From 885d805a13782fd9dd85419af28d275c2865341a Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Tue, 30 Jun 2026 20:16:42 -0700 Subject: [PATCH 1/2] Synchronize `Binary.md` threading intrinsics In #656 the threading-related intrinsics were revised and updated, but `Binary.md` wasn't updated in the same PR. This commit removes the removed intrinsics (`thread.switch-to` and `thread.yield-to`), reorganizes the list slightly (moves `thread.yield` down), and then renumbers the remaining intrinsics. --- design/mvp/Binary.md | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/design/mvp/Binary.md b/design/mvp/Binary.md index 5b3f0f26..d8e0a88b 100644 --- a/design/mvp/Binary.md +++ b/design/mvp/Binary.md @@ -302,7 +302,6 @@ canon ::= 0x00 0x00 f: opts: ft: => (canon lift | 0x05 => (canon task.cancel (core func)) ๐Ÿ”€ | 0x0a v: i: => (canon context.get v i (core func)) ๐Ÿ”€ | 0x0b v: i: => (canon context.set v i (core func)) ๐Ÿ”€ - | 0x0c cancel?: => (canon thread.yield cancel? (core func)) ๐Ÿ”€ | 0x06 async?: => (canon subtask.cancel async? (core func)) ๐Ÿ”€ | 0x0d => (canon subtask.drop (core func)) ๐Ÿ”€ | 0x0e t: => (canon stream.new t (core func)) ๐Ÿ”€ @@ -329,10 +328,13 @@ canon ::= 0x00 0x00 f: opts: ft: => (canon lift | 0x23 => (canon waitable.join (core func)) ๐Ÿ”€ | 0x26 => (canon thread.index (core func)) ๐Ÿงต | 0x27 ft: tbl: => (canon thread.new-indirect ft tbl (core func)) ๐Ÿงต - | 0x28 cancel?: => (canon thread.switch-to cancel? (core func)) ๐Ÿงต + | 0x28 => (canon thread.resume-later (core func)) ๐Ÿงต | 0x29 cancel?: => (canon thread.suspend cancel? (core func)) ๐Ÿงต - | 0x2a => (canon thread.resume-later (core func)) ๐Ÿงต - | 0x2b cancel?: => (canon thread.yield-to cancel? (core func)) ๐Ÿงต + | 0x0c cancel?: => (canon thread.yield cancel? (core func)) ๐Ÿ”€ + | 0x2a cancel?: => (canon thread.suspend-then-resume cancel? (core func)) ๐Ÿงต + | 0x2b cancel?: => (canon thread.yield-then-resume cancel? (core func)) ๐Ÿงต + | 0x2c cancel?: => (canon thread.suspend-then-promote cancel? (core func)) ๐Ÿงต + | 0x2d cancel?: => (canon thread.yield-then-promote cancel? (core func)) ๐Ÿงต | 0x40 shared?: ft: => (canon thread.spawn-ref shared? ft (core func)) ๐Ÿงตโ‘ก | 0x41 shared?: ft: tbl: => (canon thread.spawn-indirect shared? ft tbl (core func)) ๐Ÿงตโ‘ก | 0x42 shared?: => (canon thread.available-parallelism shared? (core func)) ๐Ÿงตโ‘ก From 9d86663aaec9073fbf1c7268b6345a5beea31019 Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Tue, 30 Jun 2026 20:21:05 -0700 Subject: [PATCH 2/2] Flag `thread.yield` under the async feature gate This matches what wasm-tools/Wasmtime do at least which is `thread.yield` is supported with just the component-model-async feature and doesn't need component-model-threading. IIRC this is due to the fact of this intrinsic existing prior to component-model-threading and it was just renamed later on. --- design/mvp/CanonicalABI.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/design/mvp/CanonicalABI.md b/design/mvp/CanonicalABI.md index e9132ab3..31a20d2a 100644 --- a/design/mvp/CanonicalABI.md +++ b/design/mvp/CanonicalABI.md @@ -63,7 +63,7 @@ specified here. * [`canon thread.new-indirect`](#-canon-threadnew-indirect) ๐Ÿงต * [`canon thread.resume-later`](#-canon-threadresume-later) ๐Ÿงต * [`canon thread.suspend`](#-canon-threadsuspend) ๐Ÿงต - * [`canon thread.yield`](#-canon-threadyield) ๐Ÿงต + * [`canon thread.yield`](#-canon-threadyield) ๐Ÿ”€ * [`canon thread.suspend-then-resume`](#-canon-threadsuspend-then-resume) ๐Ÿงต * [`canon thread.yield-then-resume`](#-canon-threadyield-then-resume) ๐Ÿงต * [`canon thread.suspend-then-promote`](#-canon-threadsuspend-then-promote) ๐Ÿงต @@ -4948,7 +4948,7 @@ cancellation, they can omit `cancellable` so that cancellation is instead delivered at a later `cancellable` call. -### ๐Ÿงต `canon thread.yield` +### ๐Ÿ”€ `canon thread.yield` For a canonical definition: ```wat