Repository navigation
Description
Certificate B (the rust-std rendering) of a production root is rejected by the Lean kernel when a function has a match arm whose whole body is a bare binder of the matched recursive type. Found while exporting the RustBodies roots of #92 step 4; the error names a root that is not the culprit (parseAuditOutput for a function of RustBodies), because verification covers every root of the entrypoint closure.
Error (LLV7015, production build):
certificate B: `LexLeanPreserve.C….R0.RustStd` was rejected in `fun1` of root `LexLeanBoot.Mini.tailOf`: error: native core declaration '…RustStd.fun1':
(kernel) application type mismatch
LexLeanPreservation.Rust.Corr.mCons (… (LexLeanPreservation.Rust.Corr.mCons LexLeanPreservation.Rust.Corr.mNil
(Eq.refl [LexLeanTarget.TargetSyntax.Arm.arm (LexLeanTarget.TargetSyntax.Shape.adt 0) [1, 2] …
Minimal project (one module, no source package; lexlean.toml as lexlean init writes it with entrypoints = ["src/Mini.lex.tex"], module_prefix = "LexLeanBoot", language 1.2). lexlean lock, then production build with a request for LexLeanBoot.Mini.tailOf, target rust-std (descriptor digest of the line at fbfaa73: 25e8eba5c28e98c5787c168bb517113e55de605e8e3cd7a517efd914dbc8b73c). About 4 minutes.
\begin{lexlean}{Mini}
\useglossary{lexlean.std.nat@1.2.0}
\title{Natural number addition}
\begin{semanticmodule}
inductive{
name: Expr,
type_parameters: [],
parameters: [],
constructors: [
{name: ELit, fields: [Nat, Nat]},
{name: ERead, fields: [Nat, Nat, Nat]},
{name: ENil, fields: []},
{name: ECons, fields: [Expr, Expr]}
]
}
definition{
name: itemTail,
parameters: [items : Expr],
result: Expr,
body: (match items
| Expr.ELit v0 v1 => (ctor Expr.ENil)
| Expr.ERead v0 v1 v2 => (ctor Expr.ENil)
| Expr.ENil => (ctor Expr.ENil)
| Expr.ECons item itemsTail => itemsTail),
executable: true
}
definition{
name: tailOf,
parameters: [items : Expr],
result: Expr,
body: (itemTail items),
production: {effects: [allocation, recursion], targets: [rust-std]},
executable: true
}
\end{semanticmodule}
\end{lexlean}
Measured variants (each a full export of the same shape):
Arm of ECons |
Result |
|---|---|
itemsTail (the binder, a field of the matched type) |
rejected (17 constructors of RustAst.Expr, and the 4 above) |
item (the other binder of the same type) |
rejected |
(ctor Expr.ENil) (a constant) |
exports |
(same itemsTail) with same(x : Expr) : Expr = x |
exports |
So the Corr proof of a match whose arm returns a binder of the matched ADT is not accepted, while the same value routed through a call is. The roots committed before this one export, so the shape was not met earlier; it was not searched for.
Workaround in the tree: keepE and keepP identity functions in bootstrap/src/RustBodies.lex.tex, to be removed when this is fixed.
Refs #92.
Generated by Claude Code
Activity
afflom commentedon Oct 24, 2026
Maintainer: confirmed as a defect of the certificate B emitter, mine to own, placed on v0.5. Reasons: the refusal is honest (the kernel rejects a certificate the compiler emitted,
LLV7015, no unsound acceptance), the construct has a one-line workaround that BS-11 carries with a comment naming this issue, and the fix lives in the preservation library or the certificate builder, so it moves the compiler-semantics ID and would cost the v0.4 line another regeneration wave for a completeness gap. The owner can pull it into v0.4 by saying so here. The fix removes thekeepE/keepPwrappers ofRustBodiesin the same PR.Generated by Claude Code
Remove the workarounds of #310 and #314 from the bootstrap source
Integrate certificate fixes, GNAF validation and nested induction
afflom commentedon Nov 5, 2026
Delivered through merged #393, commit 55be5514, on release/v0.4. The actual merge parents are c613290 + reviewed head050e9657, and actual/tested/reviewed tree
3065516167862533e0594427c28be8fe74406aaeis identical. Final CI passed all45 jobs, including honesty, required hosts, complete normative cases/plants and Atlas; reproducibility passed. Final evidence review retained independent source/artifact/semantic and final acceptance reviews.The original certificate failure is covered by the retained SP32/SP33 regressions and successful complete normative preservation partition, with official final-identity artifacts and the actual final gate.
Closing explicitly because this accepted landing targets a non-default release branch.
BS-11: the terms of a function body of the Rust lowering, RustBodies …
SP-32: an arm that returns a boxed field is the read of the box (UOR-…