From 95ad2b51b75be9b0ce3acfc39549bc87b7b181e3 Mon Sep 17 00:00:00 2001 From: VoyagerOne Date: Wed, 14 Sep 2016 09:09:41 -0400 Subject: [PATCH] Tweak SEE margin in pruning conditions Use 35 * depth^2 to calculate see_margin. STC: LLR: 2.95 (-2.94,2.94) [0.00,5.00] Total: 22636 W: 4212 L: 3990 D: 14434 LTC: LLR: 2.96 (-2.94,2.94) [0.00,5.00] Total: 47241 W: 6314 L: 6041 D: 34886 The Movepick SEE is now dead code, retire it. Bench: 5341477 --- src/search.cpp | 32 +++++++++++++------------------- 1 file changed, 13 insertions(+), 19 deletions(-) diff --git a/src/search.cpp b/src/search.cpp index 1d930dd5..542144bf 100644 --- a/src/search.cpp +++ b/src/search.cpp @@ -560,7 +560,7 @@ namespace { TTEntry* tte; Key posKey; Move ttMove, move, excludedMove, bestMove; - Depth extension, newDepth, predictedDepth; + Depth extension, newDepth; Value bestValue, value, ttValue, eval, nullValue; bool ttHit, inCheck, givesCheck, singularExtensionNode, improving; bool captureOrPromotion, doFullDepthSearch, moveCountPruning; @@ -932,35 +932,29 @@ moves_loop: // When in check search starts from here if (moveCountPruning) continue; - predictedDepth = std::max(newDepth - reduction(improving, depth, moveCount), DEPTH_ZERO); + // Reduced depth of the next LMR search + int lmrDepth = std::max(newDepth - reduction(improving, depth, moveCount), DEPTH_ZERO) / ONE_PLY; // Countermoves based pruning - if ( predictedDepth < 3 * ONE_PLY + if ( lmrDepth < 3 && (!cmh || (*cmh )[moved_piece][to_sq(move)] < VALUE_ZERO) && (!fmh || (*fmh )[moved_piece][to_sq(move)] < VALUE_ZERO) && (!fmh2 || (*fmh2)[moved_piece][to_sq(move)] < VALUE_ZERO || (cmh && fmh))) continue; // Futility pruning: parent node - if ( predictedDepth < 7 * ONE_PLY - && ss->staticEval + 256 + 200 * predictedDepth / ONE_PLY <= alpha) + if ( lmrDepth < 7 + && ss->staticEval + 256 + 200 * lmrDepth <= alpha) continue; - // Prune moves with negative SEE at low depths and below a decreasing - // threshold at higher depths. - if (predictedDepth < 8 * ONE_PLY) - { - Value see_v = predictedDepth < 4 * ONE_PLY ? VALUE_ZERO - : -PawnValueMg * 2 * int(predictedDepth - 3 * ONE_PLY) / ONE_PLY; - - if (pos.see_sign(move) < see_v) - continue; - } + // Prune moves with negative SEE + if ( lmrDepth < 8 + && pos.see_sign(move) < Value(-35 * lmrDepth * lmrDepth)) + continue; } - else if ( depth < 3 * ONE_PLY - && ( mp.see_sign() < 0 - || (!mp.see_sign() && pos.see_sign(move) < VALUE_ZERO))) - continue; + else if ( depth < 7 * ONE_PLY + && pos.see_sign(move) < Value(-35 * depth / ONE_PLY * depth / ONE_PLY)) + continue; } // Speculative prefetch as early as possible -- 2.39.2