Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: Repeated Positions

Author: Scott Gasch

Date: 19:51:41 08/05/99

Go up one level in this thread


Both Bob and Bruce mentioned a small hash table specifically for detecting
repetition.  I guess this would be implemented as an array of counts indexed by
a subset of the position's hash key -- say the last n bits.  What is to prevent
false draw reading, however, if two (different) positions in the same search
yield the same key subset (and artificially inflate the count).

Related question: I am initializing my transposition hash square-piece array
with just random numbers (rand()).  This is not good for many reasons: 1) if the
random numbers I get (seeded off system clock) are bad (not very random) hashing
performs badly and we have many collisions (I have not really seen this happen
but in theory I guess it could).  2) there is no way I can predict what a key
for a given position will be beforehand which is okay now but when I write an
opening book I'd like to be able to do this.  So definately I need some kind of
function to generate the seeds.

My (next) question is this -- what do you guys do for said function?  I am
computing two numbers for each position - a key and a checksum.  The key is just
xors of seeds for piece/square and the checksum is adding and subtracting seeds.
I had considered using prime numbers for the seeds but I don't see how that
really will help produce a uniform hash distribution.

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.