From fae57273b20468f534cce5843152a21214b5da05 Mon Sep 17 00:00:00 2001 From: Marco Costalba Date: Sat, 28 Jul 2018 10:38:36 +0200 Subject: [PATCH 1/1] Small tweaks to recent code changes As a note, current 2 LMR conditions on stat score could be simplified in a single line: r -= ((ss->statScore >= 0) - ((ss-1)->statScore >= 0)) * ONE_PLY; We keep them splitted in 2 "if" statements because are easier to (immediately) read. No functional change. --- src/search.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/search.cpp b/src/search.cpp index e8824b6b..b4096eba 100644 --- a/src/search.cpp +++ b/src/search.cpp @@ -935,7 +935,7 @@ moves_loop: // When in check, search starts from here int lmrDepth = std::max(newDepth - reduction(improving, depth, moveCount), DEPTH_ZERO) / ONE_PLY; // Countermoves based pruning (~20 Elo) - if ( lmrDepth <= ((ss-1)->statScore > 0 ? 3 : 2) + if ( lmrDepth < 3 + ((ss-1)->statScore > 0) && (*contHist[0])[movedPiece][to_sq(move)] < CounterMovePruneThreshold && (*contHist[1])[movedPiece][to_sq(move)] < CounterMovePruneThreshold) continue; -- 2.39.2