Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: Programming problems with PV

Author: Yngvi Bjornsson

Date: 13:21:32 05/18/00

Go up one level in this thread


On May 18, 2000 at 06:58:44, Jan Pernicka wrote:

> Hi,
>I have to face this problem:
> When using aspiration search at the root with window <eval-100,eval+100> I
>occasionally get fail high - for example when I have found a mate. Problem
>is when the returned score (let's call it S)is actually the exact value of my
>position - in this case I do a research with window <S,+infinity> but
>I'm unable to set PV properly at that ply - and if it's last ply of the search
>PV is wrong... (e.g. showing PV not leading to mate even though returned score
>says it will be mate...).
>  I set the PV in the tree when:
>    1) I got cutoff
>    2) eval()>alfa
>Thank you in advance for your suggestions.
> Jan

This can happen when you use the value returned by the minimal-window search
as a lower-bound for the research (note: this is not specific for aspiration
window at the root - this can occur anywhere on the PV). I remember chasing
down a similar case a few years back after having strange PVs emerging.
Basically, when the lower-bound happens to be an exact value, it is quite
possible that you get a beta-cutoff at a pv-node thus not exploring the whole
principal variation. My code was looking something like this (in the
pvs/nws formulation):

pvs( alpha, beta )
{
  .
  .
  .

  make_move( move );
  value = nws(-lower-1,-lower)
  if (value > lower && value < beta) {  <- note value < beta condition
    value = pvs(-beta,-value);
  }
  undo_move( move );

  if ( value > best ) {
    best = value;
    best_move = move;
    if ( best > lower ) {
      UpdatePV(ply, best_move);<- here I copied the pv from the triangular
                                  pv-array even though the node was not
                                  researched (see value<beta condition above),
                                  so I basically ended up with a crap on my PV.
      if ( best >= beta ) {
         return best;
      }
      lower = best;
                              <- one way around the problem is to move
                                 UpdatePV down here.
    }
  }

  .
  .
  .
  return best;

}

 In the above situation you should simply add best_move to your
 pv, and *not* copy the pv-array from the deeper plies.
 If you don't like the occasional truncated PVs you can research the node
 with a lower-bound of value-1. You will get more complete PVs at the cost
 of a small search overhead. However, this only works in the theoretical case
 when you are not using any window-dependent extensions/evaluations. If you
 do that all bets are off, thus I know, some programs do not tighten the
 lower bound in the research, but simply research with a window lower to beta.

 Hope this helps,
 Yngvi



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.