- std::mutex mutex;
- std::condition_variable cv;
- size_t idx;
- bool exit = false, searching = true; // Set before starting std::thread
- NativeThread stdThread;
-
-public:
- explicit Thread(size_t);
- virtual ~Thread();
- virtual void search();
- void clear();
- void idle_loop();
- void start_searching();
- void wait_for_search_finished();
- int best_move_count(Move move);
-
- Pawns::Table pawnsTable;
- Material::Table materialTable;
- size_t pvIdx, pvLast;
- uint64_t ttHitAverage;
- int selDepth, nmpMinPly;
- Color nmpColor;
- std::atomic<uint64_t> nodes, tbHits, bestMoveChanges;
-
- Position rootPos;
- Search::RootMoves rootMoves;
- Depth rootDepth, completedDepth;
- CounterMoveHistory counterMoves;
- ButterflyHistory mainHistory;
- CapturePieceToHistory captureHistory;
- ContinuationHistory continuationHistory[2][2];
- Score contempt;
+ std::mutex mutex;
+ std::condition_variable cv;
+ size_t idx;
+ bool exit = false, searching = true; // Set before starting std::thread
+ NativeThread stdThread;
+
+ public:
+ explicit Thread(size_t);
+ virtual ~Thread();
+ virtual void search();
+ void clear();
+ void idle_loop();
+ void start_searching();
+ void wait_for_search_finished();
+ size_t id() const { return idx; }
+
+ size_t pvIdx, pvLast;
+ std::atomic<uint64_t> nodes, tbHits, bestMoveChanges;
+ int selDepth, nmpMinPly;
+ Value bestValue, optimism[COLOR_NB];
+
+ Position rootPos;
+ StateInfo rootState;
+ Search::RootMoves rootMoves;
+ Depth rootDepth, completedDepth;
+ Value rootDelta;
+ Value rootSimpleEval;
+ CounterMoveHistory counterMoves;
+ ButterflyHistory mainHistory;
+ CapturePieceToHistory captureHistory;
+ ContinuationHistory continuationHistory[2][2];
+ PawnHistory pawnHistory;