Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: Programmers Question: Hashing and Alpha/Beta bounds

Author: Daniel Mehrmannn

Date: 12:12:39 06/06/05

Go up one level in this thread


On June 06, 2005 at 13:10:20, Johannes wrote:

For a starting guy its better to start with a simple hash function just like
this i used in Homer at young versions:

    /* Probe Hash */
    switch (ProbeMainHash(depth, &hashScore, &extendFlag, &hashMove)) {
        case hashfMissing:
            break;

        case hashfEXACT:
#ifdef DUMP_TREE
			MoveAction(7, hashMove);
#endif
            return hashScore;
            break;

        /* lower bound */
        case hashfBETA:
            if (hashScore >= beta) {
#ifdef DUMP_TREE
				MoveAction(7, hashMove);
#endif
                return hashScore;
			}

			//if (hashScore > alpha)
			//	alpha = hashScore - 1;
            break;

        /* upper bound */
        case hashfALPHA:
            if (hashScore <= alpha) {
#ifdef DUMP_TREE
				MoveAction(7, hashMove);
#endif
                return hashScore;
			}
			break;

        default:
            break;
    }

greetings
daniel

>Hello!
>
>While working on my chess engine I've come across two problems which I dont know
>how to deal with correctly:
>
>1. After retrieving a hash entry, can I do the following:
>
>    if (tt_flag == UBOUND) beta = MIN(beta, tt_merit);
>
>It has worked for me fine, but is in my opinion theoretically unsound.
>
>2. How to deal with a result from a node where alpha and beta have collided? Ths
>happens rarely, but can happen due to altering of bounds because of a hash
>entry. What can I do if i want to store the result from such a node? It is
>neither a LBOUND nor a UBOUND, right?
>
>I hope some of the more experienced chess programmers can help me with these...
>
>thanks
>johannes



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.