High-performance chess library with board sizes from 6x6 to 16x16
Project description
spooky_chess 🎃👻
Rust and Python library for the game of Chess.
Features
- Drive external engines with Universal Chess Interface.
- Variable board sizes from 6x6 to 16x16.
- Relatively fast.
- Out-of-the-box support for DL/ML, including AlphaZero and MAIA2 action encoding.
- Consistent interface with spooky-connect4 and spooky-go.
Performance
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.01x
Validity
Fuzz-tested against python-chess, with 5 million random playouts.
Install
Rust
cargo add spooky_chess
Python
uv add spooky-chess
Includes type hints.
Examples
Quick start:
Rust:
cargo run --example quick_start
Python:
uv run python examples/quick_start.py
More Rust examples:
cargo run --example pgn_summarycargo run --example legal_movescargo run --example action_encodingcargo run --example custom_board
More Python examples:
uv run python examples/pgn_summary.pyuv run python examples/legal_moves.pyuv run python examples/action_encoding.pyuv run python examples/custom_board.py
PGN + UCI analysis:
Rust:
cargo run --example analyse_pgn
Python:
uv run python examples/analyse_pgn.py
Develop
Tests
fish run_tests.fishfish run_python_tests.fishfish run_rust_tests.fish
Lints
fish run_lints.fish
Docs
uv run --with sphinx==9.1.0 python -m sphinx -b html -E docs docs/_build/html
Performance
fish run_benchmark.fishfish run_profile.fish
See Also
- spooky-chess
- spooky-connect4
- spooky-go
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file spooky_chess-1.1.0.tar.gz.
File metadata
- Download URL: spooky_chess-1.1.0.tar.gz
- Upload date:
- Size: 101.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0fd93c36b6bce5f0e1c256440c33167c920bab6a3b7ed1b115f831924931ed4b
|
|
| MD5 |
114bc68ce67e4555875b59dad8eb9b41
|
|
| BLAKE2b-256 |
dfe32b4b71c623c5e7ff9529e91fbbee0bb633468b6916009b5a656a2d4444e8
|
Provenance
The following attestation bundles were made for spooky_chess-1.1.0.tar.gz:
Publisher:
publish.yml on snowdrop4/spooky-chess
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
spooky_chess-1.1.0.tar.gz -
Subject digest:
0fd93c36b6bce5f0e1c256440c33167c920bab6a3b7ed1b115f831924931ed4b - Sigstore transparency entry: 1266508411
- Sigstore integration time:
-
Permalink:
snowdrop4/spooky-chess@03279640adb8a8ea96cccabbe7392b36e245ce14 -
Branch / Tag:
refs/tags/v1.1.0 - Owner: https://github.com/snowdrop4
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@03279640adb8a8ea96cccabbe7392b36e245ce14 -
Trigger Event:
release
-
Statement type:
File details
Details for the file spooky_chess-1.1.0-cp314-cp314-manylinux_2_28_x86_64.whl.
File metadata
- Download URL: spooky_chess-1.1.0-cp314-cp314-manylinux_2_28_x86_64.whl
- Upload date:
- Size: 2.3 MB
- Tags: CPython 3.14, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
058532205f1c7a7052eff56c11e65b03c1a563ab2a680a4fd829a83b06d7b455
|
|
| MD5 |
59530aeeaff956c4dfc8f5df0e0142fd
|
|
| BLAKE2b-256 |
3bee1b23fc88b2150b4491807ffb854eff5f9d1c6ccaf843b715a270ccd97823
|
Provenance
The following attestation bundles were made for spooky_chess-1.1.0-cp314-cp314-manylinux_2_28_x86_64.whl:
Publisher:
publish.yml on snowdrop4/spooky-chess
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
spooky_chess-1.1.0-cp314-cp314-manylinux_2_28_x86_64.whl -
Subject digest:
058532205f1c7a7052eff56c11e65b03c1a563ab2a680a4fd829a83b06d7b455 - Sigstore transparency entry: 1266509016
- Sigstore integration time:
-
Permalink:
snowdrop4/spooky-chess@03279640adb8a8ea96cccabbe7392b36e245ce14 -
Branch / Tag:
refs/tags/v1.1.0 - Owner: https://github.com/snowdrop4
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@03279640adb8a8ea96cccabbe7392b36e245ce14 -
Trigger Event:
release
-
Statement type:
File details
Details for the file spooky_chess-1.1.0-cp314-cp314-macosx_11_0_arm64.whl.
File metadata
- Download URL: spooky_chess-1.1.0-cp314-cp314-macosx_11_0_arm64.whl
- Upload date:
- Size: 2.1 MB
- Tags: CPython 3.14, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9cac9e1b3d56cdb60c673820dd89d465429b3a6a1640ab07e5486f9acba654fb
|
|
| MD5 |
08d8b20813e530d65e053ce65c2501be
|
|
| BLAKE2b-256 |
b7bb89229ccbe48544850265be876d942ac52f005501fb815c74906819ac41e0
|
Provenance
The following attestation bundles were made for spooky_chess-1.1.0-cp314-cp314-macosx_11_0_arm64.whl:
Publisher:
publish.yml on snowdrop4/spooky-chess
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
spooky_chess-1.1.0-cp314-cp314-macosx_11_0_arm64.whl -
Subject digest:
9cac9e1b3d56cdb60c673820dd89d465429b3a6a1640ab07e5486f9acba654fb - Sigstore transparency entry: 1266509085
- Sigstore integration time:
-
Permalink:
snowdrop4/spooky-chess@03279640adb8a8ea96cccabbe7392b36e245ce14 -
Branch / Tag:
refs/tags/v1.1.0 - Owner: https://github.com/snowdrop4
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@03279640adb8a8ea96cccabbe7392b36e245ce14 -
Trigger Event:
release
-
Statement type:
File details
Details for the file spooky_chess-1.1.0-cp313-cp313-manylinux_2_28_x86_64.whl.
File metadata
- Download URL: spooky_chess-1.1.0-cp313-cp313-manylinux_2_28_x86_64.whl
- Upload date:
- Size: 2.3 MB
- Tags: CPython 3.13, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2241cfae8c0367b530d7715bbea6ca6905ad87a2dcea29d9af033bf3f06bc5d0
|
|
| MD5 |
b58132c3bad2cf94622dbbd6666ef48b
|
|
| BLAKE2b-256 |
abf9cca769086c1b02a26b0fcb88c37207c1aa8a7000f470b53215d5f8140b40
|
Provenance
The following attestation bundles were made for spooky_chess-1.1.0-cp313-cp313-manylinux_2_28_x86_64.whl:
Publisher:
publish.yml on snowdrop4/spooky-chess
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
spooky_chess-1.1.0-cp313-cp313-manylinux_2_28_x86_64.whl -
Subject digest:
2241cfae8c0367b530d7715bbea6ca6905ad87a2dcea29d9af033bf3f06bc5d0 - Sigstore transparency entry: 1266508524
- Sigstore integration time:
-
Permalink:
snowdrop4/spooky-chess@03279640adb8a8ea96cccabbe7392b36e245ce14 -
Branch / Tag:
refs/tags/v1.1.0 - Owner: https://github.com/snowdrop4
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@03279640adb8a8ea96cccabbe7392b36e245ce14 -
Trigger Event:
release
-
Statement type:
File details
Details for the file spooky_chess-1.1.0-cp313-cp313-macosx_11_0_arm64.whl.
File metadata
- Download URL: spooky_chess-1.1.0-cp313-cp313-macosx_11_0_arm64.whl
- Upload date:
- Size: 2.1 MB
- Tags: CPython 3.13, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e17a0cf566c5fcef817705ba2bb61d9e1f34f9f1367c0db8399505bc9c42b17c
|
|
| MD5 |
48d952eb57a52baba6b15091daa86443
|
|
| BLAKE2b-256 |
b89999126a88eb4490492f1697d724208322fb117c69c77fa48fd7f3f0db17f5
|
Provenance
The following attestation bundles were made for spooky_chess-1.1.0-cp313-cp313-macosx_11_0_arm64.whl:
Publisher:
publish.yml on snowdrop4/spooky-chess
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
spooky_chess-1.1.0-cp313-cp313-macosx_11_0_arm64.whl -
Subject digest:
e17a0cf566c5fcef817705ba2bb61d9e1f34f9f1367c0db8399505bc9c42b17c - Sigstore transparency entry: 1266508759
- Sigstore integration time:
-
Permalink:
snowdrop4/spooky-chess@03279640adb8a8ea96cccabbe7392b36e245ce14 -
Branch / Tag:
refs/tags/v1.1.0 - Owner: https://github.com/snowdrop4
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@03279640adb8a8ea96cccabbe7392b36e245ce14 -
Trigger Event:
release
-
Statement type:
File details
Details for the file spooky_chess-1.1.0-cp312-cp312-manylinux_2_28_x86_64.whl.
File metadata
- Download URL: spooky_chess-1.1.0-cp312-cp312-manylinux_2_28_x86_64.whl
- Upload date:
- Size: 2.3 MB
- Tags: CPython 3.12, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
655d49782d3766f2ff85148579fa517f4347844c76540a55e920f56cf35cad0e
|
|
| MD5 |
e1d133722a3b7c59a274b4ba1ba9946b
|
|
| BLAKE2b-256 |
f180d7fa0951a256bcba62f3377ea6445b29e36328b9caab86a2e6ea1e8901a8
|
Provenance
The following attestation bundles were made for spooky_chess-1.1.0-cp312-cp312-manylinux_2_28_x86_64.whl:
Publisher:
publish.yml on snowdrop4/spooky-chess
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
spooky_chess-1.1.0-cp312-cp312-manylinux_2_28_x86_64.whl -
Subject digest:
655d49782d3766f2ff85148579fa517f4347844c76540a55e920f56cf35cad0e - Sigstore transparency entry: 1266508950
- Sigstore integration time:
-
Permalink:
snowdrop4/spooky-chess@03279640adb8a8ea96cccabbe7392b36e245ce14 -
Branch / Tag:
refs/tags/v1.1.0 - Owner: https://github.com/snowdrop4
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@03279640adb8a8ea96cccabbe7392b36e245ce14 -
Trigger Event:
release
-
Statement type:
File details
Details for the file spooky_chess-1.1.0-cp312-cp312-macosx_11_0_arm64.whl.
File metadata
- Download URL: spooky_chess-1.1.0-cp312-cp312-macosx_11_0_arm64.whl
- Upload date:
- Size: 2.1 MB
- Tags: CPython 3.12, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a2cafaf71bb4de29c7f561438effc514ad27fa6b5e9012139aa1301fba254ed0
|
|
| MD5 |
bd3eaa80e5f4627dbd6e619c5d01f53c
|
|
| BLAKE2b-256 |
e78de8a382761cf7a19343dffcf7f767a663d8922cf81067292e58efbf58f30a
|
Provenance
The following attestation bundles were made for spooky_chess-1.1.0-cp312-cp312-macosx_11_0_arm64.whl:
Publisher:
publish.yml on snowdrop4/spooky-chess
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
spooky_chess-1.1.0-cp312-cp312-macosx_11_0_arm64.whl -
Subject digest:
a2cafaf71bb4de29c7f561438effc514ad27fa6b5e9012139aa1301fba254ed0 - Sigstore transparency entry: 1266508850
- Sigstore integration time:
-
Permalink:
snowdrop4/spooky-chess@03279640adb8a8ea96cccabbe7392b36e245ce14 -
Branch / Tag:
refs/tags/v1.1.0 - Owner: https://github.com/snowdrop4
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@03279640adb8a8ea96cccabbe7392b36e245ce14 -
Trigger Event:
release
-
Statement type:
File details
Details for the file spooky_chess-1.1.0-cp311-cp311-manylinux_2_28_x86_64.whl.
File metadata
- Download URL: spooky_chess-1.1.0-cp311-cp311-manylinux_2_28_x86_64.whl
- Upload date:
- Size: 2.3 MB
- Tags: CPython 3.11, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fc72d299b2209e7cd4462233db950f0a70fbb7a3eb97f6df1465eeafc2c080e1
|
|
| MD5 |
8e2bb4e65961e01973f17364caa2a42c
|
|
| BLAKE2b-256 |
1f9bde6ab128c64e1bfabd5f9b982ff94626c9c7b14d88ea83fabfc4efc0c4ec
|
Provenance
The following attestation bundles were made for spooky_chess-1.1.0-cp311-cp311-manylinux_2_28_x86_64.whl:
Publisher:
publish.yml on snowdrop4/spooky-chess
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
spooky_chess-1.1.0-cp311-cp311-manylinux_2_28_x86_64.whl -
Subject digest:
fc72d299b2209e7cd4462233db950f0a70fbb7a3eb97f6df1465eeafc2c080e1 - Sigstore transparency entry: 1266508632
- Sigstore integration time:
-
Permalink:
snowdrop4/spooky-chess@03279640adb8a8ea96cccabbe7392b36e245ce14 -
Branch / Tag:
refs/tags/v1.1.0 - Owner: https://github.com/snowdrop4
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@03279640adb8a8ea96cccabbe7392b36e245ce14 -
Trigger Event:
release
-
Statement type:
File details
Details for the file spooky_chess-1.1.0-cp311-cp311-macosx_11_0_arm64.whl.
File metadata
- Download URL: spooky_chess-1.1.0-cp311-cp311-macosx_11_0_arm64.whl
- Upload date:
- Size: 2.1 MB
- Tags: CPython 3.11, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
02241611dca5121299b3f7baddcb9e58da0c8ca941df04a3ac11ebf8c7b9992a
|
|
| MD5 |
149eb89b2c30b45cba5628d9fcdc26a5
|
|
| BLAKE2b-256 |
a9d9b46f51ee8b31b74cfabe128589f59940b0f13b7a9862a1eba3ee23b601ed
|
Provenance
The following attestation bundles were made for spooky_chess-1.1.0-cp311-cp311-macosx_11_0_arm64.whl:
Publisher:
publish.yml on snowdrop4/spooky-chess
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
spooky_chess-1.1.0-cp311-cp311-macosx_11_0_arm64.whl -
Subject digest:
02241611dca5121299b3f7baddcb9e58da0c8ca941df04a3ac11ebf8c7b9992a - Sigstore transparency entry: 1266509161
- Sigstore integration time:
-
Permalink:
snowdrop4/spooky-chess@03279640adb8a8ea96cccabbe7392b36e245ce14 -
Branch / Tag:
refs/tags/v1.1.0 - Owner: https://github.com/snowdrop4
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@03279640adb8a8ea96cccabbe7392b36e245ce14 -
Trigger Event:
release
-
Statement type: