From fac506bdf3f0ed46fd0823ff1ed592824f91aa5a Mon Sep 17 00:00:00 2001 From: sscg13 Date: Sat, 31 Jan 2026 09:57:10 -0800 Subject: [PATCH] Update NNUE architecture to SFNNv11 and net nn-3dd094f3dfcf.nnue Removes threat features of the form piece -> king, thus saving 13MB of net space and approximately 0.8 threat feature updates per incremental accumulator update. Passed non-regression STC: LLR: 2.93 (-2.94,2.94) <-1.75,0.25> Total: 33664 W: 8864 L: 8636 D: 16164 Ptnml(0-2): 136, 3926, 8501, 4112, 157 https://tests.stockfishchess.org/tests/view/6981dcda4776a4e6e7fef2ac Passed non-regression LTC: LLR: 2.94 (-2.94,2.94) <-1.75,0.25> Total: 46896 W: 12077 L: 11881 D: 22938 Ptnml(0-2): 41, 5118, 12924, 5334, 31 https://tests.stockfishchess.org/tests/view/69827c6beb87369ff4d0c7d5 closes https://github.com/official-stockfish/Stockfish/pull/6593 bench: 2668754 --- src/evaluate.h | 2 +- src/nnue/features/full_threats.h | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/evaluate.h b/src/evaluate.h index b4f54a381..226170e12 100644 --- a/src/evaluate.h +++ b/src/evaluate.h @@ -33,7 +33,7 @@ namespace Eval { // for the build process (profile-build and fishtest) to work. Do not change the // name of the macro or the location where this macro is defined, as it is used // in the Makefile/Fishtest. -#define EvalFileDefaultNameBig "nn-c288c895ea92.nnue" +#define EvalFileDefaultNameBig "nn-3dd094f3dfcf.nnue" #define EvalFileDefaultNameSmall "nn-37f18f62d772.nnue" namespace NNUE { diff --git a/src/nnue/features/full_threats.h b/src/nnue/features/full_threats.h index 5b2582954..a71368ad4 100644 --- a/src/nnue/features/full_threats.h +++ b/src/nnue/features/full_threats.h @@ -30,8 +30,8 @@ class Position; namespace Stockfish::Eval::NNUE::Features { -static constexpr int numValidTargets[PIECE_NB] = {0, 6, 12, 10, 10, 12, 8, 0, - 0, 6, 12, 10, 10, 12, 8, 0}; +static constexpr int numValidTargets[PIECE_NB] = {0, 6, 10, 8, 8, 10, 8, 0, + 0, 6, 10, 8, 8, 10, 8, 0}; class FullThreats { public: @@ -42,7 +42,7 @@ class FullThreats { static constexpr std::uint32_t HashValue = 0x8f234cb8u; // Number of feature dimensions - static constexpr IndexType Dimensions = 79856; + static constexpr IndexType Dimensions = 66864; // clang-format off // Orient a square according to perspective (rotates by 180 for black) @@ -59,10 +59,10 @@ class FullThreats { static constexpr int map[PIECE_TYPE_NB-2][PIECE_TYPE_NB-2] = { {0, 1, -1, 2, -1, -1}, - {0, 1, 2, 3, 4, 5}, - {0, 1, 2, 3, -1, 4}, - {0, 1, 2, 3, -1, 4}, - {0, 1, 2, 3, 4, 5}, + {0, 1, 2, 3, 4, -1}, + {0, 1, 2, 3, -1, -1}, + {0, 1, 2, 3, -1, -1}, + {0, 1, 2, 3, 4, -1}, {0, 1, 2, 3, -1, -1} }; // clang-format on