Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: Hash table bug

Author: Frank Phillips

Date: 13:36:37 05/12/04

Go up one level in this thread


On May 12, 2004 at 15:22:46, Jeff GAZET wrote:

>Good morning,
>
>i have a good 64bit hash value for each position, xored with side, ep, piece and
>castling rights. I can say this is good because it's ok for detecting
>repetitions.
>
>I suppose the code to insert informations into the hashtable and to retreive
>them is ok (thanks to users of this forum). This works fine for a given position
>: the search goes deep in depth and with a correct PV. Then, if i undo the move
>and search again, another move is given in PV. I undo the move and seach again
>and result is different...
>
>But if i clear the hash table before each search. It's all right. PV is always
>the same for a given position. And a good PV.
>
>I printed hash values to a file, and depth, eval, hash flags. I can't see
>anything bad.
>
>Have you got any idea where the bug could be ?
>
>Regards.

One thing you might consider is a special Validate() function as part of your
debugging.

The Validate() function could, for example, calculate the hash code from scratch
of each position in the search and compare it to the incrementally updated
value.  You can obviously check other data too - eg that pieces are where they
should be.

Undo can be tricky if you forget to turn some things back, or do it wrong.






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.