]> git.sesse.net Git - stockfish/blobdiff - src/search.cpp
Retire approximateEval field from SplitPoint
[stockfish] / src / search.cpp
index f7a39943740d2021854de3a1788e86b70dcce058..e784045f37367235cb19498d9a33bb18a6cfd7a6 100644 (file)
@@ -310,8 +310,7 @@ namespace {
   bool idle_thread_exists(int master);
   bool split(const Position& pos, SearchStack* ss, int ply,
              Value *alpha, Value *beta, Value *bestValue,
-             const Value futilityValue, const Value approximateValue,
-             Depth depth, int *moves,
+             const Value futilityValue, Depth depth, int *moves,
              MovePicker *mp, int master, bool pvNode);
   void wake_sleeping_threads();
 
@@ -373,7 +372,7 @@ bool think(const Position& pos, bool infinite, bool ponder, int side_to_move,
   {
       Move bookMove;
       if (get_option_value_string("Book File") != OpeningBook.file_name())
-          OpeningBook.open("book.bin");
+          OpeningBook.open(get_option_value_string("Book File"));
 
       bookMove = OpeningBook.get_move(pos);
       if (bookMove != MOVE_NONE)
@@ -1142,9 +1141,6 @@ namespace {
         search_pv(pos, ss, alpha, beta, depth-2*OnePly, ply, threadID);
         ttMove = ss[ply].pv[ply];
         tte = TT.retrieve(pos.get_key());
-
-        // If tte->move() != MOVE_NONE then it equals ttMove
-        assert(!(tte && tte->move()) || tte->move() == ttMove);
     }
 
     // Initialize a MovePicker object for the current position, and prepare
@@ -1272,7 +1268,7 @@ namespace {
           && idle_thread_exists(threadID)
           && !AbortSearch
           && !thread_should_stop(threadID)
-          && split(pos, ss, ply, &alpha, &beta, &bestValue, VALUE_NONE, VALUE_NONE,
+          && split(pos, ss, ply, &alpha, &beta, &bestValue, VALUE_NONE,
                    depth, &moveCount, &mp, threadID, true))
           break;
     }
@@ -1435,7 +1431,7 @@ namespace {
 
     // Go with internal iterative deepening if we don't have a TT move
     if (UseIIDAtNonPVNodes && ttMove == MOVE_NONE && depth >= 8*OnePly &&
-        evaluate(pos, ei, threadID) >= beta - IIDMargin)
+        !isCheck && evaluate(pos, ei, threadID) >= beta - IIDMargin)
     {
         search(pos, ss, beta, Min(depth/2, depth-2*OnePly), ply, false, threadID);
         ttMove = ss[ply].pv[ply];
@@ -1576,7 +1572,7 @@ namespace {
           && idle_thread_exists(threadID)
           && !AbortSearch
           && !thread_should_stop(threadID)
-          && split(pos, ss, ply, &beta, &beta, &bestValue, futilityValue, approximateEval,
+          && split(pos, ss, ply, &beta, &beta, &bestValue, futilityValue,
                    depth, &moveCount, &mp, threadID, false))
           break;
     }
@@ -2894,8 +2890,7 @@ namespace {
 
   bool split(const Position& p, SearchStack* sstck, int ply,
              Value* alpha, Value* beta, Value* bestValue, const Value futilityValue,
-             const Value approximateEval, Depth depth, int* moves,
-             MovePicker* mp, int master, bool pvNode) {
+             Depth depth, int* moves, MovePicker* mp, int master, bool pvNode) {
 
     assert(p.is_ok());
     assert(sstck != NULL);
@@ -2934,7 +2929,6 @@ namespace {
     splitPoint->pvNode = pvNode;
     splitPoint->bestValue = *bestValue;
     splitPoint->futilityValue = futilityValue;
-    splitPoint->approximateEval = approximateEval;
     splitPoint->master = master;
     splitPoint->mp = mp;
     splitPoint->moves = *moves;