lichess.org
Donate

Triple Repetition Implementation

Can someone explain how triple move repetition is implemented (or point me to the source code)?

http://en.lichess.org/iz0itgsr

A draw was declared after only the second repetition of the position in the game I just finished.
It was the third one. At move 51, the position was identical.
It actually isn't - the first time it is black to move, the next two it is white to move.
andrewrun is correct. It's not sufficient for the pieces to be on the same squares; for the purposes of threefold repetition, a position is the same as another one if and only if the same set of legal moves are available.

Obviously that rules out the pieces being on the same squares but a different side being to move. It also means that if on the first occurrence of the position, one side could castle or make an en passant capture, but then repeated moves while giving up castling or not taking en passant, the first occurrence would not count towards threefold, since different legal moves would have been available.

It does actually seem that the position hashing used here for threefold does not correctly account for that.
fide rule
9.2
The game is drawn upon a correct claim by the player having the move, when the same position, for at least the third time (not necessarily by a repetition of moves):...

Doenst say nothing about not be sufficient for the pieces to be on the same squares nor the number of posible moves.

I~m only interpreting the text.
ositions as in (a) and (b) areconsidered the same, if the same player has the move, pieces of the same kind and colour occupy the same squares, and the possible moves of all the pieces of both players are the same.

ok :))
It seems that in the final position white can claim a draw because if he plays 56. Re3 it will be the 3rd exact repetition. It seems lichess claimed automatically for him.

From Wikipedia (sorry, too lazy for going to the Fide site...):

The relevant rule in the FIDE laws of chess is 9.2, which reads:

The game is drawn, upon a correct claim by the player having the move, when the same position, for at least the third time (not necessarily by sequential repetition of moves)

a. is about to appear, if he first writes his move on his scoresheet and declares to the arbiter his intention to make this move, or

b. has just appeared, and the player claiming the draw has the move.
Forget it. It wont be exact repetition. Where to submit a bug?

This topic has been archived and can no longer be replied to.