hashing question

Discussion of chess software programming and technical issues.

Moderator: Ras

Tony

Re: hashing question

Post by Tony »

hgm wrote:I am not sure what exactly you are asking.

What I do, is return 7500, (using your values), and increase every returned score < -7400 by 1 ('delayed-loss bonus'). So the node that can capture the King gets score 7500, the parent, if he has no better move, returns -7499 (=checkmated), the grandparent score +7499 (mate-in-1) etc. In pseudocode:

Code: Select all

int Search(Alpha, Beta)
{
    if(Alpha < -7400) Alpha--;
    if(Beta <= -7400) Beta--;

    ProbeHash();
    if(HASH_HIT) BestScore = HASH_SCORE;
    else {
        for(ALL_MOVES)
        {   Score = -Search(-Beta, -Alpha);
            if(Score > BestScore)
            {   BestScore = Score;
                 .... 
            }
        }
    }

    StoreHash(BestScore);
    if(BestScore < -7400) BestScore++;
    return BestScore
}
Not sure ( this is the stuff headaches are made from) but is this equivelent to

Code: Select all


int Search(Alpha, Beta)
{
    if(Alpha < -7400) Alpha--;
    if(Beta > 7400) Beta++;
....

}

or rather would the more generalised

Code: Select all


int Search(Alpha, Beta)
{
    if(Alpha < 0) Alpha--;
    if(Beta > 0) Beta++;
..

   if (bestScore>0) bestScore--;
   if (bestScore<0) bestScore++;

}
be usefull for a (general) progress measurement ?

Tony