Introduce separate butterfly history table for sorting root moves

Idea of this patch comes from the fact that current history heuristics
are mostly populated by low depth entries since our stat bonus reaches
maximum value at depth 5-6 and number of low depth nodes is much bigger
than number of high depth nodes. But it doesn't make a whole lost of
sense to use this low-depth centered histories to sort moves at root.
Current patch introduces special history table that is used exclusively
at root, it remembers which quiet moves were good and which quiet moves
were not good there and uses this information for move ordering.

Passed STC:
https://tests.stockfishchess.org/tests/view/66dda74adc53972b68218cc9
LLR: 2.93 (-2.94,2.94) <0.00,2.00>
Total: 127680 W: 33579 L: 33126 D: 60975
Ptnml(0-2): 422, 15098, 32391, 15463, 466

Passed LTC:
https://tests.stockfishchess.org/tests/view/66dead2adc53972b68218d34
LLR: 2.95 (-2.94,2.94) <0.50,2.50>
Total: 381978 W: 96958 L: 95923 D: 189097
Ptnml(0-2): 277, 42165, 105089, 43162, 296

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

Bench: 1611283
This commit is contained in:
Michael Chaly
2024-09-14 08:22:32 +03:00
committed by Disservin
parent 5ce7f866a5
commit 240a5b1c72
4 changed files with 53 additions and 24 deletions
+5 -1
View File
@@ -171,9 +171,11 @@ class MovePicker {
Move,
Depth,
const ButterflyHistory*,
const ButterflyHistory*,
const CapturePieceToHistory*,
const PieceToHistory**,
const PawnHistory*);
const PawnHistory*,
bool);
MovePicker(const Position&, Move, int, const CapturePieceToHistory*);
Move next_move(bool skipQuiets = false);
@@ -187,6 +189,7 @@ class MovePicker {
const Position& pos;
const ButterflyHistory* mainHistory;
const ButterflyHistory* rootHistory;
const CapturePieceToHistory* captureHistory;
const PieceToHistory** continuationHistory;
const PawnHistory* pawnHistory;
@@ -195,6 +198,7 @@ class MovePicker {
int stage;
int threshold;
Depth depth;
bool rootNode;
ExtMove moves[MAX_MOVES];
};