Repository navigation
feat(core): derived rows are made by Lean's reserved-name actions and checked (SM-33, stage 2 of #91, part 1) - #155
Conversation
… checked (SM-33, stage 2 of #91, part 1) A version 2 core-module row whose name the pinned Lean reserves (matcher equations and splitters, definition equations and unfolding theorems, sparse else_eq) is no longer submitted as data: the decoder runs Lean's own reserved-name action and refuses the module unless the constant it makes has the row's kind, levels, type and value. The state those actions read (recursive tag, transparency, matcher and equational-lemma records, realization context) is installed as each row is added; the sparse casesOn cache drops the decoder's own constants and holds each remade one under both keys. All 7,071 derived rows of the preservation library are remade exactly. No file under language/ or schemas/ changes, so no compiler-semantics ID moves. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ecoder's name prefix (RT-04) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ed-rows # Conflicts: # CHANGELOG.md
The decoder now realizes derived rows, whose private names carry the module's name; without -R, Lean named the harness's modules differently and its realizations missed the rows' names (GC-02, GC-09, SP-02..SP-04, SP-07..SP-10). lexlean verify already passes the root. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ed-rows # Conflicts: # CHANGELOG.md # README.md # SPEC.md # VERIFICATION.md # crates/conformance/src/cases/repository.rs # xtask/src/spec_links.rs
|
@humuhumu33, #146 is merged: main is
Review: I read the decoder change and the Generated by Claude Code |
…ed-rows # Conflicts: # CHANGELOG.md
… sparse cache alone #146 renders certificate E through the version 2 decoder outside the module system, where `import all` is refused. A certificate states theorems only, so its rendering drops the import and the decoder's two uses of the cache. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Each certificate E carries the version 2 decoder; it is longer, so the total the limit refuses at root r14 is 2039289 bytes, not 2022504. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Main is merged: the head is You were right about the overlap, and it went the other way from what you expected. The legacy rendering shares the version 2 header, so certificate E got the new One record moved: On WSL with the pinned Lean, on this head: On ordering with #159: that is Ilya's call; he will answer when he is back. Generated by Claude Code |
|
@humuhumu33, thank you for the Review state: no blocker from my reading of the decoder and the Generated by Claude Code |
…ed-rows # Conflicts: # CHANGELOG.md
|
@humuhumu33, main moved twice since your What I would do, in your place: let that run finish if it is close (it is the evidence for the decoder change, and for certificate E under it), then merge main once, push once, and take the run on that head. Conflicts to expect: README, SPEC §31's total, If the run on Generated by Claude Code |
…ed-rows # Conflicts: # CHANGELOG.md
|
Main is merged once more, as you suggested: the head is On WSL with the pinned Lean, on this head: Generated by Claude Code |
|
@humuhumu33, #82 is merged: main is Generated by Claude Code |
…ed-rows # Conflicts: # CHANGELOG.md # README.md # SPEC.md # crates/conformance/src/cases/repository.rs # xtask/src/spec_links.rs
|
Main is merged: the head is On WSL with the pinned Lean, on this head: Generated by Claude Code |
#82's text library states its private names for the module LexLeanText while it is compiled as LexLeanText.LexLeanText; an action makes only the private names of the module it runs in, so such a row is submitted as data (LM-02). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
@humuhumu33, the run on So Other checks on that head: 7 green and 5 running at the time of this read; I will look at the rest when it finishes. Nothing is needed from me; this one is in your decoder. If the fix changes what Generated by Claude Code |
This reverts commit bed743f.
…s as LexLeanText states its private names for a module LexLeanText, but the library compiles as LexLeanText.LexLeanText (module_prefix + file). Rows submitted as data did not care; now that a derived row is what Lean derives, its private names and those its proofs mention must be the compiled module's (LM-02). 53 names renamed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Thank you for the read. The cause is one step to the side of the I tried an exception first (a row private to another module is data) and dropped it: it moved the failure to Since it changes Generated by Claude Code |
The language-1.2 compiler-semantics ID moves from 7a7834c6 to 74bafbfa: locks relocked by ID substitution, then golden, calculus, model, fixtures, production export and verify-examples rewritten in #82's order (uor-atlas, language 1.0, aside). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Pushed: the head is
On WSL with the pinned Lean, on this head: Generated by Claude Code |
…ed-rows # Conflicts: # CHANGELOG.md
|
#160 is merged in: the head is On WSL with the pinned Lean, on this head: Generated by Claude Code |
|
@humuhumu33, #155 is green on Your decoder PR is green: my review has no blocker (SM-33's two refusals, the Generated by Claude Code |
|
Yes, thank you: please merge main What the merge has to keep, since most of the conflicts are generated records:
When it lands I will check it against those four points, Generated by Claude Code |
…rows (generated records taken from main, to be regenerated)
|
@humuhumu33, working on it. #165 ( State of the merge in my worktree (not pushed; you push nothing meanwhile): generated records taken from main and regenerating; your four points hold on the merged tree: the 53 renamed private names of Generated by Claude Code |
…3f0c7 into #155) Main moved under this branch with #162 (source packages), #153 (stdlib), #160 (bootstrap) and #165 (PK-05). The merge keeps this branch's side of the four points that matter (the 53 renamed private names of LexLeanText.lex.tex, legacy certificate E rendered with legacy_decoder() and no `import all`, SM-33, the decoder) and takes main's tree for every generated record, which is regenerated here. - register 404 (403 on main + SM-33): README, SPEC §31 total, table.len(), spec_links.rs set by hand; - language-1.2 compiler-semantics ID 91b3cb51... -> 63dd4c08...: every lock that carried the old one is substituted and `lock --check` is current; - regenerated in order: check-golden, check-fixtures, check-calculus, check-production-export, verify-examples (the language-1.2 examples, compiler, stdlib, bootstrap; languages 1.0/1.1 examples are untouched by this branch and were not rewritten), validate-model --write; - local checks passed: validate-model, validate-spec-links, check-test-inventory, check-golden, conformance_{sm_33,lm_02,sp_14,rt_02,rt_04,bs_01,pk_05,rp_07,rp_14, rp_11,sl_01,sp_05,sp_09}. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013QppGKetUURseXowZun9KY
|
@humuhumu33, pushed:
Local cases, all green on this tree: The run is the full gate on a head that contains main. When it is green I give the formal approval and merge (merge commit, pinned to Generated by Claude Code |
afflom
left a comment
There was a problem hiding this comment.
Maintainer review: approved at 5a04afd.
Scope of what I read: hh's change on its earlier head ed51aad3 (the decoder that makes derived rows through Lean's reserved-name actions and refuses a row that differs, the SM-33 case with its two refusals, the legacy certificate E rendering, the lm_02 private-name fix), and the delta of this head over it, which is the merge of main 243f0c73 (#162, #153, #160, #165) and its regeneration, made by me at hh's request on the 17th.
On this head: all 26 checks of the run are green (the whole gate: 6 legs, 14 Atlas jobs, 4 hosts), the head contains main, and hh's four points hold: register 404 with SM-33 set by hand in README, SPEC §31 total, table.len() and spec_links.rs; the 53 renamed private names of LexLeanText.lex.tex kept; core.rs renders legacy certificate E with legacy_decoder() and no import all; the combined language-1.2 ID is 63dd4c08… with every lock substituted and current. The last commit of the head is mine; hh authored the PR and every other commit, so this is a review by someone other than its author, with that stated.
Merging with a merge commit pinned to this head. hh: please run your post-landing check (SM-33, LM-02, SP-14, check-golden) on main and report on the PR; a finding is a fix PR, not a blocker for the identity train waiting on this landing.
Generated by Claude Code
Main through #155 and #166. The register is 405: main's 404 and SL-02, set by hand in README, SPEC §31, repository.rs, and spec_links.rs. stdlib/ and bootstrap/ are relocked (bootstrap pins stdlib's tree, which gains Sha256); the stdlib records are regenerated next. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Stage 2 of #91, part 1 of route (c) (intent): the decoder of a version 2 core module no longer takes a derived row from the data. A row whose name the pinned Lean reserves is made by Lean's own reserved-name action and refused unless it equals the row.
What changes
crates/lexlean/src/backend/core_v2.rs, the one fixed decoder of core module 2:Lean.isReservedNameaccepts (matchereq_Kandsplitter, definitioneq_Nandeq_def, sparseelse_eq, and anything else a registered reserved-name action makes) is not submitted. The decoder runsLean.executeReservedNameActionfor the name and refuses the module unless the action makes the constant with the row's kind, levels, type and value. A row whose constant an earlier action already made is checked the same way.recursivetag, the transparency, the matcher record, the equational-lemma record, and the row's realization context (opened after the_sunfoldrow for a definition with an equational-lemma record).casesOncache: each chunk drops the decoder's own entries (the decoder is elaborated in the module, and itsaddOneUnchecked._sparseCasesOn_1onListsat under the key theentriesOf.match_3splitter looks up), and each remade sparsecasesOnis entered under the exported and the private key. The cache is private toLean.Meta.Constructions.SparseCasesOn, so the version 2 runtime imports that module in full (import all).SPEC §17.10 states the rule;
SM-33is new (register 386 → 387;SM-32is left to #151).What does not change
No file under
language/orschemas/: no source, lock, golden, or compiler-semantics ID moves. Version 1 core modules generate the same bytes.Evidence
casesOnmade by realizations, 125else_eq, 54eq_def) is remade exactly; the library compiles under the new decoder with no exception. Before the cache and row-time fixes, 10 structural definitions and 3 matchers differed; the study is in the [v0.4] #27 stage 6: complete the closed Rust AST so the runtime is generated from the calculus #91 thread.SM-33: a fixture whoseeq_1is Lean's verifies; the same row with another proof of the same statement, and a row namedeq_2, which Lean reserves but does not make, are refused withLLV7002.lexlean verifyof thetests/negative/preservation-driftproject with the pinned Lean verifies (the library compiled under the new decoder).RustMatches.lex.texchanged,LLV7014namingentriesOf.match_3.eq_1; (b) the cache entry removed,LLV7014namingsem_part.match_1_1.eq_2; (c) the decoder's own cache entries kept,LLV7014namingentriesOf.match_3.eq_2; (d) the comparison disabled,conformance_sm_33fails.tests/negative/preservation-drift: its shim appends a false theorem to the generatedCore.lean, and the decoder is 66 lines longer, so the expected error line moves from 704 to 770.conformance_sm_33,conformance_sm_31,conformance_sp_12,conformance_rp_07, andcargo xtask check-fixturespass. Fulljust vvis this PR's CI.Cost
Making 7,071 rows with Lean's generators costs more than checking stored terms.
lexlean verifyof thepreservation-driftproject, which compiles the library once, took 172 s onmainand 205 s and 211 s on this branch (WSL, two runs each): about 36 s, or 21%, per compile of the library. The conformance harness compiles the library once per toolchain and caches it; each example verification that compiles it pays the 36 s. CI will show the total.Next
Part 2: the derived rows leave the sources (names only, or none), so a type that gains a constructor costs only its authored proofs (2 for
Item, 11 forExpr); then the scalar items with the 21 machine primitives' meanings inRustSemantics.Bytes primitives: this PR changes no reducibility, so whether they reduce in the kernel is unchanged (#92).
🤖 Generated with Claude Code