From 868b63d421ca005876cff93f63a9626e0b0262e9 Mon Sep 17 00:00:00 2001 From: Shawn Xu Date: Wed, 25 Feb 2026 17:51:47 -0800 Subject: [PATCH] Update main network to nn-9a0cc2a62c52.nnue network with new hash encoding. closes https://github.com/official-stockfish/Stockfish/pull/6651 no functional change --- src/evaluate.h | 2 +- src/nnue/nnue_feature_transformer.h | 13 ++++++++++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/src/evaluate.h b/src/evaluate.h index df273f8ae..d7c162cbe 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-5227780996d3.nnue" +#define EvalFileDefaultNameBig "nn-9a0cc2a62c52.nnue" #define EvalFileDefaultNameSmall "nn-37f18f62d772.nnue" namespace NNUE { diff --git a/src/nnue/nnue_feature_transformer.h b/src/nnue/nnue_feature_transformer.h index 5ee5eaac8..a2cc00022 100644 --- a/src/nnue/nnue_feature_transformer.h +++ b/src/nnue/nnue_feature_transformer.h @@ -122,9 +122,20 @@ class FeatureTransformer { static constexpr auto InversePackusEpi16Order = invert_permutation(PackusEpi16Order); + static constexpr std::uint32_t combine_hash(std::initializer_list hashes) { + std::uint32_t hash = 0; + for (const auto component_hash : hashes) + { + hash = (hash << 1) | (hash >> 31); + hash ^= component_hash; + } + return hash; + } + // Hash value embedded in the evaluation file static constexpr std::uint32_t get_hash_value() { - return (UseThreats ? ThreatFeatureSet::HashValue : PSQFeatureSet::HashValue) + return (UseThreats ? combine_hash({ThreatFeatureSet::HashValue, PSQFeatureSet::HashValue}) + : PSQFeatureSet::HashValue) ^ (OutputDimensions * 2); }