Skip to content

fix(atomic): validate en passant with variant rules - #1215

Open
0d00ciallo0721 wants to merge 1 commit into
niklasf:masterfrom
0d00ciallo0721:agent-tasks/1214
Open

0d00ciallo0721 wants to merge 1 commit into
niklasf:masterfrom
0d00ciallo0721:agent-tasks/1214

Conversation

@0d00ciallo0721

Copy link
Copy Markdown

Fixes #1214

Summary

AtomicBoard inherits Board.generate_legal_ep(), which only checks whether the capturing king remains in check. Atomic chess has two additional cases: capturing the opponent's king makes the move legal, while exploding the capturing king makes it illegal. Use AtomicBoard.is_legal() for en-passant generation, matching generate_legal_moves().

The regression coverage exercises both cases through generate_legal_moves(), generate_legal_ep(), generate_legal_captures(), has_legal_en_passant(), FEN, and EPD.

Verification

  • python3 test.py AtomicTestCase.test_atomic_en_passant --verbose — passed.
  • python3 test.py — 296 tests passed, 22 skipped because optional chess engines/tablebases are unavailable locally.
  • git diff --check — passed.
  • The README doctest produced 66 passes; three engine examples could not run because Stockfish is not installed in the local environment. The repository CI setup installs Stockfish before running that doctest.

AI assistance was used for issue analysis, the implementation, and regression coverage.

@0d00ciallo0721
0d00ciallo0721 marked this pull request as ready for review October 6, 2026 08:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

AtomicBoard: has_legal_en_passant(), generate_legal_ep() and fen() do not use Atomic legality

1 participant