UCI Protocol

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

dbxuau
Posts: 48
Joined: Wed Apr 11, 2012 2:16 am

UCI Protocol

Post by dbxuau »

Why is there no possible way to recall current engine parameters. We can set them with setname option value etc but there is no way to read out what the settings are. Did I miss the technicality?
elcabesa
Posts: 855
Joined: Sun May 23, 2010 1:32 pm

Re: UCI Protocol

Post by elcabesa »

I don't think it's possible
ZirconiumX
Posts: 1334
Joined: Sun Jul 17, 2011 11:14 am

Re: UCI Protocol

Post by ZirconiumX »

dbxuau wrote:Why is there no possible way to recall current engine parameters. We can set them with setname option value etc but there is no way to read out what the settings are. Did I miss the technicality?
In UCI, everything that can be delegated to the GUI is delegated to the GUI. So the GUI's supposed to remember what it set everything to.

Matthew:out
Some believe in the almighty dollar.

I believe in the almighty printf statement.
Aleks Peshkov
Posts: 892
Joined: Sun Nov 19, 2006 9:16 pm
Location: Russia

Re: UCI Protocol

Post by Aleks Peshkov »

My program displays current settings in response to 'uci' command.
I thought it was obvious implementation.
User avatar
lucasart
Posts: 3232
Joined: Mon May 31, 2010 1:29 pm
Full name: lucasart

Re: UCI Protocol

Post by lucasart »

Aleks Peshkov wrote:My program displays current settings in response to 'uci' command.
I thought it was obvious implementation.
me too.
Theory and practice sometimes clash. And when that happens, theory loses. Every single time.
mjlef
Posts: 1494
Joined: Thu Mar 30, 2006 2:08 pm

Re: UCI Protocol

Post by mjlef »

dbxuau wrote:Why is there no possible way to recall current engine parameters. We can set them with setname option value etc but there is no way to read out what the settings are. Did I miss the technicality?
Sure you can. Just send the engine the "uci" command again and it will display the current parameter names, values and allowed ranges.
User avatar
Daniel Mehrmann
Posts: 858
Joined: Wed Mar 08, 2006 9:24 pm
Location: Germany
Full name: Daniel Mehrmann

Re: UCI Protocol

Post by Daniel Mehrmann »

I don't understand your problem. First you sending all your paramater to the GUI after the "UCI" keyword.
After that the GUI will send you each single parameter change if the user or the GUI change something. So, you know always each state of your options.
dbxuau
Posts: 48
Joined: Wed Apr 11, 2012 2:16 am

Re: UCI Protocol

Post by dbxuau »

Take stockfish for example, i do a "setoption name Hash value 1024". I then query "uci". It responds with default values. There is no confirmation nor response to my input at all. Is this inherent only to stockfish?
User avatar
hgm
Posts: 27808
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: UCI Protocol

Post by hgm »

The UCI specs state that "uci" will only be sent once, at engine startup. So in principle engines can do whatever they want when the receive it a second time, without violating the specs. There actually is a vague phrase in the UCI specs that you should ignore commands that are not supposed to come. This is likely only intended for spurious 'stop' commands (which cannot be avoided due to a race condition, where the engine can spontaneously produce a move just when the user presses 'move now' in the GUI).

As other posters remarked, there should never be any reason to read out the current settings. The engine reports its initial (default) settings, and you know which setoption commands you have sent it since then.

Code: Select all

* uci
	tell engine to use the uci (universal chess interface),
	this will be send once as a first command after program boot
	to tell the engine to switch to uci mode.
	After receiving the uci command the engine must identify itself with the "id" command
	and sent the "option" commands to tell the GUI which engine settings the engine supports if any.
	After that the engine should sent "uciok" to acknowledge the uci mode.
	If no uciok is sent within a certain time period, the engine task will be killed by the GUI.

Code: Select all

* if the engine receives a command which is not supposed to come, for example "stop" when the engine is
  not calculating, it should also just ignore it.
mcostalba
Posts: 2684
Joined: Sat Jun 14, 2008 9:17 pm

Re: UCI Protocol

Post by mcostalba »

dbxuau wrote:Take stockfish for example, i do a "setoption name Hash value 1024". I then query "uci". It responds with default values. There is no confirmation nor response to my input at all. Is this inherent only to stockfish?
It is inherent to UCI protocl

http://wbec-ridderkerk.nl/html/UCIProtocol.html

Maybe reading it would help (it takes 10 minutes).

Changing the semantic of uci command (as any other command) according to the number of times it is sent is tricky and ugly.

The correct solution (like it or not) is the intended one: it is up to the GUI to keep track of current parameters values.