A new chess engine : m8

For more than a decade now, I’ve been programming chess engines as a hoby on and off. However I’ve not seriously worked on my current engine, MatMoi VII for almost two years now. But I’m thinking about comming back to computer chess programming.

If I do pick up chess programming again I will start over wrtiting an 8th iteration of my engine. I think it will be more enjoyable for me to work on a new code base than to work again on MatMoi with its flaws. For the last couples of weeks I’ve been thinking about what I could do differently in my next engine, m8 (read mate). I’ve isolated the following designs goals/ideas/principles that I will try to follow:


Keep it simple stupid. This is a principle I always try to follow while writing code, but I’ll make a special effeort to keep it in mind while writing m8. A chess engine usually contains lots of micro-optimizations that make the code less readable. In m8 I’ll make sure that each of those is really worth the increase in complexity.

2. Unit-testing and Assertions

I don’t plan on doing TDD or have 100% test coverage, but any test that can be automated will be. I also plan on heavily using assert throughout the code.

3. Testing

For a couples of years now the trend in computer chess programming is on testing everything with thousands of games. With m8 I plan on doing this early and also plan on building multiples tests utilities. There is three types of test I want to be able to perform early :

  1. Positions tests suits (EPD files);
  2. Rating tests where m8 plays hundreds or thousands of games against a couples of opponent in order to measure it’s strength;
  3. Rapid self play tests. Theses are less common. I want m8 to be able to play really fast self play games using differents sets of parameters. This functionality could be use to tests differents evaluation function against each others for example.

4. Parametrization

Everything that can be parameterized should be. Especially search and evaluation parameter. Also the user should be allowed to set theses parameter in a configuration file, on the command line or in the command line interface. The idea is to make it as easy as possible to test differents values for any parameters of the engine.

5. Open formats

If possible any files read or written by m8 should be in an open format. Things like the opening book should not be in binary format if possible (I say if possible because I’m not sure it would be efficient to have a plain text opening book). An opening book in text format can be read and modified by a human. If text format is not an option an open binary format should be used (Think SQLite).

6. Fisher Random Chess

I’ll implement FRC from the start. It’s not too hard to implement and since there is not many FRC engine it could make m8 more appealing.


I’ll try to make m8 my first multiprocessor engine.

8. Blog

I’ll try to keep a journal of my ideas and experiments and if I think some of theses could be useful or interesting to others I’ll try to blog about it.