Draw by repetition

Discussion of chess software programming and technical issues.

Moderator: Ras

syzygy
Posts: 5696
Joined: Tue Feb 28, 2012 11:56 pm

Re: Draw by repetition

Post by syzygy »

hgm wrote: Sun Feb 20, 2022 11:21 am Indeed, I was talking purely from the viewpoint of Elo, determined in engine-engine matches. For analysis it could be an issue.
I agree that in engine-engine matches there will be no measurable Elo benefit from treating repeats of history positions "correctly". There will be cases where it screws up, but it will be too rare to matter. If I remember correctly, for a long time Stockfish treated the first repetition of a history position as a draw and all attempts to "fix" it failed to pass the tests (until one solution finally passed, which then ended the recurring bug reports).

Btw, an interesting question is how to treat the root position.
For a regular search it makes no sense not to score the first repeat of the root position as a draw.
The situation is a bit more complicated with MultiPV > 1.

If the objectively best move scores > 0, the PV of the best move should not contain a repetition of the root move (and so the first repetition of the root position should be treated as a draw when searching the best move).

But for another move in the root position, the optimal line of play (after effectively "forcing" the move for the purpose of doing MultiPV > 1) might lead back to the root position, from where the best move can be played, leading to the same score as the best move. If you treat the first repetition of the root position as a draw, this will not be detected and the move will get a worse score.

If I'm not mistaken, this is "fixed" in Stockfish by treating the root position as a history move. So the first repeat of the root position will not be treated as a draw, not even with MultiPV = 1.

In my view, a first repeat of the root position should be treated as a draw even with MultiPV > 1. In my view it is a feature, not a bug, if a suboptimal move that merely happens to allow a return to the root position is scored worse than the best move.

The extreme case would be a best with a winning score and a 2nd best move with a draw score, but with a 4-ply PV leading back to the root position. But is that bad? If the user doesn't like the best move (which is why he wants to know how other moves fare), he should still not like the best move if the root position repeats...
User avatar
hgm
Posts: 28353
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: Draw by repetition

Post by hgm »

I agree.