Skip to main content

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 Variant trait.
  • FEN and EPD, reading KQkq and the AHah of X-FEN and Shredder-FEN alike, and writing KQkq whenever the rook files allow it.
  • Legal move generation into a MoveList that 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 — plus MoveFacts for every legal move, all side-relative and in the mover's view.
  • Schema, a versioned manifest with a schema_id, and batch encoders that write f32 rows without allocating.

Documentation

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

esca-0.1.0.tar.gz (234.3 kB view details)

Uploaded Source

Built Distributions

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

esca-0.1.0-cp312-abi3-win_amd64.whl (829.8 kB view details)

Uploaded CPython 3.12+Windows x86-64

esca-0.1.0-cp312-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.1 MB view details)

Uploaded CPython 3.12+manylinux: glibc 2.17+ x86-64

esca-0.1.0-cp312-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (1.0 MB view details)

Uploaded CPython 3.12+manylinux: glibc 2.17+ ARM64

esca-0.1.0-cp312-abi3-macosx_11_0_arm64.whl (940.6 kB view details)

Uploaded CPython 3.12+macOS 11.0+ ARM64

esca-0.1.0-cp312-abi3-macosx_10_12_x86_64.whl (970.7 kB view details)

Uploaded CPython 3.12+macOS 10.12+ x86-64

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

Hashes for esca-0.1.0.tar.gz
Algorithm Hash digest
SHA256 b17047a9cb398fbdf4a3ab7051f04426d02b702ada1dea83fbc1720834c4ae19
MD5 feb4ad86a189317a6f6064be345f70c1
BLAKE2b-256 577a279fe2bedb06d0add47716efa0461580286eb578189c2e037e01f00dd783

See more details on using hashes here.

Provenance

The following attestation bundles were made for esca-0.1.0.tar.gz:

Publisher: publish.yml on AnglerfishChess/anglerfish

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

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

Hashes for esca-0.1.0-cp312-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 8d840e5250f65f3d880691e9520484bdeb65d638d6625d34dcb4cd508ff5157d
MD5 d1bd4aa67356048163349638aac19dee
BLAKE2b-256 b14494bac4d01b2566721044c41e00a0b9bc49e73245e049c9670aa3f907f0c1

See more details on using hashes here.

Provenance

The following attestation bundles were made for esca-0.1.0-cp312-abi3-win_amd64.whl:

Publisher: publish.yml on AnglerfishChess/anglerfish

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

File details

Details for the file esca-0.1.0-cp312-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for esca-0.1.0-cp312-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 70d0126f2441904fc76723baf35d66ab82030929746e09c40c55030c8914483f
MD5 05619217eb85680da273cc2f74d787ef
BLAKE2b-256 33c6fb324dfd3e5b36956c6839d75f05b16b5a093698a855be67ca9540645c0c

See more details on using hashes here.

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

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

File details

Details for the file esca-0.1.0-cp312-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for esca-0.1.0-cp312-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 2bd1d447ab75ad602003adb392f62d26b181d67cd0fba2a40a140f0471601bb0
MD5 63229447334fd3cbc9a0b478855ee9b5
BLAKE2b-256 7a8f693083a3fd034e6bf1b38bf477ce85ba40065fdd73ce3136972eedddc74e

See more details on using hashes here.

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

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

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

Hashes for esca-0.1.0-cp312-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 bb445f4ee5aaa9aa542f793bfd9031181b03804995eba3e95038bd03f16ec22b
MD5 bd4fd86dc50833d5206ab630ef4d30ce
BLAKE2b-256 efa901302585420e30bc1ca286419dbbedd6896c565dad8fbd0182825a4d7d16

See more details on using hashes here.

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

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

File details

Details for the file esca-0.1.0-cp312-abi3-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for esca-0.1.0-cp312-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 d8fe195038d39f8c8cb253ba2879d3f6c588811d5c6e59077525b1b84080a703
MD5 1c1fdbeb3eb8fa7d729dad13c1a25384
BLAKE2b-256 f2bb3154d885b1c4e191d500058582b07274a89c6982177c4d991fd8fa9ea337

See more details on using hashes here.

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

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

Release history Release notifications | RSS feed

0.3.0

6 files

0.2.1

6 files

0.2.0

6 files

This release

0.1.0 This release

6 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page