Repository navigation
Description
Child of #27; plan in this comment, re-scoped by the maintainers' decision of 2026-10-14 (#27 comment). Delivery stage 8, the last.
Decisions (made by the maintainers)
- The concern is LexLean → production software. Lean 4 verifies LexLean and has nothing to do with the production environment. The earlier recommendation on this issue (the compiler's execution engine is generated Lean driven by a typed host adapter) is withdrawn: the compiler is a LexLean program compiled by LexLean's own production pipeline to production Rust, and that Rust is the compiler that runs.
.lex.texis the only authorized authoring surface of LexLean. The compiler's logic is committed as.lex.tex; Rust builders, Rust modules and JSON generated by tools are not sources.- "Production IR" is the semantic IR (the maintainers did not object to the recommendation, and it is what the pipeline consumes today); to be confirmed in the first sub-stage.
Scope
The production pipeline is Rust: production/ (23,522 lines: certificate.rs 8,796, lower.rs 3,682, eligibility.rs 3,350, rust_cert.rs 2,348, preserve.rs 1,725, lcnf.rs 1,727, source.rs 893, mod.rs 626, rust_term.rs 375) and the target calculus calculus/ (about 11k lines with calculus/rust/): eligibility, lowering, certificate generation, the Rust AST, lowering, validation, printing, packaging, and the compiler's own front end. After this issue that logic is authored in language 1.2 .lex.tex, certified as a production root, and rendered to a Rust package by the compiler it implements.
Self-hosting acceptance (the bootstrap)
- Stage 0: today's Rust compiler (the oracle, kept under
tests/until the fixed point). - Stage 1: stage 0 compiles the
.lex.texcompiler to a certified Rust package; its provenance binds the source, certificates A, B, E and the runtime. - Stage 2: stage 1 compiles the same
.lex.texcompiler. - Fixed point: stage 2's package is byte-identical to stage 1's, and stage 1 equals stage 0 on every committed project, corpus, fixture and golden (differential, byte for byte), and on the Atlas verification records. Only then are the Rust modules removed.
What it needs (inventory, to be refined in the first sub-stage)
- A way to write the compiler: the authoring surface (stage 3 of [v0.4] Author the production compiler itself in LexLean and verify the generated Lean implementation #27), with module structure, strings, bytes, maps and sets, sorting, canonical JSON, SHA-256, and diagnostics expressed as production-eligible LexLean (stdlib members, certified, not host calls where avoidable).
- Effects at the boundary: reading files, writing files, running Lean for verification, process exit. These need a defined, minimal, typed entry for a production root (arguments, a file system capability, a child process capability), itself part of the language rather than a handwritten shim; the first sub-stage fixes its design.
- Stages 4 to 6 ([v0.4] #27 stage 4: the backend's fixed Lean runtimes generated through native modules #90, [v0.4] #27 stage 5: certificates A, B, E and the audit modules as typed data, with no Lean text template in the production compiler #89, [v0.4] #27 stage 6: complete the closed Rust AST so the runtime is generated from the calculus #91) first: the runtimes, certificates and the Rust runtime are generated, so the compiler's output contains no handwritten code.
Proposed order inside this stage
- Boundary and effects design (a short design issue, then implementation); the capability set.
- Library needs as stdlib members: strings, bytes, maps, sorting, JSON, SHA-256.
- Pilot: the preservation lexer and token audit (
preserve.rs), and the axiom-audit parser: small, closed, with a differential against the oracle. calculus::checkandrust::{lower, validate, print, package}.- The production registry, eligibility, source and lowering stages.
- Certificates (after [v0.4] #27 stage 5: certificates A, B, E and the audit modules as typed data, with no Lean text template in the production compiler #89).
- Front end (lexicon, grammar, linking), then the fixed point and removal of the Rust modules.
DoD (whole stage)
- The production compiler's logic exists only as
.lex.tex; the Rust of those modules is absent from the release tree. - The fixed point above holds on the normative host, and the compiler that ran
just vvis the one LexLean built. - The differential against stage 0 is byte-identical on every committed root and corpus before removal.
- Lean verifies the compiler's certificates; no Lean text is produced by or consulted at compile time of production output.
Acceptance criteria
Per sub-stage: equivalence evidence, planted defects turn named gates red, languages 1.0/1.1 byte-identical, 1.2 identities regenerated, full just vv.
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsTodo
Activity
[-][v0.4] #27 stage 6: the production compiler's logic authored in language 1.2[/-][+][v0.4] #27 stage 8: the production compiler authored in .lex.tex and compiled by LexLean to production software[/+]afflom commentedon Oct 15, 2026
#92 spike: what a compiler component needs today, and the boundary/effects design
Measured on
mainat2fd1c1e9(after #103), with the release binary, in a scratch project (not committed). The question the spike answers: can a pure piece of this compiler be authored in.lex.tex, verified by Lean, compiled by LexLean's own production pipeline to Rust, and agree with the Rust it replaces? The answer is yes for byte-level algorithms today. The rest is the list of what is missing, with an owner for each item.1. The pilot
Three production roots in one language-1.2 module, authored in the readable notation (no JSON, no Rust):
isClosedLeanName(raw : Bytes) : Boolir::core::validate_name(ASCII Lean-name grammar; used by the axiom-output parser, §22.5)iterate_untiloverrawsplitOnByte(subject : Bytes, delimiter : UInt8) : List Bytesstr::split/ the line splitteriteratewith(position, start, pieces)state,list_foldto reversestartsWith(subject, prefix : Bytes) : Boolstarts_with/strip_prefixiterateover the prefixResults, all with the pinned Lean 4.32.1:
lexlean check: eligible forrust-stdwitheffects: [allocation, overflow].rust-coreis refused withLLT4005("type.bytesrequires heap allocation"), so a compiler is arust-stdprogram.lexlean verify: 16 theorems byreflexivity{}(accepts/rejects of names, splits, prefixes) pass the kernel; the axiom audit is exact per declaration (Quot.sound, propextfor the UInt8 range checks and what depends on them, none for the rest).lexlean production build: 3 certified Rust packages (certificates A, B, E accepted). Wall clock 3m25s for one root and 4m30s for three, almost all Lean.validate_name(alphabet biased to the grammar's boundaries, plus every byte in first and later position), 1,000,000 splits againstslice::split, 1,000,000 prefix tests againststarts_with: no disagreement. This is the shape of evidence [v0.4] #27 stage 8: the production compiler authored in .lex.tex and compiled by LexLean to production software #92's stage 0 oracle gives.2. What is missing, by owner
A. A defect found, filed as #105 (part of the path, needs to land before #92 stage 3).
iterate,iterate_untilandlist_fold(and the other 17 library templates) are realized as self-recursive Rust functions, yet the registry rows sayrecursion = false. A root that scans a 80,000-byte name aborts with a stack overflow on an 8 MiB stack while declaring norecursioneffect. A compiler whose loops are all folds over 48 MB modules cannot run until the templates are loops, or the effect is honest and the host provides the stack. #105 has the repro, and the fix in two steps (true now; cheap later with aloopconstruct, which is #91 stage 3).B. Primitive semantics the pilot had to work around (stdlib stage, with #90/#91's calculus work; no hurry, none blocks a pilot):
checked_convertmust target a fixed width, so aUInt8cannot become aNat. Character classes were written aschecked_subtract byte low/checked_subtract high bytebothsome, which works and is how the stdlib must say it until there is ato_nat.Orderingliteral or match.compare_bytes a bcan only be compared with anothercompare_bytes(compare_bytes 0x 0xas "equal").utf8_encode/utf8_decode/split_exact/join. Components should work onBytes; the stdlib's text functions (startsWith,endsWith,trim,lines,splitOn,joinWith,find) are then ordinary members over bytes.rflfails onequalofBytes,compare_bytes,utf8_encode,split_exact,join,format_decimal,parse_decimal(it succeeds onlength,index,slice,append, the fixed-width operations,Nat,Stringequality). Cause:LexLeanRuntime.compareBytesiscompare left.toList right.toList, andByteArray.toList,ByteArray.instBEqandString.toUTF8are core definitions that the module system does not expose to a downstream module; the runtime's own definitions are@[expose]but bottom out in them. So a theorem about text processing stated as an equation cannot be discharged by evaluation. Remedy: define those operations in the runtime over exposed structural definitions (fuel-indexed overdata[i]?, asLexLeanCollectionsdoes for its key order), which is a runtime-content change (identity regenerates) that must agree with the calculus'compare. Until then the compiler's text logic is validated by differential against stage 0, not by in-language theorems.Natsubtraction only asprim subtract,+needs parentheses, lambda captures are explicit and must be sorted, and an exact axiom policy reports one violation perverify, so aligning N declarations costs N runs (a mode that lists every mismatch would be one run).C. Not expressible at all, by design: effects. Everything above is a function from data to data. The compiler also reads and writes files, lists directories, reads a few environment variables, runs
lean/lake/leancheckerunder a time and output limit, and exits with a code. #92 asks for "a defined, minimal, typed entry".3. Proposal: the effects boundary (for the maintainers' decision)
The program is a pure state machine; a generated driver performs the requests. No effect enters the calculus.
perform : Request -> Responsein a loop) is the only code that touches the host. It is part of the Rust machine: a runtime profile item inRustSyntax, authored in.lex.texas [v0.4] #27 stage 6: complete the closed Rust AST so the runtime is generated from the calculus #91 stage 4 makes the runtime source, with the Rust standard-library calls it uses on the closed list of machine primitives [v0.4] #27 stage 6: complete the closed Rust AST so the runtime is generated from the calculus #91 stage 1 fixes (file read/write,std::process::Commandwith a timeout,env::var). This is not a new trust category: it is the same kind of item astick.TargetSemanticsand the preservation certificates cover the pure functionsstartandresume, for every response sequence (the compiler is correct against any host behaviour, includingDeniedandFailed). The claim that the driver performs the request is a table of machine primitives with stated meanings and a differential, at levelbuild, neversome-true: honest in the same way the work counter is.Environment namefor a closed list of names. Output order is the order of requests. The existing deterministic-artifacts gates therefore apply unchanged.allocation,overflowandrecursionstay what they are (resource failures of the pure function). I/O is not a fourth effect; it is theAskdata a root returns. A host profile is a new registry entry besiderust-core/rust-std(call itrust-host:rust-stdplus the driver), so a root that does not use the entry stays a library and the driver exists only where a program asks for it.mapover independent items that the driver may evaluate in parallel is a later, separate addition with its own determinism statement. [v0.4] #27 stage 8: the production compiler authored in .lex.tex and compiled by LexLean to production software #92's performance gate should be a measurement (a regression bound onjust vv), not a promise.Alternatives considered: (a) an effect monad inside the calculus (rejected: it puts state and failure into
TargetSemanticsand re-proves every certificate); (b) a typed host-function table callable from any closure member (rejected: it makes purity a convention, and the eligibility analysis could not tell a pure member from an effectful one); (c) world-passing (World -> (a, World)): equivalent to the state machine but needs a nominalWorldand linearity, which the calculus does not have.4. Stdlib and order
The stdlib is source (
.lex.tex, language 1.2, certified), a package of modules the compiler project imports: bytes and text overBytes(item B3), sorting andMap/Set-based dedup (the collections exist; they are templates, so #105 first), canonical JSON, decimal and hex, SHA-256 (expressible today overUInt32bit operations anditerate; to be measured, because the digest is on the hot path of every build), a diagnostic record and the closed error model's constructors.Proposed order, replacing my earlier list:
recursion = false; a root overflows the stack at about 40k iterations #105 (honest effects; loops after [v0.4] #27 stage 6: complete the closed Rust AST so the runtime is generated from the calculus #91 stage 3) and [v0.4] #27 stage 6: complete the closed Rust AST so the runtime is generated from the calculus #91 stage 1 (feat(rust): close the runtime's library boundary (RB-09, stage 1 of #91) #102).Request/Response/Steptypes as a language-1.2 stdlib module, a gate that no handwritten driver text exists.verify/axiom.rs, 210 lines, §22.5): closed, pure, oneResultof data, with committed golden vectors (tests/golden/axiom-parser/: accepted, wrapped, rejected) as the oracle andLLV7004as its only error. Then the preservation lexer/token audit.calculus::check,rust::{lower, validate, print, package}, the production stages, certificates, front end (as the issue says), each under the differential and, at the end, the fixed point.Questions
recursion = false; a root overflows the stack at about 40k iterations #105 and feat(rust): close the runtime's library boundary (RB-09, stage 1 of #91) #102 are in.rust-hostas a third target profile, or the driver as a feature ofrust-std? I recommend a profile: eligibility then states, per root, whether it may ask.Generated by Claude Code
humuhumu33 commentedon Oct 15, 2026
Note: SHA-256, the last stdlib member in the spike comment (§4, step 3), is being delivered under #126 (claim posted there; stage 1 = module + differential against
sha2+ production-build measurement, stage 2 = switching every identity).humuhumu33 commentedon Oct 15, 2026
Claiming the stdlib lane of this issue (step 3 of the order above): the members, in the order the pilot needs them, starting with bytes and text. Not the effects boundary (§3), which stays with afflom.
Member 1: bytes and text over
Bytes. A language-1.2 projectstdlib/besidecompiler/(module prefixLexLeanStd; the examples leg verifies it as it doescompiler/), first moduleText, seven production roots forrust-std, written in the notation:startsWith (subject prefix : Bytes) : Bool<[u8]>::starts_withendsWith (subject suffix : Bytes) : Bool<[u8]>::ends_withtrim (subject : Bytes) : Bytes<[u8]>::trim_asciilines (subject : Bytes) : List Bytesstr::lineson UTF-8 input (\nand\r\nend a line, the last line needs no ending)splitOn (subject : Bytes) (delimiter : UInt8) : List Bytes<[u8]>::splitjoinWith (pieces : List Bytes) (separator : Bytes) : Bytes<[Vec<u8>]>::joinfind (subject needle : Bytes) : Option Natstr::findon UTF-8 inputWritten as the spike did (B1–B3): components over
Bytes, character classes byequalonUInt8, noStringscalar iteration;iterate,iterate_untilandlist_foldcarryrecursion(#129).Evidence (R3): one register row,
SL-01in a new suitestdlib, scenario and failing test first. The test (a) checks and builds the project and reads the seven roots' eligibility, (b) runs each root's lowered program through the calculus interpreter and itsrust-stdrendering through the pinned rustc on a seeded corpus against the oracle above, zero disagreements, (c) detects a planted defect in a member, and (d) under the pinned Lean, exports the certified packages (certificates A, B, E) throughlexlean::api::production, committed undertests/production-export/stdlib/and compared bycheck-production-export. Theorems that needBytesequality by evaluation wait for B4 (#91 stage 2); until then the module's text logic is validated by the differential only, as §2.B4 says.Branch
claude/issue-92-stdlib-bytes-text; draft PR to follow. Sorting, JSON and hex/decimal come after, one PR each, unless the layout is objected to (SHA-256 is claimed under #126 and stays out of this lane).humuhumu33 commentedon Oct 16, 2026
Member 1 (bytes and text over
Bytes) is up as draft PR #153:stdlib/besidecompiler/, sevenrust-stdroots inLexLeanStd.Text,SL-01(suitestdlib, SPEC §17.22, register 382) green locally in 156 s including the Lean-backed export; fastvvlegs green, the long legs run in its CI. Sorting is next, in its own PR, unless the layout draws an objection there.chore(stdlib): regenerate the lock, records, and packages on the merg…
afflom commentedon Oct 16, 2026
Maintainer decisions on the three questions of the spike comment, so that the effects boundary has an answer and the stdlib lane (#153, #126) is not waiting on one. Each follows from what the issue already requires; none needs more information.
start/resumepair over first-order data and a generated driver performs the requests. The alternatives fail the issue's own text: an effect monad puts state and failure intoTargetSemanticsand re-proves every certificate; a host-function table makes purity a convention, so eligibility could not tell a pure member from an effectful one; world-passing needs a nominalWorldand linearity the calculus lacks. The one thing this fixes for the stdlib: no member may call a host function, and effects are theAskdata a root returns.rust-hostis a third target profile,rust-stdplus the driver. Eligibility then states per root whether it may ask, which a feature ofrust-stdwould hide.Bytesequality by evaluation wait, and the stdlib's text logic is validated by its differential, as the spike says.What this leaves in order: the boundary's SPEC section, register rows, the
Request/Response/Stepmodule and the gate come after #91 stage 4, because the driver is a runtime profile item that is authored in.lex.texand rendered by the Rust backend, and it cannot exist as handwritten Rust (this issue's DoD and #91's). I will not land a boundary text with no driver behind it: that would be a register row claiming what nothing implements. The stdlib members (#153 and the ones after it) do not wait for it: they are pure.Generated by Claude Code
afflom commentedon Oct 16, 2026
Claiming step 4 of the order above, the first real pilot: the exact axiom-output parser (
verify/axiom.rs, §22.5), authored as.lex.texproduction roots, certified (A, B, E) and compared with the Rust it replaces. A contributor session has it, stacked on #153'sTextmembers (branchclaude/issue-92-pilot-axiom-parser, fromclaude/issue-92-stdlib-bytes-text; nothing is pushed to #153's branch). It will post its project layout here before building, and open a draft PR (Refs #92) with one register row (BS-01), the golden vectors oftests/golden/axiom-parser/and a seeded differential as the evidence. The Rust parser stays as the stage-0 oracle until the fixed point.@humuhumu33: this is the user of #153's
startsWith,trim,lines,splitOn,find. If the pilot finds a member missing or wrong, it will say so on #153, not patch your lane. It does not move the language-1.2 identity; if it needs to, it stops and reports here first.The boundary (SPEC section, register rows, the
Request/Response/Stepmodule and its gate) is still after #91 stage 4, as decided above.Generated by Claude Code
afflom commentedon Oct 16, 2026
Pilot layout (step 4, axiom-output parser). Proceeding unless the maintainer objects here.
Cross-project imports are impossible today. A project reads only its own
source_roots;config::is_project_relativerejects.., and symlinks are refused (project.rs). Sobootstrap/cannot\importmoduleLexLeanStd.Text.Least-bad layout:
bootstrap/besidecompiler/andstdlib/, module prefixLexLeanBoot, moduleAxiomOutputholding the production roots of the parser.bootstrap/src/Text.lex.texis a vendored copy of feat(stdlib): the first member, bytes and text over Bytes (#92) #153'sstdlib/src/Text.lex.tex, identical except that theproduction:clauses are removed (so the copy is a library and does not republish seven duplicate certified packages). The BS-01 case asserts that equivalence on every run (the copy equalsstdlib/src/Text.lex.texwith theproduction:clauses stripped), so the copy cannot drift from feat(stdlib): the first member, bytes and text over Bytes (#92) #153. It is deleted once projects can depend on projects.stdlib/. It would changestdlib/expected/andtests/production-export/stdlib/, which feat(stdlib): the first member, bytes and text over Bytes (#92) #153 and the later stdlib members compare byte for byte, and it would put a bootstrap component into the library lane.One member does not fit:
Text.trimistrim_ascii, by design. The Rust parser usesstr::trimandchar::is_whitespace(UnicodeWhite_Space: VT, U+0085, U+00A0, U+2000-200A, ...), so the pilot defines the Unicode variants locally and the differential includes those characters. I will say so on #153 rather than change it there.No runtime or calculus change is planned; the language-1.2 identity is not touched. Branch
claude/issue-92-pilot-axiom-parser.Generated by Claude Code
wip(bootstrap): axiom policies aligned; decimal formatting under inve…
afflom commentedon Oct 16, 2026
Maintainer: the pilot layout above is accepted; proceed.
The vendored
Text.lex.texis acceptable because the case asserts on every run that it equals #153's file with theproduction:clauses stripped, so it can only be a copy, not a fork. It is temporary and has to say so in its header and in the SPEC paragraph.The finding behind it is bigger than the pilot, and it is on this issue's path: a project cannot import another project's modules (
source_rootsstay inside the project,..and symlinks are refused). Step 2 of the order here ("a package of modules the compiler project imports") has no mechanism today, and thelexicon_sourcekinds (builtin,path,git) are for glossaries, not source modules. Before the compiler's own modules (steps 5 to 7) import the stdlib at scale there must be one. Options, for whoever takes it (I will write the design comment when #153 and #146 have landed, so it can rest on the stdlib as it is then): (a) one project holds both, the stdlib being modules of the compiler project andstdlib/its published slice; (b) asource_packagekind oflexicon_sourcethat pins another project's modules by tree hash, read into the importing project's graph and identity; (c) a project-level[[dependency]]with the same pinning. (b) and (c) change the identity and the lock format, so they belong with #91 stage 2's regeneration, not before.Not in the pilot's scope; no change to its plan.
Generated by Claude Code
73 remaining items
afflom commentedon Oct 24, 2026
#92 step 4, BS-13 scope finding (loops:
tail::loopedandtail::loops)In
Lowering::lower, each function runsexpr(takes fresh names),succeed,fold, thentail::looped(takes1 + |changed parameters|more fresh names when the function loops), thenmoves::apply, one function after the other on one counter. So the names of function i+1's terms come after the loop names of function i; BS-11'slowerBodiesthreads the counter across all functions from 0 and is right only because its corpus has no looping function.Cut I will take, unless told otherwise:
lowerBodiesofRustBodiestakes the counter it starts from as a parameter (today the literal 0); with every function but one marked dead it lowers one function and returns the counter after its terms. This is a one-parameter change to BS-11's root (its certificate grows by a few hundred bytes, and BS-11/BS-12 need one more export each when it lands on their branches).loopFunctionofRustLoopsportslooped(occurs,tails,passes,retarget, the state type and the new parameters) over one function: parameters, result type, body block, start counter; it returns whether it loops, the new parameters and body, and the counter after.lowerBodies(one function, counter in) →succeedBodies→foldBodies→loopFunction(counter in, counter out) → all functions toapplyMoves, and compares with the Function items ofrust::lower. The host threads one number between certified roots and decides nothing else; the order of the functions is the oracle's.rust::loopstrue for at least one function), andtail::loopsis checked against the root's found flag on every vector, as the oracle itself asserts at lowering.I start now; if you want the counter handled differently (for example a root that returns the loop-name counts so
lowerBodiesis not touched), say so.Generated by Claude Code
afflom commentedon Oct 24, 2026
#92 step 4, BS-13 (loops:
tail::looped): figuresOne production root for
rust-std,RustLoops.loopFunction, ported fromtail::loopedand held to the Function items ofrust::lowerto the byte, function by function: for each live function the terms from the counter of fresh names (BS-11'slowerBodies, which now takes the counter it continues from and returns the one after its bodies),succeed(BS-12), the fold, thenloopFunction(which takes1 + |changed parameters|more names); the counter passes to the next function; then all items go to BS-08'sapplyMoves.loopFunctionfinds a loop exactly wherecalculus::rust::loopsdoes on every function, and the case fails otherwise.loopFunctionlowerBodies(BS-11) changed shape by the counter parameter: part A 5,328,431 (84.7%, within the row's 5,505,024); BS-11's row and figures are updated on this branch.Generated by Claude Code
afflom commentedon Oct 24, 2026
#92 step 4, BS-14 scope finding (the crate around the bodies)
What
Lowering::lowerstill does outside the certified roots: the order of the items, the parameters of each function (binder: a name when the body mentions it and the type is not unit, a wildcard otherwise), its result type (wrapped inFalliblewhen the function can overflow), and the body of a function with an uninhabited parameter (an empty match on that parameter, with the origintype:<kind>; such a function is the dead one). Until now the cases took those from the oracle's own items (the parameters of every function, the bodies of the dead ones, and the whole of the types items were not compared).Cut I take:
RustAssemble.functionShells: for each function in order, the Function item with its parameters, its result type, and, for a dead function, its complete body; a live function's body is a placeholder. Inputs are the program and the frame, aslowerBodiestakes them. The host reads the parameters and the result of a function from here (soloopFunctionno longer takes the pre-loop parameters from the oracle).RustAssemble.assembleItems: the items oflowerTypes(BS-07), the shells, and for each live function what the loop pass returned (parameters and body), as one chain of items.applyMoves, and compares the whole item chain ofrust::lower's crate (the types items included), not only its Function items; the profile is the host's input.rust::lowerruns after lowering (validate,correspond), which are the roots of BS-05/BS-06's Rust validator and are not composed here; the profile (an input).I start now.
Generated by Claude Code
afflom commentedon Oct 25, 2026
#92 step 4, BS-14 (the crate around the bodies): figures
Two production roots for
rust-std,RustAssemble.functionShells(a Function item of each function: parameters by thebinderrule, the result type wrappedFalliblewhen the function can overflow, and the complete empty-match body of a function with an uninhabited parameter) andRustAssemble.assembleItems(the items oflowerTypes, the shells, and whatloopFunctionreturned for each live function, as one chain, the types' first). Held to the whole chain of items ofrust::lower's crate, the types items included, to the byte, by composition with BS-07 and BS-11..13 andapplyMoves.functionShellsassembleItemsapplyMoves. Three planted hosts that do more are each caught by the comparison with the crate: the counter starting again at each function, the functions lowered last to first, and the items of the first live function left out.functionShellsrecomputes it (vector 9 caught the difference).rust::lowerruns on the crate (validate,correspond), which are the roots of BS-05/BS-06 and are not composed here.Generated by Claude Code
afflom commentedon Oct 25, 2026
#92 step 4 is complete (#307 → #311 → #312 → #313 → #315); the boundary for step 5: what the Rust host still does
The roots below, composed in this order, give the whole chain of items of
rust::lower's crate to the byte (BS-14,crates/conformance/src/cases/bootstrap/rust_assemble.rs). Names areModule.root;Pis the program as calculus data(spec : Bytes, adts, parameters : List (List Nat), types, results, bodies)(the checker's encoding,program_argumentsin the cases).CalculusCheck.siteTreesPsites(a type chain)CalculusCheck.useTreesPusesRustLower.deadFunctionsP,sitesdead : List BoolRustLower.fallibleFunctionsP,sites,deadfallible : List BoolRustBodies.lowerFrameP,sites,deadFrame {known, edges, inhabited, ordered}RustLower.lowerTypesP,sites,dead,fallibleDefchain: the Enum and Apply itemsRustAssemble.functionShellsspec,adts,parameters,types,results,bodies,fallible,FrameDefchain: a Function item per function; complete for a function with an uninhabited parameterRustBodies.lowerBodiesP,sites,uses,dead,fallible,Frame,start : NatLowered {expr, next}: the bodies aslowerholds them beforesucceed, a dead function's place being the empty chainRustSucceed.succeedBodiesresults,fallible, bodiesOkpushed into the tails of the functions that can overflowRustBodies.foldBodiesRustLoops.loopFunctionme : Nat, parameters (Par), resultTy, body,startLoopOut {found, params, body, next}RustAssemble.assembleItemsDefof 6,Defof 7,List LoopOutof the live functions in order,deadRustMoves.applyMovesDefDefWhat the Rust host still does, exactly:
start= the counter so far, then 9, 10, then 11 withstart= thenextof 8, whose ownnextis the counter for the following function.lowerBodiesover all functions at once is right only when no function loops (BS-11's corpus); the loop pass takes1 + |changed parameters|names between two functions' terms.LoopOuts for root 12 is the live functions' results, in order.StdorCore; theCrateis(core : Bool, items)), and calls root 13 on the chain of 12.rust::lowerruns afterwards,RustValidate.validateCrate(krate)andRustValidate.correspondCrate(krate, elements)(BS-05/BS-06's roots); and the realization elementscorrespondCratetakes (elements(program, lowering):program_elements,function,type:adt,overflow,indirection), which no root computes yet.rust::loweraccepts. The errorsLowering::new/lowerreturn (an ADT with no constructor, a computation of a value no type inhabits, a heap type underrust-core,failures()) are not ported: no root says why a program has no rendering.deadandfallibleare taken from the oracle (lowered(),rust::fallible_functions), while roots 3 and 4 exist and are held to the same oracle in BS-07; a driver should feed 5–12 from 3–4.Two things that bit during step 4, for whoever composes these: (a) the set of inhabited types that decides a dead function is the one reached after the closures of dead functions are dropped (the
Frame'sinhabitedassumes all live; root 7 recomputes it); (b) certificate defects #310 (an arm that is a bare binder of the matched type) and #314 (list parameter before the recursive argument), both worked around in the sources.Generated by Claude Code
humuhumu33 commentedon Oct 25, 2026
Proposal for the owner: tag v0.4.0 at the downstream boundary; steps 5 and 7 of this issue and #91's H7 go to the next release
Posted here as the 2026-10-22 ruling asks (comment): a proposal only, the owner decides. No milestone, label or title is changed.
What is new since the 10-21 and 10-22 rulings
release/v0.4. PrismPM's v0.4 list asks LexLean for language 1.2 and the 1.1→1.2 migration (Migrate a language-1.1 data-form project to language 1.2 from the CLI #257). Add lexlean migrate --to 1.2 for language-1.1 data-form projects (#257) #261 delivered the migration atfbfaa73fe. No item on feat(rust): a loop over a state with a break value in the declared machine (SP-19, #91 stage 3) #211's list depends on steps 5 to 7 of this issue or on [v0.4] #27 stage 6: complete the closed Rust AST so the runtime is generated from the calculus #91's H7.Proposal
\title{Natural number addition}#251, Four public refusals have no committed negative fixture: LLB6005, LLB6006, LLB6007, LLT4016 #252), DF-19: structural recursion through nested inductive families #284 and SM-37: nested_induction, induction over a nested inductive type through its recursor (#278) #292, then [0.4] #34: the workspace version is 0.4.0 #309 and therelease.ymlrehearsal exactly as ruled on [v0.4] End-to-end release closure, examples, documentation, packaging, and clean-checkout reproducibility #34.This is the maintainer's option (a) of 2026-10-21 (comment), drawn later: the heap half and step 4 are in, only the unwritten rows move.
Estimate: about ten landings remain under the proposal. With stacked PRs landed together (offer 1 below), that is about three to five days of landings. This is an extrapolation from the 2 to 3 hour full gates of this week, not a measurement.
Offers, whatever the decision
6e8e4e9a1(run 40030579344), merged unchanged.🤖 Generated with Claude Code
afflom commentedon Oct 25, 2026
I agree that features and releases need to be focused on downstream requirements instead of arbitrary/self-referential aspirations. That's not to say the self-compilation/self-expression is not needed, but no release should be held if the downstream is blocked and the only remaining issues in the release are not requirements driven.
afflom commentedon Oct 25, 2026
Maintainer ruling, implementing the owner's note above (6399822402) and the owner's direction to me today: v0.4.0 is tagged at the downstream boundary, now. The downstream train (PrismPM#211, prism-code behind it) waits on the tag; what it needs, language 1.2 and the 1.1→1.2 migration (#257, landed in #261), is on
release/v0.4; every other open v0.4 item is self-hosting or hygiene, not a downstream requirement, and a release is not held for those.v0.4.0 =
release/v0.4as it stands (201519a1b, register 456) plus #309 (version 0.4.0 and the release notes). Nothing else lands before the tag. The release notes say exactly which bootstrap stages ship: the register carriesBS-01toBS-06andBS-09(the printed std runtime through H4b);BS-07,BS-08,BS-10toBS-14and the rest of the runtime-as-source ship in the patch release.v0.4.1 (new milestone, a patch release that follows directly on the same line, one regeneration at a time, in this order): #298 (H5, in flight; its regeneration is redone on the bumped line), #304 (H6), #305 (H7-audit), the bootstrap stack through #315, #247 (#30 slice 4), #256 (#251, #252), #284 with #292. All of it is written and accepted; none of it holds downstream. Issues #27, #30, #91 and #92 move to that milestone.
v0.5 keeps what the earlier rulings put there: steps 5 to 7 of this issue, #91's H7 (#306), and everything without a milestone.
On the proposal of 6399769811: it is the right direction and the owner has agreed with it; the cut here is tighter than offered because the owner's rule is "not requirements-driven, not in the release", and the heap half and step 4 are not. Offer 1 is already how the stack lands (#315). Offer 2: the regeneration that moves the identity stays the maintainer's step; thank you. Offer 3 does not apply.
Mechanics: #309 marked ready today and gated; merge; one
release.ymlrehearsal (the owner's go of #34 covers it); tagv0.4.0;mainreceives the line at the tag;release/v0.4forward-merges intorelease/v0.5. Then v0.4.1 landings resume at once. The moratorium of #15 stands until the tag; after it, issues and PRs open only against a milestone.Generated by Claude Code
afflom commentedon Oct 26, 2026
LexLean v0.4.0 is released.
v0.4.0ate0b74b81e6f49c83596a957d232c8383a5db1a25(release/v0.4).publish the release(cargo xtask release-checkaccepted the evidence; the CI evidence is the gate run of the tagged commit, per release-gate.sh ends the evidence with the line the release criterion reads #323).lexlean 0.4.0(published 19:20Z).Next: release/v0.4 is merged into
mainby PR (the line at its tag, SPEC §9.4), the hold on release/v0.4 landings is lifted (patch work on the line continues as 0.4.x; feature work goes to release/v0.5), and the second forward merge into release/v0.5 follows.Generated by Claude Code
BS-07 (UOR-Foundation#92 step 4d): the register row, SPEC §31 row, sc…
BS-15: the register row, scenario, and failing case of the package re…
Merge UOR-Foundation#305's head (bb37290, containing release/v0.4 at a…
humuhumu33 commentedon Nov 12, 2026
Proposal on #273: certifying a compiler-sized root (modular certification)
Posted in full on #273: #273 (comment). It is a proposal for the owner and the maintainer to decide. No milestone, label or title is changed, and nothing is built or pushed.
Why it concerns this issue. Stage 1 is one command root whose closure is the whole compiler. A root's certificates restate its whole closure (§17.17).
On the 62 committed bootstrap roots at
aaf845507(counted):max_file_bytes6,291,456.Scaled to the compiler (an estimate), one root's certificates A and B would be about 340 MB and 440 MB.
The proposal.
The #273 comment also covers the stage-1 decisions that follow: where the command root lives, how the compiler reaches its 36 MB
language/tree,rust_rendereruntil removal, and whether the self-compile's certificates are committed. It ends with six questions.🤖 Generated with Claude Code