Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: Delaying the KingInCheck - pros and cons?

Author: Peter Fendrich

Date: 03:34:05 10/29/98

Go up one level in this thread


On October 28, 1998 at 20:02:36, Roberto Waldteufel wrote:


>>I suppose that you have four routines to update your bitboards. Something like
>>CutAtttacksTo, ExpandAttacksTo, DeleteAttacksFrom and InsertAttacksFrom. If you
>>used rotated bitboards to get all the bits from a certain square you could OR
>>that into your atkfr table but you still had to loop through all these bits in
>>order to update the atkto table. So I agree, it would probably be an overkill...
>
>Well, I do something similar, but not quite like you say here. Remember that
>when a square is vacated, some of the attack maps for other pieces may change
>due to "discovered" attacks, so all the rays through that square need to be
>extended, whereas when a square that was empty becomes occupied, it is necessary
>to do the reverse and chop off any rays passing through the square.

That's the meaning of CutAtttacksTo(sq), ExpandAttacksTo(sq)

>However, I use a nice little trick, only updating these changes when >necessary. Thus when a
>capture takes place, only the from square needs to have its rays adjusted. >Also,
>because I generate captures in MVV/LVA order, I often have a situation where I
>try several captures with the same to-square. In this case I don't have to do
>the ray adjustments.
>
>I use these functions:
>
> Putman places a given man of a given side to a previously empty square.
>
> Cutman removes a piece from a square, making that square empty.
>
> Repman replaces a man on a given square with some givenm other man of the same
>side (no ray adjustments)
>
> Chngman  replaces a man on a given square with some given other man of the
>other side (no ray adjustments)

The result will be same I think: When I made a move i called those funktions I
mentioned above.
When it was a capture move I didn't have to call CutAtttacksTo(To-sq).

>All the bitboard updating is done in assembler, and runs quite quickly, but >when
>I first coded this it was very tricky to get it just right. The pentium's bsf
>and bsr instructions are very handy for this.
>
>I also have found that the evaluations are a problem, since my currant
>evaluation function (also in assembler) makes very heavy use of the attack
>tables. The fact that the tables' utility is so diverse makes it very difficult
>to quantify and weigh up against the overhead of continually updating them.
>
>Best wishes'
>Roberto
>
>>
>>//Peter

One idea is to keep the atkto table and use rotated bitboards instead of the
atkfr table. One table less to update. I never found out a clever way of doing
this however. The best part with the rotated bitboards is that the "UnMake Move"
doesn't have to update bitboards at all! In your current approach these atk
tables has to be updated 'backwards'.
By keeping the atkto table the unmake function seems to be almost as costly as
before even if the atkfr is replaced by rotated bitboards.

//Peter



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.