]> git.sesse.net Git - stockfish/blobdiff - src/search.cpp
Use CounterMoveHistory when calculating LMR for cut nodes
[stockfish] / src / search.cpp
index 085bca3a8f5fce6370e908bb80b5f75cd199ca02..c5da0d4f7473d512ef582b89f438296317faa54c 100644 (file)
@@ -964,7 +964,9 @@ moves_loop: // When in check and at SpNode search starts from here
           ss->reduction = reduction<PvNode>(improving, depth, moveCount);
 
           if (   (!PvNode && cutNode)
-              ||  History[pos.piece_on(to_sq(move))][to_sq(move)] < VALUE_ZERO)
+              ||  History[pos.piece_on(to_sq(move))][to_sq(move)] < VALUE_ZERO
+              ||  CounterMovesHistory[pos.piece_on(prevMoveSq)][prevMoveSq][pos.piece_on(to_sq(move))][to_sq(move)]
+                + History[pos.piece_on(to_sq(move))][to_sq(move)] < VALUE_ZERO)
               ss->reduction += ONE_PLY;
 
           if (move == countermoves[0] || move == countermoves[1])