Why?

I edited the open-source Stockfish engine to set new defaults for the UCI settings. I did this for a few reasons:

  • I run stockfish on a raspberry pi cluster which has some potentially unique requirements.
  • I have done performance tests so I have an idea of what the default settings should be, and it is not what ships with Stockfish.
  • When connecting to the remote cluster, I want to always use specific settings, without having to change them.

New Defaults

By updating the defaults, I am still able to change these to any valid value when using Stockfish using the setoption command. Or most chess software programs will do this through their UI.

I wanted my defaults to be:

SettingStandardMy Default
Threads17
Hash16256

This is very specific to my setup. I wouldn’t recommend everyone change this.

Updating Stockfish

Changing the settings is a fairly easy process.

I just edit the file with this:

vi ucioptions.cpp

And I just changed these two lines:

  o["Threads"]               << Option(7, 1, 512, on_threads);
  o["Hash"]                  << Option(256, 1, MaxHashMB, on_hash_size);

It is basically just replacing 1 with 7 for Threads and 16 with 256 for Hash.

Rebuild

Once the change is done, you can just build stockfish again and make sure it is deployed to all the nodes of your cluster. See my build stockfish post for details on how to do that.

Caution

The biggest downside of modifying the default stockfish is that whenever there is an update, you need to make your change again. Using git this is not that complicated, but something to keep in mind.