mirror of
https://github.com/sockspls/badfish
synced 2025-05-02 17:49:35 +00:00
Simplify razoring logic
passed STC: LLR: 2.96 (-2.94,2.94) [-3.00,1.00] Total: 36574 W: 7523 L: 7430 D: 21621 http://tests.stockfishchess.org/tests/view/5aae11450ebc590299abf52f No functional change.
This commit is contained in:
parent
759b3c79cf
commit
1940485030
1 changed files with 7 additions and 16 deletions
|
@ -67,8 +67,7 @@ namespace {
|
||||||
constexpr int SkipPhase[] = { 0, 1, 0, 1, 2, 3, 0, 1, 2, 3, 4, 5, 0, 1, 2, 3, 4, 5, 6, 7 };
|
constexpr int SkipPhase[] = { 0, 1, 0, 1, 2, 3, 0, 1, 2, 3, 4, 5, 0, 1, 2, 3, 4, 5, 6, 7 };
|
||||||
|
|
||||||
// Razor and futility margins
|
// Razor and futility margins
|
||||||
constexpr int RazorMargin1 = 590;
|
constexpr int RazorMargin[] = {0, 590, 604};
|
||||||
constexpr int RazorMargin2 = 604;
|
|
||||||
Value futility_margin(Depth d, bool improving) {
|
Value futility_margin(Depth d, bool improving) {
|
||||||
return Value((175 - 50 * improving) * d / ONE_PLY);
|
return Value((175 - 50 * improving) * d / ONE_PLY);
|
||||||
}
|
}
|
||||||
|
@ -690,21 +689,13 @@ namespace {
|
||||||
|
|
||||||
// Step 7. Razoring (skipped when in check)
|
// Step 7. Razoring (skipped when in check)
|
||||||
if ( !PvNode
|
if ( !PvNode
|
||||||
&& depth <= 2 * ONE_PLY)
|
&& depth <= 2 * ONE_PLY
|
||||||
|
&& eval <= alpha - Value(RazorMargin[depth / ONE_PLY]))
|
||||||
{
|
{
|
||||||
if ( depth == ONE_PLY
|
Value ralpha = alpha - Value((depth != ONE_PLY) * RazorMargin[depth / ONE_PLY]);
|
||||||
&& eval + RazorMargin1 <= alpha)
|
Value v = qsearch<NonPV>(pos, ss, ralpha, ralpha+1);
|
||||||
return qsearch<NonPV>(pos, ss, alpha, alpha+1);
|
if (depth == ONE_PLY || v <= ralpha)
|
||||||
|
return v;
|
||||||
else if (eval + RazorMargin2 <= alpha)
|
|
||||||
{
|
|
||||||
Value ralpha = alpha - RazorMargin2;
|
|
||||||
|
|
||||||
Value v = qsearch<NonPV>(pos, ss, ralpha, ralpha+1);
|
|
||||||
|
|
||||||
if (v <= ralpha)
|
|
||||||
return v;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Step 8. Futility pruning: child node (skipped when in check)
|
// Step 8. Futility pruning: child node (skipped when in check)
|
||||||
|
|
Loading…
Add table
Reference in a new issue