Skip to content

Fix is_pseudolegal for DFRC castling and pawns - #381

Merged
kevlu8 merged 1 commit into
mainfrom
fix/is-pseudolegal
Oct 23, 2026
Merged

kevlu8 merged 1 commit into
mainfrom
fix/is-pseudolegal

Conversation

@wdotmathree

@wdotmathree wdotmathree commented Oct 23, 2026 •

Copy link
Copy Markdown
Collaborator

is_pseudolegal used to return incorrect results in the following cases:

  • DFRC castling direction was determined by which half of the board the rook is on, rather than its position relative to the king. This resulted in moves such as c1d1 in this position . . K R . . . . to be incorrectly judged as queenside. Note that movegen and make_move were never affected by this bug.
  • Pawn pushes without promotion onto the 8th rank would return true. This could happen if a rook or king performed a move such as e7e8, then later a hash collision returned that move while pawn is on e7.

These have been fixed

Bench: 2172931

@wdotmathree wdotmathree self-assigned this Oct 23, 2026
@wdotmathree
wdotmathree requested a review from kevlu8 October 23, 2026 05:31
@wdotmathree wdotmathree added the bug Something isn't working label Oct 23, 2026
@kevlu8
kevlu8 merged commit fd1fb9f into main Oct 23, 2026
9 checks passed
@kevlu8
kevlu8 deleted the fix/is-pseudolegal branch October 23, 2026 05:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants