Skip to content

Commit

Permalink
Update bestValue when futility pruning
Browse files Browse the repository at this point in the history
In qsearch we should update the bestValue as we do
in case of futilityValue < beta, also when pruning
moves with non-positive see.

Spotted by Lucas Braesch

Bench: 5695710
  • Loading branch information
mcostalba committed Nov 26, 2012
1 parent 55df3fa commit 5af8179
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/search.cpp
Expand Up @@ -1217,17 +1217,18 @@ namespace {

if (futilityValue < beta)
{
if (futilityValue > bestValue)
bestValue = futilityValue;

bestValue = std::max(bestValue, futilityValue);
continue;
}

// Prune moves with negative or equal SEE
if ( futilityBase < beta
&& depth < DEPTH_ZERO
&& pos.see(move) <= 0)
{
bestValue = std::max(bestValue, futilityBase);
continue;
}
}

// Detect non-capture evasions that are candidate to be pruned
Expand Down

0 comments on commit 5af8179

Please sign in to comment.