]> git.sesse.net Git - stockfish/blobdiff - src/search.cpp
Set LSNTime to 100 ms
[stockfish] / src / search.cpp
index 65395b4ec95943171b5bafddde76d4bf0e41c0bb..4c90db53d93619a3a34cf0c3a9f0e6876a507ef8 100644 (file)
@@ -236,7 +236,7 @@ namespace {
 
   // Last seconds noise filtering (LSN)
   const bool UseLSNFiltering = true;
-  const int LSNTime = 4000; // In milliseconds
+  const int LSNTime = 100; // In milliseconds
   const Value LSNValue = value_from_centipawns(200);
   bool loseOnTime = false;
 
@@ -1148,6 +1148,10 @@ namespace {
         && !value_is_mate(beta)
         && !pos.has_pawn_on_7th(pos.side_to_move()))
     {
+        // Pass ss->eval to qsearch() and avoid an evaluate call
+        if (!tte || tte->static_value() == VALUE_NONE)
+            TT.store(posKey, ss->eval, VALUE_TYPE_EXACT, Depth(-127*OnePly), MOVE_NONE, ss->eval, ei.kingDanger[pos.side_to_move()]);
+
         Value rbeta = beta - razor_margin(depth);
         Value v = qsearch<NonPV>(pos, ss, rbeta-1, rbeta, Depth(0));
         if (v < rbeta)
@@ -1530,7 +1534,7 @@ namespace {
         // Stand pat. Return immediately if static value is at least beta
         if (bestValue >= beta)
         {
-            if (!tte) // FIXME, remove condition
+            if (!tte)
                 TT.store(pos.get_key(), value_to_tt(bestValue, ply), VALUE_TYPE_LOWER, Depth(-127*OnePly), MOVE_NONE, ss->eval, ei.kingDanger[pos.side_to_move()]);
 
             return bestValue;