From b2e60960b39d7191105193d5ff8b7482dbcbf351 Mon Sep 17 00:00:00 2001 From: KazApps Date: Sun, 28 Dec 2025 14:54:37 +0100 Subject: [PATCH] Fix nonPawnKey Fix incorrect nonPawnKey update Passed non-reg SMP STC: ``` LLR: 2.93 (-2.94,2.94) <-1.75,0.25> Total: 139424 W: 35792 L: 35690 D: 67942 Ptnml(0-2): 197, 15783, 37665, 15855, 212 ``` https://tests.stockfishchess.org/tests/view/694b7b7e572093c1986d6b0d Passed non-reg SMP LTC: ``` LLR: 2.95 (-2.94,2.94) <-1.75,0.25> Total: 88880 W: 22863 L: 22718 D: 43299 Ptnml(0-2): 16, 8947, 26401, 9028, 48 ``` https://tests.stockfishchess.org/tests/view/694d2ceb572093c1986d6fc8 fixes https://github.com/official-stockfish/Stockfish/issues/6492 closes https://github.com/official-stockfish/Stockfish/pull/6494 Bench: 2475788 --- src/position.cpp | 1 + src/search.cpp | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/position.cpp b/src/position.cpp index 7377b2029..cfbb85e84 100644 --- a/src/position.cpp +++ b/src/position.cpp @@ -855,6 +855,7 @@ void Position::do_move(Move m, k ^= Zobrist::psq[promotion][to]; st->materialKey ^= Zobrist::psq[promotion][8 + pieceCount[promotion] - 1] ^ Zobrist::psq[pc][8 + pieceCount[pc]]; + st->nonPawnKey[us] ^= Zobrist::psq[promotion][to]; if (promotionType <= BISHOP) st->minorPieceKey ^= Zobrist::psq[promotion][to]; diff --git a/src/search.cpp b/src/search.cpp index 41bbcd6d3..86b69db57 100644 --- a/src/search.cpp +++ b/src/search.cpp @@ -89,7 +89,7 @@ int correction_value(const Worker& w, const Position& pos, const Stack* const ss + (*(ss - 4)->continuationCorrectionHistory)[pos.piece_on(m.to_sq())][m.to_sq()] : 8; - return 10347 * pcv + 8821 * micv + 11168 * (wnpcv + bnpcv) + 7841 * cntcv; + return 10347 * pcv + 8821 * micv + 11665 * (wnpcv + bnpcv) + 7841 * cntcv; } // Add correctionHistory value to raw staticEval and guarantee evaluation