Introduce the PieceReader read port #118
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#118
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
#117
What to build
Introduce the
PieceReaderread port — a 4-method interface over piece placement (pieceAt,squaresOf,occupancy,occupancyOf) — and route the read-only consumers through it, without changing any behavior.Boardalready exposes all four methods, so it implements the port as-is. Every module that currently accepts a concreteBoardpurely to read from it is widened to acceptPieceReaderinstead. This is pure type widening: no logic moves, no allocation changes, no perft impact.Acceptance criteria
PieceReaderinterface defined withpieceAt,squaresOf,occupancy,occupancyOf; not exported from the packageBoarddeclaredimplements PieceReader(no method changes needed)movegen.tsandzobrist.tssignatures that tookBoardnow takePieceReadercastling.ts(castlingMoves,homeRookPresent) andrules.hasInsufficientMaterialwidened toPieceReaderpnpm lint,pnpm typecheck,pnpm test,pnpm buildall green; perft node counts unchangedindex.tsImplemented by Sandcastle on branch
sandcastle/sequential-reviewer/1779453661375— awaiting review. IntroducedPieceReaderread port; widened movegen, zobrist, castling, and rules.hasInsufficientMaterial signatures fromBoardtoPieceReaderwith no behavior change.Promoted to branch
refactor/introduce-the-piecereader-read-port-118(PR #122), not yet merged to main. A dependent slice shouldgit fetch origin refactor/introduce-the-piecereader-read-port-118and branch off it.mentioned in issue #119
mentioned in issue #120
mentioned in issue #141
mentioned in commit
81a871ba17mentioned in commit
6bd42d7f09