summaryrefslogtreecommitdiff
path: root/src/script.c
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/script.c
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/script.c')
-rw-r--r--src/script.c122
1 files changed, 0 insertions, 122 deletions
diff --git a/src/script.c b/src/script.c
index 219825c..7286d17 100644
--- a/src/script.c
+++ b/src/script.c
@@ -97,14 +97,6 @@ typedef struct _SUITE_COUNTERS
UINT64 u64TotalJointExtraTries[JOINT_EXTRA_TIER_COUNT];
UINT64 u64TotalJointExtraResearch[JOINT_EXTRA_TIER_COUNT];
UINT64 u64TotalLMPPruned;
-#ifdef PRUNE_VERIFY
- UINT64 u64TotalPruneVerifyTries[PRUNE_VERIFY_BANDS][SHIP_DEPTH_BUCKETS];
- UINT64 u64TotalPruneVerifyFailHigh[PRUNE_VERIFY_BANDS][SHIP_DEPTH_BUCKETS];
- UINT64 u64TotalPruneVerifyMarginSum[PRUNE_VERIFY_BANDS][SHIP_DEPTH_BUCKETS];
- UINT64 u64TotalPruneVerifyPredSum[PRUNE_VERIFY_BANDS][SHIP_DEPTH_BUCKETS];
- UINT64 u64TotalPruneVerifyDyn[8][8];
- UINT64 u64TotalPruneVerifyDynMiss[8][8];
-#endif
#ifdef JOINT_EXTRA_VERIFY
UINT64 u64TotalJointExtraVerifyTries[JOINT_EXTRA_TIER_COUNT][POST_REDUCE_DEPTH_BUCKETS];
UINT64 u64TotalJointExtraVerifySilentMiss[JOINT_EXTRA_TIER_COUNT][POST_REDUCE_DEPTH_BUCKETS];
@@ -514,35 +506,6 @@ _ProcessSuiteLine(char *szLine, POSITION *pos)
}
g_SuiteCounters.u64TotalLMPPruned +=
g_Options.u64LMPPruned;
- #ifdef PRUNE_VERIFY
- {
- ULONG w;
- for (v = 0; v < PRUNE_VERIFY_BANDS; v++)
- {
- for (w = 0; w < SHIP_DEPTH_BUCKETS; w++)
- {
- g_SuiteCounters.u64TotalPruneVerifyTries[v][w] +=
- g_Options.u64PruneVerifyTries[v][w];
- g_SuiteCounters.u64TotalPruneVerifyFailHigh[v][w] +=
- g_Options.u64PruneVerifyFailHigh[v][w];
- g_SuiteCounters.u64TotalPruneVerifyMarginSum[v][w] +=
- g_Options.u64PruneVerifyMarginSum[v][w];
- g_SuiteCounters.u64TotalPruneVerifyPredSum[v][w] +=
- g_Options.u64PruneVerifyPredSum[v][w];
- }
- }
- for (v = 0; v < 8; v++)
- {
- for (w = 0; w < 8; w++)
- {
- g_SuiteCounters.u64TotalPruneVerifyDyn[v][w] +=
- g_Options.u64PruneVerifyDyn[v][w];
- g_SuiteCounters.u64TotalPruneVerifyDynMiss[v][w] +=
- g_Options.u64PruneVerifyDynMiss[v][w];
- }
- }
- }
-#endif
#ifdef JOINT_EXTRA_VERIFY
{
ULONG w;
@@ -831,91 +794,6 @@ _PrintSuiteReport(double dSuiteStart)
((double)g_SuiteCounters.u64TotalJointExtraTries[v] + 1.0)),
g_SuiteCounters.u64TotalJointExtraTries[v]);
}
-#ifdef PRUNE_VERIFY
- // See chess.h's PRUNE_VERIFY comment. The calibration test is
- // MEASURED vs PREDICTED on exactly the flagged population --
- // never measured-vs-threshold, which is a ceiling on what gets
- // flagged rather than the typical value of what does (SPEC.md
- // records getting that wrong once). A band whose measured rate
- // tracks its predicted rate is a band the gate can be trusted
- // in; one where measured >> predicted is model error localized
- // there, which no amount of Wilson/sampling conservatism fixes.
- {
- static const char *szBand[PRUNE_VERIFY_BANDS] =
- { "==0", "1", "2", "3-5", "6-10", "11-50", "51-500", ">500" };
- ULONG w;
- Trace("\ndeep-prune shadow verification (AUDIT ONLY -- nothing "
- "was actually pruned):\n");
- Trace(" predFH flagged actual-FH measured%% "
- "predicted%% mean-margin\n");
- for (v = 0; v < PRUNE_VERIFY_BANDS; v++)
- {
- UINT64 u64T = 0, u64F = 0, u64M = 0, u64P = 0;
- for (w = 0; w < SHIP_DEPTH_BUCKETS; w++)
- {
- u64T += g_SuiteCounters.u64TotalPruneVerifyTries[v][w];
- u64F += g_SuiteCounters.u64TotalPruneVerifyFailHigh[v][w];
- u64M += g_SuiteCounters.u64TotalPruneVerifyMarginSum[v][w];
- u64P += g_SuiteCounters.u64TotalPruneVerifyPredSum[v][w];
- }
- if (0 == u64T) continue;
- Trace(" %-8s %10" COMPILER_LONGLONG_UNSIGNED_FORMAT
- " %10" COMPILER_LONGLONG_UNSIGNED_FORMAT
- " %8.5f%% %8.5f%% %10.1f\n",
- szBand[v], u64T, u64F,
- 100.0 * (double)u64F / (double)u64T,
- ((double)u64P / (double)u64T) / 1000.0,
- u64F ? (double)u64M / (double)u64F : 0.0);
- }
- Trace(" (by remaining-depth bucket, flagged/actual-FH -- the COST "
- "of a wrong\n prune scales with depth even where the RATE "
- "does not)\n");
- for (w = 0; w < SHIP_DEPTH_BUCKETS; w++)
- {
- UINT64 u64T = 0, u64F = 0;
- for (v = 0; v < PRUNE_VERIFY_BANDS; v++)
- {
- u64T += g_SuiteCounters.u64TotalPruneVerifyTries[v][w];
- u64F += g_SuiteCounters.u64TotalPruneVerifyFailHigh[v][w];
- }
- if (0 == u64T) continue;
- Trace(" depth bucket %2u: %10" COMPILER_LONGLONG_UNSIGNED_FORMAT
- " / %" COMPILER_LONGLONG_UNSIGNED_FORMAT
- " (%7.5f%%)\n", w, u64T, u64F,
- 100.0 * (double)u64F / (double)u64T);
- }
- // Dynamic-veto cost/benefit, prunable bands only. For any
- // rule "refuse when attempts >= A and rate > B", sum the
- // Dyn cells it covers (sound prunes lost) against the
- // DynMiss cells (real misses caught).
- {
- static const char *szA[8] =
- { "0", "1", "2", "3-4", "5-9", "10-24", "25-99", "100+" };
- ULONG u;
- Trace("\n dynamic signals over PRUNABLE-band candidates "
- "(flagged / of-those-missed),\n rows = own-FH attempts, "
- "cols = own-FH rate in thousandths of a percent:\n");
- Trace(" attempts 0 1-100 101-400 401-900 "
- "901-1900 1901-4900 4901-9900 9901+\n");
- for (u = 0; u < 8; u++)
- {
- UINT64 u64RowT = 0;
- for (v = 0; v < 8; v++)
- u64RowT += g_SuiteCounters.u64TotalPruneVerifyDyn[u][v];
- if (0 == u64RowT) continue;
- Trace(" %-8s", szA[u]);
- for (v = 0; v < 8; v++)
- {
- Trace(" %7" COMPILER_LONGLONG_UNSIGNED_FORMAT
- "/%-2" COMPILER_LONGLONG_UNSIGNED_FORMAT,
- g_SuiteCounters.u64TotalPruneVerifyDyn[u][v],
- g_SuiteCounters.u64TotalPruneVerifyDynMiss[u][v]);
- }
- Trace("\n");
- }
- }
- }
-#endif
Trace("\nlate-move pruning (overt skip, not reduction): %"
COMPILER_LONGLONG_UNSIGNED_FORMAT " moves pruned\n",
g_SuiteCounters.u64TotalLMPPruned);