Skip to content

Commit

Permalink
evaluate leaf value before vcf
Browse files Browse the repository at this point in the history
test f15
  • Loading branch information
dhbloo committed Oct 13, 2024
1 parent ed79856 commit ef4751f
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions Rapfi/search/ab/search.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -640,6 +640,17 @@ Value search(Board &board, SearchStack *ss, Value alpha, Value beta, Depth depth

// Dive into vcf search when the depth reaches zero (~17 elo)
if (depth <= 0.0f) {
Value leafValue = Evaluation::evaluate<Rule>(board, alpha, beta);

// Update bound using standing pat
if (oppo5)
beta = std::min(beta, leafValue);
else
alpha = std::max(alpha, leafValue);
// Prune directly if the value is already outside the window
if (alpha >= beta)
return alpha;

return oppo5 ? vcfdefend<Rule, NT>(board, ss, alpha, beta)
: vcfsearch<Rule, NT>(board, ss, alpha, beta);
}
Expand Down

0 comments on commit ef4751f

Please sign in to comment.