Chess.com does not handle threefold repetition correctly if it involves pinned en passants

Sort:
xenial_pangolin

The following game is not marked as a draw by threefold repetition, even though the final position is repeated three times:


The game starts from the position:
4k3/4r3/8/4Pp2/8/8/8/R3K3 w - f6 0 2

Although there is an en passant target square, it is not a legal capture because the pawn on e5 is pinned.

After 2. Ra2 Rd7 3. Ra1 Re7, we reach the initial position again:
4k3/4r3/8/4Pp2/8/8/8/R3K3 w - - 4 4

After 4. Ra2 Rd7 5. Ra1 Re7, the position appears for the third time:
4k3/4r3/8/4Pp2/8/8/8/R3K3 w - - 8 6

However, the game is not being marked as a draw by threefold repetition.

In another example involving threefold detection and en passant—but without a pinned pawn—Chess.com handles it correctly.

This game starts from:
4k3/4r3/8/5p2/8/8/8/R4K2 w - f6 0 2

In this case, Chess.com correctly identifies that en passant isn’t a legal move, because there’s no pawn available to make the capture.

After 2. Ra2 Rd7 3. Ra1 Re7, the initial position repeats:
4k3/4r3/8/5p2/8/8/8/R4K2 w - - 4 4

After 4. Ra2 Rd7 5. Ra1 Re7, the position appears a third time:
4k3/4r3/8/5p2/8/8/8/R4K2 w - - 8 6

According to FIDE rules:

"Positions as in (a) and (b) are considered 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.
Positions are not the same if a pawn that could have been captured en passant can no
longer be captured in this manner. When a king or a rook is forced to move, it will lose its
castling rights, if any, only after it is moved"

Martin_Stahl

If the first position has enough passant as a condition, it doesn't matter if it was possible, just that the condition was (the FEN contains the en passant field). Thus it does not count as a repetition.

My guess is that's not likely to be changed. There are likely very few games where that type of position exists condition exists

xenial_pangolin

In both examples I gave, the starting position includes an en passant field in the FEN.

But in the second case, Chess.com correctly ignored it when checking for repetition. So it’s clearly not using the FEN field alone—it seems to be checking if the en passant capture is legal (though not accounting for this edge case with pinned pawns).

I get that this is a rare case, and I totally understand if it’s not a priority to fix—but I just wanted to clarify that the current behavior doesn't follow the official rule.

Martin_Stahl

Do you have a game where this occured?

Mazetoskylo
Martin_Stahl wrote:

If the first position has enough passant as a condition, it doesn't matter if it was possible, just that the condition was (the FEN contains the en passant field). Thus it does not count as a repetition.

My guess is that's not likely to be changed. There are likely very few games where that type of position exists condition exists

The possible moves of all the pieces of both players are the same, as en-passant would be illegal because of the pin. So, it is a 3-fold repetition, and it should be counted as such.

Martin_Stahl

I did a bit of research and it's not as clear cut as it might seem. It really depends on the definitions of possible in context of FIDE rules. It could be argued that in the first position, en passant is possible (or "could have been captured") but illegal. In the subsequent positions, it is not possible 

  • 9.2.3 Positions are considered the same if and only 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. Thus positions are not the same if:
  • 9.2.3.1 at the start of the sequence a pawn could have been captured en passant.

It's still a very edge case and likely one that rarely happens in practice and probably isn't something that would be a high priority code change, if it was decided it should be modified at all.