Datasets:
program stringlengths 2 12 | length uint8 2 12 | halts bool 2
classes | steps uint32 2 65.5k | output_length uint16 1 4.1k | output_class stringclasses 7
values | class_param uint8 0 255 | preperiod uint16 0 4.1k | period uint16 0 1.37k | zlib_size uint16 9 4.11k |
|---|---|---|---|---|---|---|---|---|---|
+. | 2 | true | 2 | 1 | ends_in_zeros | 0 | 1 | 1 | 9 |
-. | 2 | true | 2 | 1 | ends_in_zeros | 0 | 1 | 1 | 9 |
X. | 2 | true | 2 | 1 | ends_in_zeros | 0 | 1 | 1 | 9 |
++. | 3 | true | 3 | 1 | ends_in_zeros | 0 | 1 | 1 | 9 |
+.. | 3 | true | 3 | 2 | ends_in_zeros | 0 | 2 | 1 | 10 |
--. | 3 | true | 3 | 1 | ends_in_zeros | 0 | 1 | 1 | 9 |
-.. | 3 | true | 3 | 2 | ends_in_zeros | 0 | 2 | 1 | 10 |
.+. | 3 | true | 3 | 2 | ends_in_zeros | 0 | 2 | 1 | 10 |
.-. | 3 | true | 3 | 2 | ends_in_zeros | 0 | 2 | 1 | 10 |
.X. | 3 | true | 3 | 2 | ends_in_zeros | 0 | 2 | 1 | 10 |
X+. | 3 | true | 3 | 1 | ends_in_zeros | 0 | 1 | 1 | 9 |
X-. | 3 | true | 3 | 1 | ends_in_zeros | 0 | 1 | 1 | 9 |
X.. | 3 | true | 3 | 2 | ends_in_zeros | 0 | 2 | 1 | 10 |
+<-V | 4 | true | 4 | 2 | ends_in_zeros | 0 | 2 | 1 | 10 |
+<XV | 4 | true | 4 | 2 | ends_in_zeros | 0 | 2 | 1 | 10 |
+++. | 4 | true | 4 | 1 | ends_in_zeros | 0 | 1 | 1 | 9 |
++.. | 4 | true | 4 | 2 | ends_in_zeros | 0 | 2 | 1 | 10 |
+[.] | 4 | false | 8,191 | 4,095 | eventually_constant | 0 | 0 | 1 | 27 |
+.+. | 4 | true | 4 | 2 | ends_in_zeros | 0 | 2 | 1 | 10 |
+... | 4 | true | 4 | 3 | ends_in_zeros | 0 | 3 | 1 | 11 |
+.X. | 4 | true | 4 | 2 | ends_in_zeros | 0 | 2 | 1 | 10 |
+L+V | 4 | true | 4 | 2 | ends_in_zeros | 0 | 2 | 1 | 10 |
+L-V | 4 | true | 4 | 2 | ends_in_zeros | 0 | 2 | 1 | 10 |
+LXV | 4 | true | 4 | 2 | ends_in_zeros | 0 | 2 | 1 | 10 |
+C-V | 4 | true | 4 | 3 | ends_in_zeros | 0 | 3 | 1 | 11 |
+CXV | 4 | true | 4 | 3 | ends_in_zeros | 0 | 3 | 1 | 11 |
+V-. | 4 | true | 4 | 2 | ends_in_zeros | 0 | 2 | 1 | 10 |
-<XV | 4 | true | 4 | 2 | ends_in_zeros | 0 | 2 | 1 | 10 |
---. | 4 | true | 4 | 1 | ends_in_zeros | 0 | 1 | 1 | 9 |
--.. | 4 | true | 4 | 2 | ends_in_zeros | 0 | 2 | 1 | 10 |
-[.] | 4 | false | 8,191 | 4,095 | eventually_constant | 0 | 0 | 1 | 26 |
-.-. | 4 | true | 4 | 2 | ends_in_zeros | 0 | 2 | 1 | 10 |
-... | 4 | true | 4 | 3 | ends_in_zeros | 0 | 3 | 1 | 11 |
-.X. | 4 | true | 4 | 2 | ends_in_zeros | 0 | 2 | 1 | 10 |
-L+V | 4 | true | 4 | 2 | ends_in_zeros | 0 | 2 | 1 | 10 |
-L-V | 4 | true | 4 | 2 | ends_in_zeros | 0 | 2 | 1 | 10 |
-LXV | 4 | true | 4 | 2 | ends_in_zeros | 0 | 2 | 1 | 10 |
-C+V | 4 | true | 4 | 3 | ends_in_zeros | 0 | 3 | 1 | 11 |
-CXV | 4 | true | 4 | 3 | ends_in_zeros | 0 | 3 | 1 | 11 |
.++. | 4 | true | 4 | 2 | ends_in_zeros | 0 | 2 | 1 | 10 |
.+.. | 4 | true | 4 | 3 | ends_in_zeros | 0 | 3 | 1 | 11 |
.--. | 4 | true | 4 | 2 | ends_in_zeros | 0 | 2 | 1 | 10 |
.-.. | 4 | true | 4 | 3 | ends_in_zeros | 0 | 3 | 1 | 11 |
..+. | 4 | true | 4 | 3 | ends_in_zeros | 0 | 3 | 1 | 11 |
..-. | 4 | true | 4 | 3 | ends_in_zeros | 0 | 3 | 1 | 11 |
..X. | 4 | true | 4 | 3 | ends_in_zeros | 0 | 3 | 1 | 11 |
.X+. | 4 | true | 4 | 2 | ends_in_zeros | 0 | 2 | 1 | 10 |
.X-. | 4 | true | 4 | 2 | ends_in_zeros | 0 | 2 | 1 | 10 |
.X.. | 4 | true | 4 | 3 | ends_in_zeros | 0 | 3 | 1 | 11 |
X++. | 4 | true | 4 | 1 | ends_in_zeros | 0 | 1 | 1 | 9 |
X+.. | 4 | true | 4 | 2 | ends_in_zeros | 0 | 2 | 1 | 10 |
X--. | 4 | true | 4 | 1 | ends_in_zeros | 0 | 1 | 1 | 9 |
X-.. | 4 | true | 4 | 2 | ends_in_zeros | 0 | 2 | 1 | 10 |
X[.] | 4 | false | 8,191 | 4,095 | eventually_constant | 0 | 0 | 1 | 28 |
X.+. | 4 | true | 4 | 2 | ends_in_zeros | 0 | 2 | 1 | 10 |
X.-. | 4 | true | 4 | 2 | ends_in_zeros | 0 | 2 | 1 | 10 |
X... | 4 | true | 4 | 3 | ends_in_zeros | 0 | 3 | 1 | 11 |
XL>. | 4 | true | 4 | 1 | ends_in_zeros | 0 | 1 | 1 | 9 |
XL+V | 4 | true | 4 | 2 | ends_in_zeros | 0 | 2 | 1 | 10 |
XL-V | 4 | true | 4 | 2 | ends_in_zeros | 0 | 2 | 1 | 10 |
XLXV | 4 | true | 4 | 2 | ends_in_zeros | 0 | 2 | 1 | 10 |
XN<. | 4 | true | 4 | 1 | ends_in_zeros | 0 | 1 | 1 | 9 |
XC+V | 4 | true | 4 | 3 | ends_in_zeros | 0 | 3 | 1 | 11 |
XC-V | 4 | true | 4 | 3 | ends_in_zeros | 0 | 3 | 1 | 11 |
+<++V | 5 | true | 5 | 2 | ends_in_zeros | 0 | 2 | 1 | 10 |
+<--V | 5 | true | 5 | 2 | ends_in_zeros | 0 | 2 | 1 | 10 |
+<-.V | 5 | true | 5 | 3 | ends_in_zeros | 0 | 3 | 1 | 11 |
+<.-V | 5 | true | 5 | 3 | ends_in_zeros | 0 | 3 | 1 | 11 |
+<.XV | 5 | true | 5 | 3 | ends_in_zeros | 0 | 3 | 1 | 11 |
+<X+V | 5 | true | 5 | 2 | ends_in_zeros | 0 | 2 | 1 | 10 |
+<X-V | 5 | true | 5 | 2 | ends_in_zeros | 0 | 2 | 1 | 10 |
+<X.V | 5 | true | 5 | 3 | ends_in_zeros | 0 | 3 | 1 | 11 |
++<-V | 5 | true | 5 | 2 | ends_in_zeros | 0 | 2 | 1 | 10 |
++<XV | 5 | true | 5 | 2 | ends_in_zeros | 0 | 2 | 1 | 10 |
++++. | 5 | true | 5 | 1 | ends_in_zeros | 0 | 1 | 1 | 9 |
+++.. | 5 | true | 5 | 2 | ends_in_zeros | 0 | 2 | 1 | 10 |
++[.] | 5 | false | 8,192 | 4,095 | eventually_constant | 0 | 0 | 1 | 27 |
++.+. | 5 | true | 5 | 2 | ends_in_zeros | 0 | 2 | 1 | 10 |
++... | 5 | true | 5 | 3 | ends_in_zeros | 0 | 3 | 1 | 11 |
++.X. | 5 | true | 5 | 2 | ends_in_zeros | 0 | 2 | 1 | 10 |
++L>. | 5 | true | 5 | 1 | ends_in_zeros | 0 | 1 | 1 | 9 |
++L+V | 5 | true | 5 | 2 | ends_in_zeros | 0 | 2 | 1 | 10 |
++L-V | 5 | true | 5 | 2 | ends_in_zeros | 0 | 2 | 1 | 10 |
++LXV | 5 | true | 5 | 2 | ends_in_zeros | 0 | 2 | 1 | 10 |
++C+V | 5 | true | 5 | 3 | ends_in_zeros | 0 | 3 | 1 | 11 |
++C-V | 5 | true | 5 | 3 | ends_in_zeros | 0 | 3 | 1 | 11 |
++CXV | 5 | true | 5 | 3 | ends_in_zeros | 0 | 3 | 1 | 11 |
++V-. | 5 | true | 5 | 2 | ends_in_zeros | 0 | 2 | 1 | 10 |
+[+.] | 5 | true | 767 | 254 | ends_in_zeros | 0 | 254 | 1 | 265 |
+[.+] | 5 | true | 767 | 255 | ends_in_zeros | 0 | 255 | 1 | 266 |
+[.X] | 5 | false | 12,285 | 4,095 | eventually_constant | 0 | 1 | 1 | 28 |
+[V-] | 5 | false | 768 | 4,095 | eventually_periodic | 0 | 0 | 256 | 45 |
+[VX] | 5 | false | 768 | 4,095 | eventually_periodic | 0 | 0 | 256 | 46 |
+.<-V | 5 | true | 5 | 3 | ends_in_zeros | 0 | 3 | 1 | 11 |
+.<XV | 5 | true | 5 | 3 | ends_in_zeros | 0 | 3 | 1 | 11 |
+..+. | 5 | true | 5 | 3 | ends_in_zeros | 0 | 3 | 1 | 11 |
+.... | 5 | true | 5 | 4 | ends_in_zeros | 0 | 4 | 1 | 12 |
+..X. | 5 | true | 5 | 3 | ends_in_zeros | 0 | 3 | 1 | 11 |
+.L+V | 5 | true | 5 | 3 | ends_in_zeros | 0 | 3 | 1 | 11 |
+.L-V | 5 | true | 5 | 3 | ends_in_zeros | 0 | 3 | 1 | 11 |
brainphoque-minimal-14
Every distinct output of every Brainf*ck-style program of up to 14 symbols, on a fixed machine, each
paired with a certified shortest program that produces it. That is 12,484,888,189 outputs in total,
found by exhaustive search. Each row is one output, stored as its shortest program plus metadata. The
outputs themselves are not stored, because they are fully determined by the program: re-running it
with the included interpreter (code/bf.py, code/bfrun.c) gives the bytes back.
The intended use is pretraining and evaluating sequence models on algorithmically generated data whose description length is known exactly.
Source. This corpus was built independently for this release and is not from any paper. Only the
machine is borrowed: it is the Brainf*ck variant defined in Self-Play Pretraining with Zero Data
(Cowsik et al., 2026), without its input instruction ,. The enumeration, the certification of shortest
programs, the labels and all data here are ours.
The machine
A program is a string over 17 symbols. It runs on a circular tape of 256 byte cells (all 0 at the start) with one head. Arithmetic is mod 256 and head movement wraps around the tape.
| Symbol | Effect | Equivalent loop |
|---|---|---|
+ - |
add or subtract 1 at the current cell | |
< > |
move the head left or right | |
[ ] |
skip past the matching ] if the cell is 0; jump back to the matching [ if it is not |
|
. |
print the current cell as one byte | |
Z |
set the cell to 0 | [-] |
X |
set the cell to 16 | [-] then sixteen + |
R |
add the cell to the right neighbor, then clear it | [->+<] |
L |
add 3 times the cell to the right neighbor, then clear it | [->+++<] |
N |
subtract the cell from the left neighbor, then clear it | [-<->] |
C |
add the cell to each of the next two cells, then clear it | [->+>+<<] |
G H |
move right (left) to the nearest zero cell; if there is none, the run never finishes | [>] [<] |
W |
if the cell is nonzero, clear it and add 1 to the right neighbor | [[-]>+<] |
V |
print and move right until a zero cell | [.>] |
- Steps. Every symbol costs one step, macros included (
Vcosts one step however much it prints). Unmatched brackets do nothing and cost a step. - Output. The first 4,095 printed bytes. A shorter output is padded with zero bytes, so two outputs are the same if they agree after trailing zero bytes are removed. (4,095 bytes plus one framing byte fill a 4,096-byte context, as in Cowsik et al.)
- Completion. A run counts only if it halts (runs off the end of the program) or prints its 4,095th byte within 65,536 steps. Runs cut off by the budget have no output and are not in the dataset.
code/bf.py is the executable specification; run_reference is about 60 lines of plain Python.
What "certified shortest" means
Programs were enumerated in order of length, and alphabetically within a length using the symbol order
< > + - [ ] . Z R L N C G H W V X. The program stored for an output is the first one in that order whose
run completes with that output. It is therefore a shortest program for the output among programs that
finish within the budget: a time-bounded Kolmogorov complexity, computed exactly, with ties broken by
that order.
The search skips a program only when it can exhibit an earlier program with the same output that is no
slower at any point. Examples: [-] is never placed where Z could be, +- is never placed, and a
prefix whose state an earlier prefix already reaches is not extended. This keeps the search exact. It
was checked byte for byte against brute force over all 1.2×1011 strings up to length 9, and
every stored program was re-run to confirm its output. Length 14 ran 2.1×1011 programs, out
of 1.7×1017 strings of that length.
The output of the empty program (all zeros) is not a row; no 1-symbol program has a nonzero output, so lengths start at 2.
Data fields
| Column | Type | Description |
|---|---|---|
program |
string | The certified shortest program |
length |
uint8 | Program length, 2–14 |
halts |
bool | True if the program halts; false if it prints all 4,095 bytes |
steps |
uint32 | Steps until it halts, or until it prints the 4,095th byte |
output_length |
uint16 | Output length after removing trailing zero bytes |
output_class |
string | First class that fits the 4,095-byte output (below) |
class_param |
uint8 | Degree for polynomial (1 = arithmetic progression), coefficient a for recurrence_1, else 0 |
preperiod |
uint16 | Index where the repeating part starts (for ends_in_zeros, where the zeros start) |
period |
uint16 | Length of the repeating part; 0 if none was found |
zlib_size |
uint16 | Size of the output (trailing zeros removed) compressed with zlib at level 6 |
Output classes, in the order they are tried:
output_class |
Meaning |
|---|---|
ends_in_zeros |
The output is zero after some point (output_length < 4,095). Includes programs that print 4,095 bytes ending in zeros. |
eventually_constant |
After a prefix, one nonzero byte repeats |
polynomial |
After a prefix, a polynomial mod 256 in the position (degree in class_param) |
recurrence_1 |
After a prefix, xn+1 = a·xn + b mod 256 with a ≠ 1 |
recurrence_2 |
After a prefix, xn+2 = a·xn+1 + b·xn + c mod 256 (for example Fibonacci) |
eventually_periodic |
Repeats with period, but fits none of the above |
not_periodic_in_window |
No period found that repeats at least three times within the window |
A tail is only claimed when it covers at least half of the output, and a period only when it repeats at least three times. These labels describe the 4,095-byte window, not the infinite sequence.
Files and configs
data/length_LL/part-PPP.parquet: one folder per program length. Lengths 2–12 are one file each, length 13 is 32 files and length 14 is 256 files (about 390 MB each). Within a length, rows are split between files by a hash of the output, so each file is a uniform random sample of its length. Within a file, rows are sorted by program in enumeration order.- Configs:
default(all lengths),length_02…length_14, andsamples_with_outputs. samples/with_outputs.parquet(samples_with_outputs): up to 100,000 random rows per length (all of them for lengths 2–8), with an extraoutputcolumn holding the output bytes, trailing zeros removed.code/:bf.py(reference interpreter and Python API),bfrun.c(fast interpreter, library and command-line tool),validate.py(checks a copy of the dataset).figures/: the plots shown below.
Statistics
| Length | Outputs | Cumulative | Halting | Ends in zeros | Eventually periodic (all kinds) | Not periodic in window |
|---|---|---|---|---|---|---|
| 2 | 3 | 3 | 100.0% | 100.0% | 0.0% | 0.0% |
| 3 | 10 | 13 | 100.0% | 100.0% | 0.0% | 0.0% |
| 4 | 51 | 64 | 94.1% | 94.1% | 5.9% | 0.0% |
| 5 | 226 | 290 | 93.4% | 93.4% | 6.6% | 0.0% |
| 6 | 1,129 | 1,419 | 87.3% | 87.3% | 11.3% | 1.3% |
| 7 | 6,523 | 7,942 | 73.1% | 74.1% | 20.4% | 5.4% |
| 8 | 42,995 | 50,937 | 55.6% | 57.4% | 32.8% | 9.7% |
| 9 | 317,265 | 368,202 | 40.0% | 42.6% | 42.8% | 14.6% |
| 10 | 2,487,113 | 2,855,315 | 28.7% | 32.0% | 49.1% | 18.9% |
| 11 | 20,097,697 | 22,953,012 | 21.3% | 25.1% | 52.2% | 22.7% |
| 12 | 163,928,427 | 186,881,439 | 16.7% | 20.7% | 53.5% | 25.8% |
| 13 | 1,340,740,150 | 1,527,621,589 | 13.8% | 17.9% | 53.6% | 28.5% |
| 14 | 10,957,266,600 | 12,484,888,189 | 11.9% | 16.1% | 53.0% | 30.8% |
"Eventually periodic (all kinds)" combines eventually_constant, polynomial, recurrence_1,
recurrence_2 and eventually_periodic. New outputs grow about 8x per added symbol.
More figures, with explanations, are in figures/: periods (73% of periodic length-14 outputs repeat
every 256 bytes), output lengths of halting programs, and how much of the step budget programs use.
Usage
from datasets import load_dataset
ds = load_dataset("turtlecannon/brainphoque-minimal-14", "length_10", split="train")
print(ds[0])
# {'program': '+<<<<+[V-]', 'length': 10, 'halts': False, 'steps': 770, 'output_length': 4095,
# 'output_class': 'eventually_periodic', 'class_param': 0, 'preperiod': 0, 'period': 256, 'zlib_size': 42}
# Length 14 is about 100 GB: stream it, or load a few files (each is a random sample of length 14).
ds14 = load_dataset("turtlecannon/brainphoque-minimal-14", "length_14", split="train", streaming=True)
Regenerate outputs with the included interpreter (build the C library once for speed:
cc -O2 -shared -fPIC -o code/libbfrun.so code/bfrun.c):
import sys; sys.path.insert(0, "code") # from a local copy of the repository
import bf
status, steps, output = bf.run("+[V-]") # output: bytes with trailing zeros removed
context = bf.padded(output) # the full 4,095-byte output
Each length is about 8x larger than the one before, so sampling rows uniformly sees mostly length 14. Use the per-length configs to choose your own mixture. Halting outputs are mostly short (median 266 bytes at length 14), so several can be packed into one context.
Limitations
- Time-bounded. "Shortest" is among programs that finish within 65,536 steps. A shorter program that needs more steps would not count.
- Window. Outputs are the first 4,095 bytes. Two programs whose outputs differ only later count as the same output, and class labels describe only the window.
- One program per output. Only the first shortest program (in enumeration order) is stored; other programs of the same length with the same output are not listed.
- Outputs are not stored. They must be regenerated by running the programs.
bfrun.cruns about 38,000 length-14 programs per second on one CPU core, so regenerating outputs inside a data loader needs a few cores per GPU at most.
License and citation
Data: CC BY 4.0. Code in code/: MIT (see code/LICENSE).
To cite this dataset:
@misc{brainphoque_minimal_14,
title = {brainphoque-minimal-14: certified shortest programs for all outputs of Brainf*ck-style programs up to length 14},
year = {2026},
howpublished = {Hugging Face dataset, turtlecannon/brainphoque-minimal-14}
}
The machine is defined in the following paper; please also cite it when you describe the machine. The paper is not the source of this data.
@article{cowsik2026selfplay,
title = {Self-Play Pretraining with Zero Data},
author = {Cowsik, Aditya and Dolev, Kfir and Li, Michael Y. and De Luca, G. Bruno and Cohen, Nourya and Goodman, Noah D. and Levine, Yoav},
note = {arXiv preprint 2609.30063},
year = {2026}
}
- Downloads last month
- 33



