X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fsearch.cpp;h=e29f54498e1ce3bfd322b493fc73e641a8c3d873;hp=4b0a9fe8b60676b96c7c5dcc9bda19f9d5bcd6b8;hb=45b0aea875860e9f0fe2d0435ee6163906639194;hpb=49e110c52b19f5c99954d4797b8e991b0b60007c diff --git a/src/search.cpp b/src/search.cpp index 4b0a9fe8..e29f5449 100644 --- a/src/search.cpp +++ b/src/search.cpp @@ -242,11 +242,13 @@ void Search::think() { Threads.sleepWhileIdle = Options["Idle Threads Sleep"]; // Set best timer interval to avoid lagging under time pressure. Timer is - // used to check for remaining available thinking time. Timer will be started - // at the end of first iteration to avoid returning with a random move. + // used to check for remaining available thinking time. Threads.timer->msec = Limits.use_time_management() ? std::min(100, std::max(TimeMgr.available_time() / 16, TimerResolution)) : - Limits.nodes ? 2 * TimerResolution : 100; + Limits.nodes ? 2 * TimerResolution + : 100; + + Threads.timer->notify_one(); // Wake up the recurring timer id_loop(RootPos); // Let's start searching ! @@ -400,10 +402,6 @@ namespace { assert(alpha >= -VALUE_INFINITE && beta <= VALUE_INFINITE); } - // Wake up the recurring timer after first iteration is finished - if (depth == 1) - Threads.timer->notify_one(); - // Sort the PV lines searched so far and update the GUI std::stable_sort(RootMoves.begin(), RootMoves.begin() + PVIdx + 1); @@ -837,7 +835,7 @@ moves_loop: // When in check and at SpNode search starts from here ext = ONE_PLY; else if (givesCheck && pos.see_sign(move) >= 0) - ext = ONE_PLY / 2; + ext = inCheck || ss->staticEval <= alpha ? ONE_PLY : ONE_PLY / 2; // Singular extension search. If all moves but one fail low on a search of // (alpha-s, beta-s), and just one fails high on (alpha, beta), then that move