my first attempt at razoring was:
Code: Select all
// Razoring
if (UseRazoring && depth <= RazorDepth
&& !is_pv && !is_mate_score(beta) && !in_check)
{
if (current_eval + RazorMargin(depth) <= alpha) {
const int score = qsearch(B, alpha, beta, 0, ply+1, is_pv, si+1);
if (score <= alpha && --depth <= 0)
return score;
}
}
So I then did like everyone else (Hyatt Razoring) and compared qsearch to alpha - RazorMargin(depth) instead. However, I still wanted to test reducing against pruning in this situation. And I found that reducing is actually *better* than pruning. Result in self-testing: 321-249-297 (stopped by sequential Wald test algorithm).
Hyat Razoring & Reduce
Code: Select all
if (UseRazoring && depth <= RazorDepth
&& !is_pv && !is_mate_score(beta) && !in_check)
{
if (current_eval + RazorMargin(depth) <= alpha) {
const int razor_beta = beta - RazorMargin(depth);
const int score = qsearch(B, alpha, beta, 0, ply+1, is_pv, si+1);
if (score <= razor_beta
&& --depth <= 0) // reduce
return score; // prune at horizon
}
}
Code: Select all
if (UseRazoring && depth <= RazorDepth
&& !is_pv && !is_mate_score(beta) && !in_check)
{
if (current_eval + RazorMargin(depth) <= alpha) {
const int razor_beta = beta - RazorMargin(depth);
const int score = qsearch(B, alpha, beta, 0, ply+1, is_pv, si+1);
if (score <= razor_beta)
return score;
}
}