Author: Ricardo Gibert
Date: 02:57:16 02/10/01
Go up one level in this thread
On February 09, 2001 at 19:44:01, Ricardo Gibert wrote:
>On February 09, 2001 at 10:39:09, Pat King wrote:
>
>>On February 07, 2001 at 10:59:31, Pat King wrote:
>>
>>>I have seen it written here that with 64 bit Zobrist hashing, the perfect key
>>>should change 32 bits. When I had what I thought to be hashing problems, I
>>>captured some stats on my hash keys. I found that most of them changed 28-36
>>>bits (within 4) with a few outliers as far as 13 bits from "perfection". I also
>>>checked that I was not generating duplicate keys. How good or bad is this?
>>>Should I work on the average, or the outliers? Any comments appreciated :)
>>>
>>>Pat
>>Thanks to all for your thoughtful replies. For what it's worth, the only change
>>I've made is to generate a key set with hamming distance 31-33, with a
>>significant improvement in hash performance (thanks to Ricardo for providing a
>>reasonable argument to justify the 32 bit standard). I have yet to compare this
>>set with Rob's 16 bit criteria for XORing any 2 keys.
>>
>>Pat
>
>31-33 is too narrow a range and suggests a bug to me. The following is the
>algorithm I use:
>
>int main(void)
>{
> int i, j, c;
> hash64 a[DIM];
>
> seed_rnd64();
> a[0] = 0; // to exclude zero and near zero numbers.
I just realized this must look idiotic! Actually it makes perfect sense. Later,
when this algorithm completes, this element will be ignored. I add it at the
beginning at a known position so that the remaining numbers will not include
zero nor numbers with a too small or too large of a hamming distance to zero.
This is a simple and efficient way to produce the desired result.
> for (i = 1; i < DIM; i++)
> {
> a[i] = rnd64();
> j = 0;
> while (j < i)
> {
> c = count(a[i]^a[j]);
> if (c < 22 || c > 42)
> {
> a[i] = rnd64();
> j = 0; // don't forget to do this!
> }
> else
> {
> j++;
> }
> }
> printf("%4i ", i);
> }
> return 0;
>}
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.