From eae0f8dd066b31102b6663a60c36fffccf4e1269 Mon Sep 17 00:00:00 2001 From: Michael Chaly Date: Tue, 8 Mar 2022 10:56:07 +0300 Subject: [PATCH] Decrease reductions in Lmr for some Pv nodes This patch makes us reduce less in Lmr at pv nodes in case of static eval being far away from static evaluation of position. Idea is that if it's the case then probably position is pretty complex so we can't be sure about how reliable LMR is so we need to reduce less. Passed STC: https://tests.stockfishchess.org/tests/view/6226276aa9d47c8160e81220 LLR: 2.94 (-2.94,2.94) <0.00,2.50> Total: 262696 W: 69944 L: 69239 D: 123513 Ptnml(0-2): 1399, 29702, 68436, 30417, 1394 Passed LTC: https://tests.stockfishchess.org/tests/view/6226b002a9d47c8160e82b91 LLR: 2.95 (-2.94,2.94) <0.50,3.00> Total: 64008 W: 17320 L: 16982 D: 29706 Ptnml(0-2): 60, 6378, 18811, 6674, 81 closes https://github.com/official-stockfish/Stockfish/pull/3957 bench 6678390 --- src/search.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/search.cpp b/src/search.cpp index a6552daf..3008079e 100644 --- a/src/search.cpp +++ b/src/search.cpp @@ -1166,6 +1166,11 @@ moves_loop: // When in check, search starts here if (ttCapture) r++; + // Decrease reduction at PvNodes if bestvalue + // is vastly different from static evaluation + if (PvNode && !ss->inCheck && abs(ss->staticEval - bestValue) > 250) + r--; + ss->statScore = thisThread->mainHistory[us][from_to(move)] + (*contHist[0])[movedPiece][to_sq(move)] + (*contHist[1])[movedPiece][to_sq(move)] -- 2.39.2