From 27428a61c2fb6fd1ff1f8f0e88746e0680771730 Mon Sep 17 00:00:00 2001 From: Michael Chaly Date: Sat, 26 Apr 2025 19:48:20 +0300 Subject: [PATCH] Allow some nodes to spawn even deeper lmr searches This includes nodes that were PvNode on a previous ply and only for non cutNodes and movecounts < 8. Passed STC: https://tests.stockfishchess.org/tests/view/680cdf2e3629b02d74b15576 LLR: 2.94 (-2.94,2.94) <0.00,2.00> Total: 123552 W: 31979 L: 31539 D: 60034 Ptnml(0-2): 322, 14449, 31803, 14871, 331 Passed LTC: https://tests.stockfishchess.org/tests/view/680cf09a3629b02d74b15599 LLR: 2.94 (-2.94,2.94) <0.50,2.50> Total: 114306 W: 29310 L: 28837 D: 56159 Ptnml(0-2): 51, 12247, 32090, 12708, 57 closes https://github.com/official-stockfish/Stockfish/pull/6022 bench: 1585741 --- src/search.cpp | 6 ++++-- src/search.h | 1 + 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/search.cpp b/src/search.cpp index 79bb44c63..01f0c2c23 100644 --- a/src/search.cpp +++ b/src/search.cpp @@ -708,6 +708,7 @@ Value Search::Worker::search( (ss + 2)->cutoffCnt = 0; Square prevSq = ((ss - 1)->currentMove).is_ok() ? ((ss - 1)->currentMove).to_sq() : SQ_NONE; ss->statScore = 0; + ss->isPvNode = PvNode; // Step 4. Transposition table lookup excludedMove = ss->excludedMove; @@ -1281,8 +1282,9 @@ moves_loop: // When in check, search starts here // std::clamp has been replaced by a more robust implementation. - Depth d = std::max( - 1, std::min(newDepth - r / 1024, newDepth + !allNode + (PvNode && !bestMove))); + Depth d = std::max(1, std::min(newDepth - r / 1024, + newDepth + !allNode + (PvNode && !bestMove))) + + (!cutNode && (ss - 1)->isPvNode && moveCount < 8); ss->reduction = newDepth - d; diff --git a/src/search.h b/src/search.h index 6ef8322a8..6ab98f7c4 100644 --- a/src/search.h +++ b/src/search.h @@ -76,6 +76,7 @@ struct Stack { int cutoffCnt; int reduction; bool isTTMove; + bool isPvNode; };