@wavaxa22 said in #4:
> There's a bug in Stockfish where, in analysis mode, if you manually enter the move that results in a threefold repetition, then suddenly the engine forgets what happened beforehand and scores the position as if no repetition occurred. The Stockfish team knows about this bug, but when they tried to fix it, the program lost a small amount of Elo. The Stockfish team decided to live with the bug for the sake of playing strength.
I fixed this bug in Lichess' copy of Stockfish and eventually the official-stockfish team also fixed it. There are potentially two issues to discuss:
1. The Universal Chess Interface protocol - not designed by the Stockfish team - has no mechanism to communicate "claim a draw by repetition since the opponent just repeated this position". This becomes relevant in the uncommon situation when any move the player makes does not produce a 3fold repetition, but the current position previously occurred twice with the same player to move. Potentially Lichess could indicate, "Threefold repetition" separate from engine analysis.
2. The best move in a position may have an evaluation of 0.00 due to insufficient material, threefold repetition claim, or the position simply being equal. The UCI protocol has no mechanism to communicate, "0.00 due to 3fold repetition" so one would need to change the protocol and make a new engine which implements it in order to determine whether 0.00 is caused by 3fold repetition or caused by something else.