1
0
Fork 0
mirror of https://github.com/sockspls/badfish synced 2025-07-11 19:49:14 +00:00

Send again all the PV lines in multiPV searching

Partially revert 1036cadcec because UCI protocol
in case of multipv explicitly requires:

for the best move/pv add "multipv 1" in the string when you send the pv.
in k-best mode always send all k variants in k strings together.

Thanks to Justin Blanchard for pointing this out.

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This commit is contained in:
Marco Costalba 2011-10-08 09:25:38 +01:00
parent 325dedc7da
commit a3bf09c5c9

View file

@ -584,16 +584,27 @@ namespace {
break; break;
// Send full PV info to GUI if we are going to leave the loop or // Send full PV info to GUI if we are going to leave the loop or
// if we have a fail high/low and we are deep in the search. // if we have a fail high/low and we are deep in the search. Note
if ((value > alpha && value < beta) || current_search_time() > 2000) // that UCI protol requires to send all the PV lines also if are
for (int i = 0; i < Min(UCIMultiPV, MultiPVIteration + 1); i++) // still to be searched and so refer to the previous search's score.
if ((value > alpha && value < beta) || current_search_time() > 5000)
for (int i = 0; i < Min(UCIMultiPV, (int)Rml.size()); i++)
{
bool updated = (i <= MultiPVIteration);
if (depth == 1 && !updated)
continue;
Depth d = (updated ? depth : depth - 1) * ONE_PLY;
Value s = (updated ? Rml[i].score : Rml[i].prevScore);
cout << "info" cout << "info"
<< depth_to_uci(depth * ONE_PLY) << depth_to_uci(d)
<< (i == MultiPVIteration ? score_to_uci(Rml[i].score, alpha, beta) : << (i == MultiPVIteration ? score_to_uci(s, alpha, beta) : score_to_uci(s))
score_to_uci(Rml[i].score))
<< speed_to_uci(pos.nodes_searched()) << speed_to_uci(pos.nodes_searched())
<< pv_to_uci(&Rml[i].pv[0], i + 1, pos.is_chess960()) << pv_to_uci(&Rml[i].pv[0], i + 1, pos.is_chess960())
<< endl; << endl;
}
// In case of failing high/low increase aspiration window and research, // In case of failing high/low increase aspiration window and research,
// otherwise exit the fail high/low loop. // otherwise exit the fail high/low loop.