summaryrefslogtreecommitdiff
path: root/src/command.c
diff options
context:
space:
mode:
authorScott Gasch <[email protected]>2026-10-15 13:11:22 -0700
committerScott Gasch <[email protected]>2026-10-15 13:11:22 -0700
commit993b6eeb2a9ac7b659c473b6883fa53af1ad3a0b (patch)
treec5388824dec15a7691ce9952a6eb4af66e837127 /src/command.c
parent53b380c658f828c4c0e096be2763e6b012c23abd (diff)
Phase A NNUE: feature-indexing spec, annotation/training pipeline, dump nnuefeatures
Builds out the NNUE Phase A prototype per docs/NNUE.md: - src/nnuefeatures.c: standalone HalfKAv2_hm feature-index reference implementation (new `dump nnuefeatures` command), sourced from Stockfish's half_ka_v2_hm.{h,cpp} (sf_16 tag), including the 0x88->64 square conversion typhoon's own board representation needs. - annotate_pgns/: sharded TWIC/self-play annotation harness (annotate.py), position extraction, quiet-position filtering (flat and game-shaped, plus an upstream --prefilter-quiet option), train/holdout game-level stratified split, WDL-sigmoid K fitting, the Python HalfKAv2_hm reference encoder (nnue_feature_spec.py) and its bit-for-bit cross-checker against the C side (cross_check_features.py), and a first PyTorch training pipeline (nnue_model.py, nnue_train.py, build_training_tensors.py) -- a 256x2-32-32-1-ish net trained locally on CPU against ~1.85M quiet TWIC positions as a pipeline/framework validation pass. - Finish an in-progress InitMagic/InitLMRTable/InitEval -> InitializeBitboardMagic/InitializeLMRTable/InitializeEval rename: chess.h's prototypes hadn't been updated to match the already-renamed definitions/call sites, leaving 4 implicit-function-declaration warnings. - tests/arasan.epd: new curated EPD suite. - docs/: add the project's design docs (previously untracked). Co-Authored-By: Claude Sonnet 5 <[email protected]>
Diffstat (limited to 'src/command.c')
-rw-r--r--src/command.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/command.c b/src/command.c
index b30de2b..715c989 100644
--- a/src/command.c
+++ b/src/command.c
@@ -313,6 +313,7 @@ Routine description:
dump sizes
dump eval [optional coor]
dump evaldna
+ dump nnuefeatures
This command is used to dump internal information to the
stdout.
@@ -335,6 +336,12 @@ Routine description:
provided then the eval terms DIRECTLY affected by the piece at
the supplied coordinate is produced. Note: to use dump eval
the engine must have been built with -DEVAL_DUMP.
+
+ When used with the 'nnuefeatures' argument, prints the sorted
+ set of active HalfKAv2_hm feature indices for both
+ perspectives at the current position -- see nnuefeatures.c
+ and docs/NNUE.md. Reference-implementation-only, not wired
+ into eval/search.
Parameters:
@@ -376,12 +383,16 @@ Return value:
{
DumpSizes();
}
- else if (!STRCMPI(argv[1], "evaldna"))
+ else if (!STRCMPI(argv[1], "evaldna"))
{
char *p = ExportEvalDNA();
Trace("EvalDNA: %s\n", p);
free(p);
}
+ else if (!STRCMPI(argv[1], "nnuefeatures"))
+ {
+ DumpNnueFeatures(pos);
+ }
#ifdef EVAL_DUMP
else if (!STRCMPI(argv[1], "eval"))
{
@@ -737,7 +748,7 @@ Return value:
// ROOK_ON_HALF_OPEN_WITH_FRIEND, kept static rather than
// rebuilt every _EvalRook call since it's speed-critical
// code -- a DNA reload has to explicitly refresh it.
- InitEval();
+ InitializeEval();
// EvalCommand's persistent SEARCHER_THREAD_CONTEXT keeps
// its embedded eval hash alive across calls for speed; a