- // Calculate new depth for this move
- newDepth = depth - 1 + extension;
-
- // Step 14. Pruning at shallow depth (~170 Elo)
- if ( !rootNode
- && pos.non_pawn_material(us)
- && bestValue > VALUE_MATED_IN_MAX_PLY)
- {
- // Skip quiet moves if movecount exceeds our FutilityMoveCount threshold
- moveCountPruning = moveCount >= futility_move_count(improving, depth);
-
- if ( !captureOrPromotion
- && !givesCheck
- && (!pos.advanced_pawn_push(move) || pos.non_pawn_material(~us) > BishopValueMg))
- {
- // Move count based pruning
- if (moveCountPruning)
- continue;
-
- // Reduced depth of the next LMR search
- int lmrDepth = std::max(newDepth - reduction(improving, depth, moveCount), 0);
-
- // Countermoves based pruning (~20 Elo)
- if ( lmrDepth < 4 + ((ss-1)->statScore > 0 || (ss-1)->moveCount == 1)
- && (*contHist[0])[movedPiece][to_sq(move)] < CounterMovePruneThreshold
- && (*contHist[1])[movedPiece][to_sq(move)] < CounterMovePruneThreshold)
- continue;
-
- // Futility pruning: parent node (~2 Elo)
- if ( lmrDepth < 6
- && !inCheck
- && ss->staticEval + 250 + 211 * lmrDepth <= alpha)
- continue;
-
- // Prune moves with negative SEE (~10 Elo)
- if (!pos.see_ge(move, Value(-(31 - std::min(lmrDepth, 18)) * lmrDepth * lmrDepth)))
- continue;
- }
- else if ( !(givesCheck && extension)
- && !pos.see_ge(move, Value(-199) * depth)) // (~20 Elo)
- continue;
- }