Search found 67 matches

by grant
Wed Jun 18, 2008 11:12 am
Forum: Computer Chess Club: Programming and Technical Discussions
Topic: How to reduce the "bits" used in a magic number ca
Replies: 67
Views: 27584

Re: How to reduce the "bits" used in a magic numbe

Hi I'm not at my home computer right now so I can't try this out, but is it possible that when we calculate the attackboard we can do away with the shift lookup table by incorporating the shift into the magic number? So instead of index = (int)((occupied * rookMagic[square]) >> rookShift...
by grant
Mon Jun 09, 2008 11:58 am
Forum: Computer Chess Club: Programming and Technical Discussions
Topic: How to reduce the "bits" used in a magic number ca
Replies: 67
Views: 27584

Re: How to reduce the "bits" used in a magic numbe

Persuing this a little further, I can generate 5-bit rook magics for all squares except square 7 (H8 in my engine) which stubbornly is 6-bit, producing a rook table of 16K (actually a little less 15.2K + 0.5K for the ranks). But, surely if I use Lasse Hansen's genius postmask, the rook table comes d...
by grant
Sun Jun 08, 2008 11:11 am
Forum: Computer Chess Club: Programming and Technical Discussions
Topic: How to reduce the "bits" used in a magic number ca
Replies: 67
Views: 27584

Re: How to reduce the "bits" used in a magic numbe

Might it make sense to split the rook magic into two pieces, as the rank can be done with a shift, an and, and a 64 by 8 byte lookup? I just tried masking off everything but the file for the difficult square 0 (A8 in my engine) and came up with a 5-bit magic number 0x22554D918DFF8058. So would this...
by grant
Mon Jun 02, 2008 9:39 am
Forum: Computer Chess Club: Programming and Technical Discussions
Topic: How to reduce the "bits" used in a magic number ca
Replies: 67
Views: 27584

Re: How to reduce the "bits" used in a magic numbe

Here are some bishop 4-bit magic numbers that you may not have.
In my engine A8=0 H8=7... H1=63.

A6 20403749D4C9EFDB
B6 02A0443A151B1FF7
A3 250FD6AA751E400C
B3 B6B7F549A5E1E023
H3 005FDB2561A00200

Grant
by grant
Thu May 29, 2008 8:42 am
Forum: Computer Chess Club: Programming and Technical Discussions
Topic: How to reduce the "bits" used in a magic number ca
Replies: 67
Views: 27584

Re: How to reduce the "bits" used in a magic numbe

The rook set as requested. 0 A8 12 94800280A0400072 4096 1 B8 11 0440003000A00040 2048 2 C8 11 6900082000304100 2048 3 D8 11 8080080150001481 2048 4 E8 11 1D00070008001004 2048 5 F8 11 02000804100E000D 2048 6 G8 11 0200042801428200 2048 7 H8 12 0100010008802746 4096 8 A7 11 088080008030C001 2048 9 B...
by grant
Wed May 28, 2008 2:12 pm
Forum: Computer Chess Club: Programming and Technical Discussions
Topic: How to reduce the "bits" used in a magic number ca
Replies: 67
Views: 27584

Re: How to reduce the "bits" used in a magic numbe

Magic number found!

H2 square 55 in my orientation 10-bit = 0x510FFFF5F63C96A0

Even after finding good patterns to OR into the randoms, it still took over 6 hours to find.
Whew.

Grant
by grant
Tue May 27, 2008 11:37 am
Forum: Computer Chess Club: Programming and Technical Discussions
Topic: How to reduce the "bits" used in a magic number ca
Replies: 67
Views: 27584

Re: How to reduce the "bits" used in a magic numbe

Edmund I may have mis-understood your terminology. I measure the potential of finding a magic number by counting the first n number of occupancies that I can fit into half this number. So for B7 I get the first 527 of 1024 to fit into 512 for G2 I get 992 of 1024 into 512 for A1 I get 3500+ of 4096 ...
by grant
Tue May 27, 2008 7:45 am
Forum: Computer Chess Club: Programming and Technical Discussions
Topic: How to reduce the "bits" used in a magic number ca
Replies: 67
Views: 27584

Re: How to reduce the "bits" used in a magic numbe

I'm starting to be a believer in the "don't just use random numbers" to find optimal magics strategy. I've had a program running for two days using random numbers with very few bits set looking for an 11-bit magic for square 0 (a1). It has tried 20,000,000,000 numbers. None of them has worked. I th...
by grant
Mon May 26, 2008 11:30 am
Forum: Computer Chess Club: Programming and Technical Discussions
Topic: How to reduce the "bits" used in a magic number ca
Replies: 67
Views: 27584

Re: How to reduce the "bits" used in a magic numbe

For B7 the results are not good. Best I can get is 527 index numbers used with 176 good collisions, though if I don't see any progress after about 5 minutes I get bored and try something else. You will have better success at the other end of the board. I have 9-bit magics for B2, C2 & D2, and goods ...
by grant
Sun May 25, 2008 5:03 pm
Forum: Computer Chess Club: Programming and Technical Discussions
Topic: How to reduce the "bits" used in a magic number ca
Replies: 67
Views: 27584

Re: How to reduce the "bits" used in a magic numbe

Edmund

I'll have a look at B7 for you now.

Grant