Skip to content

D30 step 2 (part 1): a declared @[effect] pin is interface material; on a runtime ABI definition it is the declared contract - #2488

Merged
ehartford merged 2 commits into
mainfrom
d30-step2-contracts
Oct 20, 2026
Merged

ehartford merged 2 commits into
mainfrom
d30-step2-contracts

Conversation

@ehartford

Copy link
Copy Markdown
Contributor

D30 R3 step 2, the part that needs no seed (plan §10, correction 3: a bundle compiles the runtime alone, so a contract must be on the definition for the interface to carry it).

  • 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 (D30: spec/internals/compile_errors under the lane; facade domains, comptime and declared runtime pins #2481's rule, back); elsewhere a pin stays the §16.3d checked contract.
  • 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; the twin applies a pin as an extern's.
  • 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.
  • Docs: wo_bundles.md.

Part 2 (next PR, with seed.lock): cut a seed carrying the rule, move the pins from lib/std externs onto the rt/ definitions, delete #2482's extern-inheritance, and extend rt_decl_audit to compare pins.

Evidence (seed-driven, ~/.local/with-staging/d30-step2, same tree as 08ff63eab): :gate green, :bundle-interface-tests green, lane sweeps on the release WITH_RT_IN_UNIT=1 1702/1702, 1790/1790, 283/283, with run tools/battery.w GREEN (243 s). The docs commit is outside the green key (D49).

Eric Hartford added 2 commits October 20, 2026 08:21
…ime 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.
…; the interface prints it and the fingerprint carries it (D30 step 2)
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.

1 participant