value > beta

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

Robert Pope
Posts: 558
Joined: Sat Mar 25, 2006 8:27 pm

value > beta

Post by Robert Pope »

When adding transposition tables to my program, I was referencing some other codes for comparison. For beta cutoffs, Bruce Moreland's web page has
if (val >= beta) {
RecordHash(depth, beta, hashfBETA);
return beta;
}

But CPW uses
if ( val > beta ) {
tt_save(depth, beta, TT_BETA, bestmove);
info_pv( beta );
return beta;
}


This isn't fail-soft vs. fail-hard, is it? Is one of these clearly correct, and the other wrong, or is it dependent on something else?
bob
Posts: 20943
Joined: Mon Feb 27, 2006 7:30 pm
Location: Birmingham, AL

Re: value > beta

Post by bob »

Robert Pope wrote:When adding transposition tables to my program, I was referencing some other codes for comparison. For beta cutoffs, Bruce Moreland's web page has
if (val >= beta) {
RecordHash(depth, beta, hashfBETA);
return beta;
}

But CPW uses
if ( val > beta ) {
tt_save(depth, beta, TT_BETA, bestmove);
info_pv( beta );
return beta;
}


This isn't fail-soft vs. fail-hard, is it? Is one of these clearly correct, and the other wrong, or is it dependent on something else?
>= is correct.

the > beta is not so good for PVS, since most of the time alpha/beta don't change (null-window search).
User avatar
lucasart
Posts: 3232
Joined: Mon May 31, 2010 1:29 pm
Full name: lucasart

Re: value > beta

Post by lucasart »

CPW is really not an example to follow…
Theory and practice sometimes clash. And when that happens, theory loses. Every single time.
Robert Pope
Posts: 558
Joined: Sat Mar 25, 2006 8:27 pm

Re: value > beta

Post by Robert Pope »

Thanks, I had it right in my program, but whenever I see something different, I start to wonder.
Sven
Posts: 4052
Joined: Thu May 15, 2008 9:57 pm
Location: Berlin, Germany
Full name: Sven Schüle

Re: value > beta

Post by Sven »

Robert Pope wrote:When adding transposition tables to my program, I was referencing some other codes for comparison. For beta cutoffs, Bruce Moreland's web page has
if (val >= beta) {
RecordHash(depth, beta, hashfBETA);
return beta;
}

But CPW uses
if ( val > beta ) {
tt_save(depth, beta, TT_BETA, bestmove);
info_pv( beta );
return beta;
}


This isn't fail-soft vs. fail-hard, is it? Is one of these clearly correct, and the other wrong, or is it dependent on something else?
CPW has:

Code: Select all

if ( val > beta ) { // should be >=, see post
so the correction is already known there.
syzygy
Posts: 5563
Joined: Tue Feb 28, 2012 11:56 pm

Re: value > beta

Post by syzygy »

Sven Schüle wrote:CPW has:

Code: Select all

if ( val > beta ) { // should be >=, see post
so the correction is already known there.
And these lines are in search_root(). The main Search() function correctly has:

Code: Select all

 if ( val >= beta ) {