Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: Crafty internal iterative deepening

Author: Robert Hyatt

Date: 06:29:27 01/26/00

Go up one level in this thread


On January 26, 2000 at 08:08:01, Tijs van Dam wrote:

>Hello,
>
>Looking at the crafty code, i stumbled upon something i don't understand. It is
>in search.c, in the part for internal iterative deepening. I left out the abort
>checks:
>
>  tree->next_status[ply].phase=FIRST_PHASE;
>  if (tree->hash_move[ply]==0 && do_null && depth>=3*INCPLY) do {
>    < ... check if this is indeed a pv node ... >
>    tree->current_move[ply]=0;
>    value=ABSearch(tree,alpha,beta,wtm,depth-2*INCPLY,ply,DO_NULL);



OK:  The normal window failed low.  I am now going to do a search that I
_know_ can't fail low, because alpha=-INFINITY...



>    	if (value <= alpha) {
>		value=ABSearch(tree,-MATE,beta,wtm,depth-2*INCPLY,ply,DO_NULL);

here the following line is missing:

      tree->hash_move[ply]=tree->pv[ply-1].path[ply];

This was deleted somewhere along the way.  However it isn't really
important...  this case is _very_ rare....  a search to depth=N will produce
a score of X,  A search to depth=N-something only rarely fails low and breaks
this...



>	}
>	else if (value < beta) {
>		if ((int) tree->pv[ply-1].pathl >= ply)
>		tree->hash_move[ply]=tree->pv[ply-1].path[ply];
>	}
>	else
>		tree->hash_move[ply]=tree->current_move[ply];
>
>    tree->last[ply]=tree->last[ply-1];
>    tree->next_status[ply].phase=FIRST_PHASE;
>  } while(0);
>
>I understand this: to get a good move, you do a search with depth-2. When the
>search returns something in the range (alpha,beta), you are happy and use this
>move to search first. When the search returns a value >=beta, you use the move
>that caused the cutoff, because there is a good chance that it will also cause a
>cutoff at this depth.
>
>But when you get a value<=alpha, you do a research on (-MATE,beta). The outcome
>of this search is not used, although a move must have come out of it?! Why is
>the best move from this search not used, even if it is below alpha in a
>shallower search?
>
>I want to implement iterative deepening too, but i keep puzzling over this code.
>Dear Dr. Hyatt, could you please explain? BTW, this is crafty 16.something.
>
>Greets,
>Tijs van Dam



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.