Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: bitboard vs 0x88 again?

Author: Robert Hyatt

Date: 13:36:48 10/08/03

Go up one level in this thread


On October 08, 2003 at 15:01:55, Tord Romstad wrote:

>On October 08, 2003 at 09:18:51, Sune Fischer wrote:
>
>>On October 08, 2003 at 08:17:17, Tord Romstad wrote:
>>
>>>I don't know much about the "many advantages".  My main reason for this
>>>board representation is that it is extremely simple to use, and that
>>>the code is clear and easy to understand.
>>
>>Heh, that would be my reason to use bitboards :)
>>
>>The good thing about bitboards IMO, is that all the complexity is located in the
>>initializing of the attack boards (if you use rotated).
>
>The problem is that you have to do lots of low-level stuff before you
>even get off the ground.  I detest low-level programming, and try
>to avoid it whenever possible.
>
>>The parts one needs to work with a lot is kept clean and simple instead of being
>>littered with loops everywhere.
>
>People keeps claiming that, but all the bitboard code I have seen includes
>lots of loops (mostly loops through all the 1s in a bitboard).
>
>>Oh well, individual taste can't be debated I guess.

The point is this.  (for loops).  A bishop is on e4.  It attacks a piece
at h7 and at c6.  All other diagonal squares are empty.  A bitboard program
that is generating captures (which is by far the most common case due to
the q-search) will go through a loop, but only _two_ iterations, one for
each capture.  What about a program that doesn't use bitmaps?  You will have to
traverse each diagonal until the end or hitting a blocker, in all 4 directions.

So yes, both do loops, but one does _way_ fewer iterations.  That is the
savings.

>
>We can agree about that.  And as I have said repeatedly, it is entirely
>possible that I will try bitboards myself in the not too distant future
>(when I get a PowerMac G5).
>
>>There is just one thing about the geometrical relations I don't understand.
>>
>>Suppose you do
>>dir = sq1-sq2+128 (in 0x88)
>>
>>then dir is going to be some multiply of the direction and not (usually) the
>>step size needed for the board scan in the direction of dir.
>>
>>So if one needs a table lookup in any cas, what's the great advantage over the
>>smaller 64 sized board?
>
>Geometrical relations are not only useful for generating attack information,
>but also in the evaluation, like when evaluating the king's position
>relatively to passed pawns and other pieces in the endgame.  I don't claim
>that the advantage is very great, but it's there.
>
>Tord



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.