Search found 9 matches

by bnewman
Thu Mar 28, 2019 6:50 am
Forum: Computer Chess Club: Programming and Technical Discussions
Topic: No bishop magics with fixed shift 8
Replies: 17
Views: 4145

Re: No bishop magics with fixed shift 8

We also know that we need to have at least 16 valid collisions, so we want: idx_bitboard_D2_E3 = idx_bitboad_D2 It seems that there are other ways to get the necessary collisions, for instance: idx_bitboard_D2_G5 = idx_bitboard_D2 I have started a new topic to discuss the partitioning of all possib...
by bnewman
Thu Mar 28, 2019 6:33 am
Forum: Computer Chess Club: Programming and Technical Discussions
Topic: On the establishment of domains wherein magic numbers can and cannot exist
Replies: 1
Views: 673

On the establishment of domains wherein magic numbers can and cannot exist

Consider an arbitrary 64-bit number, M. For each square, S, in a relevant occupancy mask, a separate N-bit whole number and an additional fractional part can be generated from the 64-bit number as follows: The whole number part will consist of the N bits of M from bit 64-S to bit 64-S-N. The fractio...
by bnewman
Tue Mar 26, 2019 3:57 pm
Forum: Computer Chess Club: Programming and Technical Discussions
Topic: No bishop magics with fixed shift 8
Replies: 17
Views: 4145

Re: No bishop magics with fixed shift 8

That's the problem. We know that collisions can be valid. Picking powers of 2 generates big gaps, so it is necessary to demonstrate that all those gaps are filled with invalid collisions. I see your point. Let me consider this a bit more. Another interesting observation from the above formulas is t...
by bnewman
Mon Mar 25, 2019 10:11 pm
Forum: Computer Chess Club: Programming and Technical Discussions
Topic: No bishop magics with fixed shift 8
Replies: 17
Views: 4145

Re: No bishop magics with fixed shift 8

My argument that 0x 0004 0102 0200 0000 is the minimum magic number for the C1 square with a shift of 5 is this: From the MSB of the magic number (bounded by the lowest relevant square) to the LSB (bounded by the highest relevant square), we have selected the smallest possible numbers for hash value...
by bnewman
Mon Mar 25, 2019 6:48 pm
Forum: Computer Chess Club: Programming and Technical Discussions
Topic: No bishop magics with fixed shift 8
Replies: 17
Views: 4145

Re: No bishop magics with fixed shift 8

However the above maps D2 to index 4, and all the other squares to index 1. So we should increase the magic number to: (1ull << 50) + (2ull << 39) + (3ull << 30) + (5ull << 21) and now the minimum magic number is 0x40100c0a00000 https://ideone.com/CygT3J If you try this as a magic number for the C1...
by bnewman
Mon Mar 25, 2019 4:51 am
Forum: Computer Chess Club: Programming and Technical Discussions
Topic: No bishop magics with fixed shift 8
Replies: 17
Views: 4145

Re: No bishop magics with fixed shift 8

While the result in my previous post is correct, there is an error that I have introduced and wish to correct. It is not true that magic << 18 >> (64-5) = 1 implies that magic << 18 = 1 << (64-5), because there may be lower significant bits in the magic number. Sorry for the confusion. In this post,...
by bnewman
Mon Mar 25, 2019 2:46 am
Forum: Computer Chess Club: Programming and Technical Discussions
Topic: No bishop magics with fixed shift 8
Replies: 17
Views: 4145

Re: No bishop magics with fixed shift 8

I'll try to clarify (and correct) my post a bit with two examples. I do not yet have code to share for the algorithm, but I'm working on it. The first example is a fairly simple case, the B2 square. The relevant occupancy mask for this square includes the squares C3 (18), D4 (27), E5 (36), F6 (45), ...
by bnewman
Thu Mar 21, 2019 4:32 pm
Forum: Computer Chess Club: Programming and Technical Discussions
Topic: No bishop magics with fixed shift 8
Replies: 17
Views: 4145

Re: No bishop magics with fixed shift 8

Yes, I believe I know what you are talking about. I had the same idea myself. Here is my explanation: The search region is divided into multiple sections based upon the (2^c) - 1 possible choices for the hash for when only the lsb of the mask is occupied. For each of these choices, the maximum magic...
by bnewman
Thu Mar 21, 2019 7:02 am
Forum: Computer Chess Club: Programming and Technical Discussions
Topic: No bishop magics with fixed shift 8
Replies: 17
Views: 4145

Re: No bishop magics with fixed shift 8

Here's the program I used for this search: https://github.com/niklasf/magics/blob/master/src/magics.c . Unfortunately, this link no longer seems correct. I was wondering if you also recognized that the minimum bound on a magic number is 2^(64-c-r0), where r0 is the lowest numbered square of the rel...