]> git.sesse.net Git - stockfish/commitdiff
Output PV if last iteration does not complete
authorsyzygy <syzygy@server.fake>
Wed, 26 Oct 2016 21:01:11 +0000 (23:01 +0200)
committerMarco Costalba <mcostalba@gmail.com>
Thu, 27 Oct 2016 04:26:22 +0000 (06:26 +0200)
Instead of outputting "info nodes ... time ..." when the last
iteration is interrupted, simply call UCI::pv() to output the PV.

I thought about calling UCI:pv() with bounds -VALUE_INFINITE, VALUE_INFINITE
to avoid "lowerbound" or "upperbound" appearing in it, but I'm not sure that
would be any better.

This patch fixes rare inconsistencies between the first move of
the last PV output and the bestmove played. It also makes sure
that all the latest statistics are sent to the GUI (not only nodes
and time but also nps, tbhits, hashfull).

No functional change.

src/search.cpp

index eb80d177e4c77903cfa06bb40b4fba13babdf396..19749b6413163e4e1966d513c0043db4d2090f50 100644 (file)
@@ -461,11 +461,7 @@ void Thread::search() {
           if (!mainThread)
               continue;
 
-          if (Signals.stop)
-              sync_cout << "info nodes " << Threads.nodes_searched()
-                        << " time " << Time.elapsed() << sync_endl;
-
-          else if (PVIdx + 1 == multiPV || Time.elapsed() > 3000)
+          if (Signals.stop || PVIdx + 1 == multiPV || Time.elapsed() > 3000)
               sync_cout << UCI::pv(rootPos, rootDepth, alpha, beta) << sync_endl;
       }