]> git.sesse.net Git - stockfish/blobdiff - src/search.cpp
Pawn endgames directly skip early pruning.
[stockfish] / src / search.cpp
index b6a494422a468315f4cb9cd31a9e2e004109345d..4ad1eebbf6a6fed3af64640855ed2a715684f0b3 100644 (file)
@@ -656,7 +656,7 @@ namespace {
                   ss->staticEval, TT.generation());
     }
 
                   ss->staticEval, TT.generation());
     }
 
-    if (skipEarlyPruning)
+    if (skipEarlyPruning || !pos.non_pawn_material(pos.side_to_move()))
         goto moves_loop;
 
     // Step 6. Razoring (skipped when in check)
         goto moves_loop;
 
     // Step 6. Razoring (skipped when in check)
@@ -677,15 +677,13 @@ namespace {
     if (   !rootNode
         &&  depth < 7 * ONE_PLY
         &&  eval - futility_margin(depth) >= beta
     if (   !rootNode
         &&  depth < 7 * ONE_PLY
         &&  eval - futility_margin(depth) >= beta
-        &&  eval < VALUE_KNOWN_WIN  // Do not return unproven wins
-        &&  pos.non_pawn_material(pos.side_to_move()))
+        &&  eval < VALUE_KNOWN_WIN)  // Do not return unproven wins
         return eval;
 
     // Step 8. Null move search with verification search (is omitted in PV nodes)
     if (   !PvNode
         &&  eval >= beta
         return eval;
 
     // Step 8. Null move search with verification search (is omitted in PV nodes)
     if (   !PvNode
         &&  eval >= beta
-        &&  ss->staticEval >= beta - 36 * depth / ONE_PLY + 225
-        &&  pos.non_pawn_material(pos.side_to_move()))
+        &&  ss->staticEval >= beta - 36 * depth / ONE_PLY + 225)
     {
 
         assert(eval - beta >= 0);
     {
 
         assert(eval - beta >= 0);