From: Stefan Geschwentner Date: Sat, 21 Jul 2018 02:21:54 +0000 (+0200) Subject: Non functional LMR rewrite. X-Git-Url: http://winboard.nl/cgi-bin?a=commitdiff_plain;h=53c07c34bb0aba765e1add91bbc932dfce9bae52;p=fairystockfish.git Non functional LMR rewrite. --- diff --git a/src/search.cpp b/src/search.cpp index 0619db3..af7a5c1 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);