summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
d033d5e)
In particualr before to wake up main thread that
could take some random time. Until we don't reset
search time we are not able to correctly track
the elapsed search time and this can be dangerous
under extreme time pressure.
No functional change.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
#include "book.h"
#include "evaluate.h"
#include "history.h"
#include "book.h"
#include "evaluate.h"
#include "history.h"
#include "movegen.h"
#include "movepick.h"
#include "search.h"
#include "movegen.h"
#include "movepick.h"
#include "search.h"
LimitsType Limits;
std::vector<RootMove> RootMoves;
Position RootPosition;
LimitsType Limits;
std::vector<RootMove> RootMoves;
Position RootPosition;
size_t MultiPV, UCIMultiPV, PVIdx;
TimeManager TimeMgr;
size_t MultiPV, UCIMultiPV, PVIdx;
TimeManager TimeMgr;
int BestMoveChanges;
int SkillLevel;
bool SkillLevelEnabled, Chess960;
int BestMoveChanges;
int SkillLevel;
bool SkillLevelEnabled, Chess960;
Position& pos = RootPosition;
Chess960 = pos.is_chess960();
Eval::RootColor = pos.side_to_move();
Position& pos = RootPosition;
Chess960 = pos.is_chess960();
Eval::RootColor = pos.side_to_move();
TimeMgr.init(Limits, pos.startpos_ply_counter(), pos.side_to_move());
TT.new_search();
H.clear();
TimeMgr.init(Limits, pos.startpos_ply_counter(), pos.side_to_move());
TT.new_search();
H.clear();
#include <cstring>
#include <vector>
#include <cstring>
#include <vector>
#include "types.h"
class Position;
#include "types.h"
class Position;
extern LimitsType Limits;
extern std::vector<RootMove> RootMoves;
extern Position RootPosition;
extern LimitsType Limits;
extern std::vector<RootMove> RootMoves;
extern Position RootPosition;
extern void init();
extern int64_t perft(Position& pos, Depth depth);
extern void init();
extern int64_t perft(Position& pos, Depth depth);
const std::set<Move>& searchMoves) {
wait_for_search_finished();
const std::set<Move>& searchMoves) {
wait_for_search_finished();
+ SearchTime.restart(); // As early as possible
+
Signals.stopOnPonderhit = Signals.firstRootMove = false;
Signals.stop = Signals.failedLowAtRoot = false;
Signals.stopOnPonderhit = Signals.firstRootMove = false;
Signals.stop = Signals.failedLowAtRoot = false;