summaryrefslogtreecommitdiff
path: root/src/chess.h
diff options
context:
space:
mode:
authorScott Gasch <[email protected]>2026-10-14 12:41:05 -0700
committerScott Gasch <[email protected]>2026-10-14 12:41:05 -0700
commitdc77f67396cd99aea4ac1567f55ca3d8c6825fb7 (patch)
treee24c44a1c668de86c78e285d0bd8b4592e055d39 /src/chess.h
parentbb2d7a9cce6275fcfb038c8a3ab248ba3cf2c827 (diff)
Plumb fThreat and attack snapshots into SPLIT_INFO (prep for step 4)
UNIFY_SEARCH.md step 3: add fThreat and the two attack-snapshot bitboards (bbMinorAttacksSnapshot/bbRookAttacksSnapshot) to SPLIT_INFO (chess.h), populated by StartParallelSearch (split.c) from values the originating thread already has at split-launch time, passed through from search.c's call site. Plumbing only -- nothing reads these fields yet (HelpSearch() still runs its own inline copy, untouched). That's step 4: unify HelpSearch() onto SearchOneMove, at which point it can pass these real values instead of the zeroed snapshots and missing fThreat its current hand-rolled gate has. Sequenced before step 4 deliberately (not combined or left for after): landing the plumbing first means there's no window where HelpSearch() calls the real CanWeReduceOrPruneMove()/ShouldLatePrune() gate with stale/zeroed snapshots -- see UNIFY_SEARCH.md's note on why that matters for FH_TABLE_COLLECTION's sampling. Verified: precommit_check.sh passes. Bit-identical node counts at sd10/--cpus 1 across all three curated suites, zero change (expected -- single-threaded path never reads these new fields). cpus 4 smoke run across all three suites: clean exits, no crashes. Co-Authored-By: Claude Sonnet 5 <[email protected]>
Diffstat (limited to 'src/chess.h')
-rwxr-xr-xsrc/chess.h19
1 files changed, 18 insertions, 1 deletions
diff --git a/src/chess.h b/src/chess.h
index a985c16..3a1f842 100755
--- a/src/chess.h
+++ b/src/chess.h
@@ -1548,6 +1548,20 @@ typedef struct _SPLIT_INFO
SCORE iBeta; // beta at split
SCORE iEval; // static eval at split
SCORE iImprovement; // eval improvement since ply-2 (may be negative)
+ FLAG fThreat; // node-wide threat extension in play at
+ // the split point -- CanWeReduceOrPruneMove
+ // needs this; populated by the originating
+ // thread (it already has it, computed
+ // before the split-launch decision), not
+ // recomputed by helper threads
+ BITBOARD bbMinorAttacksSnapshot[2]; // attack-table snapshots from the
+ BITBOARD bbRookAttacksSnapshot[2]; // originating thread's own Search() call,
+ // for EstimateHangingMaterialCp -- helper
+ // threads have no access to the
+ // originating node's pos->bbMinorAttacks/
+ // bbRookAttacks (those are this-node-local,
+ // not replayed via mvPathToHere), so without
+ // this they'd degrade to all-zero snapshots
NODE_TYPE eNodeType; // the split point's own node type --
// copied here rather than read off a
// helper thread's own ctx->sPlyInfo,
@@ -4765,7 +4779,10 @@ StartParallelSearch(IN SEARCHER_THREAD_CONTEXT *ctx,
IN OUT MOVE *pmvBest,
IN ULONG uMoveNum,
IN INT iPositionExtend,
- IN ULONG uDepth);
+ IN ULONG uDepth,
+ IN FLAG fThreat,
+ IN BITBOARD bbMinorAttacksSnapshot[2],
+ IN BITBOARD bbRookAttacksSnapshot[2]);
void
InitializeSearcherContext(POSITION *pos, SEARCHER_THREAD_CONTEXT *ctx);