fibers B1.2: UNBLOCKED — remove invalid issue 0151, correct the async idiom

The B1.2 "blockers" were not real:
- Issue 0151 was INVALID: its repro used the non-idiomatic `($A) -> $R`
  bare-fn-ptr form. The canonical higher-order pack idiom
  `Closure(..$args) -> $R` + `..$args` (see examples/0543-packs-canonical-map)
  infers $R fine and runs today with no compiler change. Removed 0151.
- The correct async idiom is verified working live (42 42 for homo + hetero
  args): async :: (io, worker: Closure(..$args) -> $R, ..$args) -> Future($R)
  with a lambda worker (annotated params) + a `result = ---; result.v = ...`
  build form. No compiler change needed.

Issue 0150 (void struct field -> SIGTRAP exit 133) IS a real bug but is only
reached via Future(void) (void-returning worker / timeout) — deferred to B1.4;
B1.2 supports non-void workers.

Updates the PLAN/CHECKPOINT B1.2 status to UNBLOCKED with the corrected idiom
and the resume plan. No compiler/library code changed in this commit.
This commit is contained in:
agra
2026-06-20 20:00:36 +03:00
parent f0a918f3c8
commit 7bf65565bd
3 changed files with 48 additions and 131 deletions

View File

@@ -1,12 +1,17 @@
# PLAN-FIBERS — Stream B1 (fibers + Io + M:1 scheduler)
> **STATUS: 🚧 in progress.** B1.0 (`abi(.naked)` codegen) ✅ + B1.1 (per-fiber `context`
> root — zero compiler change, library convention) ✅ complete. **B1.2** (`Io` interface +
> `context.io` + `Future` + `cancel()`) is **🔴 BLOCKED on compiler issues 0150 (`void`
> struct field SIGTRAP) + 0151 (type-var from a fn-ptr-return not bound in body)** — the Io
> design is proven (the protocol-on-`Context` + blocking default + `context.io.now_ms()` work
> live), but `Future(void)`/`timeout` and the `async`/`await` generics hit those two bugs.
> Resume B1.2 after both land (WIP saved at `.sx-tmp/b12-wip/`); see `CHECKPOINT-FIBERS.md`.
> **STATUS: 🚧 in progress.** B1.0 (`abi(.naked)`) ✅ + B1.1 (per-fiber `context`) ✅. **B1.2**
> (`Io` interface) is **UNBLOCKED** — the earlier "blockers" were artifacts of non-idiomatic
> syntax + a worker's dirty binary. Issue **0151 was INVALID** (the `($A)->$R` bare-fn-ptr
> form is not idiomatic sx) and is **removed**. The correct `async` idiom **works today, no
> compiler change**: `async :: (io, worker: Closure(..$args) -> $R, ..$args) -> Future($R)`
> with a **lambda worker** + the `result : Future($R) = ---; result.v = worker(..args);` build
> form (mirrors the canonical `examples/0543-packs-canonical-map.sx`). Caveats: lambda params
> must be annotated; passing a bare *named* fn as the worker is non-idiomatic (use a lambda).
> Issue **0150** (`void` struct field SIGTRAP, exit 133) is a **real** bug but only hit by
> `Future(void)`/`timeout` — **deferred** (avoid void Futures in B1.2; revisit in B1.4). Resume
> B1.2 with the corrected idiom (the WIP at `.sx-tmp/b12-wip/` has the Io-protocol/Context/
> materializer parts that WORK; rewrite the async layer to the pack-lambda form above).
Carved from [PLAN-POST-METATYPE.md](PLAN-POST-METATYPE.md) Stream B (§B1) + the
design-of-record [../design/execution-evolution-roadmap.md](../design/execution-evolution-roadmap.md)