X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fsearch.cpp;h=ab34673463c57286d7ec4047a46755d6fc24701e;hp=7970a393d003848a537f9e4c18650266fd12580d;hb=7bad50773a65c45b0b3f88eca7eddc6aa0f7f174;hpb=ccf4ec6768b17f47b48a296978bc19e3eaaa70ba diff --git a/src/search.cpp b/src/search.cpp index 7970a393..ab346734 100644 --- a/src/search.cpp +++ b/src/search.cpp @@ -293,7 +293,6 @@ namespace { Stack ss[MAX_PLY_PLUS_2]; int depth, prevBestMoveChanges; Value bestValue, alpha, beta, delta; - bool triedEasyMove = false; memset(ss, 0, 4 * sizeof(Stack)); depth = BestMoveChanges = 0; @@ -440,12 +439,11 @@ namespace { // Stop search early if one move seems to be much better than others if ( depth >= 12 && !stop - && !triedEasyMove && PVSize == 1 + && bestValue > VALUE_MATED_IN_MAX_PLY && ( RootMoves.size() == 1 || Time::now() - SearchTime > (TimeMgr.available_time() * 20) / 100)) { - triedEasyMove = true; Value rBeta = bestValue - 2 * PawnValueMg; (ss+1)->excludedMove = RootMoves[0].pv[0]; (ss+1)->skipNullMove = true; @@ -748,7 +746,7 @@ namespace { && ttMove == MOVE_NONE && (PvNode || (!inCheck && ss->staticEval + Value(256) >= beta))) { - Depth d = (PvNode ? depth - 2 * ONE_PLY : depth / 2); + Depth d = depth - 2 * ONE_PLY - (PvNode ? DEPTH_ZERO : depth / 4); ss->skipNullMove = true; search(pos, ss, alpha, beta, d); @@ -859,7 +857,8 @@ split_point_start: // At split points actual search starts from here && !captureOrPromotion && !inCheck && !dangerous - && move != ttMove) + && move != ttMove + && bestValue > VALUE_MATED_IN_MAX_PLY) { // Move count based pruning if ( depth < 16 * ONE_PLY @@ -881,14 +880,19 @@ split_point_start: // At split points actual search starts from here if (futilityValue < beta) { + bestValue = std::max(bestValue, futilityValue); + if (SpNode) + { splitPoint->mutex.lock(); - + if (bestValue > splitPoint->bestValue) + splitPoint->bestValue = bestValue; + } continue; } // Prune moves with negative SEE at low depths - if ( predictedDepth < 3 * ONE_PLY + if ( predictedDepth < 4 * ONE_PLY && pos.see_sign(move) < 0) { if (SpNode) @@ -1224,7 +1228,7 @@ split_point_start: // At split points actual search starts from here // Prune moves with negative or equal SEE if ( futilityBase < beta && depth < DEPTH_ZERO - && pos.see(move) <= 0) + && pos.see_asymm(move, beta - futilityBase) <= 0) { bestValue = std::max(bestValue, futilityBase); continue;