mirror of
https://github.com/HChaZZY/Stockfish.git
synced 2025-12-22 01:56:58 +08:00
Simplify time management
Tested with simplification mode SPRT[-4, 0] Passed both short TC LLR: 2.95 (-2.94,2.94) [-4.00,0.00] Total: 34102 W: 6184 L: 6144 D: 21774 And long TC LLR: 2.96 (-2.94,2.94) [-4.00,0.00] Total: 16518 W: 2647 L: 2545 D: 11326 And also 40/10 TC LLR: 2.95 (-2.94,2.94) [-4.00,0.00] Total: 22406 W: 4390 L: 4312 D: 13704 bench: 8430785
This commit is contained in:
committed by
Marco Costalba
parent
e6523e56b8
commit
72e8640f4d
@@ -320,7 +320,7 @@ namespace {
|
||||
while (++depth <= MAX_PLY && !Signals.stop && (!Limits.depth || depth <= Limits.depth))
|
||||
{
|
||||
// Age out PV variability metric
|
||||
BestMoveChanges *= 0.8;
|
||||
BestMoveChanges *= 0.5;
|
||||
|
||||
// Save the last iteration's scores before first PV line is searched and
|
||||
// all the move scores except the (new) PV are set to -VALUE_INFINITE.
|
||||
@@ -429,11 +429,10 @@ namespace {
|
||||
if (depth > 4 && depth < 50 && PVSize == 1)
|
||||
TimeMgr.pv_instability(BestMoveChanges);
|
||||
|
||||
// Stop the search if only one legal move is available or most
|
||||
// of the available time has been used. We probably don't have
|
||||
// enough time to search the first move at the next iteration anyway.
|
||||
// Stop the search if only one legal move is available or all
|
||||
// of the available time has been used.
|
||||
if ( RootMoves.size() == 1
|
||||
|| IterationTime > (TimeMgr.available_time() * 62) / 100)
|
||||
|| IterationTime > TimeMgr.available_time() )
|
||||
stop = true;
|
||||
|
||||
if (stop)
|
||||
@@ -1628,9 +1627,8 @@ void check_time() {
|
||||
Time::point elapsed = Time::now() - SearchTime;
|
||||
bool stillAtFirstMove = Signals.firstRootMove
|
||||
&& !Signals.failedLowAtRoot
|
||||
&& ( elapsed > TimeMgr.available_time()
|
||||
|| ( elapsed > (TimeMgr.available_time() * 62) / 100
|
||||
&& elapsed > IterationTime * 1.4));
|
||||
&& elapsed > TimeMgr.available_time()
|
||||
&& elapsed > IterationTime * 1.4;
|
||||
|
||||
bool noMoreTime = elapsed > TimeMgr.maximum_time() - 2 * TimerThread::Resolution
|
||||
|| stillAtFirstMove;
|
||||
|
||||
Reference in New Issue
Block a user