Computer Chess Club Archives


Search

Terms

Messages

Subject: Subtle Hash Table Bug -- Help for others

Author: William Bryant

Date: 21:17:24 03/29/99


I found a subtle hash table bug present, it turns out, in the last 8 builds of
Screamer.  I have followed with interest the hash table and other implementation
discussions, I haven't seen this one discussed.  If this is old news, sorry.

When storing a mate score, store the score in the table as MATE (a predefined
constant for mate), not MATE - ply (or a mate in n score).  The score can be
converted to mate in n when extracted from the table.  The result of storing
mate in n in the hash table is that the score may report a incorrect distance to
mate, leading the engine to follow the wrong PV.  I was getting Mate in 4
changing to Mate in 2 but the PV totally lost the opportunity to checkmate the
king.

It wish to note, that it was reviewing an older version of Crafty source code
that I discovered that Bob was converting his mate scores after extraction.  I
asked why, (since I was storing the distance to mate as well), then Bob's
comments sprang to mind "The hash table stores postions, not pathways to
positions".  The distance to mate dependes on the depth at the time the position
is encountered again, not the depth when it was stored.

Anyway, if any other amature is storing mate in n positions in their hash table,
I hope this helps.

BTW, Thanks Bob.

William Bryant
wbryant@ix.netcom.com



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.