ChePP requires a fairly modern compiler with C++20 support.
Tested with:
- GCC 11–16
- Clang 17–18
- Apple Clang 17
- MSVC 17 (Visual Studio 2022) / 18 (Visual Studio 2026)
Compatibility options are provided where possible.
cmake -S . -B build [-G <generator>] [-A <platform> (MSVC)] [CMAKE_OPTIONS...]
cmake --build build [--config <config>] [--target <target>]Compile and run tests using Posix Makefiles:
cmake -S . -B build -DCMAKE_BUILD_TYPE=Release -DARCH=native
cmake --build build
ctest --test-dir buildCompile and run tests using MSVC:
cmake -S . -B build -G "Visual Studio 17 2022" -A x64 -DARCH=AVX2 # no native on MSVC
cmake --build build --config Release
ctest --test-dir build -C ReleaseCompile using MSVC for a SSE2 baseline on a Windows x64 computer.
The Core engine will run slightly slower than compiling for a more specific target.
However the NNUE kernels are dynamically dispatched and will choose the best target at runtime.
Running the engine compiled this way on a target using AVX512 will use AVX512 for the NNUE.
cmake -S . -B build -G "Visual Studio 17 2022" -A x64 -DARCH=SSE2
cmake --build build --config ReleaseCross-platform compilation requires a two-phase build:
- Build host tools
- Build the target binary
cmake -S . -B <build-host-dir> [-G <generator>]
[-A <native-platform> (MSVC)] [CMAKE_OPTIONS...]
cmake --install <build-host-dir> --target DumpBin Bin2Cpp --config Release
cmake -S . -B <build-dir> [-G <generator>] \
-DCMAKE_TOOLCHAIN_FILE=<toolchain> \
-DCMAKE_PREFIX_PATH=<build-host-dir> \
[-A <target-platform> (MSVC)] [CMAKE_OPTIONS...]
cmake --build <build-dir> --target ChePP [--config <config>]cmake -S . -B build-host -G "Ninja Multi-Config"
cmake --build build-host --target dump_magics bin2cpp --config Release
cmake -S . -B build -G "Ninja Multi-Config" \
-DCMAKE_TOOLCHAIN_FILE=mingw-w64-toolchain.cmake \
-DCMAKE_PREFIX_PATH=$(pwd)/build-host \
-DARCH=haswell \
-DSTATIC=True
cmake --build build --target ChePP --config Release-
-DNO_LTO=TRUEDisable Link Time Optimization (LTO). -
-DSANITIZE=TRUEEnable sanitizers in Debug builds. -
-DARCH=<arch>Set the target architecture used by the compiler.
Enables optimizations such asPOPCOUNT,PEXT, and improved vectorization.
NNUE kernels are dynamically dispatched and are not affected by this flag.Compiler Architectures MSVC / Clang-cl SSE2,AVX2,AVX512, etcGCC / Clang / Apple Clang / Mingw-GCC native,x86-64,skylake,armv8-a, etc -
-DSTATIC=TRUEEnable static linking of libc and libc++ (useful for cross-compilation).
ChePP supports all major UCI commands and can be used with a UCI-compatible chess interface (GUI, Python-Lichess, etc.).
Example session:
position startpos moves e2e4
go movetime 1000
setoption name Tune
go depth 20
stop
# non UCI commands:
print
print-nnue
eval
quitChePP is a portable UCI-compliant chess engine written in C++.
The engine combines a Negamax search with an Efficiently Updatable Neural Network (NNUE) for position evaluation.
Current estimated strength on Lichess-Blitz ladder: ~2650.
For comparison, Stockfish on similar hardware https://lichess.org/@/ProteusSF-lite achieves around 3000.
A precise CCRL Elo estimate is being measured, but takes a lot of resources :(
-
Bitboard-based move generation
- Magic bitboards /
PEXT
- Magic bitboards /
-
NNUE evaluation
- Trained on ~300 GB of chess positions
- SIMD kernels
- Runtime kernel selection via the
Tuneoption
-
Negamax search
- Iterative deepening
- Move ordering (history, killer, continuation...)
- Quiescence search
- Aspiration windows
- Transposition tables
- Null-move pruning
- Late move reductions
- Additional standard search optimizations
- Implement missing UCI commands (e.g.
ponder) - Improve time management and responsiveness of
go - Add NNUE accumulator caches
- Implement sparse affine evaluation
- More pruning == more elo :)
- Google Highway - portable SIMD abstraction
- Fathom - tablebase probing (TBProbe)
- Grapheus - C++ CUDA NNUE trainer by Luecx
- Stockfish - reference implementation and amazing documentation of the NNUE
- Rice - for the clean and understandable code