X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=src%2Fsearch.cpp;h=ffeb511095da93cd4e0d125402c018fdf434ced4;hb=00e34a758f2ca170986550a1f8f25dfe691ca511;hp=9b56bd2b08325cf3d871a8a49ec57b352c0c67b6;hpb=ff3fa0c664a5799e5531b0908018c59633d761bf;p=stockfish diff --git a/src/search.cpp b/src/search.cpp index 9b56bd2b..ffeb5110 100644 --- a/src/search.cpp +++ b/src/search.cpp @@ -69,9 +69,9 @@ namespace { // Reductions lookup table, initialized at startup int Reductions[MAX_MOVES]; // [depth or moveNumber] - Depth reduction(bool i, Depth d, int mn) { + Depth reduction(bool i, Depth d, int mn, bool rangeReduction) { int r = Reductions[d] * Reductions[mn]; - return (r + 534) / 1024 + (!i && r > 904); + return (r + 534) / 1024 + (!i && r > 904) + rangeReduction; } constexpr int futility_move_count(bool improving, Depth depth) { @@ -954,6 +954,7 @@ namespace { moves_loop: // When in check, search starts here ttCapture = ttMove && pos.capture_or_promotion(ttMove); + int rangeReduction = 0; // Step 11. A small Probcut idea, when we are in check probCutBeta = beta + 409; @@ -1041,7 +1042,7 @@ moves_loop: // When in check, search starts here moveCountPruning = moveCount >= futility_move_count(improving, depth); // Reduced depth of the next LMR search - int lmrDepth = std::max(newDepth - reduction(improving, depth, moveCount), 0); + int lmrDepth = std::max(newDepth - reduction(improving, depth, moveCount, rangeReduction > 2), 0); if ( captureOrPromotion || givesCheck) @@ -1176,7 +1177,7 @@ moves_loop: // When in check, search starts here || !ss->ttPv) && (!PvNode || ss->ply > 1 || thisThread->id() % 4 != 3)) { - Depth r = reduction(improving, depth, moveCount); + Depth r = reduction(improving, depth, moveCount, rangeReduction > 2); if (PvNode) r--; @@ -1236,6 +1237,10 @@ moves_loop: // When in check, search starts here value = -search(pos, ss+1, -(alpha+1), -alpha, d, true); + // Range reductions (~3 Elo) + if (ss->staticEval - value < 30 && depth > 7) + rangeReduction++; + // If the son is reduced and fails high it will be re-searched at full depth doFullDepthSearch = value > alpha && d < newDepth; didLMR = true;