Skip to content

#43: hold-rule gate + deferred entry decision — adopt wasmtime's actual model - #45

Merged
lann merged 1 commit into
mainfrom
cm4-runtime-migration
Aug 10, 2026
Merged

#43: hold-rule gate + deferred entry decision — adopt wasmtime's actual model#45
lann merged 1 commit into
mainfrom
cm4-runtime-migration

Conversation

@lann

@lann lann commented Aug 10, 2026

Copy link
Copy Markdown
Collaborator

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: blockCurrentActivation no longer releases a resolved holder's slot (definitions.py block_internal :378 leaves it alone); exitImplicitThread back to assert-held + release (:506-508); runCallbackLoop back to the unconditional release/retake with the exclusiveThread === null wait guards (:2187-2203) — which is also the DeliverEvent-parity site (wasmtime concurrent.rs:765).

Deferred entry decision — new Store.hasRunnableWork(inst, excludeTask) (scheduler.ts) + createAsyncStartCall integration (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.

@lann
lann enabled auto-merge (squash) August 10, 2026 16:26
@lann
lann merged commit 4f3351f into main Aug 10, 2026
4 checks passed
@lann
lann deleted the cm4-runtime-migration branch August 10, 2026 16:36
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/.
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.

1 participant