]> git.sesse.net Git - stockfish/commitdiff
Restore safety margin of 60ms
authorlucasart <lucas.braesch@gmail.com>
Sun, 20 Aug 2017 11:59:46 +0000 (19:59 +0800)
committerlucasart <lucas.braesch@gmail.com>
Sun, 20 Aug 2017 12:00:31 +0000 (20:00 +0800)
What this patch does is:
* increase safety margin from 40ms to 60ms. It's worth noting that the previous
  code not only used 60ms incompressible safety margin, but also an additional
  buffer of 30ms for each "move to go".
* remove a whart, integrating the extra 10ms in Move Overhead value instead.
  Additionally, this ensures that optimumtime doesn't become bigger than maximum
  time after maximum time has been artificially discounted by 10ms. So it keeps
  the code more logical.

Tested at 3 different time controls:

Standard 10+0.1
LLR: 2.95 (-2.94,2.94) [-3.00,1.00]
Total: 58008 W: 10674 L: 10617 D: 36717

Sudden death 16+0
LLR: 2.95 (-2.94,2.94) [-3.00,1.00]
Total: 59664 W: 10945 L: 10891 D: 37828

Tournament 40/10
LLR: 2.95 (-2.94,2.94) [-3.00,1.00]
Total: 16371 W: 3092 L: 2963 D: 10316

bench: 5479946

src/timeman.cpp
src/ucioption.cpp

index ea1e92d2aca5ca57ef0c6c2a6942ea2717d65753..330709be6985d84be15be778dfc8746eccd0741a 100644 (file)
@@ -66,10 +66,7 @@ namespace {
     if (type == OptimumTime && ponder)
         time *= 1.25;
 
     if (type == OptimumTime && ponder)
         time *= 1.25;
 
-    if (type == MaxTime)
-        time -= 10; // Keep always at least 10 millisecs on the clock
-
-    return std::max(0, time);
+    return time;
   }
 
 } // namespace
   }
 
 } // namespace
index 8bc4e4364383b01ba986b56bf6c6719b49dfc0b0..a2b4f276408b56cdffff8d4c6d9f3a17091bce67 100644 (file)
@@ -65,7 +65,7 @@ void init(OptionsMap& o) {
   o["Ponder"]                << Option(false);
   o["MultiPV"]               << Option(1, 1, 500);
   o["Skill Level"]           << Option(20, 0, 20);
   o["Ponder"]                << Option(false);
   o["MultiPV"]               << Option(1, 1, 500);
   o["Skill Level"]           << Option(20, 0, 20);
-  o["Move Overhead"]         << Option(30, 0, 5000);
+  o["Move Overhead"]         << Option(60, 0, 5000);
   o["nodestime"]             << Option(0, 0, 10000);
   o["UCI_Chess960"]          << Option(false);
   o["SyzygyPath"]            << Option("<empty>", on_tb_path);
   o["nodestime"]             << Option(0, 0, 10000);
   o["UCI_Chess960"]          << Option(false);
   o["SyzygyPath"]            << Option("<empty>", on_tb_path);