Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: Thoughts about board representations...

Author: Dan Newman

Date: 17:07:56 02/11/00

Go up one level in this thread


On February 11, 2000 at 11:51:31, Tom Kerrigan wrote:

>On February 11, 2000 at 09:19:04, Dan Homan wrote:
>
>>It just recently occurred to me that anything I am doing with piece lists
>>I can do with bitboards but faster and more efficiently.  I am beginning
>>to wonder if there is any reason not to have bitboards (even if one doesn't
>>want to use them fully - ie rotated bitboard move generation).
>
>With piece lists, you can just look at the next element in the array and get the
>square # of the next piece.
>
>With a bitmap, you have to create a copy of the bitmap with your pieces. Then
>you have to repeatedly find the first bit of that bitmap and clear it.
>
>The former is obviously much faster, even if you are running on a 64-bit
>computer.
>
>(I'm not saying that bitmaps are bad. I'm just saying that there are obvious
>disadvantages.)
>
>-Tom

That's what I thought.  The first time I experimented with bitboards it became
clear to me that a bitboard move generator would run at about half the speed
of an 0x88 or 64 square based generator...so I dropped bitboards and figured
I'd wait for a 64-bit machine before trying them again.  But about 4 or 5
months ago I tried bitboards again--I'd gotten tired of my old 0x88 program
and thought I'd just give them a try again--and was really surprised at the
performance I got.  Here are some figures from runs on a PIII/500:

                 Skyblue3 (0x88)        Shrike (bitboards)
Capture gen:      1.2 M moves/s            2.0 M moves/s
Non-cap gen:     28.6 M moves/s           30.7 M moves/s
Full move gen:   14.9 M moves/s           21.7 M moves/s
Make/unmake:      3.0 M/s                  2.1 M/s
WAC @1s           456 knps                 530 knps

So there's not a really huge difference, but I certainly got boost going from
0x88 + piece lists to bitboards.  It made move generation and doing the SEE
much simpler--and no more worries about the design of the piece lists :)

(The figure on make/unmake is a little unfair to the bitboard program because
I also test for move legality in that one's make() function...  Also, the
530 knps figure is one that I got when the two programs had essentially
identical search and eval--now I'm getting about 490 knps with all the extra
eval I added recently.)

I guess the thing I like best about bitboards is not having to fool around
with piece lists anymore :).

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