Closed jdart1 closed 1 year ago
This could be an issue in python-chess. The correct way to do move filtering is to rank the moves (using dtz if possible, otherwise wdl), taking into account repetition status: see https://github.com/jdart1/arasan-chess/blob/master/src/syzygy.cpp. And then select only moves that are not less in rank than the highest-ranked move: see RootMoveGenerator::filter (https://github.com/jdart1/arasan-chess/blob/master/src/movegen.cpp).
Can you test the linked PR (#831) and confirm if this fixes the problem?
This is a rarely occurring problem in game play, so I can test it but may not succeed in validating the fix. I think this would be better validated through some kind of unit test.
It fixes it in this specific situation. For fen 1r6/3P4/2k5/8/8/4K3/8/8 b - - 18 88
:
Before:
(Move.from_uci('c6d6'), 2) # Or some other move like b8d8 or b8h8
After:
(Move.from_uci('c6d7'), 2)
In this game: https://lichess.org/K9tOivpn/black, Arasan, playing Black, had a won position, but the bot, selecting moves from the Syzygy tablebases, allowed the opponent to draw by repetition.
config.yaml was set up as follows:
The game:
Some of the log file: