X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fsearch.cpp;h=dcb89d75caf89733567141297faaf3594271210c;hp=29820a1f45ac884a6c77edeb5abaa46b0677dd4d;hb=dccaa145d2b57999aa3e368c7c9203731b4e9685;hpb=6656ed8904ccf0e20321f9929f2d13fbb7b9223d diff --git a/src/search.cpp b/src/search.cpp index 29820a1f..dcb89d75 100644 --- a/src/search.cpp +++ b/src/search.cpp @@ -1604,7 +1604,12 @@ void Thread::idle_loop() { && sp->slavesCount < MAX_SLAVES_PER_SPLITPOINT && available_to(Threads[i])) { - int score = sp->spLevel * 256 * 256 + sp->slavesCount * 256 - sp->depth * 1; + // Compute the recursive split points chain size + int level = -1; + for (SplitPoint* spp = Threads[i]->activeSplitPoint; spp; spp = spp->parentSplitPoint) + level++; + + int score = level * 256 * 256 + sp->slavesCount * 256 - sp->depth * 1; if (score < bestScore) { @@ -1618,7 +1623,7 @@ void Thread::idle_loop() { if (bestSp) { sp = bestSp; - + // Recheck the conditions under lock protection Threads.mutex.lock(); sp->mutex.lock();