Skip to content

Commit

Permalink
Fix Failure Case for MacOS 14.3
Browse files Browse the repository at this point in the history
  • Loading branch information
cwfitzgerald authored and ErichDonGubler committed May 18, 2024
1 parent 2c8a597 commit d1701a1
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
16 changes: 14 additions & 2 deletions tests/tests/subgroup_operations/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,22 @@ static SUBGROUP_OPERATIONS: GpuTestConfiguration = GpuTestConfiguration::new()
TestParameters::default()
.features(wgpu::Features::SUBGROUP)
.limits(wgpu::Limits::downlevel_defaults())
.expect_fail(wgpu_test::FailureCase::molten_vk())
// 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()
// 14.3 doesn't fail test 29
.panic("thread 0 failed tests: 27,\nthread 1 failed tests: 27, 28,\n")
// Prior versions do.
.panic("thread 0 failed tests: 27, 29,\nthread 1 failed tests: 27, 28, 29,\n"),
)
.expect_fail(
// Expect metal to fail on tests involving operations in divergent control flow
wgpu_test::FailureCase::backend(wgpu::Backends::METAL)
// 14.3 doesn't fail test 29
.panic("thread 0 failed tests: 27,\nthread 1 failed tests: 27, 28,\n")
// Prior versions do.
.panic("thread 0 failed tests: 27, 29,\nthread 1 failed tests: 27, 28, 29,\n"),
),
)
Expand Down
3 changes: 3 additions & 0 deletions tests/tests/subgroup_operations/shader.wgsl
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ fn main(
add_result_to_mask(&passed, 25u, subgroup_invocation_id == 0u || subgroupShuffleUp(subgroup_invocation_id, 1u) == subgroup_invocation_id - 1u);
add_result_to_mask(&passed, 26u, subgroupShuffleXor(subgroup_invocation_id, subgroup_size - 1u) == (subgroup_invocation_id ^ (subgroup_size - 1u)));

// Mac/Apple will fail this test.
var passed_27 = false;
if subgroup_invocation_id % 2u == 0u {
passed_27 |= subgroupAdd(1u) == (subgroup_size / 2u);
Expand All @@ -119,6 +120,7 @@ fn main(
}
add_result_to_mask(&passed, 27u, passed_27);

// Mac/Apple will fail this test.
var passed_28 = false;
switch subgroup_invocation_id % 3u {
case 0u: {
Expand All @@ -134,6 +136,7 @@ fn main(
}
add_result_to_mask(&passed, 28u, passed_28);

// Mac/Apple will sometimes fail this test. MacOS 14.3 passes it, so the bug in the metal compiler seems to be fixed.
expected = 0u;
for (var i = subgroup_size; i >= 0u; i -= 1u) {
expected = subgroupAdd(1u);
Expand Down

0 comments on commit d1701a1

Please sign in to comment.