From 372f23df12960e261807a8f90e77a0bfb94337ae Mon Sep 17 00:00:00 2001 From: Andy Leiserson Date: Wed, 15 Jul 2026 07:19:44 -0700 Subject: [PATCH] test: Annotate expected failures on Metal and MoltenVK (#9850) --- benches/benches/wgpu-benchmark/computepass.rs | 4 +++- .../features/src/big_compute_buffers/tests.rs | 6 +++-- tests/tests/wgpu-gpu/binding_array/buffers.rs | 24 +++++++++++++++---- .../binding_array/sampled_textures.rs | 8 ++++++- tests/tests/wgpu-gpu/naga_capabilities.rs | 11 ++++++--- 5 files changed, 42 insertions(+), 11 deletions(-) diff --git a/benches/benches/wgpu-benchmark/computepass.rs b/benches/benches/wgpu-benchmark/computepass.rs index dbd00675c..2e83a70ab 100644 --- a/benches/benches/wgpu-benchmark/computepass.rs +++ b/benches/benches/wgpu-benchmark/computepass.rs @@ -77,7 +77,9 @@ impl ComputepassState { | wgpu::Features::SAMPLED_TEXTURE_AND_STORAGE_BUFFER_ARRAY_NON_UNIFORM_INDEXING, ) // TODO: as of writing llvmpipe segfaults the bindless benchmark on ci - && device_state.adapter_info.driver != "llvmpipe"; + && device_state.adapter_info.driver != "llvmpipe" + // TODO(https://github.com/gfx-rs/wgpu/issues/9849): Currently broken on Metal + && device_state.adapter_info.backend != wgpu::Backend::Metal; // Performance gets considerably worse if the resources are shuffled. // diff --git a/examples/features/src/big_compute_buffers/tests.rs b/examples/features/src/big_compute_buffers/tests.rs index f5eb90912..1b3a398f2 100644 --- a/examples/features/src/big_compute_buffers/tests.rs +++ b/examples/features/src/big_compute_buffers/tests.rs @@ -17,11 +17,13 @@ pub static TWO_BUFFERS: GpuTestConfiguration = GpuTestConfiguration::new() max_binding_array_elements_per_shader_stage: 8, ..Default::default() }) - // https://github.com/gfx-rs/wgpu/issues/9184 .expect_fail( wgpu_test::FailureCase::molten_vk() + // https://github.com/gfx-rs/wgpu/issues/9184 .validation_error("Shader library compile failed") - .validation_error("could not be compiled into pipeline"), + .validation_error("could not be compiled into pipeline") + // https://github.com/gfx-rs/wgpu/issues/9849 + .panic("assertion failed: produced"), ), ) .run_async(|ctx| { diff --git a/tests/tests/wgpu-gpu/binding_array/buffers.rs b/tests/tests/wgpu-gpu/binding_array/buffers.rs index 456b0a82a..e74e7d901 100644 --- a/tests/tests/wgpu-gpu/binding_array/buffers.rs +++ b/tests/tests/wgpu-gpu/binding_array/buffers.rs @@ -67,8 +67,16 @@ static BINDING_ARRAY_STORAGE_BUFFERS: GpuTestConfiguration = GpuTestConfiguratio max_binding_array_elements_per_shader_stage: 17, ..Limits::default() }, - // See https://github.com/gfx-rs/wgpu/issues/6745. - failures: FailureCase::mac_vulkan(|case| case.panic("bad SPIR-V wrapper struct inference")), + // 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(), ..Default::default() }) .run_async(|ctx| async move { binding_array_buffers(ctx, BufferType::Storage, false).await }); @@ -85,8 +93,16 @@ static PARTIAL_BINDING_ARRAY_STORAGE_BUFFERS: GpuTestConfiguration = GpuTestConf max_binding_array_elements_per_shader_stage: 33, ..Limits::default() }, - // See https://github.com/gfx-rs/wgpu/issues/6745. - failures: FailureCase::mac_vulkan(|case| case.panic("bad SPIR-V wrapper struct inference")), + // 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(), ..Default::default() }) .run_async(|ctx| async move { binding_array_buffers(ctx, BufferType::Storage, true).await }); diff --git a/tests/tests/wgpu-gpu/binding_array/sampled_textures.rs b/tests/tests/wgpu-gpu/binding_array/sampled_textures.rs index 0059d8ec1..3671d38ed 100644 --- a/tests/tests/wgpu-gpu/binding_array/sampled_textures.rs +++ b/tests/tests/wgpu-gpu/binding_array/sampled_textures.rs @@ -273,7 +273,13 @@ static PARTIAL_BINDING_ARRAY_FOLLOWED_BY_STORAGE_BUFFER: GpuTestConfiguration = .limits(Limits { max_binding_array_elements_per_shader_stage: 32, ..Limits::default() - }), + }) + // https://github.com/gfx-rs/wgpu/issues/9184 + .expect_fail( + wgpu_test::FailureCase::molten_vk() + .validation_error("Shader library compile failed") + .validation_error("could not be compiled into pipeline"), + ), ) .run_async( |ctx| async move { partial_binding_array_followed_by_storage_buffer(ctx).await }, diff --git a/tests/tests/wgpu-gpu/naga_capabilities.rs b/tests/tests/wgpu-gpu/naga_capabilities.rs index 16ee84319..d6c4e3114 100644 --- a/tests/tests/wgpu-gpu/naga_capabilities.rs +++ b/tests/tests/wgpu-gpu/naga_capabilities.rs @@ -14,9 +14,14 @@ pub fn validate_capabilities(ctx: TestingContext) { ); let max_caps = match ctx.adapter.get_info().backend { wgpu::Backend::Vulkan => naga::back::spv::supported_capabilities(), - // TODO: when mesh shaders land, change this - wgpu::Backend::Dx12 => naga::back::hlsl::supported_capabilities() | Caps::MESH_SHADER, - wgpu::Backend::Metal => naga::back::msl::supported_capabilities() | Caps::MESH_SHADER, + wgpu::Backend::Dx12 => naga::back::hlsl::supported_capabilities(), + wgpu::Backend::Metal => { + naga::back::msl::supported_capabilities() + // TODO(https://github.com/gfx-rs/wgpu/issues/9849): mask off + // BUFFER_BINDING_ARRAY because it is not currently reported by + // naga's MSL backend. + | Caps::BUFFER_BINDING_ARRAY + } wgpu::Backend::Gl => naga::back::glsl::supported_capabilities(), wgpu::Backend::BrowserWebGpu => naga::back::wgsl::supported_capabilities(), wgpu::Backend::Noop => Caps::all(),