Magics revisited

Discussion of chess software programming and technical issues.

Moderators: hgm, Harvey Williamson, bob

Forum rules
This textbox is used to restore diagrams posted with the [d] tag before the upgrade.
Post Reply
pijl

Magics revisited

Post by pijl » Sun Jan 04, 2009 12:35 pm

I've created a utility to generate your own magic numbers for magic move generation. It is available on this location (windows 32 and 64 bits executables): magicgen.zip

It includes all masks for rook and bishop magic generation, as well as the best known magic numbers found so far.

When started it first asks for the type of magic to be generated (bishop or rook) and then the square number (0-63). The third question is there to prevent the printout of equivalent magic numbers. The default is that it will print equivalent magics, but you can disable it by answering 'n'.

Then it will first report the best magic found so far, and then tries to find a better (or equivalent) one. The program will not terminate and continues to search forever.

It will try random numbers and verifies if it fits the magic number properties that we're looking for for this piece and square. If not, it will generate a new random number and try that one. It will try thousands of numbers within milliseconds.

The random number generator is quite good and is initialized with a 'time' seed, so that the random number tried are different on each run of the program. Having multiple instances looking for magics on the same square do pay off.

Today I've used it to find two new magic numbers for bishops on squares 40 and 41 (shift 60, former bests were shift 59) and will continue to use it.

If you find new magic numbers, please report them either here, in the chess wiki, or by mail to the known interested programmers.

Richard.

pijl

Bishop sq 47

Post by pijl » Sun Jan 04, 2009 2:11 pm

New magic: 0x4BFFCD8E7C587601
shift 60

pijl

Bishop 16,17

Post by pijl » Sun Jan 04, 2009 2:55 pm

square 16:
Magic number found with shift 60: 0x73C01AF56CF4CFFB (16)

square 17:
Magic number found with shift 60: 0x41A01CFAD64AAFFC (16)

Post Reply