Direct-split compute: a lane-bit test gives a wrong result on NVIDIA (RTX 3090, drivers 616.56 and 621.47), right on WARP; plain-HLSL repro #3779

Open
opened 2026-12-03 08:10:55 +00:00 by CharlyRien · 7 comments
CharlyRien commented 2026-12-03 08:10:55 +00:00 (Migrated from github.com)
Contributor

Imported from ivall/xcl. Originally posted by CharlyRien on 2026-12-03T08:10:55Z.


A small wave32 compute shader gives a wrong result on an RTX 3090 with two drivers (616.56 and 621.47), and the right one on WARP. XCL's direct split form, which runs a wave64 console program as two 32-lane halves, emits DXIL of this shape, and 58 programs from the #3716 fuzzer fail on this GPU because of it. This is group 5 of my #3716 review. The repro is plain HLSL compiled by DXC and needs nothing from XCL. Its input comes from the fuzzer and holds no data from any application.

It looks like the same family as #3772 (a lane reading its own bit of a mask word gets it wrong on NVIDIA, right on WARP), but in compute and with a different shape.

Measured

GPU driver DXC -O3 -Od 58 fuzz programs (XCL direct split)
RTX 3090 (Windows 11 22631) 616.56 1.9.2602.17 wrong (also -O1) right 0 / 58 pass
RTX 3090 (Windows 11 22631) 621.47 1.9.2602.17 wrong (also -O1) right 0 / 58 pass
WARP 1.0.23 + Agility SDK 1.621.0 — 1.9.2602.17 right right —

Both drivers give the same 31 wrong words, so a driver update does not fix it here. Results from other GPUs and drivers are welcome (see "How to check another GPU").

The shader

cs_6_6, [WaveSize(32)], [numthreads(64,1,1)], one group: two waves of 32 that share groupshared memory and barriers, the way the direct split form runs one wave64. Each wave takes a "lane" base 0 or 32 from a groupshared counter.

In it, bit = ((upper ? 0 : e) >> l31) & 1 with e = 0x3FFFFFFF & ~lo, and lo is 0 in every thread. Lane 0 must therefore take bit 0 = 1 and get v17 = v4.

  • Expected (WARP, -Od): v17 of lanes 0..29 = that lane's v4, lanes 30..63 = 0xFFFFFFFF; s37 = v4 of lane 0 = 0x9b3e8bcd; s46 = 0x3FFFFFFF.
  • NVIDIA with -O3: v17 = 0xFFFFFFFF in every lane, and s37 = 0xFFFFFFFF. s46 is right: the same thread stores e correctly, then reads its bit 0 as 0.

What the failure needs (one-flag variants of the shader, measured on the 3090):

variant result
-DTHEN=0: remove the first if (t != 0) block, which never runs right
-DTHEN=2: make that block a plain v2 = bit ? v6 : v2 right
-DXCH2=0: remove the WaveReadLaneAt + groupshared exchange + barriers in the second if v17 right
-DUHALF=1: take upper from the wave-uniform base instead of base + WaveGetLaneIndex() still wrong

In the DXC output both if blocks test a bit of a mask with the same shape, (select(upper, 0, X) & (1 << lane)) != 0: X = %40 in the first, X = %61 = %40 ^ 0x3FFFFFFF in the second. The wrong result is what the second block would give with %40 instead of %61. That is my reading of the DXIL; I have not seen the driver's ISA.

repro.hlsl
RWByteAddressBuffer io : register(u0);
RWByteAddressBuffer res : register(u1);
groupshared uint xw;
groupshared uint xs[2];
#ifndef THEN
#define THEN 1
#endif
#ifndef XCH2
#define XCH2 1
#endif
#ifndef UHALF
#define UHALF 0
#endif
[WaveSize(32)]
[numthreads(64, 1, 1)]
void main() {
    xw = 0;
    GroupMemoryBarrierWithGroupSync();
    uint got;
    InterlockedAdd(xw, WaveIsFirstLane() ? 32u : 0u, got);
    uint b0 = WaveReadLaneFirst(got);
    uint lane = b0 + WaveGetLaneIndex();
#if UHALF
    uint l31 = WaveGetLaneIndex();
    bool upper = b0 >= 32;
    uint hf = b0 >> 5;
#else
    uint l31 = lane & 31;
    bool upper = lane >= 32;
    uint hf = lane >> 5;
#endif
    uint base = lane * 1024 + 512;
    uint v2 = io.Load(base + 8);
    uint v3 = io.Load(base + 12);
    uint v4 = io.Load(base + 16);
    uint v6 = io.Load(base + 24);
    uint v7 = io.Load(base + 28);
    uint v17 = io.Load(base + 68);
    uint s37 = io.Load(148);
    uint s46 = io.Load(184);
    uint s47 = io.Load(188);
    // v_cmp_lt_u32 s[40:41], v7, v7 under EXEC = (0x3FFFFFFF, 0)
    bool cmp = (v7 < v7) && ((((upper ? 0u : 0x3FFFFFFFu) >> l31) & 1) != 0);
    uint b = WaveActiveBallot(cmp).x;
    xs[hf] = b;
    GroupMemoryBarrierWithGroupSync();
    uint o = xs[hf ^ 1];
    GroupMemoryBarrierWithGroupSync();
    uint lo = upper ? o : b;
    // s_and_saveexec: EXEC = (lo & 0x3FFFFFFF, 0); the then side (never runs here)
    uint t = lo & 0x3FFFFFFFu;
#if THEN != 0
    if (t != 0) {
        uint bit = ((upper ? 0u : t) >> l31) & 1;
#if THEN == 1
        uint off = v2 & 31;
        uint w = v3 & 31;
        uint sh = (32 - w) & 31;
        int r = (int)v6 >> off;
        r = (int)((uint)r << sh) >> sh;
        uint val = (w == 0) ? 0u : (uint)r;
#else
        uint val = v6;
#endif
        v2 = bit != 0 ? val : v2;
    }
#endif
    // s_andn2 EXEC: (0x3FFFFFFF & ~lo, 0); the whole-wave section
    uint e = 0x3FFFFFFFu & ~lo;
    if (e != 0) {
        uint bit = ((upper ? 0u : e) >> l31) & 1;
        v17 = bit != 0 ? v4 : 0xFFFFFFFFu;
#if XCH2
        uint m = WaveReadLaneAt(v17, 0);
        xs[hf] = m;
        GroupMemoryBarrierWithGroupSync();
        uint o2 = xs[hf ^ 1];
        GroupMemoryBarrierWithGroupSync();
        s37 = hf == 0 ? m : o2;
#endif
        s46 = e;
        s47 = 0;
    }
    if (lane == 0) {
        res.Store(148, s37);
        res.Store(184, s46);
        res.Store(188, s47);
    }
    res.Store(base + 8, v2);
    res.Store(base + 68, v17);
}

Bindings: three root UAVs (u0 input, u1 output, u2 unused), Dispatch(1,1,1). In both buffers, dwords 0..127 are "scalars" (s37, s46, s47 = dwords 37, 46, 47), then lane l has 256 dwords from 128 + 256*l (vN = dword N). The input sets v2 v3 v4 v6 v7 v17 per lane and s37 s46 s47; everything else is 0. The input words, both DXC disassemblies and the translator's own DXIL container are on the branch below.

How to check another GPU

Branch probe/direct-split-nv (6612772a, on #3716 at d2293dcb, itself on main 5ad98adb):

cargo test -p xcl --lib direct_split_driver_probe -- --ignored --nocapture --test-threads=1

It prints one SUMMARY line (GPU, driver, wave sizes, the HLSL repro at -O3 / -Od, and how many of the 58 + 12 fuzz programs pass).

On the XCL side

  • A workaround exists but is not safe yet. Reading the mask word once more with WaveReadLaneFirst just before the bit test in lanebit (dxil/lanes.rs) makes all 58 programs pass on the 3090 (8,000-seed fuzz run). It also turns one other seed wrong on the 3090, deterministically. That form only reads words that are already uniform, so the 3090 seems to miscompile it too. A narrower variant, applied only where one half of the mask is a constant (the shape here), is written but not run yet.
  • 12 more fuzz programs fail in the split form on NVIDIA (G6 in the summary line). They are a different case: they pass with XCL_DXIL_NO_OPT and crash WARP. Not understood yet; not part of this report.

Setup

  • 3090 runs: the probe branch above, release build, Windows 11 22631. 616.56 on 02/12, 621.47 on 03/12, same binary and inputs.
  • WARP: d3d10warp.dll 1.0.23 with the Agility SDK 1.621.0, the same DXIL.

AI use: Claude Code (Claude Opus 5.5) shrank the program, wrote the repro and the probe, ran the 3090 and WARP checks and wrote this; checked and posted by me.

<!-- greyfinch-sync:ivall/xcl:issue:6763871129 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/issues/3779). Originally posted by [CharlyRien](https://github.com/CharlyRien) on 2026-12-03T08:10:55Z. --- A small wave32 compute shader gives a wrong result on an RTX 3090 with two drivers (616.56 and 621.47), and the right one on WARP. XCL's direct split form, which runs a wave64 console program as two 32-lane halves, emits DXIL of this shape, and 58 programs from the #3716 fuzzer fail on this GPU because of it. This is group 5 of [my #3716 review](https://github.com/xcl-dev/xcl/pull/3716#pullrequestreview-6160420293). The repro is plain HLSL compiled by DXC and needs nothing from XCL. Its input comes from the fuzzer and holds no data from any application. It looks like the same family as #3772 (a lane reading its own bit of a mask word gets it wrong on NVIDIA, right on WARP), but in compute and with a different shape. ## Measured | GPU | driver | DXC | `-O3` | `-Od` | 58 fuzz programs (XCL direct split) | |---|---|---|---|---|---| | RTX 3090 (Windows 11 22631) | 616.56 | 1.9.2602.17 | **wrong** (also `-O1`) | right | 0 / 58 pass | | RTX 3090 (Windows 11 22631) | 621.47 | 1.9.2602.17 | **wrong** (also `-O1`) | right | 0 / 58 pass | | WARP 1.0.23 + Agility SDK 1.621.0 | — | 1.9.2602.17 | right | right | — | Both drivers give the same 31 wrong words, so a driver update does not fix it here. Results from other GPUs and drivers are welcome (see "How to check another GPU"). ## The shader `cs_6_6`, `[WaveSize(32)]`, `[numthreads(64,1,1)]`, one group: two waves of 32 that share groupshared memory and barriers, the way the direct split form runs one wave64. Each wave takes a "lane" base 0 or 32 from a groupshared counter. In it, `bit = ((upper ? 0 : e) >> l31) & 1` with `e = 0x3FFFFFFF & ~lo`, and `lo` is 0 in every thread. Lane 0 must therefore take bit 0 = 1 and get `v17 = v4`. - Expected (WARP, `-Od`): `v17` of lanes 0..29 = that lane's `v4`, lanes 30..63 = `0xFFFFFFFF`; `s37` = `v4` of lane 0 = `0x9b3e8bcd`; `s46` = `0x3FFFFFFF`. - NVIDIA with `-O3`: `v17` = `0xFFFFFFFF` in **every** lane, and `s37` = `0xFFFFFFFF`. `s46` is right: the same thread stores `e` correctly, then reads its bit 0 as 0. What the failure needs (one-flag variants of the shader, measured on the 3090): | variant | result | |---|---| | `-DTHEN=0`: remove the first `if (t != 0)` block, which never runs | right | | `-DTHEN=2`: make that block a plain `v2 = bit ? v6 : v2` | right | | `-DXCH2=0`: remove the `WaveReadLaneAt` + groupshared exchange + barriers in the second `if` | `v17` right | | `-DUHALF=1`: take `upper` from the wave-uniform base instead of `base + WaveGetLaneIndex()` | still wrong | In the DXC output both `if` blocks test a bit of a mask with the same shape, `(select(upper, 0, X) & (1 << lane)) != 0`: `X = %40` in the first, `X = %61 = %40 ^ 0x3FFFFFFF` in the second. The wrong result is what the second block would give with `%40` instead of `%61`. That is my reading of the DXIL; I have not seen the driver's ISA. <details><summary>repro.hlsl</summary> ```hlsl RWByteAddressBuffer io : register(u0); RWByteAddressBuffer res : register(u1); groupshared uint xw; groupshared uint xs[2]; #ifndef THEN #define THEN 1 #endif #ifndef XCH2 #define XCH2 1 #endif #ifndef UHALF #define UHALF 0 #endif [WaveSize(32)] [numthreads(64, 1, 1)] void main() { xw = 0; GroupMemoryBarrierWithGroupSync(); uint got; InterlockedAdd(xw, WaveIsFirstLane() ? 32u : 0u, got); uint b0 = WaveReadLaneFirst(got); uint lane = b0 + WaveGetLaneIndex(); #if UHALF uint l31 = WaveGetLaneIndex(); bool upper = b0 >= 32; uint hf = b0 >> 5; #else uint l31 = lane & 31; bool upper = lane >= 32; uint hf = lane >> 5; #endif uint base = lane * 1024 + 512; uint v2 = io.Load(base + 8); uint v3 = io.Load(base + 12); uint v4 = io.Load(base + 16); uint v6 = io.Load(base + 24); uint v7 = io.Load(base + 28); uint v17 = io.Load(base + 68); uint s37 = io.Load(148); uint s46 = io.Load(184); uint s47 = io.Load(188); // v_cmp_lt_u32 s[40:41], v7, v7 under EXEC = (0x3FFFFFFF, 0) bool cmp = (v7 < v7) && ((((upper ? 0u : 0x3FFFFFFFu) >> l31) & 1) != 0); uint b = WaveActiveBallot(cmp).x; xs[hf] = b; GroupMemoryBarrierWithGroupSync(); uint o = xs[hf ^ 1]; GroupMemoryBarrierWithGroupSync(); uint lo = upper ? o : b; // s_and_saveexec: EXEC = (lo & 0x3FFFFFFF, 0); the then side (never runs here) uint t = lo & 0x3FFFFFFFu; #if THEN != 0 if (t != 0) { uint bit = ((upper ? 0u : t) >> l31) & 1; #if THEN == 1 uint off = v2 & 31; uint w = v3 & 31; uint sh = (32 - w) & 31; int r = (int)v6 >> off; r = (int)((uint)r << sh) >> sh; uint val = (w == 0) ? 0u : (uint)r; #else uint val = v6; #endif v2 = bit != 0 ? val : v2; } #endif // s_andn2 EXEC: (0x3FFFFFFF & ~lo, 0); the whole-wave section uint e = 0x3FFFFFFFu & ~lo; if (e != 0) { uint bit = ((upper ? 0u : e) >> l31) & 1; v17 = bit != 0 ? v4 : 0xFFFFFFFFu; #if XCH2 uint m = WaveReadLaneAt(v17, 0); xs[hf] = m; GroupMemoryBarrierWithGroupSync(); uint o2 = xs[hf ^ 1]; GroupMemoryBarrierWithGroupSync(); s37 = hf == 0 ? m : o2; #endif s46 = e; s47 = 0; } if (lane == 0) { res.Store(148, s37); res.Store(184, s46); res.Store(188, s47); } res.Store(base + 8, v2); res.Store(base + 68, v17); } ``` </details> Bindings: three root UAVs (`u0` input, `u1` output, `u2` unused), `Dispatch(1,1,1)`. In both buffers, dwords 0..127 are "scalars" (`s37`, `s46`, `s47` = dwords 37, 46, 47), then lane `l` has 256 dwords from `128 + 256*l` (`vN` = dword `N`). The input sets `v2 v3 v4 v6 v7 v17` per lane and `s37 s46 s47`; everything else is 0. The input words, both DXC disassemblies and the translator's own DXIL container are on the branch below. ## How to check another GPU Branch [`probe/direct-split-nv`](https://github.com/CharlyRien/xcl/tree/probe/direct-split-nv) (6612772a, on #3716 at `d2293dcb`, itself on `main` `5ad98adb`): ``` cargo test -p xcl --lib direct_split_driver_probe -- --ignored --nocapture --test-threads=1 ``` It prints one `SUMMARY` line (GPU, driver, wave sizes, the HLSL repro at `-O3` / `-Od`, and how many of the 58 + 12 fuzz programs pass). ## On the XCL side - A workaround exists but is not safe yet. Reading the mask word once more with `WaveReadLaneFirst` just before the bit test in `lanebit` (`dxil/lanes.rs`) makes all 58 programs pass on the 3090 (8,000-seed fuzz run). It also turns one other seed wrong on the 3090, deterministically. That form only reads words that are already uniform, so the 3090 seems to miscompile it too. A narrower variant, applied only where one half of the mask is a constant (the shape here), is written but not run yet. - 12 more fuzz programs fail in the split form on NVIDIA (`G6` in the summary line). They are a different case: they pass with `XCL_DXIL_NO_OPT` and crash WARP. Not understood yet; not part of this report. ## Setup - 3090 runs: the probe branch above, release build, Windows 11 22631. 616.56 on 02/12, 621.47 on 03/12, same binary and inputs. - WARP: `d3d10warp.dll` 1.0.23 with the Agility SDK 1.621.0, the same DXIL. AI use: Claude Code (Claude Opus 5.5) shrank the program, wrote the repro and the probe, ran the 3090 and WARP checks and wrote this; checked and posted by me.
Raul-Paiva commented 2026-12-03 09:26:07 +00:00 (Migrated from github.com)
Author
Contributor

Imported from ivall/xcl. Originally posted by Raul-Paiva on 2026-12-03T09:26:07Z.


Ran your probe on an RTX 3070 Laptop GPU (driver 621.40 / 32.0.16.2140, Win10 19045, DXC 1.8.2502.11), probe/direct-split-nv 6612772a:

SUMMARY gpu="NVIDIA GeForce RTX 3070 Laptop GPU" driver=32.0.16.2140 waves=32-32 hlsl_O3=MISMATCH hlsl_Od=match G5=0/58 G6=1/12
  • hlsl -O3: 31 wrong words. The first ones are v17 lanes 0-3, which come back as 0xffffffff instead of 0x9b3e8bcd 0xa5bad59b 0x73b7d5f0 0x80000000.
  • Reran with -Gis on the O3 compile: still MISMATCH, with the same 31 words, and -Od still matches. So on this card it's not DXC's fast math.
  • G6 changes from run to run: it was 0/12 on the second run. Seed 1000823 gave Mismatch("memory dword 0", 3606620596, 0, 240).
  • G5: 0/58 both times.

Separately, the fast-math part of #3716 (items 3 and 4: 0 - x → −0 and inf - inf → 0) is in #3778, which compiles the translated HLSL with -Gis.

<!-- greyfinch-sync:ivall/xcl:comment:7373655152 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/issues/3779#issuecomment-7373655152). Originally posted by [Raul-Paiva](https://github.com/Raul-Paiva) on 2026-12-03T09:26:07Z. --- Ran your probe on an RTX 3070 Laptop GPU (driver 621.40 / 32.0.16.2140, Win10 19045, DXC 1.8.2502.11), `probe/direct-split-nv` 6612772a: ``` SUMMARY gpu="NVIDIA GeForce RTX 3070 Laptop GPU" driver=32.0.16.2140 waves=32-32 hlsl_O3=MISMATCH hlsl_Od=match G5=0/58 G6=1/12 ``` - **hlsl -O3:** 31 wrong words. The first ones are v17 lanes 0-3, which come back as `0xffffffff` instead of `0x9b3e8bcd 0xa5bad59b 0x73b7d5f0 0x80000000`. - **Reran with `-Gis` on the O3 compile:** still MISMATCH, with the same 31 words, and -Od still matches. So on this card it's not DXC's fast math. - **G6 changes from run to run:** it was 0/12 on the second run. Seed 1000823 gave `Mismatch("memory dword 0", 3606620596, 0, 240)`. - **G5:** 0/58 both times. Separately, the fast-math part of #3716 (items 3 and 4: `0 - x` → −0 and `inf - inf` → 0) is in #3778, which compiles the translated HLSL with `-Gis`.
Gevroska commented 2026-12-03 11:15:06 +00:00 (Migrated from github.com)
Author
Contributor

Imported from ivall/xcl. Originally posted by Gevroska on 2026-12-03T11:15:06Z.


I reproduced the 31 wrong words on my RTX 3080 with SDK DXC 1.9.2602.17. I ran each variant three times and compared all 131 output words after the GPU fence completed.

Shader variant Result in each of 3 trials
Original -O3 31 mismatches
Original -O3 -Gis Same 31 mismatches
Single groupshared writer, -O3 Same 31 mismatches
Original -Od All 131 words matched
-O3 -DTHEN=0 All 131 words matched
Single groupshared writer, -Od All 131 words matched

In every failing run, v17 on lanes 0–29 and scalar s37 read 0xffffffff. Restricting the groupshared stores to one writer preserved the failure, so concurrent writers aren’t required to reproduce it on this card. Removing the dead branch with -DTHEN=0 made the optimized case pass. The -O3 and -O3 -Gis DXIL containers were byte-identical with this compiler. My WARP device skipped before dispatch because it lacked wave32 support.

AI disclosure: OpenAI Codex GPT-6.2 Sol ran the GPU comparison. GPT-6 Sol (Daybreak) checked all 18 readbacks, and a separate GPT-6.2 Sol reviewer verified the evidence. GPT-6.2 Astra drafted this comment.

I reviewed and approved this comment before posting.

<!-- greyfinch-sync:ivall/xcl:comment:7376426971 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/issues/3779#issuecomment-7376426971). Originally posted by [Gevroska](https://github.com/Gevroska) on 2026-12-03T11:15:06Z. --- I reproduced the 31 wrong words on my RTX 3080 with SDK DXC `1.9.2602.17`. I ran each variant three times and compared all 131 output words after the GPU fence completed. | Shader variant | Result in each of 3 trials | |---|---| | Original `-O3` | 31 mismatches | | Original `-O3 -Gis` | Same 31 mismatches | | Single groupshared writer, `-O3` | Same 31 mismatches | | Original `-Od` | All 131 words matched | | `-O3 -DTHEN=0` | All 131 words matched | | Single groupshared writer, `-Od` | All 131 words matched | In every failing run, `v17` on lanes 0–29 and scalar `s37` read `0xffffffff`. Restricting the groupshared stores to one writer preserved the failure, so concurrent writers aren’t required to reproduce it on this card. Removing the dead branch with `-DTHEN=0` made the optimized case pass. The `-O3` and `-O3 -Gis` DXIL containers were byte-identical with this compiler. My WARP device skipped before dispatch because it lacked wave32 support. AI disclosure: OpenAI Codex GPT-6.2 Sol ran the GPU comparison. GPT-6 Sol (Daybreak) checked all 18 readbacks, and a separate GPT-6.2 Sol reviewer verified the evidence. GPT-6.2 Astra drafted this comment. I reviewed and approved this comment before posting.
stijn-boer commented 2026-12-03 11:37:06 +00:00 (Migrated from github.com)
Author
Contributor

Imported from ivall/xcl. Originally posted by stijn-boer on 2026-12-03T11:37:06Z.


Ran probe/direct-split-nv at 6612772a on an AMD Radeon RX 9060 XT (driver 32.0.32029.2010, Windows 10 build 19044.6332, DXC 1.9.2609.5). The original run and both reruns produced the same summary:

SUMMARY gpu="AMD Radeon RX 9060 XT" driver=32.0.32029.2010 waves=32-64 hlsl_O3=match hlsl_Od=match G5=58/58 G6=0/12
  • HLSL -O3 and -Od — Both matched with zero wrong words in both reruns. I used the stock probe flags.
  • G5 — All 58 direct-split seeds matched the reference in both reruns.
  • G6 — All 12 seeds failed at CreateComputePipelineState with 0x887A0005 (DXGI_ERROR_DEVICE_REMOVED) in both reruns. The first failure was seed 155, immediately after Unknown pointer operation encountered during ParseAddress. Seed 1000823 returned the same device error, so there was no output comparison for it. The logs do not establish which operation caused the removal.

AI use

Codex (GPT-6) prepared the test builds, ran the tests, reviewed the diff, and drafted this report.

<!-- greyfinch-sync:ivall/xcl:comment:7376948233 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/issues/3779#issuecomment-7376948233). Originally posted by [stijn-boer](https://github.com/stijn-boer) on 2026-12-03T11:37:06Z. --- Ran `probe/direct-split-nv` at `6612772a` on an **AMD Radeon RX 9060 XT** (driver `32.0.32029.2010`, Windows 10 build `19044.6332`, DXC `1.9.2609.5`). The original run and both reruns produced the same summary: ```text SUMMARY gpu="AMD Radeon RX 9060 XT" driver=32.0.32029.2010 waves=32-64 hlsl_O3=match hlsl_Od=match G5=58/58 G6=0/12 ``` - **HLSL `-O3` and `-Od`** — Both matched with zero wrong words in both reruns. I used the stock probe flags. - **G5** — All 58 direct-split seeds matched the reference in both reruns. - **G6** — All 12 seeds failed at `CreateComputePipelineState` with `0x887A0005` (`DXGI_ERROR_DEVICE_REMOVED`) in both reruns. The first failure was seed `155`, immediately after `Unknown pointer operation encountered during ParseAddress`. Seed `1000823` returned the same device error, so there was no output comparison for it. The logs do not establish which operation caused the removal. AI use Codex (GPT-6) prepared the test builds, ran the tests, reviewed the diff, and drafted this report.
CharlyRien commented 2026-12-03 12:51:25 +00:00 (Migrated from github.com)
Author
Contributor

Imported from ivall/xcl. Originally posted by CharlyRien on 2026-12-03T12:51:25Z.


@stijn-boer thanks for the AMD run. About the G6 DXGI_ERROR_DEVICE_REMOVED at CreateComputePipelineState ("Unknown pointer operation encountered during ParseAddress"):

  • The probe branch 6612772a is #3716 d2293dcb on main 5ad98adb. That base has #3655 but not #3707.
  • With #3655, the split-wave64 rendezvous is written as internal DXIL functions that take groupshared pointers. The DXIL of the G6 programs has two of them (xcl.spin.wait(i32 addrspace(3)*, i32 addrspace(3)*, ...) and xcl.barrier.arrive), called twice each. I read that in the DXIL I dumped on the 3090 for seeds 155 and 1000823.
  • #3707 (merged today) inlines these helpers before the DXIL is written, because dxil-spirv could not convert those pointer arguments under Wine.

So I think the AMD driver's compiler rejects the same thing, and that main with #3707 does not hit it. I have no AMD card to check, so that is a guess, not a measurement. The G5 programs pass on your card, which fits: I expect they have no exchange, so they have no such helper. I have not checked their DXIL.

If you can rerun G6 on a tree with #3707, that would settle it.

On NVIDIA, G6 now has a workaround: on the RTX 3090, reading each word of the half-local mask pair with WaveReadLaneFirst after its select fixes all 12 G6 programs, plus seed 358, with no new failure over the 8,000 seeds. Measured on #3707 + #3716 d2293dcb with a local switch. A PR follows.

AI use: Claude Code (Claude Opus 5.5) read the DXIL and the PRs and wrote this; checked and posted by me.

<!-- greyfinch-sync:ivall/xcl:comment:7378943800 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/issues/3779#issuecomment-7378943800). Originally posted by [CharlyRien](https://github.com/CharlyRien) on 2026-12-03T12:51:25Z. --- @stijn-boer thanks for the AMD run. About the G6 `DXGI_ERROR_DEVICE_REMOVED` at `CreateComputePipelineState` ("Unknown pointer operation encountered during ParseAddress"): - The probe branch `6612772a` is #3716 `d2293dcb` on `main` `5ad98adb`. That base has #3655 but not #3707. - With #3655, the split-wave64 rendezvous is written as internal DXIL functions that take groupshared pointers. The DXIL of the G6 programs has two of them (`xcl.spin.wait(i32 addrspace(3)*, i32 addrspace(3)*, ...)` and `xcl.barrier.arrive`), called twice each. I read that in the DXIL I dumped on the 3090 for seeds 155 and 1000823. - #3707 (merged today) inlines these helpers before the DXIL is written, because dxil-spirv could not convert those pointer arguments under Wine. So I think the AMD driver's compiler rejects the same thing, and that `main` with #3707 does not hit it. I have no AMD card to check, so that is a guess, not a measurement. The G5 programs pass on your card, which fits: I expect they have no exchange, so they have no such helper. I have not checked their DXIL. If you can rerun G6 on a tree with #3707, that would settle it. On NVIDIA, G6 now has a workaround: on the RTX 3090, reading each word of the half-local mask pair with `WaveReadLaneFirst` after its `select` fixes all 12 G6 programs, plus seed 358, with no new failure over the 8,000 seeds. Measured on #3707 + #3716 `d2293dcb` with a local switch. A PR follows. AI use: Claude Code (Claude Opus 5.5) read the DXIL and the PRs and wrote this; checked and posted by me.
stijn-boer commented 2026-12-03 13:02:12 +00:00 (Migrated from github.com)
Author
Contributor

Imported from ivall/xcl. Originally posted by stijn-boer on 2026-12-03T13:02:12Z.


@CharlyRien I reran the unchanged probe/direct-split-nv at 6612772a59e601afb77c4f43490e19221c2acf83 on current main a815de932c4dc8da3b383ca44f4b094aa406fec9, the upstream #3707 merge. The clean local probe merge was 7ca751b9bff41bad89ee8ee888ab26ad96732bc8. I used the stock flags and added no other PRs.

G6 changed from 0/12 to 12/12 on AMD. All three sequential runs printed the same line:

SUMMARY gpu="AMD Radeon RX 9060 XT" driver=32.0.32029.2010 waves=32-64 hlsl_O3=match hlsl_Od=match G5=58/58 G6=12/12
  • G6: Every seed dispatched and matched the reference, including 155 and 1000823. There were no G6 device-removal errors or Unknown pointer operation encountered during ParseAddress messages in these runs.
  • G5 and HLSL controls: 58/58 seeds matched, and both -O3 and -Od returned zero wrong words each time.

Setup: RX 9060 XT, driver 32.0.32029.2010, Windows 10 build 19044.6332, DXC/DXIL 1.9.2609.5, and Agility SDK 1.620.2. Command: cargo test -p xcl --lib direct_split_driver_probe -- --ignored --nocapture --test-threads=1. Each invocation reported 1 passed, 0 failed, 0 ignored, and 0 skips.

This confirms the failure is gone on current main with #3707. Compared with the older probe base, the result is consistent with the helper-inlining explanation. The two bases include other changes as well, so this run does not isolate the compiler mechanism.

AI use: OpenAI Codex (GPT-6, exact variant unavailable) prepared the probe merge, ran it, and drafted this report.

<!-- greyfinch-sync:ivall/xcl:comment:7379217124 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/issues/3779#issuecomment-7379217124). Originally posted by [stijn-boer](https://github.com/stijn-boer) on 2026-12-03T13:02:12Z. --- @CharlyRien I reran the unchanged `probe/direct-split-nv` at `6612772a59e601afb77c4f43490e19221c2acf83` on current `main` `a815de932c4dc8da3b383ca44f4b094aa406fec9`, the upstream #3707 merge. The clean local probe merge was `7ca751b9bff41bad89ee8ee888ab26ad96732bc8`. I used the stock flags and added no other PRs. **G6 changed from 0/12 to 12/12 on AMD.** All three sequential runs printed the same line: ```text SUMMARY gpu="AMD Radeon RX 9060 XT" driver=32.0.32029.2010 waves=32-64 hlsl_O3=match hlsl_Od=match G5=58/58 G6=12/12 ``` - **G6:** Every seed dispatched and matched the reference, including `155` and `1000823`. There were no G6 device-removal errors or `Unknown pointer operation encountered during ParseAddress` messages in these runs. - **G5 and HLSL controls:** 58/58 seeds matched, and both `-O3` and `-Od` returned zero wrong words each time. Setup: RX 9060 XT, driver 32.0.32029.2010, Windows 10 build 19044.6332, DXC/DXIL 1.9.2609.5, and Agility SDK 1.620.2. Command: `cargo test -p xcl --lib direct_split_driver_probe -- --ignored --nocapture --test-threads=1`. Each invocation reported 1 passed, 0 failed, 0 ignored, and 0 skips. This confirms the failure is gone on current main with #3707. Compared with the older probe base, the result is consistent with the helper-inlining explanation. The two bases include other changes as well, so this run does not isolate the compiler mechanism. **AI use:** OpenAI Codex (GPT-6, exact variant unavailable) prepared the probe merge, ran it, and drafted this report.
CharlyRien commented 2026-12-03 13:12:32 +00:00 (Migrated from github.com)
Author
Contributor

Imported from ivall/xcl. Originally posted by CharlyRien on 2026-12-03T13:12:32Z.


@stijn-boer thanks, that settles the AMD side: G6 runs and matches on main a815de93 with #3707, so the device removal came from the older base, as you say without isolating the mechanism.

That leaves G6 on NVIDIA. I tested a workaround on the RTX 3090 (WaveReadLaneFirst of each word of the half-local mask pair, after its select). I am preparing it as a PR on a815de93 and will link it here. Your run also shows that main already gives the right G6 results on RDNA4 without it.

AI use: Claude Code (Claude Opus 5.5) wrote this; checked and posted by me.

<!-- greyfinch-sync:ivall/xcl:comment:7379472329 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/issues/3779#issuecomment-7379472329). Originally posted by [CharlyRien](https://github.com/CharlyRien) on 2026-12-03T13:12:32Z. --- @stijn-boer thanks, that settles the AMD side: G6 runs and matches on `main` `a815de93` with #3707, so the device removal came from the older base, as you say without isolating the mechanism. That leaves G6 on NVIDIA. I tested a workaround on the RTX 3090 (`WaveReadLaneFirst` of each word of the half-local mask pair, after its `select`). I am preparing it as a PR on `a815de93` and will link it here. Your run also shows that `main` already gives the right G6 results on RDNA4 without it. AI use: Claude Code (Claude Opus 5.5) wrote this; checked and posted by me.
CharlyRien commented 2026-12-03 15:04:43 +00:00 (Migrated from github.com)
Author
Contributor

Imported from ivall/xcl. Originally posted by CharlyRien on 2026-12-03T15:04:43Z.


The NVIDIA workaround for G6 is now #3792 (draft): in the split wave64 form, each word of a half-local mask pair is read once more with WaveReadLaneFirst where the pair is made. On the RTX 3090 (driver 621.47), on main a815de93 + #3716 de05c50e, over the 8,000 fuzz seeds: 203 programs differ from the reference without it, 193 with it (10 fixed, 0 new). On AMD, @stijn-boer's run above already matched on all 12 G6 programs with main (#3707), so this is for NVIDIA only so far.

AI use: Claude Code (Claude Opus 5.5) ran the fuzz and wrote this; checked and posted by me.

<!-- greyfinch-sync:ivall/xcl:comment:7382524237 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/issues/3779#issuecomment-7382524237). Originally posted by [CharlyRien](https://github.com/CharlyRien) on 2026-12-03T15:04:43Z. --- The NVIDIA workaround for G6 is now #3792 (draft): in the split wave64 form, each word of a half-local mask pair is read once more with `WaveReadLaneFirst` where the pair is made. On the RTX 3090 (driver 621.47), on `main` `a815de93` + #3716 `de05c50e`, over the 8,000 fuzz seeds: 203 programs differ from the reference without it, 193 with it (10 fixed, 0 new). On AMD, @stijn-boer's run above already matched on all 12 G6 programs with `main` (#3707), so this is for NVIDIA only so far. AI use: Claude Code (Claude Opus 5.5) ran the fuzz and wrote this; checked and posted by me.
Sign in to join this conversation.
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
xcl-dev/xcl#3779
No description provided.