Skip to content

Orbital-Web/Raphael

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

447 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Raphael

Raphael is a superhuman UCI Chess Engine built using C++. It also comes with a GUI built using SFML.

You can scroll to the bottom to see a list of features currently implemented, and also download the prebuilt binaries to try Raphael out for yourself.

Raphael is largely inspired by Sebastian Lague's Coding Adventure series on implementing a Chess Engine, and is a revisit/successor to a previous engine I coded in Python.

demo of Raphael

Elo

The following are the historic elo for Raphael.

Version Release Date CCRL Blitz CCRL 40/15
3.1.0 Mar 01, 2026 3506 3416
3.0.0 Feb 12, 2026 3321* 3206
2.3.0 Jan 25, 2026 3146* 3061
2.2.0 Jan 08, 2026 3035* 2953
2.1.0 Dec 31, 2025 2739* 2689
2.0.0 Dec 23, 2025 2646*
1.8.0 Dec 27, 2024 2223*
1.7.6 Dec 16, 2024 1970
1.7.0 Aug 26, 2023 1853
1.6.0 Aug 20, 2023 1797*
1.5.0 Aug 16, 2023 1764*
*estimated

Getting Started

Builds of the UCI engine for Windows and Linux/WSL are available on the Releases page. In general, you should use the avx2-bmi2 build (on pre-Zen 3 AMD CPUs, the avx2 build can be significantly faster than the avx2-bmi2 build).

Please refer to the following section to compile the GUI and/or the engine yourself on Windows and Linux. The features section outline the supported commands and features of the GUI and UCI engine.

Compiling From Source

Follow these steps to build Raphael yourself. Note that it is highly recommended you build on WSL if you are on Windows.

  1. Clone the repository with

    git clone https://github.com/Orbital-Web/Raphael.git
  2. Ensure you have Make and g++ installed. If you are on Linux/WSL, you can do so by running:

    sudo apt-get install build-essential g++  # Linux/WSL

    Otherwise, if you are on Windows, follow this guide to install MSYS2 and run the following command inside the MSYS2 UCRT64 terminal:

    pacman -S --needed mingw-w64-ucrt-x86_64-toolchain make  # Windows
  3. Compile as follows:

    make uci       # build UCI engine
    make packages  # download SFML, required to build main
    make main      # build GUI

Features

Graphics User Interface (GUI)

The GUI is a quick and easy way to start engine battles or play against Raphael interactively. To start a quick GUI match against yourself and Raphael as follows:

main.exe human "Human" Raphael "Raphael" -s "game.pgn"  # Windows
./main human "Human" Raphael "Raphael" -s "game.pgn"    # Linux/WSL

You can see other command-line arguments by running main.exe -h. There are supports for board annotations (arrows and square highlights) using the right mouse button.

Raphael (Engine)

Raphael is a UCI-compliant chess engine. To use it in other UCI-compliant softwares, compile uci.cpp using the instructions above. To see all supported commands, run uci.exe help

The engine contains the following features:

  • Search (v1.0+)
    • Iterative deepening (v1.1+)
    • Aspiration window (v1.3+)
    • Aspiration widening (v3.0+)
    • Endgame table base
  • Alpha-beta search (v1.0+)
    • Pruning (v1.0+)
      • Alpha-beta pruning (v1.0+)
      • Transposition table cutoff (v1.1+)
      • Mate distance pruning (v1.6+)
      • Reverse futility pruning (v2.2+)
      • Null move pruning (v2.2+)
      • Razoring (v2.3+)
      • Probcut
      • Late move pruning (v2.3+)
      • Futility pruning (v2.3+)
      • SEE pruning (v2.3+)
      • History pruning
      • Multi-cut
      • Improving heuristics (v3.2+)
    • Transposition table (v1.1+)
      • Prefetching (v2.2+)
      • Aging (v3.0+)
      • Clusters
      • Storing static evaluations
    • Principle variation search (v2.1+)
    • Extensions (v1.4+)
      • Check extensions (v1.4+)
      • Pawn push extensions (v1.4+)
      • One reply extensions (v1.7+)
      • Singular extensions (v3.0+)
      • Double extensions (v3.0+)
      • Triple extensions
      • Negative extensions (v3.0+)
      • Cutnode negative extensions (v3.1+)
      • Low depth singular extensions
    • Reductions (v1.5+)
      • Late move reductions (v1.5+)
      • Internal iterative reduction (v3.0+)
    • Move ordering (v1.0+)
      • MVV-LVA (v1.0+)
      • Promotions (v1.0+)
      • Hash move (v1.6+)
      • Killer heuristics (v1.3+)
      • Butterfly history (v1.5+)
      • Capture history (v2.3+)
      • Piece-to history
      • Continuation history (v3.2+)
      • Correction history
      • Threats in history
      • SEE (v1.7+)
  • Quiescence search (v1.0+)
    • Delta pruning (v2.1+)
    • Futility pruning (v2.3+)
    • SEE pruning (v2.3+)
    • Transposition table cutoff (v3.0+)
  • Evaluation (v1.0+)
    • Hand-crafted evaluation (v1.0+)
      • Materials (v1.0+)
      • Piece-square tables (v1.0+)
      • Midgame King safety
      • Endgame King opposition
      • Endgame King proximity (v1.0+)
      • Evaluation tapering (v1.0+)
      • Passed Pawn (v1.3+)
      • Isolated Pawn (v1.3+)
      • Mobility (v1.5+)
      • Bishop pair (v1.8+)
      • Bishop-colored corner (v1.8+)
      • Draw evaluation (v1.8+)
      • Evaluation texel tuning (v1.8+)
    • NNUE (v2.0+)
      • Lizard SCReLU (v2.0+)
      • Lazy updates (v2.1+)
      • Horizontal mirroring (v3.1+)
      • Output buckets (v3.1+)
      • King buckets
      • Finny tables
      • Pairwise multiplication
      • Dual activations
      • Multilayer network
      • Threat Inputs
  • Time management (v1.0+)
    • Hard/soft limit (v3.0+)
    • Node-based scaling (v3.2+)
    • Bestmove stability
    • Score stability
    • Complexity
  • Pondering (v1.2+)
  • Performance (v1.8+)
    • Compiler optimizations (v1.8+)
    • Incremental selection sort (v2.2+)
    • Linux huge pages (v2.2+)
    • Staged movegen (v3.0+)
  • Lazy SMP
  • SPSA tuning

For a more in-depth documentation on the NNUE and how it was trained, refer to the NNUE History. All iterations of Raphael's NNUE were trained on self-generated training data. The net files can be found on the Raphael-Net repository.

UCI Options

Name Type Default Range Description
Hash spin 64 [1, 65536] Memory allocated for transposition table (in MiB)
Threads spin 1 [1, 1] Number of search threads
UCI_Chess960 check false true/false Whether to play Chess960 (frc/dfrc) games
MoveOverhead spin 10 [0, 5000] Amount of time assumed to be lost to overhead per move (in ms)
Datagen check false true/false Whether to enable datagen mode (modifies search behavior)
Softnodes check false true/false Whether to use a soft node limit when sent go nodes
SoftNodeHardLimitMultiplier spin 1678 [1, 5000] Scale factor of hard node limit when using softnodes

Acknowledgements

Raphael uses or has used the following tools throughout its development:

  • fastchess for running SPRTs locally
  • C++ chess library for movegen up until v2.3, and a strong source of inspiration for the custom movegen logic from v3.0 onwards
  • GediminasMasaitis's Texel Tuner for tuning the HCE parameters for v1.8
  • OpenBench for data generations and distributed SPRTs from v3.1 onwards
  • bullet for NNUE training from v3.1 onwards
  • Pawnocchio for data processing and relabeling from v3.1 onwards
  • incbin for embedding network files from v3.1 onwards

Special Thanks To

Furthermore, the following individuals have inspired me or have helped me tremendously throughout the development process of Raphael (in no particular order):

About

Superhuman chess engine and GUI coded in C++ and SFML.

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages