Tony Hecker posts some perft numbers on his website ( http://tonyjh.com/chess/technical/ ). So I suppose TJshogi / TJxiangqi do contain a perft function. I have no idea how it could be activated, though.
I vaguely recall Ilari Pihlajisto did make a dedicated perft utility that could also do Shogi and Xiangqi.
I guess in general it should need some additional specification as to what 'perft' means in these variants, in relation to repetitions and checks. In Chess perft does ignore repetitions, which is justified, because FIDE rules do not define these as a forced game termination, but just as a claim possibility. But in Shogi and Xiangqi perpetual checking is forbidden (and in the latter a whole lot more), so that continuing it at some point would be an illegal move. In Shogi it is not completely clear whether the game ends at checkmate or at King capture. Unlike Chess, where illegal moves have to be taken back, and the game then continues, illegal moves in Shogi forfeit the game. This makes it a moot point whether you lose because the King is captured, or because you exposed it to capture.
SjaakII has a perft command, just run it as a terminal application.
Perft results for Shogi and Xiangqi (and others) are here: http://www.eglebbk.dds.nl/program/chess-perft.html, though not as deep as the ones you listed. It has some test positions that are checked when you run "test movegen", you can find them in xboard.c
The game is taken to end on checkmate, repetitions receive no special treatment (in general, anything that requires search or game history to determine whether it is illegal or not is assumed to be legal; come to think of it, that probably means it's quite happy to count checkmate by pawn drop as legal in Shogi).
Patrice Duhamel wrote:I made move generation for Xiangqi and Shogi, I'm looking for engines with a perft option or other results
for usefull positions.
My results :
Xiangqi : rheakaehr/9/1c5c1/p1p1p1p1p/9/9/P1P1P1P1P/1C5C1/9/RHEAKAEHR r
lnsgkgsnl/1r5b1/ppppppppp/9/9/9/PPPPPPPPP/1B5R1/LNSGKGSNL[-] w
perft 6
9 l n s g k g s n l
8 . r . . . . . b .
7 p p p p p p p p p
6 . . . . . . . . .
5 . . . . . . . . .
4 . . . . . . . . .
3 P P P P P P P P P
2 . B . . . . . R .
1 L N S G K G S N L
a b c d e f g h i
a3a4 - 24243519
b3b4 - 19907745
c3c4 - 29957753
d3d4 - 19852453
e3e4 - 20084010
f3f4 - 20068603
g3g4 - 21454558
h3h4 - 21077049
i3i4 - 22670449
a1a2 - 19908353
i1i2 - 17192943
c1c2 - 17752452
c1d2 - 16694739
g1f2 - 13675365
g1g2 - 12555151
d1c2 - 16472699
d1d2 - 16734160
d1e2 - 14474297
f1e2 - 14618238
f1f2 - 14732208
f1g2 - 12534398
h2g2 - 18971676
h2f2 - 17938641
h2e2 - 17868556
h2d2 - 17615109
h2c2 - 18388324
h2i2 - 19697773
e1e2 - 16972039
e1d2 - 17808729
e1f2 - 15659528
Perft 6 Summary
Nodes: 547581517
Time: 116.68 sec
Nodes/sec: 4693060
Thanks, I will try Sjaak II with custom positions.
Evert wrote:
The game is taken to end on checkmate, repetitions receive no special treatment (in general, anything that requires search or game history to determine whether it is illegal or not is assumed to be legal; come to think of it, that probably means it's quite happy to count checkmate by pawn drop as legal in Shogi).
I'm not sure to understand the problem ?
I count the mate from a pawn drop as illegal.
Patrice Duhamel wrote:
I'm not sure to understand the problem ?
I count the mate from a pawn drop as illegal.
It is illegal, of course, but SjaakII's perft function doesn't know this. It's very simple and basic, simply skipping positions where the other side was left in check as illegal.
During game play, illegal pawn drops are caught by the search: if the current position is mate and the last move was a pawn drop, it returns an "ILLEGAL" score rather than a "MATE" score, which is caught and handled one level up. The perft function doesn't do this check, so it actually returns the wrong number if the tree contains a mate by pawn-drop.
There's more it doesn't check: it doesn't know to end the game after three checks in "three-check" either, as mentioned it doesn't consider chases in XiangQi and it doesn't handle the special mating rules of Shatar. I suppose I could fix all those, but it hasn't been high on my list of priorities...
In Shokidoki I do not consider Pawn-drop mates as illegal but as moves that lose. This is just a score correction similar to the stalemate correction in Chess. In the latter case you correct the score of a no-legal-moves position (which naturally would be -INF) to zero if you are not in check, in the former case you correct it to +INF if the move leading to it was a Pawn drop.