]> git.sesse.net Git - stockfish/commitdiff
Do more aggressive pruning for some node types
authorMichael Chaly <Vizvezdenec@gmail.com>
Thu, 2 Dec 2021 20:41:23 +0000 (23:41 +0300)
committerJoost VandeVondele <Joost.VandeVondele@gmail.com>
Fri, 3 Dec 2021 07:54:46 +0000 (08:54 +0100)
This patch allows more aggressive futility/see based pruning for PV nodes with low delta and non-pv nodes.

Fixes some white space issues.

Passed STC
https://tests.stockfishchess.org/tests/view/61a5ed33d16c530b5dcc27cc
LLR: 2.95 (-2.94,2.94) <0.00,2.50>
Total: 182088 W: 47121 L: 46584 D: 88383
Ptnml(0-2): 551, 20687, 48037, 21212, 557

Passed LTC
https://tests.stockfishchess.org/tests/view/61a74dfdbd5c4360bcded0ac
LLR: 2.94 (-2.94,2.94) <0.50,3.00>
Total: 87136 W: 22494 L: 22103 D: 42539
Ptnml(0-2): 38, 8918, 25272, 9295, 45

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

bench 4332259

src/misc.cpp
src/misc.h
src/search.cpp

index 294b7c8f85b78381748cdc55929742ade02c6e92..b46786dff08e0e98badfbbe1373a08d3979c8432 100644 (file)
@@ -515,7 +515,7 @@ int best_node(size_t idx) {
   if (!fun1)
       return -1;
 
-  // First call to GetLogicalProcessorInformationEx() to get returnLength. 
+  // First call to GetLogicalProcessorInformationEx() to get returnLength.
   // We expect the call to fail due to null buffer.
   if (fun1(RelationAll, nullptr, &returnLength))
       return -1;
@@ -589,13 +589,13 @@ void bindThisThread(size_t idx) {
   if (!fun2 || !fun3)
       return;
 
-  if (!fun4 || !fun5) 
+  if (!fun4 || !fun5)
   {
       GROUP_AFFINITY affinity;
       if (fun2(node, &affinity))                                                 // GetNumaNodeProcessorMaskEx
           fun3(GetCurrentThread(), &affinity, nullptr);                          // SetThreadGroupAffinity
-  } 
-  else 
+  }
+  else
   {
       // If a numa node has more than one processor group, we assume they are
       // sized equal and we spread threads evenly across the groups.
index c17441306c1a5a621579233b25441342712e68e0..062b420a422befb2bd3192247bdbce1d26d9efb2 100644 (file)
@@ -141,7 +141,7 @@ private:
 
 /// sigmoid(t, x0, y0, C, P, Q) implements a sigmoid-like function using only integers,
 /// with the following properties:
-/// 
+///
 ///  -  sigmoid is centered in (x0, y0)
 ///  -  sigmoid has amplitude [-P/Q , P/Q] instead of [-1 , +1]
 ///  -  limit is (y0 - P/Q) when t tends to -infinity
index c926c1d20649d2c460f02c53d106b71b682a5cca..5e022e664ca18266ee55c457b85a03d3f27481f4 100644 (file)
@@ -1065,6 +1065,8 @@ moves_loop: // When in check, search starts here
 
               history += thisThread->mainHistory[us][from_to(move)];
 
+              lmrDepth = std::max(0, lmrDepth - (beta - alpha < thisThread->rootDelta / 4));
+
               // Futility pruning: parent node (~5 Elo)
               if (   !ss->inCheck
                   && lmrDepth < 8