Skip to main content

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

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_summary
  • cargo run --example legal_moves
  • cargo run --example action_encoding
  • cargo run --example custom_board

More Python examples:

  • uv run python examples/pgn_summary.py
  • uv run python examples/legal_moves.py
  • uv run python examples/action_encoding.py
  • uv 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.fish
    • fish run_python_tests.fish
    • fish 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.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-1.0.0.tar.gz (98.1 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-1.0.0-cp314-cp314-manylinux_2_28_x86_64.whl (2.3 MB view details)

Uploaded CPython 3.14manylinux: glibc 2.28+ x86-64

spooky_chess-1.0.0-cp314-cp314-macosx_11_0_arm64.whl (2.0 MB view details)

Uploaded CPython 3.14macOS 11.0+ ARM64

spooky_chess-1.0.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-1.0.0-cp313-cp313-macosx_11_0_arm64.whl (2.0 MB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

spooky_chess-1.0.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-1.0.0-cp312-cp312-macosx_11_0_arm64.whl (2.0 MB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

spooky_chess-1.0.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-1.0.0-cp311-cp311-macosx_11_0_arm64.whl (2.0 MB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

File details

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

File metadata

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

File hashes

Hashes for spooky_chess-1.0.0.tar.gz
Algorithm Hash digest
SHA256 2e7b03a8cb034ed2f9234247a2e6826785751c5b48356ddcbe90d8d8836b5ab4
MD5 14e1d23312a62d65b8a6be40cc0c7003
BLAKE2b-256 632e47ae6d791d036d4fe96f19ba90148b647b46c5e480b47f131775c2492cfb

See more details on using hashes here.

Provenance

The following attestation bundles were made for spooky_chess-1.0.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-1.0.0-cp314-cp314-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for spooky_chess-1.0.0-cp314-cp314-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 d27688457a5d663d2f3c42251e1f9d2240002ae3e00b7e26e72cf3988166d459
MD5 8c70da638dce1411cd1433410e16c20c
BLAKE2b-256 7cfb41e13b94c6d7d64f2559bd1b4b39f49d065ddc5c4dd919a80f12bea6ccd1

See more details on using hashes here.

Provenance

The following attestation bundles were made for spooky_chess-1.0.0-cp314-cp314-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-1.0.0-cp314-cp314-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for spooky_chess-1.0.0-cp314-cp314-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 fabc0d824d256d8b8136b4dd8d235a7647bda02989cdcc006bffbf810a4ede41
MD5 fff79ab4b3213980dbe4a8bdc9cf576f
BLAKE2b-256 5285bd9e8b46cec7eee7d0f9898d1202aa6554c6e351a84b1d452f1719a763df

See more details on using hashes here.

Provenance

The following attestation bundles were made for spooky_chess-1.0.0-cp314-cp314-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-1.0.0-cp313-cp313-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for spooky_chess-1.0.0-cp313-cp313-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 8bbf7200963900cff50b1ec2c5239050e5b6e4c7ca13f89df99db4c3ae0d5211
MD5 f2f6a6421ad9e9de434d36ddcb44d4ea
BLAKE2b-256 585d389588e95dcd1e919d6ae291a7594112b3d192dcb04c19d7061a8ae5d396

See more details on using hashes here.

Provenance

The following attestation bundles were made for spooky_chess-1.0.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-1.0.0-cp313-cp313-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for spooky_chess-1.0.0-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 15e7fada6c965640bbd5cf7e23b7fdfc280889dca7705bbcbc10420c78c74f7a
MD5 408d5a2e7f440648973f413bef976069
BLAKE2b-256 cb7e0e332813f29d8ad44553e00dfff092fb961c3d5ea7af384c613d3f766ba1

See more details on using hashes here.

Provenance

The following attestation bundles were made for spooky_chess-1.0.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-1.0.0-cp312-cp312-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for spooky_chess-1.0.0-cp312-cp312-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 8e39f25a41b16b666a7cded0bdf1480d0c646a5ccef6c7fe495149bd10a4d63f
MD5 8b68b8623d4e2980b8a6a12f59dff0ad
BLAKE2b-256 e47b05862afbcdf000bfbe60bcbdb66a1a9688d8c1fd903b86b2e1b2862f0c95

See more details on using hashes here.

Provenance

The following attestation bundles were made for spooky_chess-1.0.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-1.0.0-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for spooky_chess-1.0.0-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 f7476b780cee70e08e891a26fa74f5c254043a915b1eae09a8772b14322aabbb
MD5 847458e8a649ea6ac1af3e6e2e79d448
BLAKE2b-256 f09fe61772cacdb5fbdecb834d2f0f29565fa7173af607acebd534eec14ac63f

See more details on using hashes here.

Provenance

The following attestation bundles were made for spooky_chess-1.0.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-1.0.0-cp311-cp311-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for spooky_chess-1.0.0-cp311-cp311-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 1312ee9f7d263d456a1336701698555706f06c25301021c0ae2f06d41135008e
MD5 4b90477964b63936e7f856e36162fdc6
BLAKE2b-256 0ee6ed19d23f7a7e44a2ece4edb3d02a0932d3430c773b0bf9c7d4b8e6cfb262

See more details on using hashes here.

Provenance

The following attestation bundles were made for spooky_chess-1.0.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-1.0.0-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for spooky_chess-1.0.0-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 6881c6b5a80d7897838b1150b4f8e460760f9c588c7afe419cce7d2142d1971e
MD5 6b9c2e7715fd6b0fcd3ea656267ebbfb
BLAKE2b-256 924934fe429c45c91062a4a30a011322ee6846ec938081dc84d801d2501e4f0a

See more details on using hashes here.

Provenance

The following attestation bundles were made for spooky_chess-1.0.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