mirror of
https://github.com/sockspls/badfish
synced 2025-05-01 17:19:36 +00:00
Workaround github issue
Temporary revert aspiration window patch so to be visible to everybody: it will be re-applied with next patch No functional change (together with next one)
This commit is contained in:
parent
6fbe027da0
commit
838255ef91
1 changed files with 34 additions and 25 deletions
|
@ -296,12 +296,9 @@ namespace {
|
||||||
Value bestValue, alpha, beta, delta;
|
Value bestValue, alpha, beta, delta;
|
||||||
|
|
||||||
memset(ss-1, 0, 4 * sizeof(Stack));
|
memset(ss-1, 0, 4 * sizeof(Stack));
|
||||||
(ss-1)->currentMove = MOVE_NULL; // Hack to skip update gains
|
|
||||||
|
|
||||||
depth = BestMoveChanges = 0;
|
depth = BestMoveChanges = 0;
|
||||||
bestValue = delta = alpha = -VALUE_INFINITE;
|
bestValue = delta = -VALUE_INFINITE;
|
||||||
beta = VALUE_INFINITE;
|
(ss-1)->currentMove = MOVE_NULL; // Hack to skip update gains
|
||||||
|
|
||||||
TT.new_search();
|
TT.new_search();
|
||||||
History.clear();
|
History.clear();
|
||||||
Gains.clear();
|
Gains.clear();
|
||||||
|
@ -331,12 +328,17 @@ namespace {
|
||||||
// MultiPV loop. We perform a full root search for each PV line
|
// MultiPV loop. We perform a full root search for each PV line
|
||||||
for (PVIdx = 0; PVIdx < PVSize; PVIdx++)
|
for (PVIdx = 0; PVIdx < PVSize; PVIdx++)
|
||||||
{
|
{
|
||||||
// Reset aspiration window starting size
|
// Set aspiration window default width
|
||||||
if (depth >= 5)
|
if (depth >= 5 && abs(RootMoves[PVIdx].prevScore) < VALUE_KNOWN_WIN)
|
||||||
{
|
{
|
||||||
delta = Value(16);
|
delta = Value(16);
|
||||||
alpha = std::max(RootMoves[PVIdx].prevScore - delta,-VALUE_INFINITE);
|
alpha = RootMoves[PVIdx].prevScore - delta;
|
||||||
beta = std::min(RootMoves[PVIdx].prevScore + delta, VALUE_INFINITE);
|
beta = RootMoves[PVIdx].prevScore + delta;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
alpha = -VALUE_INFINITE;
|
||||||
|
beta = VALUE_INFINITE;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 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,
|
||||||
|
@ -364,28 +366,35 @@ namespace {
|
||||||
if (Signals.stop)
|
if (Signals.stop)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// In case of failing low/high increase aspiration window and
|
// In case of failing high/low increase aspiration window and
|
||||||
// research, otherwise exit the loop.
|
// research, otherwise exit the loop.
|
||||||
if (bestValue <= alpha)
|
if (bestValue > alpha && bestValue < beta)
|
||||||
{
|
|
||||||
alpha = std::max(bestValue - delta, -VALUE_INFINITE);
|
|
||||||
|
|
||||||
Signals.failedLowAtRoot = true;
|
|
||||||
Signals.stopOnPonderhit = false;
|
|
||||||
}
|
|
||||||
else if (bestValue >= beta)
|
|
||||||
beta = std::min(bestValue + delta, VALUE_INFINITE);
|
|
||||||
|
|
||||||
else
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
delta += delta / 2;
|
|
||||||
|
|
||||||
assert(alpha >= -VALUE_INFINITE && beta <= VALUE_INFINITE);
|
|
||||||
|
|
||||||
// Give some update (without cluttering the UI) before to research
|
// Give some update (without cluttering the UI) before to research
|
||||||
if (Time::now() - SearchTime > 3000)
|
if (Time::now() - SearchTime > 3000)
|
||||||
sync_cout << uci_pv(pos, depth, alpha, beta) << sync_endl;
|
sync_cout << uci_pv(pos, depth, alpha, beta) << sync_endl;
|
||||||
|
|
||||||
|
if (abs(bestValue) >= VALUE_KNOWN_WIN)
|
||||||
|
{
|
||||||
|
alpha = -VALUE_INFINITE;
|
||||||
|
beta = VALUE_INFINITE;
|
||||||
|
}
|
||||||
|
else if (bestValue >= beta)
|
||||||
|
{
|
||||||
|
beta += delta;
|
||||||
|
delta += delta / 2;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Signals.failedLowAtRoot = true;
|
||||||
|
Signals.stopOnPonderhit = false;
|
||||||
|
|
||||||
|
alpha -= delta;
|
||||||
|
delta += delta / 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
assert(alpha >= -VALUE_INFINITE && beta <= VALUE_INFINITE);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Sort the PV lines searched so far and update the GUI
|
// Sort the PV lines searched so far and update the GUI
|
||||||
|
|
Loading…
Add table
Reference in a new issue