X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fsearch.cpp;h=1214cbdcbd2b02f32d7b132ef02cd5ce4f400264;hp=c256cfc01a9615bd6c5d11f6c6b21d30f2991500;hb=0fc9a01933ce33fda3732c1d5bbde5a8908d0019;hpb=c5ec94d0f1b128fc2c691c7231663a345409d5cc diff --git a/src/search.cpp b/src/search.cpp index c256cfc0..1214cbdc 100644 --- a/src/search.cpp +++ b/src/search.cpp @@ -857,16 +857,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 ( !PvNode - && !captureOrPromotion + if ( !captureOrPromotion && !inCheck && !dangerous - && move != ttMove - && (bestValue > VALUE_MATED_IN_MAX_PLY || ( bestValue == -VALUE_INFINITE - && alpha > VALUE_MATED_IN_MAX_PLY))) + && move != ttMove) { // Move count based pruning - if ( depth < 16 * ONE_PLY + if ( !PvNode + && depth < 16 * ONE_PLY && moveCount >= FutilityMoveCounts[depth] && (!threatMove || !refutes(pos, move, threatMove))) { @@ -883,7 +881,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 (futilityValue < beta) + if (!PvNode && futilityValue < beta) { if (SpNode) sp->mutex.lock(); @@ -929,7 +927,8 @@ split_point_start: // At split points actual search starts from here { ss->reduction = reduction(depth, moveCount); Depth d = std::max(newDepth - ss->reduction, ONE_PLY); - alpha = SpNode ? sp->alpha : alpha; + if (SpNode) + alpha = sp->alpha; value = -search(pos, ss+1, -(alpha+1), -alpha, d); @@ -942,7 +941,9 @@ split_point_start: // At split points actual search starts from here // Step 16. Full depth search, when LMR is skipped or fails high if (doFullDepthSearch) { - alpha = SpNode ? sp->alpha : alpha; + if (SpNode) + alpha = sp->alpha; + value = newDepth < ONE_PLY ? givesCheck ? -qsearch(pos, ss+1, -(alpha+1), -alpha, DEPTH_ZERO) : -qsearch(pos, ss+1, -(alpha+1), -alpha, DEPTH_ZERO)