Xiangqi endgames, solved
With few pieces left, xiangqi is small enough to work out completely. We ran every legal position of these endgames through the rules engine used on this site and traced each one back from checkmate. The tables below are the results, so you can decide whether to trade down before you do it.
How to read the tables
- Wins is the share of positions the stronger side wins with best play, when it is that side's turn. A random placement counts the same as a sensible one.
- Longest is the number of the stronger side's moves needed from the hardest position, against the longest defence. A dash means there is no forced win to measure.
- Not counted: the repetition rule and the hundred-move draw. A share below 100% means the rest cannot be forced to mate on the board, and the longest wins here are well under the limit.
We also compared 625 sampled positions with Pikafish, a strong open-source engine. Win or draw and mate length agreed on all of them.
Against a lone general
| Stronger side has | Wins | Longest |
|---|---|---|
| Chariot | 100% | 2 |
| Horse | 100% | 7 |
| Cannon | 0% | — |
| Soldier | 84.7% | 10 |
| Cannon + advisor | 100% | 9 |
| Cannon + elephant | 0% | — |
| Cannon + soldier | 84.7% | 10 |
| Two soldiers | 97.8% | 10 |
A chariot finishes almost at once, since no position needs more than two moves. Your own general does half the work by closing a file.
f8 covers e8 and f9, and Red's general closes the d-file. Having no legal move loses the game.A cannon alone cannot win, not from a single position. Add an advisor and every position becomes a win. An elephant does not do the same job: cannon and elephant win none of them. Our guess at the reason is that a cannon needs a screen to give check, and the advisor can provide one close to the palace.
Keep your soldier off the last rank
The 84.7% for a lone soldier hides a sharp rule: a soldier anywhere but the last rank always wins, and a soldier on the last rank never does. It wins from all 2,394 positions on the other ranks, including from its own side of the river, and from none of the 432 on the last rank.
Soldiers cannot go backward, so this is the most expensive mistake in the small endgames. When you are winning with a soldier, do not hurry it forward. Two soldiers win far more often, and they mate side by side.
e8 gives check. The soldier on f8 protects it and guards f9, and Red's general closes the d-file.Against defenders
| Attacker vs defenders | Wins | Longest |
|---|---|---|
| Chariot vs advisor | 100% | 5 |
| Chariot vs elephant | 100% | 6 |
| Chariot vs two advisors | 100% | 10 |
| Chariot vs two elephants | 100% | 12 |
| Chariot vs advisor + elephant | 100% | 8 |
| Horse vs advisor | 99.7% | 19 |
| Horse vs elephant | 24.1% | 16 |
| Horse vs two advisors | 7.3% | 22 |
| Horse vs advisor + elephant | 9.1% | 22 |
| Horse vs two elephants | 0.5% | 15 |
| Soldier vs advisor | 8.4% | 7 |
| Soldier vs elephant | 3.5% | 7 |
A chariot beat every defence of up to two pieces in this table. A horse is a different story: one advisor almost always falls, but one elephant holds in about three positions out of four, and a pair of defenders usually holds.
The tables stop at three pieces besides the generals, so they do not cover a chariot against a full set of advisors and elephants.
What to do with this
- Before trading into a cannon endgame, check you still have an advisor. Without one, the cannon cannot finish.
- Against a horse, keep two defenders if you can. One advisor almost always loses, while two defenders usually hold.
- Count the soldier's rank before you push. One step too many turns a sure win into a draw.
You can play these out against the computer or test yourself on endgame puzzles. The mates they end in are in checkmate patterns.
