esca
A chess model that answers what is true about a position — a Rust crate and a Python package built from it.
The esca is the anglerfish's lure: the small thing that lights up what is in front of it.
Position is placement and state and nothing else. Rules live in Variant implementations —
Classic and Chess960 — so a position can be asked the same question under different rules, and
a new variant is a new implementation and nothing else. A Game pairs a variant with the moves
played, which is what repetition and claimable draws need. Facts answers what is true about a
position, both as prose a reader can check and as the flat f32 row a net consumes.
Rust
[dependencies]
esca = "0.1"
use esca::{Game, Schema, Side, classic};
let mut game = Game::new(classic()); // Chess960 rules: `esca::chess960()`
game.play_san("e4").unwrap();
game.play_uci("e7e5").unwrap();
println!("{}", game.position().fen());
let facts = game.facts(); // side-relative, in the mover's view
println!("{}", facts.tactics[Side::Us.index()].legal_move_count);
println!("{}", facts.summary());
let schema = Schema::v0(); // the row a net eats: 1065 f32
println!("{}", facts.encode(schema, schema.all()).len());
Cargo features, neither on by default: lichess (streaming reader for the Lichess evaluation
dump) and python (the PyO3 module the wheel is built from).
Python
pip install esca
import esca
game = esca.Game() # Chess960 rules: esca.Game(variant=esca.CHESS960)
game.play_san("e4")
game.play("e7e5")
print(game.position.fen)
facts = game.facts() # side-relative: index with esca.US / esca.THEM
print(facts.tactics[esca.US].legal_move_count)
print(facts.summary())
rows = esca.encode([game.position.fen]) # (1, 1065) float32, ready for a net
print(rows.shape, esca.SCHEMA_ID)
Wheels are abi3 for Python 3.12 and up. esca.lichess.batches() streams the evaluation dump as
encoded batches with their targets.
What it covers
- Classic chess and Chess960, behind one
Varianttrait. - FEN and EPD, reading
KQkqand theAHahof X-FEN and Shredder-FEN alike, and writingKQkqwhenever the rook files allow it. - Legal move generation into a
MoveListthat never allocates. - UCI move text in either castling spelling, and SAN with the disambiguation it needs.
- Checkmate, stalemate, insufficient material, the fifty- and seventy-five-move rules, and threefold and fivefold repetition.
Facts: nine groups of cheap position facts — state, material, pawns, pieces, king, mobility, attacks, one-ply tactics and attack planes — plusMoveFactsfor every legal move, all side-relative and in the mover's view.Schema, a versioned manifest with aschema_id, and batch encoders that writef32rows without allocating.
Documentation
docs/esca-api.md— the API in both languages.docs/esca-vocabulary.md— the terms the API and the facts are named after.
License
MIT — see LICENSE.
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 esca-0.1.0.tar.gz.
File metadata
- Download URL: esca-0.1.0.tar.gz
- Upload date:
- Size: 234.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b17047a9cb398fbdf4a3ab7051f04426d02b702ada1dea83fbc1720834c4ae19
|
|
| MD5 |
feb4ad86a189317a6f6064be345f70c1
|
|
| BLAKE2b-256 |
577a279fe2bedb06d0add47716efa0461580286eb578189c2e037e01f00dd783
|
Provenance
The following attestation bundles were made for esca-0.1.0.tar.gz:
Publisher:
publish.yml on AnglerfishChess/anglerfish
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
esca-0.1.0.tar.gz -
Subject digest:
b17047a9cb398fbdf4a3ab7051f04426d02b702ada1dea83fbc1720834c4ae19 - Sigstore transparency entry: 2693449613
- Sigstore integration time:
-
Permalink:
AnglerfishChess/anglerfish@932b06e70f741b269a9190259fc403df4718920e -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/AnglerfishChess
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@932b06e70f741b269a9190259fc403df4718920e -
Trigger Event:
release
-
Statement type:
File details
Details for the file esca-0.1.0-cp312-abi3-win_amd64.whl.
File metadata
- Download URL: esca-0.1.0-cp312-abi3-win_amd64.whl
- Upload date:
- Size: 829.8 kB
- Tags: CPython 3.12+, Windows x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8d840e5250f65f3d880691e9520484bdeb65d638d6625d34dcb4cd508ff5157d
|
|
| MD5 |
d1bd4aa67356048163349638aac19dee
|
|
| BLAKE2b-256 |
b14494bac4d01b2566721044c41e00a0b9bc49e73245e049c9670aa3f907f0c1
|
Provenance
The following attestation bundles were made for esca-0.1.0-cp312-abi3-win_amd64.whl:
Publisher:
publish.yml on AnglerfishChess/anglerfish
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
esca-0.1.0-cp312-abi3-win_amd64.whl -
Subject digest:
8d840e5250f65f3d880691e9520484bdeb65d638d6625d34dcb4cd508ff5157d - Sigstore transparency entry: 2693449870
- Sigstore integration time:
-
Permalink:
AnglerfishChess/anglerfish@932b06e70f741b269a9190259fc403df4718920e -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/AnglerfishChess
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@932b06e70f741b269a9190259fc403df4718920e -
Trigger Event:
release
-
Statement type:
File details
Details for the file esca-0.1.0-cp312-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.
File metadata
- Download URL: esca-0.1.0-cp312-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 1.1 MB
- Tags: CPython 3.12+, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
70d0126f2441904fc76723baf35d66ab82030929746e09c40c55030c8914483f
|
|
| MD5 |
05619217eb85680da273cc2f74d787ef
|
|
| BLAKE2b-256 |
33c6fb324dfd3e5b36956c6839d75f05b16b5a093698a855be67ca9540645c0c
|
Provenance
The following attestation bundles were made for esca-0.1.0-cp312-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:
Publisher:
publish.yml on AnglerfishChess/anglerfish
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
esca-0.1.0-cp312-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl -
Subject digest:
70d0126f2441904fc76723baf35d66ab82030929746e09c40c55030c8914483f - Sigstore transparency entry: 2693450098
- Sigstore integration time:
-
Permalink:
AnglerfishChess/anglerfish@932b06e70f741b269a9190259fc403df4718920e -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/AnglerfishChess
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@932b06e70f741b269a9190259fc403df4718920e -
Trigger Event:
release
-
Statement type:
File details
Details for the file esca-0.1.0-cp312-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.
File metadata
- Download URL: esca-0.1.0-cp312-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
- Upload date:
- Size: 1.0 MB
- Tags: CPython 3.12+, manylinux: glibc 2.17+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2bd1d447ab75ad602003adb392f62d26b181d67cd0fba2a40a140f0471601bb0
|
|
| MD5 |
63229447334fd3cbc9a0b478855ee9b5
|
|
| BLAKE2b-256 |
7a8f693083a3fd034e6bf1b38bf477ce85ba40065fdd73ce3136972eedddc74e
|
Provenance
The following attestation bundles were made for esca-0.1.0-cp312-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl:
Publisher:
publish.yml on AnglerfishChess/anglerfish
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
esca-0.1.0-cp312-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl -
Subject digest:
2bd1d447ab75ad602003adb392f62d26b181d67cd0fba2a40a140f0471601bb0 - Sigstore transparency entry: 2693449984
- Sigstore integration time:
-
Permalink:
AnglerfishChess/anglerfish@932b06e70f741b269a9190259fc403df4718920e -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/AnglerfishChess
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@932b06e70f741b269a9190259fc403df4718920e -
Trigger Event:
release
-
Statement type:
File details
Details for the file esca-0.1.0-cp312-abi3-macosx_11_0_arm64.whl.
File metadata
- Download URL: esca-0.1.0-cp312-abi3-macosx_11_0_arm64.whl
- Upload date:
- Size: 940.6 kB
- Tags: CPython 3.12+, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bb445f4ee5aaa9aa542f793bfd9031181b03804995eba3e95038bd03f16ec22b
|
|
| MD5 |
bd4fd86dc50833d5206ab630ef4d30ce
|
|
| BLAKE2b-256 |
efa901302585420e30bc1ca286419dbbedd6896c565dad8fbd0182825a4d7d16
|
Provenance
The following attestation bundles were made for esca-0.1.0-cp312-abi3-macosx_11_0_arm64.whl:
Publisher:
publish.yml on AnglerfishChess/anglerfish
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
esca-0.1.0-cp312-abi3-macosx_11_0_arm64.whl -
Subject digest:
bb445f4ee5aaa9aa542f793bfd9031181b03804995eba3e95038bd03f16ec22b - Sigstore transparency entry: 2693450200
- Sigstore integration time:
-
Permalink:
AnglerfishChess/anglerfish@932b06e70f741b269a9190259fc403df4718920e -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/AnglerfishChess
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@932b06e70f741b269a9190259fc403df4718920e -
Trigger Event:
release
-
Statement type:
File details
Details for the file esca-0.1.0-cp312-abi3-macosx_10_12_x86_64.whl.
File metadata
- Download URL: esca-0.1.0-cp312-abi3-macosx_10_12_x86_64.whl
- Upload date:
- Size: 970.7 kB
- Tags: CPython 3.12+, macOS 10.12+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d8fe195038d39f8c8cb253ba2879d3f6c588811d5c6e59077525b1b84080a703
|
|
| MD5 |
1c1fdbeb3eb8fa7d729dad13c1a25384
|
|
| BLAKE2b-256 |
f2bb3154d885b1c4e191d500058582b07274a89c6982177c4d991fd8fa9ea337
|
Provenance
The following attestation bundles were made for esca-0.1.0-cp312-abi3-macosx_10_12_x86_64.whl:
Publisher:
publish.yml on AnglerfishChess/anglerfish
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
esca-0.1.0-cp312-abi3-macosx_10_12_x86_64.whl -
Subject digest:
d8fe195038d39f8c8cb253ba2879d3f6c588811d5c6e59077525b1b84080a703 - Sigstore transparency entry: 2693449763
- Sigstore integration time:
-
Permalink:
AnglerfishChess/anglerfish@932b06e70f741b269a9190259fc403df4718920e -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/AnglerfishChess
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@932b06e70f741b269a9190259fc403df4718920e -
Trigger Event:
release
-
Statement type: