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); }