I use Arena, and one of its features is to control how much hash memory is used by the engine when it loads. This value can be controlled via the engine configuration, but if the global UCI setting is enabled, you can't override it.
The global value is configured by selecting Engines/Manage from the top menu, then select the UCI tab. There is a check box "Common hashtable size" when an option to set the maximum size. I use 16384 on my system.
This presents a problem to the engine developer. What do you do if the value requested by the "overlord" exceeds the maximum hash size supported by the engine? Unless the developer considers this, the results may vary. I found that most engines will use their default size in this situation.
I think a better way to implement the hash size request is to compare the requested value with the maximum value allowed by your engine, and if the request is larger, set the hash size to the maximum the engine allows. This is the behavior I expect.
Of course, most modern (Stockfish clones especially) don't have this issue since the maximum allowable hashsize is way beyond what most machine have.
I am not sure if this is specified in the UCI interface or not.
Vince
UCI Hash setting and engine behavior
Moderator: Ras
-
- Posts: 396
- Joined: Sat Feb 04, 2017 11:57 pm
- Location: USA
UCI Hash setting and engine behavior
i7-6700K @ 4.00Ghz 32Gb, Win 10 Home, EGTBs on PCI SSD
Benchmark: Stockfish15.1 NNUE x64 bmi2 (nps): 1277K
Benchmark: Stockfish15.1 NNUE x64 bmi2 (nps): 1277K
-
- Posts: 28353
- Joined: Fri Mar 10, 2006 10:06 am
- Location: Amsterdam
- Full name: H G Muller
Re: UCI Hash setting and engine behavior
For each option the engine can specify the maximum setting. A GUI should not request more than that. Not sure whether UCI2WB respects the max; I will check that.
It seems to me that it is up to the engine to decide how it will use the allowed memory. Leaving it idle is just one particular kind of use it could make of it.
It seems to me that it is up to the engine to decide how it will use the allowed memory. Leaving it idle is just one particular kind of use it could make of it.
-
- Posts: 2696
- Joined: Tue Aug 30, 2016 8:19 pm
- Full name: Rasmus Althoff
Re: UCI Hash setting and engine behavior
This is a GUI bug because the engine does announce the valid range to the GUI, and Arena should clip the values. UCI specifies that the engine should ignore invalid commands, and out of range parameters make the command invalid. So, refusing to act on the command and by consequence, sticking with the default value is the expected behaviour. I don't follow this, but range-check and clip all input values anyway.
Rasmus Althoff
https://www.ct800.net
https://www.ct800.net
-
- Posts: 28353
- Joined: Fri Mar 10, 2006 10:06 am
- Location: Amsterdam
- Full name: H G Muller
Re: UCI Hash setting and engine behavior
In CECP the memory comand specifies a maximum, and since my engines require a power-of-2 hash size, they even must clip values that aren't above their own max. I implement this by starting with the max power-of-2 they can handle, and divide it by 2 unitil it no longer exceeds the input value. I recommend UCI engines should do the same.