X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fsearch.cpp;h=8ef2513dd1a895c0fdda2ed28af7c5587f06de51;hp=fc3ecae4d87e5c56230aec04a8bb6aacbee50cc0;hb=81e9cf043a7e8ac1aeb579e6ad17c695f7fb3d47;hpb=db322e6a63459bc3dfdf7fd537d42234b854fb76 diff --git a/src/search.cpp b/src/search.cpp index fc3ecae4..8ef2513d 100644 --- a/src/search.cpp +++ b/src/search.cpp @@ -745,7 +745,7 @@ namespace { && ttMove == MOVE_NONE && (PvNode || (!inCheck && ss->staticEval + Value(256) >= beta))) { - Depth d = (PvNode ? depth - 2 * ONE_PLY : depth / 2); + Depth d = (PvNode ? depth - 2 * ONE_PLY : depth - 4 * ONE_PLY); ss->skipNullMove = true; search(pos, ss, alpha, beta, d); @@ -852,14 +852,14 @@ split_point_start: // At split points actual search starts from here newDepth = depth - ONE_PLY + ext; // Step 13. Futility pruning (is omitted in PV nodes) - if ( !captureOrPromotion + if ( !PvNode + && !captureOrPromotion && !inCheck && !dangerous && move != ttMove) { // Move count based pruning - if ( !PvNode - && depth < 16 * ONE_PLY + if ( depth < 16 * ONE_PLY && moveCount >= FutilityMoveCounts[depth] && (!threatMove || !refutes(pos, move, threatMove))) { @@ -876,7 +876,7 @@ split_point_start: // At split points actual search starts from here futilityValue = ss->staticEval + ss->evalMargin + futility_margin(predictedDepth, moveCount) + Gain[pos.piece_moved(move)][to_sq(move)]; - if (!PvNode && futilityValue < beta) + if (futilityValue < beta) { if (SpNode) splitPoint->mutex.lock(); @@ -885,7 +885,7 @@ split_point_start: // At split points actual search starts from here } // Prune moves with negative SEE at low depths - if ( predictedDepth < 2 * ONE_PLY + if ( predictedDepth < 4 * ONE_PLY && pos.see_sign(move) < 0) { if (SpNode) @@ -1125,6 +1125,12 @@ split_point_start: // At split points actual search starts from here if (pos.is_draw() || ss->ply > MAX_PLY) return DrawValue[pos.side_to_move()]; + // Decide whether or not to include checks, this fixes also the type of + // TT entry depth that we are going to use. Note that in qsearch we use + // only two types of depth in TT: DEPTH_QS_CHECKS or DEPTH_QS_NO_CHECKS. + ttDepth = InCheck || depth >= DEPTH_QS_CHECKS ? DEPTH_QS_CHECKS + : DEPTH_QS_NO_CHECKS; + // Transposition table lookup. At PV nodes, we don't use the TT for // pruning, but only for move ordering. posKey = pos.key(); @@ -1132,11 +1138,6 @@ split_point_start: // At split points actual search starts from here ttMove = tte ? tte->move() : MOVE_NONE; ttValue = tte ? value_from_tt(tte->value(),ss->ply) : VALUE_NONE; - // Decide whether or not to include checks, this fixes also the type of - // TT entry depth that we are going to use. Note that in qsearch we use - // only two types of depth in TT: DEPTH_QS_CHECKS or DEPTH_QS_NO_CHECKS. - ttDepth = InCheck || depth >= DEPTH_QS_CHECKS ? DEPTH_QS_CHECKS - : DEPTH_QS_NO_CHECKS; if ( tte && tte->depth() >= ttDepth && ttValue != VALUE_NONE // Only in case of TT access race