Skip to content

Commit d1701a1

Browse files
cwfitzgeraldErichDonGubler
authored andcommitted
Fix Failure Case for MacOS 14.3
1 parent 2c8a597 commit d1701a1

File tree

2 files changed

+17
-2
lines changed

2 files changed

+17
-2
lines changed

tests/tests/subgroup_operations/mod.rs

+14-2
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,22 @@ static SUBGROUP_OPERATIONS: GpuTestConfiguration = GpuTestConfiguration::new()
1111
TestParameters::default()
1212
.features(wgpu::Features::SUBGROUP)
1313
.limits(wgpu::Limits::downlevel_defaults())
14-
.expect_fail(wgpu_test::FailureCase::molten_vk())
14+
// Expect metal to fail on tests involving operations in divergent control flow
15+
//
16+
// Newlines are included in the panic message to ensure that _additional_ failures
17+
// are not matched against.
18+
.expect_fail(
19+
wgpu_test::FailureCase::molten_vk()
20+
// 14.3 doesn't fail test 29
21+
.panic("thread 0 failed tests: 27,\nthread 1 failed tests: 27, 28,\n")
22+
// Prior versions do.
23+
.panic("thread 0 failed tests: 27, 29,\nthread 1 failed tests: 27, 28, 29,\n"),
24+
)
1525
.expect_fail(
16-
// Expect metal to fail on tests involving operations in divergent control flow
1726
wgpu_test::FailureCase::backend(wgpu::Backends::METAL)
27+
// 14.3 doesn't fail test 29
28+
.panic("thread 0 failed tests: 27,\nthread 1 failed tests: 27, 28,\n")
29+
// Prior versions do.
1830
.panic("thread 0 failed tests: 27, 29,\nthread 1 failed tests: 27, 28, 29,\n"),
1931
),
2032
)

tests/tests/subgroup_operations/shader.wgsl

+3
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ fn main(
111111
add_result_to_mask(&passed, 25u, subgroup_invocation_id == 0u || subgroupShuffleUp(subgroup_invocation_id, 1u) == subgroup_invocation_id - 1u);
112112
add_result_to_mask(&passed, 26u, subgroupShuffleXor(subgroup_invocation_id, subgroup_size - 1u) == (subgroup_invocation_id ^ (subgroup_size - 1u)));
113113

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

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

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

0 commit comments

Comments
 (0)