summaryrefslogtreecommitdiff
path: root/src/genetic/GeneticDriver.java
diff options
context:
space:
mode:
authorScott Gasch <[email protected]>2026-09-05 10:37:55 -0700
committerScott Gasch <[email protected]>2026-09-05 10:37:55 -0700
commit5405191f8c519333006417a5a3c31bc3e186e42e (patch)
tree1355d4c1cfecbe1777f92df2ecadbb17d8215e37 /src/genetic/GeneticDriver.java
parentaad154a5a07d2793e52a71415cc5c59276a8f629 (diff)
Retire ATTACK_BITV/bvAttacks and the c|8 shadow-index mechanism entirely
Now that king (the last piece writing it) has converted to a bitboard accumulator, nothing writes rgSquare[c|8].bvAttacks any more -- deletes the whole mechanism rather than leaving a known-dead struct around: - chess.h: ATTACK_BITV union gone. SQUARE collapses from a union-with-ATTACK_BITV to a plain {pPiece, uIndex} struct (the #pragma pack(1) that only existed for ATTACK_BITV's bitfield layout goes too). UNSAFE_FOR_ROOK/UNSAFE_FOR_QUEEN and the whole-word MINOR_XRAY_BIT/ ROOK_XRAY_BIT/QUEEN_XRAY_BIT constants deleted -- confirmed unused (only ever referenced in stale comments, not code) now that every consumer reads bbXAttacks bitboards directly. PAWN_BIT/MINOR_BIT/ ROOK_BIT/QUEEN_BIT/KING_BIT stay: they're a separate, still-live local bit-packing scheme _EvalKing/_WhoControlsSquareFast use to build a per-square attack-pattern index into KING_COUNTER_BY_ ATTACK_PATTERN/g_SwapTable, unrelated to the retired storage struct. - eval.c: _ClearAttackTables drops its entire macro-unrolled, 128-square clearing loop (CLEAR_A_SQ/CLEAR_A_RANK/CLEAR_SHORT_RANK, all deleted) -- it only ever existed to zero the old per-square struct; clearing the 7 bbXAttacks accumulators is the whole function now. The transitional _IsSquareAttackedByX/_IsSquareXrayedByX helpers (minor/rook/queen/king, 8 functions total) are deleted outright, not just simplified -- their only remaining purpose was bridging to the now-gone struct, and their DEBUG cross-checks were explicitly migration-only scaffolding, not a permanent invariant. Call sites (_WhoControlsSquareFast, _EvalKing's bvAttack/bvXray/bvDefend) read the bbXAttacks bitboards directly instead. _WhoControlsSquareFast simplifies to a flat OR of 8 bitboard membership tests per color, down from raw struct reads plus 7 helper calls each. Found and fixed one real, pre-existing bug while doing this (flagged and confirmed with the user before touching it, kept as its own documented change rather than silently folded into the mechanical rename): _EvaluateCandidatePasser's helper-pawn-safety gate read rgSquare[c1+8].bvAttacks[...].uWholeThing, but this function runs from _EvalPawns -- the first piece type Eval() evaluates each call, before any non-pawn piece (or, since commit 57502d6 retired pawns' own bvAttacks write, even pawns) has written anything there. That word has therefore been unconditionally zero, and the gate unconditionally true (a silent no-op), since 57502d6 landed -- not something today's cleanup introduced. Left exactly as dead/unconditional (deleted the now-meaningless condition, kept the body it always ran anyway) rather than fixed, since a real fix changes eval scoring and deserves its own before/after check, documented inline for a future session. Verification: precommit_check.sh (self-test + DEBUG smoke test) passes. tests/ecm_ringers.ep_ at sd10 vs. the immediately preceding commit: solve parity holds exactly (10/11 both), and final (depth-10) node counts are byte-identical for all 11 positions -- the bar for a change meant to be purely mechanical, unlike king's own conversion. One harmless artifact noted: ECM.750 has a different depth-6 *intermediate* best move (a shallow tie-break flip) that already resolves to the identical PV and node count by depth 7 and holds through depth 10 -- not chased further since the actual (depth-10) result matches exactly and search is deterministic at --cpus 1. Co-Authored-By: Claude Sonnet 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01XxmVi2sTMwpPp4i6WYFjan
Diffstat (limited to 'src/genetic/GeneticDriver.java')
0 files changed, 0 insertions, 0 deletions