Author: Gerd Isenberg
Date: 01:32:09 03/03/06
Go up one level in this thread
On March 03, 2006 at 03:12:26, Tony Werten wrote: >On February 26, 2006 at 16:04:13, Gerd Isenberg wrote: > >>Applying the old trick - not using the outer squares of the masked occupied ray >>- makes perfect 6-bit range hashing possible. Most often there are only 32 >>occupied states per ray - only if the source is an outer square, there are 64 >>states on a eight square ray: >> >> BitBoard preCalulatedAttacks[64][4][64]; >> >> struct SMagicMask { >> BitBoard mask; >> BitBoard magic; >> }; >> >> // sq ::= 0..63 square index of a sliding piece >> // dir ::= 0..3 kind of ray (two diagonals, horicontal, vertical) >> occIdx64 = (occupiedBB & mm[sq][dir].mask) * mm[sq][dir].magic) >> 58; >> attacks = preCalulatedAttacks[sq][dir][occIdx64]; >> >>Generated mm-values below in a separate longer post... > >I can confirm your findings. There are a few points however. > >I couldn't get your values to work, in a few cases the magic number seemed to >map different bitboards to the same index. oups - really!? Can you post or mail some of the values so that i can have a closer look and to eventually find the bug in my checkMagicNumber(). I use a boolean array of bits to lock found indices to ensure indices all are unique. > >I then run the deBruijn generator myself, to get stuck on 40 values or so, for >wich it couldn't get a magic number. > >Then I just pumped random number into my checkMagicNumber() and within 10 milion >tries, I got a complete set of magic numbers ?! Ah yes, great idea. > >I have implemented them in XiniX, ran a couple of searches with a check wether >the same moveBB was generated, and it works. Nice to hear. > >It's a bit faster than my (strangly) rotated bitboards on a 32 bit machine. On >64bit it will be way faster, since a lot of time is now spend in >_allmull(BB,BB) which isn't needed on 64bit. Yes, 64bit mul is only 4 cycles direct path. Thanks for the feedback, Gerd > >Tony
This page took 0 seconds to execute
Last modified: Thu, 15 Apr 21 08:11:13 -0700
Current Computer Chess Club Forums at Talkchess. This site by Sean Mintz.