summaryrefslogtreecommitdiff
path: root/src/command.c
diff options
context:
space:
mode:
authorScott Gasch <[email protected]>2026-10-20 18:37:20 -0700
committerScott Gasch <[email protected]>2026-10-20 18:37:20 -0700
commit9cf14e14e6999420f234cda951894337e034f57c (patch)
treed4845d0cf127ef4226a5cd2e60472ee750213614 /src/command.c
parentc8c6bbc2c1a103e5b07b079a0f8bdf66c7724d80 (diff)
NNUE: re-fit raw-to-score calibration, NNU4 weight format, super-lazy default-on, lazy probe measured net-negative
Fits an affine (a + b*raw) correction into every exported .nnue file (export_nnue_weights.py's CalibrateScoreMapping) so the engine's consumed centipawn output tracks Stockfish's real score scale rather than the net's nominal raw WDL-sigmoid output -- training variance alone shifts this mapping across retrains even with an identical recipe, so it's re-fit and baked in per export rather than assumed constant. Weight format bumped to "NNU4" to carry the two new floats; older NNU1/2/3 files are no longer readable. Super-lazy (material-only) pre-filter promoted to default-on (g_fUseNnueSuperLazy = TRUE) with a recalibrated per-material-bucket margin table (measured against the recalibrated net, 16-shard cross_sectional_200k.ep_ sample) -- real, measured nps win across all three curated suites. The separate lazy-probe gate (accumulator-based early exit) is measured net-negative on real search traffic at this net's probe-vs-forward latency ratio and stays off by default (g_fUseNnueLazyProbe = FALSE); code kept live since margin tuning could still flip this, per docs/NNUE.md. Also: direct per-call latency instrumentation for NnueProbeScore/ NnueForward (root.c, EVAL_TIME build) to make the lazy-probe breakeven math measurable directly instead of inferred; QSearch futility margins given real-data-derived NNUE_FULL/NNUE_LAZY starting points. Co-Authored-By: Claude Sonnet 5 <[email protected]>
Diffstat (limited to 'src/command.c')
-rw-r--r--src/command.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/command.c b/src/command.c
index 1767e98..9808c33 100644
--- a/src/command.c
+++ b/src/command.c
@@ -992,14 +992,22 @@ Return value:
if (!STRCMPI(argv[1], "superlazyon"))
{
+ // 2026-10-20: margin cp is now optional -- omit it to use
+ // eval.c's calibrated iNnueSuperLazyMarginByMatBucket table
+ // (the normal case); pass one to force a flat override across
+ // every material bucket instead, same convention as
+ // "nnue lazymargin".
if (argc < 3)
{
- Trace("Usage: nnue superlazyon <margin cp>\n");
+ g_iNnueSuperLazyMargin = -1;
+ g_fUseNnueSuperLazy = TRUE;
+ Trace("NNUE super-lazy (material-only) pre-filter enabled, "
+ "using calibrated per-bucket margin table.\n");
return;
}
g_iNnueSuperLazyMargin = (SCORE)atoi(argv[2]);
g_fUseNnueSuperLazy = TRUE;
- Trace("NNUE super-lazy (material-only) pre-filter enabled, margin=%d cp.\n",
+ Trace("NNUE super-lazy (material-only) pre-filter enabled, flat margin=%d cp.\n",
g_iNnueSuperLazyMargin);
return;
}