Sending pure comments using UCI protocol

Discussion of chess software programming and technical issues.

Moderators: bob, hgm, Harvey Williamson

Forum rules
This textbox is used to restore diagrams posted with the [d] tag before the upgrade.
Post Reply
User avatar
xr_a_y
Posts: 764
Joined: Sat Nov 25, 2017 1:28 pm
Location: France

Sending pure comments using UCI protocol

Post by xr_a_y » Wed Aug 21, 2019 9:54 am

To send things that won't be read by the GUI in xboard protocol, the # sign is used at the beginning of the line.
(not read is a bit false as some key word are still parsed by some GUI, like the word "error" for example in winboard itself, anyway).

What is the syntax in UCI protocol ? It seems to me that the paradigm is in a way reversed and only lines starting with some known words to the GUI will be read (for instance "info" strings). So it seems I can also send comments starting with the # sign when using UCI protocol ? Am I correct ?

Because I am a little scared by the following specification
* if the engine or the GUI receives an unknown command or token it should just ignore it and try to parse the rest of the string.
"unknown command" refers to a full line ? or just a word ?
"string" refers to the rest of the stream or the next word in the line ?

Joost Buijs
Posts: 986
Joined: Thu Jul 16, 2009 8:47 am
Location: Almere, The Netherlands

Re: Sending pure comments using UCI protocol

Post by Joost Buijs » Wed Aug 21, 2019 12:35 pm

xr_a_y wrote:
Wed Aug 21, 2019 9:54 am
To send things that won't be read by the GUI in xboard protocol, the # sign is used at the beginning of the line.
(not read is a bit false as some key word are still parsed by some GUI, like the word "error" for example in winboard itself, anyway).

What is the syntax in UCI protocol ? It seems to me that the paradigm is in a way reversed and only lines starting with some known words to the GUI will be read (for instance "info" strings). So it seems I can also send comments starting with the # sign when using UCI protocol ? Am I correct ?

Because I am a little scared by the following specification
* if the engine or the GUI receives an unknown command or token it should just ignore it and try to parse the rest of the string.
"unknown command" refers to a full line ? or just a word ?
"string" refers to the rest of the stream or the next word in the line ?
If you want to send comments the UCI specification says you first have to send "info string" and after this the comment e.g. "info string comment". At least that is what I do, and I never saw any adversary effect of it.

Ras
Posts: 1159
Joined: Tue Aug 30, 2016 6:19 pm
Contact:

Re: Sending pure comments using UCI protocol

Post by Ras » Wed Aug 21, 2019 2:35 pm

xr_a_y wrote:
Wed Aug 21, 2019 9:54 am
Because I am a little scared by the following specification
* if the engine or the GUI receives an unknown command or token it should just ignore it and try to parse the rest of the string.
"unknown command" refers to a full line ? or just a word ?
The very next line in the UCI spec holds the answer:
Examples: "joho debug on\n" should switch the debug mode on given that joho is not defined, "debug joho on\n" will be undefined however.
A strict implementation will continue to parse after the # sign.
Rasmus Althoff
https://www.ct800.net

User avatar
xr_a_y
Posts: 764
Joined: Sat Nov 25, 2017 1:28 pm
Location: France

Re: Sending pure comments using UCI protocol

Post by xr_a_y » Wed Aug 21, 2019 6:00 pm

Thanks got it.

User avatar
hgm
Posts: 23718
Joined: Fri Mar 10, 2006 9:06 am
Location: Amsterdam
Full name: H G Muller
Contact:

Re: Sending pure comments using UCI protocol

Post by hgm » Wed Aug 21, 2019 6:17 pm

My guess is that you could simply use "info <message>", provided the message would not contain any keywords.

WinBoard + UCI2WB would interpret 'info string <message>' as something that should be presented to the user in the engine Output window

User avatar
xr_a_y
Posts: 764
Joined: Sat Nov 25, 2017 1:28 pm
Location: France

Re: Sending pure comments using UCI protocol

Post by xr_a_y » Thu Aug 22, 2019 5:11 am

Ok. So this is not so clear in fact...

Maybe a

info comments ....

sequence could be helpful in the protocol ?

Ras
Posts: 1159
Joined: Tue Aug 30, 2016 6:19 pm
Contact:

Re: Sending pure comments using UCI protocol

Post by Ras » Thu Aug 22, 2019 5:11 pm

xr_a_y wrote:
Thu Aug 22, 2019 5:11 am
Maybe a

info comments ....

sequence could be helpful in the protocol ?
The "info string" sequence already allows any free form comments. If the issue is that the GUI shall not evaluate the strings in any way, the easiest solution would be not to send them. Extending UCI is pretty much out of question because one of the reasons for its success is that it hasn't been extended over and over.
Rasmus Althoff
https://www.ct800.net

User avatar
hgm
Posts: 23718
Joined: Fri Mar 10, 2006 9:06 am
Location: Amsterdam
Full name: H G Muller
Contact:

Re: Sending pure comments using UCI protocol

Post by hgm » Thu Aug 22, 2019 9:43 pm

But the problem is that 'info string' is used both for messages you want to communicate to the user, as for extra output that is given in response to the 'debug' option being 'on' (and which you would likely want to appear only in some log).

Ras
Posts: 1159
Joined: Tue Aug 30, 2016 6:19 pm
Contact:

Re: Sending pure comments using UCI protocol

Post by Ras » Fri Aug 23, 2019 1:38 pm

hgm wrote:
Thu Aug 22, 2019 9:43 pm
But the problem is that 'info string' is used both for messages you want to communicate to the user, as for extra output that is given in response to the 'debug' option being 'on' (and which you would likely want to appear only in some log).
IMHO, this is a feature, not a problem. If a user encounters an issue that the dev can't readily reproduce, which is about the only scenario where a regular user would even use the engine with "debug on", then copy/pasting that from the GUI's message/info area into an email for the bug report is something most users will be able to do. Using a log file, finding it, and putting that as attachment into an email - probably not so much.
Rasmus Althoff
https://www.ct800.net

User avatar
hgm
Posts: 23718
Joined: Fri Mar 10, 2006 9:06 am
Location: Amsterdam
Full name: H G Muller
Contact:

Re: Sending pure comments using UCI protocol

Post by hgm » Fri Aug 23, 2019 5:45 pm

Perhaps you are right. That reminds me that UCI2WB doesn't support the UCI 'debug' command. You can put it in debug mode through a command-line argument, but that only means it will report all communication with the engine to the GUI. Perhaps I should also make it run the engine in debug mode, in such a case.

Post Reply