Repository navigation
Description
Summary
Fiber-stack pooling works on current Darwin runtime probes, but the gate suite
does not pin reuse or the configured retention cap. Add deterministic,
platform-guarded internals coverage for §14.19.
Current state (revalidated 2026-07-15)
Darwin and Windows runtime cores expose:
- with_fiber_pool_allocs()
- with_fiber_pool_reuses()
- with_fiber_pool_free_count()
- with_fiber_pool_size_limit()
A current probe running two short tasks sequentially observed allocation counts
of 0 → 1 → 1 and reuse counts of 0 → 0 → 1: the second task reused the first
task's completed stack.
The requested regression still does not exist under test/. The hooks exist
only in the Darwin and Windows cores, so a portable behavior fixture that
declares them unconditionally would break unsupported hosts. This belongs in a
platform-guarded internals test.
#403 has landed: fiber_pool_size and the free-count/limit hooks now make
the retention-cap case actionable. The old “after #403” deferral is obsolete.
There is also a dangling codegen-corpus entry for
bootstrap/test/cases/fiber_pool_reuse.w even though that file and bootstrap
tree no longer exist.
Work
- Add a Darwin/Windows-guarded internals case that awaits two sequential
tasks and asserts either a reuse increment or a flat allocation count on the
second task. - Add a project/runtime configuration case with a small fiber_pool_size and
prove completed stacks beyond the cap are released rather than retained. - Use runtime counters only; do not depend on timing, addresses, or scheduler
ordering. - Replace the dangling codegen-corpus entry with the real test artifact.
Acceptance criteria
- The test fails if completed stacks never return to the pool.
- The test fails if a later fiber never reuses an available pooled stack.
- The configured cap is tested through free-count and size-limit hooks.
- Unsupported platforms skip through an explicit harness guard, not a missing
symbol at link time. - Full build, fixpoint, and test gates pass.
Traceability
- Specification §14.19, Fiber Stack Management
- docs/requirements.md 14.19.1.39 and 14.19.1.41
Activity
ehartford commentedon Jul 3, 2026
Coverage sweep: fiber stack-pool REUSE is verified working on HEAD (allocs stay flat, reuses increment across successive awaits, via with_fiber_pool_allocs/reuses in rt/fiber_core_darwin.w). But those introspection hooks exist ONLY on darwin+windows (no linux fiber_core), so a fixture calling them as externs would break a non-Darwin gate. Pinning this needs a platform-guarded internals test, not a portable behavior fixture — flagged as a harness deliverable. §14.
ehartford commentedon Oct 25, 2026
Triage 2026-10-25,
with v0.15.3.0(main a261b65): still open. Nothing undertest/exercises the fiber pool counters; the only mention is the dangling corpus entry the issue names:post-release: runtime test coverage, no user-visible defect.
A test that pins fiber stack reuse by the pool's counters: the first …
ehartford commentedon Nov 18, 2026
Landed in #3420.
behav_501_fiber_stack_pool_reuse.wpins reuse by the pool's counters (first task: one stack allocated and left pooled; second: none allocated, one reused). The retention cap is pinned by the existing selfhost casebs_check_runtime_manifest_config(fiber_pool_size = 1). The hooks exist on every native core (the non-Windows targets share one), so no platform guard was needed.test/codegen_corpus.txt, the home of the dangling entry, named only files that no longer exist and nothing read it; it is deleted.