summaryrefslogtreecommitdiff
path: root/src/chess.h
diff options
context:
space:
mode:
authorScott Gasch <[email protected]>2026-10-14 12:16:43 -0700
committerScott Gasch <[email protected]>2026-10-14 12:16:43 -0700
commitac5cc078b71e94b21a8a843628045c745022aa75 (patch)
tree1633412357651cd94e34b50c74f23ff06608db7f /src/chess.h
parent91f01c607338eabb10ae1f8c144be55071d174a5 (diff)
Remove PRUNE_VERIFY entirely -- never compiled in its current form
PRUNE_VERIFY (shadow verification for ShouldLatePrune's deep-prune gate) is dead code that has apparently never been built successfully: search.c's #if defined(PERF_COUNTERS) && defined(PRUNE_VERIFY) block reads fVerifyFlagged/uVerifyBand/uVerifyDepthB/uVerifyAttB/ uVerifyRateB/uVerifyPred, none of which are declared or assigned anywhere in the file. Confirmed by compiling search.c with -DPRUNE_VERIFY directly: 7 "use of undeclared identifier" errors. Since GNUmakefile never defines PRUNE_VERIFY on any path (it's opt-in only, ifdef PRUNE_VERIFY / PROFILE += -DPRUNE_VERIFY), nothing has ever caught this. Removed rather than fixed: reconstructing fVerifyFlagged/uVerifyBand/ etc.'s intended semantics from scratch would be inventing behavior, not restoring it -- there's no prior working version to recover. Removed: the broken block in search.c's move loop; its two PRUNE_VERIFY-exclusive helper functions (PruneVerifyBand, PvAttBucket/PvRateBucket -- careful to keep ShipDepthBucketPublic/ JOINT_TABLE_SENTINEL_PUBLIC/ShipLateBucketPublic/PruneVerifyPredict, which PRUNE_LIVE also uses via its PruneLivePredict alias, simplifying that block's guard from "(PERF_COUNTERS && PRUNE_VERIFY) || PRUNE_LIVE" to just "PRUNE_LIVE"); the COUNTERS and g_Options struct fields in chess.h (u64PruneVerifyTries/FailHigh/MarginSum/PredSum/Dyn/DynMiss) and PRUNE_VERIFY_BANDS/SHIP_DEPTH_BUCKETS (the latter was only ever used by PRUNE_VERIFY code); root.c's dead counter copies; script.c's report-printing block and SHIP_DEPTH_BUCKETS-sized suite-total fields; GNUmakefile's flag wiring (left a comment explaining the removal). Found while scoping the PRUNE_LIVE guard above: PRUNE_LIVE is ALSO currently broken (separate, pre-existing, unrelated bug) -- PruneVerifyPredict (search.c) returns g_uJointFHThousandths[...]'s element type as ULONG, but that array is declared USHORT in data.c, producing an "incompatible pointer to integer conversion" error under -DPRUNE_LIVE=<K>. Confirmed pre-existing (reproduces identically with this commit reverted). Not fixed here -- out of scope, nobody's asked to touch PRUNE_LIVE, flagging for awareness only. Verified: standard profile (GENETIC=1 PERF_COUNTERS=1 MP=1 SIXTYFOUR=1) builds clean, precommit_check.sh passes (TEST=1 self-test + DEBUG smoke test). PRUNE_LIVE's build was already broken before this commit and remains identically broken after (confirmed via git stash). Co-Authored-By: Claude Sonnet 5 <[email protected]>
Diffstat (limited to 'src/chess.h')
-rwxr-xr-xsrc/chess.h90
1 files changed, 0 insertions, 90 deletions
diff --git a/src/chess.h b/src/chess.h
index 36b90e3..ec912a2 100755
--- a/src/chess.h
+++ b/src/chess.h
@@ -1078,47 +1078,6 @@ MOVE_STACK;
// to a formula that might grow later.
#define NULL_R_BUCKETS (12)
-// 2026-10-03: PRUNE_VERIFY (GNUmakefile) -- shadow verification for the
-// DEEP PRUNE gate (ShouldLatePrune), answering a question the LMR-side
-// JOINT_EXTRA_VERIFY cannot: "this move was about to be skipped
-// ENTIRELY -- would searching it have failed high?" A reduction leaves a
-// score behind that can be sanity-checked; a prune leaves nothing, so
-// there is no signal at all unless we deliberately decline to prune and
-// watch what the move does.
-//
-// Deliberately AUDIT-ONLY: the gate is evaluated, the verdict is
-// recorded, and then the move is searched normally anyway. That means
-// NO bespoke shadow Search() call is needed -- the move's own ordinary
-// search answers "did it fail high", with the real move loop's
-// re-search wrapper intact. That sidesteps the null-move-bailout
-// fabrication (searchsup.c's Tord Romstad branch) that made
-// JOINT_EXTRA_VERIFY's first numbers 80-99.8% measurement artifact and
-// needed NEUTRALIZE_NULL_BAILOUT to fix. Nothing here fabricates a
-// score, so nothing here can misread one.
-//
-// Known, accepted under-detection: an audited move is still subject to
-// LMR, so a fail-high that only a FULL-depth search would have found
-// can be missed. The existing re-search-on-fail-high path catches the
-// common case, and JOINT_EXTRA_VERIFY measured the residual silent-miss
-// rate at ~0.00056% once measured correctly -- negligible against the
-// prune miss rates this is built to detect.
-//
-// Bands are the table's own predicted-FH value (thousandths of a
-// percent, post-Wilson-re-bake so the value already encodes the cell's
-// sample confidence -- see data.c's header). Indexed by band because
-// the decision this validates is literally "prune if predicted <= K",
-// so band-resolution answers "is the rule sound at threshold K" for
-// every candidate K at once. Depth is carried alongside because the
-// COST of a wrong prune scales with remaining depth even where the rate
-// does not.
-// Shipped depth dimension of g_uJointFHThousandths (data.c declares it
-// as [12][11][11][16][11], including the 5th/improve axis; the 12 is
-// _ShipDepthBucket's range).
-#define SHIP_DEPTH_BUCKETS (12)
-#define PRUNE_VERIFY_BANDS (8)
-// band edges, predicted FH in thousandths of a percent:
-// 0: ==0 1: 1 2: 2 3: 3-5 4: 6-10 5: 11-50 6: 51-500 7: >500
-
// 2026-09-28: JOINT_EXTRA_VERIFY silent-miss calibration, bucketed by
// how much remaining depth the FULLY-reduced (base + extra) search
@@ -1274,47 +1233,6 @@ typedef struct _COUNTERS
// clamped to NULL_R_BUCKETS - 1.
UINT64 u64NullMoveTriesByR[NULL_R_BUCKETS];
UINT64 u64NullMoveSuccessByR[NULL_R_BUCKETS];
-#ifdef PRUNE_VERIFY
- // [predicted-FH band][shipped depth bucket] -- see
- // PRUNE_VERIFY_BANDS above. Tries = moves the deep-prune gate
- // said to skip; FailHigh = how many of those then actually
- // raised beta when searched anyway (a silent miss the gate
- // would have caused). Margin = how far past beta it cleared,
- // summed, so narrow-window boundary noise (JOINT_EXTRA_VERIFY's
- // documented false-positive class: a score clearing a tight
- // inherited PVS window proves only that, not that the move is
- // good) can be separated from real misses post-hoc instead of
- // hand-traced one at a time.
- UINT64 u64PruneVerifyTries[PRUNE_VERIFY_BANDS][SHIP_DEPTH_BUCKETS];
- UINT64 u64PruneVerifyFailHigh[PRUNE_VERIFY_BANDS][SHIP_DEPTH_BUCKETS];
- UINT64 u64PruneVerifyMarginSum[PRUNE_VERIFY_BANDS][SHIP_DEPTH_BUCKETS];
- // Volume-weighted sum of the PREDICTED rate over exactly the
- // flagged population. The calibration check is measured-vs-this,
- // NOT measured-vs-threshold: a threshold is a ceiling on what
- // gets flagged, not the typical value of what actually does, and
- // SPEC.md records getting that wrong once already.
- UINT64 u64PruneVerifyPredSum[PRUNE_VERIFY_BANDS][SHIP_DEPTH_BUCKETS];
- // Cost/benefit cross-tab for a DYNAMIC veto layered on the
- // static gate, prunable bands only (predicted <= 10). Indexed
- // [attempts band][own-FH-rate band] per searchsup.c's
- // AttemptsBucket/RateBucket. Dyn = every flagged move;
- // DynMiss = the subset that actually failed high. Together they
- // give, for any candidate rule "refuse when attempts >= A and
- // rate > B": how many REAL misses it catches, and how many
- // sound prunes it costs. The second number is what matters --
- // the GetMoveFailHighPercentage veto was retired last time
- // because it vetoed 70-80% of candidates for zero node savings.
- UINT64 u64PruneVerifyDyn[8][8];
- UINT64 u64PruneVerifyDynMiss[8][8];
-#endif
-
- // above -- settles whether elevated per-move-identity rates
- // (5-100 thousandths) are concentrated at low attempts
- // (sampling noise around the real 0.400% population average)
- // or spread across high attempts too (a real, well-evidenced
- // elevated rate, which the sampling-noise theory would NOT
- // predict). AttemptsBucket/RateBucket (searchsup.c) define
- // the 8 bands each axis uses.
#ifdef JOINT_EXTRA_VERIFY
// Full-coverage shadow-search "silent miss" calibration -- see
// GNUmakefile's JOINT_EXTRA_VERIFY comment. Tries = extra-
@@ -2077,14 +1995,6 @@ typedef struct _GAME_OPTIONS
UINT64 u64LMPPruned;
UINT64 u64NullMoveTriesByR[NULL_R_BUCKETS];
UINT64 u64NullMoveSuccessByR[NULL_R_BUCKETS];
-#ifdef PRUNE_VERIFY
- UINT64 u64PruneVerifyTries[PRUNE_VERIFY_BANDS][SHIP_DEPTH_BUCKETS];
- UINT64 u64PruneVerifyFailHigh[PRUNE_VERIFY_BANDS][SHIP_DEPTH_BUCKETS];
- UINT64 u64PruneVerifyMarginSum[PRUNE_VERIFY_BANDS][SHIP_DEPTH_BUCKETS];
- UINT64 u64PruneVerifyPredSum[PRUNE_VERIFY_BANDS][SHIP_DEPTH_BUCKETS];
- UINT64 u64PruneVerifyDyn[8][8];
- UINT64 u64PruneVerifyDynMiss[8][8];
-#endif
#ifdef JOINT_EXTRA_VERIFY
UINT64 u64JointExtraVerifyTries[JOINT_EXTRA_TIER_COUNT][POST_REDUCE_DEPTH_BUCKETS];
UINT64 u64JointExtraVerifySilentMiss[JOINT_EXTRA_TIER_COUNT][POST_REDUCE_DEPTH_BUCKETS];