Open thearst3rd opened 3 years ago
Yes, it should be rather trivial to add. However, I am somewhat sceptical of the change for several reasons:
All fair points!
is_immediate_game_end
function, even though I used the term "immediate" in the title/example. As you mentioned - perft would not not output the correct numbers since draws (other than stalemate) are ignored. Though it does mean there would have to be an additional function like Position::is_immediate_game_draw
or something that just purely exists for the libraries. It might not be worth the added effort/complexity if it's going to be relatively niche.Anyways I created the issue since it's technically a rule of chess that Fairy-Stockfish doesn't support, but I understand if it's out of scope for the project :)
On pychess site (similar to lichess) infinite game issue is solved by the 300 move limit.
Implementing it as a separate method of course is an option. Still, I think that it is not like any other rule of chess, considering that it is not very well established in practice (it is a quite recent change, I am not yet aware of any software supporting it, and I have never seen it applied OTB) apart from being defined by FIDE. Nevertheless, I get your point, and I am open to applying an isolated change that does not affect the engine to provide this for the libraries.
One more thing to consider though is that if introduced as a variant configuration it creates overhead for the definition of variants. Also if it would be available for all variants, things like armageddon should be considered as well. In general it sounds like more fitting to a chess-only library, unless there are similar rules for other variants that justify introducing it as a general concept.
For software that supports it, I know that python-chess does:
https://python-chess.readthedocs.io/en/latest/core.html#chess.Termination.SEVENTYFIVE_MOVES https://python-chess.readthedocs.io/en/latest/_modules/chess.html#Board.outcome (under "automatic draws")
Additionally, Lichess (via scalachess) supports fivefold repetition (but not 75-move rule, 50-move auto draws):
https://github.com/ornicar/scalachess/search?q=fivefold
It's funny, about the recency of the rules: even though they were implemented in 2014 which is 7 years ago, in terms of the history of chess, that might as well have been yesterday :) So I get that as well.
We will need to think about variants - I figured that most western chess variants (armageddon, crazyhouse, etc) adopt the drawing rules unless they explicitly state that they don't. The harder part would be removing it from regional variants or variants that don't derive from western chess, if it doesn't make sense to apply the rules there.
Thank you for your input! Maybe if I feel like it, I may create a PR that you can review, and if so we can discuss more then.
Curious about your thoughts on this, since it doesn't actually affect engine play but would be nice for the libraries. Right now, only optional draws by n-fold repetition and n-move rule are supported - I was wondering about the possibility of adding "immediate" draws by m-fold and m-move rule (such as fivefold repetition and 75-move rule in standard chess). I feel like it should be relatively easy to add (maybe 😄), do you think it would be worth the effort?
Ex: