Repository navigation
D30: spec/internals/compile_errors under the lane; facade domains, comptime and declared runtime pins - #2481
Merged
Merged
Conversation
added 3 commits
October 19, 2026 22:41
Compiled in-unit, the runtime's libc facade declares errno, environ and locale; a program facade naming `locale` without declaring it was told it exists (err_c_facade_unknown_domain passed vacuously under the lane), where the object-linked runtime it never sees left it unknown. The runtime's own facades still see every domain, and one declared in both stays one domain (ruling §35).
… no body As linked from an object, with_println_str is an extern: D104's declaration check names `print -> with_println_str (an extern)` and evaluation stops there. In-unit, the check's walk found the runtime's (mostly unchecked) body free of forbidden callees and passed `print` as comptime-callable, and evaluation walked into str_data's raw read. Both now treat it as the extern it is to compile time (Sema.fn_is_in_unit_runtime_abi_def); the evaluator still answers the runtime calls it implements (with_sysinfo_os/arch). Also: an `@[effect]` pin on a runtime ABI definition is its declared contract (applied as an extern's is), not a checked one. A pointer parameter's inferred effects are read-only by design, so what the runtime retains through a raw pointer can only be declared; with_thread_spawn's fn_ptr/ctx pin (std.thread's extern carries it today) moves onto the definition once a seed with this rule is pinned, because bootstrap-rt-core-object compiles rt/ with the seed (err_thread_spawn_closure_captures_ref stays red under the lane until then).
…e lane; the seed-gated spawn pin
ehartford
added a commit
that referenced
this pull request
Oct 20, 2026
…ntime libc blocks are not program facades (#2482) * D30: an in-unit runtime definition takes the declared contract of the extern it replaces std.thread declares `@[effect(fn_ptr: escape_value, ctx: escape_value)] extern fn with_thread_spawn`: the thread keeps the closure. Under WITH_RT_IN_UNIT the runtime's definition won and the extern was dropped with its pins, and the definition's own inference cannot see retention through a raw pointer (a pointer parameter's inferred effects are read-only by design), so a closure holding a view of its frame was spawned unrefused (err_thread_spawn_closure_captures_ref, red under the lane). The frontend keeps a dropped pinned extern for its runtime definition (Zcu.note_runtime_contract_extern, in the prelude tier where std's externs drop and in the program tiers); Sema applies its pins to the definition's signature as an extern's, and they survive that body's inference. One fact in one place: no seed-compiled source changes, so #2481's seed-gated rule for pins on runtime definitions is removed unused. * D30: the runtime's libc blocks are not the program's facades Two places treated the in-unit runtime's `c facade libc` blocks as the program's: inject_toolchain_facades counted them as claims, so the toolchain libc facade's text lost `domain environ` while its getenv row still named it, and every program using getenv failed under WITH_RT_IN_UNIT (61 lane files, after #2481's domain rule made the omission visible); and the domain rule judged a facade block by current_module_path, which names whatever module was checked last when facade items are collected. Claims skip `<embedded-rt>/` facades, and a block is the runtime's by its own declaration's path. * D30 plan: the spawn contract without a seed; lane state after the full re-sweep --------- Co-authored-by: Eric Hartford <[email protected]>
ehartford
added a commit
that referenced
this pull request
Oct 20, 2026
…on a runtime ABI definition it is the declared contract (#2488) * D30 step 2: a declared @[effect] pin is interface material; on a runtime ABI definition it is the declared contract The runtime bundle (D30 R3) compiles the runtime alone, so a contract no type spells — what with_thread_spawn retains through fn_ptr and ctx — must be on the definition for the interface to carry it (plan §10, correction 3). Three pieces, none needing a seed: - Sema: an `@[effect]` pin on a runtime ABI definition in a runtime module is its declared contract, applied as the extern's is in the object world (#2481's rule, back); on any other bodied function the pin stays the §16.3d checked contract. - The interface: the emitter prints a declaration's pins as the parser reads them (`@[effect(ctx: escape_value)]`) on fns and externs instead of refusing them, the fingerprint row carries the pinned bits in place of the type's declared effect, and the interface twin applies a pin as an extern's (apply_interface_declared_effects). - The harness: wi_demo gains a pinned extern and a pinned fn; the .wi regenerates byte for byte, the twin's fingerprint agrees, a dropped pin is a fifth mutation that changes it, and a consumer handing the pinned extern a closure holding a view of its frame (spawn_os's shape) is refused from the interface alone. Moving the pins from the std externs onto the runtime definitions needs a seed carrying this rule (the seed compiles rt/ for stage1): the next PR, with seed.lock. * wo_bundles.md: a declared @[effect] pin is declaration, not inference; the interface prints it and the fingerprint carries it (D30 step 2) --------- Co-authored-by: Eric Hartford <[email protected]>
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.
D30: the remaining corpora under the lane, and three places the in-unit runtime showed through to programs where the object-linked one never did.
libcfacade madelocaleknown.@[effect]pin is a declared contract, not a checked one. This is the seed-gated first half:with_thread_spawn's retention pin moves onto the definition once a seed carrying this rule is pinned, becausebootstrap-rt-core-objectcompilesrt/with the seed.Measured under the lane: test/spec 210/210, test/internals 72/72,
with check src/main.wclean. test/compile_errors' three real failures are fixed here, except the spawn cell, which waits for the seed. Recorded in plan section 9.Battery GREEN on 92ff935 (
with run tools/battery.w, rc=0, 280 s).