Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: Hash probe success rate

Author: Dann Corbit

Date: 17:36:16 06/30/04

Go up one level in this thread


On June 30, 2004 at 20:09:55, Andrew Wagner wrote:

>Can you confirm what Bob suggested, that this is hash signature match only? Or
>is the source available that I can check it myself? If so, I can generate that
>statistic myself and check it. Thanks. Andrew

No.  It is the number of elements found and verified.  I had a big hash table of
512 MB and the searches were 3 minutes, so we will expect a lot of hash hits.
20% is only 1 out of 5, so it is not a lot of transpositions.  On the other
hand, the hash attribute type may be wrong, so it might not get used by the
calling routine.  But we definitely found it.

See "HashProbes" and "HashHits" below.

/* Probe the hash table for the specified board */
HashElt        *HashProbe(Board * B)
{
    long int        hashentry;
    HashElt        *H = NULL;
    StoreKey        SK;
    KeyType         Hashkey = B->Key;

    hashentry = ((unsigned long int) (Hashkey >> 32)) % NHash;

    switch (B->side) {
    case WHITE:
        H = &TableW[hashentry];
        break;
    case BLACK:
        H = &TableB[hashentry];
        break;
    }

    /* Update counter */
    HashProbes++;

    /* Check if this entry exists, and return it if so */
    if (H && H->depth > 0) {
        SK = PackToStoreKey(Hashkey);
        if (H->Key == SK) {
            ResetStaleness(H->flags);
            HashHits++;
            return H;
        }
    }
    /* This entry doesn't exist :( */
    return NULL;
}



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.