From fb03188fc7e96f8bd21177fa2a2990cf8dde7575 Mon Sep 17 00:00:00 2001 From: Marco Costalba Date: Sat, 11 Apr 2015 23:21:52 +0200 Subject: [PATCH] Assorted cleanup of last patches No functional change. --- src/search.cpp | 13 +++++++------ src/thread.cpp | 4 ---- src/uci.h | 6 +++--- src/ucioption.cpp | 2 +- 4 files changed, 11 insertions(+), 14 deletions(-) diff --git a/src/search.cpp b/src/search.cpp index 8f074ca6..cb8179e7 100644 --- a/src/search.cpp +++ b/src/search.cpp @@ -1068,7 +1068,6 @@ moves_loop: // When in check and at SpNode search starts from here rm.score = -VALUE_INFINITE; } - bool newBestMove = false; if (value > bestValue) { bestValue = SpNode ? splitPoint->bestValue = value : value; @@ -1081,7 +1080,6 @@ moves_loop: // When in check and at SpNode search starts from here && (move != EasyMove.get(pos.key()) || moveCount > 1)) EasyMove.clear(); - newBestMove = true; bestMove = SpNode ? splitPoint->bestMove = move : move; if (PvNode && !RootNode) // Update pv even in fail-high case @@ -1101,7 +1099,7 @@ moves_loop: // When in check and at SpNode search starts from here } } - if (!SpNode && !captureOrPromotion && !newBestMove && quietCount < 64) + if (!SpNode && !captureOrPromotion && move != bestMove && quietCount < 64) quietsSearched[quietCount++] = move; // Step 19. Check for splitting the search @@ -1147,7 +1145,7 @@ moves_loop: // When in check and at SpNode search starts from here : inCheck ? mated_in(ss->ply) : DrawValue[pos.side_to_move()]; // Quiet best move: update killers, history and countermoves - else if (bestMove != MOVE_NONE && !pos.capture_or_promotion(bestMove)) + else if (bestMove && !pos.capture_or_promotion(bestMove)) update_stats(pos, ss, bestMove, depth, quietsSearched, quietCount); tte->save(posKey, value_to_tt(bestValue, ss->ply), @@ -1405,9 +1403,12 @@ moves_loop: // When in check and at SpNode search starts from here *pv = MOVE_NONE; } - // update_stats() updates killers, history, countermove history and countermoves stats for a quiet best move. - void update_stats(const Position& pos, Stack* ss, Move move, Depth depth, Move* quiets, int quietsCnt) { + // update_stats() updates killers, history, countermove history and + // countermoves stats for a quiet best move. + + void update_stats(const Position& pos, Stack* ss, Move move, + Depth depth, Move* quiets, int quietsCnt) { if (ss->killers[0] != move) { diff --git a/src/thread.cpp b/src/thread.cpp index c73f5566..8eaee875 100644 --- a/src/thread.cpp +++ b/src/thread.cpp @@ -321,10 +321,6 @@ void ThreadPool::read_uci_options() { assert(requested > 0); - // If zero (default) then set best minimum split depth automatically - if (!minimumSplitDepth) - minimumSplitDepth = 5 * ONE_PLY ; - while (size() < requested) push_back(new_thread()); diff --git a/src/uci.h b/src/uci.h index 76e6cda6..eb0353a4 100644 --- a/src/uci.h +++ b/src/uci.h @@ -17,8 +17,8 @@ along with this program. If not, see . */ -#ifndef UCIOPTION_H_INCLUDED -#define UCIOPTION_H_INCLUDED +#ifndef UCI_H_INCLUDED +#define UCI_H_INCLUDED #include #include @@ -76,4 +76,4 @@ Move to_move(const Position& pos, std::string& str); extern UCI::OptionsMap Options; -#endif // #ifndef UCIOPTION_H_INCLUDED +#endif // #ifndef UCI_H_INCLUDED diff --git a/src/ucioption.cpp b/src/ucioption.cpp index fd6c46d2..2906ae62 100644 --- a/src/ucioption.cpp +++ b/src/ucioption.cpp @@ -57,7 +57,7 @@ void init(OptionsMap& o) { o["Write Debug Log"] << Option(false, on_logger); o["Contempt"] << Option(0, -100, 100); - o["Min Split Depth"] << Option(0, 0, 12, on_threads); + o["Min Split Depth"] << Option(5, 0, 12, on_threads); o["Threads"] << Option(1, 1, MAX_THREADS, on_threads); o["Hash"] << Option(16, 1, MaxHashMB, on_hash_size); o["Clear Hash"] << Option(on_clear_hash); -- 2.39.2