Skip to content

Commit

Permalink
Small cleanup
Browse files Browse the repository at this point in the history
In search remove one condition check and reorder conditions. Removes some code.

Passed non-regression test:
https://tests.stockfishchess.org/tests/view/64548fa06206ee34ebf853ad
LLR: 2.95 (-2.94,2.94) <-1.75,0.25>
Total: 282976 W: 75327 L: 75374 D: 132275
Ptnml(0-2): 604, 29673, 80995, 29598, 618

closes #4557

No functional change
  • Loading branch information
Vizvezdenec authored and vondele committed May 7, 2023
1 parent 2844219 commit 464ebdf
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/search.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1310,7 +1310,13 @@ namespace {
if (PvNode && !rootNode) // Update pv even in fail-high case
update_pv(ss->pv, move, (ss+1)->pv);

if (PvNode && value < beta) // Update alpha! Always alpha < beta
if (value >= beta)
{
ss->cutoffCnt += 1 + !ttMove;
assert(value >= beta); // Fail high
break;
}
else
{
// Reduce other moves if we have found at least one score improvement (~1 Elo)
if ( depth > 1
Expand All @@ -1319,13 +1325,7 @@ namespace {
depth -= 1;

assert(depth > 0);
alpha = value;
}
else
{
ss->cutoffCnt += 1 + !ttMove;
assert(value >= beta); // Fail high
break;
alpha = value; // Update alpha! Always alpha < beta
}
}
}
Expand Down

0 comments on commit 464ebdf

Please sign in to comment.