Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

simplify see pruning in qsearch #5607

Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 4 additions & 12 deletions src/search.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1592,19 +1592,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