X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fsearch.cpp;h=02aea53827f39eff2977258b10ef175bfe49b164;hp=b7a242f98470422cfeacd7041cefdd917d3fe7fc;hb=1d18647e738951a7e94530fef231f4b4e13b1786;hpb=eed508b4445057cd26bfb95ab5cd754ac96629fd diff --git a/src/search.cpp b/src/search.cpp index b7a242f9..02aea538 100644 --- a/src/search.cpp +++ b/src/search.cpp @@ -325,7 +325,7 @@ namespace { RootMoves[i].prevScore = RootMoves[i].score; // MultiPV loop. We perform a full root search for each PV line - for (PVIdx = 0; PVIdx < PVSize; ++PVIdx) + for (PVIdx = 0; PVIdx < PVSize && !Signals.stop; ++PVIdx) { // Reset aspiration window starting size if (depth >= 5) @@ -354,11 +354,11 @@ namespace { for (size_t i = 0; i <= PVIdx; ++i) RootMoves[i].insert_pv_in_tt(pos); - // If search has been stopped return immediately. Sorting and + // If search has been stopped break immediately. Sorting and // writing PV back to TT is safe becuase RootMoves is still // valid, although refers to previous iteration. if (Signals.stop) - return; + break; // When failing high/low give some update (without cluttering // the UI) before to research. @@ -415,7 +415,7 @@ namespace { Signals.stop = true; // Do we have time for the next iteration? Can we stop searching now? - if (Limits.use_time_management() && !Signals.stopOnPonderhit) + if (Limits.use_time_management() && !Signals.stop && !Signals.stopOnPonderhit) { bool stop = false; // Local variable, not the volatile Signals.stop @@ -1331,7 +1331,7 @@ moves_loop: // When in check and at SpNode search starts from here // We exclude the trivial case where a sliding piece does in two moves what // it could do in one move: eg. Ra1a2, Ra2a3. if ( m2to == m1from - || (m1to == m2from && !squares_aligned(m1from, m2from, m2to))) + || (m1to == m2from && !aligned(m1from, m2from, m2to))) return true; // Second one moves through the square vacated by first one