diff options
| author | Scott Gasch <[email protected]> | 2026-10-25 09:55:30 -0700 |
|---|---|---|
| committer | Scott Gasch <[email protected]> | 2026-10-25 09:55:30 -0700 |
| commit | 874ef0478078ef4eb436af7d2b68a353f61f4d70 (patch) | |
| tree | e9954c289393c64d88402beff04637b52732ca73 /src/GNUmakefile | |
| parent | 5f901d737b17c5f99b6e456d6c0c7d5e3c093dc4 (diff) | |
Learned FH% logistic-regression model (alpha full, beta whole-node-only)
Replaces the data.c histogram tables (g_uJointFHThousandths/
g_uBetaFHThousandths and their _NNUE counterparts) with two quantized
logistic regressions as the default FH%-prediction mechanism under
FH_USE_REGRESSION_MODEL=1, trained against real collected search data
(fhcollect.c) per docs/REGRESSION.md.
Alpha side is a full per-move regression, validated against the old
table (0.119pp weighted mean deviation across 10,684 matched cells).
Beta side is whole-node-only (matching the old table's own scope --
no functionality lost), refit on the NO_MOVE population after an
earlier mixed-tier fit saturated and over-pruned; its skip threshold
(FH_BETA_SKIP_THRESHOLD=99000) was confirmed by direct self-play
sweeps, not just ECM solve-count intuition (see docs/REGRESSION.md's
"Category A vs B" discussion).
Gated by an overnight SPRT match (regression vs HEAD tables, same
NNUE eval, sd8): at 4120 games, llr=+2.53 (never dipped negative,
peaked +2.8), score=0.517, candidate reaching comparable depth at
higher nps/ebf than head. Did not cross the H1=+2.94 SPRT bound, but
the trend across the full run is unambiguous and the marginal value of
waiting out the remaining games was judged not worth it.
The data.c tables are left in place as the inactive #else branch of
FH_USE_REGRESSION_MODEL for now; a follow-up commit will flip the
build default and remove them once this commit's head_reference
baseline and ECM numbers are recorded.
Co-Authored-By: Claude Sonnet 5 <[email protected]>
Diffstat (limited to 'src/GNUmakefile')
| -rw-r--r-- | src/GNUmakefile | 48 |
1 files changed, 25 insertions, 23 deletions
diff --git a/src/GNUmakefile b/src/GNUmakefile index 041ffbd..f462b07 100644 --- a/src/GNUmakefile +++ b/src/GNUmakefile @@ -169,28 +169,27 @@ endif ifdef PERF_COUNTERS PROFILE += -DPERF_COUNTERS endif -# 2026-10-10: this flag was referenced (search.c's joint-table/marginal -# collection block, #ifdef FH_TABLE_COLLECTION) but never actually wired -# to a compiler define anywhere in this makefile -- every prior -# collection run must have been built some other way (or this gap -# predates the comment claiming it's "a live, in-progress collection -# run"). Requires PERF_COUNTERS=1 too (the block this gates is nested -# inside an outer #ifdef PERF_COUNTERS). -# -# Re-added 2026-10-20: this wiring was itself silently dropped at some -# point after landing (collateral damage from the 2026-10-14 PRUNE_VERIFY/ -# PRUNE_LIVE dead-flag cleanup, going by GNUmakefile.orig's surviving copy) -# -- every FH_TABLE_COLLECTION=1 build in between compiled clean but -# never actually included the instrumentation. Caught before launching -# the NNUE dual-table re-collection run; a smoke-test build+run with -# this restored confirmed -DFH_TABLE_COLLECTION actually reaches the -# compiler and the (currently 4D-alpha-only, no beta side -- see -# docs/NNUE.md) FOURAXISRAW dump fires. The original run's richer -# ALPHARAW/BETARAW/ESTRAW dump format no longer exists in this tree at -# all (not just unwired) -- that's the separate, larger restoration -# this collection run is waiting on, tracked alongside this fix. -ifdef FH_TABLE_COLLECTION -PROFILE += -DFH_TABLE_COLLECTION +# 2026-10-24: FH_TABLE_COLLECTION (the discrete 5D-alpha/4D-beta +# histogram collection, used to re-derive data.c's table) is retired in +# favor of FH_REGRESSION_COLLECTION -- see docs/REGRESSION.md. The old +# flag's history (two separate "was referenced but never wired to the +# compiler" incidents, 2026-10-10 and 2026-10-20) is kept here for +# context since the same per-shard build-sanity check ("confirm the +# define actually reaches the compiler, don't just assume the ifdef +# wiring survived the last refactor") applies to its replacement too. +# Requires PERF_COUNTERS=1 (the block this gates is nested inside an +# outer #ifdef PERF_COUNTERS), same as the old flag. +ifdef FH_REGRESSION_COLLECTION +PROFILE += -DFH_REGRESSION_COLLECTION +endif +# Safety toggle (2026-10-24) -- opt-in only, so the new regression +# model (fhmodel.c) doesn't become the default until it's been through +# the validation ladder docs/REGRESSION.md describes (DEBUG=1 TEST=1, +# debug_smoke_test.sh, sd10/sn5000000 suite diffs, match_play.py). +# Mutually exclusive with FH_REGRESSION_COLLECTION in practice (that +# profile needs the OLD table live and uncensored to collect against). +ifdef FH_USE_REGRESSION_MODEL +PROFILE += -DFH_USE_REGRESSION_MODEL endif ifdef MOVE_ORDERING_EVIDENCE_COLLECTION PROFILE += -DMOVE_ORDERING_EVIDENCE_COLLECTION @@ -396,7 +395,7 @@ OBJS = main.o root.o search.o searchsup.o draw.o dynamic.o \ input.o vars.o util.o unix.o gamelist.o mersenne.o \ sig.o piece.o ics.o san.o fen.o book.o bench.o board.o \ data.o probe.o fathom.o recogn.o list.o x64.o \ - nnuefeatures.o nnueaccum.o nnueeval.o + nnuefeatures.o nnueaccum.o nnueeval.o fhmodel.o ifdef TEST # ---> .o, not .c! <--- @@ -414,6 +413,9 @@ endif ifdef TREEDUMP OBJS += dumptree.o endif +ifdef FH_REGRESSION_COLLECTION +OBJS += fhcollect.o +endif ifdef MP OBJS += split.o endif |
