diff options
| author | Scott Gasch <[email protected]> | 2026-10-15 13:11:22 -0700 |
|---|---|---|
| committer | Scott Gasch <[email protected]> | 2026-10-15 13:11:22 -0700 |
| commit | 993b6eeb2a9ac7b659c473b6883fa53af1ad3a0b (patch) | |
| tree | c5388824dec15a7691ce9952a6eb4af66e837127 /src/data.c | |
| parent | 53b380c658f828c4c0e096be2763e6b012c23abd (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/data.c')
| -rw-r--r-- | src/data.c | 12 |
1 files changed, 6 insertions, 6 deletions
@@ -895,7 +895,7 @@ Return value: // board_representation/MOVEGEN_MIGRATION.md sections 2a/3 for the // full design writeup. Everything here (occupancy masks, magic // numbers, and the attack tables they index into) is computed once at -// startup by InitMagic(), never hardcoded -- a validation prototype +// startup by InitializeBitboardMagic(), never hardcoded -- a validation prototype // measured the full search+build+verify cost at ~0.22s for both piece // types combined, cheap enough to just pay at every process launch // rather than maintaining hand-pasted constants that could silently @@ -911,7 +911,7 @@ Return value: // count, and therefore the attack table size, minimal). // // g_RookMagic[c] / g_BishopMagic[c] and g_RookMagicShift[c] / -// g_BishopMagicShift[c]: found by InitMagic() via a random +// g_BishopMagicShift[c]: found by InitializeBitboardMagic() via a random // sparse-candidate search, fixed-seeded (see g_MagicRngState below) // so a given build reproduces the exact same magics on every run -- // deliberately NOT using libc's rand()/srand(), since main.c's @@ -968,7 +968,7 @@ _MagicSparseRandom64(void) } // Slow, obviously-correct reference used both to build each magic -// table's contents and to verify it before InitMagic() accepts it: +// table's contents and to verify it before InitializeBitboardMagic() accepts it: // walk each of the 4 directions from c until (and including) the // first occupied square, given a full occupancy bitboard covering // both sides' pieces. @@ -1066,7 +1066,7 @@ _MagicFindAndBuildForSquare(COOR c, BITBOARD mask, const int iDelta[4], if ((NULL == rgbbOccupancy) || (NULL == rgbbAttacks) || (NULL == rgbbTable) || (NULL == rgfFilled)) { - Bug("InitMagic: out of memory building table for square %d\n", c); + Bug("InitializeBitboardMagic: out of memory building table for square %d\n", c); } for (i = 0; i < uSize; i++) @@ -1128,7 +1128,7 @@ _MagicFindAndBuildForSquare(COOR c, BITBOARD mask, const int iDelta[4], if (rgbbTable[uIndex] != bbExpected) { - Bug("InitMagic: verification failed for square %d, " + Bug("InitializeBitboardMagic: verification failed for square %d, " "occupancy subset %lu\n", c, i); } } @@ -1142,7 +1142,7 @@ _MagicFindAndBuildForSquare(COOR c, BITBOARD mask, const int iDelta[4], } void -InitMagic(void) +InitializeBitboardMagic(void) /** Routine description: |
