File size: 3,484 Bytes
9480dc9
964ad12
 
 
 
 
 
 
 
 
615b2a1
 
964ad12
 
9480dc9
964ad12
 
 
 
 
 
 
 
 
 
9480dc9
964ad12
 
 
 
 
 
 
 
 
 
615b2a1
964ad12
 
 
615b2a1
 
 
 
 
 
964ad12
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
---
configs:
  - config_name: 1d_w81
    data_files: "data/1d_w81/*.parquet"
  - config_name: 1d_w400
    data_files: "data/1d_w400/*.parquet"
  - config_name: 1d_w900
    data_files: "data/1d_w900/*.parquet"
  - config_name: 2d_9x9
    data_files: "data/2d_9x9/*.parquet"
  - config_name: 2d_20x20
    data_files: "data/2d_20x20/*.parquet"
  - config_name: 2d_30x30
    data_files: "data/2d_30x30/*.parquet"
license: mit
task_categories:
  - reasoning
tags:
  - cellular-automata
  - recursive-reasoning
  - rule110
  - game-of-life
  - parquet
size_categories:
  - 100K<n<1M
---

# CAInvert: Cellular Automata Inversion Reasoning Benchmark

Official Dataset Repository for [CAInvert (GitHub)](https://github.com/randomNumber101/cainvert).

CAInvert evaluates recursive and latent neural reasoning models on **computationally irreducible cellular automata dynamics**.
Given an evolved future state $S_D$ at depth $D$ alongside sparse disambiguating hints, the model's task is to invert the physical trajectory and reconstruct the ancestral ground-truth initial state $S_0$.

## Dataset Portfolio

Total verified preimage trees: **510,364** across 1D and 2D lattices:

| Config | Dimension | Rule | Lattice Shape | Sequence Length | Total Trees | Shards | Depths ($d$) |
| :--- | :---: | :---: | :---: | :---: | :---: | :---: | :---: |
| **`1d_w81`** | 1D | Rule 110 | (81,) | $N = 81$ | 249,920 | 100 shards | 1, 2, 3, 4, 6, 8, 10, 12 |
| **`1d_w400`** | 1D | Rule 110 | (400,) | $N = 400$ | 149,920 | 60 shards | 1, 2, 3, 4, 6, 8, 10, 12 |
| **`1d_w900`** | 1D | Rule 110 | (900,) | $N = 900$ | 100,000 | 40 shards | 1, 2, 3, 4, 6, 8, 10, 12 |
| **`2d_9x9`** | 2D | Life B3/S23 | (9, 9) | $N = 81$ | 6,000 | 192 shards | 1, 2, 3, 4, 6, 8, 10, 12 |
| **`2d_20x20`** | 2D | Life B3/S23 | (20, 20) | $N = 400$ | 2,200 | 411 shards | 1, 2, 3, 4, 6, 8, 10 |
| **`2d_30x30`** | 2D | Life B3/S23 | (30, 30) | $N = 900$ | 2,324 | 437 shards | 1, 2, 3, 4, 6, 8, 10 |

## Sequence Layout & Prediction Task

Every sample in the Parquet files contains:
- `target_state`: Byte buffer of length $N$ representing $S_D$.
- `ground_truth_s0`: Byte buffer of length $N$ representing target $S_0$.
- `hints_s0`: Int8 array of length $N$ where `-1` represents unrevealed/masked bits and values in `{0, 1}` represent spatial hint tape tokens.
- `depth`: Integer recursion depth $d$.
- `leaf_count`: Number of alternative preimages in the branching tree ($\Lambda$).
- `effective_branching`: Geometric branching rate $b_{\text{eff}} = \Lambda^{1/d}$.

### Model Input Format:
$$\mathbf{X} = [S_D] \circ [\mathtt{[SEP]=3}] \circ [H_0 \text{ (with MASK=2)}]$$
Total input length: $2N + 1$ tokens. Target: $S_0 \in \{0, 1\}^N$.

## Loading Data

### 1. PyTorch (`cainvert`)
```python
from cainvert.storage.torch_dataset import CAInversionDataset

dataset = CAInversionDataset.from_hub(
    repo_id="randomnumber101/cainvert-benchmark",
    split="1d_w81",
    depth_min=4,
    depth_max=8
)
```

### 2. Hugging Face Datasets
```python
from datasets import load_dataset

ds = load_dataset("randomnumber101/cainvert-benchmark", "1d_w81")
```

### 3. Zero-Download DuckDB Queries
```python
import duckdb

conn = duckdb.connect()
conn.execute("INSTALL httpfs; LOAD httpfs;")
df = conn.execute("""
    SELECT depth, COUNT(*), AVG(leaf_count)
    FROM read_parquet('https://huggingface.co/datasets/randomnumber101/cainvert-benchmark/resolve/main/data/1d_w81/*.parquet')
    GROUP BY depth
""").df()
print(df)
```