Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: Fail-hard, fail-soft question

Author: Dan Honeycutt

Date: 10:24:09 05/06/04

Go up one level in this thread


On May 06, 2004 at 11:51:45, Anthony Cozzie wrote:

>On May 06, 2004 at 11:38:44, Dan Honeycutt wrote:
>
>>Yet again I apologize for asking a question which I'm sure has been asked many
>>times before, but could someone explain the difference between a fail-hard and a
>>fail-soft and how does is affect a PVS search?
>>
>>I made the guess that, ie, if (score >= beta) if I return score it's a fail-hard
>>and if I return beta it's a fail-soft.  It would seem that what I return doesn't
>>so much matter as what I put in the hash table.  If I put in the (possibly)
>>higher value of score then I have a higher lower bound and a greater chance for
>>a hash cut if this position arises again.
>>
>>Thanks in advance.
>>Dan H.
>
>You understand it perfectly except for having it backwards.
>
>Fail hard: return beta on score >= beta
>Fail soft: return score on score >= beta
>
>Zappa is fail soft, just because it seemed more logical.
>
>anthony

Thanks Anthony and Robert for straightening me out.

It seems more logical to me also to fail soft - score can be a "correct" value
whereas alpha and beta are just limits.  To retrieve a return value outside the
window I added a variable "best" which works as follows:

best = -Infinity;
flag = upper;
while (MovesLeft) {
  MakeMove();
  score = -AlphaBeta(-beta, -alpha);
  UnmakeMove()
  if (score > best) {
    best = score;
    if (score > alpha) {
      alpha = score;
      flag = exact;
      if (score >= beta) {
        SaveHash(lower, xxx);  //xxx = score or beta
        return xxx;
      }
    }
  }
}
SaveHash(flag, yyy);  //yyy = best or alpha
return yyy;


I've been playing with xxx and yyy for both what i store in hash table and what
i return.  It definitely affects the search, but I have far too little data to
judge which seems best.  Any thoughts?

Dan H.




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.