]> git.sesse.net Git - stockfish/commitdiff
Move sending of PV line to id_loop()
authorMarco Costalba <mcostalba@gmail.com>
Fri, 11 Feb 2011 05:20:16 +0000 (06:20 +0100)
committerMarco Costalba <mcostalba@gmail.com>
Fri, 11 Feb 2011 05:28:55 +0000 (06:28 +0100)
No functional change apart form move reordering because
pv_info_to_uci() performs a do / undo_move sequence.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
src/search.cpp

index fba9e53559f5b883f0cd479923ac2abe7a88ab78..1cd7eefc14852d5c24146677476bf4ed7fa30d79 100644 (file)
@@ -671,10 +671,13 @@ namespace {
             // Search starting from ss+1 to allow calling update_gains()
             value = search<PV, false, true>(pos, ss+1, alpha, beta, depth, 0);
 
             // Search starting from ss+1 to allow calling update_gains()
             value = search<PV, false, true>(pos, ss+1, alpha, beta, depth, 0);
 
-            // Write PV lines to transposition table, in case the relevant entries
-            // have been overwritten during the search.
+            // Send PV line to GUI and write to transposition table in case the
+            // relevant entries have been overwritten during the search.
             for (int i = 0; i < Min(MultiPV, (int)Rml.size()); i++)
             for (int i = 0; i < Min(MultiPV, (int)Rml.size()); i++)
+            {
+                cout << Rml[i].pv_info_to_uci(pos, depth, alpha, beta, i) << endl;
                 Rml[i].insert_pv_in_tt(pos);
                 Rml[i].insert_pv_in_tt(pos);
+            }
 
             // Value cannot be trusted. Break out immediately!
             if (StopRequest)
 
             // Value cannot be trusted. Break out immediately!
             if (StopRequest)
@@ -1263,13 +1266,8 @@ split_point_start: // At split points actual search starts from here
               if (!isPvMove && MultiPV == 1)
                   Rml.bestMoveChanges++;
 
               if (!isPvMove && MultiPV == 1)
                   Rml.bestMoveChanges++;
 
-              // Inform GUI that PV has changed, in case of multi-pv UCI protocol
-              // requires we send all the PV lines properly sorted.
               Rml.sort_multipv(moveCount);
 
               Rml.sort_multipv(moveCount);
 
-              for (int j = 0; j < Min(MultiPV, (int)Rml.size()); j++)
-                  cout << Rml[j].pv_info_to_uci(pos, depth, alpha, beta, j) << endl;
-
               // Update alpha. In multi-pv we don't use aspiration window, so
               // set alpha equal to minimum score among the PV lines.
               if (MultiPV > 1)
               // Update alpha. In multi-pv we don't use aspiration window, so
               // set alpha equal to minimum score among the PV lines.
               if (MultiPV > 1)