Rust and Python library for the game of Chess.
- Drive external engines with Universal Chess Interface.
- Variable board sizes from 6x6 to 16x16.
- Relatively fast.
- Out-of-the-box support for DL/ML (action encoding and decoding methods).
- Consistent interface with spooky-connect4 and spooky-go.
Measured with a Threadripper 9980x, and 6400 MT/s CL36 DDR5. Python 3.14.
> cd tests/comparison && cargo run --release && cd -
50000 random game playouts
spooky_chess (Rust Bindings):
moves: 4936906
time: 2.14s
moves/s: 2311096.73> uv run python -m pytest -k test_compare_random_game_playout -s --run-slow
50000 random game playouts
spooky_chess (Python Bindings):
moves: 4936141
time: 6.66s
moves/s: 740666.24
python-chess:
moves: 4935315
time: 113.33s
moves/s: 43548.00
Speedup: 17.01xFuzz-tested against python-chess, with 5 million random playouts.
cargo add spooky_chessuv add spooky-chessIncludes type hints.
These examples load a PGN, and ask Stockfish for the best move at every playable position.
Rust:
cargo run --example analyse_pgnPython:
uv run python examples/analyse_pgn.pyfish run_tests.fishfish run_python_tests.fishfish run_rust_tests.fish
fish run_lints.fish
fish run_benchmark.fishfish run_profile.fish
- spooky-chess
- spooky-connect4
- spooky-go