X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=src%2Fsearch.cpp;h=5839763dc7fd647fa8e91d92cb874e54368c1126;hb=219fa2f0a79381d35d9eb1240781cc598e74f647;hp=77619345c8f397cc9f7d577a20063f460c6973d5;hpb=6c1df553fa7a94551de7b07515a29098a2f23c16;p=stockfish diff --git a/src/search.cpp b/src/search.cpp index 77619345..5839763d 100644 --- a/src/search.cpp +++ b/src/search.cpp @@ -1184,8 +1184,11 @@ moves_loop: // When in check, search starts here // Do full depth search when reduced LMR search fails high if (value > alpha && d < newDepth) { + // Adjust full depth search based on LMR results - if result + // was good enough search deeper, if it was bad enough search shallower const bool doDeeperSearch = value > (alpha + 64 + 11 * (newDepth - d)); - value = -search(pos, ss+1, -(alpha+1), -alpha, newDepth + doDeeperSearch, !cutNode); + const bool doShallowerSearch = value < bestValue + newDepth; + value = -search(pos, ss+1, -(alpha+1), -alpha, newDepth + doDeeperSearch - doShallowerSearch, !cutNode); int bonus = value > alpha ? stat_bonus(newDepth) : -stat_bonus(newDepth);