Repository navigation
feat(#90): the runtime of generated Lean is native modules (RT-01..RT-04) - #144
Conversation
…-04) The portable primitives, ordered collections, model predicates, and reasoning lemmas of language 1.2 were Rust string constants the backend spliced into every module that used them. They are now four native core modules of the embedded project language/runtime-1.2/library (LexLeanRuntime.Portable, .Collections, .Models, .Reasoning), migrated once and losslessly, which a generated module imports. Verification compiles, replays, and audits the runtime modules a project uses. Languages 1.0 and 1.1 are frozen: their released runtime text is data under language/runtime-1.2/frozen/, and their output is byte-identical. The decoder of core module 2 stays the one Lean text of the language-1.2 compiler, since it is what loads native modules. The preservation and certification libraries' references to the per-module runtime copies are renamed by a pairing walked through the kernel terms. The differential oracle's tables are re-versioned for what it answers once the runtime is imported. The language-1.2 compiler-semantics ID changes, and every language-1.2 record is regenerated. This commit is the migration checkpoint: it carries the one-time oracle, tests/runtime-library/oracle/, which the next commit removes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The record of what it established is tests/runtime-library/MIGRATION.md, which now names the checkpoint commit 34d940f that carries it (RT-01: the completed migration input is not in the release tree). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Heads-up from the maintenance of #99/#101/#102, not a review (I have not read this diff and have not touched the branch). Main moved under this PR after its CI started: #101 merged ( What overlaps, so the merge is not a surprise. #101 (
Procedure that worked for #101, and that you reproduced independently there: merge main with a merge commit, take main's side of those generated files, regenerate them ( If you want me to do that merge for this branch, say so here and I will, with the same guard (nothing pushed until you say, since a push cancels the run in progress). If you would rather keep your CI run going to its end first and merge main afterwards, that is also fine; I will not touch it either way. Generated by Claude Code |
|
Status and one question, @humuhumu33. CI. All eight checks are green on Order against #146. Both PRs change the certificate text of Question. Who does this PR's main merge? (a) I do it, on this branch, with the procedure from my earlier comment: a merge commit, main's side of the generated files, Generated by Claude Code |
|
Correction to the counts above: #130 (PX-13) merged, so main is Generated by Claude Code |
# Conflicts: # CONFORMANCE.md # README.md # SPEC.md # VERIFICATION.md # crates/conformance/src/cases/repository.rs # crates/lexlean/src/production/certificate.rs # examples/models/expected/verify/preserve/preservation.json # examples/reasoning/expected/verify/preserve/preservation.json # tests/negative/certificate-resource-exhausted/expected/command.json # tests/negative/certificate-resource-exhausted/expected/diagnostics.json # xtask/src/spec_links.rs
|
No answer to the question above in over six hours, and no push from you on this branch or on #146 since 22:43Z, so I am doing the main merge, and I am reversing what I wrote ("I will not push to it unasked"): this PR is the critical path of #90 → #89 → #91 → #92, it is complete and green on its own base, and what blocks it is mechanical. What I am doing, so nothing is a surprise. In a scratch tree, on top of your tip
Then full CI on the new head (it restarts on the push). Generated by Claude Code |
…ficate-resource-exhausted fixture on the combined tree The merge of main (#101's list helper, #130's PX-13, #139, #140, #135, #137, #143, #147) into this branch: counts set to 386 by hand, certificate.rs keeps #101's lean_list argument form with this PR's LexLeanRuntime names, CONFORMANCE.md regenerated. verify-examples --write (models, reasoning) and check-fixtures --write change only these four files. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013QppGKetUURseXowZun9KY
|
Thanks for taking the merge. I had the same merge in progress locally (on
Agreed on the order: this one first, then #146 regenerates 🤖 Addressed by Claude Code |
…age-model; the register carries only the wired text rows LM-01..LM-03 and LM-13 (390 IDs)
The runtime modules of #144 are shipped data: every part elaborates them before its own modules, the part that publishes replays and audits them, and its records lead the attestation as on main. The register has 387 IDs.
|
Post-merge review of this PR, merged at 08:01:59Z, 32 s after its last check finished and before the maintainer review of the two commits the afflom session had pushed to it ( Generated by Claude Code |
…ards ci: verify UOR Atlas as the parts of one run (#131, steps 2 and 3 of its agreed order). Tested head 55583ba, which contains main 32afe5d (#144): run 38905653756, all 22 checks green. Atlas side (prefix start to join end) 95.9 min, the rest leg 111.5 min (the longer side now), the examples leg without Atlas 23.4 min, against 178 min for the examples leg on main at 514e95a. The join published Atlas with attestation fa0885f9... and found its 267 normalized records equal to expected/verify. #131 stays open: the bdd certificates partition and step 1 remain.
…to claude/issue-89-typed-certificates The four register counts are set by hand to 387 (main's 386 with SP-14). A staged runtime module carries no authoring-notation record (`source: None`, as a library module), the one semantic conflict of the two changes. VR-13's production slots gain certificate E's data record, `preserve/LexLeanPreserve/*/*/Compose/*.lex.tex`, which §22.8 already lists. The language-1.2 records are regenerated on the combined tree: verify-examples --write (every corpus but uor-atlas, which neither side touches), check-fixtures --write, check-production-export --write. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Closes #90 (stage 4 of #27). The one Lean text the language-1.2 compiler keeps, the core-module-2 decoder, is declared as the loader's seed; the reasons are below and on #90.
What this does
The language-1.2 runtimes are LexLean source. The portable primitives, ordered collections, model predicates, and reasoning lemmas were Rust string constants that
backend/semantic.rsspliced into every generated module that used them, one copy per module. They are now four nativelexlean/core-module/2modules of a new embedded project,language/runtime-1.2/library/, written in the core notation of #104:LexLeanRuntime.PortableLexLeanRuntime.CollectionsLexLeanRuntime.ModelsLexLeanRuntime.ReasoningThey were exported once, losslessly, by the #79 route. The record is
tests/runtime-library/MIGRATION.md. The exporter is in the checkpoint commit, the first of the two, and the second commit removes it. A generated 1.2 modulepublic imports the runtime modules it uses and carries no runtime text (SPEC §17.12, Runtime modules).verifystages them. A verification compiles the runtime modules a project imports before the project's own modules. That includes the runtime modules imported by the calculus modules its certificates are checked against. It replays them withleancheckerand audits every runtime declaration against its exact axioms (§22.3, §18.9). The certificate workspace, the extraction stage, the oracle differential, andTC-04's evaluator include them too.Languages 1.0 and 1.1 are frozen.
portable_runtime()and the core-module-1 decoder are now committed data:language/runtime-1.2/frozen/portable-runtime-1.1.txtand.../core-decoder-1.txt. Only the 1.0/1.1 backends read them. They lie in the 1.2 partition of §21.2, so the 1.0 and 1.1 IDs do not move, and no 1.0 or 1.1 output changed.conformance_rt_02checks that the bytes equal the released output.The probe and audit modules are typed data.
backend::lean::AuxiliaryModuleholds imports plus a closed command set (set_option autoImplicit false,universe,example,#print axioms), rendered once by the backend. The rendered bytes are unchanged.New
runtimesuite,RT-01..RT-04. Each has its SPEC §31 row, a scenario, and aconformance_rt_0Ntest. The register goes from 380 to 384.RT-01RT-02RT-03LLV7005.RT-04VR-19,SP-12, andGC-11now state the one Lean text their generated modules carry beside data, and their cases check it.Consequences the issue did not spell out
The libraries' references were renamed. A runtime name is now
LexLeanRuntime.x, not<module>.LexLeanRuntime.x. The native preservation and certification libraries are kernel data that named the per-module copies. The renaming was derived, not assumed:TargetSemantics.primitiveandRustSemantics.literalhad reused their module copy'scheckedMultiplyInt64.match_1, so their later matchers renumbered by two.walk.pycompiled the calculus modules asmaingenerated them and as they are generated now, then exported both. It walked every declaration's kernel type and value in parallel. It found 3,914 pairs, each the same tree up to constant and binder names, pairing 480 names.rename.pyapplied that pairing to the data form of 23 library sources, converted from the notation and back withlexlean::sdk. The round trip alone changes no byte. Only names changed: 551 occurrences in the preservation library and 280 in the certification library. The kernel re-checks every proof when the libraries compile against the regenerated calculus modules.LexLeanRuntime.equal.eq_1is now declared by two preservation modules that don't import each other, with identical rows up to binder names. The pinned Lean imports such equation lemmas from both modules (tested by elaboration andleanchecker).preserve.rsnow accepts a name declared twice only when it is an equation lemma and both rows are the same declaration.These findings were posted on #90 beforehand (decoder, rename).
The oracle answers differently. The pinned oracle (
lean4-prod, §17.19) exports one module's closure and does not follow a call into another module. A collection template or a reasoner's iteration that Lean's compiler keeps as a call is now anunresolved-external-callrefusal. Two list roots the oracle refused before are now generated, and they return their list into a caller's buffer. The harness passes such a buffer and compares the elements written. The tables are re-versioned with digests inoracle/table-versions.toml:known-differencesv3: rows move between KD-01/02 and KD-03, and the new KD-13output-bufferis added.known-non-overlapv2: 20 constructs change refusal, andmap_entriesandset_elementsleave the table.The corpus counts in §17.19 changed from 30 to 32 generated, 72 to 70 refused, 23 to 25 compiled, and 1411 to 1446 inputs.
The core-module-2 decoder is the seed
LEAN_CORE_DECODER_V2is the one Lean text of the 1.2 compiler not generated from a native module. It is what loads native modules into Lean, so it cannot be one of them: a loader cannot load itself. The printer of #93's stage 3c prints kernel terms into the core notation, not into Lean, so it does not close that circle. Printing the decoder back as elaboratable Lean would be a large new path with no gain in assurance:RT-04holds it to be the only such text in the compiler and finds a planted second one.Evidence
casesOnrows equal up to binder names. The attribute probe matches (47 lines).974c98b5…toa4111005…; 1.0 and 1.1 are unchanged. Everything that depends on it was regenerated:expected/verify/records, which cover certificates A, B, and E of every production root over the renamed librariesc257a657, one run,--test-threads 2. 382 of 383 passed. The one failure,RT-01, failed because its plants and its name scan read only the data form. It now reads the notation too, andRT-01..RT-04pass. The rebase onto feat(rust): close the runtime's library boundary (RB-09, stage 1 of #91) #102 (70de63d3) changed only the register count. After it,RP-07,RB-09,RT-01..RT-04,model,spec-links, andinventorypass.fmt-check,lint(clippy-D warnings),model,spec-links,test,bdd,inventory,golden, anddeny.reprois left to CI.VERIFICATION.md(runtime modules can fail).examples/uor-atlas(language 1.0, whose output and records this change does not touch) needs more memory than the host has. It runs in CI'sexamplesleg.🤖 Generated with Claude Code