You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit aa97bec
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: amdgpu/README.md
+10Lines changed: 10 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -81,6 +81,15 @@ are local artifacts and are ignored by git; set `FUZZX_RUNTIME_ROOT`,
81
81
`CORPUS_ROOT`, `LOG_DIR`, `ARTIFACT_ROOT`, or `FUZZX_FINDINGS_DIR` to override
82
82
the default local runtime paths.
83
83
84
+
### Known-Bug Suppression
85
+
86
+
Known bug patterns are suppressed by default so continued fuzzing does not keep
87
+
rediscovering the same issue.
88
+
89
+
| Flag | Default | Meaning |
90
+
| --- | --- | --- |
91
+
|`FUZZX_ALLOW_M019_HIGHBIT_OR_XOR=1`| unset | Re-enable the outer high-bit `(x | C) ^ x` shape for [m019](known-miscompiles/m019-highbit-or-xor/NOTES.md). |
92
+
84
93
## Layout
85
94
86
95
| Path | Purpose |
@@ -131,6 +140,7 @@ Tested toolchains as of 2026-05-16:
131
140
|[m016-scalar-fshl-one](known-miscompiles/m016-scalar-fshl-one/NOTES.md)| ✅ | ❌ | ❌ |`-O0` lowers scalar `fshl.i32(x, y, 1)` through a 64-bit shift-by-`-1` sequence that returns only bit 31. |
132
141
|[m017-vector-and-lane0-clear-xor](known-miscompiles/m017-vector-and-lane0-clear-xor/NOTES.md)| ❌ | ✅ | ✅ | ROCm 7.2.3 `-O0` drops a vector lane-0 `and`/`extractelement` clear before `xor`; LLVM HEAD and ROCm HEAD already pass. |
133
142
|[m018-two-private-memory-ops](known-miscompiles/m018-two-private-memory-ops/NOTES.md)| ❌ | ✅ | ✅ | ROCm 7.2.3 `-O0` intermittently reads stale scratch data across two private-memory sequences; LLVM HEAD and ROCm HEAD pass 50 repeated combined runs. |
143
+
|[m019-highbit-or-xor](known-miscompiles/m019-highbit-or-xor/NOTES.md)| ❌ | ❌ | ❌ |`-O0` combines a high-bit `(x | C) ^ x` expression into `v_bitop3_b32` with the wrong truth table or operands. |
134
144
135
145
*Human-written note:* Up through bug m016 I was testing against upstream LLVM. But then it became clear that the ROCm 7.2.3 release doesn't have most of the bugs that are appearing in upstream. I'm more interested in bugs that appear in the release, so after this, I started testing against 7.2.3 (built from source).
# m019: high-bit `(x | C) ^ x` is miscompiled through `v_bitop3_b32`
2
+
3
+
Found while fuzzing the ROCm 7.2.3 source build with the LLVM-bitcode C++
4
+
fuzzer.
5
+
6
+
```bash
7
+
known-miscompiles/run_ll_reproducer.sh \
8
+
known-miscompiles/m019-highbit-or-xor/reduced.ll
9
+
```
10
+
11
+
Observed result:
12
+
13
+
```text
14
+
input=0x00000000
15
+
O0=0x80000000
16
+
O2=0x00000000
17
+
mismatch=true
18
+
```
19
+
20
+
## Reduction
21
+
22
+
The reduced IR computes:
23
+
24
+
```llvm
25
+
%salt = xor i32 %workitem.id.x, 0x80000000
26
+
%mix = xor i32 %load, %salt
27
+
%and = and i32 %mix, %salt
28
+
%or = or i32 %and, 0x80000000
29
+
%xor = xor i32 %or, %and
30
+
```
31
+
32
+
For the single executed work-item and input `0`, `%salt` and `%and` are both
33
+
`0x80000000`, so `%xor` should be zero.
34
+
35
+
## Root Cause Notes
36
+
37
+
At `-O2`, the expression is simplified to `load & 0x80000000`, which returns
38
+
zero for the reproducer input.
39
+
40
+
At `-O0`, instruction selection combines the bit expression into:
41
+
42
+
```asm
43
+
v_bitop3_b32 v2, v2, v3, s2 bitop3:0x62
44
+
```
45
+
46
+
where `v2` is the loaded input, `v3` is the work-item id, and `s2` is
47
+
`0x80000000`. For work-item zero and input zero this instruction produces
48
+
`0x80000000`, but the LLVM IR expression is defined and evaluates to zero.
49
+
50
+
## Toolchain Results
51
+
52
+
| Toolchain | Result |
53
+
| --- | --- |
54
+
| ROCm 7.2.3 source build from tag `rocm-7.2.3`, commit `f58b06dce1f9c15707c5f808fd002e18c2accf7e`, `Release`, sanitizer coverage, no ASan | Reproduces. |
0 commit comments