Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: Stuffing the PV

Author: Scott Gasch

Date: 16:25:55 12/05/00

Go up one level in this thread


I really hate to reply to my own message especially to call myself an idiot but
I would feel even worse if people spent time replying to me about this.

The hash code had three bugs in it.  I will describe them for the benefit of
anyone else who is struggling with their hash code.

First, the hash move at a certain ply was not being cleared between searches.
That is, position P1 is a hash hit but not enough depth.  Hashmove[ply] was set
to the hash entry's move and searched first... Next position P2, a sibling of P1
in the search tree probes the hash and misses... well, the Hashmove[ply] is
still set to the same thing it was when we hit in P1.  This messes up the move
order if the hash move happens to be legal in both P1 and P2.

Next, (and this is the huge one) I had two key conditionals incorrect.  When I
was storing an upper bound the first thing I do is say: If the upper bound about
to be stored is at or above +MATE_IN_N, don't bother.  Likewise with the lower
bound entries and -MATE_IN_N.  These are a waste of space because they don't
convey any useful information.  I think I got this idea from Bruce.  Well the >
and < were swapped so my hash was really only storing exact positions.  It now
blazes through position FINE70, which is:

8/k7/3p4/p2P1p2/P2P1P2/8/8/K7 w - - 0 0

...in case you are curious.

Finally, I changed the code to follow Ernst's advice... Before I was storing
depth+extend as the depth in the hash node... now I am only storing depth.  I do
not fully understand this, though... if I just got a score X from a search with
depth=depth+extend, is it incorrect to store depth+extend in the hash table?  I
would really appreciate some clarification of this concept if someone has time.

Let me describe one more thing (which I also learned from one of Bruce's
messages, I think) so that someone can sanity check me if I am doing it wrong.
When I get an exact score that is >= +MATE_IN_N or <= -MATE_IN_N I am converting
it to a bound.  I do this because a MATE_IN_N is relative to the depth of the
position in the search tree... and if we come across the same position in the
tree later at a different depth the score will be incorrect.
So convert _exact_ scores >= +MATE_IN_N into lower bounds of MATE_IN_N -- that
is, convert "this node is mate in N moves" into "this node is worth at least a
forced checkmate".  Convert exact scores <= -MATE_IN_N into upper bounds of
-MATE_IN_N -- change "this position gets me killed in N moves" into "this
position is a forced mate in some number of moves".  I've also seen people
adjust these scores relative to the current ply... I like the bound idea better
because it is simpler.

Thanks again for all the help.  This is a great forum and I appreciate the
advice and assistence...

Scott



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.