]> git.sesse.net Git - stockfish/blobdiff - src/search.cpp
Skip moves-loop pruning in qsearch if we have only pawns
[stockfish] / src / search.cpp
index 9949e2aeb23477f4cb1eaa511ed89c95c464a04a..97b70b8fefd7ffcea1b96a21890ab0330522d66c 100644 (file)
@@ -1427,6 +1427,7 @@ moves_loop: // When in check, search starts here
     Value bestValue, value, ttValue, futilityValue, futilityBase;
     bool pvHit, givesCheck, capture;
     int moveCount;
+    Color us = pos.side_to_move();
 
     // Step 1. Initialize node
     if (PvNode)
@@ -1537,7 +1538,7 @@ moves_loop: // When in check, search starts here
         moveCount++;
 
         // Step 6. Pruning.
-        if (bestValue > VALUE_TB_LOSS_IN_MAX_PLY)
+        if (bestValue > VALUE_TB_LOSS_IN_MAX_PLY && pos.non_pawn_material(us))
         {
             // Futility pruning and moveCount pruning (~10 Elo)
             if (   !givesCheck