From d91c7f6eac385faa68d12d46eaf91ea6909a2f52 Mon Sep 17 00:00:00 2001 From: Shawn Xu Date: Thu, 2 Jul 2026 14:46:07 -0700 Subject: [PATCH] Update main network to nn-0ee0657fb25e.nnue Passed STC: LLR: 2.93 (-2.94,2.94) <0.00,2.00> Total: 26976 W: 7185 L: 6883 D: 12908 Ptnml(0-2): 89, 3058, 6895, 3354, 92 https://tests.stockfishchess.org/tests/view/6a46dd46f97ff95f78795707 Passed LTC: LLR: 2.95 (-2.94,2.94) <0.50,2.50> Total: 101394 W: 26460 L: 26009 D: 48925 Ptnml(0-2): 74, 10871, 28367, 11300, 85 https://tests.stockfishchess.org/tests/view/6a46eff2f97ff95f7879573b fixes a potential overflow when rescaling network evals. nettest: vondele/nettest#403 closes https://github.com/official-stockfish/Stockfish/pull/6944 Bench: 2752030 --- src/evaluate.cpp | 7 ++++--- src/evaluate.h | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/evaluate.cpp b/src/evaluate.cpp index f714cd01b..03727b899 100644 --- a/src/evaluate.cpp +++ b/src/evaluate.cpp @@ -27,6 +27,7 @@ #include #include +#include "misc.h" #include "nnue/network.h" #include "nnue/nnue_misc.h" #include "position.h" @@ -52,11 +53,11 @@ Value Eval::evaluate(const Eval::NNUE::Network& network, // Blend optimism and eval with nnue complexity int nnueComplexity = std::abs(psqt - positional); - optimism += optimism * nnueComplexity / 476; - nnue -= nnue * nnueComplexity / 18236; + optimism += optimism * i64(nnueComplexity) / 476; + nnue -= nnue * i64(nnueComplexity) / 18236; int material = 534 * pos.count() + pos.non_pawn_material(); - int v = (nnue * (77871 + material) + optimism * (7191 + material)) / 77871; + int v = (nnue * i64(77871 + material) + optimism * i64(7191 + material)) / 77871; // Damp down the evaluation linearly when shuffling v -= v * pos.rule50_count() / 199; diff --git a/src/evaluate.h b/src/evaluate.h index 12d12af6e..e62cec409 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 EvalFileDefaultName "nn-2ab42c9eeb3e.nnue" +#define EvalFileDefaultName "nn-0ee0657fb25e.nnue" namespace NNUE { class Network;