summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorScott Gasch <[email protected]>2026-10-25 10:47:41 -0700
committerScott Gasch <[email protected]>2026-10-25 10:47:41 -0700
commit93ddedd408cfebb162068d458ea42484cd3f98d2 (patch)
treea0e149c01d53525cff6e44c691247dbdb69cad3d
parentf97b2710981e936cfb500ad0cdf1ceab233efad8 (diff)
Make NNUE eval the default, same convention as the EGTB path default
main.c's InitializeOptions now tries to load "eval.nnue" (a file next to the binary, matching typhoon_nnue's own NNUE_WEIGHTS default -- typically a symlink into head_reference/nnue/current/weights.nnue) after argument parsing, if the user hasn't already enabled NNUE explicitly via --nnueweights or an interactive "nnue load"/"nnue on". Same hardcoded-default-path convention main.c already uses for --egtbpath (/zscratch/egtb). Fails soft: a checkout without eval.nnue present, or one where it fails to load, just falls back to HCE eval exactly as before -- this is a default, not a requirement, so there's no UtilPanic the way --nnueweights's own explicit-request failure path has. The existing interactive "nnue off" command remains the way to explicitly opt back out of NNUE for a given session; a script that wants guaranteed HCE (e.g. an apples-to-apples eval comparison) should add "nnue off;" to its own --command string rather than relying on the old no-flag default. Verified: clean release build, clean DEBUG=1 TEST=1 self-test run (no assertion failures), and manually confirmed both the default-load path (eval.nnue present in cwd) and the silent-fallback path (run from a directory without it) behave as expected; --nnueweights still works unchanged. Co-Authored-By: Claude Sonnet 5 <[email protected]>
-rw-r--r--src/main.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/main.c b/src/main.c
index 2f5428e..73b3758 100644
--- a/src/main.c
+++ b/src/main.c
@@ -521,6 +521,32 @@ Return value:
i++;
}
+
+ // 2026-10-25: NNUE is now the default evaluator, same convention
+ // as szEGTBPath's hardcoded /zscratch/egtb default above -- try to
+ // load a weights file sitting next to the binary (matching
+ // typhoon_nnue's own NNUE_WEIGHTS default) if the user didn't
+ // already enable NNUE explicitly via --nnueweights or an
+ // interactive "nnue load"/"nnue on". Fails soft: a checkout
+ // without eval.nnue present (or a bad/missing file) just falls
+ // back to HCE, exactly like it always did -- this is a default,
+ // not a requirement, so there's no UtilPanic here the way
+ // --nnueweights's own explicit-request failure path has.
+ if ((FALSE == g_fUseNnueEval) &&
+ (TRUE == SystemDoesFileExist("eval.nnue")))
+ {
+ if (NnueLoadWeights("eval.nnue"))
+ {
+ g_fUseNnueEval = TRUE;
+ Trace("Loaded default NNUE weights \"eval.nnue\", "
+ "NNUE eval enabled.\n");
+ }
+ else
+ {
+ Trace("Found \"eval.nnue\" but failed to load it; "
+ "falling back to HCE eval.\n");
+ }
+ }
}