Ras wrote: ↑Thu May 21, 2020 11:03 am
hgm wrote: ↑Thu May 21, 2020 10:15 amThe only valid way to leave analyze mode is through the 'exit' command.
Which has a similar problem because the engine has to actively suppress that feature by announcing "analysis=0". Which many engines don't do. The only reliable way to figure that out is to try it and see whether it works
The 'exit' command will in practice always work when the 'analyze' command works; testing it the way you suggest is as silly as testing whether the 'stop' command works in a UCI engine. Whether the 'analyze' command works doesn't require testing of the kind you propose; you would just have to send the command, and the engine will refuse it with an error message if it did not support it.
And though your correction on "?" is true, the only way to reliably determine whether this works is still through trial & error feature detection.
The question, however, is: why would you ever want to determine that? What are you going to do with that information, even if you managed to obtain it? It seems the best you can do is to gray out the 'Move now' menu item on the GUI, or perhaps not display it at all. Which will invariably lead to users blaming the GUI for it. "Your GUI is buggy, the move-now is greyed out while the engine is thinking!"
Much better to leave the item operational, and when the user operates it, and the engine doesn't respond in a reasonable time, throw up a popup that says "this engine seems to be stuck". Then people will know where the fault lies, and complain to the right developer.
Same with analysis. If a CECP v2 engine has not announced feature analyze=0 at startup, you can assume it supports analysis. Assuming by default that things will not work according to specs is just paranoia. And even if it is non-compliant, and refuses the 'analyze' command when it was really needed, this can show an error popup "This engine does not support analysis, even though it said it did". That leaves no doubt about the fact that it is an engine bug.
There is no limit to how crappy and non-compliant engines can be. Should the GUI test an engine for every conceivable malfunction when you first register it? I think the time this takes would just annoy the user.