Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: Bitboard user's information request

Author: Dan Newman

Date: 05:28:43 10/07/99

Go up one level in this thread


On October 07, 1999 at 07:42:16, frank phillips wrote:

>On October 06, 1999 at 20:27:02, Dan Newman wrote:
>
>>On October 06, 1999 at 07:32:00, Bas Hamstra wrote:
>>
>>>On October 06, 1999 at 05:42:45, Dan Newman wrote:
>>>
>>>>On October 05, 1999 at 12:00:19, Robert Hyatt wrote:
>>>>
>>>>>I have finished writing a paper for the JICCA on the rotated bitmap approach
>>>>>to chess...  although it includes traditional (non-rotated) bitmaps as well
>>>>>since an understanding of them is necessary to appreciate rotated bitmaps.
>>>>>
>>>>>There is very little literature to reference, excepting the paper in the
>>>>>old Chess Skill in Man and Machine book, so I thought that I would at least
>>>>>mention the names of current (and past, such as Kaissa) programs that are or
>>>>>did use bitboards.
>>>>>
>>>>>If you are using them, either post the particulars here (name of program,
>>>>>author, affiliation [if any], and so forth) and I'll include it.
>>>>>
>>>>>Thanks...
>>>>>
>>>>>Bob
>>>>
>>>>I'm working on one now that I am provisionally calling Shrike (after
>>>>the bird that impales its prey on cactus needles), but I've only been
>>>>working on this one for about 2 1/2 weeks...
>>>>
>>>>It uses non-rotated bitboards and so must frequently scan the board
>>>>for slider move generation and attack detection.
>>>>
>>>>So far I like it.  It's given me the simplest move generator and
>>>>make/undo code that I've gotten so far.  It is slightly slower
>>>>generating moves than my 0x88 program, but I suspect/hope that will
>>>>be offset by gains elsewhere--specifically in the SEE and eval.
>>>>
>>>>Name: Shrike
>>>>Author: Dan Newman
>>>>
>>>>-Dan.
>>>
>>>
>>>About that scanning the board:
>>>
>>>I have a simple testversion that too uses non rotated bitboards. If I want to
>>>know if a pseudo attack is blocked by any piece I use:
>>>
>>>  BlackPieces & WhitePieces & BlockMask[FromSquare][ToSquare]
>>
>>I think you meant:
>>   (BlackPieces | WhitePieces) & BlockMask[FromSquare][ToSquare]
>>
>>>
>>>The array BlockMask is a bitboard array which for each square to each other
>>>square (if possible, only "slider type") contains the bitmap. It works well, is
>>>easy and still fast.
>>>
>>>
>>>Regards,
>>>Bas Hamstra.
>>
>>That's neat.  I'll have to try it.  The only worry I'd have is the
>>space that BlockMask takes up (32k if I've calculated correctly) and
>>how that might affect the cache.  But it can be used in a lot of places
>>(move gen, SEE, in check test, eval, any place that needs to calculate
>>attacks) and seems like it'd be a lot quicker than scanning.
>>
>>-Dan.
>
>I found this to be slower (not much) than a mixed approach using the
>integer-offsets-array approach for sliders when the bitboard test indicated a
>pseudo attack.  With offsets you can often catch the queen attacks early, when
>testing for rook attacks and bishop attacks.
>

Hmm.  I wonder why.  It could just be due to the large mask array getting
knocked out of cache and attendant memory access costs.  Or it could be
that scans of the board are very short on average (I don't know this, but
it certainly seems possible) and so are very cheap.

>Should  bitboards or rotated bitboard be faster?
>
>Frank

Interesting question, but hard to tell.  If you use one technique for a long
time, you'll no doubt find some tricks to make things faster.  Then if you
(briefly) try another technique it might not look as good.  But with more
time, that one may turn out to be faster...  I suspect that on 32-bit
Intel machines that non-rotated with board scanning (or the mask trick)
might be faster than rotated for generating moves.  And certainly making
and unmaking moves would be slightly faster because there are fewer bitboards
to update.  But for SEE, eval term calculations, and other things, I don't
really have a good feel for it.

-Dan.



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.