Adjust time used for move based on previous score

Use less time if evaluation is not worse than for previous move and even less time if in addition no fail low encountered for current iteration.

STC: 10+0.1
ELO: 5.37 +-2.9 (95%) LOS: 100.0%
Total: 20000 W: 3832 L: 3523 D: 12645

STC: 10+0.1
LLR: 2.96 (-2.94,2.94) [0.00,5.00]
Total: 17527 W: 3334 L: 3132 D: 11061

LTC: 60+0.6
LLR: 2.95 (-2.94,2.94) [0.00,5.00]
Total: 28233 W: 3939 L: 3725 D: 20569

LTC: 60+0.6
ELO: 2.43 +-1.4 (95%) LOS: 100.0%
Total: 60000 W: 8266 L: 7847 D: 43887

LTC: 60+0.06
LLR: 2.95 (-2.94,2.94) [-1.00,3.00]
Total: 38932 W: 5408 L: 5207 D: 28317

Resolves #547
This commit is contained in:
Leonid Pechenik
2016-01-03 14:00:56 +00:00
committed by Joona Kiiski
parent 5972c4a678
commit 9eceb894ac
5 changed files with 18 additions and 11 deletions

View File

@@ -187,6 +187,8 @@ void Search::clear() {
th->history.clear();
th->counterMoves.clear();
}
Threads.main()->previousMoveScore = VALUE_INFINITE;
}
@@ -337,6 +339,8 @@ void MainThread::search() {
bestThread = th;
}
previousMoveScore = bestThread->rootMoves[0].score;
// Send new PV when needed
if (bestThread != this)
sync_cout << UCI::pv(bestThread->rootPos, bestThread->completedDepth, -VALUE_INFINITE, VALUE_INFINITE) << sync_endl;
@@ -536,10 +540,12 @@ void Thread::search() {
// of the available time has been used or we matched an easyMove
// from the previous search and just did a fast verification.
if ( rootMoves.size() == 1
|| Time.elapsed() > Time.available() * (mainThread->failedLow ? 641 : 315) / 640
|| (mainThread->easyMovePlayed = ( rootMoves[0].pv[0] == easyMove
&& mainThread->bestMoveChanges < 0.03
&& Time.elapsed() > Time.available() / 8)))
|| Time.elapsed() > Time.available() * ( 640 - 160 * !mainThread->failedLow
- 126 * (bestValue >= mainThread->previousMoveScore)
- 124 * (bestValue >= mainThread->previousMoveScore && !mainThread->failedLow))/640
|| ( mainThread->easyMovePlayed = ( rootMoves[0].pv[0] == easyMove
&& mainThread->bestMoveChanges < 0.03
&& Time.elapsed() > Time.available() * 25/206)))
{
// If we are allowed to ponder do not stop the search now but
// keep pondering until the GUI sends "ponderhit" or "stop".