Skip to content

BS-52: the conservative checker of LSE expressions as source (#269) - #502

Draft
humuhumu33 wants to merge 7 commits into
release/v0.4from
claude/issue-269-lse-types
Draft

humuhumu33 wants to merge 7 commits into
release/v0.4from
claude/issue-269-lse-types

Conversation

@humuhumu33

@humuhumu33 humuhumu33 commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

Third slice of the lexicon closure of #269. bootstrap/src/LseTypes.lex.tex holds checkSignature and checkValue to lse::check_signature and check_value: the zonked type and every literal's type, or the first error, with the oracle's metavariable numbering and capture-avoiding renames. The lookup closure is handed over as rows plus a fallback (Missing for a closure, Opaque for a package as it loads). Each recursive definition is structural over a chain built from a nesting bound the host passes (192), so both roots admit recursion.

Rust-backend limitation found (no Rust changed here). A definition that calls itself as its last step is rendered as a loop whose exit wraps a tail call to another fallible definition in Err(..) without propagating its overflow, which the validator refuses with LLB6005. The module works around it: inferBinding, inferRest and unifyPiLoop bind their own recursive call and rebuild the record. A fix belongs in calculus/rust/lower.rs.

Case (conformance_bs_52, run on WSL over 26e5e0ace). 39 named vectors over a hand-built glossary, the signatures and defined values of the 43 committed packages that load (224 signature and 236 value runs, each checked against its own package and against the builtins), and seeded expressions. The evaluator agrees on 899 runs and rustc on 3,499; all 20 planted defects are detected.

Regenerated. 8911e442f2 applies regenerate.yml run 43335583294 (base 8fa301f907): the export with LseTypes' two packages and their stack bounds, the oracles, the verify records, and the counts (manifests 330 -> 332). Two commits before it: max_child_output_bytes = 268435456 (the maintainer's decision), and the axioms Lean observes on 21 definitions (LLV7005 in run 43316854893) with pair flags read through definitions. Ready for the parent's batch landing; it stays a draft.

🤖 Generated with Claude Code

LseTypes holds checkSignature and checkValue to lse::check_signature and
check_value: the zonked type and the type of every natural literal, or the
first error, with the oracle's metavariable numbering and capture-avoiding
renames. The lookup closure is handed over as rows and a fallback (Missing
for a closure, Opaque for a package as it loads). Each recursive definition
is structural over a chain built from a bound on nesting the host passes, so
both roots admit recursion. 20 planted defects are each detected by their
own vector.

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 source/ownership readback across #500a216a163, #501f63c2de1 and this head086e9c52: no new semantic blocker was demonstrated in the inspected root/effect/harness boundaries. The draft bodies correctly retain their missing generated-product and final-qualification obligations; reported WSL runs are scoped owner evidence, not full release acceptance. Shared manifests, root inventories, register totals and the identical BS25 helper-visibility change need one coordinated batch composition with exact product bindings. Existing active producers remain untouched.

Avoid a duplicate compiler repair for the disclosed tail-call limitation: this failure class is already tracked by #279 and its v0.5 fix #300/RB21. This PR targets v0.4, so the disclosure alone does not establish a v0.5 regression. Cross-reference that history when documenting the workaround. In the inspected inferBinding/inferRest/unifyPiLoop source, the recursive call still decreases fuel and the record reconstruction preserves result/error fields; declared recursion remains. Its actual evaluator/rustc/certificate correspondence still belongs to the existing gate. No new bugfix prerequisite or reproduction was introduced here.

Keep #269 open for its remaining scope. Source review is bounded, not final source/product clearance; no build, probe, identity wave, gate action or competing implementation was performed.

@afflom afflom mentioned this pull request Nov 12, 2026
humuhumu33 and others added 3 commits November 12, 2026 22:06
…iner's decision)

The Lean extraction of the production export with BS-52 writes more than the
33,554,432 bytes max_child_output_bytes allowed (LLS8002 in the regeneration
run 43308029226); Ilya chose 268435456, as for BS-65 and RB-24. A semantic
input, so the lock moves.

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

Regeneration run 43316854893 stopped on LLV7005: 21 definitions that reach the
standard library's numerals observe Quot.sound and propext; they now declare
them. Conditions on a component of a pair go through flagOf and typedCk, the
shape BS-50's certificate needed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Applied from regenerate.yml run 43335583294 (base 8fa301f): the bootstrap
export with the two packages of LseTypes, the build oracles, the verify records,
and the counts of BS-05 to BS-08 and BS-11 to BS-15 the count writer moved
(manifests 330 -> 332).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
humuhumu33 and others added 2 commits November 13, 2026 05:42
Generated files take release's side for the regeneration to rewrite; release
carries max_child_output_bytes = 268435456, so this slice's own sentence and
entry for it give way to RB-24's. The register is 495 IDs; the lock follows the
new language-1.2 compiler-semantics ID.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The merge of release/v0.4 kept this slice's earlier regenerated records,
exports and counts where release had moved under RB-24's compiler-semantics
ID. They are release's again, and the slice is registered on top (register
495 IDs), so the regeneration writes everything from one tree.

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

This branch has not been deployed

No deployments
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