1
0
Fork 0
mirror of https://github.com/sockspls/badfish synced 2025-05-01 09:13:08 +00:00

Simplify away depth condition for aspiration window adjust

Simplification STC:
https://tests.stockfishchess.org/tests/view/64351654596a20f264276ded
LLR: 2.95 (-2.94,2.94) <-1.75,0.25>
Total: 374664 W: 98942 L: 99089 D: 176633
Ptnml(0-2): 1049, 41767, 101878, 41558, 1080

Simplification LTC:
https://tests.stockfishchess.org/tests/view/6439499f605991a801b4f684
LLR: 2.95 (-2.94,2.94) <-1.75,0.25>
Total: 457880 W: 123021 L: 123233 D: 211626
Ptnml(0-2): 166, 44739, 139335, 44541, 159

closes https://github.com/official-stockfish/Stockfish/pull/4534

Bench: 3879281
This commit is contained in:
Muzhen Gaming 2023-04-14 20:33:33 +08:00 committed by Joost VandeVondele
parent 7b9b793fd5
commit d64d4ac426

View file

@ -288,9 +288,7 @@ void Thread::search() {
ss->pv = pv; ss->pv = pv;
bestValue = delta = alpha = -VALUE_INFINITE; bestValue = -VALUE_INFINITE;
beta = VALUE_INFINITE;
optimism[WHITE] = optimism[BLACK] = VALUE_ZERO;
if (mainThread) if (mainThread)
{ {
@ -349,18 +347,15 @@ void Thread::search() {
selDepth = 0; selDepth = 0;
// Reset aspiration window starting size // Reset aspiration window starting size
if (rootDepth >= 4) Value prev = rootMoves[pvIdx].averageScore;
{ delta = Value(10) + int(prev) * prev / 16502;
Value prev = rootMoves[pvIdx].averageScore; alpha = std::max(prev - delta,-VALUE_INFINITE);
delta = Value(10) + int(prev) * prev / 16502; beta = std::min(prev + delta, VALUE_INFINITE);
alpha = std::max(prev - delta,-VALUE_INFINITE);
beta = std::min(prev + delta, VALUE_INFINITE);
// Adjust optimism based on root move's previousScore // Adjust optimism based on root move's previousScore
int opt = 120 * prev / (std::abs(prev) + 161); int opt = 120 * prev / (std::abs(prev) + 161);
optimism[ us] = Value(opt); optimism[ us] = Value(opt);
optimism[~us] = -optimism[us]; optimism[~us] = -optimism[us];
}
// Start with a small aspiration window and, in the case of a fail // Start with a small aspiration window and, in the case of a fail
// high/low, re-search with a bigger window until we don't fail // high/low, re-search with a bigger window until we don't fail