mirror of
https://github.com/HChaZZY/Stockfish.git
synced 2025-12-22 10:06:26 +08:00
StateInfo is usually allocated on the stack by search()
And passed in do_move(), this ensures maximum efficiency and speed and at the same time unlimited move numbers. The draw back is that to handle Position init we need to reserve a StateInfo inside Position itself and use at init time and when copying from another Position. After lazy SMP we don't need anymore this gimmick and we can get rid of this special case and always pass an external StateInfo to Position object. Also rewritten and simplified Position constructors. Verified it does not regress with a 3 threads SMP test: ELO: -0.00 +-12.7 (95%) LOS: 50.0% Total: 1000 W: 173 L: 173 D: 654 No functional change.
This commit is contained in:
@@ -64,7 +64,7 @@ public:
|
||||
int maxPly, callsCnt;
|
||||
|
||||
Position rootPos;
|
||||
Search::RootMoveVector rootMoves;
|
||||
Search::RootMoves rootMoves;
|
||||
Depth rootDepth;
|
||||
HistoryStats history;
|
||||
MoveStats counterMoves;
|
||||
@@ -94,9 +94,12 @@ struct ThreadPool : public std::vector<Thread*> {
|
||||
void exit(); // be initialized and valid during the whole thread lifetime.
|
||||
|
||||
MainThread* main() { return static_cast<MainThread*>(at(0)); }
|
||||
void start_thinking(const Position&, const Search::LimitsType&, Search::StateStackPtr&);
|
||||
void start_thinking(const Position&, StateListPtr&, const Search::LimitsType&);
|
||||
void read_uci_options();
|
||||
int64_t nodes_searched();
|
||||
|
||||
private:
|
||||
StateListPtr setupStates;
|
||||
};
|
||||
|
||||
extern ThreadPool Threads;
|
||||
|
||||
Reference in New Issue
Block a user