From 08ac4e9db5d763edb788f3b01ea5c3bac494defa Mon Sep 17 00:00:00 2001 From: Michael Chaly Date: Mon, 7 Feb 2022 13:32:21 +0300 Subject: [PATCH] Do less depth reduction in null move pruning for complex positions This patch makes us reduce less depth in null move pruning if complexity is high enough. Thus, null move pruning now depends in two distinct ways on complexity, while being the only search heuristic that exploits complexity so far. passed STC https://tests.stockfishchess.org/tests/view/61fde60fd508ec6a1c9f7754 LLR: 2.94 (-2.94,2.94) <0.00,2.50> Total: 170000 W: 45555 L: 45027 D: 79418 Ptnml(0-2): 760, 19352, 44359, 19658, 871 passed LTC https://tests.stockfishchess.org/tests/view/61fe91febf46cb834cbd5c90 LLR: 2.96 (-2.94,2.94) <0.50,3.00> Total: 145272 W: 39182 L: 38651 D: 67439 Ptnml(0-2): 127, 14864, 42157, 15327, 161 closes https://github.com/official-stockfish/Stockfish/pull/3923 bench 4461945 --- src/search.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/search.cpp b/src/search.cpp index 6ca3b56e..426f7937 100644 --- a/src/search.cpp +++ b/src/search.cpp @@ -776,7 +776,9 @@ namespace { // Step 7. Razoring. // If eval is really low check with qsearch if it can exceed alpha, if it can't, // return a fail low. - if (!PvNode && depth <= 6 && eval < alpha - 400 - 300 * depth * depth) + if ( !PvNode + && depth <= 6 + && eval < alpha - 400 - 300 * depth * depth) { value = qsearch(pos, ss, alpha - 1, alpha); if (value < alpha) @@ -805,8 +807,8 @@ namespace { { assert(eval - beta >= 0); - // Null move dynamic reduction based on depth and value - Depth R = std::min(int(eval - beta) / 205, 3) + depth / 3 + 4; + // Null move dynamic reduction based on depth, eval and complexity of position + Depth R = std::min(int(eval - beta) / 205, 3) + depth / 3 + 4 - (complexity > 500); ss->currentMove = MOVE_NULL; ss->continuationHistory = &thisThread->continuationHistory[0][0][NO_PIECE][0]; -- 2.39.2