X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fsearch.cpp;h=0b4125fcdd6ccf05279c848c1257eed89c042343;hp=995204f34aab2bf4cca090eb3e66c41f1c857c8a;hb=8e45e70e55c42c4750ccb729dcd49cdaafe5af44;hpb=126036abb093df88593ef9db67ac0b9a07f411a6;ds=sidebyside diff --git a/src/search.cpp b/src/search.cpp index 995204f3..0b4125fc 100644 --- a/src/search.cpp +++ b/src/search.cpp @@ -413,11 +413,6 @@ void Thread::search() { // search the already searched PV lines are preserved. std::stable_sort(rootMoves.begin() + PVIdx, rootMoves.end()); - // Write PV back to the transposition table in case the relevant - // entries have been overwritten during the search. - for (size_t i = 0; i <= PVIdx; ++i) - rootMoves[i].insert_pv_in_tt(rootPos); - // If search has been stopped, break immediately. Sorting and // writing PV back to TT is safe because RootMoves is still // valid, although it refers to the previous iteration. @@ -1564,33 +1559,6 @@ string UCI::pv(const Position& pos, Depth depth, Value alpha, Value beta) { } -/// RootMove::insert_pv_in_tt() is called at the end of a search iteration, and -/// inserts the PV back into the TT. This makes sure the old PV moves are searched -/// first, even if the old TT entries have been overwritten. - -void RootMove::insert_pv_in_tt(Position& pos) { - - StateInfo state[MAX_PLY], *st = state; - bool ttHit; - - for (Move m : pv) - { - assert(MoveList(pos).contains(m)); - - TTEntry* tte = TT.probe(pos.key(), ttHit); - - if (!ttHit || tte->move() != m) // Don't overwrite correct entries - tte->save(pos.key(), VALUE_NONE, BOUND_NONE, DEPTH_NONE, - m, VALUE_NONE, TT.generation()); - - pos.do_move(m, *st++, pos.gives_check(m, CheckInfo(pos))); - } - - for (size_t i = pv.size(); i > 0; ) - pos.undo_move(pv[--i]); -} - - /// RootMove::extract_ponder_from_tt() is called in case we have no ponder move /// before exiting the search, for instance, in case we stop the search during a /// fail high at root. We try hard to have a ponder move to return to the GUI,