Computer Chess Club Archives




Subject: Re: Hash Tables - Should one store EP, Castling rights etc?

Author: James Robertson

Date: 11:25:59 01/30/99

Go up one level in this thread

On January 30, 1999 at 13:34:46, William Bryant wrote:

>On January 30, 1999 at 11:23:31, Robert Hyatt wrote:
>>On January 30, 1999 at 09:59:38, Steve Maughan wrote:
>>>I have a couple of question regarding hash tables - can anyone help?
>>>1 I see in the Crafty code that the flag for a hash entry can be "value is
>>>worthless".  What is the condition for storing this type of entry?
>>that's an entry that has been 'cleared'.  IE the score/bound is totally
>>no good because something changed at the root that caused the piece/square
>>tables to be recomputed... which means scores will change.  I set the type
>>to 'worthless' because the 'move' stored in such a position is still good for
>>move ordering, but the score/bound is not.
>>if I just cleared the entire entry, I'd lose the move ordering stuff the table
>>contains...  this way I just lose the score.
>>>2 Is it advisable to store the a) the side to move b)Enpassant square c)
>>>castling right in the hash code? ie assign a random value that is XORed for
>>>these conditions.
>>you _must_.  I do it by dynamically updating the hash signature when I make a
>>move that makes an enpassant possible, and updating it again when I make a move
>>that makes the EP capture impossible.  Ditto for castling.  If you don't do this
>>you will get matches that are wrong, and results that are wrong.
>>>All help appreciated.
>>>Steve Maughan
>I may have the wrong impression, but I though you maintained different hash
>tables depending on the side to move, ie a white-to-move table, and a
>black-to-move table.

I think Crafty does divide the entries into different tables based on side to

>Can this be done by simple using an XOR value for side to move
>	(ie include it if white to move, exclude it if white not to move).


>This would double the amount of available hash table space for me.

Not quite; you will still be storing and retrieving the same number of
positions, just in different places. Whichever method you use (one large table,
or two smaller ones) is your choice, as (I think) neither has any advantage in
speed or space requirements over the other.


>William Bryant

This page took 0.01 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.