Author: Robert Hyatt
Date: 06:00:37 08/06/99
Go up one level in this thread
On August 05, 1999 at 22:51:41, Scott Gasch wrote: >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. > I wouldn't use a clock-seeded set of RN's... for many reasons including distribution, etc. But more importantly, I use the hash signature as the 'book' signature, which means every time I start Crafty, I want the same set of random numbers so that I can use this to access my opening book. Look at the Random64 function in Crafty. It is a well-known RNG that was given in Knuth's book and also in "Numerical Recipes". It is known to work well... I used it both in Cray Blitz and Crafty... >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.