From 910d26b5c30bb68845e032a8f2aac82f19c96262 Mon Sep 17 00:00:00 2001 From: Giacomo Lorenzetti Date: Sat, 24 Jul 2021 22:03:29 +0200 Subject: [PATCH] Simplification in LMR This commit removes the `!captureOrPromotion` condition from ttCapture reduction and from good/bad history reduction (similar to #3619). passed STC: https://tests.stockfishchess.org/tests/view/60fc734ad8a6b65b2f3a7922 LLR: 2.97 (-2.94,2.94) <-2.50,0.50> Total: 48680 W: 3855 L: 3776 D: 41049 Ptnml(0-2): 118, 3145, 17744, 3206, 127 passed LTC: https://tests.stockfishchess.org/tests/view/60fce7d5d8a6b65b2f3a794c LLR: 2.93 (-2.94,2.94) <-2.50,0.50> Total: 86528 W: 2471 L: 2450 D: 81607 Ptnml(0-2): 28, 2203, 38777, 2232, 24 closes https://github.com/official-stockfish/Stockfish/pull/3629 Bench: 4951406 --- src/search.cpp | 27 ++++++++++++--------------- 1 file changed, 12 insertions(+), 15 deletions(-) diff --git a/src/search.cpp b/src/search.cpp index c41df1f0..f412d9d6 100644 --- a/src/search.cpp +++ b/src/search.cpp @@ -1159,21 +1159,18 @@ moves_loop: // When in check, search starts from here if (cutNode && move != ss->killers[0]) r += 2; - if (!captureOrPromotion) - { - // Increase reduction if ttMove is a capture (~3 Elo) - if (ttCapture) - r++; - - ss->statScore = thisThread->mainHistory[us][from_to(move)] - + (*contHist[0])[movedPiece][to_sq(move)] - + (*contHist[1])[movedPiece][to_sq(move)] - + (*contHist[3])[movedPiece][to_sq(move)] - - 4923; - - // Decrease/increase reduction for moves with a good/bad history (~30 Elo) - r -= ss->statScore / 14721; - } + // Increase reduction if ttMove is a capture (~3 Elo) + if (ttCapture) + r++; + + ss->statScore = thisThread->mainHistory[us][from_to(move)] + + (*contHist[0])[movedPiece][to_sq(move)] + + (*contHist[1])[movedPiece][to_sq(move)] + + (*contHist[3])[movedPiece][to_sq(move)] + - 4923; + + // Decrease/increase reduction for moves with a good/bad history (~30 Elo) + r -= ss->statScore / 14721; // In general we want to cap the LMR depth search at newDepth. But if // reductions are really negative and movecount is low, we allow this move -- 2.39.2