From: Marco Costalba Date: Fri, 11 Feb 2011 05:20:16 +0000 (+0100) Subject: Move sending of PV line to id_loop() X-Git-Url: https://git.sesse.net/?p=stockfish;a=commitdiff_plain;h=c006435bb4b93aa15ea904da50070f360e365291;ds=sidebyside Move sending of PV line to id_loop() No functional change apart form move reordering because pv_info_to_uci() performs a do / undo_move sequence. Signed-off-by: Marco Costalba --- diff --git a/src/search.cpp b/src/search.cpp index fba9e535..1cd7eefc 100644 --- a/src/search.cpp +++ b/src/search.cpp @@ -671,10 +671,13 @@ namespace { // Search starting from ss+1 to allow calling update_gains() value = search(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++) + { + cout << Rml[i].pv_info_to_uci(pos, depth, alpha, beta, i) << endl; Rml[i].insert_pv_in_tt(pos); + } // 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++; - // 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); - 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)