Use average bestMoveChanges across all threads #2072

The current update only by main thread depends on the luck of
whether main thread sees any/many changes to the best move or not.
It then makes large, lumpy changes to the time to be
used (1x, 2x, 3x, etc) depending on that sample of 1.
Use the average across all threads to get a more reliable
number with a smoother distribution.

STC @ 5+0.05 th 4 :
LLR: 2.95 (-2.94,2.94) [0.50,4.50]
Total: 51899 W: 11446 L: 11029 D: 29424
http://tests.stockfishchess.org/tests/view/5ca32ff20ebc5925cf0016fb

STC @ 5+0.05 th 8 :
LLR: 2.96 (-2.94,2.94) [0.50,4.50]
Total: 13851 W: 2843 L: 2620 D: 8388
http://tests.stockfishchess.org/tests/view/5ca35ae00ebc5925cf001adb

LTC @ 20+0.2 th 8 :
LLR: 2.95 (-2.94,2.94) [0.00,3.50]
Total: 48527 W: 7941 L: 7635 D: 32951
http://tests.stockfishchess.org/tests/view/5ca37cb70ebc5925cf001cec

Further work:
Similar changes might be possible for the fallingEval and timeReduction calculations (and elsewhere?), using either the min, average or max values across all threads.

Bench 3506898
This commit is contained in:
xoto10
2019-04-03 08:35:55 +01:00
committed by Marco Costalba
parent 0f63b35120
commit 1982fe25f8
2 changed files with 14 additions and 11 deletions

View File

@@ -63,7 +63,7 @@ public:
size_t pvIdx, pvLast;
int selDepth, nmpMinPly;
Color nmpColor;
std::atomic<uint64_t> nodes, tbHits;
std::atomic<uint64_t> nodes, tbHits, bestMoveChanges;
Position rootPos;
Search::RootMoves rootMoves;
@@ -85,7 +85,7 @@ struct MainThread : public Thread {
void search() override;
void check_time();
double bestMoveChanges, previousTimeReduction;
double previousTimeReduction;
Value previousScore;
int callsCnt;
bool stopOnPonderhit;