]> git.sesse.net Git - stockfish/commitdiff
Assign extra bonus for previous move that caused a fail low more often
authorMichael Chaly <Vizvezdenec@gmail.com>
Mon, 6 Dec 2021 00:52:44 +0000 (03:52 +0300)
committerJoost VandeVondele <Joost.VandeVondele@gmail.com>
Mon, 6 Dec 2021 06:42:04 +0000 (07:42 +0100)
This patch allows to assign extra bonus for previous move that caused a fail low not only for PvNodes and cutNodes but also fo some allNodes - namely if the best result we could've got from the search is still far below alpha.

passed STC
https://tests.stockfishchess.org/tests/view/61aa26a49e8855bba1a36d96
LLR: 2.94 (-2.94,2.94) <0.00,2.50>
Total: 73808 W: 19183 L: 18842 D: 35783
Ptnml(0-2): 251, 8257, 19564, 8564, 268

passed LTC
https://tests.stockfishchess.org/tests/view/61aa7dc29e8855bba1a3814f
LLR: 2.94 (-2.94,2.94) <0.50,3.00>
Total: 142416 W: 36717 L: 36192 D: 69507
Ptnml(0-2): 106, 14799, 40862, 15346, 95

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

bench 4724181

src/search.cpp

index 99c4743174dfbb9befae87b2fecca958b2450107..edeed9c030446a9e015cf99218ce2a5ca402315b 100644 (file)
@@ -1380,7 +1380,15 @@ moves_loop: // When in check, search starts here
     // Bonus for prior countermove that caused the fail low
     else if (   (depth >= 3 || PvNode)
              && !priorCapture)
-        update_continuation_histories(ss-1, pos.piece_on(prevSq), prevSq, stat_bonus(depth) * (1 + (PvNode || cutNode)));
+    {
+        //Assign extra bonus if current node is PvNode or cutNode
+        //or fail low was really bad
+        bool extraBonus =    PvNode
+                          || cutNode
+                          || bestValue < alpha - 94 * depth;
+
+        update_continuation_histories(ss-1, pos.piece_on(prevSq), prevSq, stat_bonus(depth) * (1 + extraBonus));
+    }
 
     if (PvNode)
         bestValue = std::min(bestValue, maxValue);