How to ponder

Discussion of chess software programming and technical issues.

Moderator: Ras

bob
Posts: 20943
Joined: Mon Feb 27, 2006 7:30 pm
Location: Birmingham, AL

Re: How to ponder

Post by bob »

hgm wrote:
bob wrote:I can't start a search and get no PV back, because I have no way for a search to terminate without backing up the best move at the root, which can't be a hash hit since I don't probe at the root...
You can get a hash hit at the root PV daughter, if you probe there. Then your PV would only be one move long. (Unless you hash it, of course, but not many engines do.)
I always do this, but today it never happens, because I hash the path as well, remember? So about the only reason I see a short PV would be either a hash hit at ply=1 where there was either no path stored or the path has been overwritten, or by a repetition / 50 move draw detection that will truncate the PV on the spot.

However, in the case of either, when I complete that best move search, I do try to "walk the tt" to see if I can extend the PV beyond what I have.

Thankfully, the short PVs ending with <HT> or whatever have disappeared pretty much (can't save every path of course, but there are not that many and I RARELY see a short PV unless it is a draw problem.)
bob
Posts: 20943
Joined: Mon Feb 27, 2006 7:30 pm
Location: Birmingham, AL

Re: How to ponder

Post by bob »

JVMerlino wrote:
hgm wrote:
bob wrote:I can't start a search and get no PV back, because I have no way for a search to terminate without backing up the best move at the root, which can't be a hash hit since I don't probe at the root...
You can get a hash hit at the root PV daughter, if you probe there. Then your PV would only be one move long. (Unless you hash it, of course, but not many engines do.)
Please correct me if I'm wrong, as this is a bit of a corner case that involves clock management. But isn't it also possible to have a "PV" be only one move long because of a fail high? Then, because of severe time pressure, you make that move anyway because the search with a wider window hasn't finished yet and just hope for the best? At least, that's a possibility in my engine.

Of course, Bob's other ways of getting a move to ponder with will still apply here. So I'm just talking about the case of a one-move PV.

jm
Good catch, and you are right. On a FH, there is generally no best move (since all ply=2 moves failed low). There, I am forced to switch sides, and do a search (Crafty terminology calls this a "puzzling" search, as in "puzzling for a move to ponder."

This is actually the most common reason I get a short PV in fact, but most of the time I have time to re-search and get a real PV/score anyway...