Skip to content

Release 3.0.2: the readback budget fix and the separated-class bound - #13

Merged
a9lim merged 67 commits into
mainfrom
dev
Nov 7, 2026
Merged

a9lim merged 67 commits into
mainfrom
dev

Conversation

@a9lim

@a9lim a9lim commented Nov 7, 2026

Copy link
Copy Markdown
Owner

blam 3.0.2 changes no interface. It fixes a budget bug in the program runner and publishes what has been proved about the self-interpreter since 3.0.1.

Fix: --steps is a hard cap again

blam blc and blam uni run on the call-by-need machine. Reading back a normal form that is shared k levels deep in evaluated thunks expands 2ᵏ neutral nodes from k β-steps, and that path neither counted steps nor polled the caller. So --steps was not a hard cap, and a caller that had asked to stop was never heard: λf.λz. 27 (λy. f y y) z ran past a 100,000-step cap, and one 40-bit term held a search worker for over half an hour. Every readback job now counts as a step and is polled like any other. Census, Solomonoff and speed-prior numbers are unaffected, since they run on the KN machine, and the differential against Tromp's uni.rs reproduces all 20,804 recorded runs.

The self-interpreter

162 bits is still the smallest known. What is new is how far its optimality reaches.

  • The separated class. Every interpreter built like the 162 (an opaque fixed-point knot, any reader obeying the rigid reader laws, a separate NEXT building the canonical values) costs exactly 116 + w(R) bits, and Lean proves that every one has at least 146. The 162, at w = 46, is optimal in the class exactly when every reader has w ≥ 46. Every β-normal reader does, and every λ-rooted minimum reader below 46 is excluded; what is open is root lets, nonlinear, with two to four uses. The equivalence also holds for NEXT of any syntax above a price frontier (q ≥ 92 and q + 3F ≥ 104), any NEXT-free value decoder and any opaque two-port recursion (class-bound.md).
  • The global floor. Every self-interpreter has at least 40 bits, up from 37: the proof is handwritten, with every finite certificate's predicate and every residual case checked in Lean. At least 31 bits is kernel-checked outright, without Statman's theorem, and every interpreter needs four source λs (global-floor.md, structural-bounds.md).
  • A 188-bit β-normal interpreter, down from 204, proved correct in Lean for every closed program (normal.md).
  • Other protocols. A 165-bit parser/continuation bundle is proved correct, and Lean rules out several uniform repairs of other state protocols (protocol-obstructions.md).

AIT golf

Tromp's review of tromp/AIT#13 found that our 172-bit int4 broke on 11 before an abstraction or an application: int4's 11 weakens any term, and our battery had generated only canonical codes. His 189 is restored, the battery now runs every weakening, and the branch changes 39 programs by 1,142 bits.

CI

CI is slimmer: one lint job, one Ubuntu release test run, and the census spot-check, with the Lean certificates, qALC fixtures and ref/AIT additivity checked by path-scoped workflows. The crate no longer declares a minimum Rust version.

Found and checked with Claude (Anthropic), Codex (OpenAI) and Gemini (Google).

a9lim added 30 commits October 21, 2026 20:29
The third round of reasoning lanes on the 162 found no smaller interpreter
and proved these bounds instead.

The separated class (class-bound.md): every interpreter that is an opaque
fixed-point knot around \p c. R[Q/j], with any reader R obeying the
independent rigid reader laws and a separate beta-normal NEXT Q obeying the
canonical rigid branch laws, costs at least 116 + w(R), w = cost(R) +
4 depth(j), with equality for the canonical NEXT and knot. The 162 is w = 46,
the 165 w = 49. Blc/SelfintClass.lean kernel-checks this and 138 bits,
including the 92-bit NEXT classification; a reviewed handwritten argument
with 3,484 kernel-checked cases gives w >= 30, hence 146. The 162 is optimal
in the class iff every reader has w >= 46, which stays open: two-lambda
readers are >= 50, the serial form with at most four lambdas >= 46, and with
NEXT opaque the s I A j middle operand is exactly the 162's family through
30 bits.

The global floor (global-floor.md): a literal interface \c.B costs at least
39, and with it sizes 37, 38 and 39 are excluded (676, 1,206 and 4,672
layouts; finite certificates kernel-checked, every residual excluded in
Lean). Each step has two independent reviews. The numeric floor itself is
not a Lean theorem.

Blc/SelfintRecursion.lean prices recursion without an opaque knot: >= 165
for two arbitrary recursive heads under the ordinary first-child cut, >= 167
for the generator without the intL let (attained). interpreter.md gains the
variants of the 162 (163-297 bits) and the reader-slot checks; an enumeration
with the real NEXT is recorded as not a result, its checker having
mis-bound the knot's generator. Lane reports, proofs, reviews and the
floor's Lean development: data/self-interpreter/reasoning_162/.
lake build Blc: 66 jobs; the floor modules build with
reasoning_162/floor38/check_lean.py.
Promote the round-4 Lean into lean/Blc: the reader weight 30 with no
remaining assumption (SelfintReader30, so every member of the separated
class has at least 146 bits), NEXT of any syntax above the price frontier
(SelfintWiden: the 162 is optimal there iff every reader weighs at least
46), NEXT-free value representations (SelfintValues, SelfintValuesTransfer),
two-port opaque recursion heads (SelfintKnotHeads), the continuation-headed
split class at 165 (SelfintChead), the divergent-probe forwarding lemma and
the derived reader laws (SelfintProbe, SelfintProbeSlots,
SelfintProbeDerive), and the probe-family ceilings of the global floor
(SelfintGlobalBarriers, SelfintSpineBarriers, SelfintTowerBarriers).

class-bound.md is rewritten around the exact price, the open reader bound
(what is settled by proof, by complete finite checks and by the reviewed
depth-1 reduction, and what is open) and the widenings; interpreter.md gains
the round's thirty-odd measured designs (163-265 bits); global-floor.md the
probe ceilings. data/self-interpreter/reasoning_class/ archives the
finished lanes.
close46's 21 kernel-checked modules join lean/Blc: no application tree
over factories and continuation towers reads the stream
(SelfintClosureBarrier); every one-helper reader with any helper and any
specializer over g and s weighs at least 46 (SelfintStreamSpecializer,
SelfintClosedSpecializer, SelfintHelperPair); the exact weighted beta
balance, first-head classification and argument budgets of minimum readers
(SelfintSourceCost, SelfintLocalCost, SelfintSourceFront, SelfintFlat*,
SelfintLetSink); the linear-let counterexample (SelfintLambdaSink); and in a
minimum reader, the extra uses of a self-headed let are needed and nested
lets exchange at an exact price (SelfintNeededHead, SelfintNestedLets).
Round 3's role algebra becomes SelfintRoleAlgebra; its hoisting proof was
already in SelfintWiden.

class-bound.md §3 now states the depth-1 reduction as reviewed: the four
families cover readers whose hole's parent is rigid on a zero stream, the
162-family bound holds for minimum readers, and zero-λ parents are open.
The archive gains close46 and the promotion lane.
A correct reader of weight 221 carries a growing Church counter and skips in 2n² + 8n + 8 steps, and the 162's repeating skip consists of input-cell redexes only, so pumping arguments charge no reader source (Codex, kernel-checked in the loop lane).
A literal let parent, a closed transport and a source-disjoint redispatch (at least 53) are out of a minimum depth-1 reader (Codex, zerolam lane); zero-λ parents whose function part is an application over s or c remain open.
No minimum reader of weight at most 45 has the form λs. s (λb t. B) j: λ-headed bodies hoist strictly lighter, linear redexes do not fit, and every rigid-headed body and every body with a two-to-four-use head let fails a law (Codex, needbinder lane).
At depth 1 the lowest ancestor of j with a rigid zero value is context-free, and anchoring there recovers priced operands; but it can be the whole body, as in a β-normal reader of weight 75 whose two halves are both λ-valued on a zero stream (Codex, zerolam lane).
λs. s (λb. b A c) B with any operands has weight at least 48 and its hoisted form at least 49, both sharp, by rigid shielding: a j the zero run wraps as r r j cannot be extracted by a j-free context (Codex, loop lane; prices and shielding kernel-checked).
Every s-spine reader whose first operand reaches the first dispatch through
stream expansions, λ-bindings and variable heads alone weighs at least 46,
apart from one skeleton whose check would exceed the lane cap (Claude,
d1open lane; complete certified skeleton checks over jn's core lemmas, with
the handwritten deletion lemma for zero-only material). The open list in
class-bound.md, STATUS and interpreter.md now reads as what it is: sharing
between the zero and unary roles.
λs. s (λb. b H) (λu. D) j weighs at least 46 for every H, a minimum reader λs. s A (λu. D) j below 46 has |A| ≥ 11 and |D| ≤ 18, and a weight-75 reader shows the binder can genuinely be needed (Codex, needbinder lane). Archive the needbinder and zerolam lanes.
Depth-0 readers behind a shared top-level let and application-rooted readers with j a let-body operand are out of a minimum below 46 whenever the let argument's chain binds the stream and every root argument, and in four related shapes (Claude, root lane; complete checks with certified cut-offs, and the exact root-let weight).
No reader (λx. x x) A j weighs 37 or less, for any A, by a lazy enumeration sound under the transfer lemma; contracting a hand-off's pre-stream computation is never lighter (Claude, root lane).
Every such reader satisfying the unary laws weighs at least 46, with any source redexes and j at any depth, which closes the one redex-free s-spine skeleton beyond the lane cap; in a minimum reader below 46 with a literal λ-dispatcher, every redex inside it has two to five uses (Codex, loop lane).
The 40-bit near miss λs. s I (s (λq. c) (s s s)) j gives r j on zero and c r N j on unary; the 162 is it plus its 6-bit absorber, and every other repair priced costs at least 7 bits more. The depth-0 window (λx n s. M) A j with one c in A and x used twice has no reader (Claude and Codex, adv5 lane).
No β-normal reader weighs 43 or less, and none with j at depth two or more weighs under 46, without minimality, by a complete demand-driven search for intersection-type derivations of the laws; the shared role skeleton never contains c or j, and a shared let saves exactly its argument's shared skeleton (Claude, types lane).
A minimum reader below 46 with j at depth 1 and a let as its stream-λ body uses the let's variable at most four times, has a λ inside the argument, and carries j inside it when the let is linear (Codex, bodyredex lane).
Every residual of j is erased by a λ from the reader source, a unary F or the terminal K, but the origin fixes no cost: the 162 erases j at the terminal K, and β-normal readers of 58 and 70 kill it by both mechanisms or by a bare source F (Codex, jerase lane; witnesses kernel-checked).
Deleting a dispatch site keeps the unary law through any let or redex; a closed s I anchor anywhere forces weight 46 with equality only at the 162, and two sites or one saving 16 bits force 46, so a reader below 46 has a single site saving 8 to 15 bits; the three unary cores through 23 bits are pinned (Claude, zcore lane, reviewed by Codex). Corrects the 164's zero-only material to 12 bits.
Every nonlinear let inside a literal first handler λb. B fails at every arity, by the exact price and minimality per let (kernel-checked) and a complete check of 117,059 sources with 1,868 normalizer exceptions refuted in Lean (Codex, handlerlet lane); with the redex-free and multiplicity results this closes the branch.
A complete needed-narrowing search over the zero law and the unary laws at
n = 1, 2 finds no β-normal reader below 46, with no minimality assumption,
sharp at the 162 (Claude, types lane). Codex's fresh-context review
reproduced every run, cross-checked the engine against an independent
enumerator, found that single-law tabling loses solutions, and supplied the
needed-occurrence argument under which the joint-law tabling is sound.

So a reader below 46 must contain a source redex. class-bound.md §3,
STATUS, interpreter.md and the README now state the open problem that way:
s-spines whose first operand is not a literal λ, readers whose stream-λ
body is a let, and root lets.
A let-shared dispatcher whose unary calls all hand it a bit is a deletable site of its own, so below 46 a shared dispatcher needs a call that hands it something else; selector calls cost at least 11 bits, and calls handing it c, s or a tail remain unpriced (Claude, zcore lane).
A fresh Claude reviewer found the β-normal search sound for the joint laws, agreeing with Codex, and proved by hand the two cut-offs that rested on the engine.
A reader need not have a normal form and contracting a shared let can copy j, so the β-normal bound forces a redex to pay for itself only where a contraction keeps one j. Record bodyredex's follow-up: a linear body let never contracts straight to a β-normal term (kernel-checked), and two more let families have no reader below 46 (Codex).
In a minimum reader below 46 whose first operand is j-free but not a literal λ, every redex inside it has two to five uses, and a sunk handler let must satisfy a strict occurrence inequality (Codex, firstop lane; linear cases refuted in Lean).
A minimum root let with k uses and j at depth d weighs at least 4k + 22 + 4d (kernel-checked), so below 46 it has at most five uses, four with j under a λ; replacing the copies of j that do not survive in a normal form by c gives a one-hole reader, bounding the normal form from below (Codex, rootnf lane).
The shape lemma, the needed-occurrence lemma and the admissibility of the search's lower bound are now in Lean, with one small row excluded end to end; a proof-producing version of the whole search is designed but not built (Codex, leanbn lane).
The nonlinear lets inside a j-free first operand fail in five complete cells with 7,023 normalizer exceptions refuted in Lean, and the j-carrying operand ((λx. D) j) P⃗ is excluded too; the stream-reification surcharge is kernel-checked (Codex, firstop lane).
Listing the unary cores of weight at most 37 by needed narrowing on the unary laws (110 templates) and refuting every single-site insertion shows that no reader below 46 with j under only the stream binder has an s I, handler or s K site; with the depth results, a minimum reader below 46 must read the bit through a let-shared dispatcher with a non-bit call, an under-applied dispatch, or the stream applied to itself (Claude, single lane; reviewed and rerun by Codex).
First operands that carry j fail too: a selective pruning price for j-sharing lets (kernel-checked for its witness) and fourteen complete checks of 424,378 sources, 4,337 normalizer exceptions refuted in Lean (Codex, firstopj lane). With the redex-free, literal-handler and j-free closures, only minimum readers whose stream-λ body or root is a let remain open.
a9lim added 29 commits October 22, 2026 06:04
All 580 listed root-let sources with k + d = 5 fail a law, 577 by Lean proofs and three by the frozen engine's divergence verdict; source η-contraction is formalized, and 73,311 lower-profile sources are excluded (Codex, rootcert lane).
No minimum reader below 46 is a linear root let: complete inventories of 135,652 sources with 1,354 refutations in Lean; the exact price of exposing the stream binder is kernel-checked (Codex, rootlow lane). The separated class's open case is now nonlinear root lets with two to four uses and j at depth at most 1.
The three weight-45 sources rootcert left to the frozen engine fall to one kernel-checked divergence family, so all 580 listed root-let sources now have Lean refutations from the zero law alone (Claude, combs2 lane).
Root lets (λg s. B) A with any body have no reader below 46 for every helper shape the search reached, with no minimality assumption and every cut-off certified; the adversary's dozen root-let designs all cost 56 or more (Claude, adv6 lane).
Of 188,718 nonlinear root-let sources with four uses and j at depth 0, all but 658 fail a law, 38,271 by Lean refutations; the Lift transfer, a self-feeding divergence theorem with payloads and a stronger hole repair are kernel-checked (Codex, rootnl lane). The remaining cells need an upper bound on pre-stream expansion.
A correct root-let reader of weight 84 + 5m reaches a first weak-head λ of weight 40 + 6·2^m, every node needed by both laws (a 108-bit instance kernel-checked), so the remaining nonlinear root lets need a source-level simplification that recovers the expansion, not a bound on it (Codex, expand lane).
Specializing a static hand-off keeps both laws and one j at an exact price that always pays when no wrapper remains, and idempotent helpers let a use x x shrink to x, taking 27 listed sources out of the minimum (Codex, simplify lane).
653 have Lean refutations, most through a kernel-checked flow and arity checker, and five of weight 44 have the frozen engine's divergence verdict, so the four-use depth-0 root-let cells under the cap are closed (Codex, rootcert2 lane).
Needed narrowing with minimality price filters read off complete subterms closes the redex-argument and λy. j stream-λ-headed root lets and every full-chain hand-off for minimum readers below 46, and most short chains (Claude, rootnarrow lane).
The five weight-44 sources rootcert2 left to the frozen engine fall to one kernel-checked 44-step head cycle, so every listed root-let source in the four-use depth-0 cells now has a Lean refutation (Codex, combs3 lane).
Dependent payloads, several payloads, constant helpers and arbitrary bodies get exact kernel-checked specialization prices; applied to rootnl's over-cap cells they mark 184,628 sources non-minimum and leave 2,343,026 (Codex, simplify lane).
Adjacent prefix exchange and consumption of a pending operand get exact kernel-checked prices, and the residual cells fail with every normalizer exception refuted in Lean, so no minimum reader below 46 is such a root let (Codex, pending lane).
A general closure-and-stack divergence certificate certifies 33 of the 36 cut-offs the narrowing lane left, closing three more short-chain cells; it also shows the lane's two-argument self-feeding variant is unsound (a kernel-checked counterexample), so the one cut-off only that variant certified is reopened (Codex, certgen lane).
After the SF2 counterexample, the general checker re-certified all 340 other self-feeding-style certificates the round relied on and reopened nothing; the original lemma and its first-argument variant are sound as stated (Codex, recert lane).
Root lets whose body is headed by a nested redex fail in every residual cell, 3,577 normalizer exceptions refuted in Lean, and common-argument specialization is priced exactly; root lets with an x-headed body remain, one cell at 51 listed sources and eight over the cap (Codex, pending lane).
Add unbounded symbolic reader exclusions, mixed-branch and capture-copy constraints, a 196-bit normal interpreter, and a verified parser/continuation bundle. Keep the 162-bit optimality boundary explicit.
Add unbounded source-shape reductions, last-head helper exclusions with dead prefixes, and complete captured-reader payload families. Prove contextual NEXT factoring and alias specialization, record the sharp binder-potential barrier, and derive the current reader diagonal. Verify the integrated Lean target and preserve the open global optimality boundary.
Readback of a neutral term forces argument thunks that are often already
evaluated, and that path neither counted work nor polled the sink. A
normal form shared k levels deep in evaluated thunks reads back 2^k
neutral nodes from k β-steps, so `--steps` was not a hard cap and an
aborting sink was never heard: `λf.λz. 27 (λy. f y y) z` ran past a
100,000-step cap, and one 40-bit term in a soup replicator search held a
worker for over half an hour after its sink had stopped.

Each readback job now goes through `tick`, which counts the step, checks
the work and memory caps, and polls the sink every 256 steps. New test
`lazy_readback_of_shared_normal_form_is_budgeted` fails without the
charge. Both release suites pass, census rows 4..32 are bit-identical,
and uni_diff.py on a frozen binary reproduces the recorded counts
(20,804 runs: 6,201 identical, 14,379 prefix errors, 224 unfinished).
actions.py and runs.py were not rerun: GHC is not installed here.
int4's 11 is weakening and may precede any term, not only a variable, so
a program has one int4 code per way of weakening its subterms. --int4
encoded variables as (11)^i 10 and weakened nothing else, which passed a
172-bit int4 that reads the code as a unary index and breaks on 11 before
00 or 01 (Tromp's review, tromp/AIT#13). The battery now runs every code
of a program, or past 64 the canonical, shortest and maximal ones plus a
fixed sample: Tromp's 189 passes 4,980 of 4,980 through 18 bits, the 172
fails 4,313. The reference normal form is computed once per program.
int4's 11 is weakening on any term, so the 172 that read (11)^i 10 as a
unary index was wrong whenever 11 precedes 00 or 01 (Tromp's review of
tromp/AIT#13). The golf branch restores his int4.lam; the PR now changes
39 programs and saves 1,142 bits.

golf.md says why int.lam's design does not port and records the correct
redesigns measured here and, independently, by Codex: none under 189, the
closest 190. The wrong 172 leaves data/golf/machines and the origin162
archive. tools/golf/table.py's source sizes catch up with the 162's reader,
so the generated no-gain list matches the doc again. PR_KIT has the reply
draft for a9.
CI history (194 runs) shows the release-test matrix never failed: every
catch came from fmt, clippy, rustdoc or the census spot-check. CI is now
one lint job, one Ubuntu release test run with an im-rc-only build check,
and the spot-check together with the one behaviour default features add
(`lab_subcommands_are_named_either_way`). macOS, the two extra feature
configurations, the MSRV job and `rust-version`, and the retired-binary
grep are gone. The Lean certificates and the ref/AIT additivity check move
to path-scoped workflows, and release.yml resolves whether a push is a
release before it waits for CI.

The spot-check keeps n, closed, halt, diverge, unknown, max|nf| and
beta_total hard and reports escal, which memos and scheduling move by
design: a cold run from 28 already differs from the table at 29 and 31.
AGENTS.md scopes the external differentials to changes that can alter
what a program prints or reads (pairs.py sets no step budget), runs
batteries, recertification and Lean builds only when a change touches what
they check, and replaces review rituals with what each kind of result
needs: a trust audit for kernel-checked results, one falsification attempt
for consequential handwritten ones, full-domain coverage for finite checks.
Codex reviewed the plan; its corrections are in (keep the dispatcher test,
path-scope fork-additive rather than delete it, report escal rather than
drop it, resolve release state before waiting).

Without `rust-version`, clippy flags `chunks_exact` with constant sizes;
the five sites now use `as_chunks`. `machine_handles_bb34_fast` duplicated
a case of `machine_reproduces_bb_witnesses` and is removed.

Local: fmt, clippy, rustdoc, release tests with all features (368 pass),
the default-feature dispatcher test, the im-rc-only check, and the
spot-check 4..32 (plus a forced halt drift failing and a forced escal
drift passing with a note).
3.0.2 changes no interface. It fixes the lazy machine's step budget
(0edeeb1): readback of a shared normal form charges a step per job, so
`--steps` is a hard cap and an aborting sink is heard. The rest since 3.0.1
is the self-interpreter record: the separated class is kernel-checked at
146 bits and the 162 is optimal in it iff every reader weighs at least 46,
which every β-normal reader does; the global floor is 40 handwritten and
31 kernel-checked; the β-normal interpreter is 188 bits.

STATUS's self-interpreter section keeps the current numbers and open cells
and leaves the theorems to the domain documents (about 585 lines to 225).
It now lists rootnl's 2,343,026 over-cap sources beside the x-headed
cells' 2,102,856, and records why the readback charge leaves the three AIT
differentials unchanged. The README states the reader bound plainly; the PR
kit drops the drafts a9 has posted and points links at v3.0.2.

Local: release tests with all features, clippy, rustdoc, the spot-check
4..32; `lake build --no-build Blc Certs BusyBeaver` reports all 198 jobs up
to date, every audited theorem on at most propext, Classical.choice and
Quot.sound.
@a9lim
a9lim merged commit 82a082a into main Nov 7, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant