gpu_geometry_wave32_prefix_count_over_a_mask: flaky on AMD (load-sensitive) - NVIDIA wave32 rigs skip it, so AMD is the only place it runs #847
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
goal:world-load
good first issue
help wanted
invalid
keep-open
off-goal
question
stale
test-only
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/xcl-dev--xcl#847
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@SlopTart on GitHub · 2026-11-24 06:41 UTC · original
2|
3|Machine: RX 7900 XT (RADV NAVI31), Mesa 26.2.5, kernel 7.2 (Arch), Wine = Proton Experimental (wine-11.0), patched vkd3d-proton v3.1, Rust 1.100.0 cross
x86_64-pc-windows-gnu, release profile,XCL_NETWORK=0, native wave64. Same rig as my Linux rows in #42 / #718.4|
5|
gpu::recomp::tests::gpu_geometry_wave32_prefix_count_over_a_maskfails on this rig and looks untracked:6|
7|- Isolated:
cargo test -p xcl --lib --release -- gpu_geometry_wave32_prefix_count_over_a_maskat mainbeaa245, 20 separate runs: 5 failed, 15 passed (~25%). Each run is a fresh process, single test, no other tests running - so this is not cross-test interference and not the #718 trio.8|- Full suite: 2 hits in 12 release full-suite runs since
beaa245(thebeaa245baseline itself and one PR-lane run); never seen atd5442d2ore50836bin earlier runs.9|- Not reliably reproducible yet: reruns on the same tree ~40 minutes later: 0/40 (15 plain
beaa245, 25 onbeaa245+PR #823). During the failing window my GPU also served local LLM inference; later windows were idle (16% busy). So the flake looks sensitive to GPU/system load rather than to the code under test - but note your PR rows always show it SKIPPED (no wave64) on NVIDIA, so AMD hardware is the only place this test ever executes, and on AMD it can eat a lane run at random.10|- The failure output I captured before I started chasing it was truncated; I have not yet pinned the assertion text. Happy to rerun under load until it breaks with full stdout if that would help.
11|
12|Counts only, no game data.
13|AI use: Hermes agent (local Qwen-class) ran the loops and drafted this; I checked it before posting.
@Abuudiii on GitHub · 2026-11-24 06:59 UTC · original
Independent game-free run at
beaa245ca04e212f064efc7cafcdce104bc5c0a2: Arch Linux, RX 9070 (RADV GFX1201 / Mesa 26.2.5), GE-Proton 11-7 + vkd3d-proton 3.1, DXC/DXIL 1.9.2609.5, Rust 1.99.1x86_64-pc-windows-gnu, release.Tested:
gpu::recomp::tests::gpu_geometry_wave32_prefix_count_over_a_mask, one exact test per fresh process,--exact --test-threads=1 --nocapture,XCL_REQUIRE_GPU=wave64, default split exchange. No skips.The Vulkan scaling control saturated the RX 9070 but does not reproduce an inference workload. No mismatch was captured on this stack, so the failing leg and cause remain unconfirmed. No runtime change is proposed from this result.
Not tested: RX 7900 XT, the original inference workload, native Windows, or a retail game.
AI use: omp (GPT-6.2 Sol) ran the checks and drafted this report.
@SlopTart on GitHub · 2026-11-24 07:17 UTC · original
Follow-up datapoint: in today's 19-PR lane sweep (mains
beaa245->1ec4c98, each full release suite,--test-threads=4) this test hit 0 times in 19 full-suite runs, same rig and load pattern as the earlier window where it failed 2/12. Consistent with the load-sensitive read in the issue body - leaving the issue open until it either repeats under load or stops being flaky outright.AI use: Hermes agent (local Qwen-class) ran the sweep and drafted this; I checked it before posting.
@4usphs on GitHub · 2026-11-24 08:32 UTC · original
A native Windows run on AMD (not reproduced), and what a failure of the split exchange's timeout looks like, so a captured failure can be matched against it.
Machine: RX 9070 XT (RDNA4, native wave64), driver 32.0.32029.2010, Ryzen 7 9800X3D, Windows 11 Pro 26200, Rust 1.100.0 MSVC, DXC 1.9.2602.17,
main1ec4c98, release (cargo test -p xcl --lib --release). Each run is the exact test alone in a fresh process,--test-threads=1 --nocapture,XCL_REQUIRE_GPU=wave64, default exchange (XCL_WAVE64_SPINunset). No skips.gpu_tests (bursty, about 2 % 3D use)The load shader is a local probe I did not commit; it is not an inference workload.
What an exchange timeout looks like. In the split form,
xcl_x_meet(emit.rs) polls the other half's arrival counter and gives up after1 << 20polls:xcl_x_deadis set and the other half's words read as 0. With that bound set locally to 0 (so the meet fails at once), the test fails the same way in 6 of 6 runs, in the first (split) leg, attests.rs:3803:Lanes 0–31 are right. Lanes 32–63 have
vccandexec24 too low ands[10:11]stuck at 8: the upper half never got the lower half's mask word (24 bits oflane & 3 != 0, 32 bits oflane < 40). A failure with this pattern is the timeout; one with other lanes or other differences is something else.How close normal runs come to the bound. With the bound read from a local environment variable (probe only):
1 << 20So here the other half has always arrived by the first poll, even under load, and the real bound leaves a margin of about a million polls. On this stack the timeout looks out of reach. I could not test RADV / vkd3d-proton, or a workload like local inference that runs compute queues next to the test.
If it fails again on the Linux rig, the full assertion text would tell whether it is this pattern. #872's phase labels would also show which leg failed.
Not tested: Linux / RADV / vkd3d-proton, an inference workload, debug builds for the load runs, the full suite.
AI use: Claude Code (Claude Opus 5.5) wrote the loops and the local probes, ran them on my PC and drafted this comment. I have not reviewed the code.
@KENAJBBY on GitHub · 2026-11-24 10:33 UTC · original
A run on RDNA2 and on an integrated GPU (memory shared with the CPU), native Windows: not reproduced at the default bound in 2,761 runs. With the bound lowered, a compute load on the same GPU makes the other half arrive a few polls late here, unlike on the RX 9070 XT above.
Machine: AMD Radeon Graphics iGPU
gfx1036(RDNA2, 1 WGP, native wave64) in a Ryzen 7 9800X3D, driver 32.0.21030.2001, 32 GB DDR5-4800 dual channel shared with the CPU, Windows 11 Pro 26200, Rust 1.100.0 MSVC, DXC 1.9.2602.17, release (cargo test -p xcl --lib --release). The PC also has an RTX 5070 Ti;XCL_ADAPTER=radeonpicks the iGPU. Built atmain077ce40;emit.rsandtests.rshave not changed since, up to6efdabc.Each run is the exact test alone in a fresh process (the built test binary with
--exact gpu::recomp::tests::gpu_geometry_wave32_prefix_count_over_a_mask --test-threads=1 --nocapture),XCL_ADAPTER=radeon,XCL_REQUIRE_GPU=wave64,XCL_WAVE64_SPINunset. No skips.Default bound (
1 << 20)gpu_tests (iGPU 3D about 2 %)gpu_test loops (3D about 88 %, compute about 100 %)The load scripts are local probes I did not commit. The GPU load is OpenCL through the AMD driver, so it runs on a compute queue next to the test's direct queue. It is not an inference workload. The 8-process RAM series stopped at 441 because the PC hard-reset. This machine has done that before, and it is not a test failure.
How close the runs come to the bound here. The bound is read from a local environment variable (probe only). Each cell is failed / runs:
gpu_loopsOn the RX 9070 XT the other half was always there by the first poll, even under load. Here a compute load on the same GPU delays it by a few polls, and a memory-bandwidth load on its own does not. With every load I tried, 16 polls were always enough, so the default bound leaves a margin of about 65,000×.
The bound in time. I made a second local change that raises
needout of reach, so the other half never arrives. The split leg then spins to the bound once. The test takes 0.57 s (median of 20) with the bound at1 << 20against 0.49 s with it at 0, and 0.60 s against 0.51 s under 1 OpenCL process.2^18polls add about 30 ms, the same order. So on this iGPU1 << 20polls take about 80–90 ms, about 0.08 µs per poll. For a timeout at the default bound, one wave32 half of the 64-thread group has to fall that far behind the other. Here, under load, the gap was a few polls, about 1 µs.Two shapes of the same failure. Every failure whose output was saved was at
tests.rs:3803in the split leg. All of them ran with the bound at 4 or less, or with the never-arrive change. Each had one of two shapes:vccandexec24 too low ands[10:11]stuck at 8 in lanes 32–63). 290 failures had this shape, including all forced ones.s[10:11]is wrong in lanes 32–63, andvccandexecare right. 41 failures had this shape, all of them under load with the bound at 1 or 4: B fits a timeout at the exchange of thev_cmpintos[10:11], after the earlier exchanges made it.execis exchanged at the start, and the savedexecis computed from the wholevccandexec. So a captured failure with onlys[10:11]wrong in lanes 32–63 is this timeout too.The timeline is consistent with this. #798 made the bounded spin the default for one-wave64 groups like this test's, which met through
GroupMemoryBarrierWithGroupSync()(no timeout) before. It was merged at 05:57 UTC, just beforebeaa245, the first commit with failures in the issue body. The clean commits named there (d5442d2,e50836b) do not contain it. The later 0 / 40 and 0 / 19 at and afterbeaa245show that load still matters. A cheap check on the Linux rig: rerun under the load that failed withXCL_WAVE64_SPIN=0(group barriers, no timeout). If it never fails that way and still fails with the default, the timeout is the cause.Not tested: Linux / RADV / vkd3d-proton, RDNA3, an inference workload, a D3D12 compute-queue load (mine was OpenCL), debug builds, the full suite.
AI use: Claude Code (Claude Opus 5.5) wrote the loops, the load scripts and the local probe changes, ran them on my PC and drafted this comment. I have not reviewed the code.
@AlexandreSchuelter on GitHub · 2026-11-24 10:57 UTC · original
Not reproduced on a discrete RDNA2 card (native Windows): 0 failures in 750 fresh-process runs.
Tested
mainat67a3735stable-x86_64-pc-windows-msvc, release; DXC 1.9.2602.17 (Windows SDK 10.0.26100)XCL_NETWORK=0,XCL_REQUIRE_GPU=wave64(the test runs, not SKIPPED)<xcl lib test exe> gpu::recomp::tests::gpu_geometry_wave32_prefix_count_over_a_mask --exact --nocapture --test-threads=1; a run counted as passed only when it printed1 passedXCL_WAVE64_SPIN=0Load: two concurrent loops of the other GPU tests in the same binary (
gpu_ --skip wave32_prefix_count --test-threads=8, 94 tests, ~4.2 s per pass) for the whole window.Not tested
xcl_x_meetboundAI use: Claude Code (Claude Opus 5.5) installed the toolchain, ran the loops and wrote this report; the runs are real, on the hardware above.
@SzczepanGrela on GitHub · 2026-11-24 11:41 UTC · original
Reproduced on Linux / Mesa RADV +
vkd3d-proton(66 / 80 failed under Vulkan async compute load, 0 / 80 withXCL_WAVE64_SPIN=0), on the same physical RX 9070 and exact same release binary that passed 290 / 290 on native Windows 11.RADV_DEBUG=spirvandRADV_DEBUG=shadersshow the cause: Mesa NIR lowersInterlockedAdd(shared, 0u, c)to a read-only@load_shared (access=atomic)and eliminates the loop-body poll, leaving zero LDS reads insidexcl_x_meet()'s1 << 20spin loop.Setup. AMD Radeon RX 9070 (RDNA4 /
GFX1201, native wave64, 15.81 GiB VRAM), Ryzen 7 7700, 31.4 GiB RAM (dual-boot). Exact same binary frommain1ec4c98(xcl-331cdc890787b29f.exe, release MSVC, DXC/DXIL1.9.2602.17), one fresh process per run (gpu::recomp::tests::gpu_geometry_wave32_prefix_count_over_a_mask --exact --test-threads=1 --nocapture),XCL_REQUIRE_GPU=wave64,XCL_NETWORK=0, no skips.26200, AMD driver32.0.32029.2010,rustc 1.100.0MSVC.7.3.0-5-cachyos, Mesa26.2.5-arch3.1(radv, Vulkan1.4.354),GE-Proton11-12(Wine Staging 11.0 +ntsync),vkd3d-protonv3.1-1-g8293130eb, DXVKv3.1.1-174-gf8637768.XCL_WAVE64_SPIN1)1)gfxqueue (6.5 ms dispatches, 32 KiB LDS, 1 GiB VRAM)1)asynccompute queue (same 6.5 ms shader, 32 KiB LDS, 1 GiB VRAM)1)async6.5 ms load0async+gfx, ~83 ms dispatches, 32 KiB LDS, 12 GiB VRAM)1)0All 66 failures panicked at
crates\xcl\src\gpu\recomp\tests.rs:3803:9with the two timeout shapes posted above: 53 shape A (vcc,s[10:11],execwrong in lanes 32-63) and 13 shape B (onlys[10:11]wrong in lanes 32-63), 0 other shapes.Why it fails on RADV. In
emit.rs:5428-5433,xcl_x_meet()polls withInterlockedAdd(XCL_XC(...), 0u, c). DXC peels iteration 0 before the loop, sovkd3d-protonemits twoOpAtomicIAddops with value0andNone(Relaxed) memory semantics (%183before the loop,%225inside it inRADV_DEBUG=spirv). Mesa26.2.5NIR lowers both to@load_shared (%41) (base=32756, access=atomic)and eliminates the loop-body load, reusing the pre-loop result for all1 << 20iterations (verified at all three exchanges in the split shader:-32,-64,-96). In the generated RDNA4 ISA,ds_load_b32runs once before the loop and the loop body has no LDS read:Why queue type matters. Standalone
1 << 20LDS reads take36.8 mson this card under RADV (44.98 mson Windows 11), but the hoisted loop effectively has a bound of 1 poll. Idle (20/20) andgfx-only load on queue family 0 (20/20, matching @Abuudiii's20/20under Vulkan scaling on the same RX 9070 + Mesa26.2.5) serialize on the GFX ring withxcl's D3D12 DIRECT queue, so both wave32 halves start together and the single pre-loop read succeeds. Anasynccompute queue (family 1, like local LLM inference or the 6.5 ms burner above:29/30failed) runs waves concurrently on the WGPs, so small arrival skew misses the single read and spins out to timeout.Fix check (standalone compiler tests only). A minimal peeled GLSL compute shader with
atomicAdd(xc[1], 0u)reproduces the same NIR elimination on Mesa26.2.5(one pre-loopds_load_b32,14.8 msregister spin). Checking two options in bothdxc.exe 1.9.2602.17 -T cs_6_6(DXIL) and standalone GLSL -> Mesa26.2.5RADV (RADV_DEBUG=shaders):InterlockedCompareExchange(XCL_XC(...), 0u, 0u, c)(atomicCompSwap(xc[1], 0u, 0u)): DXC emitscmpxchg ... i32 0, i32 0 seq_cstin the loop; Mesa NIR keeps@shared_atomic_swap(ds_cmpstore_rtn_b32) inside the loop (43.8 ms).GroupMemoryBarrier()(memoryBarrierShared()) inside the loop beforeInterlockedAdd: DXC emits@dx.op.barrier(i32 80, i32 8)+atomicrmw add ... 0in the loop; Mesa NIR keepsds_load_b32inside the loop (42.6 ms).(No local game files for
smoke.ps1, so no runtime PR opened.)Not tested: RX 7900 XT (RDNA3), a real local LLM workload, end-to-end build of
xclwith modifiedemit.rs, or retail game titles.AI use: Antigravity (Gemini 4 Neon) wrote the local Vulkan stress/benchmark harness, ran the Linux/RADV matrix and
RADV_DEBUGdumps on my machine, inspected the SPIR-V/NIR/ISA output, and drafted this comment; I reviewed the results before posting.@SlopTart on GitHub · 2026-11-24 14:36 UTC · original
Correction + sharpening of this flake log, because the forced-split axis re-behaved under controlled re-testing today.
The red/green flips in this thread's later runs were partly a mode mismatch, not time of day: on this RDNA3 rig (native wave64 hardware) the cluster fails deterministically with
XCL_SPLIT_WAVE64=1 --test-threads=1and passes without the env var. Today's forced runs:47efa2e:waves_diverge,local_and_exchanged_masks,masks_read_wholeall 3/3 FAILED (matches this morning's 0/3 + 0/6 floor, same commit).b8b1f49(current main):waves_diverge3/3 ok,lane_local_masks3/3 ok, butlocal_and_exchanged_masks+masks_read_wholestill 3/3 FAILED.And the axis part that matters: five independent runs on #1193 today, all NVIDIA wave32 parts (Blackwell/Ampere/Turing, one via Linux+vkd3d-proton), report these same tests fully green, including a 745 passed / 0 failed full-workspace run on Ampere where split-wave64 emulation is the only path. So this cluster does not reproduce on real wave32 hardware at all; it reproduces on native wave64 hardware with the split path forced, deterministically at 3/3.
Implication for the cure-chasing PRs (#1090, #1111, #1126, #1193, #1244): validate on an AMD forced-split rig, not NVIDIA - NVIDIA passes with the bug still present. Failure signature on our side is
ds_bpermutevalue loss (got 0, expected 65 at group 0 thread 96 onwaves_diverge). Green runs on NVIDIA cannot clear any of these PRs against this cluster.Counts only, no game data. Machine: RX 7900 XT (RADV NAVI31), Mesa 26.2.5, kernel 7.2 (Arch), Proton Experimental (wine-11.0), patched vkd3d-proton v3.1, release profile. My Linux rows: #42 / #718.
AI use: Hermes agent (local Qwen-class) ran the suite and drafted this; I checked it before posting.
@SzczepanGrela on GitHub · 2026-11-24 14:55 UTC · original
@SlopTart PR #1244 (
71d3a38) has already been tested on AMD + Mesa26.2.5withXCL_SPLIT_WAVE64=1(RX 9070 / RDNA4): https://github.com/ivall/xcl/pull/1244#issuecomment-7133597024. All four failinggpu_split_wave64_*tests went from0/5onmainto3/3idle and10/10under async compute load (0/146total under load), withds_cmpstore_rtn_b32confirmed inside the spin loop inRADV_DEBUG=shaders.The difference between NVIDIA Linux (
vkd3d-proton) and AMD Linux fits NVIDIA's proprietary Vulkan compiler vs Mesa NIR (which hoistsInterlockedAdd(..., 0u, c)out ofxcl_x_meet()on RADV, while Windows AMD Adrenalin and NVIDIA keep the poll in the loop) rather than wave32 vs wave64 hardware. A confirmation of #1244 on your RX 7900 XT (RDNA3) would still be useful to close the loop on RDNA3.AI use: Antigravity (Gemini 4 Neon) drafted this reply from our #1244 test results; I reviewed it before posting.
@SlopTart on GitHub · 2026-11-24 17:58 UTC · original
Floor update for this issue on current main
9e3831e1, now that the split tests were renamed to thegpu_split_wave64_*family (from merged #67/#94). This is the first report of that family on a native wave64 card forced into split mode; the NVIDIA rows are all green natively.XCL_SPLIT_WAVE64=1,--test-threads=1, RX 7900 XT (native wave64):The failing set is not stable across runs (that is itself a signal:
gpu_split_wave64_masks_read_whole_after_partial_writesfails 3/3;gpu_split_wave64_local_and_exchanged_masks_in_diverging_waves2/3 with left157right164;gpu_split_wave64_waves_diverge1/3;gpu_split_wave64_cross_half_operationsalso seen red in a separate control run). Onlygpu_split_wave64_lane_local_masksis green every run. A flaky composition points at mask state leaking between halves rather than one deterministic translation bug.Counts only, no game data.
Machine: RX 7900 XT (RADV NAVI31), Mesa 26.2.5, kernel 7.2 (Arch), Proton Experimental (wine-11.0), patched vkd3d-proton v3.1, release profile. See my Linux rows in #42 / #718.
AI use: Hermes agent (local Qwen-class) ran the suite and drafted this; I checked it before posting.
@SlopTart on GitHub · 2026-11-24 18:29 UTC · original
Follow-up to my floor comment above: same main
9e3831e1, still forced split mode, but each failing test run solo in its own process (--exact, 3 runs each). This separates "the test itself is broken" from "state leaks between tests in one process":gpu_split_wave64_masks_read_whole_after_partial_writes: FAILED 3/3 solo, deterministicgpu_split_wave64_local_and_exchanged_masks_in_diverging_waves: FAILED 2/3 solo, self-flaky (same157vs164delta)gpu_split_wave64_waves_diverge: ok 3/3 solo, yet it went red inside the family run above: only fails after the other split tests have run in the same processSo two of the three are genuine single-test bugs on native-wave64 hardware in split mode, and
waves_divergeis a cross-test state leak: something in the earlier split tests leaves mask state behind that flips a otherwise-green test. Both signals point at half/mask bookkeeping not being reset per program, consistent with the mask-semantics theme of this issue.Counts only, no game data. Same machine: RX 7900 XT (RADV NAVI31), Mesa 26.2.5, Proton Experimental (wine-11.0), patched vkd3d-proton v3.1, release profile.
AI use: Hermes agent (local Qwen-class) ran the suite and drafted this; I checked it before posting.
@SlopTart on GitHub · 2026-11-24 18:46 UTC · original
Found the source of the unstable composition reported above:
gpu_split_wave64_cross_half_operationsis the polluter.Order-pair runs on the same commit, forced split mode, 2 runs per pair:
waves_divergeafterlocal_and_exchanged_masks_in_diverging_waves: ok, okwaves_divergeaftermasks_read_whole_after_partial_writes: ok, okwaves_divergeaftercross_half_operations: FAILED, FAILEDwaves_divergesolo: ok 3/3 (from the previous comment)cross_half_operationssolo: FAILED 2/2 (a genuine single-test failure too)That also explains the shifting family results: alphabetical order inside one process puts
cross_half_operationsfirst, sowaves_divergeonly goes red in the family run, andmasks_read_whole/local_and_exchangedfail on their own merits regardless of order.Summary for this axis: 3 broken split-mode tests on native wave64 hardware (
cross_half_operations,masks_read_whole_after_partial_writes,local_and_exchanged_masks_in_diverging_waves), plus one cross-test state leak fromcross_half_operationsthat flips an otherwise-greenwaves_diverge.Counts only, no game data. Same machine and stack as my comments above.
AI use: Hermes agent (local Qwen-class) ran the suite and drafted this; I checked it before posting.