]> git.sesse.net Git - stockfish/commitdiff
Remove "Last seconds noise" filtering UCI option
authorMarco Costalba <mcostalba@gmail.com>
Mon, 13 Jul 2009 10:44:33 +0000 (11:44 +0100)
committerMarco Costalba <mcostalba@gmail.com>
Wed, 15 Jul 2009 07:35:00 +0000 (08:35 +0100)
This feature makes sense during development, but
It doesn't seem to make sense for normal users.

Also fix a possible race where the GUI adjudicates
the game a fraction of second before the engine sets
looseOnTime flag so that it will bogusly waits until
it ran out of time at the beginning of the next new game.

The fix is to always reset looseOnTime at the beginning
of a new game.

Race condition spotted by Tord.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
src/search.cpp
src/ucioption.cpp

index e64950283445f001e0e69158684d22f5aee3ac5f..1d27dad5e3e96ee9b4f431f2bf5f466e3e44dc51 100644 (file)
@@ -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)
   {
index be5a1df53d8782189f4ee27c1bac23947377e10f..92729355c827cd0d5c3abcb41b0e910353bbef63 100644 (file)
@@ -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);