Computer Chess Club Archives


Search

Terms

Messages

Subject: Question about hash tables

Author: José Carlos

Date: 02:51:22 10/19/99


I use the standard hash function generated from a set of 64bit random numbers. I
use the n rightmost bits of the 64bit code as index (of the array), n depending
on the hash table size.
I think this is normal, but my question is related to the checksum to ensure the
position in the table is equal to that in the board.
The only way to ensure this is to code the board (256bits if 4bits per square
and piece or about 180 if using huffman code). I use the first.
But last night I was looking at Crafty's code (16.15, if I remember right), and
saw it uses a 64 bit checksum. That's what I read in the comment before the
HashProbe function, but I could not find where is this checksum generated, and
how.
My question is: with, at most, 128bits per position (that I'll never would use
in fact), isn't it possible to make mistakes? I know the probability is small,
but eventually there could be a very strange move coming from a hash table
mistake. Is this true? What am I missing?
Is, anyway, safe to use a 64bit checksum? And if so, is the checksum generated
the same way as the hash code, but with different random numbers?

Thanks in advance.

José C.



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.