X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=src%2Fsearch.cpp;h=2b41ec448da40db166b8a107e7a529ddc0a491e1;hb=6a8cfe79da1b645ba3196458aca0e2c7247cbba2;hp=6e210c0f2f086e219e0f3f217c229cc00c1b6050;hpb=9e1d142fddd2cf1a8287888a15994ccbaa547c45;p=stockfish diff --git a/src/search.cpp b/src/search.cpp index 6e210c0f..2b41ec44 100644 --- a/src/search.cpp +++ b/src/search.cpp @@ -753,12 +753,12 @@ namespace { if (dbg_show_hit_rate) dbg_print_hit_rate(LogFile); - UndoInfo u; + StateInfo st; LogFile << "Nodes: " << nodes_searched() << std::endl << "Nodes/second: " << nps() << std::endl << "Best move: " << move_to_san(p, ss[0].pv[0]) << std::endl; - p.do_move(ss[0].pv[0], u); + p.do_move(ss[0].pv[0], st); LogFile << "Ponder move: " << move_to_san(p, ss[0].pv[1]) << std::endl << std::endl; } @@ -781,7 +781,7 @@ namespace { { int64_t nodes; Move move; - UndoInfo u; + StateInfo st; Depth ext, newDepth; RootMoveNumber = i + 1; @@ -807,7 +807,7 @@ namespace { newDepth = (Iteration - 2) * OnePly + ext + InitialDepth; // Make the move, and search it - pos.do_move(move, u); + pos.do_move(move, st); if (i < MultiPV) { @@ -835,7 +835,7 @@ namespace { } } - pos.undo_move(move, u); + pos.undo_move(move); // Finished searching the move. If AbortSearch is true, the search // was aborted because the user interrupted the search or because we @@ -1011,8 +1011,8 @@ namespace { Depth newDepth = depth - OnePly + ext; // Make and search the move - UndoInfo u; - pos.do_move(move, u); + StateInfo st; + pos.do_move(move, st); if (moveCount == 1) // The first move in list is the PV value = -search_pv(pos, ss, -beta, -alpha, newDepth, ply+1, threadID); @@ -1054,7 +1054,7 @@ namespace { } } } - pos.undo_move(move, u); + pos.undo_move(move); assert(value > -VALUE_INFINITE && value < VALUE_INFINITE); @@ -1182,8 +1182,8 @@ namespace { { ss[ply].currentMove = MOVE_NULL; - UndoInfo u; - pos.do_null_move(u); + StateInfo st; + pos.do_null_move(st); int R = (depth >= 4 * OnePly ? 4 : 3); // Null move dynamic reduction Value nullValue = -search(pos, ss, -(beta-1), depth-R*OnePly, ply+1, false, threadID); @@ -1201,7 +1201,7 @@ namespace { && pos.see(ss[ply + 1].currentMove) + nullValue >= beta) nullDrivenIID = true; - pos.undo_null_move(u); + pos.undo_null_move(); if (value_is_mate(nullValue)) { @@ -1334,8 +1334,8 @@ namespace { } // Make and search the move - UndoInfo u; - pos.do_move(move, u); + StateInfo st; + pos.do_move(move, st); // Try to reduce non-pv search depth by one ply if move seems not problematic, // if the move fails high will be re-searched at full depth. @@ -1358,7 +1358,7 @@ namespace { ss[ply].reduction = Depth(0); value = -search(pos, ss, -(beta-1), newDepth, ply+1, true, threadID); } - pos.undo_move(move, u); + pos.undo_move(move); assert(value > -VALUE_INFINITE && value < VALUE_INFINITE); @@ -1513,10 +1513,10 @@ namespace { continue; // Make and search the move. - UndoInfo u; - pos.do_move(move, u); + StateInfo st; + pos.do_move(move, st); Value value = -qsearch(pos, ss, -beta, -alpha, depth-OnePly, ply+1, threadID); - pos.undo_move(move, u); + pos.undo_move(move); assert(value > -VALUE_INFINITE && value < VALUE_INFINITE); @@ -1605,8 +1605,8 @@ namespace { continue; // Make and search the move. - UndoInfo u; - pos.do_move(move, u); + StateInfo st; + pos.do_move(move, st); // Try to reduce non-pv search depth by one ply if move seems not problematic, // if the move fails high will be re-searched at full depth. @@ -1628,7 +1628,7 @@ namespace { ss[sp->ply].reduction = Depth(0); value = -search(pos, ss, -(sp->beta - 1), newDepth, sp->ply+1, true, threadID); } - pos.undo_move(move, u); + pos.undo_move(move); assert(value > -VALUE_INFINITE && value < VALUE_INFINITE); @@ -1714,8 +1714,8 @@ namespace { Depth newDepth = sp->depth - OnePly + ext; // Make and search the move. - UndoInfo u; - pos.do_move(move, u); + StateInfo st; + pos.do_move(move, st); // Try to reduce non-pv search depth by one ply if move seems not problematic, // if the move fails high will be re-searched at full depth. @@ -1751,7 +1751,7 @@ namespace { Threads[threadID].failHighPly1 = false; } } - pos.undo_move(move, u); + pos.undo_move(move); assert(value > -VALUE_INFINITE && value < VALUE_INFINITE); @@ -1876,15 +1876,15 @@ namespace { if (includeMove) { // Find a quick score for the move - UndoInfo u; + StateInfo st; SearchStack ss[PLY_MAX_PLUS_2]; moves[count].move = mlist[i].move; moves[count].nodes = 0ULL; - pos.do_move(moves[count].move, u); + pos.do_move(moves[count].move, st); moves[count].score = -qsearch(pos, ss, -VALUE_INFINITE, VALUE_INFINITE, Depth(0), 1, 0); - pos.undo_move(moves[count].move, u); + pos.undo_move(moves[count].move); moves[count].pv[0] = moves[i].move; moves[count].pv[1] = MOVE_NONE; // FIXME count++;