mirror of
https://github.com/sockspls/badfish
synced 2025-04-30 00:33:09 +00:00
Introduce mean squared score for delta adjustments
This patch introduces the value `meanSquaredScore`, which makes the initial delta sensitive to unstable iterative deepening scores. Passed STC: https://tests.stockfishchess.org/tests/view/66fed74286d5ee47d953bb42 LLR: 2.98 (-2.94,2.94) <0.00,2.00> Total: 71104 W: 18635 L: 18262 D: 34207 Ptnml(0-2): 234, 8365, 17993, 8714, 246 Passed LTC: https://tests.stockfishchess.org/tests/view/6700088e86d5ee47d953bbe9 LLR: 2.95 (-2.94,2.94) <0.50,2.50> Total: 212544 W: 54238 L: 53560 D: 104746 Ptnml(0-2): 120, 23093, 59172, 23763, 124 closes https://github.com/official-stockfish/Stockfish/pull/5627 Bench: 1395505
This commit is contained in:
parent
d4358ddba7
commit
aaadbe0572
2 changed files with 16 additions and 11 deletions
|
@ -312,8 +312,8 @@ void Search::Worker::iterative_deepening() {
|
||||||
selDepth = 0;
|
selDepth = 0;
|
||||||
|
|
||||||
// Reset aspiration window starting size
|
// Reset aspiration window starting size
|
||||||
|
delta = 5 + std::abs(rootMoves[pvIdx].meanSquaredScore) / 13797;
|
||||||
Value avg = rootMoves[pvIdx].averageScore;
|
Value avg = rootMoves[pvIdx].averageScore;
|
||||||
delta = 5 + avg * avg / 11797;
|
|
||||||
alpha = std::max(avg - delta, -VALUE_INFINITE);
|
alpha = std::max(avg - delta, -VALUE_INFINITE);
|
||||||
beta = std::min(avg + delta, VALUE_INFINITE);
|
beta = std::min(avg + delta, VALUE_INFINITE);
|
||||||
|
|
||||||
|
@ -1265,6 +1265,10 @@ moves_loop: // When in check, search starts here
|
||||||
rm.averageScore =
|
rm.averageScore =
|
||||||
rm.averageScore != -VALUE_INFINITE ? (value + rm.averageScore) / 2 : value;
|
rm.averageScore != -VALUE_INFINITE ? (value + rm.averageScore) / 2 : value;
|
||||||
|
|
||||||
|
rm.meanSquaredScore = rm.meanSquaredScore != -VALUE_INFINITE * VALUE_INFINITE
|
||||||
|
? (value * std::abs(value) + rm.meanSquaredScore) / 2
|
||||||
|
: value * std::abs(value);
|
||||||
|
|
||||||
// PV move or new best move?
|
// PV move or new best move?
|
||||||
if (moveCount == 1 || value > alpha)
|
if (moveCount == 1 || value > alpha)
|
||||||
{
|
{
|
||||||
|
|
|
@ -95,6 +95,7 @@ struct RootMove {
|
||||||
Value score = -VALUE_INFINITE;
|
Value score = -VALUE_INFINITE;
|
||||||
Value previousScore = -VALUE_INFINITE;
|
Value previousScore = -VALUE_INFINITE;
|
||||||
Value averageScore = -VALUE_INFINITE;
|
Value averageScore = -VALUE_INFINITE;
|
||||||
|
Value meanSquaredScore = -VALUE_INFINITE * VALUE_INFINITE;
|
||||||
Value uciScore = -VALUE_INFINITE;
|
Value uciScore = -VALUE_INFINITE;
|
||||||
bool scoreLowerbound = false;
|
bool scoreLowerbound = false;
|
||||||
bool scoreUpperbound = false;
|
bool scoreUpperbound = false;
|
||||||
|
|
Loading…
Add table
Reference in a new issue