Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: Rough comparison between rotated bitboards and 0x88

Author: Dan Newman

Date: 14:42:10 06/21/00

Go up one level in this thread


On June 21, 2000 at 14:15:55, Christophe Theron wrote:

>On June 20, 2000 at 21:22:38, Ricardo Gibert wrote:
>
>>On June 20, 2000 at 21:09:58, Christophe Theron wrote:
>>
>>>On June 20, 2000 at 14:58:54, James Robertson wrote:
>>>
>>>>On June 20, 2000 at 12:18:06, Ralf Elvsén wrote:
>>>>
>>>>>I'm asking about things I don't have much personal experience from
>>>>>so forgive me if this is a stupid question. With BB, as I understand
>>>>>it, one usually have a lot of precomputed BB-arrays, like bishopsMoves[square],
>>>>>maybe blocks[from][to]  or the rotated BB-stuff. Is this causing problems
>>>>>for the cache? How much precomputed stuff is needed in 0x88 compared to this?
>>>>>
>>>>>Ralf
>>>>
>>>>I'll answer your second question first. A tiny amount (guesstimate, maybe 1k) is
>>>>needed for 0x88. Bitboards require much more... almost 600k for core arrays on
>>>>my program. Crafty uses some funky thing called compact attacks which I guess
>>>>compacts the attacks. I don't know how it works. (Dr. Hyatt, could you please
>>>>explain how it works and what it's advantages are?)
>>>>
>>>>The precomputed arrays are usually in the form of attacks for ranks and files.
>>>>To try to stuff all bishop or rook moves into one array is a bad idea. For
>>>>instance, in my program, rook moves would require an array of dimensions
>>>>8*64*256*256 bytes = 33MB!
>>>>
>>>>Taking two arrays, one for ranks and one files (each 8*64*256 = 131072 bytes) is
>>>>a lot better.
>>>>
>>>>James
>>>
>>>
>>>I thought bitboards were elegant?
>>>
>>>Sorry, but 128K arrays to do such simple things sounds really ugly!
>>>
>>>Like a hammer to kill a fly.
>>
>>I'm not sure I understand your analogy. It would seem to me to be much more
>>difficult to kill a fly with a hammer, than with a much more appropriate tool
>>like a fly swatter.
>>
>>I think your analogy would work better with a shotgun, though given the
>>irritation factor of some flys, a shotgun does not seem like such a bad idea ;)
>
>
>A shotgun, if you want. Anyway, for me that's the same.
>
>Tell me about the elegance of the bitboard concept, after that...
>
>A 0x88 or 16x engine: 64Kb
>A bitboard engine: 2MB
>
>They are of equal strength.
>
>But the bitboard design is so smart! And when we have 64 bits processors, the
>bitboard program will not be stronger, but it will fit the processor's
>architecture so nicely! Just thinking about it makes me wet everywhere!
>
>Cute piece of expensive art I would say.
>
>
>    Christophe

I went through my bitboard program and tried to count up the data (most
is in one data.cpp file) and got about 360k, most of which isn't bitboard
stuff--about 40k of it is bitboards.  (I'm not doing rotated bitboards
though, and I imagine that it'd grow quite a bit larger if I did.)

I also went through my 0x88 program and found about 222k of data.  I think
it's smaller mainly due the the coordinate difference trick that lets you
use very small tables for attack detection.

The main thing I like about bitboards is that I don't need piece list
data structures with all their difficulties.

I think there is slightly more overhead on make/undo with bitboards, and
also that bitboards may cost a bit more when the board is sparsely
occupied (endgame).  [You still have to check the bitboards even if
they are now empty, but in 0x88 you can simply eliminate captured
pieces from the piece lists.]

Anyway, I think bitboards seem a bit more elegant [it's a toss up perhaps
with the ugly bitboard arrays versus the ugly piece list data structures
in 0x88], and, at least in my case, bitboards are somewhat faster than 0x88.

-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.