Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: draw recognition and hash interactions

Author: José Carlos

Date: 06:08:42 07/18/01

Go up one level in this thread


On July 18, 2001 at 08:29:03, Rafael Andrist wrote:

>On July 18, 2001 at 07:36:41, Ulrich Tuerke wrote:
>
>>On July 18, 2001 at 06:00:32, Rafael Andrist wrote:
>>
>>>My program missed to avoid a draw in a game (see below) due to some strange
>>>interactions between search and hash. I investigated it and recognized the
>>>following problem:
>>>
>>>- at move 33 my program recognizes a 2x and a 3x rep. during the search. The 2x
>>>rep. is allowed and the 3x is avoided. But in the hash, the move leading to a 3x
>>>rep. is stored.
>>>- I get PV completly from hash, so the displayed PV is incorrect (shows 3x rep.)
>>>but the real PV (inside the search) is correct
>>>- at move 35 my porgram gets the PV leading to a 3x rep. from hash. The PV has a
>>>length of 8 ply
>>>
>>>---> my program cannot search to 9 ply because it has not enough time (fixed
>>>time per move), so it takes the move recommended from hash and draws.
>>
>>If I got you ríght, this should not happen.
>>Prior to probing the hash table, you should generally check whether the move
>>under consideration leads to an immediate draw. If so, the search can
>>immediately return from this candidate move with zero score.
>>The search over the remaining move then decides if it's favorable to select this
>>candidate.
>>
>>Regards, Uli
>
>The problem happens at the root of the search. I get a hash-cutoff, so no move
>is investigated and the hash move is returned. This is the code I use:
>
>//there's a appropriate hash entry, read the bounds/value:
>if (iHashPtr->SearchDepth >= RemainingDepth)
>{
>	if (iHashPtr->Flag == HashFlagExakt)
>		return iHashPtr->HashValue; //the returned move is the hash-move
>	else if (iHashPtr->Flag == HashFlagAlpha && iHashPtr->HashValue > Alpha)
>		Alpha = iHashPtr->HashValue; //adjust Alpha-Bound
>	else if (iHashPtr->Flag == HashFlagBeta && iHashPtr->HashValue < Beta)
>		Beta = iHashPtr->HashValue; //adjust Beta-Bound
>
>	if (Alpha >= Beta)
>		return iHashPtr->HashValue; //the returned move is the hash-move
>}
>
>Please, tell me what is wrong in this code.
>
>Rafael B. Andrist

  You shouldn't do this at the root. First, generate the root moves. For each
one of them, call search(...) and in the top of search(...) check for the hash
table. Many people (including myself) have a function for the root, and a
function for the rest of the plies, because in the root you have to make some
decisions you don't have inside the tree.

  José C.



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.