Skip to content

hansbinderup/meltdown-chess-engine

Repository files navigation

Meltdown

GitHub Release GitHub commits since latest release GitHub Downloads

Linux Windows

Lichess Bot

C++23 UCI compliant-ish Chess Engine.

Design goals
#1 Fully stack allocated - engine should at no point allocate heap memory
#2 Fast - well, probably the goal of most chess engines out there
#3 Readable - the code and alogorithms should be easy to read and understand
#4 Modular - the algorithms should be easy to replace with faster, better etc. if needed

Comments:

#1: This goes for the engine itself. Can't bother with debug handles, debug logging etc. as these will only run locally, so no need to complicate things here. The engine's search functions, heuristics etc. must be stack allocated.

#2 Without compromising #3 and #4 it should be implemented in the most efficient way using the most common algorithms and techniques.

#3 Starting this project I spend a fair amount of time getting some inspiration. Mostly for algorithms. And I often observed that the implementation of the algorithms were pretty hard to read. I believe that it's possible to implement these fancy and "magic" algorithms in a way that is readable but also don't compromise #2. When it comes to the "magic" algorithms etc. my goal is to separate the logic into method where it's easy(er) to follow what's going on based on the documentation that is currently available.

#4 Each component should, if possible, be decoupled so that it is easy to implement newer and potentially better algorithms if such were to be found.

Getting started

Whether you're here to download, test, compile, or develop Meltdown, you have a few options to get started.

Download Meltdown release

The easiest way to install Meltdown is by downloading one of the releases from the release page. All binaries are statically compiled so it should be easy to run.

Using build scripts

This is the preferred way. It is very useful for quick development and ensures that you use setups verified by the developers.

The build scripts currently support Linux and Windows. The OS is automatically detected on build. The scripts default to clang++ as they've proven to be the fastest runtime. If you're compiling outside of docker then be aware of this.

Building with Docker

  1. Setup docker
  2. Run docker iteractively: ./docker/run.sh
  3. Run one of the 3 build scripts:
    • Release build: ./scripts/build.sh --release [--native] [-r]
    • Development build: ./scripts/build.sh [-r]
    • For debugging in gdb: ./scripts/debug.sh
    • Compile and run unit-tests: ./scripts/unit_test.sh
[--native]: Use native CPU optimizations and local toolchains [-r]: Automatically run the executable after building

Building without Docker

If you prefer to compile without Docker you must ensure that meson (min. v1.1) is installed and your compiler supports cpp23. You can then run step #3 from above.

Custom build (cross compilation target)

If you, for some reason, want to perform a cross compilation or simply want more control over your build, then you can specify these yourself.

In the folder targets are some predefined cross compilation targets. If you encounter issues with the methods above then you can resort to building with your own compiler/linking cross compilation targets.

  1. Create a new cross compilation target (see targets/ for inspiration).
  2. Setup the build: meson setup <build dir> --cross-file <target file from #1> --buildtype=release

You only have to setup meson once with the steps from below.

If breaking changes have been introduced you're required to reconfigure the build. You can do this by adding the --reconfigure flag to the setup.

When the build has been setup you can now compile it.

  1. Compile: meson compile -C <build dir>

You can now run the executable living in the build dir.

Playing strength

Each release varies in playing strength. The estimated strength, relative to previous release, will be provided with each release.

Meltdown is regularly tested by the CCRL team. Thanks a lot!

About

C++23 UCI compliant Chess Engine

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •