From 8da3c2155a86a78d24aaf454264cf1bc93cb2d3a Mon Sep 17 00:00:00 2001 From: Nonlinear2 <131959792+Nonlinear2@users.noreply.github.com> Date: Sat, 31 May 2025 15:43:19 +0200 Subject: [PATCH] Simplify NMP eval in qsearch Passed non-regression STC: https://tests.stockfishchess.org/tests/view/6834e9436ec7634154f9cd6e LLR: 2.95 (-2.94,2.94) <-1.75,0.25> Total: 24864 W: 6626 L: 6394 D: 11844 Ptnml(0-2): 62, 2806, 6477, 3012, 75 Passed non-regression LTC: https://tests.stockfishchess.org/tests/view/683598fd6ec7634154f9ce82 LLR: 2.94 (-2.94,2.94) <-1.75,0.25> Total: 200148 W: 51461 L: 51424 D: 97263 Ptnml(0-2): 92, 21672, 56503, 21721, 86 closes https://github.com/official-stockfish/Stockfish/pull/6109 Bench: 2316591 --- src/search.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/search.cpp b/src/search.cpp index 93fe7e588..197da7a4f 100644 --- a/src/search.cpp +++ b/src/search.cpp @@ -1589,9 +1589,8 @@ Value Search::Worker::qsearch(Position& pos, Stack* ss, Value alpha, Value beta) } else { - // In case of null move search, use previous static eval with opposite sign - unadjustedStaticEval = - (ss - 1)->currentMove != Move::null() ? evaluate(pos) : -(ss - 1)->staticEval; + unadjustedStaticEval = evaluate(pos); + ss->staticEval = bestValue = to_corrected_static_eval(unadjustedStaticEval, correctionValue); }