Skip to content

mkd/gargantua

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Gargantua UCI Chess Engine

Overview

Gargantua is a UCI chess engine with NNUE evaluation, derived from Chess0, and inspired by Code Monkey King's BBC.

Gargantua's current approximate ELO rating is around ~3350, based on the Elometer test, various tournaments against other rated chess engines (via Cutechess), and a series of online games played on the Free Internet Chess Server (FICS).

Implementation

Gargantua is implemented mainly in C++, leveraging the STL as much as possible. However, there are many routines and data structures that are written in pure C language for performance reasons.

Gargantua relies on Stockfish' neural networks (NNUE) to evaluate the score of a given position. This is based on Daniel Shawul's NNUE-probe implementation.

In order to ensure a proper behavior, you need to make sure the neural network file (i.e., nn-eba324f53044.nnue) is in the current directory of execution. This also means you must configure the path to Gargantua in your GUI, so that it can find the neural network evaluation file. Otherwise, the engine will play random moves.

Search features and optimizations

Key Features in v2.0

  • New NNUE Architecture: Shifted to a robust Stockfish-based probe implementation (src/stockfish_probe) for state-of-the-art evaluation.
  • Syzygy Tablebase Support: precise endgame play with support for 3-4-5-6-7 piece tablebases.
  • Crash Recovery System: Implemented a dedicated signal handling mechanism to ensure maximum stability even during intensive tablebase probes.
  • Simplified Build: A clean and standardized build process.

Files

Building Gargantua

To build the engine, simply run:

cd src
make

This produces the gargantua binary.

Using Gargantua

Thanks to the UCI protocol, you can use Gargantua with your favorite chess GUI. Chess GUI applications use the UCI protocol to communicate with the engine, so you can analyze your games, play against it or even run a computer chess tournament from your own computer.

I personally use ScidvsMac (a version of ScidvsPC for Mac) to test Gargantua. There's a ton of free chess graphical interfaces for UCI chess engines, just pick your favorite one.

Gargantua also has a few built-in commands that are not officially part of the UCI protocol. These commands are used for debugging or testing. Here's a short list:

  • d: display the current position on the chess board
  • eval: show the NNUE static evaluation of the current position
  • flip: flip the view of the chess board when printing a position
  • moves: print a list of all pseudo-legal moves
  • smoves: print the list of available moves, sorted from best to worst

UCI Options

  • Hash: Size of the transposition table in MB.
  • SyzygyPath: Absolute path to your Syzygy tablebase files (.rtbw, .rtbz).
    • Example: SyzygyPath=/path/to/syzygy/3-4-5

Testing Framework

Gargantua includes a powerful testing framework in tests/manager.py for automated matches and Elo measurement using cutechess-cli.

Example: Run a 100-game match against a previous version:

python3 tests/manager.py --match --base ./gargantua-v1 --games 100 --tc 10+0.1

Contributing to Gargantua

My work on Gargantua is very sporadic and not a priority in my life, so the development is not very active. So, if you have tried Gargantua and would like to improve the current source code in any way, please go ahead!

Credits

  • Claudio M. Camacho: Author
  • Stockfish Team: For the NNUE and Tablebase probe implementation.
  • Daniel Shawul: For the original NNUE-probe inspiration.

About

UCI chess engine with NNUE evaluation

Topics

Resources

License

GPL-3.0, GPL-3.0 licenses found

Licenses found

GPL-3.0
LICENSE
GPL-3.0
copying.txt

Stars

Watchers

Forks

Packages

No packages published