X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fsearch.cpp;h=b0e885c6aabf35e257dd0ff5c9fd191c86d0498e;hp=d7a8379a14e9507d28950ab7b071e456f2f58a46;hb=ffdf63ff7c1fce40774aa8cff82b17c54155c6cb;hpb=553ead429d94b6314ff14aa3eb724f47987e5a52 diff --git a/src/search.cpp b/src/search.cpp index d7a8379a..b0e885c6 100644 --- a/src/search.cpp +++ b/src/search.cpp @@ -327,7 +327,7 @@ namespace { // Reset aspiration window starting size if (depth >= 5) { - delta = Value(16); + delta = Value(depth > 23 ? 16 : 12); alpha = std::max(RootMoves[PVIdx].prevScore - delta,-VALUE_INFINITE); beta = std::min(RootMoves[PVIdx].prevScore + delta, VALUE_INFINITE); } @@ -534,7 +534,6 @@ namespace { : ttValue >= beta ? (tte->bound() & BOUND_LOWER) : (tte->bound() & BOUND_UPPER))) { - TT.refresh(tte); ss->currentMove = ttMove; // Can be MOVE_NONE // If ttMove is quiet, update killers, history, counter move and followup move on TT hit @@ -1470,7 +1469,7 @@ void Thread::idle_loop() { mutex.lock(); // If we are master and all slaves have finished then exit idle_loop - if (this_sp && !this_sp->slavesMask) + if (this_sp && this_sp->slavesMask.none()) { mutex.unlock(); break; @@ -1529,14 +1528,14 @@ void Thread::idle_loop() { searching = false; activePosition = NULL; - sp->slavesMask &= ~(1ULL << idx); + sp->slavesMask.reset(idx); sp->nodes += pos.nodes_searched(); // Wake up the master thread so to allow it to return from the idle // loop in case we are the last slave of the split point. if ( Threads.sleepWhileIdle && this != sp->masterThread - && !sp->slavesMask) + && sp->slavesMask.none()) { assert(!sp->masterThread->searching); sp->masterThread->notify_one(); @@ -1551,10 +1550,10 @@ void Thread::idle_loop() { // If this thread is the master of a split point and all slaves have finished // their work at this split point, return from the idle loop. - if (this_sp && !this_sp->slavesMask) + if (this_sp && this_sp->slavesMask.none()) { this_sp->mutex.lock(); - bool finished = !this_sp->slavesMask; // Retest under lock protection + bool finished = this_sp->slavesMask.none(); // Retest under lock protection this_sp->mutex.unlock(); if (finished) return; @@ -1597,13 +1596,10 @@ void check_time() { sp.mutex.lock(); nodes += sp.nodes; - Bitboard sm = sp.slavesMask; - while (sm) - { - Position* pos = Threads[pop_lsb(&sm)]->activePosition; - if (pos) - nodes += pos->nodes_searched(); - } + + for (size_t idx = 0; idx < Threads.size(); ++idx) + if (sp.slavesMask.test(idx) && Threads[idx]->activePosition) + nodes += Threads[idx]->activePosition->nodes_searched(); sp.mutex.unlock(); }