struct Stack {
SplitPoint* splitPoint;
+ Move* pv;
int ply;
Move currentMove;
Move ttMove;
Move killers[2];
Depth reduction;
Value staticEval;
- bool skipNullMove;
+ bool skipEarlyPruning;
};
/// all non-pv moves.
struct RootMove {
- RootMove(Move m) : score(-VALUE_INFINITE), prevScore(-VALUE_INFINITE) {
- pv.push_back(m); pv.push_back(MOVE_NONE);
- }
+ RootMove(Move m) : score(-VALUE_INFINITE), previousScore(-VALUE_INFINITE), 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 extract_pv_from_tt(Position& pos);
void insert_pv_in_tt(Position& pos);
Value score;
- Value prevScore;
+ Value previousScore;
std::vector<Move> pv;
};
+typedef std::vector<RootMove> RootMoveVector;
/// The LimitsType struct stores information sent by GUI about available time
/// to search the current move, maximum depth/time, if we are in analysis mode
extern volatile SignalsType Signals;
extern LimitsType Limits;
-extern std::vector<RootMove> RootMoves;
+extern RootMoveVector RootMoves;
extern Position RootPos;
extern Time::point SearchTime;
extern StateStackPtr SetupStates;
-extern void init();
-extern void think();
+void init();
+void think();
template<bool Root> uint64_t perft(Position& pos, Depth depth);
} // namespace Search