diff --git a/cpp/command/gtp.cpp b/cpp/command/gtp.cpp index 933c3b766..9b9c1465f 100644 --- a/cpp/command/gtp.cpp +++ b/cpp/command/gtp.cpp @@ -826,6 +826,12 @@ struct GTPEngine { } const Board board = search->getRootBoard(); + + int totalVisits = 0; + for(int i = 0; i 0) out << " "; @@ -849,6 +855,7 @@ struct GTPEngine { out << "info"; out << " move " << Location::toString(data.move,board); out << " visits " << data.numVisits; + out << " totalVisits " << totalVisits; out << " utility " << utility; out << " winrate " << winrate; // We report lead for scoreMean here so that a bunch of legacy tools that use KataGo use lead instead, which diff --git a/docs/GTP_Extensions.md b/docs/GTP_Extensions.md index d8fd3ae9e..58cc194df 100644 --- a/docs/GTP_Extensions.md +++ b/docs/GTP_Extensions.md @@ -115,11 +115,12 @@ In addition to a basic set of [GTP commands](https://www.lysator.liu.se/~gunnar/ * `pvVisits true` - Output the number of visits spent in the position after each move in each principal variation. * `pvEdgeVisits true` - Output the number of visits spent following each move in each principal variation. * Output format: - * Outputted lines look like `info move E4 visits 487 utility -0.0408357 winrate 0.480018 scoreMean -0.611848 scoreStdev 24.7058 scoreLead -0.611848 scoreSelfplay -0.515178 prior 0.221121 lcb 0.477221 utilityLcb -0.0486664 order 0 pv E4 E3 F3 D3 F4 P4 P3 O3 Q3 O4 K3 Q6 S6 E16 E17 info move P16 visits 470 utility -0.0414945 winrate 0.479712 scoreMean -0.63075 scoreStdev 24.7179 scoreLead -0.63075 scoreSelfplay -0.5221 prior 0.220566 lcb 0.47657 utilityLcb -0.0502929 order 1 pv P16 P17 O17 Q17 O16 E17 H17 D15 C15 D14 C13 D13 C12 D12 info move E16 visits 143 utility -0.0534071 winrate 0.474509 scoreMean -0.729858 scoreStdev 24.7991 scoreLead -0.729858 scoreSelfplay -0.735747 prior 0.104652 lcb 0.470674 utilityLcb -0.0641425 order 2 pv E16 P4 P3 O3 Q3 O4 E3 H3 D5 C5` + * Outputted lines look like `info move E4 visits 487 totalVisits 1024 utility -0.0408357 winrate 0.480018 scoreMean -0.611848 scoreStdev 24.7058 scoreLead -0.611848 scoreSelfplay -0.515178 prior 0.221121 lcb 0.477221 utilityLcb -0.0486664 order 0 pv E4 E3 F3 D3 F4 P4 P3 O3 Q3 O4 K3 Q6 S6 E16 E17 info move P16 visits 470 utility -0.0414945 winrate 0.479712 scoreMean -0.63075 scoreStdev 24.7179 scoreLead -0.63075 scoreSelfplay -0.5221 prior 0.220566 lcb 0.47657 utilityLcb -0.0502929 order 1 pv P16 P17 O17 Q17 O16 E17 H17 D15 C15 D14 C13 D13 C12 D12 info move E16 visits 143 utility -0.0534071 winrate 0.474509 scoreMean -0.729858 scoreStdev 24.7991 scoreLead -0.729858 scoreSelfplay -0.735747 prior 0.104652 lcb 0.470674 utilityLcb -0.0641425 order 2 pv E16 P4 P3 O3 Q3 O4 E3 H3 D5 C5` * `info` - Indicates the start of information for a new possible move, followed by key-value pairs. Current key-value pairs: * **NOTE: Consumers of this data should attempt to be robust to the order of these fields, as well as to possible addition of new fields in the future.** * `move` - The move being analyzed. * `visits` - The number of visits invested into the move so far. + * `totalVisits` - The number of total visits of all the moves so far. The `totalVisits` sums up all the `visits` value of all the moves in the current output. * `winrate` - The winrate of the move so far, as a float in [0,1]. * `scoreMean` - Same as scoreLead. "Mean" is a slight misnomer, but this field exists to preserve compatibility with existing tools. * `scoreStdev` - The predicted standard deviation of the final score of the game after this move, in points. (NOTE: due to the mechanics of MCTS, this value will be **significantly biased high** currently, although it can still be informative as a *relative* indicator).