Author: Peter Fendrich
Date: 12:03:54 10/29/98
Go up one level in this thread
On October 29, 1998 at 13:36:30, Roberto Waldteufel wrote: > >On October 29, 1998 at 06:34:05, Peter Fendrich wrote: > >>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 > >I don't understand why unmake move does not need to update the rotated >bitboards, unless do you pass them as parameters when recursing to the next ply? >(is this more efficient than global bitboards?) Otherwise, you have to do four >masking steps whenever the occupancy of a square changes, which will happen when >unmaking moves, sometimes for the destination square, and always for the source >square. What I ment was that no looping through atk tables is needed. The atk tables are static and are only initialized once. The bitbords that holds where the pieces are has to be updated but that's nothing compared to looping through rays of attacks. >I like the idea of only maintaining one set of atkto tables, but in practice >these are what take most of the time at present. The atkfr tables are much >faster to update, at least the way I do it they are anyway. So, as you say, this >may not really be worth much of a saving. Well, I wish there was a clever way of doing this but haven't found out how. I really miss the aktto table! >Best wishes, >Roberto
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.