Skip to content

Commit

Permalink
simplify see pruning in qsearch
Browse files Browse the repository at this point in the history
passed non-regression STC:
LLR: 2.96 (-2.94,2.94) <-1.75,0.25>
Total: 34880 W: 9193 L: 8968 D: 16719
Ptnml(0-2): 103, 4047, 8935, 4232, 123
https://tests.stockfishchess.org/tests/view/66ee83bd86d5ee47d953b15b

passed non-regression LTC:
LLR: 2.95 (-2.94,2.94) <-1.75,0.25>
Total: 69126 W: 17529 L: 17357 D: 34240
Ptnml(0-2): 41, 7507, 19285, 7699, 31
https://tests.stockfishchess.org/tests/view/66ef3e0386d5ee47d953b1d3

closes #5607

Bench: 1339840
  • Loading branch information
Nonlinear2 authored and vondele committed Sep 28, 2024
1 parent ae420e7 commit aff1f67
Showing 1 changed file with 4 additions and 12 deletions.
16 changes: 4 additions & 12 deletions src/search.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1596,19 +1596,11 @@ Value Search::Worker::qsearch(Position& pos, Stack* ss, Value alpha, Value beta)
continue;
}

// If static eval is much lower than alpha and move is
// not winning material, we can prune this move. (~2 Elo)
if (futilityBase <= alpha && !pos.see_ge(move, 1))
// if static exchange evaluation is low enough
// we can prune this move. (~2 Elo)
if (!pos.see_ge(move, alpha - futilityBase))
{
bestValue = std::max(bestValue, futilityBase);
continue;
}

// If static exchange evaluation is much worse than what
// is needed to not fall below alpha, we can prune this move.
if (futilityBase > alpha && !pos.see_ge(move, (alpha - futilityBase) * 4))
{
bestValue = alpha;
bestValue = (futilityBase > alpha) ? alpha : std::max(bestValue, futilityBase);
continue;
}
}
Expand Down

0 comments on commit aff1f67

Please sign in to comment.