Extract ponder move and check it against PV#997
Extract ponder move and check it against PV#997robertnurnberg wants to merge 1 commit intoDisservin:masterfrom
Conversation
|
Ok, so latest IMO the standard for all uci engines should be that bestmove and ponder move match the final PV. Here is what https://backscattering.de/chess/uci/#engine-bestmove has to say about this: So arguably the last point means that the GUI should be informed about the ponder move in the final info command. For example, thinking about chess tournaments, I believe it is nice to give the viewer the full information: i.e. what opponent move the engine would ponder on. If engines would like to give the "true" search pv (say of length 1 after a fail high/low) to the user as well, they can do so in the penultimate info command, for example. |
|
SF always tries to provide a ponder move, even if the PV lengths is just 1. This makes sense, i.e. ensure you have something to ponder about even if you have no PV yet (otherwise you can't use the time given to you in the 'pondering window'). |
|
Right. And if SF does fetch a ponder move from TT, it lengthens the PV with it and outputs the longer PV to the gui. Which is as it should be imo. The fact that length 1 or length 2 PVs show some uncertainty of the engine is usually well understood by users. Similarly to the very end of PVs usually being somewhat unreliable. |
|
actually I think that would be a change of behavior, at least when we last updated the cluster branch, we made sure that the PV was shown before that extension, so that the extension was immaterial? At least, IIRC. |
|
Yes, it's part of the changes in official-stockfish/Stockfish#6679. I don't think there's a reason to withhold information from the gui. If the engine thinks the move is good enough to ponder on, we might as well send it to the user. The UCI protocol should not have to concern itself with a/b engine semantics, imo. |
|
I don't think that's quite correct, or at least it might lead to confusion. What if for example the PV + pondermove happens to be a mate position or a 3-fold, but the eval is not yet consistent. |
|
If the ponder move leads to a checkmate then bestmove should ideally have |
|
still not 100% sure that the SF change is good. However, probably best to split this question in two parts. The first one for fastchess, and I would say if there is a PV that contains at least 2 moves, it is reasonable to verify that the pondermove and the 2nd PV move match. If there is not a second PV move that check is not done. I'm not 100% sure this check is correct (or I could imagine an engine coming up with a different scheme for whatever reason). The other question is for SF, i.e. if adding the pondermove to the PV if the PV is only 1 move long. Here I have rather strong reservations. But that we can discuss elsewhere. |
|
Agreed. I have amended the PR to make the contentious warning for ponder move vs. PV of length 1 optional. Latest push causes CI to fail, but this looks unrelated to the PR? Maybe something @Disservin can look into? |
|
Example run of Example run of |
|
Thanks for fixing the CI issue by doing a manual re-run. I have moved the separate discussion to official-stockfish/Stockfish#6725. |
This PR allows the extraction of a ponder move if it is present on the bestmove output line. On successful extraction, the ponder move is checked against the second move of the last PV output (if that was for an exact score).
If the new fhe flag
-warn-ponder-pv-shortis passed, then fastchess also warns if the engine emits a ponder move alongside a PV of length 1.No legality check is performed explicitly, but an illegal ponder move would always raise a warning, as either the PV move itself was illegal (master flags this already), or the ponder move does not match the PV.
We also add some test cases and extend the dummy engine for this purpose.