From c64ed9f8fc3de3f6d9bd427e4938c3906e577f7e Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Thu, 23 Jul 2026 21:18:06 -0700 Subject: [PATCH] Update component-model spec test suite * Update some required features for tests * Flag `memory64.wast` as now-passing * Temporarily allow `post-return.wast` to fail while #13949 and WebAssembly/component-model#680 are being aligned. * Fix a debug assert tripping erroneously in an async `subtask.cancel` intrinsic. --- crates/test-util/src/wast.rs | 28 ++++++++----------- .../src/runtime/component/concurrent.rs | 13 ++++++--- tests/component-model | 2 +- 3 files changed, 21 insertions(+), 22 deletions(-) diff --git a/crates/test-util/src/wast.rs b/crates/test-util/src/wast.rs index ae1e531bbf75..08fcc6411322 100644 --- a/crates/test-util/src/wast.rs +++ b/crates/test-util/src/wast.rs @@ -193,22 +193,17 @@ fn component_test_config(test: &Path) -> TestConfig { ret.reference_types = Some(true); ret.multi_memory = Some(true); ret.component_model_implements = Some(true); + ret.bulk_memory = Some(true); + ret.component_model_async = Some(true); + ret.component_model_more_async_builtins = Some(true); + ret.component_model_async_stackful = Some(true); + ret.component_model_threading = Some(true); + + if test.ends_with("memory64.wast") { + ret.component_model_memory64 = Some(true); + } if let Some(parent) = test.parent() { - if parent.ends_with("async") - || [ - "trap-in-post-return.wast", - "resources.wast", - "multiple-resources.wast", - ] - .into_iter() - .any(|name| Some(name) == test.file_name().and_then(|s| s.to_str())) - { - ret.component_model_async = Some(true); - ret.component_model_async_stackful = Some(true); - ret.component_model_more_async_builtins = Some(true); - ret.component_model_threading = Some(true); - } if parent.ends_with("wasm-tools") { ret.memory64 = Some(true); ret.threads = Some(true); @@ -472,9 +467,8 @@ impl WastTest { } let unsupported = [ - // Can be re-enabled once the tests/component-model submodule has been bumped to a commit that includes - // https://github.com/WebAssembly/component-model/pull/676 - "test/wasm-tools/memory64.wast", + // needs to be updated after WebAssembly/component-model#680 + "test/values/post-return.wast", ]; if unsupported.iter().any(|part| self.path.ends_with(part)) { return true; diff --git a/crates/wasmtime/src/runtime/component/concurrent.rs b/crates/wasmtime/src/runtime/component/concurrent.rs index 0b2e6bcab9ba..079ce49e6e20 100644 --- a/crates/wasmtime/src/runtime/component/concurrent.rs +++ b/crates/wasmtime/src/runtime/component/concurrent.rs @@ -4063,9 +4063,13 @@ impl Instance { store.suspend(SuspendReason::Yielding { thread: caller, cancellable: false, - // `subtask.cancel` is not allowed to be called in a - // sync context, so we cannot skip the may-block check. - skip_may_block_check: false, + // We've already checked that for a sync version of + // this intrinsic we're allowed to block (start of + // the function here), and otherwise this is similar + // to `suspension_intrinsic` where we're doing a + // brief yield to deliver the event, so there's no + // need to check may-block again. + skip_may_block_check: true, })?; break; } else if let GuestThreadState::Ready { @@ -4079,7 +4083,8 @@ impl Instance { store.suspend(SuspendReason::Yielding { thread: caller, cancellable: false, - skip_may_block_check: false, + // See the comment above for why this is `true` + skip_may_block_check: true, })?; break; } diff --git a/tests/component-model b/tests/component-model index 87d36cef87c1..e8d800509946 160000 --- a/tests/component-model +++ b/tests/component-model @@ -1 +1 @@ -Subproject commit 87d36cef87c1a38338a3a42ccbf423a5ed3e935d +Subproject commit e8d80050994662d150c84e3d52981a9d471a152d