Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: how to back up the PV with minimal work.

Author: Sune Fischer

Date: 01:32:40 01/20/04

Go up one level in this thread


On January 19, 2004 at 21:52:53, Robert Hyatt wrote:

>Here is what I do.  Dirt-simple.  No extra work:

There is also the termination issue.

>Finally I copy the best move at the _current ply_ into the PV for the
>previous ply.  To count the work done, if doing a 10 ply search with no
>extensions, at ply=10 all I do is store the current move at ply=9 in path[10].
>When I finish 9, I copy that one word back to ply 8 and then stuff my best
>move in at path[9].
>
>By the time I get to the root I have copied 10+9+8+7+...+1 words total.  I
>had been intending to simplify this a bit further, but it has no cost and I
>have not done anything else.

That is a very optimistic estimate, you are assuming perfect move ordering.
I'm quite sure there will be cases where you do 100 times that amount of work.

The fundamental principle in chess programming is never to do any work that is
not needed.
That's why I think it is a bit silly to update a PV a few hundred times (in
particular in qsearch) and then only print it out the last one.

If you need the pv for search related things I can understand, but if you only
want it to look at it then it is nothing more than eye-candy.

> Using a special "sentinel" isn't quite as clean
>for me as I have a pathl value that tells me how many moves are in the PV,
>so that I can tell memcpy() how much stuff needs copying.
>
>I could copy the entire path each time I back it up, but that is extra traffic
>that is not needed.

I wonder if memcpy is faster for such tiny amounts, my impression was that
memcpy is best with large chunks of data.

-S.



This page took 0.01 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.