X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fsearch.cpp;h=b39bc1764dbda697e8a4d19985abd435a8f3c61c;hp=833bbba4e6f3b5d4fca4c3b2e3c35065bbb76edd;hb=5b35c149e833e365c2afb8039ca5c658abc53081;hpb=b9f8cb78372773128257866881f632bce0884aed diff --git a/src/search.cpp b/src/search.cpp index 833bbba4..b39bc176 100644 --- a/src/search.cpp +++ b/src/search.cpp @@ -560,7 +560,8 @@ namespace { // Start with a small aspiration window and, in case of fail high/low, // research with bigger window until not failing high/low anymore. do { - // Search starting from ss+1 to allow calling update_gains() + // Search starting from ss+1 to allow referencing (ss-1). This is + // needed by update_gains() and ss copy when splitting at Root. value = search(pos, ss+1, alpha, beta, depth * ONE_PLY); // It is critical that sorting is done with a stable algorithm @@ -1170,7 +1171,6 @@ split_point_start: // At split points actual search starts from here alpha = sp->alpha; } - // 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 @@ -1228,8 +1228,8 @@ split_point_start: // At split points actual search starts from here && Threads.available_slave_exists(pos.thread()) && !StopRequest && !thread.cutoff_occurred()) - Threads.split(pos, ss, &alpha, beta, &bestValue, depth, - threatMove, moveCount, &mp, NT); + bestValue = Threads.split(pos, ss, alpha, beta, bestValue, depth, + threatMove, moveCount, &mp, NT); } // Step 20. Check for mate and stalemate @@ -2211,6 +2211,8 @@ void ThreadsManager::idle_loop(int threadID, SplitPoint* sp) { search(pos, ss+1, tsp->alpha, tsp->beta, tsp->depth); else if (tsp->nodeType == NonPV) search(pos, ss+1, tsp->alpha, tsp->beta, tsp->depth); + else + assert(false); assert(threads[threadID].state == Thread::SEARCHING); @@ -2239,8 +2241,6 @@ void ThreadsManager::idle_loop(int threadID, SplitPoint* sp) { // In helpful master concept a master can help only a sub-tree, and // because here is all finished is not possible master is booked. assert(threads[threadID].state == Thread::AVAILABLE); - - threads[threadID].state = Thread::SEARCHING; return; } }