]> git.sesse.net Git - stockfish/blobdiff - src/search.cpp
Prefer ttMove to tte->move() in search()
[stockfish] / src / search.cpp
index 9cfd09e2ffa11c85f2bf8f047363dbfe3759056e..0fbdab56722b41c8368ad0123dbe3b25c525d764 100644 (file)
@@ -394,7 +394,7 @@ bool think(Position& pos, const SearchLimits& limits, Move searchMoves[]) {
 
   // Read UCI options
   UCIMultiPV = Options["MultiPV"].value<int>();
-  SkillLevel = Options["Skill level"].value<int>();
+  SkillLevel = Options["Skill Level"].value<int>();
 
   read_evaluation_uci_options(pos.side_to_move());
   Threads.read_uci_options();
@@ -871,8 +871,8 @@ namespace {
         search<PvNode>(pos, ss, alpha, beta, d);
         ss->skipNullMove = false;
 
-        ttMove = ss->bestMove;
         tte = TT.probe(posKey);
+        ttMove = tte ? tte->move() : MOVE_NONE;
     }
 
 split_point_start: // At split points actual search starts from here
@@ -885,8 +885,7 @@ split_point_start: // At split points actual search starts from here
     singularExtensionNode =   !Root
                            && !SpNode
                            && depth >= SingularExtensionDepth[PvNode]
-                           && tte
-                           && tte->move()
+                           && ttMove != MOVE_NONE
                            && !excludedMove // Do not allow recursive singular extension search
                            && (tte->type() & VALUE_TYPE_LOWER)
                            && tte->depth() >= depth - 3 * ONE_PLY;
@@ -949,7 +948,7 @@ split_point_start: // At split points actual search starts from here
       // on all the other moves but the ttMove, if result is lower than ttValue minus
       // a margin then we extend ttMove.
       if (   singularExtensionNode
-          && move == tte->move()
+          && move == ttMove
           && ext < ONE_PLY)
       {
           Value ttValue = value_from_tt(tte->value(), ss->ply);
@@ -1067,7 +1066,6 @@ split_point_start: // At split points actual search starts from here
               ss->reduction = reduction<PvNode>(depth, moveCount);
               if (ss->reduction)
               {
-                  alpha = SpNode ? sp->alpha : alpha;
                   Depth d = newDepth - ss->reduction;
                   value = -search<NonPV>(pos, ss+1, -(alpha+1), -alpha, d);