Andrew wrote:
I intend to write a nice KDE GTP 2 client, which everybody will be able to use to debug their own engines. In such a situation, I can clearly see that my application will want to say: "requires the standard GTP debug subset".
And IMHO an experimental Go engine definitely does need debug commands. Perhaps I am not making myself clear: this is not to debug programming errors, this is actually to debug/optimize/fine-tune the engine's algorithm.
Actually, the primary thought behind including showboard is that it should come in handy when debugging gtp communication problems.
The kind of commands you want may be better to call diagnostic, or something like that.
So why not include such commands in the standard?
That's not unreasonable, but I'm somewhat doubtful that different engines have sufficiently similar internals for it to be meaningful. Also, as Don pointed out, this is not the right time to add such commands.
Still I would encourage you to do experiments with a GUI and multiple engines to find out how well diagnostic commands work in practice. This may well be stuff for a future extension of the protocol.
OK, but now I have another question: I have noticed that in response to the showboard command, GNU Go sends its output to stderr, not to stdout!!!
Wallyplus outputs the board to stdout.
I had earlier understood that the standard specified that the showboard command would cause the engine to output the board to stdout, in the normal response stream.
What is the correct behaviour?? Output to stderr or stdout?
The simple answer is that in GTP version 2 stdout is correct. The original GNU Go implementation was to output to stderr, mainly because that was easiest to implement, but also because it sufficed for our purposes. If you are observant you may notice that if stderr and stdout are merged, the output is not syntactically correct, but on stdout the output is a correct empty response. Current GNU Go development versions still use GTP version 1, but this will change before 3.4.
The somewhat more complex answer is that the output should be over the GTP communication channel, but it's up to the program whether it communicates through stdout, stderr, a socket, or whatever. For a typical unix program, though, using stdin/stdout would usually make most sense.
/Gunnar