Fix early stop condition
authorMarco Costalba <mcostalba@gmail.com>
Wed, 8 Jan 2014 21:58:25 +0000 (06:58 +0900)
committerMarco Costalba <mcostalba@gmail.com>
Wed, 8 Jan 2014 21:58:25 +0000 (06:58 +0900)
While editing original Uri's messy patch
I have incorrectly simplified the logic
condition. Here is the correct original
version, as it was tested.

bench: 8502826

src/search.cpp

index be82568a2179f03eb9bce512617950a7abad8f50..a08256d740953b00caeb0eca075ade01e33679bb 100644 (file)
@@ -1612,8 +1612,9 @@ void check_time() {
   Time::point elapsed = Time::now() - SearchTime;
   bool stillAtFirstMove =    Signals.firstRootMove
                          && !Signals.failedLowAtRoot
-                         &&  elapsed > (TimeMgr.available_time() * 62) / 100
-                         &&  elapsed > IterationTime * 1.4;
+                         && (   elapsed > TimeMgr.available_time()
+                             || (   elapsed > (TimeMgr.available_time() * 62) / 100
+                                 && elapsed > IterationTime * 1.4));
 
   bool noMoreTime =   elapsed > TimeMgr.maximum_time() - 2 * TimerThread::Resolution
                    || stillAtFirstMove;