If the PV can be extended by appending tablebase moves, it can be come a couple hundred of ply in length. That's one of the reasons I dropped MAXPLY from the program. The only absolutely way to handle a fixed length limit is to set MAXPLY to 12,000 or so, the theoretic maximum ply length of a game.bob wrote:Chances are, no matter what you set max ply to, you will get a PV that is longer. You have to have a cutoff point where you realize "I can't copy all of this hash-recovered pv on to the end of the current one, because it simply is too long.
That bit me as soon as I wrote this code a few years ago.
I still get some PVs that end with <HT> as a result. I could change MAXPLY to 128 or 256, but I am not sure I want to really display PVs that long, I am not sure they are sensible.
Using variable length move lists works. Moves are never copied; only the end links of lists are adjusted and this is always an O(1) time operation regardless of the lengths of the lists. Using a private move node recycler makes the node allocation time also an O(1) operation; this is more important than the append time because allocation happens more often. A private allocator is a good idea anyway, as hitting malloc() or new in a multithreaded application invites the possibility of a block due to a mutex in the library code.
If there is a downside to using lists, then it's the implementation time for installing the code into an already written program.

