From e46a72dd1df5142cbbbd67ccff9ce2cbd3364450 Mon Sep 17 00:00:00 2001 From: Marco Costalba Date: Sat, 17 May 2014 12:49:52 +0200 Subject: [PATCH] Extract a reliable PV line Truncate the extracted PV from the point where the score stored in hash starts to deviate from the root score. Idea from Ronald de Man. bench: 8732553 --- src/search.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/search.cpp b/src/search.cpp index aa63fcb4..6a4e352f 100644 --- a/src/search.cpp +++ b/src/search.cpp @@ -1401,6 +1401,7 @@ void RootMove::extract_pv_from_tt(Position& pos) { const TTEntry* tte; int ply = 0; Move m = pv[0]; + Value expectedScore = score; pv.clear(); @@ -1411,8 +1412,10 @@ void RootMove::extract_pv_from_tt(Position& pos) { pos.do_move(pv[ply++], *st++); tte = TT.probe(pos.key()); + expectedScore = -expectedScore; } while ( tte + && expectedScore == value_from_tt(tte->value(), ply) && pos.pseudo_legal(m = tte->move()) // Local copy, TT could change && pos.legal(m, pos.pinned_pieces(pos.side_to_move())) && ply < MAX_PLY -- 2.39.2