I may guess the purpose of the option based on the meaning of the name (clear hash). I understand the GUI should show a button for that option too. However look like I missed the commands from GUI to order engines to do that task (clear hash tables).
Can someone explain to me how the option work? What happens when user clicks to “clear hash” button? What commands GUI should send to engines? What “standard” reactions by GUI when working with option type of button? Thanks.
https://banksiagui.com
The most features chess GUI, based on opensource Banksia - the chess tournament manager
I may guess the purpose of the option based on the meaning of the name (clear hash). I understand the GUI should show a button for that option too. However look like I missed the commands from GUI to order engines to do that task (clear hash tables).
Can someone explain to me how the option work? What happens when user clicks to “clear hash” button? What commands GUI should send to engines? What “standard” reactions by GUI when working with option type of button? Thanks.
You might be over thinking this. It works like any other UCI command the GUI sends to the engine. The GUI will send the command "setoption name Clear Hash" to the engine. The engine will reinitiate the hashtable by however method the programmer had decided when it receives the command.
In stockfish, when that that command is sent to the engine, it will call the the Search:clear() function, as if it was a new game. A user would click that button when they want the engine to start a with clean search when analyzing. Probably more used by programmers and hardcore computer chess enthusiasts than an average user.
I may guess the purpose of the option based on the meaning of the name (clear hash). I understand the GUI should show a button for that option too. However look like I missed the commands from GUI to order engines to do that task (clear hash tables).
Can someone explain to me how the option work? What happens when user clicks to “clear hash” button? What commands GUI should send to engines? What “standard” reactions by GUI when working with option type of button? Thanks.
You might be over thinking this. It works like any other UCI command the GUI sends to the engine. The GUI will send the command "setoption name Clear Hash" to the engine. The engine will reinitiate the hashtable by however method the programmer had decided when it receives the command.
In stockfish, when that that command is sent to the engine, it will call the the Search:clear() function, as if it was a new game. A user would click that button when they want the engine to start a with clean search when analyzing. Probably more used by programmers and hardcore computer chess enthusiasts than an average user.
Also, you might want to download the GUI Arena, Arena has a logging function that can be turned on . When it is turned on, it will record all the communication being sent between the GUI and the engine to a file. You should play around with that to see how the communication works between GUI and engine actually occurs - the commands being sent back and forth.
phhnguyen wrote: ↑Thu Jun 20, 2019 2:52 amCan someone explain to me how the option work? What happens when user clicks to “clear hash” button? What commands GUI should send to engines? What “standard” reactions by GUI when working with option type of button? Thanks.
So options of type 'button' are treated a bit different from other engine-defined options: when the buttons appearing in the engine-settings dialog are pressed this will send a 'setoption' command to the engine immediately, and that command will differ from 'setoption' commands for other types, in that it does not have a 'value' part. Changes in other option types will only be sent to the engine when you close the Engine Settings dialog through 'OK'.
'Clear Hash' is not a standard option, so UCI engines are not obliged to have it. So it might not be wise to implement features in a GUI that rely on it. OTOH, many engines are likely to have it, with exactly that name. So if a GUI would for instance have a mode to run EPD test suites, it might want to explicitly exercise the option before starting the new search, if the engine has it.
MikeB wrote:
You might be over thinking this. It works like any other UCI command the GUI sends to the engine. The GUI will send the command "setoption name Clear Hash" to the engine. The engine will reinitiate the hashtable by however method the programmer had decided when it receives the command.
Wow, thanks. You are right. Simpler than my thought (I thought being an option it should have some values to select and send).
BTW, "setoption name Clear Hash" is... no meaning (in term of logic and English), right?
MikeB wrote:
Also, you might want to download the GUI Arena, Arena has a logging function that can be turned on .
Thanks again but it is useless for me since I am in Mac world
https://banksiagui.com
The most features chess GUI, based on opensource Banksia - the chess tournament manager
phhnguyen wrote: ↑Thu Jun 20, 2019 2:52 amCan someone explain to me how the option work? What happens when user clicks to “clear hash” button? What commands GUI should send to engines? What “standard” reactions by GUI when working with option type of button? Thanks.
So options of type 'button' are treated a bit different from other engine-defined options: when the buttons appearing in the engine-settings dialog are pressed this will send a 'setoption' command to the engine immediately, and that command will differ from 'setoption' commands for other types, in that it does not have a 'value' part. Changes in other option types will only be sent to the engine when you close the Engine Settings dialog through 'OK'.
'Clear Hash' is not a standard option, so UCI engines are not obliged to have it. So it might not be wise to implement features in a GUI that rely on it. OTOH, many engines are likely to have it, with exactly that name. So if a GUI would for instance have a mode to run EPD test suites, it might want to explicitly exercise the option before starting the new search, if the engine has it.
Thanks HGM! I have never seen that button in xboard. Does it have when working with UCI engines?
https://banksiagui.com
The most features chess GUI, based on opensource Banksia - the chess tournament manager
hgm wrote: ↑Thu Jun 20, 2019 8:30 amSo options of type 'button' are treated a bit different from other engine-defined options: when the buttons appearing in the engine-settings dialog are pressed this will send a 'setoption' command to the engine immediately, and that command will differ from 'setoption' commands for other types, in that it does not have a 'value' part. Changes in other option types will only be sent to the engine when you close the Engine Settings dialog through 'OK'.
H.G.,
Is this immediate behavior defined in the standard? I opted to implement this just like any other option (viz. if the user has pressed the button during the lifetime of the dialog, the option will be send (and without value obviously)) when closing the dialog. Both the direct and delayed interpretation make some sort of sense, but I was not sure from reading the protocol description.
Aart
I don't think this is anything the standard would care about; this just defines what effect the commands have on the engine. The GUI designer has the freedom to use them as he says fit. There is also no requirement that the Engine Settings dialog should have an 'OK' button, or indeed that there should be a separate Engine Settings dialog at all.
As a user I would be surprised if buttons did not have an immediate effect, and I never considered the method you describe. But come to think of it, I am not sure it would ever make any observable difference, though. Perhaps if there was a button that toggled something in the engine. (But why would one not use a checkbox for that.)
hgm wrote: ↑Thu Jun 20, 2019 8:34 pmAs a user I would be surprised if buttons did not have an immediate effect, and I never considered the method you describe. But come to think of it, I am not sure it would ever make any observable difference, though. Perhaps if there was a button that toggled something in the engine. (But why would one not use a checkbox for that.)
Thanks for your thoughts.
For that reason, I found the button widget a bit "impure" compared to the others. Perhaps it would have been better to split the options setup (shown during a first setup dialog) from widgets like this (which could have been shown next to the chessboard during regular play). It generally does not make sense to clear the hash when the engine starts, but it makes sense to request clearing the hash after some games have been played, without affecting other options.