X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fsearch.h;h=5ba95fe098a5fef94ae7b7418da376fd82d0f619;hp=a31b189c010f2c00fe3c3fe5b3252a52f5a8c96a;hb=a2410227cc8df5373d6970bfe63bbd3df5287c8c;hpb=3c07603dac03f0da20194097cf4eb1a396fea60d diff --git a/src/search.h b/src/search.h index a31b189c..5ba95fe0 100644 --- a/src/search.h +++ b/src/search.h @@ -47,6 +47,7 @@ struct Stack { Depth reduction; Value staticEval; bool skipEarlyPruning; + int moveCount; }; /// RootMove struct is used for moves at the root of the tree. For each root move @@ -55,14 +56,15 @@ struct Stack { struct RootMove { - RootMove(Move m) : score(-VALUE_INFINITE), previousScore(-VALUE_INFINITE), pv(1, m) {} + explicit RootMove(Move m) : pv(1, m) {} bool operator<(const RootMove& m) const { return score > m.score; } // Ascending sort bool operator==(const Move& m) const { return pv[0] == m; } void insert_pv_in_tt(Position& pos); + bool extract_ponder_from_tt(Position& pos); - Value score; - Value previousScore; + Value score = -VALUE_INFINITE; + Value previousScore = -VALUE_INFINITE; std::vector pv; }; @@ -75,7 +77,7 @@ typedef std::vector RootMoveVector; struct LimitsType { LimitsType() { // Init explicitly due to broken value-initialization of non POD in MSVC - nodes = time[WHITE] = time[BLACK] = inc[WHITE] = inc[BLACK] = movestogo = + nodes = time[WHITE] = time[BLACK] = inc[WHITE] = inc[BLACK] = npmsec = movestogo = depth = movetime = mate = infinite = ponder = 0; } @@ -84,7 +86,7 @@ struct LimitsType { } std::vector searchmoves; - int time[COLOR_NB], inc[COLOR_NB], movestogo, depth, movetime, mate, infinite, ponder; + int time[COLOR_NB], inc[COLOR_NB], npmsec, movestogo, depth, movetime, mate, infinite, ponder; int64_t nodes; }; @@ -101,11 +103,11 @@ extern volatile SignalsType Signals; extern LimitsType Limits; extern RootMoveVector RootMoves; extern Position RootPos; -extern Time::point SearchTime; extern StateStackPtr SetupStates; void init(); void think(); +void reset(); template uint64_t perft(Position& pos, Depth depth); } // namespace Search