Author: Steven Edwards
Date: 12:45:38 09/03/03
Go up one level in this thread
On September 03, 2003 at 14:53:23, Robert Hyatt wrote:
>fine 70 searched to 39 plies deep:
>
>copy/make : 15.5 seconds, make/unmake 14.0 seconds (11% overhead)
>
>kopec 22 searched to 12 plies deep:
>
>copy/make : 32.4 seconds, make/unmake 28.3 seconds. (14.5% overhead)
>
>mate position searched 9 plies deep (mate in 10)
>
>copy/make : 8.9 seconds, make/unmake 7.5 seconds. (18.7% overhead)
I have seen similar numbers demonstrating the superiority of make/unmake in my
testing, although with a slightly higher ratio.
>That's not all the story. however. The copy/make approach requires an
>extra register everywhere since the data structures have to be accessed
>through a pointer (or via an array subscript, same thing). My test case
>does not take care of that. But if you were to mark one register as
>"unusable" for the compiler, the result would be worse, for certain. Since
>these data values are accessed all over the place, a register has to be used
>everywhere, which is going to add to the above, significantly. If it only adds
>10% then the above numbers are back to what I originally saw when I speeded
>things up by 25% by getting rid of copy/make.
There is no additional penalty if using C++, as a register for the this pointer
is already allocated. At least part of the overall impact is dependent on the
number of addressing registers available. The PowerPC has 32 registers, so this
isn't much of a concern compared to x86.
The CT toolkit gives the designer a choice. For each of the five position
classes (one includes a BB database), there are three routines:
Execute(const CTMove &theMove); // Update in-place
Execute(const CTMove &theMove, CTEnv &theEnv); // Update, saving the (small)
environment
Retract((const CTMove &theMove, const CTEnv &theEnv); // Retract and restore
Most of the time, the latter two routines are used:
CTEnv theEnv;
thePosition.Execute(theMove, theEnv);
....
thePosition.Retract(theMove, theEnv); // Retract to restore
To implement copy/make is easy:
CTPosition theNextPosition = thePosition; // Make a copy of the whole
position and data
theNextPosition.Execute(theMove); // No need to retract
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.