Page 1 of 1

PV for console output problem

Posted: Fri Nov 25, 2016 10:37 pm
by thevinenator
I'm working on displaying the PV after each iterative ply.
to do so, I walk the moves from the PV onto a a temporary board with the following stopping actions:

a TT entry was not found for the position
a TT entry was found but it wasn't an EXACT type
the move from the PV wasn't valid for the given position (more of a dumb programmer check)

this seems to work ok until i tried it on the Fine 70 position.
8/k7/3p4/p2P1p2/P2P1P2/8/8/K7 w - - 0 1

when the iterative loops it gets down to ply 25 or so, the moves returned from the TT after 8 or 9 moves in put it into an endless loop, meaning the move from position (b) points back to position (a) which points to position (b), which eventually overwrote some buffers. my first instinct was that i had a problem with my repetition code, which there was, but once repaired, the problem still persists.

any ideas what is causing this?

i can temporarily keep it from running away by limiting the amount of PV moves I display to a fixed number, but me thinks there is something else wrong, perhaps with the way i'm storing results in the TT.

Re: PV for console output problem

Posted: Sun Nov 27, 2016 11:12 pm
by H.G.Muller
This seems to be normal; I often saw that in my engine Joker too. This also reconstructs the PV from the TT after the search.

Re: PV for console output problem

Posted: Mon Nov 28, 2016 3:46 am
by thevinenator
I found a solution.
I dumped the PV from the TT idea and used Bruce Moreland's method described here:

https://chessprogramming.wikispaces.com ... +variation

no more errors!

Re: PV for console output problem

Posted: Mon Nov 28, 2016 11:18 am
by H.G.Muller
In my recent engine I also switched to collecting PV durig search. The disadvantage of this method is that you often find shortened PVs because the PV ran into a hash cutoff. Crafty now uses a method that also solves that, which is storing the entire PV of all PV nodes in the TT, so that a TT hit can retrieve the tail of the PV even when it does cause a cutoff.