Skip to main content

High-performance chess library with arbitrary board sizes

Project description

spooky_chess 🎃👻

Rust and Python library for the game of Chess.

Features

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

These examples load a PGN, and ask Stockfish for the best move at every playable position.

Rust:

cargo run --example analyse_pgn

Python:

uv run python examples/analyse_pgn.py

Develop

Tests

  • fish run_tests.fish
    • fish run_python_tests.fish
    • fish run_rust_tests.fish

Lints

  • fish run_lints.fish

Performance

  • fish run_benchmark.fish
  • fish run_profile.fish

See Also

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

spooky_chess-0.8.0.tar.gz (84.6 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

spooky_chess-0.8.0-cp313-cp313-manylinux_2_28_x86_64.whl (2.3 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.28+ x86-64

spooky_chess-0.8.0-cp313-cp313-macosx_11_0_arm64.whl (2.1 MB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

spooky_chess-0.8.0-cp312-cp312-manylinux_2_28_x86_64.whl (2.3 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.28+ x86-64

spooky_chess-0.8.0-cp312-cp312-macosx_11_0_arm64.whl (2.1 MB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

spooky_chess-0.8.0-cp311-cp311-manylinux_2_28_x86_64.whl (2.3 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.28+ x86-64

spooky_chess-0.8.0-cp311-cp311-macosx_11_0_arm64.whl (2.1 MB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

File details

Details for the file spooky_chess-0.8.0.tar.gz.

File metadata

  • Download URL: spooky_chess-0.8.0.tar.gz
  • Upload date:
  • Size: 84.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for spooky_chess-0.8.0.tar.gz
Algorithm Hash digest
SHA256 f2277fbc764440da104ef103201702ba95521c743e43ce54ed40b79b03aa7323
MD5 4bede0a243782c05723d7bb1bf12ce66
BLAKE2b-256 647dcb91d71c5e27a882c6a9874519283e9698c93ffd311efe6977761563485e

See more details on using hashes here.

Provenance

The following attestation bundles were made for spooky_chess-0.8.0.tar.gz:

Publisher: publish.yml on snowdrop4/spooky-chess

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file spooky_chess-0.8.0-cp313-cp313-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for spooky_chess-0.8.0-cp313-cp313-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 97fe7f0d7567345a735d06ea7556e0b1ac2b7c88d88830cd0dce1bfb2c4343fa
MD5 50bd9cc6dadcb92f31d9841b2964e37d
BLAKE2b-256 152d99eb60e3b84ee33f6a250d94b9da47c375f0b1cbc9e59caf268f988f9a0e

See more details on using hashes here.

Provenance

The following attestation bundles were made for spooky_chess-0.8.0-cp313-cp313-manylinux_2_28_x86_64.whl:

Publisher: publish.yml on snowdrop4/spooky-chess

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file spooky_chess-0.8.0-cp313-cp313-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for spooky_chess-0.8.0-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 64db390433d056967540f814b15ce00e7df79d04ee989976cbd34a98c3e47d53
MD5 5ce08c1efecc3d4fa8ebf62996d4b056
BLAKE2b-256 f123d82752b0bdf28c909ab91d0aa970ffa1e5aad04f40fd4b4dca8ab67a8d17

See more details on using hashes here.

Provenance

The following attestation bundles were made for spooky_chess-0.8.0-cp313-cp313-macosx_11_0_arm64.whl:

Publisher: publish.yml on snowdrop4/spooky-chess

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file spooky_chess-0.8.0-cp312-cp312-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for spooky_chess-0.8.0-cp312-cp312-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 701f768e44d7a0ff3d745b7a88de821a800a63f816a831d1cb0e7f7e2c5ab652
MD5 850c1f2cd04312c8fbaf8f0ed5bb2b1c
BLAKE2b-256 baf59ead46dcb54f6e54801039ad0e73e7394c80156f9e2c80b75dc1e6b5ce93

See more details on using hashes here.

Provenance

The following attestation bundles were made for spooky_chess-0.8.0-cp312-cp312-manylinux_2_28_x86_64.whl:

Publisher: publish.yml on snowdrop4/spooky-chess

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file spooky_chess-0.8.0-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for spooky_chess-0.8.0-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 b2380a9a59da37935b4af82885d1618de7b49c605fda4dafff567ee18dfcaaa6
MD5 32f547e3bf8d0cc16652c570ae086f8b
BLAKE2b-256 4ea898b2af32d9b997a7b3533a806be7e9220edf53d28621ce9f0051838bd25b

See more details on using hashes here.

Provenance

The following attestation bundles were made for spooky_chess-0.8.0-cp312-cp312-macosx_11_0_arm64.whl:

Publisher: publish.yml on snowdrop4/spooky-chess

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file spooky_chess-0.8.0-cp311-cp311-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for spooky_chess-0.8.0-cp311-cp311-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 1e216cf6032e5b29045e5ea42d55cf91aabea1a9251f0bfad9fb73bb920c7d2b
MD5 0c36ae5cd16749085c26da87a85659f4
BLAKE2b-256 bc99fd2e4555baa38387709a3acbd6b8a620ad0b9839a62474873785a9f84dab

See more details on using hashes here.

Provenance

The following attestation bundles were made for spooky_chess-0.8.0-cp311-cp311-manylinux_2_28_x86_64.whl:

Publisher: publish.yml on snowdrop4/spooky-chess

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file spooky_chess-0.8.0-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for spooky_chess-0.8.0-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 f0268cc5bc3808e139358a6c59706f5e9569dac9e1236025b8bef04408b3053b
MD5 8a2fd43fdd7176c6a48686a050d604a7
BLAKE2b-256 40576804af7c74be9aa5d022dfe550f73674d57c13e3974bb1c5a5e817220757

See more details on using hashes here.

Provenance

The following attestation bundles were made for spooky_chess-0.8.0-cp311-cp311-macosx_11_0_arm64.whl:

Publisher: publish.yml on snowdrop4/spooky-chess

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page