About

The xiangqi engine

When you play the computer at xiangqi, the moves come from Fairy-Stockfish, running on our server rather than in your browser.

Why this one is different

Every other game here thinks inside your browser. Xiangqi cannot. The published WebAssembly build of a strong xiangqi engine needs SharedArrayBuffer, which needs page isolation headers this site does not set, and its neural network is a ten-megabyte download. We also measured what a hand-written engine could do in the same budget: depth three to four on a phone, which anyone who plays xiangqi would see in the opening. So this one runs here, and your device downloads nothing.

The engine only ever sees positions from rooms you are playing in. It is not an analysis service, and it is not told positions by the page — the server reads them from the game it is already refereeing.

What runs, exactly

  • Fairy-Stockfish, the chess-variant engine by Fabian Fichter and contributors, in the release built for xiangqi with its neural network included (xiangqi-c07e94a5c7cb).
  • It is a separate program. The site talks to it over the standard UCI text protocol and never links against it; no line of its source is part of this site.
  • Before it is installed, the downloaded binary is checked against a recorded SHA-256 digest. A binary that does not match is not installed, and the game then simply has no computer opponent.
  • Every move it proposes is put through this server's own rules before it is played. Those two rulebooks were compared across five thousand positions and agreed on every legal move in all of them.

Licences

Fairy-Stockfish is free software under the GNU General Public License, version 3. Because it runs on our server and is not handed to you, that licence asks nothing of this page; we name it because it should be named.

The evaluation network inside that build is credited to the Pikafish developers, whose own engine is also GPL-3, and whose networks are trained on data from the Pika Xiangqi Zero project, published under the Open Database License. Three separate pieces of work, named separately, because a network's provenance is not covered by the engine's licence.

The rest of QED Night is a separate work and is not covered by those licences.