fairy-stockfish / Fairy-Stockfish

chess variant engine supporting Xiangqi, Shogi, Janggi, Makruk, S-Chess, Crazyhouse, Bughouse, and many more
https://fairy-stockfish.github.io/
GNU General Public License v3.0
603 stars 189 forks source link

Janggi errors #610

Closed cab101 closed 1 year ago

cab101 commented 1 year ago

Originally pass_on_stalemate() was used for janggi. https://github.com/fairy-stockfish/Fairy-Stockfish/commit/7952fae1a9a59d7168f5ca8340ebbdd9b40d1276#diff-2a523082b4e3a1ee6185d1d1fc07c2ad9199c5069453917a860c1cd94c8f34e4R350 https://github.com/fairy-stockfish/Fairy-Stockfish/commit/7952fae1a9a59d7168f5ca8340ebbdd9b40d1276#diff-1d066214056be2b8958a2a2143c121d339937f753cdd7b5361cf1cece354480dR877

but now https://github.com/fairy-stockfish/Fairy-Stockfish/blob/master/src/position.cpp#L1070 use it https://github.com/fairy-stockfish/Fairy-Stockfish/blob/master/src/movegen.cpp#L446 use pass()

May be pass_on_stalemate() is obsolete?

ianfab commented 1 year ago

I am not sure I understand what you mean. If you think there is a bug, please specify exact commands how to reproduce it. And if there is a working feature you don't need, just ignore it.

cab101 commented 1 year ago

_uci setoption name UCIVariant value janggi position startpos moves e2e2 e9e9 go

debug Fen: rnba1abnr/4k4/1c5c1/p1p1p1p1p/9/9/P1P1P1P1P/1C5C1/4K4/RNBA1ABNR w - - 2 2

Both e2e2 and e9e9 (use for pass) are illegal. Replacing pass_on_stalemate() -> pass() in position.cpp fix it.

Also, could you tell me when the release will be?

ianfab commented 1 year ago

Thanks for the example. I don't exactly understand the problem though, as both passing moves are legal and Fairy-SF correctly handles that, and after the two passing moves the game is over and is adjudicated by point scoring. So from my perspective everything there is working as expected. If your point is that in your opinion the rule implementation should be different, that is nothing that I can address, since this ruleset is the consensus regarding janggi tournament rules we arrived at after long discussion with many people, including pro players, and this ruleset is stable in Fairy-SF for several years now, so it would require an extraordinary level of evidence to the contrary to change this.