Skip to content

Commit 51e19e8

Browse files
Expand READMEs
1 parent 94bea90 commit 51e19e8

4 files changed

Lines changed: 65 additions & 1 deletion

File tree

README.md

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# Aix - `aixchess` DuckDB extension
2+
3+
Aix enables efficient storage and querying of large chess game collections. Read more on [my blog post](https://thomasd.be/2026/02/01/aix-storing-querying-chess-games.html) and the [documentation](docs/README.md).
4+
5+
Get started by:
6+
7+
* [Installing the `aixchess` extension](https://github.com/thomas-daniels/aix/releases/tag/v0.1.0) for DuckDB.
8+
* Download one of the [Aix-compatible Lichess database files](https://huggingface.co/datasets/thomasd1/aix-lichess-database).
9+
10+
With the `aixchess` extension loaded, you can execute SQL queries over a chess game collection. For example, this query generates a heatmap of king move destinations:
11+
12+
```sql
13+
with king_destinations as (
14+
select
15+
move_details(movedata)
16+
.list_filter(lambda m: m.role = 'k')
17+
.apply(lambda m: m.to)
18+
as destinations
19+
from 'aix_lichess_2025-12_low.parquet'
20+
),
21+
unnested as (
22+
select unnest(destinations) as destination from king_destinations
23+
),
24+
aggregated as (
25+
select destination, count() from unnested group by 1 order by 2 desc
26+
)
27+
28+
from aggregated;
29+
```
30+
31+
Which results in:
32+
33+
```
34+
┌─────────────┬──────────────┐
35+
│ destination │ count_star() │
36+
│ varchar │ int64 │
37+
├─────────────┼──────────────┤
38+
│ g1 │ 74020594 │
39+
│ g8 │ 71579360 │
40+
│ g7 │ 23388424 │
41+
...
42+
```
43+
44+
The conversion from Lichess PGNs to Aix-compatible files is done using [`pgn-to-aix`](pgn-to-aix/README.md). At the moment, this tool is specifically tailored towards Lichess PGNs.
45+
46+
## Building the extension yourself
47+
48+
Make sure that CMake, [Ninja](https://ninja-build.org/), [ccache](https://ccache.dev/), and Cargo are installed. Build the extension using:
49+
50+
```
51+
GEN=ninja make
52+
```
53+
54+
A DuckDB binary with the extension loaded is then available in `./build/release/duckdb`. Running unit tests is possible with `make test`.

aix-chess-compression/Cargo.toml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,14 @@
11
[package]
22
name = "aix-chess-compression"
33
version = "0.1.0"
4+
authors = ["Thomas Daniels <daniels.thomas@pm.me>"]
45
edition = "2024"
6+
license = "GPL-3.0+"
7+
keywords = ["compression", "decompression", "chess", "huffman"]
8+
readme = "README.md"
9+
repository = "https://github.com/thomas-daniels/aix"
10+
categories = ["compression", "encoding", "algorithms", "games"]
11+
description = "Binary encoding and decoding for chess games, as used by Aix"
512

613
[dependencies]
714
chess-huffman = "0.12.1"

aix-chess-compression/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# aix-chess-compression
2+
3+
Provides binary encoding and decoding for chess games, used by [Aix](https://github.com/thomas-daniels/aix).

docs/encoding.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Binary encoding of chess games
22

3-
Aix makes use of a binary encoding for the moves in a chess game (the [movedata column](columns.md) in the Aix-compatible Lichess database).
3+
Aix makes use of a binary encoding for the moves in a chess game (the [movedata column](columns.md) in the Aix-compatible Lichess database). See [the blog post](https://thomasd.be/2026/02/01/aix-storing-querying-chess-games.html#space-efficient-storage) for details.
44

55
There are three possible compression levels for the binary encoding: Low, Medium, and High. A lower compression level takes up more disk space, but the decoding speed is higher. The [`recompress` function](functions.md#recompress) can transform encoded games between different compression levels.

0 commit comments

Comments
 (0)