There is another issue... the hash reconstruction approach can produce a bogus PV.AndrewShort wrote:I did some testing, and the results are not surprising:
Generating the PV normally (via search) often yields the full pv, but occasionally you get a truncated PV due to exact hash hits surviving to the root.
Generating the PV after the fact, by walking the hash table, is very tempting, because it's so easy to write and it's fast - it doesn't bog down search. However, it usually yields a shorter PV than the normal way (via search) because of hash overwrites. I am not willing to not overwrite exact hash entries.
Sometimes, the after-the-fact hash walkthough generates a PV *longer* than the normal way (if normal yielded a truncated pv), but this is rare. In that case, you are just getting lucky that the hash table still contains the nodes in question.
So walking the hash table seems inferior to me, particularly since the PV is fed into the next iteration of the search, to be sorted first. I suppose if before you try a new iteration you see the pv is truncated, you may as well walk the hash to see if you can get a fuller pv, as it's almost free, and only done in a specific case between iterations. A fuller pv would usually mean a better sorting of the next iteration.
The thing I want for debugging is to be able to have the sequence of moves leading exactly to the terminal node that produced the score that was backed up to the root. If the PV comes from the hash, it will be wrong often enough to make this kind of debugging very difficult...