From 53c07c34bb0aba765e1add91bbc932dfce9bae52 Mon Sep 17 00:00:00 2001 From: Stefan Geschwentner Date: Sat, 21 Jul 2018 04:21:54 +0200 Subject: [PATCH] Non functional LMR rewrite. --- src/search.cpp | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/search.cpp b/src/search.cpp index 0619db3a..af7a5c13 100644 --- a/src/search.cpp +++ b/src/search.cpp @@ -985,11 +985,9 @@ moves_loop: // When in check, search starts from here if (captureOrPromotion) // (~5 Elo) { - // Increase reduction by comparing opponent's stat score - if ((ss-1)->statScore >= 0) - r += ONE_PLY; - - r -= r ? ONE_PLY : DEPTH_ZERO; + // Decrease reduction by comparing opponent's stat score + if ((ss-1)->statScore < 0) + r -= ONE_PLY; } else { @@ -1030,10 +1028,10 @@ moves_loop: // When in check, search starts from here r += ONE_PLY; // Decrease/increase reduction for moves with a good/bad history (~30 Elo) - r = std::max(DEPTH_ZERO, (r / ONE_PLY - ss->statScore / 20000) * ONE_PLY); + r -= ss->statScore / 20000 * ONE_PLY; } - Depth d = std::max(newDepth - r, ONE_PLY); + Depth d = std::max(newDepth - std::max(r, DEPTH_ZERO), ONE_PLY); value = -search(pos, ss+1, -(alpha+1), -alpha, d, true); -- 2.39.2