Repository navigation
Description
⛔ Blocked on #675 — minicoro lands as a MigrationSpec manifest entry, not a hand-rolled build module. Blocks #369 — the Windows async stack-overflow fix rides on minicoro's Windows backend; do not attempt #369's fix against the current Darwin-only backend.
Goal
Execute docs/feature_plans/async-proposal.md: migrate minicoro (~1800 lines of public-domain C, battle-tested in Nelua) with with migrate, and replace the platform-specific fiber backend (rt/fiber_core_darwin.w + fiber_asm_darwin.s, aarch64-only) with a minicoro-backed one behind a permanent backend interface (rt/fiber_backend.w: fiber_create/resume/yield/destroy/running).
The scheduler, scope tracking, cancellation, channels, completion sequencing, and all async language semantics stay owned by With — minicoro provides only the context-switch substrate (proposal §2.2/§2.3 tables are the contract for what changes vs what must not).
Why
Current backend: Darwin/aarch64 only, hand-written asm, fixed mmap stacks, 1024-fiber cap, no sanitizer support. minicoro: x86_64/ARM/ARM64/RISC-V + ucontext + Windows fiber backends, WASM paths, vmem growable stacks, Valgrind/ASan/TSan compatibility. This is the cross-platform unlock for the async runtime — and the prerequisite for #369.
Sequencing (from the proposal)
- Prerequisites first (proposal §3): fix the five known async-review bugs so migration regressions are distinguishable from pre-existing issues.
- Introduce
rt/fiber_backend.wwhile the CURRENT backend still works — verify the interface against known-good behavior (proposal §"introduce the abstraction first"). - Migrate minicoro via the Build: manifest-driven C-library migrations — one generic pipeline engine, per-library specs as data #675 manifest pipeline; wire as the second backend.
- Cut over per-platform; keep the interface as permanent insurance (WASM/debug/sanitizer backends).
Policy (same as #673/#674)
with migrateoutput compiles as-is; migrator fixes are generic, with regression fixtures; no hand-patches; no silent fallbacks; engine module-private. minicoro's per-arch assembly falls under the repo's inline/platform-asm exception — the C core migrates, the.sbackends land beside the existingruntime/fiber_asm_*convention.- Runtime invariants preserved and re-verified: FIBER layout constants, completion-sequence semantics (std.task collection combinators: completion ordering, fallible await_all, and coverage #489), generational handle behavior incl. stale⇒done (Task.is_done() returns false after .await (await appears to invalidate the handle) #637), cancellation lexical-unwind behavior, live-fiber baselines — the full §14.11 fixture family plus /drop-audit before/after, since this touches fiber lifecycle under drop scheduling.
Deliverables
- Proposal §3 prerequisite bugs fixed (tracked individually)
-
rt/fiber_backend.winterface extracted over the current backend, gates green before minicoro enters - minicoro manifest entry (Build: manifest-driven C-library migrations — one generic pipeline engine, per-library specs as data #675 pipeline): pinned release + SHA256, compile-as-is, conformance smoke
- minicoro-backed backend passing the entire async fixture family on Darwin
- Windows backend path validated (unblocks Windows async stack overflow handler does not produce controlled runtime diagnostic #369)
- Old backend removal as a separate final commit once parity is proven
References
docs/feature_plans/async-proposal.md (canonical plan), §14 (async semantics that must not change), #675 (build pipeline), #369 (blocked Windows fix), #489/#637 runtime invariants.
Activity
Docs: record #637 fix, #676 minicoro deferral, #650 escalation in han…
[-]Migrate minicoro: cross-platform fiber backend behind a permanent backend interface (docs/feature_plans/async-proposal.md)[/-][+]Fiber backend: converge onto minicoro semantics — hand-port with port map, behind the permanent backend interface[/+]ehartford commentedon Aug 31, 2026
Re-scoped 2026-08-31 after the strategic review with Eric; docs/feature_plans/async-proposal.md is rewritten to match and is the canonical plan.
The rationale is trust, stated properly: the fiber substrate is too critical to home-grow, and minicoro's value is that its failure modes are documented — including four open upstream defects (issues #11, #27, #31; PRs #29, #30 unmerged) and four README caveats a language runtime must convert from disclaimers into guarantees (thread-safety, TLS-across-threads, overflow-UB, unwind-on-cancel).
Mechanism changed: hand-port/convergence, not
with migrate. The trust-critical parts (switch sequences, TEB machine-code bytes, inline asm) can't go through the migrator anyway, and at ~2K lines a comprehension port transfers more trust than mechanical translation. The existing multi-platform backend (correct register sets, guard pages with per-fiber overflow attribution, stack pooling) is converged function-by-function onto minicoro semantics rather than replaced.Key findings folded in:
__chkstk, SEH, OS callbacks see the wrong stack). Immediate slice: transcribe it now, ahead of the campaign.Deliverables: docs/fiber-minicoro-port.md (function map + named deviations with fixtures), transcribed switch sequences with offset provenance, minicoro's testsuite ported, the C original as an external differential oracle, dual-backend test matrix (--fiber-backend=current|ported), then flip + one A/B release + cleanup.
Prerequisite audit already done: the old §3.1 scope-track UAF and §3.5 await_first bugs are verified fixed in today's tree; §3.2–3.4 need verification and the §3.6 panic/defer matrix is still owed (it doubles as the dual-backend acceptance suite).
docs: rewrite async-proposal as the minicoro convergence port (#676)
ehartford commentedon Oct 25, 2026
Triage 2026-10-25,
with v0.15.3.0(main a261b65): still open, and no longer blocked on #675 (the corpus registry exists). No minicoro corpus or backend exists inbuild/orlib/std;async-proposal.mdis the canonical plan per the 2026-08-31 re-scope.post-release: replacing the fiber substrate is a campaign.