Use explicit logic for pruning
authorVoyagerOne <excelgeek@gmail.com>
Sat, 15 Oct 2016 21:35:10 +0000 (17:35 -0400)
committerMarco Costalba <mcostalba@gmail.com>
Tue, 18 Oct 2016 06:53:51 +0000 (08:53 +0200)
Also a speedup since we don't need to recalculate SEE
for extensions...as it already determined to be positive.

Results for 12 tests for each version:

        Base      Test      Diff
Mean    2132395   2191002   -58607
StDev   128058    85917     134239
p-value: 0.669
speedup: 0.027

Non functional change.

src/search.cpp

index 112e149..81b3f29 100644 (file)
@@ -919,7 +919,7 @@ moves_loop: // When in check search starts from here
 
       // Step 13. Pruning at shallow depth
       if (  !rootNode
 
       // Step 13. Pruning at shallow depth
       if (  !rootNode
-          &&  bestValue > VALUE_MATED_IN_MAX_PLY)
+          && bestValue > VALUE_MATED_IN_MAX_PLY)
       {
           if (   !captureOrPromotion
               && !givesCheck
       {
           if (   !captureOrPromotion
               && !givesCheck
@@ -941,6 +941,7 @@ moves_loop: // When in check search starts from here
 
               // Futility pruning: parent node
               if (   lmrDepth < 7
 
               // Futility pruning: parent node
               if (   lmrDepth < 7
+                  && !inCheck
                   && ss->staticEval + 256 + 200 * lmrDepth <= alpha)
                   continue;
 
                   && ss->staticEval + 256 + 200 * lmrDepth <= alpha)
                   continue;
 
@@ -950,6 +951,7 @@ moves_loop: // When in check search starts from here
                   continue;
           }
           else if (   depth < 7 * ONE_PLY
                   continue;
           }
           else if (   depth < 7 * ONE_PLY
+                   && !extension
                    && !pos.see_ge(move, Value(-35 * depth / ONE_PLY * depth / ONE_PLY)))
                   continue;
       }
                    && !pos.see_ge(move, Value(-35 * depth / ONE_PLY * depth / ONE_PLY)))
                   continue;
       }