Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
ddugovic committed May 11, 2023
2 parents b20ee16 + 65e2150 commit 76cea3c
Showing 1 changed file with 11 additions and 14 deletions.
25 changes: 11 additions & 14 deletions src/search.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -789,13 +789,10 @@ namespace {
ss->staticEval = eval = tte->eval();
if (eval == VALUE_NONE)
ss->staticEval = eval = evaluate(pos);
else
{
#ifdef USE_NNUE
if (PvNode)
Eval::NNUE::hint_common_parent_position(pos);
else if (PvNode)
Eval::NNUE::hint_common_parent_position(pos);
#endif
}

// ttValue can be used as a better position evaluation (~7 Elo)
if ( ttValue != VALUE_NONE
Expand Down Expand Up @@ -1315,7 +1312,7 @@ namespace {
{
// Adjust full depth search based on LMR results - if result
// was good enough search deeper, if it was bad enough search shallower
const bool doDeeperSearch = value > (alpha + 58 + 12 * (newDepth - d));
const bool doDeeperSearch = value > (bestValue + 68 + 12 * (newDepth - d));
const bool doEvenDeeperSearch = value > alpha + 588 && ss->doubleExtensions <= 5;
const bool doShallowerSearch = value < bestValue + newDepth;

Expand Down Expand Up @@ -1432,7 +1429,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 @@ -1441,13 +1444,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 76cea3c

Please sign in to comment.