]> git.sesse.net Git - stockfish/blobdiff - src/search.cpp
Disable "Null driven IID" by default
[stockfish] / src / search.cpp
index 2a2e32f943fae435ef69719364504b7b2f58fedc..26d8fde8767a1d26971c43949db7beb648d837ca 100644 (file)
@@ -107,7 +107,7 @@ namespace {
   const bool UseIIDAtNonPVNodes = false;
 
   // Use null move driven internal iterative deepening?
-  bool UseNullDrivenIID = true;
+  bool UseNullDrivenIID = false;
 
   // Internal iterative deepening margin.  At Non-PV moves, when
   // UseIIDAtNonPVNodes is true, we do an internal iterative deepening search
@@ -393,6 +393,7 @@ void 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);
 
+  UseNullDrivenIID = get_option_value_bool("Null driven IID");
   UseQSearchFutilityPruning = get_option_value_bool("Futility Pruning (Quiescence Search)");
   UseFutilityPruning = get_option_value_bool("Futility Pruning (Main Search)");
 
@@ -1138,6 +1139,7 @@ namespace {
 
     // Null move search
     if (    allowNullmove
+        &&  depth > OnePly
         && !isCheck
         &&  ok_to_do_nullmove(pos)
         &&  approximateEval >= beta - NullMoveMargin)
@@ -1159,7 +1161,7 @@ namespace {
             && ttMove == MOVE_NONE
             && ss[ply + 1].currentMove != MOVE_NONE
             && pos.move_is_capture(ss[ply + 1].currentMove)
-            && pos.see(ss[ply + 1].currentMove) * PawnValueMidgame + nullValue > beta - IIDMargin)
+            && pos.see(ss[ply + 1].currentMove) + nullValue >= beta)
             nullDrivenIID = true;
 
         pos.undo_null_move(u);
@@ -1175,9 +1177,9 @@ namespace {
                 return beta;
         } else {
             // The null move failed low, which means that we may be faced with
-            // some kind of threat.  If the previous move was reduced, check if
+            // some kind of threat. If the previous move was reduced, check if
             // the move that refuted the null move was somehow connected to the
-            // move which was reduced.  If a connection is found, return a fail
+            // move which was reduced. If a connection is found, return a fail
             // low score (which will cause the reduced move to fail high in the
             // parent node, which will trigger a re-search with full depth).
             if (nullValue == value_mated_in(ply + 2))
@@ -1216,8 +1218,9 @@ namespace {
         Move tm = ss[ply].threatMove;
 
         assert(tm != MOVE_NONE);
+        assert(ttMove == MOVE_NONE);
 
-        search(pos, ss, beta, Min(depth/2, depth-3*OnePly), ply, false, threadID);
+        search(pos, ss, beta, depth/2, ply, false, threadID);
         ttMove = ss[ply].pv[ply];
         ss[ply].threatMove = tm;
     }