Threefold repetition is missed after a double pawn push #432
Labels
No labels
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
spec
wayfinder:grilling
wayfinder:map
wayfinder:prototype
wayfinder:research
wayfinder:task
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
amaurycoudr/chess-project#432
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What happens
A threefold repetition is missed whenever a double pawn push sits in the history. Every double push sets the en passant square (
packages/engine/src/rules/search-board.ts:223-233), and the Zobrist key hashes its file whether or not a capture is possible (packages/engine/src/state/zobrist.ts:81-83). The position after the push never matches the same position reached later, so the count is off.FIDE counts two positions as the same unless an en passant capture is actually available.
Reproduce
Done when
zobristKeyandupdateZobristKey.mentioned in commit
8d34a3120bmentioned in merge request !547
mentioned in commit
10f7ed9c73