Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: attack tables

Author: KarinsDad

Date: 13:21:17 04/27/99

Go up one level in this thread


On April 27, 1999 at 15:47:09, Will Singleton wrote:


>
>Thanks for the explanation, sounds like you're making good progress.  It always
>seemed to me that the overhead of incrementally updating the attack-tables at
>each node would negate the advantage derived at move-gen.  But I guess you
>haven't got far enough to test that trade-off yet.
>
>
>Will

Yes, incrementally updating the attack tables is a BEAR.

I was working on that last night and decided to not even bother yet.

The steps required are:

1) Clear all piece attacks for the source square of the moving piece
2) Clear all piece attacks for any long range piece that attacks the source
square
3) If a piece is taken, clear all piece attacks for any piece taken at the
destination square
4) If a piece is not taken, clear all piece attacks for any long range piece
that attacks the destination square and then set all piece attacks for any long
range piece that attacks the destination square
5) Set all piece attacks for any long range piece that attacks the source square
6) Set all piece attacks for the destination square of the moving piece

However, this will result in considerably less (maybe 70%) work than creating
the attack tables from scratch since most pawn, knight, and king (and all long
range pieces that did not attack the source or destination square) pieces will
not be affected.

I also could not come up with a way to quickly turn off the bits (for example in
step 4 above) that are not needed without turning them all off and then
re-performing the calculation for each piece. I'm sure there is a way to do it
(which would speed this up), but I haven't attempted to figure it out yet.

Your idea that the incremental calculation basically offsets the gain in move
gen may be correct. However, since I am also going to use a derivative of the
piece attack tables in the evaluation, I am sort of killing two birds with one
stone. So, I'm hoping that I will gain more than I lose. Also, I'm hoping that I
can use the Piece Attack tables for other things (such as quickly calculating
open files, etc.), so I'm hoping that it will give me even more.

KarinsDad :)



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.