mirror of
https://github.com/sockspls/badfish
synced 2025-07-11 19:49:14 +00:00
Don't exit earlier from aspiration window loop
Currently we exit the loop when abs(bestValue) >= VALUE_KNOWN_WIN but there is no logical reason for this. It seems more natural to re-search again with full open window. This has practically no impact in most cases, we have a 'no functional change' running 'bench' command.
This commit is contained in:
parent
afcee1e8a4
commit
6008f6538e
1 changed files with 10 additions and 3 deletions
|
@ -365,7 +365,8 @@ namespace {
|
||||||
|
|
||||||
// Start with a small aspiration window and, in case of fail high/low,
|
// Start with a small aspiration window and, in case of fail high/low,
|
||||||
// research with bigger window until not failing high/low anymore.
|
// research with bigger window until not failing high/low anymore.
|
||||||
do {
|
while (true)
|
||||||
|
{
|
||||||
// Search starts from ss+1 to allow referencing (ss-1). This is
|
// Search starts from ss+1 to allow referencing (ss-1). This is
|
||||||
// needed by update gains and ss copy when splitting at Root.
|
// needed by update gains and ss copy when splitting at Root.
|
||||||
bestValue = search<Root>(pos, ss+1, alpha, beta, depth * ONE_PLY);
|
bestValue = search<Root>(pos, ss+1, alpha, beta, depth * ONE_PLY);
|
||||||
|
@ -419,9 +420,15 @@ namespace {
|
||||||
else
|
else
|
||||||
break;
|
break;
|
||||||
|
|
||||||
assert(alpha >= -VALUE_INFINITE && beta <= VALUE_INFINITE);
|
// Search with full window in case we have a win/mate score
|
||||||
|
if (abs(bestValue) >= VALUE_KNOWN_WIN)
|
||||||
|
{
|
||||||
|
alpha = -VALUE_INFINITE;
|
||||||
|
beta = VALUE_INFINITE;
|
||||||
|
}
|
||||||
|
|
||||||
} while (abs(bestValue) < VALUE_KNOWN_WIN);
|
assert(alpha >= -VALUE_INFINITE && beta <= VALUE_INFINITE);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Skills: Do we need to pick now the best move ?
|
// Skills: Do we need to pick now the best move ?
|
||||||
|
|
Loading…
Add table
Reference in a new issue