Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: About history pruning...

Author: Tord Romstad

Date: 03:35:38 10/27/05

Go up one level in this thread


On October 26, 2005 at 19:13:22, Harald Lüßen wrote:

>I want to understand this. Let me try to explain it in my words
>and pseudo code. I have left out everything else.
>
>search(a,b,d) {
>  try nullmove
>  for moves M
>    r=0 but reduce late moves with r=1 (or fraction?)
>    do move
>again:
>      search(-b,-a,d-1-r)
>      --> {
>           try nullmove
>           if it fails low because of move N
>              and M was reduced (M.r > 0)
>              and M.piece == N.piece
>              then return cancel_reason_tords_enhancement
>           for moves m
>             ...
>           next move
>          }
>      <--
>      if r>0 and returned cancel_reason_tords_enhancement
>        r = 0
>        goto again
>    undo move
>  next move
>}
>
>In 'and M.piece == N.piece' is it important that it is
>exactly the same piece or can it be the same piece-type?
>
>Can you confirm this or correct me?

If I understand your code correctly, everything between
"-->" and "<--" isn't really supposed to be located exactly
where it is printed above, but rather directly below the
"try nullmove" near the top of the code.  In this case, it
looks correct, though the exact implementation is slightly
different from mine.  Here is what I do, in compact pseudo
code (there could be bugs here):

int search(int alpha, int beta, int depth) {
   int value, moves_searched;

   do_nullmove();
   value = -search(-beta, -beta + 1, depth - 4);
   undo_nullmove();
   if(value >= beta) return value;
   else {
     ThreatMove[Ply] = BestMove[Ply+1];
     if(Reduction[Ply-1] &&
        from_square(ThreatMove[Ply]) == to_square(CurrentMove[Ply-1]))
       return alpha - 1;
   }

   generate_moves();
   moves_searched = 0;
   while((CurrentMove[Ply] = pick_move()) && alpha < beta) {
     do_move(CurrentMove[Ply]);
     if(moves_searched > 3 && ok_to_reduce(move))
       value = -search(-beta, -alpha, depth - 2);
     else value = alpha + 1;
     undo_move(CurrentMove[Ply]);
     if(value > alpha) {
       value = -search(-beta, -alpha, depth - 1);
       if(value > alpha) alpha = value;
     }
     moves_searched++;
   }
   return alpha;
}

Tord



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.