diff options
| author | Scott Gasch <[email protected]> | 2026-10-25 10:16:16 -0700 |
|---|---|---|
| committer | Scott Gasch <[email protected]> | 2026-10-25 10:16:16 -0700 |
| commit | 3927a4cac6ec254a8e34a5e864300f75c3efc9f3 (patch) | |
| tree | d34d06481bd57276b3ef50bc5513f5bd65950a74 /src/chess.h | |
| parent | 874ef0478078ef4eb436af7d2b68a353f61f4d70 (diff) | |
Make the FH% regression model the default; remove data.c's retired tables
Flips FH_USE_REGRESSION_MODEL from an opt-in safety toggle to the only
behavior: fhmodel.c's quantized logistic regressions are now always
used, with no build-time choice left between them and the old
histogram tables. Removes g_uJointFHThousandths/g_uBetaFHThousandths
and their _NNUE counterparts from data.c (4085 lines), their extern
declarations from chess.h, and the now-dead
_JointTablePredictedFHThousandths/_BetaTablePredictedFHThousandths
lookup functions and their supporting bucket helpers
(HangCpBucket/GapCpBucket/MoveNumBucket/DepthBucket/ImproveBucket/
GapBetaBucket/_ShipDepthBucket/_ShipLateBucket) from searchsup.c, along
with the uRawDepthB/uRawImproveB plumbing that only existed to feed
them (search.c, split.c, SearchOneMove's parameter list).
Also drops the beta-side static-nullmove skip threshold's provisional-
96000 #else branch -- 99000 is now simply the default, confirmed (not
provisional) by docs/REGRESSION.md's trust-audit sweep (+291 Elo over
96000 at 200 games, LOWER95=0.79).
Verified: clean release build, clean DEBUG=1 TEST=1 self-test run (no
asserts), and a fresh head_reference/ checkpoint
(head-reference-20261025 -> 874ef04's regression-model binary) with
sd10/sn5000000 solve counts on the three curated suites essentially
matching the previous table-based checkpoint (70/191 vs 71/191 sd10,
93/191 vs 96/191 sn5M).
Co-Authored-By: Claude Sonnet 5 <[email protected]>
Diffstat (limited to 'src/chess.h')
| -rwxr-xr-x | src/chess.h | 90 |
1 files changed, 13 insertions, 77 deletions
diff --git a/src/chess.h b/src/chess.h index 0d5a4a1..85b4bd7 100755 --- a/src/chess.h +++ b/src/chess.h @@ -3975,40 +3975,13 @@ extern BITBOARD g_KingAttacksBB[128]; // search.c -- phase 2 (LMR replacement) is a separate, later step. // // 2026-10-21: late axis widened 16 -> 17. Shipped late bucket 0 is now -// dedicated SOLELY to the whole-node sample (raw late == 0, "will -// something at this node fail high" -- no specific move), not shared -// with the real first-leftover-move curve the way the old 16-bucket -// shape coincidentally did. See searchsup.c's _ShipLateBucket and -// dual_table_run_nnue/README.md's "whole-node alpha sample" section. -// g_uJointFHThousandths (HCE) carries a PLACEHOLDER in that bucket, -// duplicated from g_uJointFHThousandths_NNUE's real measurement, since -// this table's own collection build predates the whole-node -// instrumentation -- see data.c's header comment on this array, and -// dual_table_run/README.md, for how/when that gets replaced with a -// real HCE-side measurement. -extern USHORT g_uJointFHThousandths[12][11][11][17][11]; - -// 2026-10-21: NNUE-eval counterpart of g_uJointFHThousandths above -- -// same shape, collected against the NNUE evaluator instead of HCE -// (see ../dual_table_run_nnue/). Both tables are compiled in; which -// one a lookup reads is chosen at runtime by -// _JointTablePredictedFHThousandths (searchsup.c) based on -// (g_fUseNnueEval && g_fNnueWeightsLoaded) -- NOT a build-time -// #ifdef, since NNUE is itself already a runtime switch in this -// binary (see eval.c, command.c's "nnue on"/"nnue off"). -extern USHORT g_uJointFHThousandths_NNUE[12][11][11][17][11]; - -// 2026-10-10: beta-side (static-null-move) 4D FH% table -- see data.c's -// header. [depth][gapBeta][ownImprove][enemyImprove]. Cell stores the -// GAP TO 100% FH rate (thousandths of a percentage point), not FH% -// itself -- see _BetaTablePredictedFHThousandths's comment for why. -extern USHORT g_uBetaFHThousandths[12][21][11][11]; - -// 2026-10-21: NNUE-eval counterpart of g_uBetaFHThousandths above -- -// same shape/encoding, collected against the NNUE evaluator. Runtime- -// selected the same way as g_uJointFHThousandths_NNUE above (see -// _BetaTablePredictedFHThousandths, searchsup.c). -extern USHORT g_uBetaFHThousandths_NNUE[12][21][11][11]; +// 2026-10-25: the data.c FH%-prediction histogram tables +// (g_uJointFHThousandths/g_uBetaFHThousandths and their _NNUE +// counterparts) are retired -- replaced by the quantized logistic +// regressions in fhmodel.c/fhmodel_weights.h (see docs/REGRESSION.md +// for the full design/validation trail). This is now the only FH%- +// prediction mechanism; there's no build-time choice between it and +// a table anymore. // 2026-09-15: king-ring bitboard split for _EvalKing's linear-SCORE // rewrite -- front/back mirror EmptyAttackedSquare's old color-dependent @@ -4614,50 +4587,18 @@ EstimateHangingMaterialCp(IN SEARCHER_THREAD_CONTEXT *ctx, IN BITBOARD bbRookAttacksSnapshot[2]); ULONG -HangCpBucket(SCORE iHangCp); - -ULONG -GapCpBucket(SCORE iGapCp); - -ULONG -MoveNumBucket(ULONG uMoveNum); - -ULONG -DepthBucket(ULONG uCandDepth); - -ULONG -ImproveBucket(SCORE iImprovement); - -ULONG -GapBetaBucket(SCORE iGapBeta); - -USHORT -_JointTablePredictedFHThousandths(IN ULONG uRawDepthBucket, - IN ULONG uRawDumbBucket, - IN ULONG uRawGapBucket, - IN ULONG uRawLateBucket, - IN ULONG uRawImproveBucket); - -ULONG -_BetaTablePredictedFHThousandths(IN ULONG uRawDepthBucket, - IN ULONG uGapBetaBucket, - IN ULONG uOwnImproveBucket, - IN ULONG uEnemyImproveBucket); - -ULONG _RefineNodeTypeGuess(IN SEARCHER_THREAD_CONTEXT *ctx, IN SCORE iEval, IN SCORE iAlpha, IN SCORE iBeta, IN ULONG uDepth, IN SCORE iImprovement, - IN SCORE iEnemyImprovement, - IN ULONG uRawImproveB); + IN SCORE iEnemyImprovement); // fhmodel.c -- production inference for the FH% logistic-regression -// models (FH_USE_REGRESSION_MODEL), see docs/REGRESSION.md. No -// separate header -- matches fhcollect.c's own convention of -// declaring everything here rather than a per-module header. +// models, see docs/REGRESSION.md. No separate header -- matches +// fhcollect.c's own convention of declaring everything here rather +// than a per-module header. // // Fully quantized fixed-point integer arithmetic -- no floats, no // runtime log()/exp() calls. @@ -4825,16 +4766,11 @@ SearchOneMove(IN SEARCHER_THREAD_CONTEXT *ctx, // matters once HelpSearch() also calls // this: its first move off the shared // pool is never the node's first move) - IN ULONG uRawDepthB, // node-level hoists, loop-invariant -- - IN ULONG uRawImproveB, // caller computes once, not per-move IN BITBOARD bbMinorAttacksSnapshot[2], IN BITBOARD bbRookAttacksSnapshot[2], -#ifdef FH_USE_REGRESSION_MODEL IN FHM_NODE_BASE sFhAlphaNodeBase, // hoisted node-level - // precompute, same loop-invariant - // convention as uRawDepthB/ - // uRawImproveB above -#endif + // precompute, loop-invariant -- + // caller computes once, not per-move #ifdef MOVE_ORDERING_EVIDENCE_COLLECTION IN FLAG fThisMoveIsCountermoveMatch, IN ULONG uCMEvidenceBucket, |
