Skip to content

#43: CM-4 filing kit — schedule-agnostic sync-streams patch + ready-to-file issue draft - #111

Merged
lann merged 1 commit into
mainfrom
cm4-filing-kit-43
Aug 11, 2026
Merged

#43: CM-4 filing kit — schedule-agnostic sync-streams patch + ready-to-file issue draft#111
lann merged 1 commit into
mainfrom
cm4-filing-kit-43

Conversation

@lann

@lann lann commented Aug 11, 2026

Copy link
Copy Markdown
Collaborator

What

The remaining deliverable of #43 (the runtime migration landed in #45; the adjudication re-scoped the issue to the filing kit): ready-to-file upstream artifacts for the CM-4 test-defect finding.

  • upstream-issue-sync-streams-schedule-overfit.md — issue draft against WebAssembly/component-model, following the upstream-issue-stale-async-drop.md convention. Body distills the final adjudication (issue CM-4: sync-streams.wast:145 overfits wasmtime's scheduler — upstream test-defect filing kit #43, 2026-08-10): gate semantics are agreed by definitions.py, wasmtime, and the CanonicalABI.md prose; what sync-streams.wast:145 hard-asserts is the entry-decision timing, a non-normative scheduler policy on which the reference (eager-inline → STARTING) and wasmtime (deferred → STARTED) conformingly disagree.
  • upstream-sync-streams-schedule-agnostic.patch — the proposed test fix, git apply --check-verified against spec HEAD 73b7ad5: accept STARTING|STARTED from the lower; on STARTING, wait for the subtask's admission (STARTED) before touching the stream; every other assertion unchanged. The STARTED arm is byte-identical to today's assertions, so the current runner (wasmtime) loses no coverage.
  • Tracker CM-4 entry updated to kit-READY; filing remains operator-gated via File the upstream findings (IROH-1; component-model tracker) #15.

Every definitions.py/CanonicalABI.md/wast line citation in the draft was re-verified against the 73b7ad5 submodule pin.

Closes #43.

Verification

Pipeline: scratch test-dir → testgen --test-dir X --out-dir Y asyncrunWastJson with RuntimeExecutor (real shim), no xfail filtering.

leg arm exercised FIFO seed 1 seed 4242
pristine sync-streams.wast (control) STARTED 2/2
patched sync-streams.wast STARTED (else-arm) 2/2 2/2 2/2
STARTING-variant (below) STARTING (hard-asserted) 2/2 2/2 2/2

The STARTING arm is dead code under deltic's drain-to-quiescence policy in the patched scenario (deltic answers STARTED, like wasmtime). To execute the new arm on a live engine rather than argue it by inspection, the variant leg reorders $D.run so $C.set is called before the stream-1 read: $C.get's mid-frame park is then unready, no amount of draining can admit the callee, and the call reports STARTING (the semantics pinned by runtime/tests/entry_deferral_test.ts). The variant hard-asserts STARTING at the call, performs the stream-1 read/drop to make the holder ready, then runs the patched STARTING arm verbatim (wait for SUBTASK/STARTED with payload asserts) and the unchanged tail. Its 2/2 pass under FIFO + both seeds means the proposed arm's waits and asserts executed and held.

Reproduction recipe
# worktree at this PR's commit; shim + testgen built:
cargo build -p translator-shim --target wasm32-unknown-unknown --release
cargo build -p testgen

mkdir -p /tmp/cm4/{pristine,patched}/test/async
cp third_party/component-model/test/async/sync-streams.wast /tmp/cm4/pristine/test/async/
cp third_party/component-model/test/async/sync-streams.wast /tmp/cm4/patched/test/async/
(cd /tmp/cm4/patched && git apply $OLDPWD/upstream-sync-streams-schedule-agnostic.patch)

for t in pristine patched; do
  cargo run -q -p testgen -- --test-dir /tmp/cm4/$t/test --out-dir /tmp/cm4/$t/generated async
done
# run each generated async/sync-streams.json through harness/src/runner.ts
# runWastJson + RuntimeExecutor.create(shim), asserting zero failures; rerun
# with DELTIC_SCHED_SEED=1 and =4242. (Scratch driver: ~25 lines importing
# @deltic-workspace harness modules; must run from inside the workspace so
# the @deltic/* workspace specifiers resolve.)

Variant construction: apply the kit patch, then in $D.run (1) add (local $rx2 i32), (2) move the stream-1 read/assert/drop block to after the $C.set call + waitable-set.new/join, calling $set with $rx2 from the stream.new pair, (3) replace the two-arm if with a hard (if (i32.ne (i32.const 0 (; STARTING ;)) ...) (then unreachable)) followed by the STARTING arm's wait/asserts inline, (4) leave the tail unchanged. Header comment in the variant marks it deltic-verification-only (not for upstream).

Filing boundary

Nothing is filed upstream by this PR; the draft + patch are artifacts for the operator (#15). The wasmtime-dev leg (wasmtime wast -W component-model-async=y -W component-model-more-async-builtins=y test/async/sync-streams.wast) is documented in the filing notes as an optional pre-filing courtesy — by construction the patch only adds an arm wasmtime never takes.

@lann
lann enabled auto-merge (squash) August 11, 2026 17:13
@lann
lann disabled auto-merge August 11, 2026 17:14
@lann
lann enabled auto-merge August 11, 2026 17:14
@lann
lann merged commit b705e3b into main Aug 11, 2026
4 checks passed
@lannbot
lannbot deleted the cm4-filing-kit-43 branch August 23, 2026 16:51
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.

CM-4: sync-streams.wast:145 overfits wasmtime's scheduler — upstream test-defect filing kit

1 participant