Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: Hash table and best move

Author: Robert Hyatt

Date: 11:31:51 02/18/04

Go up one level in this thread


On February 18, 2004 at 02:55:48, milix wrote:

>Hi to everyone!
>In my amateur engine I encounter a really nasty
>hash table related bug. A hash element contained a
>position and a best move, say Ra8-a4. When this
>position occured again in a search, the rook was not
>on a8 but on a2. So the right best move should be
>Ra2-a4.

You have a bug.  How can the two positions be _identical_ if the
rooks are on different squares???  It isn't possible.

If, on the other hand, you mean you got a valid match but had a bad
move stored, that still has to be a bug.  I have a test in Crafty for
this condition, as it sometimes happens when I break something while
testing.  But in games, I _never_ see the hash move fail a legality
test.  If it does, that indicates a problem.



> So, I added a routine to check for such
>'corrupted' hash moves. I currently solve the above
>mentioned problem by looking at legal moves in the position
>that had a move with the best's move 'to' square and is moving
>the best's move piece. This correction is only done when I retrieve
>the PV from the hash table, so it is practically cheap.
>
>I have one question about the above concept:
>Is this happen to every hash table or I have a pathological
>situation which may (or may already have) introduce
>other bugs? My hash table uses the replace always scheme
>and is cleared only at the start of a new game.

Seems to me that something must be broken.  Either you store a bad move, which
might happen if you try to store a best move on a "fail low" position that has
no best move, or you somehow corrupt the move later.



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.