Author: leonid
Date: 14:24:55 11/16/99
Go up one level in this thread
On November 16, 1999 at 00:26:17, Scott Gasch wrote:
>Hi,
>
>I have been rewriting my engine from the ground up and trying to "do it right"
>this second go 'round. For instance, I pruned the move data struct from a huge
>56 byte struct down to an int to increase performance ;)
>
>I have recently been doing Vincent Diepeveen's test of move generation speed to
>clock how fast my generator is. In the prior version it generated at about 3
>million nodes/sec whereas in this version (with the much smaller move
>representation) it is up to about 6 million nodes/sec on my AMD K6-3 450.
>
>Vincent's test is to generate all successors of:
>rnbqkbnr/ppp2ppp/8/3pp3/3PP3/8/PPP2PPP/RNBQKBNR b KQkq e6 0 0
>
>in a loop, 2000000 times and keep track of how long it takes... then compute
>nodes/sec. Vincent gets 15 million in the same position with a slower
>processor!
>
>I have profiled my code and determined that the bottleneck is in my generation
>routines (as opposed to AddMove) So my question is this: I currently generate
>moves for a specific piece something like this:
>
> //
> // Figure out how the rook can move.
> //
> for (iDir = 0; iDir < 4; iDir++)
> {
> iTarg = x + iDelta[iDir];
> while (ONBOARD(iTarg))
> {
> iTargContents = PIECE_AT(psPos, iTarg);
>
> //
> // The rook can move if the square is empty.
> //
> if (IS_EMPTY(iTargContents))
> {
> AddMove(psPos, x, iTarg);
> }
>
> //
> // Or if there is an enemy piece there to capture.
> //
> else
> {
> if (COLOR(iTargContents) != COLOR(iRook))
> {
> AddMove(psPos, x, iTarg);
> }
> break;
> }
> iTarg += iDelta[iDir];
> }
> }
>
>However I see in GNUChess they use some kind of precomputed table.
I interrupted the message written by other person only to ask you the next
question: In what way, generally speaking, moves are generated? Through some
kind of general logic, or by looking in some in advance written moves table?
Leonid.
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.