9

In dobutsu shogi, the chick (Japanese pawn) promotes to a chicken (Gold general). In my experience this promotion occurs only rarely and I suspect after much blundering.

Does the chick promotion rule in dobutsu shogi really matter? That is, does the game really change if chick promotion is dropped (and chicks become stuck on the last row instead)?

By really change, I mean the classification of a position (winning, losing or drawing) changing, or the precise sequence of moves to force a win from a winning position changing materially.

6

The promotion rule actually matters a lot. With perfect play the game ends in a draw instead of a win for white/gote if you drop the promotion rule. In fact, the evaluation of all four moves in the initial position changes in this way.

I have used two independent methods to get this result in order to double-check that there is no bug in my implementations:

  1. Using an engine with alpha-beta search, namely my Stockfish fork for fairy chess variants (including shogi variants), I ran deep searches (~1h) before and after disabling the promotion rule, see the results below.
  2. Since dobutsu shogi is a solved game, there are tablebase generators for it. I have used an open-source tablebase generator and modified it to disable promotions (I am not very familiar with this code base, but since the results of the two methods are consistent, my change seems to work fine). I ran the tablebase generation with both rule sets and checked the results, which you can find below.

1. Search results

input:

setoption name multipv value 4
setoption name hash value 4096
setoption name UCI_Variant value dobutsu
position startpos
go depth 90

output with promotion rule:

info depth 90 seldepth 87 multipv 1 score mate -43 nodes 2423491649 nps 889420 hashfull 338 tbhits 0 time 2724798 pv c1c2 a4a3 c2c1 b3b2 a1b2 c4b3 C@a1 C@a2 c1c2 a2a1+ b2a1 b3c2 b1c2 a3b3 c2b1 b4a3 E@b2 a3b4 b2c1 b3a3 a1b2 a3a4 b1c2 b4c4 b2c3 a4a3 c3b2 a3a2 C@a1 a2b2 c2b2 G@b3 b2b1 E@a3 G@c2 C@c3 c2b2 c4b4 b2a2 b4a4 a2a3 a4a3 a1a2 a3b4 b1a1 G@c2 a1b1 b4c4 E@a1 b3b4 a1b2 c4b3 a2a3 b4c4 b1a1 c2c1 b2c1 b3a3 G@a2 a3b3 a2b2 b3a4 b2a2 C@a3 c1b2 a3a2 a1a2 c3c2 C@b3 E@c3 b2c3 c4c3 b3b4+ a4b4 E@b2 c3b3 a2b1 b3b2 b1b2 E@a3 b2a1 E@b2 a1b1 G@a1 b1c2 C@c3
info depth 90 seldepth 87 multipv 2 score mate -43 nodes 2423491649 nps 889420 hashfull 338 tbhits 0 time 2724798 pv b1c2 b3b2 a1b2 c4b3 c2b1 a4a3 C@a1 C@a2 c1c2 a2a1+ b2a1 b3c2 b1c2 a3b3 c2b1 b4a3 E@b2 a3b4 b2c1 b3a3 a1b2 a3a4 b1c2 b4c4 b2c3 a4a3 c3b2 a3a2 C@a1 a2b2 c2b2 G@b3 b2b1 E@a3 G@c2 C@c3 c2b2 c4b4 b2a2 b4a4 a2a3 a4a3 a1a2 a3b4 b1a1 G@c2 a1b1 b4c4 E@a1 b3b4 a1b2 c4b3 a2a3 b4c4 b1a1 c2c1 b2c1 b3a3 G@a2 a3b3 a2b2 b3a4 b2a2 C@a3 c1b2 a3a2 a1a2 c3c2 C@b3 E@c3 b2c3 c4c3 b3b4+ a4b4 E@b2 c3b3 a2b1 b3b2 b1b2 E@a3 b2a1 E@b2 a1b1 G@a1 b1c2 C@c3
info depth 90 seldepth 87 multipv 3 score mate -43 nodes 2423491649 nps 889420 hashfull 338 tbhits 0 time 2724798 pv b1a2 a4a3 a2b1 b3b2 a1b2 c4b3 C@a1 C@a2 c1c2 a2a1+ b2a1 b3c2 b1c2 a3b3 c2b1 b4a3 E@b2 a3b4 b2c1 b3a3 a1b2 a3a4 b1c2 b4c4 b2c3 a4a3 c3b2 a3a2 C@a1 a2b2 c2b2 G@b3 b2b1 E@a3 G@c2 C@c3 c2b2 c4b4 b2a2 b4a4 a2a3 a4a3 a1a2 a3b4 b1a1 G@c2 a1b1 b4c4 E@a1 b3b4 a1b2 c4b3 a2a3 b4c4 b1a1 c2c1 b2c1 b3a3 G@a2 a3b3 a2b2 b3a4 b2a2 C@a3 c1b2 a3a2 a1a2 c3c2 C@b3 E@c3 b2c3 c4c3 b3b4+ a4b4 E@b2 c3b3 a2b1 b3b2 b1b2 E@a3 b2a1 E@b2 a1b1 G@a1 b1c2 C@c3
info depth 90 seldepth 85 multipv 4 score mate -42 nodes 2423491649 nps 889420 hashfull 338 tbhits 0 time 2724798 pv b2b3 c4b3 a1b2 a4a3 C@a1 C@a2 c1c2 a2a1+ b2a1 b3c2 b1c2 a3b3 c2b1 b4a3 E@b2 a3b4 b2c1 b3a3 a1b2 a3a4 b1c2 b4c4 b2c3 a4a3 c3b2 a3a2 C@a1 a2b2 c2b2 G@b3 b2b1 E@a3 G@c2 C@c3 c2b2 c4b4 b2a2 b4a4 a2a3 a4a3 a1a2 a3b4 b1a1 G@c2 a1b1 b4c4 E@a1 b3b4 a1b2 c4b3 a2a3 b4c4 b1a1 c2c1 b2c1 b3a3 G@a2 a3b3 a2b2 b3a4 b2a2 C@a3 c1b2 a3a2 a1a2 c3c2 C@b3 E@c3 b2c3 c4c3 b3b4+ a4b4 E@b2 c3b3 a2b1 b3b2 b1b2 E@a3 b2a1 E@b2 a1b1 G@a1 b1c2 C@c3

output without promotion rule:

info depth 90 seldepth 52 multipv 1 score cp 0 nodes 2745548262 nps 965315 hashfull 244 tbhits 0 time 2844199 pv b1a2 a4a3 a2b1 b3b2 a1b2 c4b3 C@a1 b4a4 c1c2 b3c2 b1c2 G@b3 b2c3 C@c4 c3b2 a4b4 E@a2 c4c3 c2c1 b3b2 c1b2 E@b3 b2b1 b3a4 G@b2 b4c4 b1c1 a4b3 a2b3 a3b3 b2b3 c4b3 G@b2 b3c4 E@b3 c4b4 c1b1 G@a3 b3a2 b4c4 b1c1 E@a4 c1b1 a4b3 b2b3 a3b3 a2b3 c4b3 G@b2 b3b4 E@b3
info depth 90 seldepth 52 multipv 2 score cp 0 nodes 2745548262 nps 965315 hashfull 244 tbhits 0 time 2844199 pv b1c2 b3b2 a1b2 c4b3 c2b1 a4a3 C@a1 b4a4 c1c2 b3c2 b1c2 G@b3 b2c3 C@c4 c3b2 a4b4 E@a2 c4c3 c2c1 b3b2 c1b2 E@b3 b2b1 b3a4 G@b2 b4c4 b1c1 a4b3 a2b3 a3b3 b2b3 c4b3 G@b2 b3c4 E@b3 c4b4 c1b1 G@a3 b3a2 b4c4 b1c1 E@a4 c1b1 a4b3 b2b3 a3b3 a2b3 c4b3 G@b2 b3b4 E@b3
info depth 90 seldepth 50 multipv 3 score cp 0 nodes 2745548262 nps 965315 hashfull 244 tbhits 0 time 2844199 pv b2b3 c4b3 a1b2 a4a3 C@a1 b4a4 c1c2 b3c2 b1c2 G@b3 b2c3 C@c4 c3b2 a4b4 E@a2 c4c3 c2c1 b3b2 c1b2 E@b3 b2b1 b3a4 G@b2 b4c4 b1c1 a4b3 a2b3 a3b3 b2b3 c4b3 G@b2 b3c4 E@b3 c4b4 c1b1 G@a3 b3a2 b4c4 b1c1 E@a4 c1b1 a4b3 b2b3 a3b3 a2b3 c4b3 G@b2 b3b4 E@b3
info depth 90 seldepth 59 multipv 4 score cp 0 nodes 2745548262 nps 965315 hashfull 244 tbhits 0 time 2844199 pv c1c2 a4a3 c2c1 b3b2 a1b2 c4b3 C@a1 b4a4 c1c2 b3c2 b1c2 G@b3 b2c3 C@c4 c3b2 a4b4 E@a2 c4c3 c2c1 b3b2 c1b2 E@b3 b2b1 b3a4 G@b2 b4c4 b1c1 a4b3 a2b3 a3b3 b2b3 c4b3 G@b2 b3c4 E@b3 c4b4 c1b1 G@a3 b3a2 b4c4 b1c1 E@a4 c1b1 a4b3 b2b3 a3b3 a2b3 c4b3 G@b2 b3a4 E@b3 a4b4 b1c1 G@a3 b3a2 b4c4 c1b1 E@b3

See the UCI protocol description for details on the meaning of the in- and output.

2. Tablebase results

input:

show lines

output with promotion rule:

Gc4-c3 : #-78  (25.00%)
Lb4-c3 : #-78  (25.00%)
Lb4-a3 : #-78  (25.00%)
Cb3xb2 : #-76  (24.99%)

output without promotion rule:

Cb3xb2 : 0     (25.00%)
Gc4-c3 : 0     (25.00%)
Lb4-c3 : 0     (25.00%)
Lb4-a3 : 0     (25.00%)

Please note:

  • The mate distances differ for two reasons:
    • Stockfish counts the mate distance in full moves (unless you enable the USI protocol), whereas the tablebase generator counts in ply (half moves).
    • The search does not not necessarily find the shortest way to mate, whereas the tablebase result should be accurate.
  • The two softwares also use different coordinate systems to describe the squares (the ordering of ranks is inverted), so be careful not to mix them up when comparing move strings.
  • 1
    What an interesting and unexpected result! I studied that tablebase generator a bit but had not realized such a small change would accomplish my goal. Anyway, can you explain the fairy-stockfish output a bit more? (Why) does "cp 0" mean draw? – hkBst Dec 22 '18 at 12:25
  • 1
    Yes, it was surprising to me as well. Thanks for the feedback, I have added a link to the UCI protocol description. To your specific question: Yes, cp 0 means draw, since it stands for the advantage of the side to move in the unit of centipawns (1/100th of a chess pawn). – Fabian Fichter Dec 22 '18 at 12:49
1

I am now convinced that Fabian Fichter's answer is correct. The following commentary on Fabian's answer may help to convince others of the same.

1. Position that seems to be impacted by removing chick promotion

Analysing the posted results from the modified Stockfish, all games converge pretty quickly on the following position: S/-l-/ge-/-E-/-LG/cC.

$ ./dobutsu -vs900
Loading tablebase... done
1. setup S/-l-/ge-/-E-/-LG/cC
1. show board
  ABC 
 +---+
1| l | c
2|ge |
3| E |
4| LG| *C
 +---+
1. show lines
Eb3xa2 : #-72  (67.13%)
C  *a4 : #-70  (32.87%)   <---  apparently quite strong
Gc4-c3 : #-46  ( 0.00%)
C  *c2 : #-36  ( 0.00%)
C  *c1 : #-28  ( 0.00%)
Eb3-a4 : #-26  ( 0.00%)
Lb4-a4 : #-26  ( 0.00%)
C  *a1 : #-24  ( 0.00%)
C  *c3 : #-22  ( 0.00%)
C  *a3 : #-20  ( 0.00%)
Eb3-c2 : #-12  ( 0.00%)
Lb4-c3 : #-2   ( 0.00%)
Lb4-a3 : #-2   ( 0.00%)

Sente then plays C*a4, dropping their chick in the bottom left corner. I initially thought this a pretty wasteful drop but according to the table base it is actually not at all bad.

1. C  *a4
  ABC 
 +---+
1| l | *c
2|ge |
3| E |
4|CLG| 
 +---+

Now something interesting happens. The table base agrees with Stockfish that stepping the Lion to the side is a draw, but what about dropping a chick to fight a chick?

2. show lines
C  *a3 : #69   (99.57%)   <---  winning chick drop
C  *c2 : #91   ( 0.21%)
C  *c1 : #91   ( 0.21%)
C  *a1 : 0     ( 0.00%)
Ga2-a1 : 0     ( 0.00%)
Eb2-c1 : 0     ( 0.00%)
Eb2-a1 : 0     ( 0.00%)
Lb1-a1 : 0     ( 0.00%)   <---  draws the game
C  *c3 : #-28  ( 0.00%)
Lb1-c1 : #-22  ( 0.00%)
Eb2-c3 : #-20  ( 0.00%)
Eb2-a3 : #-20  ( 0.00%)
Ga2-a3 : #-18  ( 0.00%)
Lb1-c2 : #-2   ( 0.00%)
2. C  *a3
  ABC 
 +---+
1| l | 
2|ge |
3|cE |
4|CLG| *
 +---+

Now the chick on a3 is one step away from promoting and moreover would give check on promoting, which would force the Sente lion to take it. The only problem is that the best move involves losing the chick on a3 and also that we are still pretty far from a checkmate. Therefore we are going to take a bit of a short-cut, such that we lose faster, but without losing for other reasons such as giving away material needlessly.

3. show lines
Ca4xa3 : #-68  (92.84%)   <---  catches chick about to promote
Gc4-c3 : #-62  ( 7.16%)
Eb3xa2 : #-32  ( 0.00%)   <---  shortcut
Eb3-c2 : #-8   ( 0.00%)   <---  give away elephant
Lb4-c3 : #-2   ( 0.00%)   <---  stupid
Lb4xa3 : #-2   ( 0.00%)   <---  stupid
3. Eb3xa2
  ABC 
 +---+
1| l | *
2|Ee |
3|c  |
4|CLG| G
 +---+
4. show lines
Lb1xa2 : #31   (100.00%)
Lb1-c2 : #-10  ( 0.00%)
Lb1-c1 : #-6   ( 0.00%)
Lb1-a1 : #-6   ( 0.00%)
Ca3xa4+: #-2   ( 0.00%)
Eb2-c3 : #-2   ( 0.00%)
Eb2-c1 : #-2   ( 0.00%)
Eb2-a1 : #-2   ( 0.00%)
4. Lb1xa2
  ABC 
 +---+
1|   | e
2|le |
3|c  |
4|CLG| *G
 +---+

We seem to have succeeded in preserving the threat of the sacrificial promoting chick, so let's continue!

5. show lines
G  *b3 : #-30  (100.00%)
G  *a1 : #-24  ( 0.00%)
G  *c3 : #-20  ( 0.00%)
Gc4-c3 : #-18  ( 0.00%)
G  *c2 : #-14  ( 0.00%)
G  *c1 : #-10  ( 0.00%)
G  *b1 : #-10  ( 0.00%)
Ca4xa3 : #-8   ( 0.00%)
Lb4-c3 : #-2   ( 0.00%)
Lb4-b3 : #-2   ( 0.00%)
Lb4xa3 : #-2   ( 0.00%)
5. G  *b3
  ABC 
 +---+
1|   | *e
2|le |
3|cG |
4|CLG| 
 +---+
6. show lines
Ca3xa4+: #29   (100.00%)   <---  sacrificial promoting chick check
E  *c3 : #-30  ( 0.00%)
E  *c1 : #-28  ( 0.00%)
Eb2-c1 : #-28  ( 0.00%)
Eb2-a1 : #-28  ( 0.00%)
La2-b1 : #-28  ( 0.00%)
La2-a1 : #-28  ( 0.00%)
E  *c2 : #-26  ( 0.00%)
E  *a1 : #-24  ( 0.00%)
E  *b1 : #-12  ( 0.00%)
Eb2-c3 : #-12  ( 0.00%)
La2xb3 : #-2   ( 0.00%)

And there it is, the sacrificial promoting chick as the best move! Let's see what happens.

6. Ca3xa4+:
  ABC 
 +---+
1|   | ce
2|le |
3| G |
4|rLG| *
 +---+
7. show lines
Lb4xa4 : #-28  (100.00%)   <---  take chick (forced if promoted)
Gc4-c3 : #-2   ( 0.00%)
Gb3-c3 : #-2   ( 0.00%)
Gb3-a3 : #-2   ( 0.00%)
Gb3xb2 : #-2   ( 0.00%)
Lb4-c3 : #-2   ( 0.00%)
Lb4-a3 : #-2   ( 0.00%)

Now let's see what happens if we change that rooster to a chick:

7. setup S/---/le-/-G-/cLG/ec
1. show board
  ABC 
 +---+
1|   | ce
2|le |
3| G |
4|cLG| *
 +---+
1. show lines
Gc4-c3 : #-90  (100.00%)
Gb3xb2 : #-30  ( 0.00%)
Lb4xa4 : #-28  ( 0.00%)
Gb3-c3 : #-10  ( 0.00%)
Gb3-a3 : #-8   ( 0.00%)
Lb4-c3 : #-2   ( 0.00%)
Lb4-a3 : #-2   ( 0.00%)

In this position the best move puts checkmate 88 (90-2) moves away, which is further away from checkmate than the starting position, making it plausible that when analysed it will lead to another position that without promoting chick power is suddenly much further from mate than before (ad infinitum). If true that would make position G/---/le-/cG-/CLG/e (see below) a draw instead of a win without chick promotion.

  ABC 
 +---+
1|   | *e
2|le |
3|cG |
4|CLG| 
 +---+

2. Correctness of exhaustive search

Assuming that the used table base generator is a correct exhaustive search, it seems that Fabian's patch should succeed in disabling chick promotions as file moves.c is the only place that POS_FLAGS is used (except for a use in validation.c to check position structs) and indeed seems purpose-built to disable promotions.

/* clear promotion bits for pieces that can't be promoted */
status &= POS_FLAGS;

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.