Author: Severi Salminen
Date: 00:34:51 10/31/02
Go up one level in this thread
>Take the case of the first subtree search at the root, for say the 4th iterated
>search (with depth 4). The prior depth=3 search would have made one PV. Now as
>soon as I enter alphabeta, as part of the code I do board->pv_length[ply] = ply,
>so for ply=0 (root) it become board->pv_length[0] = 0.
>Now as part of move generation when I am in the GEN_PV phase, how do I know the
>length of the PV so that I generate a *correct* PV move.
>The code goes something like
>
>if(board->follow_pv==TRUE && ply<board->pv_length[0])
>{
> generate PV move;
>
>}
>else
>{
>either we are not following the PV or the PV was short enough so that it never
>reached till this ply.
>}
>
>Now if I have already made board->pv_length[0]=0 the second condition in the
>above if check will always be false.
When you think of it, you'll see where you make an error. You have to understand
what pv_length[ply]=ply actually means. Maybe you copied it from another program
or some CC document, I don't know: that usually leads to not understanding what
really happens. (I don't mean to offend, just to remind). PV_Length basically
tells us how many plies we have PV left for that particular ply. If we have
pv_length[3]==5, then we have a pv of 2 moves at ply 3. Whether that is part of
the _actual_ pv (starting from ply 0) is another issue.
When you start a search, you have an actual PV from previous iteration, 3 plies
for example. So pv_length[0]==3. Now we enter search(depth=4). Why would we need
to say that pv_length[0]=0??? Well, we don't need to say it at all. It is 3 and
it can be 3, so pv_length[0]==3. We just continue our search and the above
condition works. And if and when we get another PV (most likely 4 plies deep),
then the pv_length[0] gets updated. So remove the pv_length[0]=0 statement.
Actually you should consider writing a separate rootsearch() function to take
care everything that is done only in root - that way you don't have to make any
exceptions if you use something like pv_length[ply]=ply in search().
>One way I can think of is to use the hash as the PV will be there in the hash
Yes, that is another issue. PV can be retrieved from hash table (unless part of
it has been rewritten there). I have not yet done that so I can't help more. But
just by following HT moves from root position you should be able to retrieve the
whole PV. Worth trying!
Severi
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.