From 67ae53b020cbc604a817d249933973fbc9de866b Mon Sep 17 00:00:00 2001 From: mstembera Date: Tue, 18 Dec 2018 08:50:57 +0100 Subject: [PATCH] New voting formula for threads We now use a quadratic formula during the vote for threads when deciding on which thread to pick a move from. time control 5+0.05, with 8 threads: LLR: 2.95 (-2.94,2.94) [0.00,5.00] Total: 20202 W: 4031 L: 3813 D: 12358 http://tests.stockfishchess.org/tests/view/5c16c8e60ebc5902ba1223e2 time control 20+0.2, with 8 threads: LLR: 2.96 (-2.94,2.94) [0.00,5.00] Total: 14330 W: 2290 L: 2115 D: 9925 http://tests.stockfishchess.org/tests/view/5c16efca0ebc5902ba122993 20000 games match at time control 5+0.05, with 31 threads: ELO: 5.63 +-2.8 (95%) LOS: 100.0% Total: 20000 W: 3539 L: 3215 D: 13246 http://tests.stockfishchess.org/tests/view/5c16f07a0ebc5902ba122a20 Closes https://github.com/official-stockfish/Stockfish/pull/1876 No functional change (in simple thread mode) --- src/search.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/search.cpp b/src/search.cpp index 5b6a0485..02f40199 100644 --- a/src/search.cpp +++ b/src/search.cpp @@ -254,7 +254,7 @@ void MainThread::search() { && !Skill(Options["Skill Level"]).enabled() && rootMoves[0].pv[0] != MOVE_NONE) { - std::map votes; + std::map votes; Value minScore = this->rootMoves[0].score; // Find out minimum score and reset votes for moves which can be voted @@ -265,12 +265,13 @@ void MainThread::search() { } // Vote according to score and depth + auto square = [](int64_t x) { return x * x; }; for (Thread* th : Threads) - votes[th->rootMoves[0].pv[0]] += int(th->rootMoves[0].score - minScore) - + int(th->completedDepth); + votes[th->rootMoves[0].pv[0]] += 200 + (square(th->rootMoves[0].score - minScore + 1) + * int64_t(th->completedDepth)); // Select best thread - int bestVote = votes[this->rootMoves[0].pv[0]]; + int64_t bestVote = votes[this->rootMoves[0].pv[0]]; for (Thread* th : Threads) { if (votes[th->rootMoves[0].pv[0]] > bestVote) -- 2.39.2