]> git.sesse.net Git - stockfish/blobdiff - src/search.cpp
Assign negative stat bonuses for quiet moves at Pv nodes
[stockfish] / src / search.cpp
index 749de792dd63c6589b5d8924a7d914991d622fb5..aa1a3e8c17fec2a39407c3753e95338e9cd5d443 100644 (file)
@@ -290,7 +290,7 @@ void Thread::search() {
 
   bestValue = delta = alpha = -VALUE_INFINITE;
   beta = VALUE_INFINITE;
-  optimism[us] = optimism[~us] = VALUE_ZERO;
+  optimism[WHITE] = optimism[BLACK] = VALUE_ZERO;
 
   if (mainThread)
   {
@@ -1257,6 +1257,9 @@ moves_loop: // When in check, search starts here
           (ss+1)->pv[0] = MOVE_NONE;
 
           value = -search<PV>(pos, ss+1, -beta, -alpha, newDepth, false);
+
+          if (moveCount > 1 && newDepth >= depth && !capture)
+              update_continuation_histories(ss, movedPiece, to_sq(move), -stat_bonus(newDepth));
       }
 
       // Step 19. Undo move