ReviewOS

home-lang/home

Complete async-context coverage for stream WebSocket and worker TODOs

#856
Open chris opened this 8 days ago ·
8 days ago

Current main update (2026-10-09): Worker/WebSocket creation-context delivery and verified native evidence are landed. Native bindings 23/23; complete Debug build 29/29 (5,657 MB peak under 8,192 MB); generator/ABI tests 8/8 with 350 assertions. All 19 original entries validate: 199 registered passes, zero failures/skips, one original TODO and one successful standalone worker-message process check. The unchanged worker-message fixture now passes directly, while its tracking-suite TODO remains explicitly counted. Native context controls pass in parent and worker VMs with forced GC, different registration context, errors and restoration. All 133 audited test/fixture/ABI inputs stay unchanged; all 162 tracked artifacts have verified hashes, and all 19 restored reports validate.

The original WebSocket TODO now observes close:value but lacks open: its using server is disposed before it awaits the exchange. A server kept alive through the exchange passes context checks. The original fixture stays unchanged and its TODO assertion is not a passing result. Direct-stream probes show cancellation never calling its underlying cancel callback and a pending unflushed read not settling after reader cancellation. Core builtin ownership, pinned source alignment and those semantics are tracked in #858, linked to #66. Full hook support, remaining ownership/dependencies, release builds (#855) and platforms remain incomplete.


The original Bun async-context selection still has three TODOs that prevent complete logical parity under #66. The Home-owned events/async-hooks/timers batch preserves the pinned fixtures and records 202 registered passes, zero failures/skips, and three TODOs. Those TODOs do not receive passing credit.

Supplementary native execution on Darwin arm64 (pinned Bun 4982b91) establishes:

  • AsyncLocalStorage.test.ts --todo: direct-stream cancellation times out at the original 90,000 ms case deadline.
  • Its WebSocket client case observes only close:undefined instead of open:value, close:value. An isolated --todo --test-name-pattern 'WebSocket client' run reproduces the assertion. The native TODO runner retains TODO classification and exits zero; that is not a passing contract. Investigate connection/event delivery as well as context capture.
  • Running the unchanged async-context-worker_threads-message.js directly exits one with FAIL: worker message event lost context. Message and exit callbacks must preserve the Worker resource's creation context.

Complete the runtime behavior and test the original contracts without fixture rewrites, weakened assertions, longer case deadlines, synthetic result credit or process delegation. Retain failure diagnostics and successful native evidence, and keep #66 linked. The default unchanged suite's TODO classification should remain explicit when reporting counts.

The pinned createHook implementation also remains limited to TickObject init events, with other resource hooks and execution/trigger IDs unimplemented; the current ownership batch does not resolve full hook support. Remaining external bindings/dependencies and release-build memory issue #855 remain separate open work.

Source: https://github.com/home-lang/home/commit/7782d97f76918c442441323bea694c911c44a9d9 Evidence: https://github.com/home-lang/home/blob/main/docs/docs/bun-port-evidence/2026-10-09-owned-events-async-timers/manifest.json

8 days ago

Reader cancellation follow-up: #858 now has the landed core stream generation and direct/default/BYOB cancellation verification. Source: https://github.com/home-lang/home/commit/9a44c58c7 . Evidence: https://github.com/home-lang/home/blob/f1e2d94c9/docs/docs/bun-port-evidence/2026-10-09-owned-core-streams/manifest.json .

Home regenerates 280 stream builtin bodies and fixes the pending direct read, source cancel invocation/context/errors, lazy/reentrant/concurrent cancellation and releaseLock behavior. Native controls terminate with their verified final marker. The original 18-entry selection validates 9,540 passes, zero failures, 269 original skips and three TODOs; those pending cases receive no passing credit.

The original direct-stream async-context TODO still waits for an unflushed write before reaching cancellation, and the WebSocket TODO still disposes its server prematurely. These original fixture outcomes remain explicit, with renderer/ASAN/platform and broader ownership coverage unfinished. #66/#858 stay open.

Sign in to comment on this issue.