Bitboard implementation, how much time?

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

User avatar
Rebel
Posts: 6991
Joined: Thu Aug 18, 2011 12:04 pm

Bitboard implementation, how much time?

Post by Rebel »

How much time did it take you to convert:

1. Mailbox -> Rotated bitboard
2. Mailbox -> Magic bitboard

And have it 100% bug free.
User avatar
lucasart
Posts: 3232
Joined: Mon May 31, 2010 1:29 pm
Full name: lucasart

Re: Bitboard implementation, how much time?

Post by lucasart »

Rebel wrote:How much time did it take you to convert:

1. Mailbox -> Rotated bitboard
2. Mailbox -> Magic bitboard

And have it 100% bug free.
I never used mailbox
bob
Posts: 20943
Joined: Mon Feb 27, 2006 7:30 pm
Location: Birmingham, AL

Re: Bitboard implementation, how much time?

Post by bob »

Rebel wrote:How much time did it take you to convert:

1. Mailbox -> Rotated bitboard
2. Mailbox -> Magic bitboard

And have it 100% bug free.
Vague question.

FIrst move generator for Crafty, late 1994, took 3 months. Rotated bitboards came later. Another 3 months to work out the details and get code working. Moving to magic took an hour.

It is not a day's work. Magic was fastest because we had existing code. Those that originally used my rotated bitboard idea had the same advantage.
User avatar
Evert
Posts: 2929
Joined: Sat Jan 22, 2011 12:42 am
Location: NL

Re: Bitboard implementation, how much time?

Post by Evert »

I wrote a basic rotated bitboard engine from scratch (different orientation than described in Bob's paper though) in a few evenings.
I replaced it with "kindergarten" multiplication in one evening or so (this was not only simpler, but also faster).

Afterwards, I wrote a "kindergarten" bitboard engine basically from scratch in an evening (this one dealing with "hoppers" as well as "sliders"). I later extended that to arbitrary rectangular boards with up to 128 squares and width/height < 16 again in a few evenings (took a bit longer because I had to refactor a lot of code).

In other words, not a very long time...
I never wrote a mailboard program, but my first chess program used an 8x8 char array. I never reused code from that for anything though.
jdart
Posts: 4366
Joined: Fri Mar 10, 2006 5:23 am
Location: http://www.arasanchess.org

Re: Bitboard implementation, how much time?

Post by jdart »

I did 1. back in '96-'97 and it was 6 months between releases. I think I did the bulk of it in a couple of months though. Crafty had done this earlier but I didn't really understand Crafty's implementation and my square numbering was different, so my implementation was done from scratch.

Then I did rotated->magic, but like many I am using a modified version of Pradyu Kannan's code for that. So that was easier.
IWB
Posts: 1539
Joined: Thu Mar 09, 2006 2:02 pm

Re: Bitboard implementation, how much time?

Post by IWB »

Hmm, reading the numbers here is doesn't seem too unlikely that someone who knows Crafty can rewrite fruit within a few weeks/monthes to bitboards... :)


Bye
Ingo
Mincho Georgiev
Posts: 454
Joined: Sat Apr 04, 2009 6:44 pm
Location: Bulgaria

Re: Bitboard implementation, how much time?

Post by Mincho Georgiev »

1 month to wrote new generator and debug it. 2 weeks after it the program was 100% translated. It is a simple program though.
User avatar
hgm
Posts: 27796
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: Bitboard implementation, how much time?

Post by hgm »

IWB wrote:Hmm, reading the numbers here is doesn't seem too unlikely that someone who knows Crafty can rewrite fruit within a few weeks/monthes to bitboards... :)


Bye
Ingo
Oh, I am pretty sure I could do that in a week. (I'd use 'Kindergarten bitboards' rather than magics, because I dislike big tables.)

For micro-Max it would probably take less than a day. :lol:
Sven
Posts: 4052
Joined: Thu May 15, 2008 9:57 pm
Location: Berlin, Germany
Full name: Sven Schüle

Re: Bitboard implementation, how much time?

Post by Sven »

hgm wrote:For micro-Max it would probably take less than a day. :lol:
Not too difficult when considering that the micro-Max source code itself isn't much bigger than a bitboard ;-)

Sven
Richard Allbert
Posts: 792
Joined: Wed Jul 19, 2006 9:58 am

Re: Bitboard implementation, how much time?

Post by Richard Allbert »

Assuming a "week" is four evenings, and a full weekend day..

Using Bob's paper, rotated took a month, and I also needed the Crafty source to get my head around it.

Magics took a couple of weeks, again, CPW, Glaurung Source, Pradu's posts on this site were all needed to understand it.