Author: Dieter Buerssner
Date: 10:08:39 06/26/03
Go up one level in this thread
On June 25, 2003 at 19:48:37, Geoff wrote:
>Essentially I add or subtact ply to the mate score before storing in the table,
>this should store it relative to this current position not relative to the
>root. See code below
>
>Note I am only adjusting an exact score and leaving a low or high score
>unadjusted. Not sure if this is correct?
It is not correct. You have to adjust bounds as well. A lower bound for example
means: I will mate you in 5, perhaps faster. But with the normal scoring, this
is relative to the root. When you are 2 plies away from the root, it is a mate
in at least 4 in this pos. When you visit this position in a transposition, say
4 plies after the root, you change this back to mate in at least 6 from root.
Without the adjustment, the score could be wrong - it would say mate in 5, while
actually it might only be mate in 6 from the root. Basically, same argument as
with exact scores.
>#define CHECKMATE = 10,000
>
>BOOL hashInsert(U64 hashCode, S32 eval, move bestMove, S32 depth, U8 flags)
>{
> pHashEntry ph;
>
> ph = PHASH_ENTRY(hashCode);
>
> if ((ph->code != hashCode) &&
> ((ph->flags & VALIDITY_FLAG_MASK) == VALID_FLAG) &&
> (ph->depth > depth))
> return FALSE;
>
> /* Adjust mate scores so they are relative to this position */
> if (eval > (INFINITY - MAX_PLY)) /* > 9,900 */
Note, that in rare cases, your search can find longer mates (due to HTs) than
MAX_PLY. Also, when you use endgame TBs.
Regards,
Dieter
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.