The Mrbdzz Novelty Grinder!

April 2, 2024 Matthew Sadler 2 comments

Leela’s wonderful new WDL Contempt feature – discussed in earlier posts and also in a series of videos on my Silicon Road YouTube channel ( – continues to inspire new avenues of chess investigation. One event that created a stir was the fascinating David Navara – Leela match at knight odds on which I commentated here: I’ll most likely dedicate some blog space to that match in the future, but this blog post focuses on a lovely little programming project by grizzled veteran TCEC chatter mrbdzz who many of you will know from my streams as “Leela’s Greatest Fan”!

A while back we chatted about the ideal tooling for opening exploration by engines. We both agreed that the current available tooling (especially the commercial tools) is very limited and that someone should do something about it! I’m not a programmer so it was never going to be me 😉 so it’s cool that mrbdzz has started the ball rolling with this 0.1 dev version of his “Novelty Grinder”! It is freely downloadable from Since it’s a 0.1 dev version, it requires a tiny bit of tweaking to get things working on Windows. However, with just a bit of effort you have the makings of some really great opening tooling.

Note that this is really hot off the press – it was released just a couple of days ago! I haven’t tried all the different permutations, just tried to get it working on Windows as quickly as possible. There’ll probably be more tips and tricks coming in the next weeks!

The idea is to let an engine find novelties / unusual ideas in the opening for you in automated fashion. The way this happens is described by mrbdzz in his introduction (with a few comments added by me here):

Novelty Grinder is a tool to find potential surprise moves. This is done by analyzing games (or lines) as follows:

A position is analyzed with an engine for candidate moves

Leela works “out of the box” in this version, though you could adjust things to point to another engine.

A game database is queried for popular moves

The Lichess database is used in this case to see which engine suggestions are the most popular (we’re not interested in those of course – we only want the sexy stuff!)

Popular moves are removed from the candidate moves set

The remaining candidate moves are the potential surprise moves

A pgn file is then produced with annotations.

Arrows are added in the PGN annotation for visualization. Red arrow = novelty; green arrow = unpopular engine suggestion.

The cool thing of course is combining this powerful mechanism with “Contemptla” (Leela with WDL Contempt) to generate crazy ideas!

The output pgn file ends up looking like this:

The green arrows show unpopular moves and the red ones are novelties (in the Lichess database) And all that within a few seconds!

In the next paragraphs, I’m going to explain how I got this working on Windows as mrbdzz shared this as a Linux tool. However, the beauty of Python – the programming language used by mrbdzz – is that it works on anything and everything. Even a rather uncertain user like myself can fiddle around to get things working!

I am assuming in all this that you already have a working Leela and Nibbler configuration. If not, take a look at my earlier blog posts to see how to do this!


The first thing you need is a working Python environment on your Windows machine. You can download everything you need from but the simplest is to go to the Microsoft Store and let Windows install Python for you. That way all the correct paths and variables for your system get configured automatically.

I am using 3.11 but I’m sure 3.12 would be fine too. Just click on Get and let Microsoft work its magic

Installing the required modules

Mrbdzz has used the python-chess and Berserk modules which are not in the standard Python download.

After installing python, you should be able to open up a command prompt on your Windows machine and install them through the pip package manager tool.

The command line Pip install python-chess berserk (asalso specified in the file provided by mrbdzz) will get you what you need!


Download the Novelty Grinder from The highlighted button will download the file for you.

Copy the file to a directory (I put mine into D:\NoveltyGrinder\src) and then navigate with your command prompt to that location.

The command line

The sample command line provided by mrbdzz is

./novelty-grinder –engine=/usr/local/bin/lc0 –nodes=100000 –eval-threshold=100 –arrows –first-move=4 –book-cutoff=40 input-games.pgn | tee annotated-games.pgn

This has a few Linux-specific things in it so we need to change that. First of all however, let’s hear from mrbdzz what the command actually does (with a few additions from me)

This command uses engine /usr/local/bin/lc0 to analyze the game:

100 kN per move, starting from move 4

That’s a good amount of analysis, particularly when using the Leela WDL Contempt feature

Moves less than 1% from the top move are considered candidate moves

Default popularity cutoff is used. That is, moves with at most 5% popularity are considered for surprises

Analysis is stopped when less than 40 games are in the database.

Obviously, you can tweak all these parameter values based on what you want to analyse. There are a couple of things that must be changed however to get things working on Windows.

The –engine path

This path obviously refers to a Linux location. In principle it should be perfectly possible to specify a Windows location, but every syntax I tried failed. In the end, I removed this option from the command line and added a default value to the appropriate section in



This equates to a Leela installation in C:\Users\gmmat\Leela\lc0.exe

Note that I also defined this Leela installation in Nibbler with appropriate contempt settings:

The engines.json path

There is one sneaky thing in it really does expect you to have a Nibbler installation! And you need to point to the appropriate path for your Nibbler engines.json file. It’s not too complicated:



As you can see, this ends up pointing the file to this standard location for the Nibbler configuration files:

If you need any help on the syntax of the path function in Python then this is one of many Internet articles:

The tee command

The last piped command tee annotated-games.pgn outputs Leela’s analysis to the annotated-games.pgn file. In Windows, it’s simpler just to use >> filename.

Putting it all together

So what do we get? Well this was the sample (Linux-friendly) command line from mrbdzz once again

./novelty-grinder –engine=/usr/local/bin/lc0 –nodes=100000 –eval-threshold=100 –arrows –first-move=4 –book-cutoff=40 input-games.pgn | tee annotated-games.pgn

This is the Windows-friendly one INCLUDING the necessary alterations to the file as detailed above

python –nodes=100000 –eval-threshold=100 –arrows –first-move=4 –book-cutoff=40 inputgame.pgn >> output2.pgn

As you can see, you execute python in Windows by putting python in front of the filename

The input was this simple pgn file

And the output was this:

Finally, mrbdzz has given his personal assurance – swearing solemnly on Leela’s name – that he will work day and night to add extra features! Follow his progress here:

2 Comments on “The Mrbdzz Novelty Grinder!

  1. I really like this idea – it feels very natural, making you wonder if seconds already prepare novelties using similar tools. Maybe part of the challenge is telling if a move has a new idea to it, vs merely a very slightly worse version of a popular move? As a relatively bad chess player who hasn’t played around with Leela contempt or anything, no clue, but it looks interesting. It would be cool to try this in a browser, either in its own page or through Lichess somehow (bot?).

    1. Thanks! Yes it’s a lovely idea! I’d discussed it quite a few times in the TCEC chat with mrbdzz so I’m really glad he decided to take on the programming himself and go for it! I wouldn’t think that anyone is using anything like this (yet!) but it may change. Tbh, if I was an elite player, I would have hired in a programmer to do something like this for me but I don’t have the impression that anyone has done that… Best Wishes, Matthew

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.