-/// TranspositionTable::full() returns the permill of all transposition table
-/// entries which have received at least one write during the current search.
-/// It is used to display the "info hashfull ..." information in UCI.
+/// TranspositionTable::extract_pv() builds a PV by adding moves from the
+/// transposition table. We consider also failing high nodes and not only
+/// VALUE_TYPE_EXACT nodes. This allow to always have a ponder move even
+/// when we fail high at root and also a long PV to print that is important
+/// for position analysis.
+
+void TranspositionTable::extract_pv(const Position& pos, Move bestMove, Move pv[], const int PLY_MAX) {
+
+ const TTEntry* tte;
+ StateInfo st;
+ Position p(pos, pos.thread());
+ int ply = 0;