Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: Where is Principal Variation?

Author: Robert Hyatt

Date: 17:03:14 11/22/00

Go up one level in this thread


On November 22, 2000 at 16:43:10, Severi Salminen wrote:

>
>>Be careful.  It is possible to back up a value of "alpha" after searching every
>>move and finding that the successive ply fails high each time.  You now have
>>a score you are backing up, but you have _no_ PV to go along with it.  If your
>>test is wrong, you can break.  Same thing happens on a fail high.  You can back
>>up the current move as a best move for the 'fail-high PV', but you will have
>>_no_ moves below that node in the PV array.  It will probably contain old
>>moves that were not overwritten.  This will wreck you.
>
>Yes, this seems to be the problem. I found a position (mate in one for black)
>and after performing a 2 ply search my program thinks that the PV has two moves
>(which is obviously false). So when it tries all replies for white it sees that
>there are no legal replies and fails low, but doesn't know how to inform that
>the PV is not right.
>
>Now, how could I get rid of this annoying problem, so what are all the
>"exceptions"? I just can't figure it out...
>
>Severi


For mates it is easy.  Just set the length of the PV to ply-1, when you find
you have no legal moves at ply.  IE in Crafty, I have a string of moves in
the PV array, and a path_length variable that tells me how many moves are
in there...

This also saves a bit of memory copying as when you back up a PV, you only
have to back up the PV array from the current ply to the end of the PV.  The
previous ply can add in its move after it chooses what to back up.  Etc...



This page took 0 seconds to execute

Last modified: Thu, 15 Apr 21 08:11:13 -0700

Current Computer Chess Club Forums at Talkchess. This site by Sean Mintz.