]> git.sesse.net Git - stockfish/blobdiff - src/search.cpp
Clean up common adjustments
[stockfish] / src / search.cpp
index f3e9c15d58776c8b79ae5e1565469763ab3bfd50..8da1c34512293bf027bb2db737b98ce68b424467 100644 (file)
@@ -171,6 +171,9 @@ namespace {
   // evaluation of the position is more than NullMoveMargin below beta.
   const Value NullMoveMargin = Value(0x200);
 
+  // Depth limit for use of dynamic threat detection when null move fails low
+  const Depth ThreatDepth = 5 * OnePly;
+
   // Step 9. Internal iterative deepening
 
   const Depth IIDDepthAtPVNodes = 5 * OnePly;
@@ -215,7 +218,7 @@ namespace {
   inline Depth    pv_reduction(Depth d, int mn) { return (Depth)    PVReductionMatrix[Min(d / 2, 63)][Min(mn, 63)]; }
   inline Depth nonpv_reduction(Depth d, int mn) { return (Depth) NonPVReductionMatrix[Min(d / 2, 63)][Min(mn, 63)]; }
 
-
+  // Step. Common adjustments
 
   // Search depth at iteration 1
   const Depth InitialDepth = OnePly;
@@ -224,17 +227,15 @@ namespace {
   // better than the second best move.
   const Value EasyMoveMargin = Value(0x200);
 
-  /// Variables initialized by UCI options
-
-  // Depth limit for use of dynamic threat detection
-  Depth ThreatDepth;
-
   // Last seconds noise filtering (LSN)
   const bool UseLSNFiltering = true;
   const int LSNTime = 4000; // In milliseconds
   const Value LSNValue = value_from_centipawns(200);
   bool loseOnTime = false;
 
+
+  /// Global variables
+
   // Iteration counters
   int Iteration;
 
@@ -429,8 +430,6 @@ bool think(const Position& pos, bool infinite, bool ponder, int side_to_move,
   MateThreatExtension[1] = Depth(get_option_value_int("Mate Threat Extension (PV nodes)"));
   MateThreatExtension[0] = Depth(get_option_value_int("Mate Threat Extension (non-PV nodes)"));
 
-  ThreatDepth   = get_option_value_int("Threat Depth") * OnePly;
-
   Chess960 = get_option_value_bool("UCI_Chess960");
   ShowCurrentLine = get_option_value_bool("UCI_ShowCurrLine");
   UseLogFile = get_option_value_bool("Use Search Log");