diff --git a/src/search.cpp b/src/search.cpp index e6495028..1d27dad5 100644 --- a/src/search.cpp +++ b/src/search.cpp @@ -201,6 +201,12 @@ namespace { // Depth limit for use of dynamic threat detection Depth ThreatDepth; // heavy SMP read access + // Last seconds noise filtering (LSN) + const bool UseLSNFiltering = true; + const int LSNTime = 4000; // In milliseconds + const Value LSNValue = value_from_centipawns(200); + bool looseOnTime = false; + // Extensions. Array index 0 is used at non-PV nodes, index 1 at PV nodes. // There is heavy SMP read access on these arrays Depth CheckExtension[2], SingleReplyExtension[2], PawnPushTo7thExtension[2]; @@ -367,7 +373,10 @@ bool think(const Position& pos, bool infinite, bool ponder, int side_to_move, // Read UCI option values TT.set_size(get_option_value_int("Hash")); if (button_was_pressed("Clear Hash")) + { TT.clear(); + looseOnTime = false; // reset at the beginning of a new game + } bool PonderingEnabled = get_option_value_bool("Ponder"); MultiPV = get_option_value_int("MultiPV"); @@ -400,10 +409,6 @@ bool think(const Position& pos, bool infinite, bool ponder, int side_to_move, if (UseLogFile) LogFile.open(get_option_value_string("Search Log Filename").c_str(), std::ios::out | std::ios::app); - bool UseLSNFiltering = get_option_value_bool("LSN filtering"); - int LSNTime = get_option_value_int("LSN Time Margin (sec)") * 1000; - Value LSNValue = value_from_centipawns(get_option_value_int("LSN Value Margin")); - MinimumSplitDepth = get_option_value_int("Minimum Split Depth") * OnePly; MaxThreadsPerSplitPoint = get_option_value_int("Maximum Number of Threads per Split Point"); @@ -481,8 +486,7 @@ bool think(const Position& pos, bool infinite, bool ponder, int side_to_move, // We're ready to start thinking. Call the iterative deepening loop function - static bool looseOnTime = false; - + // // FIXME we really need to cleanup all this LSN ugliness if (!looseOnTime) { diff --git a/src/ucioption.cpp b/src/ucioption.cpp index be5a1df5..92729355 100644 --- a/src/ucioption.cpp +++ b/src/ucioption.cpp @@ -119,9 +119,6 @@ namespace { o["Full Depth Moves (PV nodes)"] = Option(14, 1, 100); o["Full Depth Moves (non-PV nodes)"] = Option(3, 1, 100); o["Threat Depth"] = Option(5, 0, 100); - o["LSN filtering"] = Option(true); - o["LSN Time Margin (sec)"] = Option(4, 1, 10); - o["LSN Value Margin"] = Option(200, 100, 600); o["Randomness"] = Option(0, 0, 10); o["Minimum Split Depth"] = Option(4, 4, 7); o["Maximum Number of Threads per Split Point"] = Option(5, 4, 8);