Page 3 of 3

Re: Shogi Perft numbers

Posted: Sat Aug 24, 2019 9:25 am
by hgm
Patrice Duhamel wrote:
Sat Aug 24, 2019 9:23 am
What GUI are using USI protocol ?
Shogidogoro, BCM Games and gShogi. And perhaps Tagua.

Re: Shogi Perft numbers

Posted: Sat Aug 24, 2019 10:33 am
by Ferdy
Patrice Duhamel wrote:
Sat Aug 24, 2019 9:23 am
What GUI are using USI protocol ?
There is also ShogiGui, and of course Winboard.

Re: Shogi Perft numbers

Posted: Tue Sep 03, 2019 11:08 pm
by IanO
I've never concerned myself with perft in my game programs before, but is it supposed to detect checkmates in order to avoid playing past fools mates? I was wondering if

Code: Select all

perft 7
could be used to enumerate all the shortest mates in shogi.

Re: Shogi Perft numbers

Posted: Wed Sep 04, 2019 6:55 am
by hgm
Sure. Perft only considers legal moves, so it cannot calculate past stalemate or checkmate. It does calculate past 3-fold reps, though.

Re: Shogi Perft numbers

Posted: Wed Sep 04, 2019 4:34 pm
by Patrice Duhamel
IanO wrote:
Tue Sep 03, 2019 11:08 pm
I've never concerned myself with perft in my game programs before, but is it supposed to detect checkmates in order to avoid playing past fools mates? I was wondering if

Code: Select all

perft 7
could be used to enumerate all the shortest mates in shogi.
There are 29 mate positions at depth 7 :

Code: Select all

nodes = 15 086 269 607 
Captures = 156 289 904 
Promotions = 78 496 954 
Drops = 22 189 844 
Checks = 79 636 812 
Mates = 29

Re: Shogi Perft numbers

Posted: Mon Sep 09, 2019 9:32 pm
by IanO
Patrice Duhamel wrote:
Wed Sep 04, 2019 4:34 pm
IanO wrote:
Tue Sep 03, 2019 11:08 pm
I've never concerned myself with perft in my game programs before, but is it supposed to detect checkmates in order to avoid playing past fools mates? I was wondering if

Code: Select all

perft 7
could be used to enumerate all the shortest mates in shogi.
There are 29 mate positions at depth 7 :

Code: Select all

nodes = 15 086 269 607 
Captures = 156 289 904 
Promotions = 78 496 954 
Drops = 22 189 844 
Checks = 79 636 812 
Mates = 29
Thanks! Those stats were perfect for verifying the shogi perft I wrote this weekend. Turns out there are 11 unique 7-move mate positions in shogi, expressing 6 themes:













The 29 transpositions and 5 other mate positions are left as an exercise for the reader. :)

(The fairy FEN support here doesn't support the "+P" style of indicating promoted pieces as in SFEN. I've used 'W' for promoted pawn (same as for gold general) and 'Q' for promoted bishop.)

Re: Shogi Perft numbers

Posted: Tue Sep 10, 2019 10:57 am
by hgm

Yeah, sorry about that. The diagram script still needs some work for the support of fairy pieces, which I so far postponed. For one, I would like to support all XBoard pieces, of which there are now 66, and obvioulsy 1-letter encoding will fail. The symbols XBoard's default theme uses for Shogi Horse and Dragon are currently available as I and J, but I don't think the Gold-like symbols for promoted P, N, L, S can currently be selected.

Of course +P, +N, +L and +S would be obvious choices for their two-character IDs, and +B, +R would be preferable over I, J. To further expand the set I was thinking of punctuation suffixes on the letters, like L', L`, L" or L!

Re: Shogi Perft numbers

Posted: Tue Sep 10, 2019 4:42 pm
by Patrice Duhamel
hgm wrote:
Tue Sep 10, 2019 10:57 am
Why "Black" and "White" are inverted in Winboard ?
In others GUI Black is the first player.

Code: Select all

Winboard :
lns3snl/1rgkG+B1b1/pppppp1pp/9/9/2P6/PP1PPPPPP/7R1/LNSGKGSNL[P] b 0 4

ShogiGUI or BCMGames :
lns3snl/1rgkG+B1b1/pppppp1pp/9/9/2P6/PP1PPPPPP/7R1/LNSGKGSNL w P 8

Re: Shogi Perft numbers

Posted: Tue Sep 10, 2019 5:46 pm
by hgm
In other Chess variants white is first player.

WinBoard uses ordinary FEN as part of CECP. ShogiGUI and BCMgames uses the incompatible SFEN as part of USI.