Skip to content

Commit e883551

Browse files
add new buffer match rule to work with bittracking
1 parent 2baa055 commit e883551

File tree

3 files changed

+53
-1
lines changed

3 files changed

+53
-1
lines changed
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# Example test case using BufferParticipantPattern rule for WaveParticipantBitTracking
2+
---
3+
Shaders:
4+
- Stage: Compute
5+
Entry: main
6+
DispatchSize: [8, 1, 1] # 8 threads
7+
Buffers:
8+
# Actual output from the shader (may have patterns in any order)
9+
- Name: ParticipantOutput
10+
Format: UInt32
11+
ZeroInitSize: 96 # Space for multiple patterns (3 uint32 per pattern)
12+
13+
# Expected patterns - order doesn't matter, but pattern counts must match
14+
- Name: ExpectedPatterns
15+
Format: UInt32
16+
Data: [
17+
# Pattern 1: Wave op ID 69, loop iteration 0, participants 0,1,2,3
18+
4416, 0x000F, 0x0000, # (69<<6)|0, mask for threads 0-3, high mask
19+
4416, 0x000F, 0x0000, # Duplicate 1
20+
4416, 0x000F, 0x0000, # Duplicate 2
21+
4416, 0x000F, 0x0000, # Duplicate 3 (4 participants = 4 copies)
22+
23+
# Pattern 2: Wave op ID 70, loop iteration 1, participants 4,5,6,7
24+
4496, 0x00F0, 0x0000, # (70<<6)|(1<<4), mask for threads 4-7, high mask
25+
4496, 0x00F0, 0x0000, # Duplicate 1
26+
4496, 0x00F0, 0x0000, # Duplicate 2
27+
4496, 0x00F0, 0x0000, # Duplicate 3 (4 participants = 4 copies)
28+
]
29+
30+
Results:
31+
- Result: ValidateParticipantPatterns
32+
Rule: BufferParticipantPattern
33+
GroupSize: 3 # Each pattern consists of 3 uint32 values
34+
Actual: ParticipantOutput
35+
Expected: ExpectedPatterns
36+
37+
DescriptorSets:
38+
- Resources:
39+
- Name: ParticipantOutput
40+
Kind: RWBuffer
41+
DirectXBinding:
42+
Register: 0
43+
Space: 0
44+
VulkanBinding:
45+
Binding: 0
46+
...

include/Support/Pipeline.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ namespace offloadtest {
2525

2626
enum class Stages { Compute };
2727

28-
enum class Rule { BufferExact, BufferFloatULP, BufferFloatEpsilon };
28+
enum class Rule { BufferExact, BufferFloatULP, BufferFloatEpsilon, BufferParticipantPattern };
2929

3030
enum class DenormMode { Any, FTZ, Preserve };
3131

@@ -131,6 +131,7 @@ struct Result {
131131
DenormMode DM = DenormMode::Any;
132132
unsigned ULPT; // ULP Tolerance
133133
double Epsilon;
134+
unsigned GroupSize = 0; // For BufferParticipantPattern rule
134135
};
135136

136137
struct Resource {
@@ -357,6 +358,7 @@ template <> struct ScalarEnumerationTraits<offloadtest::Rule> {
357358
ENUM_CASE(BufferExact);
358359
ENUM_CASE(BufferFloatULP);
359360
ENUM_CASE(BufferFloatEpsilon);
361+
ENUM_CASE(BufferParticipantPattern);
360362
#undef ENUM_CASE
361363
}
362364
};

lib/Support/Pipeline.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -383,6 +383,10 @@ void MappingTraits<offloadtest::Result>::mapping(IO &I,
383383
I.mapOptional("DenormMode", R.DM);
384384
break;
385385
}
386+
case Rule::BufferParticipantPattern: {
387+
I.mapRequired("GroupSize", R.GroupSize);
388+
break;
389+
}
386390
default:
387391
break;
388392
}

0 commit comments

Comments
 (0)