From: Marco Costalba Date: Tue, 1 Dec 2009 10:56:48 +0000 (+0100) Subject: Don't clear hash at the beginning of a new game X-Git-Url: https://git.sesse.net/?p=stockfish;a=commitdiff_plain;h=403db5a6e9f004e39773dbc6cea9d1a99c81a233 Don't clear hash at the beginning of a new game After 900 games at 1+0 Mod vs Orig +217 =480 -196 +8 ELO Signed-off-by: Marco Costalba --- diff --git a/src/search.cpp b/src/search.cpp index 5bbc0abd..b47b8b24 100644 --- a/src/search.cpp +++ b/src/search.cpp @@ -402,13 +402,13 @@ bool think(const Position& pos, bool infinite, bool ponder, int side_to_move, Problem = false; ExactMaxTime = maxTime; + if (button_was_pressed("New Game")) + loseOnTime = false; // reset at the beginning of a new game + // Read UCI option values TT.set_size(get_option_value_int("Hash")); if (button_was_pressed("Clear Hash")) - { TT.clear(); - loseOnTime = false; // reset at the beginning of a new game - } bool PonderingEnabled = get_option_value_bool("Ponder"); MultiPV = get_option_value_int("MultiPV"); diff --git a/src/uci.cpp b/src/uci.cpp index 69de2fb1..c4c1a037 100644 --- a/src/uci.cpp +++ b/src/uci.cpp @@ -124,7 +124,7 @@ namespace { } else if (token == "ucinewgame") { - push_button("Clear Hash"); + push_button("New Game"); Position::init_piece_square_tables(); RootPosition.from_fen(StartPosition); } diff --git a/src/ucioption.cpp b/src/ucioption.cpp index d1326a4c..2185edf0 100644 --- a/src/ucioption.cpp +++ b/src/ucioption.cpp @@ -125,6 +125,7 @@ namespace { o["Threads"] = Option(1, 1, 8); o["Hash"] = Option(32, 4, 4096); o["Clear Hash"] = Option(false, BUTTON); + o["New Game"] = Option(false, BUTTON); o["Ponder"] = Option(true); o["OwnBook"] = Option(true); o["MultiPV"] = Option(1, 1, 500);