Bitboard implementation, how much time?

Discussion of chess software programming and technical issues.

Moderators: hgm, Dann Corbit, Harvey Williamson

Forum rules
This textbox is used to restore diagrams posted with the [d] tag before the upgrade.
User avatar
Rebel
Posts: 6172
Joined: Thu Aug 18, 2011 10:04 am

Bitboard implementation, how much time?

Post by Rebel » Sun Jan 22, 2012 4:36 pm

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: 3218
Joined: Mon May 31, 2010 11:29 am
Full name: lucasart
Contact:

Re: Bitboard implementation, how much time?

Post by lucasart » Sun Jan 22, 2012 4:40 pm

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: 20923
Joined: Mon Feb 27, 2006 6:30 pm
Location: Birmingham, AL

Re: Bitboard implementation, how much time?

Post by bob » Sun Jan 22, 2012 4:49 pm

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: Fri Jan 21, 2011 11:42 pm
Location: NL
Contact:

Re: Bitboard implementation, how much time?

Post by Evert » Sun Jan 22, 2012 7:31 pm

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: 4134
Joined: Fri Mar 10, 2006 4:23 am
Location: http://www.arasanchess.org

Re: Bitboard implementation, how much time?

Post by jdart » Wed Jan 25, 2012 4:13 am

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 1:02 pm

Re: Bitboard implementation, how much time?

Post by IWB » Wed Jan 25, 2012 4:59 am

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 4:44 pm
Location: Bulgaria
Contact:

Re: Bitboard implementation, how much time?

Post by Mincho Georgiev » Wed Jan 25, 2012 7:40 am

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: 26434
Joined: Fri Mar 10, 2006 9:06 am
Location: Amsterdam
Full name: H G Muller
Contact:

Re: Bitboard implementation, how much time?

Post by hgm » Wed Jan 25, 2012 8:48 am

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: 4004
Joined: Thu May 15, 2008 7:57 pm
Location: Berlin, Germany
Full name: Sven Schüle
Contact:

Re: Bitboard implementation, how much time?

Post by Sven » Wed Jan 25, 2012 9:15 am

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: 780
Joined: Wed Jul 19, 2006 7:58 am

Re: Bitboard implementation, how much time?

Post by Richard Allbert » Wed Jan 25, 2012 10:21 am

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.

Post Reply