setting engine options
Posted: 12 Aug 2008, 09:13
As the discussion in the WB protocol thread seems to focus on developing new protocol for configuring the engine through the GUI interface, rather than on discussing the extended / clarified protocol as I posted (and implemented in WinBoard 4.3.14), I decided to create a new thread for it.
The situation we were slowly converging on was something like this:
There will be a distinction between standard options, which describe properties and limitations of the system we are running on. This includes information on were we put standard files like books and end-game tables, and maximum allowed resource usage, like memory size and number of cores.
The second type of options are those specific to the engine, like playing style, and even if other engines have such an option as well, the allowed values for the option will vary from engine to engine. To WinBoard such engines mean nothing; it will merely act as a passive medium to pass along the options and their settings btween engine and user.
For standard options the engine will merely have to tell WinBoard if it understands them (or not). In WB protocol the 'feature' command is used for such things, and I see no reason to change that. So the engine can send things like
feature egt="nalimov,scorpio"
feature book=1
feature processors=4
feature memory=160
during the normal WB startup handshaking, and WinBoard would reply with
accepted egt
accepted book
accepted processors
accepted memory
(older versions, or other WB-compatible GUIs might of course send 'rejected' in stead of 'accepted', but this is not very interesting to the engine, and just means that it will not receive any commands for setting the correspondng options later on.)
The sequence above would tell WinBoard that the engine would accept the commands
processors N
memory M
to set the number of cores and the memory the engine will be allowed to use. For the cores, WinBoard will know that the maximum number of cores the engine can use is 4, so that WinBoard can relay this information to the user in the configuration dialog for this engine. It will not be considered an error, though, for the user to set a number of cores larger than this in the settings menu for standard options (as the other engine might support the larger number of cores), the value there is merely the maximum the engine can use. Likewise, the engine should not consider it an error when the 'processors' command passes a number larger than the specified maximum; it should simply use the maximum it does support in that case. We might have a menu item in the engine-specific configuration dialog that can limit the number of cores further.
For the memory option it works slightly differently; the number specified here is the engine default.
The feature egt enables the GUI->engine commands
egtpath nalimov PATHNAME
egtpath scorpio PATHNAME
which will always be sent if WinBoard is aware of the location of the respective end-game tables. It will also enable sending of the command
egtcache M
when the user requests this from the engine-specific configuration menu. Engines are allowed to ignore this command, if they want, as long as they do not exceed the total memory allocation specified in the 'memory' command.
Similarly, the feature book=1 will prompt WinBoard to send
bookpath PATHNAME
of an openingbook that the engine could use, provided it is aware of the existence of one.
The situation we were slowly converging on was something like this:
There will be a distinction between standard options, which describe properties and limitations of the system we are running on. This includes information on were we put standard files like books and end-game tables, and maximum allowed resource usage, like memory size and number of cores.
The second type of options are those specific to the engine, like playing style, and even if other engines have such an option as well, the allowed values for the option will vary from engine to engine. To WinBoard such engines mean nothing; it will merely act as a passive medium to pass along the options and their settings btween engine and user.
For standard options the engine will merely have to tell WinBoard if it understands them (or not). In WB protocol the 'feature' command is used for such things, and I see no reason to change that. So the engine can send things like
feature egt="nalimov,scorpio"
feature book=1
feature processors=4
feature memory=160
during the normal WB startup handshaking, and WinBoard would reply with
accepted egt
accepted book
accepted processors
accepted memory
(older versions, or other WB-compatible GUIs might of course send 'rejected' in stead of 'accepted', but this is not very interesting to the engine, and just means that it will not receive any commands for setting the correspondng options later on.)
The sequence above would tell WinBoard that the engine would accept the commands
processors N
memory M
to set the number of cores and the memory the engine will be allowed to use. For the cores, WinBoard will know that the maximum number of cores the engine can use is 4, so that WinBoard can relay this information to the user in the configuration dialog for this engine. It will not be considered an error, though, for the user to set a number of cores larger than this in the settings menu for standard options (as the other engine might support the larger number of cores), the value there is merely the maximum the engine can use. Likewise, the engine should not consider it an error when the 'processors' command passes a number larger than the specified maximum; it should simply use the maximum it does support in that case. We might have a menu item in the engine-specific configuration dialog that can limit the number of cores further.
For the memory option it works slightly differently; the number specified here is the engine default.
The feature egt enables the GUI->engine commands
egtpath nalimov PATHNAME
egtpath scorpio PATHNAME
which will always be sent if WinBoard is aware of the location of the respective end-game tables. It will also enable sending of the command
egtcache M
when the user requests this from the engine-specific configuration menu. Engines are allowed to ignore this command, if they want, as long as they do not exceed the total memory allocation specified in the 'memory' command.
Similarly, the feature book=1 will prompt WinBoard to send
bookpath PATHNAME
of an openingbook that the engine could use, provided it is aware of the existence of one.