My practicing Web site, powered by MODX

This is summary field

Feed from adachis wp blog using simplepie

  • The blog section of Shogishack.net was moved to https://blog.shogishack.net.
    This page will be no longer updated and the site will be eventually closed. Please go here
  • Shogi maze re-imaged
    In 2010, I was contacted by members of Shogi France. One of their active members has just created a shogi site with a page that showed variety of opening moves. They offered to include the content in our site as this will nicely compliment with our site pages that explains what piece to move first. […]
  • Using real Shogi pieces
    Many of the Shogi fans overseas are probably using Online platform to enjoy Shogi, because Shogi fans are few and apart from each other. You may have never touched actual shogi pieces. In Japan, there are Shogi dojos in many places where people play against each other using actual Shogi pieces. The YouTube video here […]
  • Feed from adachis wp blog using simplepie

  • Vibe Codingで将棋のUSI通信を行うAPIサーバーを作ってみた。
    以前のブログに将棋の盤面を渡して、最適手筋をかえしてくれるようなAPIのサービスがあったらありがたいと書いた。 実際にオンラインでコンピューター将棋を実現しているサイトはどんな手段をつかっているのだろうか? ネットでいろいろ見聞きしてみて大まかに二つの方法があるらしいことが分かってきた。 一つはクライエントUIから盤面情報を送り、それに基づいて、指し手を供給するサーバーを使う方法。 もう一つはブラウザーに将棋エンジンの実行コードを送ってしまい、ブラウザー上で将棋エンジンを実行させてしまう方法。 どちらも一長一短がありそうだ。 サーバーにやねうら王のような本来一つの入出力で動作するエンジンを常駐させて、ここからhtttpリクエストにこたえる方法ではhttp接続のクライエントが複数になることを考えると、position と go コマンドをセットにして処理する必要がある。 それにgameover などのコマンドは意味をなさなくなる。本当に多数のマルチクライエントに対応するためにはロードバランサーの背後にいくつものサーバーインスタンスを置くことになるのだろう。自分の能力も予算も超えてしまうのである。 一方のブラウザーで将棋エンジンを実行させてしまうというのは、何なの?と思うかもしれないが、要はブラウザに実装されるJavaScriptのエンジンで将棋AIを走らせましょう、ということである。 JavaScriptのマシン語とも言えるWeb Assemblyというバイナリーを実行することができる。 専用のコンパイラがあり、C++やRUSTのソースコードからWASMモジュールへのコンパイルが可能なTool Chainが存在する。 実際にYaneuraouのソースコードにはWASMをコンパイルするためのScriptもメンテナンスされている。YaneuraouのWASMmodule自体は圧縮すれば300キロバイト以下のようで、これにnn.binを追加しても今の一般のネット環境ではサイズ的は気にしなくてもよさそうだ。あまり大きなペタショックのような定跡ファイルを転送するのはさすがに憚る。性能はブラウザが走るデバイスによるところが大きそうだ。 liShogiのサイトでは用途に応じて両方を使っているっぽいのである。この将棋サイトはソースコードがGithubで公開されていて、眺めていると面白い。 実際にどんな使い心地なのか自分でもためしてみたかったので、まずはブラウザ上でWasmエンジンとお話できるコンソール的なものを作ってみた。 このときはじめてAIにコーディングを本格的に手伝ってもらった。使ったのはBrave blowserについているLeoというAgentだが、用途に応じてAIエンジンが切れ変わっていた。コーディングにはAntrhopicのHaikuを使っていた模様。 この時は自分で書いたオリジナルコードをAIに確認してもらい、機能の追加や、モジュール化、その他云々を生成してもらった。 一応Proof of Conceptだったので、コンソール上でコマンドを送り、それに対して解答をもらうようなところまで確認できたところで終了。、 いつかはこれをもとに将棋盤を描画するWeb UIも作ってみようと思うわけである。 ソースコードはこちら。 で、昨日ふと、サーバーサイドでエンジンを動かすほうもコンセプトだけでも試してみたくなり、 今回プログラムを書くにあたって、最初からAIに書かせることにした。人間側は指示だけしてAIがコード生成しながらプログラムを仕上げていくのをVibe Codingというのだそうである。 という訳で自分はプロジェクトのコンセプトだけ考えてテキストに書きだし、これをAIに提出してコード生成をお願いしてみた。 テキスト内容はこちら。   Shogi API server. Use nodejs expressjs framework.  We will add authentication and security through middleware in the future. the server need to communicate with executable binary on the server.  It’s default path should be ./engine/engine but should be able to be configured through environmental variable process.env.  for that we will include dotenv library as well. node process should be spawning binary and connect to stdin/stdout. engine uses USI protocol.   If unfamiliar with USI protocol,  I will provide the spec. write source code in typescript for easy maintenance. … Continue reading
  • This site's iformation using simple snippet

    Site information

    Document information

    ← LoginMember Login →