From 76daa88cf878b12a03755dc0550b3fa8e4d19cb1 Mon Sep 17 00:00:00 2001 From: Vizvezdenec Date: Thu, 11 Feb 2021 10:45:16 +0300 Subject: [PATCH] PV-Nodes likely to fail low Do not decrease reduction at pv-nodes which are likely to fail low. The idea of this patch can be described as following: during the search, if a node on the principal variation was re-searched in non-pv search and this re-search got a value which was much lower than alpha, then we can assume that this pv-node is likely to fail low again, and we can reduce more aggressively at this node. Passed STC https://tests.stockfishchess.org/tests/view/6023a5fa7f517a561bc49638 LLR: 2.95 (-2.94,2.94) {-0.25,1.25} Total: 70288 W: 6443 L: 6223 D: 57622 Ptnml(0-2): 239, 5022, 24436, 5174, 273 Passed LTC https://tests.stockfishchess.org/tests/view/6023f2617f517a561bc49661 LLR: 2.94 (-2.94,2.94) {0.25,1.25} Total: 105656 W: 4048 L: 3748 D: 97860 Ptnml(0-2): 67, 3312, 45761, 3630, 58 Closes https://github.com/official-stockfish/Stockfish/pull/3349 Bench: 3766422 --- src/search.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/search.cpp b/src/search.cpp index 80c3e4c2..d77ab691 100644 --- a/src/search.cpp +++ b/src/search.cpp @@ -1025,6 +1025,14 @@ moves_loop: // When in check, search starts from here movedPiece = pos.moved_piece(move); givesCheck = pos.gives_check(move); + // Indicate PvNodes that will probably fail low if node was searched with non-PV search + // at depth equal or greater to current depth and result of this search was far below alpha + bool likelyFailLow = PvNode + && ttMove + && (tte->bound() & BOUND_UPPER) + && ttValue < alpha + 200 + 100 * depth + && tte->depth() >= depth; + // Calculate new depth for this move newDepth = depth - 1; @@ -1172,8 +1180,9 @@ moves_loop: // When in check, search starts from here if (th.marked()) r++; - // Decrease reduction if position is or has been on the PV (~10 Elo) - if (ss->ttPv) + // Decrease reduction if position is or has been on the PV + // and node is not likely to fail low (~10 Elo) + if (ss->ttPv && !likelyFailLow) r -= 2; // Increase reduction at root and non-PV nodes when the best move does not change frequently -- 2.39.2