diff --git a/AUTHORS b/AUTHORS index 4638b41a..33a7a3d5 100644 --- a/AUTHORS +++ b/AUTHORS @@ -91,6 +91,7 @@ Luca Brivio (lucabrivio) Lucas Braesch (lucasart) Lyudmil Antonov (lantonov) Maciej Żenczykowski (zenczykowski) +Malcolm Campbell (xoto10) Mark Tenzer (31m059) marotear Matthew Lai (matthewlai) @@ -151,6 +152,12 @@ Tracey Emery (basepr1me) Uri Blass (uriblass) Vince Negri (cuddlestmonkey) -# Additionally, we acknowledge the authors of fishtest, -# an essential framework for the development of Stockfish: + +# Additionally, we acknowledge the authors and maintainer of fishtest, +# an amazing and essential framework for the development of Stockfish! +# # https://github.com/glinscott/fishtest/blob/master/AUTHORS + + + + diff --git a/src/search.cpp b/src/search.cpp index 6146bdf6..ec9c6b1d 100644 --- a/src/search.cpp +++ b/src/search.cpp @@ -393,6 +393,8 @@ void Thread::search() { contempt = (us == WHITE ? make_score(ct, ct / 2) : -make_score(ct, ct / 2)); + int searchAgainCounter = 0; + // Iterative deepening loop until requested to stop or the target depth is reached while ( ++rootDepth < MAX_PLY && !Threads.stop @@ -410,6 +412,9 @@ void Thread::search() { size_t pvFirst = 0; pvLast = 0; + if (!Threads.increaseDepth) + searchAgainCounter++; + // MultiPV loop. We perform a full root search for each PV line for (pvIdx = 0; pvIdx < multiPV && !Threads.stop; ++pvIdx) { @@ -445,7 +450,7 @@ void Thread::search() { int failedHighCnt = 0; while (true) { - Depth adjustedDepth = std::max(1, rootDepth - failedHighCnt); + Depth adjustedDepth = std::max(1, rootDepth - failedHighCnt - searchAgainCounter); bestValue = ::search(rootPos, ss, alpha, beta, adjustedDepth, false); // Bring the best move to the front. It is critical that sorting @@ -558,6 +563,11 @@ void Thread::search() { else Threads.stop = true; } + else if ( Threads.increaseDepth + && Time.elapsed() > Time.optimum() * fallingEval * reduction * bestMoveInstability * 0.6) + Threads.increaseDepth = false; + else + Threads.increaseDepth = true; } mainThread->iterValue[iterIdx] = bestValue; diff --git a/src/thread.cpp b/src/thread.cpp index f55bcb22..615d482c 100644 --- a/src/thread.cpp +++ b/src/thread.cpp @@ -179,6 +179,7 @@ void ThreadPool::start_thinking(Position& pos, StateListPtr& states, main()->wait_for_search_finished(); main()->stopOnPonderhit = stop = false; + increaseDepth = true; main()->ponder = ponderMode; Search::Limits = limits; Search::RootMoves rootMoves; diff --git a/src/thread.h b/src/thread.h index 4de30edb..aea86fd5 100644 --- a/src/thread.h +++ b/src/thread.h @@ -109,7 +109,7 @@ struct ThreadPool : public std::vector { uint64_t nodes_searched() const { return accumulate(&Thread::nodes); } uint64_t tb_hits() const { return accumulate(&Thread::tbHits); } - std::atomic_bool stop; + std::atomic_bool stop, increaseDepth; private: StateListPtr setupStates;