Skip to content

Commit d64d4ac

Browse files
XInTheDarkvondele
authored andcommitted
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 #4534 Bench: 3879281
1 parent 7b9b793 commit d64d4ac

File tree

1 file changed

+10
-15
lines changed

1 file changed

+10
-15
lines changed

src/search.cpp

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -288,9 +288,7 @@ void Thread::search() {
288288

289289
ss->pv = pv;
290290

291-
bestValue = delta = alpha = -VALUE_INFINITE;
292-
beta = VALUE_INFINITE;
293-
optimism[WHITE] = optimism[BLACK] = VALUE_ZERO;
291+
bestValue = -VALUE_INFINITE;
294292

295293
if (mainThread)
296294
{
@@ -349,18 +347,15 @@ void Thread::search() {
349347
selDepth = 0;
350348

351349
// Reset aspiration window starting size
352-
if (rootDepth >= 4)
353-
{
354-
Value prev = rootMoves[pvIdx].averageScore;
355-
delta = Value(10) + int(prev) * prev / 16502;
356-
alpha = std::max(prev - delta,-VALUE_INFINITE);
357-
beta = std::min(prev + delta, VALUE_INFINITE);
358-
359-
// Adjust optimism based on root move's previousScore
360-
int opt = 120 * prev / (std::abs(prev) + 161);
361-
optimism[ us] = Value(opt);
362-
optimism[~us] = -optimism[us];
363-
}
350+
Value prev = rootMoves[pvIdx].averageScore;
351+
delta = Value(10) + int(prev) * prev / 16502;
352+
alpha = std::max(prev - delta,-VALUE_INFINITE);
353+
beta = std::min(prev + delta, VALUE_INFINITE);
354+
355+
// Adjust optimism based on root move's previousScore
356+
int opt = 120 * prev / (std::abs(prev) + 161);
357+
optimism[ us] = Value(opt);
358+
optimism[~us] = -optimism[us];
364359

365360
// Start with a small aspiration window and, in the case of a fail
366361
// high/low, re-search with a bigger window until we don't fail

0 commit comments

Comments
 (0)