Fiber stack initial size and cap
Platform spec ADR
Fiber stack initial size and cap
Spec standingStandard
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”Fiber stacks must balance memory use against deep call chains from generated code and corelib. GC needs precise stack maps at safepoints on every fiber stack.
Decision
Section titled “Decision”| Parameter | Value |
|---|---|
| Initial size | 64 KiB per fiber |
| Growth | Growable until cap |
| Maximum | 8 MiB cap per fiber |
| Overflow | FiberError::StackOverflow at Join — no undefined behavior |
| Switching | Callee stacks ABI-aligned; callee-saved registers saved per platform ABI |
| GC | All fiber stacks enumerable at safepoints via compiler stack maps |
Consequences
Section titled “Consequences”Documentation and corelib must cite these limits. Stack switching may use manual swap techniques documented in design model.
Verification anchors
Section titled “Verification anchors”Scheduler stack allocator; fiber spawn/join integration tests.