Introduce a checked-program boundary across the compiler - #70
Open
izaak wants to merge 2 commits into
Open
Conversation
Record lexical bindings, solved types, and source locations in owned checked bodies. Specialization produces explicit concrete function/global instances consumed by safety, hoisting, copy elision, Cranelift, LLVM, register VM, and Stack lowering. Replace repeated name lookup, shadowing bookkeeping, and separate capture walkers with recorded identities and shared capture discovery. Retain templates across entry-point changes and specialization retries, validate publication boundaries, and keep partial editor facts separate from executable programs. Check concrete requirements in every retained function body before code motion. Preserve existing syntax and overload/coercion policies. Share borrowed-call classification and add ownership, lifecycle, safety, editor recovery, DSP state, and cancellation regressions. Document the contract in docs/CHECKED_PROGRAM.md. Validated on macOS ARM64 with LLVM 18: default and LLVM workspace builds/tests, backend golden suites, AOT integration tests, and a library check without default features all passed.
The Ubuntu LLVM job builds without the Clang-only C Stack interpreter. Three unguarded references to stack_interp_bridge prevented its library tests from compiling. Gate the C Stack portions of the hoisting and VM codegen regressions with has_stack_interp while keeping register VM coverage active on every build. Validation: reproduced all three original errors with has_stack_interp disabled locally; all 439 LLVM library tests now pass in that configuration. All 13 affected hoisting and VM codegen tests also pass with the C Stack interpreter enabled. git diff --check passes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Compiler passes previously reconstructed binding and callee identity from source names and signatures, maintained shadowing bookkeeping, and repeated capture discovery. This change records bindings, solved types, and source locations in CheckedProgram bodies, then supplies explicit concrete function/global instances after specialization. Recorded identities and shared capture discovery replace those duplicated lookup and bookkeeping paths.
Existing syntax and overload/coercion policies remain intact. The safety changes reject previously missed violations of existing requirements.
Validated on macOS ARM64 with LLVM 18: default and LLVM workspace builds/tests, backend golden suites, AOT integration tests, and a library check without default features all passed.
Regression coverage includes binding and capture identity, specialization safety and lifecycle, editor recovery, DSP buffer rebinding and persistent state, and cancellation with successful reentry.