Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: Fast hash key method - Revisited!

Author: Don Dailey

Date: 22:22:17 01/14/98

Go up one level in this thread


On January 14, 1998 at 14:04:53, John Bartkiw wrote:

>
>    Just a question for anyone.  I've noticed most people are using a
>table of random numbers to use instead of the actual bitboards.  Can
>someone give me the reasoning for this?  Is it do to the sparseness of
>the bitboards?
>
>John.
>
>>
>>The key in seq A would be something like:
>>origKey ^ randTable[white][king][c3] ^
>>          randTable[black][king][c6] ^
>>          randTable[white][king][b2]
>>
>>And for B:
>>origKey ^ randTable[white][king][c1] ^
>>          randTable[black][king][c6] ^
>>          randTable[white][king][b2]
>>


It's not like you couldn't come up with a well distributed hash key
using bitboards,  the point is that this is not easy to do.  You
cannot just add or xor everything together (which is probably already
slower that what you are now doing with the table method.)

To get good distribution you would have to be extremely clever about
what you were doing and would have to introduce a lot of extra
computation.

If you were to kludge something together I'd almost be money on it that
your distribution would be poor for one reason or another.  Finding
good hash algorithms is an advanced skill and has been studied
extensively.
There are many "gotcha's" and complexities that might go unnoticed for
a while.

It's just not worth it given you have something that is just about as
fast as it gets and known to give extremely good distributions.


- Don




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.