X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;ds=sidebyside;f=src%2Fsearch.cpp;h=833bbba4e6f3b5d4fca4c3b2e3c35065bbb76edd;hb=b9f8cb78372773128257866881f632bce0884aed;hp=0dccf934e82c2f823ed0f1b013589daf2ac6384a;hpb=13bc6ba2c69f326017dcc771d1e45a096e23e0c4;p=stockfish diff --git a/src/search.cpp b/src/search.cpp index 0dccf934..833bbba4 100644 --- a/src/search.cpp +++ b/src/search.cpp @@ -1171,16 +1171,12 @@ split_point_start: // At split points actual search starts from here } - if (RootNode) + // Finished searching the move. If StopRequest is true, the search + // was aborted because the user interrupted the search or because we + // ran out of time. In this case, the return value of the search cannot + // be trusted, and we don't update the best move and/or PV. + if (RootNode && !StopRequest) { - // Finished searching the move. If StopRequest is true, the search - // was aborted because the user interrupted the search or because we - // ran out of time. In this case, the return value of the search cannot - // be trusted, and we break out of the loop without updating the best - // move and/or PV. - if (StopRequest) - break; - // Remember searched nodes counts for this move RootMove* rm = Rml.find(move); rm->nodes += pos.nodes_searched() - nodes; @@ -1226,15 +1222,14 @@ split_point_start: // At split points actual search starts from here } // Step 19. Check for split - if ( !RootNode - && !SpNode + if ( !SpNode && depth >= Threads.min_split_depth() && bestValue < beta && Threads.available_slave_exists(pos.thread()) && !StopRequest && !thread.cutoff_occurred()) Threads.split(pos, ss, &alpha, beta, &bestValue, depth, - threatMove, moveCount, &mp, PvNode); + threatMove, moveCount, &mp, NT); } // Step 20. Check for mate and stalemate @@ -2210,9 +2205,11 @@ void ThreadsManager::idle_loop(int threadID, SplitPoint* sp) { memcpy(ss, tsp->ss - 1, 4 * sizeof(SearchStack)); (ss+1)->sp = tsp; - if (tsp->pvNode) + if (tsp->nodeType == Root) + search(pos, ss+1, tsp->alpha, tsp->beta, tsp->depth); + else if (tsp->nodeType == PV) search(pos, ss+1, tsp->alpha, tsp->beta, tsp->depth); - else + else if (tsp->nodeType == NonPV) search(pos, ss+1, tsp->alpha, tsp->beta, tsp->depth); assert(threads[threadID].state == Thread::SEARCHING);