Engine PR 8.4: king+pawn perft validation #71
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#71
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?
Parent
#67
What to build
Prove pawn move generation and legality correct by perft. The reference data already exists:
packages/engine/src/perft-fixtures.tsexportsPAWN_PERFT_CASES, six positions with Stockfish 18-verified depth/node tables, each isolating a pawn mechanic (double pushes, en passant from the root FEN, en passant created mid-search, push-promotion, capture-promotion, pawns + knight together). This slice consumes that data — it does not pick new positions or re-run Stockfish.Extend
perft.test.tswith adescribeblock that walksPAWN_PERFT_CASES, mirroring the existing king/knight blocks: each case is parsed from itsfenvia the file'spositionFromFenhelper, then driven through theperfthelper with anit.eachovercounts. Choose a per-case depth ceiling that keeps the suite fast (the existing king/knight perft tops out around 90k nodes — match that order of magnitude; the deeper rows in the fixture are reference values, not all meant to run).Implements step 8 (final part) of
docs/adr/0004-engine-slice-plan-and-king-first-piece-ordering.md.PAWN_PERFT_CASESis deliberately kept out of the running test until pawns exist (see the note inperft-fixtures.ts); wiring it in is part of this slice. The node counts are valid against our engine because every position uses only kings, pawns, knights, and — after promotion — sliders, all of which the engine implements by step 8; no position carries castling rights, the one rule still missing.Acceptance criteria
perft.test.tsconsumesPAWN_PERFT_CASESfromperft-fixtures.ts— no hand-picked positions or counts duplicated into the testfenvia the existingpositionFromFenhelper and validated with the existingperfthelperperft.test.tsstructure (describe.eachper group,it.eachdepth table)pnpm lint,pnpm typecheck,pnpm test,pnpm buildall green from the repo rootBlocked by
Implemented by Sandcastle on branch
sandcastle/sequential-reviewer/1778951767805— awaiting review. Wires PAWN_PERFT_CASES into perft.test.ts with a 110k-node ceiling, exercising all six pawn positions.Promoted to branch
feat/engine-pr-8-1-pawns-pushes-captures-attack-mask-legality-wiring-68(PR #72), not yet merged to main. A dependent slice shouldgit fetch origin feat/engine-pr-8-1-pawns-pushes-captures-attack-mask-legality-wiring-68and branch off it.mentioned in commit
616b4dd697