Skip to content

A check-only build without the preservation library, with the 1.2 ID as a checked constant (#495) - #499

Merged
humuhumu33 merged 5 commits into
release/v0.4from
feat/check-only-build
Nov 13, 2026
Merged

humuhumu33 merged 5 commits into
release/v0.4from
feat/check-only-build

Conversation

@humuhumu33

@humuhumu33 humuhumu33 commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

Closes #495.

Scoped to what the review of #495 asks for first: check-only capability and identity correspondence. It admits no new release variant, no writer, no identity wave.

What changes

The lexlean crate gets a production-data feature, on by default, that embeds language/preservation-1.2/library/. Built with --no-default-features:

  • build.rs leaves the library's files out of embedded::FILES. They are absent, not empty, and there is no environment override. It also writes embedded::PRODUCTION_DATA = false.
  • compiler_semantics_id_for("1.2") returns the checked-in LANGUAGE_1_2_SEMANTICS_ID. The 1.0 and 1.1 IDs are still computed with the existing partitions and data-form rule: §21.2 already excludes every language/preservation-1.2/ file from them. Only 1.2 has a constant, because a constant where the data is present would add a way to go stale and gain nothing.
  • production build, and verify of a project with a production root, refuse with a new registered code, LLC0205 (exit 2), before a build is rendered or published. The guard is preserve::require_library(), at both entry points and at the head of preserve::native() as a backstop.
  • The version report adds a fifth line, variant check-only. The reduced binary shares the compiler-semantics IDs of a full build and not its executable identity; SPEC §8.4 and §30.3 say it is never a release binary and replaces a full binary for no certifying or producing use.

A default build differs only by the constant it tests. SPEC §8.4 carries the exception, and R4 in §27.2 and AGENTS.md says unsanctioned feature switch — the word RP-08's registered statement already uses — and names §8.4, which names R4 in turn. No registered statement changed.

Bindings

  • Source to constant. RP-10 recomputes the 1.2 ID from the complete normative tree on disk, independently of the compiler, requires LANGUAGE_1_2_SEMANTICS_ID to equal it, and names the correct value when it does not.
  • Inventory to built variant. RP-19 builds the reduced executable (--no-default-features) and holds it to the full build the harness links. It binds the complete excluded inventory, not its largest file: every one of the 31 files of language/preservation-1.2/library/ is witnessed by bytes of its own — the whole file when it is short, else a 64-byte window from its middle — and the image is read once for all of them, a 256-entry table of first bytes naming the candidates at each position, so the cost is the image's length and not its length times the inventory's size. One file, library/lean-toolchain (25 bytes), is the toolchain string the retained data embeds anyway and cannot be told from it in an image: it is named with its reason, and the reason is checked (its own bytes must occur in the retained data). The other 30 are bound by absence. The scan is shown to find what is there: the preservation data outside library/ (library.toml and the four calculus modules), which this build does embed, is found in the same image by the same method.
  • Constant to built variant. The same reduced build gives equal exit codes, stdout, stderr and lexlean.lock bytes for lock and --diagnostic-format json check on nat-add-zero (1.0), semantic-1.1, language-1.2 and production, and for check on three language-1.2 negative fixtures. Lock bytes are where a wrong constant shows. verify and production build on examples/production exit 2 with LLC0205, leaving no .lexlean/build, verified or production.
  • Target. This binds the host target the gate builds. A wasm32-wasip1 build is not bound here; it needs Build and run check on wasm32-wasip1 (six gated sites) #494 first.

Planted defects

A non-largest file of the inventory is embedded. build.rs keeps out every library file except src/Values.lex.tex (70,609 bytes), while the largest, src/RustLemmas.lex.tex (17,189,578 bytes), stays out — so an assertion that read the largest file alone would have passed:

test conformance_rp_19 ... FAILED
RP-19: the build without production-data embeds ["language/preservation-1.2/library/src/Values.lex.tex"] of `language/preservation-1.2/library/`

Read directly, that planted binary holds the witness of src/Values.lex.tex and not that of src/RustLemmas.lex.tex.

One digit of the constant (…680b to …680c):

test conformance_rp_10 ... FAILED
test conformance_rp_19 ... FAILED
RP-10: lexlean::LANGUAGE_1_2_SEMANTICS_ID is stale; the tree's language-1.2 ID is 06639c99a4cb1dbcb7fc9c0c87544ee05c599079d85272d8af66c8045900680b
RP-19: language-1.2: lexlean.lock bytes

With each plant removed, both pass. Both records are in VERIFICATION.md.

Measured

Native release builds, x86_64 Linux (WSL2, 12 cores, shared with other builds), taken at 425f15e:

release/v0.4 this branch, default this branch, --no-default-features
Binary 55,319,248 B 55,321,160 B 23,097,160 B
check on examples/language-1.2, median of 5 1.08 s 0.68 s 0.01 s
Peak memory of that check, median of 5 235 MB 237 MB 14 MB

The binary shrinks by 32,224,000 bytes against 32,215,857 bytes of library data (36,440,831 embedded in all). The base and default times differ through machine load, not code: a start that computes the 1.2 ID reads the whole library into its data form, and the check-only build does not.

Agreement at that head: the three binaries ran on every committed example (18), three language-1.2 negative fixtures and one project outside the repository, each under lock, lock --check, check, check --all, fmt --check --all and build. Exit codes, stdout and stderr were identical in all 22 × 6 cases, as were the written lexlean.lock bytes and the SHA-256 of every file under .lexlean/build. Every example's fresh lock equals its committed lock, and production targets is byte-equal to the base.

These are owner measurements, scoped to 425f15e. The merge to release/v0.4 adds one rust-runtime-1.2 module and leaves the excluded inventory unchanged; it moved the language-1.2 ID to 06639c99…680b, and the constant moved with it, which is the maintenance this design costs.

Acceptance narrative

The ready-event run at 425f15e (CI 43318953291) was a terminal success: all 70 materialized jobs passed, same-run honesty included, and exact-head reproducibility (43298076741) passed. That head is superseded by this one, which merges release/v0.4 and makes the review's correction, so it needs its own complete gate; that gate is what the current run decides. Checks run locally on this head: cargo fmt --check, validate-model (495 IDs, 87 codes), validate-spec-links, clippy with -D warnings for lexlean, repo-conformance and xtask with --all-targets --all-features and for lexlean --no-default-features, conformance_rp_06, rp_07, rp_08, rp_10, rp_11, rp_19, cl_18, and the bdd meta target.

Decisions for the maintainers

  1. The §8.4 exception. §8.4 forbade a feature that disables a normative capability; the PR makes production-data its single named exception and reconciles R4 with it. That amendment is yours. Recommendation: accept it — a separate check-only crate would add a second shipped crate beside the one §8.4 allows, which costs more than one named, gated exception.
  2. The constant moves with the language. On release/v0.4, 26 of the 99 first-parent commits of the last 30 days touched the 1.2 tree, and this PR's own merge moved it once. So about one landing in four changes one line, and RP-10 prints the value. Recommendation: keep it hand-edited under the existing RP-10 diagnostic, as the review says; no generator.
  3. Base. release/v0.4, per AGENTS.md. A check-only build without the embedded preservation library, with the compiler-semantics ID as a checked constant #495 has no milestone.

Not tested

  • verify or production build with a default build on this branch: they need the Lean toolchain, and their paths are unchanged apart from the new guard, which is a no-op with the data embedded. The gate's Lean legs cover them.
  • Any wasm build of this branch. Native-host qualification does not cover WASM.
  • RP-19 adds a debug build of the crate to the conformance run in its own target directory: about 30 s warm on this machine, more on a cold runner.

🤖 Generated with Claude Code

humuhumu33 and others added 3 commits November 12, 2026 20:09
…test (#495)

The register row, the SPEC.md §31 row and total, the scenario, and
conformance_rp_19, which builds the crate with --no-default-features and
holds it to the default build: no library source in its image, a version
report that names the variant, equal exit codes, JSON diagnostics and lock
bytes for lock and check, and LLC0205 before anything is published for
verify and production build. RP-10 now also requires the checked-in
language-1.2 ID to equal the ID recomputed from disk. SPEC.md §8.4 names
the production-data feature as the one exception to its rule, §21.2 says
how a build without it takes the 1.2 ID, §24.7 lists LLC0205, and §30.3
says such a build is never a release binary.

These tests fail here: the constant and the feature do not exist yet.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…constant (#495)

On by default, it embeds language/preservation-1.2/library/, the native
preservation library only certificate generation reads (32.2 of the
36.4 MB of embedded data). Without it, build.rs leaves those files out,
compiler_semantics_id_for("1.2") returns LANGUAGE_1_2_SEMANTICS_ID, the
version report adds "variant check-only", and production build and the
verify of a project with a production root refuse with LLC0205 before a
build is rendered or published. The 1.0 and 1.1 IDs are computed as
before: §21.2 excludes every preservation-1.2 file from them. A default
build differs only by a constant it tests.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@afflom afflom left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bounded review of exact 425f15e; existing implementation owner retained.

Engineering disposition: the explicitly named, non-release check-only variant is an acceptable direction for #495, subject to completing its correspondence evidence. Keep full/default release binaries and every existing proof/qualification obligation unchanged; the reduced binary cannot substitute for a qualified producer. This endorses the narrow capability design, not this draft's final acceptance or a general optional-capability exception. Keep the §8.4 exception and R4 wording consistent. A checked constant maintained with the existing RP-10 diagnostic is sufficient here; a new generator is not needed merely for this change.

P2 — RP-19's image assertion does not establish its registered claim. In crates/conformance/src/cases/repository.rs around 2464, max_by_key selects only the largest library file and the binary is searched only for that file's bytes. Accidentally embedding another library file while omitting the largest still passes, although RP-19 promises no library file is embedded. The current build.rs prefix filter does exclude them all; this is a test-correspondence gap, not a demonstrated current leak. Bind the complete excluded-file inventory to the built variant with a bounded efficient check, and show a non-largest-file inclusion is caught. Reuse the same reduced build and existing lock/constant comparisons rather than adding another build or broad producer wave.

The inspected default identity calculation, independent full-tree constant check, cross-variant lock comparisons, typed LLC0205 guards before production publication and explicit variant label are retained. Owner measurements and planted-defect transcripts remain scoped evidence, not independently rerun here. Native-host qualification does not cover WASM. #468 custody and #316 frozen tools remain separate, with no replacement or new prerequisite. After the focused correction, the final head still needs the complete gate and reviewed actual integration; no readiness, rerun or merge is initiated by this review.

@afflom afflom mentioned this pull request Nov 12, 2026
@humuhumu33
humuhumu33 marked this pull request as ready for review November 12, 2026 22:20

afflom commented Nov 13, 2026

Copy link
Copy Markdown
Member

Full ready-event CI43318953291 is now terminal success at unchanged425f15e321337c1bb50f331e61a132235c067cb5: all70 dynamically materialized jobs passed, including same-run honesty. Exact-head reproducibility43298076741 also passed. This supersedes the body's draft/untested-host status; the retained successful run needs no replay for diagnosis.

The remaining source acceptance item is review5881757244's RP19 correspondence gap: checking only the largest library file cannot detect accidental inclusion of a different file. Please make the focused complete-inventory check and non-largest inclusion witness reuse the same reduced build, reconcile §8.4/R4 wording, and update the acceptance narrative. Full/default release proof requirements remain intact. Qualification applies to this exact head; necessary changed-head acceptance and actual merged-tree equality still apply. Existing implementation owner retains the repair; no competing patch, gate rerun or merge was initiated.

humuhumu33 and others added 2 commits November 13, 2026 11:00
…erge moved (#495)

Review of 425f15e (P2): RP-19's image assertion read the largest library
file alone, so a build that left that one out and embedded another would
have passed a case that states no library file is embedded. It now binds
every file of the inventory: each is witnessed by bytes of its own --- the
whole file when it is short, else a window from its middle --- and the
image is read once for all of them, a table of first bytes naming the
candidates at each position, so the cost is the image's length and not its
length times the inventory's size. The one file whose witness the retained
data carries anyway is named with its reason, and the reason is checked.
The scan is shown to find what is there: the preservation data outside
`library/`, which this build embeds, is found in the same image. The same
reduced build and the same lock and constant comparisons carry it; no
second build and no generator.

R4 (SPEC.md §27.2, AGENTS.md) read that no feature switch disables a
normative capability, which §8.4 now excepts; both rows say `unsanctioned`,
the word RP-08's registered statement already uses, and name §8.4, which
names R4 in turn. No registered statement changed.

The merge moved the language-1.2 compiler-semantics ID to
06639c99a4cb1dbcb7fc9c0c87544ee05c599079d85272d8af66c8045900680b, which
RP-10 reports when the constant is stale, and the register to 495 rows.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@humuhumu33

Copy link
Copy Markdown
Contributor Author

Corrected at 84ca191cbf79cbdd6b4ed371622e50bcc1520533, which merges release/v0.4 (the conflict was CHANGELOG.md alone) and then makes the focused repair. The body's acceptance narrative is updated, including the terminal success of CI 43318953291 at 425f15e and that this head needs its own complete gate.

P2, the RP-19 correspondence gap. The image assertion now binds the complete excluded inventory instead of its largest file. Every one of the 31 files of language/preservation-1.2/library/ is witnessed by bytes of its own — the whole file when it is short, else a 64-byte window from its middle — and the image is read once for all of them: a 256-entry table of first bytes names the candidates at each position and only a candidate is compared, so the cost is the image's length and not its length times the inventory's size. It reuses the same reduced build and the same lock and constant comparisons; no second build, no generator.

Two things the case now states rather than assumes:

  • One file, library/lean-toolchain (25 bytes), is the toolchain string the retained data embeds anyway, so no image can tell it from that data. It is named with its reason instead of passing in silence, and the reason is checked: its own bytes must occur in the retained data. The other 30 are bound by absence.
  • The scan is shown to find what is there. The preservation data outside library/ — library.toml and the four calculus modules — is found in the same image by the same method, so an absence above is an absence and not a broken search.

The non-largest witness. Planted in build.rs: the exclusion keeps out every library file except src/Values.lex.tex (70,609 bytes), while the largest, src/RustLemmas.lex.tex (17,189,578 bytes), stays out — so the previous largest-only assertion would have passed.

test conformance_rp_19 ... FAILED
RP-19: the build without production-data embeds ["language/preservation-1.2/library/src/Values.lex.tex"] of `language/preservation-1.2/library/`
test result: FAILED. 0 passed; 1 failed

Read directly, that planted binary holds the witness of src/Values.lex.tex and not the witness of src/RustLemmas.lex.tex. With the plant removed, conformance_rp_19 passes. The record is in VERIFICATION.md.

§8.4 and R4. Reconciled: R4 in SPEC §27.2 and AGENTS.md now reads unsanctioned feature switch, the word RP-08's registered statement already uses, and names §8.4; §8.4 names R4 in turn. No registered statement changed, so the register, the §31 table and the scenarios are untouched by this.

The constant. Still a checked constant under the existing RP-10 diagnostic, no generator. The merge moved the language-1.2 ID to 06639c99a4cb1dbcb7fc9c0c87544ee05c599079d85272d8af66c8045900680b (a new rust-runtime-1.2 module), and the constant moved with it — the maintenance this design costs, once, visibly. The one-digit plant still fails both bindings:

RP-10: lexlean::LANGUAGE_1_2_SEMANTICS_ID is stale; the tree's language-1.2 ID is 06639c99…680b
RP-19: language-1.2: lexlean.lock bytes

Scope. Full and default release binaries and every existing proof and qualification obligation are unchanged; the reduced binary substitutes for no qualified producer. #468 custody and #316 frozen tools are untouched. Native-host qualification does not cover WASM. The owner measurements in the body stay scoped to 425f15e, which the merge changes by one rust-runtime-1.2 module while leaving the excluded inventory unchanged.

Locally on this head: cargo fmt --check, validate-model (495 IDs, 87 codes), validate-spec-links, clippy with -D warnings across lexlean, repo-conformance and xtask and for lexlean --no-default-features, conformance_rp_06, rp_07, rp_08, rp_10, rp_11, rp_19, cl_18, and the bdd meta target. The complete gate on this head is running; I am not merging, and claim no readiness beyond what that run decides.

@afflom afflom left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The two earlier source findings are structurally resolved at84ca191. RP19 now checks witnesses for every preservation-library inventory row, with all retained preservation siblings as positive controls. The executable is read once and searched through first-byte buckets. For indistinguishable retained content, the code additionally requires the entire library file in retained data; a shared64-byte snippet alone cannot waive a larger file. The lean-toolchain duplicate-content limitation is explicit rather than a filename exemption.

SPEC§8.4, R4 and AGENTS now consistently describe the single sanctioned check-only exception. RP10 retains independent full-tree constant validation and RP19 retains default/reduced lock-byte comparison. Default production proof qualification and refusal boundaries are preserved; this variant does not replace qualified #316/#468 tools.

The documented nonlargest Values.lex.tex plant is an appropriate falsifier for the former largest-only gap. Its runtime result remains attributed owner evidence; I did not repeat the plant or local tests. No new concrete defect was demonstrated in this focused review. Current full CI43414162623 is still active and exact repro43414162622 passed. Old425f qualification is not current-head acceptance; full final-head/integration acceptance remains owed before landing or #495 closure. No additional build, writer or arbitrary check is requested.

afflom commented Nov 13, 2026

Copy link
Copy Markdown
Member

Current acceptance preparation is complete without repeating source review or execution. Full43414162623 has69/70 successful jobs with the aarch64-apple job active; exact repro passed. The run metadata and cached syntheticcba7fafd still bind baseb8b6/head84ca (treec72f). Actual release/v0.4 is15d66a after #516, whose entire delta fromb8b6 is the six-line regenerate.yml core-handler repair. The cached synthetic is not evidence of that current composition.

Please preserve the existing run as exact-tree evidence and reconcile that narrow actual-base delta before final resulting-tree qualification/landing. This workflow-only integration does not justify another identity writer, product wave, measurement or plant. No rerun or competing patch was initiated here. Root will require the actual merged tree to match the qualified result.

The full #495 body has also been mapped: the accepted native design uses the checked1.2 constant where data is excluded and preserves the existing1.1 computation where its selected data remains present. That is the accepted narrow refinement from5881757244, not a request for another constant/generator. Record this disposition with delivery; WASM #494 is separate. #495 remains open until merged full-scope acceptance.

@humuhumu33
humuhumu33 merged commit b4ac72e into release/v0.4 Nov 13, 2026
71 checks passed
@humuhumu33
humuhumu33 deleted the feat/check-only-build branch November 13, 2026 13:15

@afflom afflom left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Postlanding acceptance is now complete for actual merge b4ac72e on release/v0.4. Its own full push gate 43432076539 passed all70 dynamically materialized jobs and772 steps, including same-run honesty, Atlas join, supported-host construction and all normative partitions. Exact actual-head repro43432076411 passed.

Actual tree d2bdcf2031c11362cd761c5ae0ec84d33da56ac3 is the tree qualified by those runs; ordered parents remain15d66a764ea902686c6275543b21d28b3d03130f +84ca191cbf79cbdd6b4ed371622e50bcc1520533. This establishes actual-tree acceptance now. It does not retroactively claim a final premerge review, nor equality to the older PR gate's c72f tree. The external landing timing and six-line #516 integration difference remain accurately recorded.

Retained focused source review5890857618 and the independent full-body audit establish scoped native #495 delivery: default-on production data, reduced-image inventory correspondence, independently checked1.2 constant, default/reduced lock comparisons and typed refusal before production publication. Preserving1.1's existing computation is the accepted refinement where its selected data remains present. WASM #494 and qualified #316/#468 producer custody remain separate. No producer, plant, test, log or gate was repeated for this acceptance.

afflom pushed a commit that referenced this pull request Nov 13, 2026
…generate on it [regenerate]

#474 moved the language-1.2 identity and took PF-24, so the products of
c56c53e no longer apply. The merged tree is release/v0.4's with PF-26's
sources only, PF-26 placed after PF-24 in the register, §31, the scenario
and the test wiring; the README range is PF-01..PF-26 and the register is
497 IDs. The Laws export is reused: Portable and Collections are unchanged
on the line. Every written output comes from release/v0.4 and is
regenerated on this tree under the gated workflow.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013Asa3MWG2BeFisFkR1Kebg
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.

2 participants