From 20e56a987d6d36fd34456f03902b678e47b18571 Mon Sep 17 00:00:00 2001 From: Andy Leiserson Date: Tue, 4 Aug 2026 15:17:44 -0700 Subject: [PATCH] test: Adjust some KosmicKrisp expectations Tested with Vulkan SDK 1.4.350.0 --- .../features/src/big_compute_buffers/tests.rs | 4 ++ tests/src/expectations.rs | 9 ++++ tests/tests/wgpu-gpu/bind_groups.rs | 9 +--- tests/tests/wgpu-gpu/binding_array/buffers.rs | 38 ++++++++-------- .../tests/wgpu-gpu/subgroup_operations/mod.rs | 45 ++++++++----------- 5 files changed, 51 insertions(+), 54 deletions(-) diff --git a/examples/features/src/big_compute_buffers/tests.rs b/examples/features/src/big_compute_buffers/tests.rs index b15e9884e..34baf7397 100644 --- a/examples/features/src/big_compute_buffers/tests.rs +++ b/examples/features/src/big_compute_buffers/tests.rs @@ -24,6 +24,10 @@ pub static TWO_BUFFERS: GpuTestConfiguration = GpuTestConfiguration::new() .validation_error("could not be compiled into pipeline") // https://github.com/gfx-rs/wgpu/issues/9849 .panic("assertion failed: produced"), + ) + .expect_fail( + // https://github.com/gfx-rs/wgpu/issues/9849 + wgpu_test::FailureCase::kosmic_krisp().panic("assertion failed: produced"), ), ) .run_async(|ctx| { diff --git a/tests/src/expectations.rs b/tests/src/expectations.rs index 9210d1c4f..29f405292 100644 --- a/tests/src/expectations.rs +++ b/tests/src/expectations.rs @@ -171,6 +171,15 @@ impl FailureCase { vec![f(FailureCase::molten_vk()), f(FailureCase::kosmic_krisp())] } + /// Tests running on macOS (both Vulkan and Metal). + pub fn mac(f: impl Fn(FailureCase) -> FailureCase) -> Vec { + vec![ + f(FailureCase::molten_vk()), + f(FailureCase::kosmic_krisp()), + f(FailureCase::backend(wgpu::Backends::METAL)), + ] + } + pub fn lvp_poison_memory(message: &'static str) -> Self { if let Ok("true") = std::env::var("LVP_POISON_MEMORY").as_deref() { FailureCase { diff --git a/tests/tests/wgpu-gpu/bind_groups.rs b/tests/tests/wgpu-gpu/bind_groups.rs index 0c82d4fc4..cf70b24ba 100644 --- a/tests/tests/wgpu-gpu/bind_groups.rs +++ b/tests/tests/wgpu-gpu/bind_groups.rs @@ -2,8 +2,7 @@ use std::num::NonZeroU64; use wgpu::{util::DeviceExt, BufferUsages, PollType}; use wgpu_test::{ - apply, gpu_test, FailureCase, GpuTestConfiguration, GpuTestInitializer, TestParameters, - TestingContext, + apply, gpu_test, GpuTestConfiguration, GpuTestInitializer, TestParameters, TestingContext, }; pub fn all_tests(vec: &mut Vec) { @@ -256,11 +255,7 @@ static BIND_GROUP_NONFILTERING_LAYOUT_MIPMAP_SAMPLER: GpuTestConfiguration = #[apply(gpu_test!)] static BIND_GROUP_WITH_MAX_BINDING_INDEX: GpuTestConfiguration = GpuTestConfiguration::new() - .parameters( - TestParameters::default() - .limits(wgpu::Limits::downlevel_defaults()) - .expect_fail(FailureCase::kosmic_krisp()), // https://github.com/gfx-rs/wgpu/issues/9187 - ) + .parameters(TestParameters::default().limits(wgpu::Limits::downlevel_defaults())) .run_async(|ctx| async move { let (device, queue) = ctx .adapter diff --git a/tests/tests/wgpu-gpu/binding_array/buffers.rs b/tests/tests/wgpu-gpu/binding_array/buffers.rs index 9495fc419..767589cb8 100644 --- a/tests/tests/wgpu-gpu/binding_array/buffers.rs +++ b/tests/tests/wgpu-gpu/binding_array/buffers.rs @@ -68,16 +68,15 @@ static BINDING_ARRAY_STORAGE_BUFFERS: GpuTestConfiguration = GpuTestConfiguratio max_binding_array_elements_per_shader_stage: 17, ..Limits::default() }, - // Metal: https://github.com/gfx-rs/wgpu/issues/9849 - // MoltenVK: #9849 and also https://github.com/gfx-rs/wgpu/issues/6745 - // With #6745 only, the expected failure was `case.panic("bad SPIR-V wrapper struct inference")` - failures: FailureCase::mac_vulkan(|case| { - case.validation_error("Shader library compile failed") - .validation_error("could not be compiled into pipeline") - }) - .into_iter() - .chain([FailureCase::backend(Backends::METAL)]) - .collect(), + failures: vec![ + // https://github.com/gfx-rs/wgpu/issues/9849 and https://github.com/gfx-rs/wgpu/issues/6745 + // Before #9849, the expected failure with #6745 only was `case.panic("bad SPIR-V wrapper struct inference")` + FailureCase::molten_vk() + .validation_error("Shader library compile failed") + .validation_error("could not be compiled into pipeline"), + // https://github.com/gfx-rs/wgpu/issues/9849 + FailureCase::backend(Backends::METAL), + ], ..Default::default() }) .run_async(|ctx| async move { binding_array_buffers(ctx, BufferType::Storage, false).await }); @@ -94,16 +93,15 @@ static PARTIAL_BINDING_ARRAY_STORAGE_BUFFERS: GpuTestConfiguration = GpuTestConf max_binding_array_elements_per_shader_stage: 33, ..Limits::default() }, - // Metal: https://github.com/gfx-rs/wgpu/issues/9849 - // MoltenVK: #9849 and also https://github.com/gfx-rs/wgpu/issues/6745 - // With #6745 only, the expected failure was `case.panic("bad SPIR-V wrapper struct inference")` - failures: FailureCase::mac_vulkan(|case| { - case.validation_error("Shader library compile failed") - .validation_error("could not be compiled into pipeline") - }) - .into_iter() - .chain([FailureCase::backend(Backends::METAL)]) - .collect(), + failures: vec![ + // https://github.com/gfx-rs/wgpu/issues/9849 and https://github.com/gfx-rs/wgpu/issues/6745 + // Before #9849, the expected failure with #6745 only was `case.panic("bad SPIR-V wrapper struct inference")` + FailureCase::molten_vk() + .validation_error("Shader library compile failed") + .validation_error("could not be compiled into pipeline"), + // https://github.com/gfx-rs/wgpu/issues/9849 + FailureCase::backend(Backends::METAL), + ], ..Default::default() }) .run_async(|ctx| async move { binding_array_buffers(ctx, BufferType::Storage, true).await }); diff --git a/tests/tests/wgpu-gpu/subgroup_operations/mod.rs b/tests/tests/wgpu-gpu/subgroup_operations/mod.rs index 8a9e64fc3..69ab7e5a1 100644 --- a/tests/tests/wgpu-gpu/subgroup_operations/mod.rs +++ b/tests/tests/wgpu-gpu/subgroup_operations/mod.rs @@ -11,33 +11,24 @@ const TEST_COUNT: u32 = 37; #[apply(gpu_test!)] static SUBGROUP_OPERATIONS: GpuTestConfiguration = GpuTestConfiguration::new() - .parameters( - TestParameters::default() - .features(wgpu::Features::SUBGROUP) - .limits(wgpu::Limits::downlevel_defaults()) - // Expect metal to fail on tests involving operations in divergent control flow - // - // Newlines are included in the panic message to ensure that _additional_ failures - // are not matched against. - .expect_fail( - wgpu_test::FailureCase::molten_vk() - // 26.0 fails only test 28, and not on thread 0 - .panic("thread 1 failed tests: 28,\n") - // 14.3 fails 27 and 28 - .panic("thread 0 failed tests: 27,\nthread 1 failed tests: 27, 28,\n") - // Prior versions fail 27, 28, and 29 - .panic("thread 0 failed tests: 27, 29,\nthread 1 failed tests: 27, 28, 29,\n"), - ) - .expect_fail( - wgpu_test::FailureCase::backend(wgpu::Backends::METAL) - // 26.0 fails only test 28, and not on thread 0 - .panic("thread 1 failed tests: 28,\n") - // 14.3 fails 27 and 28 - .panic("thread 0 failed tests: 27,\nthread 1 failed tests: 27, 28,\n") - // Prior versions fail 27, 28, and 29 - .panic("thread 0 failed tests: 27, 29,\nthread 1 failed tests: 27, 28, 29,\n"), - ), - ) + .parameters(TestParameters { + required_features: wgpu::Features::SUBGROUP, + required_limits: wgpu::Limits::downlevel_defaults(), + // Expect metal to fail on tests involving operations in divergent control flow + // + // Newlines are included in the panic message to ensure that _additional_ failures + // are not matched against. + failures: wgpu_test::FailureCase::mac(|case| { + case + // 26.0 fails only test 28, and not on thread 0 + .panic("thread 1 failed tests: 28,\n") + // 14.3 fails 27 and 28 + .panic("thread 0 failed tests: 27,\nthread 1 failed tests: 27, 28,\n") + // Prior versions fail 27, 28, and 29 + .panic("thread 0 failed tests: 27, 29,\nthread 1 failed tests: 27, 28, 29,\n") + }), + ..Default::default() + }) .run_sync(|ctx| { let device = &ctx.device;