]> git.sesse.net Git - stockfish/commitdiff
Assign negative stat bonuses for quiet moves at Pv nodes
authorMichael Chaly <Vizvezdenec@gmail.com>
Wed, 5 Apr 2023 02:48:34 +0000 (05:48 +0300)
committerJoost VandeVondele <Joost.VandeVondele@gmail.com>
Wed, 5 Apr 2023 06:23:54 +0000 (08:23 +0200)
This patch assigns negative stat bonuses for quiet moves
at pv nodes which are searched at depth greater than
this node assumes, so are extended.

Passed STC:
https://tests.stockfishchess.org/tests/view/6426198bdb43ab2ba6f9cfa2
LLR: 2.94 (-2.94,2.94) <0.00,2.00>
Total: 548944 W: 147287 L: 146254 D: 255403
Ptnml(0-2): 1662, 59772, 150671, 60605, 1762

Passed LTC:
https://tests.stockfishchess.org/tests/view/642be4f177ff3301150d892d
LLR: 2.95 (-2.94,2.94) <0.50,2.50>
Total: 93352 W: 25400 L: 24994 D: 42958
Ptnml(0-2): 44, 8817, 28547, 9225, 43

closes https://github.com/official-stockfish/Stockfish/pull/4495

bench 5044536

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