Telomare, rebuilt from nine laws by a model that never saw Telomare
We wrote down what Telomare must be, and nothing about how: nine laws in Bend 2 (every program ends, within a time and a space known before it runs, and answers the same on one core, every core and the GPU) plus three measured ones. A model in a sealed sandbox, that could read nothing but those laws and Bend's own guide, designed and built a language that obeys them. Then a judge it never saw ran it on hidden programs, next to Telomare's master (Haskell) and bend branches.
bend PROOF.bend --verdict prints ALL PROOFS CHECK, and the same checker rejects a false proof and an unproved lawprovedtelomare-laws at 1da7c05 (the implementer's final state, 2026-12-04 12:19), PROOF.bend; rechecked by mugen after the rundoneBuilt, in about 3½ hours of agent time over seven sessions (two models), 485 tool calls: a language, its compiler and three evaluators in 5 361 lines of Bend, an OpenCL route in 808 lines of C, 130 lines of proof, a guide and a measurement report. Committed locally as 1da7c05; nothing pushed, rented or deleted.the agents' logs (tl-fable/run/agent-*.jsonl, olimpo), timestamps and tool calls per session
openNever run: T.gpu, the GPU function the laws name, on a GPU (it needs CUDA; olimpo has an AMD card). So the measured law "the GPU no slower than every core" is open for it.telomare-laws at 1da7c05 (the implementer's final state, 2026-12-04 12:19), impl/NEEDS.md, impl/GPU.md
Each claim is marked: proved (Bend's checker and the BendTT kernel accept it), measured, tested (a check that runs), done, claimed (a document says so), open, decided, lead. Hidden programs are named by family and size only (A16, B8, ...): the corpus stays hidden for the next implementer. Keys: → or space for next, ← back, a for all slides.
Can the laws alone make a Telomare?
Telomare has two implementations. master is the Haskell one: 17 593 lines in 44 files. The bend branch is a port to Bend 2 with its own runtime: 61 441 lines of Bend in 95 files, 651 of C. Both carry years of design choices, and neither has a written contract that a third implementation could be checked against.
So the experiment: distil what any Telomare must do into laws that Bend's checker can hold an implementation to, seal them, and hand them to a model that has never seen either implementation. If what comes back is proved against the laws and beats both on programs nobody showed it, the laws are the contract, and the implementation is replaceable.
| master | bend branch | telomare-laws (this) | |
|---|---|---|---|
| language of the implementation | Haskell | Bend 2, a C runtime | Bend 2; C only for the command's OpenCL route |
| lines (implementation) | 17 593 (44 files) | 61 441 Bend + 651 C + 399 Haskell | 5 361 Bend + 808 C |
| proofs | none against a written contract | of some parts; none of a whole contract | the nine laws, --verdict |
| who wrote it | Sam Griffin and others, since 2016 | mugen and its agents, since 2026-09 | Fable 5.2, then Opus 5.5, blind, 2026-12-04 |
Laws in, an implementation out, a judge it never met
The 7 steps, in words
- the goal: 12-03: "distill telomare laws from master and bend; time and space; CPU and GPU", then "laws only, no goldens" and "laws cover a hidden .tel corpus, with no influence on syntax".
- nine laws: mugen writes Spec.bend (the floor: data and eight forms), LAWS.bend (nine laws, three measured) and the brief, and tags them laws-sealed (ebe1322, 12-04 00:24).
- a copy: The sandbox sees the repository and Bend's own guide and library, nothing else on the machine; the network is a proxy that lets through api.anthropic.com only; /dev/dri for the GPU.
- build: Fable 5.2 designs the language and proves the laws (00:25-10:17, cut twice by usage limits); Opus 5.5 takes over from its notes alone and does the GPU (10:35-12:19).
- edit a law: Every five minutes a snapshot is committed only if the five sealed files still match laws-sealed. They always did: the implementer never wrote to them.
- impl/: The judge copies impl/ and PROOF.bend, puts back the sealed files from the tag, refuses @unsafe and foreign code behind a law, runs --verdict, then the hidden programs on one, many and gpu.
- verdict: Everything here comes from those runs, the implementer's own measurements (marked as such), and the logs.
Nine laws, sealed; click one for its code
Spec.bend gives the words: a datum is the atom or a pair; a run is an answer, its steps and its most cells; and the floor, eight forms every Telomare must express (Same, Drop, Left, Right, Both, Then, If, Twice), where Twice is the only repetition. LAWS.bend holds the implementation's T to these:
totalEvery program answers every input.Under --verdict Bend proves nothing that might not end and accepts no @unsafe: the one-line proof says T.run is a total function.
law total:
for p: T.Program
for d: S.D
exs r: S.Run
{T.run(p, d) == r : S.Run}timeA run takes no more steps than T.time(p, size(d)), known before it runs.A bound you can read off the program, in steps.
law time:
for p: T.Program
for d: S.D
{Nat.is_le(S.time(T.run(p, d)), T.time(p, S.size(d))) == True{} : Bool}spaceNor holds more cells than T.space(p, size(d)).The same, in memory.
law space:
for p: T.Program
for d: S.D
{Nat.is_le(S.space(T.run(p, d)), T.space(p, S.size(d))) == True{} : Bool}floorEvery floor function is a program, meaning what the floor means.The language can say at least the floor; nobody can ship a language too small to matter.
law floor:
for f: S.F
for d: S.D
{S.out(T.run(T.of(f), d)) == S.mean(f, d) : S.D}honest_timeA floor function's run counts at least the floor's work.Bounds cannot be met by counting steps short.
law honest_time:
for f: S.F
for d: S.D
{Nat.is_le(S.work(f, d), S.time(T.run(T.of(f), d))) == True{} : Bool}honest_spaceA run holds at least its answer.Nor cells.
law honest_space:
for p: T.Program
for d: S.D
{Nat.is_le(S.size(S.out(T.run(p, d))), S.space(T.run(p, d))) == True{} : Bool}oneT.one answers as T.run.The fast one-core evaluator is the counted one.
law one:
for p: T.Program
for d: S.D
{T.one(p, d) == S.out(T.run(p, d)) : S.D}manyT.many answers as T.run.Every core, same answer.
law many:
for p: T.Program
for d: S.D
{T.many(p, d) == S.out(T.run(p, d)) : S.D}gpuT.gpu answers as T.run.The GPU, same answer.
law gpu:
for p: T.Program
for d: S.D
{T.gpu(p, d) == S.out(T.run(p, d)) : S.D}decidedMeasured, not provable in Bend, so judged: bounds are real (seconds per step, bytes per cell); more chips, less time past a stated size; faster than master and bend on one core. Effects are a definition, session: the world calls the program again with its state and the next line.telomare-laws (private, local on olimpo), LAWS.bend, the MEASURED comment and `session`
A language of eight forms, names, and doubling
The implementer chose the smallest language the laws allow: the floor itself, written as text, plus definitions and shorthand that add no power. No types, no functions as values, no recursion: a name must be defined above its use. The only repetition is twice; p ^ k is p run 2^k times, p * n is p run n times, and a loop stops early with an if.
| floor | text | answers, given d |
|---|---|---|
| Same, Drop | same, drop or 0 | d; the atom |
| Left, Right | left, right | a or b of (a, b); the atom of the atom |
| Both{p, q} | (p, q) | the pair of both answers |
| Then{p, q} | p q or p ; q | q of p's answer |
| If{t, p, q} | if(t, p, q) | p's answer if t's is a pair, else q's |
| Twice{p} | twice(p), p ^ k, p * n | p of p's answer; 2^k; n times |
# a running sum of the lines it is given (impl/examples/sum.tel)
step = if(left, (left left, (right, 0)), same) # (a, b) -> (a - 1, b + 1) while a is not 0
add = step ^ 32 ; right # (a, b) -> a + b, for a below 2^32
total = (left, right left) add # (input, (total, 0)) -> input + total
main = if(same, (total, (total, 0)), (0, (0, 0)))doneA command, impl/bin/telomare [one|many|gpu] [text|data] FILE, runs a file as a session: the program is called on 0, shows the left of its answer, and is called again on (next line, state) until the state is 0.telomare-laws at 1da7c05 (the implementer's final state, 2026-12-04 12:19), impl/Main.bend, impl/Lang.bend, impl/GUIDE.md section 7
openNumbers are unary, as the floor's data are: 1 000 000 is a million pairs. Everything a program does to a number is a loop over it.telomare-laws at 1da7c05 (the implementer's final state, 2026-12-04 12:19), impl/GUIDE.md section 6
One compiler, three evaluators, and a gate before the GPU
The 9 steps, in words
- text: The file is read and its definitions inlined;
^and*become nestedTwiceand rows; the result is a floor term,T.of(f). - floor: The term is compiled once to flat code that is only read while it runs (the old plain evaluator took the program apart at every look: up to 100 times slower).
- one:
T.oneruns the code on one core; proved to answer asT.run. A guarded loop stops as soon as its guard fails. - many:
T.manyforks aBothwhen both halves weigh at least 4096 forms as written: the decision reads the text, not the data. Proved to answer asT.run. - a tree of forks: With
gpu, a wide tree of forks is gathered into a list of jobs and weighed: 2048 leaves or more, 2^28 forms of work or more, inputs under a 64th of the work. - sent: The jobs are flattened and sent once; each GPU lane interprets one leaf's code with its own memory (collected when full) and its own stack.
- too big: A lane that outgrows its memory sends the whole tree back to the cores: the answer is the same, the time already spent is lost.
- answers: The answers come back in order and are built as Bend data, about 30 ns a pair.
- shown: The left of the answer is shown; if the state is a pair, the next line is read and the program called again.
All nine laws, by the kernel, and the checker still bites
bend PROOF.bend --verdict to print ALL PROOFS CHECK (Bend 2.0.39, BendTT kernel)measuredtelomare-laws at 1da7c05 (the implementer's final state, 2026-12-04 12:19), rerun by mugen after the runprovedtotal, time, space, floor, honest_time, honest_space, one, many, gpu: each law is a definition in PROOF.bend that the kernel accepts. T.gpu is T.pgo!(...), the forking evaluator handed to Bend's !, proved equal to T.run through the plain semantics T.sem.telomare-laws at 1da7c05 (the implementer's final state, 2026-12-04 12:19), PROOF.bend, impl/Fast.bend gpu_sem
testedThe checker is not a rubber stamp: mugen's checks after the run. A false lemma (n + 1 = n, impl/lab/chk/bad.bend) gives SOME PROOFS FAIL with the mismatch; a tenth law added to a copy of LAWS.bend with no proof gives SOME PROOFS FAIL, 1 TODO; the shipped PROOF.bend gives ALL PROOFS CHECK.mugen, olimpo, 2026-12-04 12:3x, Bend 2.0.39 from tl-bend-pin
testedWhat is proved is about the Bend functions. The command's OpenCL route is C and is tested only: 3191 random programs with every tree forced onto the GPU (897 of them with lanes of 200 cells, so the collector runs often) and 600 runs of the command matched the reference.impl/MEASURED.md at 1da7c05 (the implementer's measurements, Ryzen 7 3700X, RX 580), section 5; impl/lab/gpu/fz
Twenty hidden programs: all right, on every chip
Five families of programs it never saw, from tiny to 25 million steps: A long loops, B loops that stop early, C answers that grow, D work that splits, E counting. want is the answer the floor's meaning gives; every run below got it. Seconds, whole process, Ryzen 7 3700X (16 threads), RX 580.
| program | floor work | one | many | gpu | right |
|---|---|---|---|---|---|
| A16 | 393 219 | 0.006 | 0.007 | 0.012 | 1 = 1 |
| A20 | 6 291 459 | 0.059 | 0.067 | 0.081 | 1 = 1 |
| A22 | 25 165 827 | 0.237 | 0.239 | 0.210 | 1 = 1 |
| B3 | 95 | 0.002 | 0.002 | 0.002 | 0 = 0 |
| B4 | 191 | 0.003 | 0.002 | 0.002 | 0 = 0 |
| B8 | 3 071 | 0.002 | 0.003 | 0.002 | 0 = 0 |
| B14 | 196 607 | 0.005 | 0.004 | 0.003 | 0 = 0 |
| B18 | 3 145 727 | 0.018 | 0.033 | 0.019 | 0 = 0 |
| C8 | 45 | 0.002 | 0.004 | 0.003 | 1 = 1 |
| C16 | 93 | 0.004 | 0.003 | 0.003 | 1 = 1 |
| C20 | 117 | 0.003 | 0.003 | 0.003 | 1 = 1 |
| D2·6 | 1 571 | 0.003 | 0.003 | 0.003 | 1 = 1 |
| D4·6 | 6 299 | 0.003 | 0.002 | 0.002 | 1 = 1 |
| D6·4 | 6 779 | 0.004 | 0.004 | 0.004 | 1 = 1 |
| D8·8 | 395 771 | 0.005 | 0.005 | 0.006 | 1 = 1 |
| E4 | 113 | 0.002 | 0.003 | 0.003 | 1 = 1 |
| E5 | 227 | 0.003 | 0.004 | 0.004 | 1 = 1 |
| E6 | 453 | 0.002 | 0.002 | 0.002 | 1 = 1 |
| E8 | 1 801 | 0.002 | 0.002 | 0.002 | 1 = 1 |
| E12 | 28 689 | 0.003 | 0.003 | 0.002 | 1 = 1 |
measuredEvery one of 60 runs (20 programs × one, many, gpu) answered what the floor means. The slowest took a quarter of a second.the hidden judge (tl-judge/judge.sh on a copy of 1da7c05, olimpo, 2026-12-04), rc=0, want = got
openThe judge's own counted run (T.run, the reference the laws are stated against) is slow: 39 s for A16, past the 120 s limit for A20, A22 and B18. It is the specification, not what the command runs.the hidden judge (tl-judge/judge.sh on a copy of 1da7c05, olimpo, 2026-12-04), the counted line
Against master and the bend branch, on the same hidden functions
One core, whole process, seconds. master and bend were each run checked (their default, with Telomare's proofs and abort checks) and with --fast; the faster of the two is drawn, the other is in the note. Bars are relative to the slowest row of each pair; a run that hit the 100 s limit is drawn at full length.
Known before the run: close on loops, useless on counting
T.time and T.space are computed from the program and the input's size alone, in 3 to 5 ms for every hidden program. The judge compares them with the counted run where that finished:
| program | steps counted | T.time | cells counted | T.space |
|---|---|---|---|---|
| A16 | 393 219 | 458 797 (1.17×) | 131 073 | 131 114 |
| B4 | 191 | 225 | 32 | 50 |
| B8 | 3 071 | 3 353 | 512 | 538 |
| C8 | 45 | 345 | 255 | 300 |
| B14 | 196 607 | 213 029 | 32 768 | 32 806 |
| C16 | 93 | 65 721 | 65 535 | 65 628 |
| D8·8 | 395 771 | 470 515 | 131 583 | 603 120 |
| E4 | 113 | 16 675 | 69 | 32 855 |
| E5 | 227 | 129 140 756 | 213 | 301 327 107 |
| E6, E8, E12 | 453; 1 801; 28 689 | not computable: past 2^48 | 645; 5 829; 472 389 | not computable |
| A20, A22, B18 | past 120 s | 7.3 M, 29.4 M, 3.4 M | past 120 s | 2.1 M, 8.4 M, 0.5 M |
provedThat the bound is never exceeded is the time and space laws; what is measured is how loose it is. For loops it grows by the step's gain each round instead of doubling: within 17% on A16. C16's time bound also counts a bound on the answer's size, so it is loose there: 65 721 against 93.telomare-laws at 1da7c05 (the implementer's final state, 2026-12-04 12:19), PROOF.bend; impl/Bounds.bend
measuredStated constants: 100 ns per step of T.time plus 5 ms to start, and 32 bytes per cell of T.space plus 8 MB. The tightest of its jobs used 6.3 ns a step and 12.5 bytes a cell.impl/MEASURED.md at 1da7c05 (the implementer's measurements, Ryzen 7 3700X, RX 580), sections 1 and 2
openCounting breaks the bounds: E5's time bound is 569 000 times its run, and for E6, E8 and E12 the command cannot even compute its bound ("a Nat past the largest immediate 2^48-1"). The law still holds (a bound exists, and is proved never exceeded), but it is useless there. The implementer saw the same on its own dbl 20 0.the hidden judge (tl-judge/judge.sh on a copy of 1da7c05, olimpo, 2026-12-04), E4-E12 bound lines; impl/MEASURED.md at 1da7c05 (the implementer's measurements, Ryzen 7 3700X, RX 580), section 1
Every core pays past 64 heavy halves
| job | one | many (16 threads) | speed-up |
|---|---|---|---|
| map 6 12 (64 leaves) | 5 ms | 2 ms | 2.5× |
| map 8 12 (256) | 19 | 4 | 4.7× |
| map 10 12 (1024) | 72 | 13 | 5.5× |
| map 12 12 (4096) | 294 | 46 | 6.4× |
| dup 12 12 | 290 | 45 | 6.4× |
| up 22 0 (nothing to fork) | 137 | 136 | 1.0× |
| lazy 12 12 (looks heavy, is not) | 4 | 10 | 0.4× |
measuredStated size: work that splits into at least 64 halves of at least 50 µs each. Past it T.many is no slower than T.one; below it, unforked work runs the same code as T.one.impl/MEASURED.md at 1da7c05 (the implementer's measurements, Ryzen 7 3700X, RX 580), section 3
measuredOn the hidden programs many gained nothing: they are sequential loops, and the fork rule reads the text, so many took what one took (A22: 0.239 s against 0.237).the hidden judge (tl-judge/judge.sh on a copy of 1da7c05, olimpo, 2026-12-04), the many column
openA fork is decided from the program's text, not its data: 4096 loops that stop at once are slower on every core (10 ms against 4). A fork costs about 6 µs.impl/MEASURED.md at 1da7c05 (the implementer's measurements, Ryzen 7 3700X, RX 580), section 3
On the RX 580, through OpenCL: up to 4.5× every core
spin k m: 2^k independent loops of 2^m rounds each, on tiny data. Evaluation in ms, best of three; gpu is the command's OpenCL route, start-up included (about 100 ms to open OpenCL and build the kernel).
measuredStated size for the command's gpu: at least 2048 leaves on small data and 2^28 forms of work (about 0.2 s on every core). Below it the work stays on the cores and gpu takes what many takes, to within 10%.impl/MEASURED.md at 1da7c05 (the implementer's measurements, Ryzen 7 3700X, RX 580), section 5
openBig answers: 82 million answer pairs took 3 s to bring back (30 ns a pair) after 0.2 s on the GPU, so such work now stays on the cores, but the slow step is not fixed.impl/MEASURED.md at 1da7c05 (the implementer's measurements, Ryzen 7 3700X, RX 580), section 5, wide.tel
Three days of trying, then two hours
From 12-01 to 12-03 mugen tried to make Telomare's own runtime (the bend branch's interaction-combinator evaluator, then a Bend 2 fork/join backend) beat the CPU on the same RX 580, and on rented NVIDIA machines. The goal was never met, and was paused on 12-03.
| attempt | GPU | CPU | verdict |
|---|---|---|---|
| IC evaluator on Vulkan (ic.comp), RX 580 | 4 to 34 s | 0.15 s | GPU slower |
| FFT (fftb), RX 580 | 2.3 s | 0.71 s (8 threads) | GPU slower |
| q512 batch, RX 580 | 5 552 ms | 2 644 ms (8 threads) | GPU slower |
| Bend 2 fork/join, rented NVIDIA (4 rentals) | never ran: libcuda/nvrtc missing | q512: 287 ms (16 threads) against 8 813 ms before | CPU only |
| telomare-laws, the command's OpenCL route, RX 580 | spin 14 14: 356 ms | 1 586 ms (16 threads) | GPU 4.5× faster |
measuredWhat changed: not the card, the design. One GPU lane runs one whole leaf (an interpreter of the compiled code, with its own memory), instead of the GPU stepping a shared graph whose work lanes hand to each other; and a gate keeps the GPU out of work it would lose.telomare-laws at 1da7c05 (the implementer's final state, 2026-12-04 12:19), impl/GPU.md
openNot the same programs: the FFT and q512 jobs were not rerun on telomare-laws, and spin is the GPU's best case (independent, heavy, tiny data).mugen's review
Two models, seven sessions, one sealed contract
| when (CST, 12-04) | who | what |
|---|---|---|
| 00:24 | mugen | laws sealed (ebe1322) |
| 00:25-00:39 | Fable 5.2 | reads the laws and Bend's guide; first design |
| 04:10-04:37 | Fable 5.2 | v0: the nine laws proved; cut by the five-hour limit |
| 09:16-10:17 | Fable 5.2 | one core and every core proved, fast; cut: out of credits |
| 10:35-11:21 | Opus 5.5 | takes over from Fable's notes only; the OpenCL route; cut by the weekly limit |
| 11:33-11:38 | Opus 5.5 | resumed after the plan was upgraded |
| 11:39-12:19 | Opus 5.5 | restarted so its reasoning is logged; fuzzing, measurements, docs; says done |
testedThe sandbox held: every file the agents named was in the repository or their own /tmp; no other path on olimpo, no other host.the agents' logs (tl-fable/run/agent-*.jsonl, olimpo), paths in every tool call, scanned by mugen
What is good, and what I would not sign yet
provedGood: the contract works. Nine laws, all proved by the kernel, and an implementation that keeps to them without ever having seen the other two.telomare-laws at 1da7c05 (the implementer's final state, 2026-12-04 12:19), PROOF.bend
measuredGood: it is fast where Telomare was slow. Every hidden program ran in under a quarter of a second; master and bend took 0.06 s to past 100 s on the same functions. On the big loops that is 41× (A20) to 280× (A22) faster than the faster of the two; on the small programs the thousands-fold gaps are mostly master's and bend's start (parsing, type and size checks), not their evaluation. In a third of master's lines and an eleventh of the bend branch's.the hidden judge (tl-judge/judge.sh on a copy of 1da7c05, olimpo, 2026-12-04), slides 8 and 9
measuredGood: the first GPU result that beats the CPU on this card, after three days of failed attempts on Telomare's own runtime.impl/MEASURED.md at 1da7c05 (the implementer's measurements, Ryzen 7 3700X, RX 580), section 5
openSmaller than Telomare: no lambdas, no functions as values, no types, no recursion but doubling, unary numbers. The laws let it be this small ("the floor is inside it"); a language people would write needs more, and every addition must keep the nine laws.telomare-laws at 1da7c05 (the implementer's final state, 2026-12-04 12:19), impl/GUIDE.md
open808 lines of C: the OpenCL interpreter is tested, not proved, and goes against our rule of Bend first, then Haskell, then shell. The brief allowed it (no foreign code behind a law); T.gpu itself stays pure Bend.telomare-laws at 1da7c05 (the implementer's final state, 2026-12-04 12:19), impl/gpu.c, impl/Gpu.bend `import "./gpu.c"`
openBounds that cannot be used: on the counting family the time bound is hundreds of thousands of times the run, or too big to compute (slide 10). The laws ask only that a bound exist; a law on how tight it must be would have caught this.the hidden judge (tl-judge/judge.sh on a copy of 1da7c05, olimpo, 2026-12-04), E5-E12
openThe C gives a lane up to 2^22 cells a half, with all lanes under a quarter of the card's memory and under one buffer's limit. On 12-01 a large K on this card ran Xorg out of memory; no crash this time, but the cap was raised without asking.telomare-laws at 1da7c05 (the implementer's final state, 2026-12-04 12:19), impl/gpu.c lines 636-643
openA possible Bend bug: in a test copy, passing a parameter differently made Bend skip the ! call silently (answers still right, run on the cores). The shipped code avoids the pattern.telomare-laws at 1da7c05 (the implementer's final state, 2026-12-04 12:19), impl/NOTES.md
What it would take to make this Telomare
- Run
T.gpuand the OpenCL route on an NVIDIA machine (impl/GPU.md has the commands; a rented one needs the owner's OK, two hours at most): the last open law. - Rerun the FFT and q512 jobs on telomare-laws, so the GPU comparison uses the same programs as before.
- Grow the language under the laws: functions as values and binary numbers, each proved against the same nine laws before it is kept.
- Decide on gpu.c: keep it as the command's route, or move the lane interpreter to Bend's own GPU path once one runs on this card.
- Fix the two costs the implementer found: answers back at 30 ns a pair, and the lost time when a lane runs out of memory.
- Hand the same sealed laws to a second model blind, and judge both: if two strangers' implementations both pass, the laws are the contract.
openNothing has been pushed: telomare-laws, its snapshots and 1da7c05 are local to olimpo. The two old implementations are untouched.telomare-laws (private, local on olimpo), git status
Made by mugen from the full history of the work: the laws and brief it wrote, the sandbox's logs, the judge's runs on a copy, and the implementer's own reports, each marked by kind. 2026-12-04.