Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: Crafty question to Dr. Robert Hyatt

Author: Robert Hyatt

Date: 06:44:47 05/02/01

Go up one level in this thread


On May 02, 2001 at 08:52:20, Alvaro Jose Povoa Cardoso wrote:

>The code below is in the Iterate() function.
>Could someone (namely Dr. Robert Hyatt) explain the lines below (line 1, line 2
>and line 3)?
>
>line 1 and line 2 takes care of root_alpha.
>line 3 takes care of root_beta.
>What exactly is the .status member variable in "root_moves[0].status" ?


From chess.h:

/*
  xxxx xxx1 = failed low
  xxxx xx1x = failed high
  1xxx xxxx = done (searched)
  x1xx xxxx = don't search in parallel
*/



>What values can it have and what do they mean?
>In other words what are the conditions in this code that modify root_alpha and
>root_beta?
>(Yes I noticed root_beta is also modified in SearchRoot())
>


the two lines effectively say

If the search has not failed low during the current iteration (on this
specific move) then set root alpha to one thing, if it has failed low (this
is often a fail low, then a fail high on the same move) then set alpha to
- infinity.







>Thank you,
>Alvaro Cardoso
>
>
>
>
>        value=SearchRoot(tree,root_alpha, root_beta, wtm,
>                         iteration_depth*INCPLY+30);
>        root_print_ok=tree->nodes_searched > noise_level;
>        cpu_time_used+=ReadClock(cpu)-thread_start_time[0];
>        if (abort_search || time_abort) break;
>        if (value >= root_beta) {
>          root_moves[0].status|=2;
>          root_moves[0].status&=255-128;
>line 1    if (root_moves[0].status&1) root_alpha=-MATE-1;
>line 2    else root_alpha=root_beta-1;
>          root_value=root_alpha;
>          root_beta=MATE+1;
>          root_moves[0].nodes=0;
>          if (root_print_ok) {
>            Print(2,"               %2i   %s     ++   ",iteration_depth,
>            DisplayTime(end_time-start_time));
>            if (display_options&64) Print(2,"%d. ",move_number);
>            if ((display_options&64) && !wtm) Print(2,"... ");
>            Print(2,"%s!!\n",
>                  OutputMove(tree,tree->pv[1].path[1],1,wtm));
>            whisper_text[0]=0;
>            if (display_options&64)
>              sprintf(whisper_text," %d.",move_number);
>            if ((display_options&64) && !wtm)
>              sprintf(whisper_text+strlen(whisper_text)," ...");
>            sprintf(whisper_text+strlen(whisper_text)," %s!!",
>                    OutputMove(tree,tree->pv[1].path[1],1,wtm));
>            Whisper(6,wtm,iteration_depth,end_time-start_time,value,
>                    tree->nodes_searched,-1, tree->egtb_probes_successful,
>                    whisper_text);
>          }
>        }
>        else if (value <= root_alpha) {
>          if (!(root_moves[0].status&2)) {
>            root_moves[0].status&=255-128;
>            root_moves[0].nodes=0;
>            root_moves[0].status|=1;
>line 3      if (root_moves[0].status&2) root_beta=MATE+1;
>            root_alpha=-MATE-1;
>            root_value=root_alpha;
>            easy_move=0;
>            if (root_print_ok && !time_abort && !abort_search) {
>              Print(4,"               %2i   %s     --   ",iteration_depth,
>                    DisplayTime(ReadClock(time_type)-start_time));
>              if (display_options&64) Print(4,"%d. ",move_number);
>              if ((display_options&64) && !wtm) Print(4,"... ");
>              Print(4,"%s\n",OutputMove(tree,root_moves[0].move,1,wtm));
>            }
>          }
>          else break;
>        }
>        else break;
>      }



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.