Magic News?
Posted: 30 Jan 2007, 21:22
Hi,
I tried to dense Pradu's magic bishop tables a bit with the help of constructive collisions, where different occupied bits map same attack sets. But I only found to condense edges, boarder and extended boarder squares. (number*range) 15*16, 9*30, 9*31 and 15*32, despite 12*128 for extended center and 4*512 for the center squares. 38824 bytes < 38K.
I used snoob for popcounts 4..8 (56..60) xor some 64-bit DeBruijn constant to find magics to maximize collisions.
Somehow i feel there is no way to shrink the sizes for the inner squares. Does somebody has better values?
Cheers,
Gerd
I tried to dense Pradu's magic bishop tables a bit with the help of constructive collisions, where different occupied bits map same attack sets. But I only found to condense edges, boarder and extended boarder squares. (number*range) 15*16, 9*30, 9*31 and 15*32, despite 12*128 for extended center and 4*512 for the center squares. 38824 bytes < 38K.
I used snoob for popcounts 4..8 (56..60) xor some 64-bit DeBruijn constant to find magics to maximize collisions.
Somehow i feel there is no way to shrink the sizes for the inner squares. Does somebody has better values?
Cheers,
Gerd
- Code: Select all
u64 bishopMagic[64] =
{ // 0 1 2 3
0xffedf9fd7cfcffff,0xfc0962854a77f576,0xc3879718b46a0c89,0x43d7df9dbcca0c89,
0xc3fbfbdcf4ca0c89,0x03f71c59b4ca0c89,0xfc0a66c64a7ef576,0x7ffdfdfcbd79ffff,
0xfc0846a64a34fff6,0xfc087a874a3cf7f6,0xc3f7c75e34fa8c89,0x03f79f5e74820c89,
0x43f79c0ca0ca0c89,0xc3f79e38f5ee0c89,0xfc0864ae59b4ff76,0x3c0860af4b35ff76,
0xc3f7ff0cb1d20c89,0xc3f61f6cb2ca0cd9,0x0001000202020200,0x0000800410220000,
0x0000800400a00001,0x0000200100884000,0x7c0c028f5b34ff76,0xfc0a028e5ab4df76,
0xc3e7bfdcb5cb04c9,0x33f79f5cb0ca0e09,0x0000208004010400,0x0000404004010200,
0x0000404004010040,0x0000404002011000,0x43f51f5cb6c80989,0x03f59e1cb4cb0c09,
0xc3e71c5cb4f20c89,0xc3f3865cb4e00c89,0x0000104400080800,0x0000020080080081,
0x0000404040040100,0x0000808100020100,0x33ff975cb4ca0e89,0x43fe9f1c34cb0c09,
0xc3f78eceb0ca1889,0xc3f305dcb6ca0c09,0x0000082088001000,0x0000000a44000800,
0x0000010122000400,0x0001010101000200,0x43ff9a5cf4ca0c01,0xc3f79b7cb68a0cad,
0xfc0ff2865334f576,0xfc0bf6ce5924f576,0x03f79e5cd4eb2c89,0x23f79f5ca0880c89,
0x33f79f5ca08a0c89,0x43f7b75c34cade89,0xc3ffb7dc36ca8c89,0xc3ff8a54f4ca2c89,
0xfffffcfcfd79edff,0xfc0863fccb147576,0x43f79f5cb3831c89,0x33f79f5cb4c20881,
0x33f79f5cb0ca0881,0xc3f79f2c94e808a9,0xfc087e8e4bb2f736,0x43ff9e4ef4ca2c89
};
u8 bishopShift[64] =
{
59,60,59,59,59,59,60,59,
60,60,59,59,59,59,60,60,
59,59,57,57,57,57,60,60,
59,59,57,55,55,57,59,59,
59,59,57,55,55,57,59,59,
59,59,57,57,57,57,60,59,
60,60,59,59,59,59,60,60,
59,60,59,59,59,59,60,59
};
// used to calculate pointer offsets
u16 bishopSizeOfEachArray[64] =
{
32, 16, 30, 32, 32, 30, 16, 32,
16, 16, 30, 32, 32, 30, 16, 16,
30, 30,128,128,128,128, 16, 16,
31, 32,128,512,512,128, 31, 32,
31, 31,128,512,512,128, 32, 31,
30, 31,128,128,128,128, 16, 31,
16, 16, 31, 32, 32, 30, 16, 16,
32, 16, 30, 32, 32, 31, 16, 32
};