diff --git a/src/search.c b/src/search.c index 251cc4d2..3399e4e9 100644 --- a/src/search.c +++ b/src/search.c @@ -347,6 +347,8 @@ static int AlphaBeta(Thread *thread, Stack *ss, int alpha, int beta, Depth depth if (!isTerminal(ttScore) && TTScoreIsMoreInformative(ttBound, ttScore, eval)) eval = ttScore; + int evalCorrection = inCheck ? 0 : abs(eval - unadjustedEval); + // Improving if not in check, and current eval is higher than 2 plies ago bool improving = !inCheck && eval > (ss-2)->staticEval; @@ -550,6 +552,8 @@ static int AlphaBeta(Thread *thread, Stack *ss, int alpha, int beta, Depth depth // Reduce more in cut nodes r += 2 * cutnode; + r -= MIN(2, evalCorrection / 128); + // Depth after reductions, avoiding going straight to quiescence as well as extending Depth lmrDepth = CLAMP(newDepth - r, 1, newDepth);