Chess-Engine-Lovers Forum
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Go down
supersharp77
supersharp77
Posts : 267
Join date : 2023-04-09
Location : SW USA

Carp Chess Engine Empty Carp Chess Engine

Sun Oct 08, 2023 1:49 am
Carp Chess Engine

"Carp is a UCI-compatible didactic engine written in Rust, using a bitboard-based piece-centric approach.
The engine is built on top of a conventional Negamax search and uses a simple NNUE evaluation.

The main goal of this project is to learn the basics of both Rust and Chess Programming.
Rating Lists
Version CCRL 40/15 CCRL BLITZ MCERL
3.0.1 N/a N/a N/a
2.0.0 3087 3159 3117
1.3.0 N/a N/a 2675
1.2.0 N/a N/a 2488
1.1.0 N/a N/a 2164

Carp is rigorously tested with SPRT, and is part of the SWEHosting OB instance.
Project Structure & Building Carp

The project is structured in 3 main Cargo Workspaces: Chess is the game backend used by the engine, Carp is the UCI engine and Carp-Tools is an executable with developer tools. The first two crates are designed to be dependency-less, although Syzygy Tablebase support requires interfacing with Fathom.

Building Carp only requires Cargo. Carp is currently tested on Rust Stable v1.70, so that is the recommended version, although it could possibly work (without guarantees) on earlier releases.

For development, Carp should be built through Cargo with cargo run --release --package carp.

To compile Carp for maximum performance, the use of PGO is highly recommended. Depending on the CPU, it has shown to be up to 60 elo over a standard Cargo build. To do this, either run make native to only build an executable targeting the machine's specific architecture, or build all available microarchitecture levels for the running OS through make release.

NOTE: the PGO build requires having llvm-profdata, which should be included with LLVM or CLANG.
NNUE

Carp uses a (768->1024)x2->1 perspective net trained with Bullet. It fully relies on its own self-play data for training the network. Data can be generated with the utilities provided in the Tools module. To build for datagen, simply run make datagen which also performs PGO.

As of Carp 2.0, NNUE has compltely replaced the old HCE.
Implemented optimizations

Fully legal move generation (~435 MNodes/s on a 7950x) with Fixed Shift Black Magic Bitboards
Fail-Hard Negamax + Quiescence
Iterative Deepening with Aspiration Windows
Move Ordering with a staged sorter:
MVV + Capture History with Threshold Static Exchange Evaluation
Quiet History
Continuation Histories
Multithreading with Lazy-SMP
Lockless Transposition table with aging
Principal Variation Search
Internal Iterative Reductions
Late Move Reductions
Null Move Pruning
Reverse Futility Pruning
Mate Distance Pruning
History Leaf Pruning
Extended Futility Pruning
Late Move Pruning
Singular Extensions
Syzygy Endgame Tablebases

Dependencies

None of these are strictly necessary to run the engine, but they are vital for development:

Fathom
Cutechess-Cli
Bullet
MarlinFlow
OpenBench
Stockfish's WDL model

Credits
CMK's chess engine in C series
Chess Programming Wiki
Bruce Moreland's Programming Topics
Cosmo, author of Viridithas, for a lot of help with NNUE
Crippa, author of Svart for hosting the OB instance Carp is tested with.
Johan, owner of SWEHosting for donating CPU time to our instance.
Malu's Asymptote engine to better understand search heuristics
The entire chess programming community, for countless awesome resources"

Carp v3.0.1https://github.com/dede1751/carp/releases/download/v3.0.1/carp-v3.0.1-win-x86_64-V1.exe


Carp v3.0.1 ver 2https://github.com/dede1751/carp/releases/download/v3.0.1/carp-v3.0.1-win-x86_64-V2.exe


Carp v3.0.0 https://github.com/dede1751/carp/releases/download/v3.0.0/carp-v3.0.0-win-x86_64-V1.exe

Carp v3.0.0 ver2 https://github.com/dede1751/carp/releases/download/v3.0.0/carp-v3.0.0-win-x86_64-V2.exe


Carp v2.0 https://github.com/dede1751/carp/releases/download/v.2.0.0/carp_v2.0-x86_64-pc-windows-msvc.exe


Carp v1.1.0 https://github.com/dede1751/carp/releases/download/v1.1.0/carp_v1.1-x86_64-pc-windows-msvc.exe









Carp Chess Engine Carp_logo

GardeAV likes this post

Back to top
Permissions in this forum:
You cannot reply to topics in this forum