Skip to content

runtime: close out Wasmtime concurrency coverage gaps - #378

Merged
lannbot merged 2 commits into
mainfrom
fix/wasmtime-concurrency-closeout
Sep 14, 2026
Merged

lannbot merged 2 commits into
mainfrom
fix/wasmtime-concurrency-closeout

Conversation

@lannbot

@lannbot lannbot commented Sep 14, 2026

Copy link
Copy Markdown
Collaborator

Summary

Complete the disposition of the remaining supplementary Wasmtime concurrency subset: fix executable runtime gaps, recognize narrowly proved diagnostic equivalents, and document compatible/native-only residuals.

Runtime

  • Transport component-boundary traps with a native Wasm trap carrier so guest catch_all cannot intercept them. Exact carrier identities retain the original cause and physical/logical origin across nested and JSPI boundaries; no global pending-cause slot. Core exceptions caught within a component remain ordinary exceptions.
  • Enforce unresolved synchronous-lift progress using callee-instance work, independent of unrelated host retention. Distinguish actual CM blocking from host-import latency and mandatory cancellation/start-call continuation.
  • Offer pending host admission at safe canonical boundaries, preventing starvation behind perpetual callback YIELD work.
  • Implement explicit thread creation, index, suspend, resume-later, resume/suspend/yield/promote operations using the existing Task/Thread scheduler. Preserve operand validation before cancellation, target-first transfer, logical task identity, original exceptional causes, and post-result thread lifetime.

Explicit limitation

thread.new-indirect validates ordinary canonical-final (i32|i64) -> () start types before execution. Valid structurally equivalent non-final/derived types may still be rejected. This is not spec-compatible full thread support: the current JS interface exposes nominal type tests rather than structural function-signature reflection. Complete support requires translator metadata/table instrumentation beyond this interface; the restriction and executable boundary tests remain tracked under #12.

Harness

  • Add exact task-return diagnostic equivalents; retain the eleven future-write OR-message differences as explained compatible per-row divergences, not a global equivalence.
  • Provide wasmtime/gc only to the destructor-context fixture as a real host boundary, matching its purpose with eager logical frames rather than pretending to force JS GC.
  • Preserve native table-capacity test-control exclusion; add a 1,000-cycle cancellation/drop regression checking bounded slot reuse instead of a fake provider knob.
  • Explain the massive-send exclusion as Wasmtime-specific transfer-fuel policy over an exponentially expanded value. No claim of equivalent aggregate allocation protection.
  • End dedicated shell workers only after complete, synchronously written output. Validate header/done/file identities against the independent manifest; wire protocol regressions into just shells.
  • Enumerate the observed Bun fn() unreachable diagnostic exactly, without broadening matching.

Final Wasmtime concurrency disposition

Starting async inventory:42 failures +4 skipped setups. Final:13 classified failures,0 skips:
-11 future-write diagnostic differences: spec-compatible rejection of non-IDLE operations.
-1 unavailable native table-capacity setup +1 dependent no-instance assertion; purpose covered separately by bounded-reuse regression.
-The excluded async massive-send file remains a documented native resource-policy test.

All executed async exception and explicit-thread cases now pass. Residual file/line keys remain in harness/src/wasmtime-expectations.ts; reasoning is in harness/README.md and contracts/intrinsics.md.

Verification

  • Independent exception, thread/sync scheduling, and final harness reviews: LGTM. Real-Wasm regressions cover nested/same-store/cross-store trap delivery, suppressed carrier recovery, switches, cancellation under sibling exclusivity, post-result children, and start-type rejection without execution.
  • Full just gates < /dev/null: PASS, /tmp/opencode/concurrency-closeout-final-gates.log.
  • Runtime1072passed/2existingignored; seeded1069passed/5existingignored. New shell protocol gate6passed, then wired into the recipe and rerun directly.
  • Official corpus:1511commands,1506executed,1468passed,38xfail,0runtime/capability skips,5unsupported directives; seeded1465passed with existing three-command deterministic-profile omission.
  • Supplementary Wasmtime:607passed,69known failures,0skips,174excluded commands,0unexpected. Public guests pass FIFO/seed1.
  • Required shell/browser/OPFS, packaging and available consumer smokes pass. JSC arm64 unavailability and declared not-applicable/translation-only smoke cases remain. Actual consumer git statuses unchanged before/after full verification.

No convention goldens, manifests, protocol marks, or plan format version changed. Automerge will be armed and watched through delivery. Related tracking: #12, #372.

@lannbot
lannbot enabled auto-merge September 14, 2026 15:40
@lannbot
lannbot merged commit 654d0e4 into main Sep 14, 2026
4 checks passed
@lannbot
lannbot deleted the fix/wasmtime-concurrency-closeout branch September 14, 2026 15:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants