-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cutechess/fishtest issued Illegal PV warnings for Shogi #18
Comments
Thanks for reporting. The fourfold adjudication looks correct, and perhaps cutechess treats any move in the PV after a fourfold repetition as illegal (whereas in SF play can theoretically continue). I think it probably is not an issue and might just be related to how SF creates the PV line from the TT, but I will need to check in more detail to confirm that it really is not an issue. |
I think this is more of a cutechess issue. I cannot see anything wrong with stockfish. |
Okay, it is what @ianfab said: The PV extends past the 4-fold repetition. Giving check +Rh8 (i8h8) would then be an illegal perpetual. |
Thanks for investigating! This also appears to be the same issue, although cutechess adjudicated a result this time around. They're repeating the exchange of Golds on d8 at the end. Sorry about the long output :D but I guess otherwise I would have missed those warnings were they shorter.
And the game in question:
|
This looks more problematic as cutechess and Fairy-Stockfish seem to disagree on the rules here. I suspect the definition of perpetual check might differ. In Fairy-Stockfish a perpetual check is defined as a (fourfold) repetition of a position where all moves of one side between the occurences of the positions were checks. This to my understanding is in line with the FESA rules, see articles 3.12 and 5.2.
|
@notruck : Thank you for reporting this new problem. @ianfab : Thank you for the clarification. Indeed, cutechess needs to check whether the sequence of checks is continuous, FESA rules 5.2. I did not have a copy of the FESA rules yet. I will try to come up with a patch for cutechess as soon as possible. |
Dobutsu is generating a lot of warnings. I have only partial logs as the output is so copious this time. Searching for the "Finished game x" string, many games ended with an illegal move: (none).
|
I also came across another type of issue, with invalid FENs:
|
The pgn: |
Thanks, in the PGN I identified a couple of issues. From my perspective only for the first one it is unclear whether the issue is in Fairy-Stockfish or cutechess, since most phrasings of the rules are not very clear on that. The other ones to me look like bugs in cutechess. @alwey Can you please have a look?
|
The rules from second sources are not quite clear. The official rules say that a Chick promotes moving onto the final rank: When implementing this I used the Google translations to English and to German of the official rules page and found no problem here. From the Google translation of the official rules page
...
I think in this case cutechess is right, because in Dobutsu Shogi the Lion may expose itself to attack and can move to b2 or capture on c2 in round 1 and the Lion has 4 moves in round 5.
For the same reason there is no stalemate, so in round 58 the Lion has 5 moves. From the original rules page and Google translation:
-- Now for some cutechess errors:
Round 35: This is a cutechess error. I forgot this. I will change the code so that the Chick can be dropped onto the highest rank.
Rounds 42 and 59: Cutechess errors. This also slipped through when I implemented DobutsuBoard: There is no "nifu" rule in Dobutsu Shogi, so two Chicks of the same colour are allowed to be on the same file. I will change this. I found an additional weakness in cutechess: When the opponent can catch a Lion that reached the farthest rank but fails to do so the game is only adjudicated late. The winning side has to make a superfluous move with some piece without removing the Lion from the farthest rank. So I have some work to do. EDIT: I found the "mate by Pawn drop is forbidden" (uchi-fu-zume) rule active in cutechess, which is also a problem. |
I just found videos about Dobutsu Shogi on youtube. The first video by account "Dobutsu Shogi" gives an introduction to the rules. There are equivalent videos in other languages. A second video showis the implementation of the game on a N* console. At 1:22 you will find the chick promotion to chicken. At 1:42 Sky Team's Lion exposes himself to attack by Land Team's Lion and Land Team's Giraffe. The latter captures the Lion - game over. At 2:05 the rule of the Lion winning (or losing if captured immediately) on the far rank is shown. Manuals ,e .g. https://www.shogi.cz/en/manual/dobutsuDE.pdf, https://www.shogi.cz/en/manual/dobutsuEN.pdf, https://www.shogi.cz/en/manual/dobutsuES.pdf, https://www.shogi.cz/en/manual/dobutsuFR.pdf, https://www.shogi.cz/en/manual/dobutsuIT.pdf, https://www.shogi.cz/en/manual/dobutsuPL.pdf |
In the example given above,,
cutechess has problems because it uses a wrong symbol, In general, some problems with FEN and Shogi variants may root in cutechess' s FEN "lnsgkgsnl/1r5b1/ppppppppp/9/9/9/PPPPPPPPP/1B5R1/LNSGKGSNL[-] w - 1" The |
Updated cutechess/cutechess#615 with new fixes: |
Thanks for the clarifications! Regarding promotion my main reason to assume them to be optional was that it is allowed to drop chicks on the last rank. I still find the phrasing slightly ambiguous, but I will check how other dobutsu shogi software handles. I was not aware of the rule that the lion can be moved into check. However, this is not very critical in practice as the game result will always be the same just ending two ply earlier/later, but I will see if this can easily be implemented (e.g., regarding the farthest rank win rule). If this is also implemented in the tablebase solvers, it might explain though why Fairy-Stockfish disagrees on the mate distance. |
The chick can be dropped onto the last rank but can do nothing. So the rules are simpler. Indeed, then one would logically say that a chick may go to the last rank and stay unpromoted if there were no rule against. Dobutsu Shogi was introduced to get young children into Shogi. Check and mate are missing from this game. The next stage, Goro-Goro Dobutsu Shogi has a bigger board (5x6), more piece types, and introduces the concept of check and checkmate. It also forbids two Chicks in a file ("nifu") and dropping a Chick on the last rank. The third stage of the game is full Shogi with animal pieces (Dobutsu Shogi in the Greenwood). |
The corner case of a lion moving to the last rank into check will perhaps be problematic, and considering that it does not have much of an impact on game play (or rather it saves pychess users from playing out two useless ply), it does not have a very high priority for me. To keep track of it, I filed it as fairy-stockfish/Fairy-Stockfish#191. |
The vast majority of Shogi (and shogi-family) games complete without any warning, but this one game (round 87) issued quite a bunch.
In particular, it really seems to dislike this
i8h8
move. The log below is unedited and copied verbatim:The game itself is relatively short, eventually ending in a 4-fold repetition.
The text was updated successfully, but these errors were encountered: