]> git.sesse.net Git - stockfish/blobdiff - src/search.cpp
LMR Tweak
[stockfish] / src / search.cpp
index 2c2321ee9ca0bb5f48bd99b4fc068986a8d2a297..f50fdf8803fbaa7c58981058e490ff5dac8ecc9d 100644 (file)
@@ -1114,6 +1114,13 @@ moves_loop: // When in check, search starts from here
                              + (*contHist[3])[movedPiece][to_sq(move)]
                              - 4000;
 
+              // Reset statScore to zero if negative and most stats shows >= 0
+              if (    ss->statScore < 0
+                  && (*contHist[0])[movedPiece][to_sq(move)] >= 0
+                  && (*contHist[1])[movedPiece][to_sq(move)] >= 0
+                  && thisThread->mainHistory[us][from_to(move)] >= 0)
+                  ss->statScore = 0;
+
               // Decrease/increase reduction by comparing opponent's stat score (~10 Elo)
               if (ss->statScore >= 0 && (ss-1)->statScore < 0)
                   r -= ONE_PLY;
@@ -1144,6 +1151,9 @@ moves_loop: // When in check, search starts from here
               int bonus = value > alpha ?  stat_bonus(newDepth)
                                         : -stat_bonus(newDepth);
 
+              if (move == ss->killers[0])
+                 bonus += bonus / 4;
+
               update_continuation_histories(ss, movedPiece, to_sq(move), bonus);
           }
       }