A chess engine written in Rust, built for WebAssembly (WASM) and native binaries. It uses a neural network evaluation (NNUE) and supports standard UCI protocol commands.
This is a chess engine that can run in a browser (via WebAssembly) or as a native binary. It communicates using the UCI (Universal Chess Interface) protocol, which means it can work with chess GUIs and platforms that support UCI engines.
Requires Rust and a C compiler.
# Build the native binary with threading support
cargo build --release --features parallel-search --bin uci_binary --jobs 24
# Run it
./target/release/uci_binaryThen send UCI commands via stdin, for example:
uci
isready
position startpos
go movetime 8000
quit
The WASM build is what runs in browsers. It uses single-threaded execution (WASM does not support multi-threading in this setup) and embeds the NNUE model directly.
# Build WASM output
bash build_wasm.shThis creates dist/ with the deployable files and pkg/ with the WASM module.
- NNUE evaluation: Uses a neural network (
nn-5af11540bbfe.nnue, CC0 license) for position evaluation. - UCI protocol: Supports
uci,isready,position,go,stop,quit, and time/movetime controls. - Opening book: Uses
openings.jsfor book moves in the opening phase. - Threading (native only): The
parallel-searchfeature enables Rayon-based multi-core root search, but requires the native binary (uci_binary), not the WASM build.
This project is licensed under the GNU General Public License version 2 (GPLv2). See LICENSE for details.
The neural network weights (nn-5af11540bbfe.nnue) are released by Fishtest, Stockfishs training website, licensed under CC0. They are in the SF_16 format.
src/— Rust source code (engine logic, search, evaluation, move generation)pkg/— WASM output (generated bybuild_wasm.sh)dist/— Deployable WASM bundle (generated)openings.js— Opening book data (JSON format inside a JS file)build_wasm.sh— Script to compile and package the WASM buildbuild_server.sh— Script to compile the native server binary