Remove global TB variables from search.cpp

Follow up cleanup of #4968, removes the global variables from search and
instead uses a dedicated tb config struct.

closes https://github.com/official-stockfish/Stockfish/pull/4982

No functional change
This commit is contained in:
Disservin
2024-01-14 14:29:12 +01:00
parent 32e46fc47f
commit a5675f19d8
6 changed files with 89 additions and 75 deletions

View File

@@ -181,8 +181,7 @@ void ThreadPool::start_thinking(const OptionsMap& options,
|| std::count(limits.searchmoves.begin(), limits.searchmoves.end(), m))
rootMoves.emplace_back(m);
if (!rootMoves.empty())
Tablebases::rank_root_moves(options, pos, rootMoves);
Tablebases::Config tbConfig = Tablebases::rank_root_moves(options, pos, rootMoves);
// After ownership transfer 'states' becomes empty, so if we stop the search
// and call 'go' again without setting a new position states.get() == nullptr.
@@ -205,6 +204,7 @@ void ThreadPool::start_thinking(const OptionsMap& options,
th->worker->rootMoves = rootMoves;
th->worker->rootPos.set(pos.fen(), pos.is_chess960(), &th->worker->rootState);
th->worker->rootState = setupStates->back();
th->worker->tbConfig = tbConfig;
}
main_thread()->start_searching();