Route isAttackedIn through the PieceReader port #119
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#119
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
Route
isAttackedInthrough thePieceReaderport. Today it takes the raw{ sets: PieceSets; occupancy: SquareSet }pair, and its two callers assemble that argument differently —rules.isCheckpasses a freshposition.board.toSets()copy,SearchBoard.legalMovespasses the live#setsref plus a separately-computed occupancy. This slice replaces that parameter with a singlePieceReader, derived occupancy included, so both callers pass a board directly.End-to-end: attack detection runs identically whether handed an immutable snapshot or a live board, with one calling convention.
Acceptance criteria
isAttackedInsignature changed from{ sets, occupancy }to aPieceReader; occupancy derived internally viapieceReader.occupancy()rules.isCheckpassesposition.boarddirectly — notoSets()copy, no hand-rolled occupancySearchBoard.legalMovespasses its board through the port — no{ sets, occupancy }tupleattacks.test.tsupdated to driveisAttackedInvia aPieceReaderpnpm lint,pnpm typecheck,pnpm test,pnpm buildall green; perft node counts unchangedBlocked by
Implemented by Sandcastle on branch
sandcastle/sequential-reviewer/1779453986599— awaiting review. RoutedisAttackedInthrough thePieceReaderport: signature collapsed from{ sets, occupancy }to a singlePieceReader, withrules.isCheckand bothSearchBoard.legalMovescallsites passing the board directly;attacks.test.tsdrives the function viapos.board(no moreattackContexthelper). All four gates green; perft node counts unchanged.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 #120
mentioned in commit
5ef5e336a2mentioned in commit
81a871ba17mentioned in commit
6bd42d7f09mentioned in commit
658aeacfa2mentioned in merge request !527