X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=src%2Fsearch.cpp;h=19ebc5e6eeeb79ef8ce12a3835372b1581edae95;hb=3ce43c20dee3d0c7afc4ff3b4c67e0530ab2138f;hp=15f09bc92743de1cc2eab9fcdfabfd76a4cba82b;hpb=0d68b523a390e2f5c37f211316869d798e852289;p=stockfish diff --git a/src/search.cpp b/src/search.cpp index 15f09bc9..19ebc5e6 100644 --- a/src/search.cpp +++ b/src/search.cpp @@ -442,11 +442,17 @@ namespace { if (Time::now() - SearchTime > (TimeMgr.available_time() * 62) / 100) stop = true; + bool recapture = pos.is_capture(RootMoves[0].pv[0]) + && pos.captured_piece_type() + && SetupMoves->size() + && to_sq(SetupMoves->back()) == to_sq(RootMoves[0].pv[0]); + // Stop search early if one move seems to be much better than others if ( depth >= 12 && !stop && PVSize == 1 - && ( (bestMoveNeverChanged && pos.captured_piece_type()) + && ( (bestMoveNeverChanged && recapture) + || RootMoves.size() == 1 || Time::now() - SearchTime > (TimeMgr.available_time() * 40) / 100)) { Value rBeta = bestValue - 2 * PawnValueMg;