Auditing 172 Xiangqi Compositions
In short
- I ran an exhaustive solver over 172 continuous-check compositions from 適情雅趣 (1570), 渊深海阔 (1808) and 烂柯神机, asking whether the printed solution is the only one. 45 are clean.
- No composition fails outright: every one wins for the side the book says wins. The faults are about uniqueness: a second key move (what problemists call a cook), a second winning continuation, a faster mate than the one printed.
- Nine records don’t hold as typed. A defence the book never gives leaves Red with no continuous-check mate. Whether the fault is in the book or the copy is open; in 第217局 one black chariot accounts for it.
- The audit was wrong three times before it was right: it searched from the wrong side, judged 排局 by chess-problem rules, and read mistyped records as broken compositions.
The problem
A classical xiangqi composition comes with a printed solution and a verdict, usually 红先胜, Red plays and wins. What the books do not tell you is whether that solution is the only one, and that is the whole of what makes a composition good or broken. A second first move that also wins is a fault. A second winning continuation buried in the tree is a fault. A mate two moves faster than the printed one is a fault.
An engine cannot answer any of those. It reports that Red is winning, which was never in doubt; uniqueness is a statement about every legal alternative, and that needs a proof, not an evaluation.
The solver
Exhaustive AND/OR search over the rules the site already plays with, so the legality of a move in the audit is the same legality a player gets in a game: the flying general, the elephant’s blocked eye, the horse’s blocked leg, 困毙 counted as a loss.
For a continuous-check composition, “sound” means three things at once. The book’s first move is the only one that mates in the recorded number of moves. No line inside the tree gives Red a second winning continuation. No mate is available faster than the printed one. The search proves all three or the problem carries a fault.
Short problems finish in seconds. A solution of nine to thirteen plies is small enough to exhaust; past that the tree stops being searchable this way, which is why the audit is 172 problems and not 2,388.
The results
| count | |
|---|---|
| Compositions audited | 172 |
| Sound: unique key, no dual, nothing faster | 45 |
| Carrying a dual, a second winning continuation | 58 |
| Carrying a second key move | 13 |
| Mate available faster than printed | 9 |
| Win available but longer than printed | 21 |
| Unsound, no win at all | 0 |
A problem can carry more than one fault, so the rows do not sum. The headline is the last row: the books hold up. Where they fail they fail at uniqueness, which is a judging standard that postdates most of these compositions by centuries. The 21 longer wins are the book getting its own length wrong: Black has a defence the printed line never meets, and Red still mates, only later than the book says.
One of each, with the book’s line as the mainline and the fault as a branch at the move where it happens.
A dual. 群鼠争穴, from 適情雅趣 (1570). At Red’s sixth move the book plays He6+, and Hc6+ mates just as fast.
A second key. 妙振兵铃, from the same book. It opens Rh10+ and mates in six. So does Pd10+.
A faster mate. 争舟走渡, also 適情雅趣. The book prints a mate in seven, and Pxe9+ mates in six.
Separately, 34 records are flagged as corrupt rather than faulty, meaning the diagram as typed does not support the claim printed beside it. Ten of those claim mate by continuous checks, and nine are refuted inside the book’s own line. This is the clearest one, from 渊深海阔 (1808): the record gives 士6进5 at Black’s fourth move, and 车5退8 instead leaves Red without a single legal check.
Three wrong audits
The side to move. The first quiet-move audit searched the position after the key as though Red were to play twice. It reported 190 compositions sound, I believed it for an afternoon, and the number was meaningless. A cooperative or adversarial search that starts on the wrong side answers a different question perfectly.
The stipulation. I treated every composition as a mate in n. A quiet 排局 does not claim that. It claims 红先胜, Red plays and wins, and against that claim a second key move is not a fault and a faster mate is not a fault. Half the faults I had counted were not faults, because I had imported the chess problem convention along with the solver that checks it.
Both of those were in the audit of the quiet compositions, which I shelved: a quiet problem runs past twenty plies, and the exhaustive search that settles a nine-ply problem does not finish there. The 172 above are all continuous-check problems, where the length is part of what the book claims.
Exact search without an engine screen. An exhaustive search that finds no forced mate looks identical whether the composition is broken or the record is mistyped, and I read eight of them as unsound. Five were fine: Red wins, later than the printed line. Three were corrupt records. One engine evaluation at the root separates the two cases in seconds, so the engine screen now runs first, on a search whose whole point was not needing an engine.
There was a fourth, in a different lane, and it is the same mistake. My helpmate composer tested its problems for checkmate. Xiangqi also kills a general that has no legal move, so a line ending in 困毙 is a second solution, and 22 of 186 problems I had published as sound had lines the composer could not see. One had ten of them.
What this cost and what it bought
Four bugs, and every one of them was a rule I knew perfectly well and had not carried into the tool. The solver was right each time. The question it was asked was wrong.
What it bought is a corpus with its faults labelled, nine records whose printed lines do not hold, and a repair search that names the piece: in 第217局, of 154 single-piece edits to the diagram, the four that restore the book’s solution all concern the same black chariot on e2, and with a soldier on that square the printed line works. I sent the board and the line to the person who maintains the records, in Chinese. His answer was that the old manuals have errors (古谱就有错呀), so whether the chariot is the book’s mistake or the copy’s is still open.
The full record is a study you can play through: sound compositions, each kind of fault, three corrupt records, and 第217局 with the move that breaks it. If you have a printed edition of 渊深海阔, the square in question is e2, and I would like to know what it says.