Two ways to be strong

Pikafish is built for speed. It looks at more than a million positions a second and judges each one by rules written by hand. AB-JChess is built from Pikafish too, but it judges positions with a neural network trained on about a billion jieqi positions. It looks at about fifty times fewer positions, and understands each one better. Its training code is public in the same repository, under abjchess-nnue-pytorch.

Where the edge comes from

Each engine reported a score with every move it played in the match, and when the two disagreed, AB-JChess was usually the one that was right. In 137 games there came a point where AB-JChess gave itself 75% or more while Pikafish, on the move before or after, gave AB-JChess 60% or less. AB-JChess won 115 of those games, lost 13 and drew 9. The other way round, Pikafish at 75% or more for itself while AB-JChess gave it 60% or less, happened in 202 games, and Pikafish won 101 of them, lost 90 and drew 11. These are the numbers Pikafish reported during the match, with the reveal bug we have since fixed.

Here are two of AB-JChess's wins, both as Red, where its score climbed while Pikafish's stayed level. We scored every position again with both engines, AB-JChess searching 1 million positions and the fixed Pikafish 64 million, and turned each engine's numbers into an expected score with a curve fitted on the match. Each chart shows AB-JChess's score as each engine saw it, with moves numbered as on the board below it. On the boards, ?! marks a Pikafish move that cost 5 to 10 points by AB-JChess's count; neither game has a worse one.

Game 68: two advisors and an elephant, for an attack

Pikafish, as Black, took a face-down advisor with its chariot on move 11, then sent the horse that came up on b1 into Red's camp, where it took the second advisor and an elephant. AB-JChess spent those moves bringing a chariot, a horse and a soldier near Black's king. From move 13 to move 21, AB-JChess never had Red below 69%; Pikafish, searching the same positions, had Red between 40% and 58%.

On move 18 the horse took the elephant on c1. AB-JChess had Red at 85%; Pikafish had Red at 50%, and during the game it had reported 47%. Red's elephant took the horse on move 20. Pikafish's own score for Red reached 85% on move 21, when the piece it turned over on b10 came up a soldier.

Game 6: one chariot against a face-down back row

In game 6 AB-JChess took an advisor with its chariot on move 15 and let the chariots come off. After move 16 Red had the only chariot on the board, and the seven pieces Black had not turned over could only be five soldiers and two horses. AB-JChess had Red at 83%; Pikafish had Red at 48%.

Red's chariot reached Black's back row on move 19 and took two horses there. AB-JChess had Red above 80% from move 17, Pikafish from move 21.

What a longer search says

We searched each of the five marked moves again, the game move and AB-JChess's choice each on its own: AB-JChess at 4 million positions, the fixed Pikafish at 256 million. AB-JChess still puts two of them 5 points or more below its choice and the other three within 2 points. Pikafish prefers AB-JChess's choice once and its own game move four times. So the single moves are close calls. The gap is in the scores the two engines give the positions, and in both games Pikafish's own score came round to AB-JChess's later: on move 23 rather than 18 in game 68, and on move 21 rather than 17 in game 6. The study shows both engines' numbers at every marked move.

Where it sits

AB-JChess is at the top of the jieqi bot list, above Level 8. Levels 1 to 8 stay Pikafish, and a new player starts at Level 2. It does not take a level number: the top place holds the strongest jieqi engine we have measured, under its own name. Its rating on the bots page, 2354 against Level 8's 2226, comes from the same bot-against-bot games that rate the levels. Its authors are training stronger networks; when one is released, we will play it against this one and switch if it wins.

While writing this post we found a bug in how our Pikafish bot scored reveals. It is fixed; a follow-up post covers what it was and what it cost.

Thanks

AB-JChess is open source under the GPL-3.0 licence, at github.com/lxsgx23/AB-JChess. Its authors let us use the engine and its network on Mistboard. The network is downloaded from their own release each time we build the site, never re-hosted. Thank you, Huorongrong and Laoxu.

Play AB-JChessJieqi rules