#43: hold-rule gate + deferred entry decision — adopt wasmtime's actual model - #45
Merged
Conversation
lann
enabled auto-merge (squash)
August 10, 2026 16:26
lann
added a commit
that referenced
this pull request
Aug 10, 2026
…xam kit into #43 (#46) sync-streams.wast:145 pins a scheduler policy (wasmtime's deferred entry decision), not semantics: an upstream test defect, not a reference bug. Both sketched amendments are withdrawn; definitions.py, CanonicalABI.md, and test_callback_interleaving need no change. The bounded §1 exception shrinks back to CM-3; the CM-4 lesson becomes its guard (corpus assertions must be schedule-independent to count as semantics). Runtime unchanged: hold gate = conformance, drain-to-quiescence = non-normative policy (#45). exams/wasmtime-exclusivity/ is removed — distilled onto issue #43, archived at 4f3351f:exams/wasmtime-exclusivity/.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implements #43 (follow-up to the #44 correction). deltic's release-at-resolution rule is removed; the runtime now matches wasmtime's verified model:
Gate lifetime (hold rule) — pristine reference shapes restored at all three former divergence sites:
blockCurrentActivationno longer releases a resolved holder's slot (definitions.py block_internal :378 leaves it alone);exitImplicitThreadback to assert-held + release (:506-508);runCallbackLoopback to the unconditional release/retake with theexclusiveThread === nullwait guards (:2187-2203) — which is also the DeliverEvent-parity site (wasmtime concurrent.rs:765).Deferred entry decision — new
Store.hasRunnableWork(inst, excludeTask)(scheduler.ts) +createAsyncStartCallintegration (fact_calls.ts): while the callee is parked at the entry gate, the caller's existing jspi determinacy park waits for the callee instance's runnable work to drain to quiescence, then reads the status. Order-robust formulation per spec-amendment.md (drain-to-quiescence, not wasmtime's FIFO pop-one) — keeps the suite green under DELTIC_SCHED_SEED shuffles. Caller excluded from the scan (nested lowers report STARTING immediately); JSPI-parked activations are counted via their SuspensionPoint, not double-counted via awaiting. Plain mode untouched and provably drain-free (no mid-invocation parks without JSPI); suspendability classification unchanged (async-start-call was already Suspending-wrapped); backpressure admission order unchanged (callee registers in num_waiting_to_enter synchronously before any drain) so the deterministic-profile pins hold.New test
runtime/tests/entry_deferral_test.ts— pins the pump/poke shape under the wasmtime model (resolved holder parked-unready gates entry, STARTING after quiescent drain, no interleaving during the parked span, admission only after exit) and the caller-exclusion edge.Docs — intrinsics.md §Status, architecture.md §1, CM-4 finding status: migration landed; IROH-1 → RESOLVED-BY-HOST.
Gates (coder-hard run + orchestrator re-verification): build/test-rust PASS; test-runtime 327/0 PASS (rerun); conformance 1349 executed, 0 failed, no stale xfails, sync-streams green (rerun); sched-seeds PASS both seeds (rerun); ct-runner 17/0, wasi-shims 41/0; iroh-exam scenarios 1/2/4/5 PASS including the IROH-1 legs — scenario 3 fails identically on pristine main (pre-existing environmental WebRTC backend issue on this host, unrelated).
Implemented by coder-hard under orchestrator review (scheduler-core single-owner protocol); revision analysis and drain design reviewed hunk-by-hunk.