X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fsearch.cpp;h=10aa196add95d87944db24863eb1cbd5c764010e;hp=8f2cbb0aa942bebd289024e4224e619ed1bcdbbf;hb=4fa5dd4db55ba9fde841120fc8fbcd99f6540eb4;hpb=5c4f6f6226c7b12bd737f10dba40b28f26f1b58d diff --git a/src/search.cpp b/src/search.cpp index 8f2cbb0a..10aa196a 100644 --- a/src/search.cpp +++ b/src/search.cpp @@ -22,7 +22,6 @@ //// #include -#include #include #include #include @@ -70,16 +69,16 @@ namespace { public: RootMoveList(Position &pos, Move searchMoves[]); - Move get_move(int moveNum) const; - Value get_move_score(int moveNum) const; - void set_move_score(int moveNum, Value score); - void set_move_nodes(int moveNum, int64_t nodes); + inline Move get_move(int moveNum) const; + inline Value get_move_score(int moveNum) const; + inline void set_move_score(int moveNum, Value score); + inline void set_move_nodes(int moveNum, int64_t nodes); void set_move_pv(int moveNum, const Move pv[]); - Move get_move_pv(int moveNum, int i) const; - int64_t get_move_cumulative_nodes(int moveNum) const; - int move_count() const; + inline Move get_move_pv(int moveNum, int i) const; + inline int64_t get_move_cumulative_nodes(int moveNum) const; + inline int move_count() const; Move scan_for_easy_move() const; - void sort(); + inline void sort(); void sort_multipv(int n); private: @@ -417,7 +416,7 @@ void think(const Position &pos, bool infinite, bool ponder, int side_to_move, int myTime = time[side_to_move]; int myIncrement = increment[side_to_move]; int oppTime = time[1 - side_to_move]; - + TimeAdvantage = myTime - oppTime; if(!movesToGo) { // Sudden death time control @@ -1123,9 +1122,8 @@ namespace { } } // Null move search not allowed, try razoring - else if ( depth < RazorDepth - && approximateEval < beta - RazorMargin - && evaluate(pos, ei, threadID) < beta - RazorMargin) + else if ( (approximateEval < beta - RazorMargin && depth < RazorDepth) + ||(approximateEval < beta - PawnValueMidgame && depth <= OnePly)) { Value v = qsearch(pos, ss, beta-1, beta, Depth(0), ply, threadID); if (v < beta) @@ -2175,6 +2173,12 @@ namespace { { lastInfoTime = t; lock_grab(&IOLock); + if (dbg_show_mean) + dbg_print_mean(); + + if (dbg_show_hit_rate) + dbg_print_hit_rate(); + std::cout << "info nodes " << nodes_searched() << " nps " << nps() << " time " << t << " hashfull " << TT.full() << std::endl; lock_release(&IOLock); @@ -2187,7 +2191,7 @@ namespace { bool overTime = t > AbsoluteMaxSearchTime || (RootMoveNumber == 1 && t > MaxSearchTime + ExtraSearchTime) - || ( !FailHigh && !fail_high_ply_1() && !Problem + || ( !FailHigh && !fail_high_ply_1() && !Problem && t > 6*(MaxSearchTime + ExtraSearchTime)); if ( (Iteration >= 2 && (!InfiniteSearch && overTime))