Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: Squashing Hash Table Bugs

Author: Frank Phillips

Date: 13:28:53 05/29/04

Go up one level in this thread


On May 29, 2004 at 16:11:42, James Swafford wrote:

>On May 29, 2004 at 14:20:43, Frank Phillips wrote:
>
>>On May 29, 2004 at 12:50:57, James Swafford wrote:
>>
>>>On May 29, 2004 at 12:50:12, Bas Hamstra wrote:
>>>
>>>>
>>>>
>>>>On May 29, 2004 at 11:10:47, James Swafford wrote:
>>>>
>>>>>In a recent post, Tord suggested setting a flag in
>>>>>the search when the hash table suggests a fail high, and
>>>>>testing whether the search would indeed fail high.
>>>>>
>>>>>The idea seems so simple I'm embarassed I haven't thought
>>>>>of it before. :)
>>>>>
>>>>>I've been 'pretty sure' for a long time that I've got some
>>>>>nasty hash bugs.  I'm in the mood to exterminate them.
>>>>>
>>>>>Last night I implemented Tord's idea and, to my dismay
>>>>>(but not to my surprise) my hash table is saying 'fail
>>>>>high' when the search wouldn't have failed high.  And-
>>>>>it doesn't take very long. :)
>>>>>
>>>>>This seems like a nasty thing to debug.  I'm comtemplating
>>>>>how I might go about it.  I'm hoping some of you can
>>>>>provide some suggestions...
>>>>>
>>>>>--
>>>>>James
>>>>
>>>>What you describe is not a good way of finding HT bugs, IMO. To start with, hash
>>>>can cause inconsistent search results, even with completely bugfree code. Want
>>>>to track hash bugs? Do this: write code to completely recalculate hashkey from
>>>>scratch. Compare this key with the incremental key at every node. Analyze and
>>>>fix differences until they are all gone.
>>>
>>>I already do this... my keys are fine.
>>
>>Have you added debug code to check that the position in the hash table is the
>>same as that 'on the board'?
>
>Probably not in the way you mean.  If I get a 'hit', meaning
>there is an entry in the hash table, I do verify the full
>64 bit key.  I don't have any code to add the entire board
>structure to table, though.  Is that what you mean?
>
>--
>James

Yes, although not necessarily the whole board.  If you used bitboards, it could
be a 64 bit word made up of some of the pieces (rooks | bishops etc) as a quick
test, for example.

I did not know where you did you verified the hash; and was wondering about a
systematic error.

Clearly if the stored and 'real' boards are the same then the problem is
elsewhere.  Just a thought.  I like to eliminate the obvious first...

Frank

>
>
>
>>
>>
>>>
>>>
>>>>
>>>>
>>>>Bas.



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.