List of magics for bitboard move geneartion

Programming Topics (Computer Chess) and technical aspects as test techniques, book building, program tuning etc

Moderator: Andres Valverde

Re: List of magics for bitboard move geneartion

Postby Gerd Isenberg » 12 May 2008, 12:15

Grant Osborne wrote:
Yes, I used the magics and shifts from Pradu's post 3 in this thread.

Hm, seems like I was a bit sloppy when making the rook indices (I did it manually). It could be a bit better by applying this pattern by repacing with necessary address space:
Code:
Idx[64]={
00,01,02,03,04,05,06,07,
01,00,03,02,05,04,07,06,
08,09,10,11,12,13,14,15,
09,08,11,10,13,12,15,14,
16,17,18,19,20,21,22,23,
17,16,19,18,21,20,23,22,
24,25,26,27,28,29,30,31,
25,24,27,26,29,28,31,30,
};


Regards, Lasse


As you know, 11-bit keys exist for two of the corners for rooks, there are also 10-bit keys for five of the edge squares. By substituting these better magics and using the pattern above brings the size of the table down to 448k.

Grant

Wow! I guess that additional "and" pays off.
Gerd Isenberg
 
Posts: 285
Joined: 31 Jan 2005, 20:31
Location: Hattingen, Germany

Re: List of magics for bitboard move geneartion

Postby Lasse Hansen » 13 May 2008, 17:12

Code: Select all
Quote:
Yes, I used the magics and shifts from Pradu's post 3 in this thread.

Hm, seems like I was a bit sloppy when making the rook indices (I did it manually). It could be a bit better by applying this pattern by repacing with necessary address space:
Code:
Idx[64]={
00,01,02,03,04,05,06,07,
01,00,03,02,05,04,07,06,
08,09,10,11,12,13,14,15,
09,08,11,10,13,12,15,14,
16,17,18,19,20,21,22,23,
17,16,19,18,21,20,23,22,
24,25,26,27,28,29,30,31,
25,24,27,26,29,28,31,30,
};


Regards, Lasse


As you know, 11-bit keys exist for two of the corners for rooks, there are also 10-bit keys for five of the edge squares. By substituting these better magics and using the pattern above brings the size of the table down to 448k.

Grant

No, hehe, I actually forgot. I just assumed Pradu's keys were the best.

Lasse
Lasse Hansen
 
Posts: 41
Joined: 07 Jun 2006, 21:25
Location: Porsgrunn, Norway

Re: List of magics for bitboard move geneartion

Postby Pradu » 13 May 2008, 19:59

Lasse Hansen wrote:No, hehe, I actually forgot. I just assumed Pradu's keys were the best.
Lasse
Grant has the best keys for rooks (perhaps bishops too) AFAIK. I use some of them (with credit given) in magicmoves. IIRC, Gerd has also posted good keys for bishops somewhere here.
User avatar
Pradu
 
Posts: 343
Joined: 12 Jan 2005, 19:17
Location: Chandler, Arizona, USA

Re: List of magics for bitboard move geneartion

Postby Grant Osborne » 13 May 2008, 20:17

In my engine A8=0 H8=7 ... H1=63 and I use the 32-bit flavour of magic move generation.

But these keys should work for you guys:-

Rooks square A1 11-bit key EBFFFFB9FF9FC526
H1 11-bit key 7645FFFECBFEA79E
A2 10-bit key 48FFFE99FECFAA00
B1 10-bit key 61FFFEDDFEEDAEAE
C1 10-bit key 53BFFFEDFFDEB1A2
D1 10-bit key 127FFFB9FFDFB5F6
E1 10-bit key 411FFFDDFFDBF4D6

They are actually not too difficult to find if you make sure your random numbers are very dense.

My bishop table is now only 12.9k

Grant
User avatar
Grant Osborne
 
Posts: 69
Joined: 16 Jun 2006, 14:05

Re: List of magics for bitboard move geneartion

Postby Gerd Isenberg » 13 May 2008, 21:26

Grant Osborne wrote:In my engine A8=0 H8=7 ... H1=63 and I use the 32-bit flavour of magic move generation.

But these keys should work for you guys:-

Rooks square A1 11-bit key EBFFFFB9FF9FC526
H1 11-bit key 7645FFFECBFEA79E
A2 10-bit key 48FFFE99FECFAA00
B1 10-bit key 61FFFEDDFEEDAEAE
C1 10-bit key 53BFFFEDFFDEB1A2
D1 10-bit key 127FFFB9FFDFB5F6
E1 10-bit key 411FFFDDFFDBF4D6

They are actually not too difficult to find if you make sure your random numbers are very dense.

My bishop table is now only 12.9k

Grant

Hi Grant,
I setup a CPW-page for best magics:
http://chessprogramming.wikispaces.com/ ... ics+so+far
I fear, I confused your coordinates - or did you already transform?
I guess your A1 == 56 is A8 in little endian rank mapping with A1==0, H8==63?
(of course I may try, but I am kind of lazy and I have no magic checker handy ;-)

If you and everybody else likes to share his numbers, it would be a great pleasure to welcome you as a member in the chess programming wiki, to eventually contribute up and then. I you don't like - it would be also fine if you allow us publishing your results.

Cheers,
Gerd
Last edited by Gerd Isenberg on 13 May 2008, 21:33, edited 1 time in total.
Gerd Isenberg
 
Posts: 285
Joined: 31 Jan 2005, 20:31
Location: Hattingen, Germany

Re: List of magics for bitboard move geneartion

Postby Gerd Isenberg » 13 May 2008, 21:29

Pradu wrote:
Lasse Hansen wrote:No, hehe, I actually forgot. I just assumed Pradu's keys were the best.
Lasse
Grant has the best keys for rooks (perhaps bishops too) AFAIK. I use some of them (with credit given) in magicmoves. IIRC, Gerd has also posted good keys for bishops somewhere here.

That is why we need the CPW - to archive that stuff. I need to have a look on my old computer for the sources...
Gerd Isenberg
 
Posts: 285
Joined: 31 Jan 2005, 20:31
Location: Hattingen, Germany

Re: List of magics for bitboard move geneartion

Postby Volker Pittlik » 13 May 2008, 21:43

Gerd Isenberg wrote:...
That is why we need the CPW - to archive that stuff. I need to have a look on my old computer for the sources...



I hope you have fun over there. Make sure to copy everything you need from here. Hint: Don't wait to long with it.
User avatar
Volker Pittlik
 
Posts: 1031
Joined: 24 Sep 2004, 10:14
Location: Murten / Morat, Switzerland

Re: List of magics for bitboard move geneartion

Postby Gerd Isenberg » 13 May 2008, 21:51

Volker Pittlik wrote:I hope you have fun over there. Make sure to copy everything you need from here. Hint: Don't wait to long with it.

Sorry to hear that. I had a lot of fun here too. I think the infrastructure of a wiki is better suited for long term stuff as mentioned.
Thanks again for all your work, time and effort!

Cheers,
Gerd
Gerd Isenberg
 
Posts: 285
Joined: 31 Jan 2005, 20:31
Location: Hattingen, Germany

Re: List of magics for bitboard move geneartion

Postby EugeneCarey » 13 May 2008, 23:44

Gerd Isenberg wrote:
Volker Pittlik wrote:I hope you have fun over there. Make sure to copy everything you need from here. Hint: Don't wait to long with it.

Sorry to hear that. I had a lot of fun here too. I think the infrastructure of a wiki is better suited for long term stuff as mentioned.
Thanks again for all your work, time and effort!

Cheers,
Gerd


Better than a wiki (or private forum) would be a public newsgroup.

A wiki is likely to disapear in a couple years when the host decides to start charging for the 'free' wiki. Or if it was done on a private server, the owner might just loose interest or be unable to afford it for ever.

People might keep personal backup copies, but to the public, it'd be gone.

On the other hand, a newsgroup archive is likely to be around for a much longer time.

Thanks to DejaNews, and now Google, you can still find messages about computer chess from 1981.


A wiki is good for creating & sharing knowledge, but I'm not so sure it'll still be around in 5 years.


Perhaps a compromise....?

Go ahead and do the wiki, since it is so good at sharing & creating knowledge, and then once a month publicly post the resulting HTML dump into the computer chess newsgroup? (There might as well be *something* computer chess releated in that newsgroup! It's always Sam Sloan or USCF or warez....)

And perhaps put archives onto a public ftp server, just to help make sure it'll still be around in 10 years? Just look at all the messages that were lost in the CCC forums. And with this one apparently about to disappear, all the development and ideas and discussions that went into the ideas being posted in the Wiki are about to vanish.

Would Archive.org be interested in archiving a wiki & forum messages?
EugeneCarey
 
Posts: 16
Joined: 27 Apr 2008, 17:08

Re: List of magics for bitboard move geneartion

Postby Zach Wegner » 14 May 2008, 00:12

That is very sad to hear Volker. I hope the wiki does not factor into your decision. I do hope that you decide to keep the forum alive. But if you don't, would it be possible for you to send me, or anyone really, a backup of the site? This place has been a haven for new research, and I am positive that very many people would miss this place. The amount of information contained in the archives is just too much to let go so easily...

Zach
User avatar
Zach Wegner
 
Posts: 182
Joined: 26 Sep 2004, 22:02
Location: Austin, Texas, USA

Re: List of magics for bitboard move geneartion

Postby Volker Pittlik » 14 May 2008, 07:18

Zach Wegner wrote:That is very sad to hear Volker. I hope the wiki does not factor into your decision...


Of course it does. It induced it directly. Don't get me wrong: I like the idea, but the way of announcement here is something what makes me really sick.

Zach Wegner wrote:.. But if you don't, would it be possible for you to send me, or anyone really, a backup of the site?...


Sure. I start right now to make a backup. You can have everything, the database and all forum related files including all modifications and updates. I'm going to delete all private messages and e-mail addresses from the database of course. Please let me know your postal address. I'll burn the data on CD and send it to you. I guess this will not take longer than a week or so.

Volker
User avatar
Volker Pittlik
 
Posts: 1031
Joined: 24 Sep 2004, 10:14
Location: Murten / Morat, Switzerland

Previous

Return to Programming and Technical Discussions

Who is online

Users browsing this forum: No registered users and 37 guests