Stack captures cannot escape spawn
Platform spec ADR
Stack captures cannot escape spawn
Spec standingStandard
- No directly attached article pages for this node.
0 revisions (git unavailable at build; counts may be empty)
No commits recorded for this path.
| Section id | Required | Found |
|---|---|---|
what-this-feature-specifies | yes | yes |
implementation-anchors | yes | yes |
Full tree: run pnpm verify:platform-spec-layout (writes src/generated/platform-spec-layout-report.json).
Context
Section titled “Context”Moving stack references into another fiber breaks the memory model and GC rooting assumptions.
Decision
Section titled “Decision”Closure captures that would leak stack references across fibers must be rejected with diagnostic StackReferenceEscapesSpawn (compile error).
Consequences
Section titled “Consequences”Authors pass data through Channel<T> or other approved sharing; runtime does not repair invalid captures.
Verification anchors
Section titled “Verification anchors”compiler/crates/beskid_analysis/ capture analysis; Memory and references.