Assorted cleanups

Assorted cleanups

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

No functional change

Co-Authored-By: Shahin M. Shahin <41402573+peregrineshahin@users.noreply.github.com>
Co-Authored-By: cj5716 <125858804+cj5716@users.noreply.github.com>
This commit is contained in:
Disservin
2024-02-10 13:58:38 +01:00
parent 3d5b16df7c
commit 9068fdc57b
6 changed files with 25 additions and 39 deletions
+7 -11
View File
@@ -47,7 +47,6 @@ enum NodeType {
class TranspositionTable;
class ThreadPool;
class OptionsMap;
class UCI;
namespace Search {
@@ -124,10 +123,12 @@ struct LimitsType {
// The UCI stores the uci options, thread pool, and transposition table.
// This struct is used to easily forward data to the Search::Worker class.
struct SharedState {
SharedState(const OptionsMap& o, ThreadPool& tp, TranspositionTable& t) :
options(o),
threads(tp),
tt(t) {}
SharedState(const OptionsMap& optionsMap,
ThreadPool& threadPool,
TranspositionTable& transpositionTable) :
options(optionsMap),
threads(threadPool),
tt(transpositionTable) {}
const OptionsMap& options;
ThreadPool& threads;
@@ -209,11 +210,7 @@ class Worker {
template<NodeType nodeType>
Value qsearch(Position& pos, Stack* ss, Value alpha, Value beta, Depth depth = 0);
Depth reduction(bool i, Depth d, int mn, int delta) {
int reductionScale = reductions[d] * reductions[mn];
return (reductionScale + 1177 - int(delta) * 776 / int(rootDelta)) / 1024
+ (!i && reductionScale > 842);
}
Depth reduction(bool i, Depth d, int mn, int delta);
// Get a pointer to the search manager, only allowed to be called by the
// main thread.
@@ -251,7 +248,6 @@ class Worker {
TranspositionTable& tt;
friend class Stockfish::ThreadPool;
friend class Stockfish::UCI;
friend class SearchManager;
};