1
0
Fork 0

Tweak initial aspiration window.

Maintain for each root move an exponential average of the search value with a weight ratio of 2:1 (new value vs old values). Then the average score is used as the center of the initial aspiration window instead of the previous score.

Stats indicate (see PR) that the deviation for previous score is in general greater than using average score, so later seems a better estimation of the next search value. This is probably the reason this patch succeded besides smoothing the sometimes wild swings in search score. An additional observation is that at higher depth previous score is above but average score below zero. So for average score more/less fail/low highs should be occur than previous score.

STC:
LLR: 2.97 (-2.94,2.94) <0.00,2.50>
Total: 59792 W: 15106 L: 14792 D: 29894
Ptnml(0-2): 144, 6718, 15869, 7010, 155
https://tests.stockfishchess.org/tests/view/61841612d7a085ad008eef06

LTC:
LLR: 2.94 (-2.94,2.94) <0.50,3.00>
Total: 46448 W: 11835 L: 11537 D: 23076
Ptnml(0-2): 21, 4756, 13374, 5050, 23
https://tests.stockfishchess.org/tests/view/618463abd7a085ad008eef3e

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

Bench: 6719976
pull/3780/head
Stefan Geschwentner 2021-11-05 13:49:28 +01:00 committed by Joost VandeVondele
parent 45e5e65a28
commit a0259d8ab9
2 changed files with 4 additions and 1 deletions

View File

@ -376,7 +376,7 @@ void Thread::search() {
// Reset aspiration window starting size
if (rootDepth >= 4)
{
Value prev = rootMoves[pvIdx].previousScore;
Value prev = rootMoves[pvIdx].averageScore;
delta = Value(17) + int(prev) * prev / 16384;
alpha = std::max(prev - delta,-VALUE_INFINITE);
beta = std::min(prev + delta, VALUE_INFINITE);
@ -1280,6 +1280,8 @@ moves_loop: // When in check, search starts here
RootMove& rm = *std::find(thisThread->rootMoves.begin(),
thisThread->rootMoves.end(), move);
rm.averageScore = rm.averageScore != -VALUE_INFINITE ? (2 * value + rm.averageScore) / 3 : value;
// PV move or new best move?
if (moveCount == 1 || value > alpha)
{

View File

@ -73,6 +73,7 @@ struct RootMove {
Value score = -VALUE_INFINITE;
Value previousScore = -VALUE_INFINITE;
Value averageScore = -VALUE_INFINITE;
int selDepth = 0;
int tbRank = 0;
Value tbScore;