Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: hash collisions

Author: Scott Gasch

Date: 16:39:27 07/09/02

Go up one level in this thread


>i always thought i should do the following experiment one day: reduce the number
>of bits in my "hash lock" (the number i compare to see if the position in the
>hashtable matches the one i'm looking for), and look when the search starts to
>change. that's a one-line change, instead of
>if(hashtable[index].lock == hashlock) you just & both sides with something like
>1<<N-1. you can check the frequency of your hash collision by checking the whole
>lock which should under normal circumstances give close to 0 collisions.

If I understand you correctly, I'm already doing this.  I have 64 bit hash keys
and compute the hash location based on the low N bits of the sig (N depends on
size of hash table).  I then verify the sig match based on the high 32 bits.
This is cheaper than verifying the whole 64 bit sig and my debug code asserts
that the full key matches.  I've _never_ seen this assert fire though I suppose
it could.

Scott



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.