Skip to content

Translator: --lds-wave-order (opt-in) orders LDS exchange between lanes of one wave with subgroup barriers - #2345

Open
AlxcBTW wants to merge 5 commits into
ItsNotRexed:mainfrom
AlxcBTW:lds-wave-order-v3
Open

AlxcBTW wants to merge 5 commits into
ItsNotRexed:mainfrom
AlxcBTW:lds-wave-order-v3

Conversation

@AlxcBTW

@AlxcBTW AlxcBTW commented Nov 22, 2026

Copy link
Copy Markdown
Contributor

This is #1608 rebased onto main as one commit, because a new merge round conflicted in tools/rdna2spirv.py. I rebased rather than merging main in, as asked for that file. The conflicts were "keep both": fit_shared_memory() from main and lds_order_setup() from here, plus the fixture count. Re-run on the rebased commit: test_translate and test_shader_checks 592 passed, 2 skipped; semantic test_lds_wave_order and test_wave64_halves OK.

Results carried over from #1608 and #1564, all pass:

Tester GPU Generation OS
@Itschotsch RTX 4090 Ada Linux
@dcastell1 RTX 5090 Blackwell
@bobcatchris Radeon Pro V540 RDNA1
@crastinator RX 6700 XT RDNA2
@zneel RX 9070 XT RDNA4
@josevictorp CPU —

Thanks to all of you.

What and why

Adds an opt-in translator option, --lds-wave-order off|on. The default is off, and output is unchanged. LEONIDA_LDS_WAVE_ORDER=1 turns it on for runtime/test/shaders/build.py. Claimed in #1218.

The problem: RDNA2 runs a wave in lockstep with an in-order LDS queue. Shaders therefore write LDS in one lane and read it in another with only s_waitcnt lgkmcnt(0), or nothing, in between. Reductions, prefix sums and transposes all do this. SPIR-V and the Vulkan memory model order nothing between two invocations without a barrier or an atomic. A compiler may reorder the accesses, and a GPU with independent thread scheduling may have the lanes of a subgroup at different instructions. Prior art, facts only: shadPS4 #5285 saw RADV reorder such reads.

What on does: a native compute or mesh shader (not --wave64-emulate) gets an OpControlBarrier Subgroup Subgroup AcquireRelease|WorkgroupMemory before an LDS access that conflicts with an earlier, still unordered one. "Unordered" means no s_barrier and no earlier subgroup barrier sits between them. The conflicting pairs are RAW, WAR, WAW, and atomic vs plain; atomic after atomic needs no barrier. The unordered set is a forward data flow over the blocks, so a loop-carried pair and a join are handled.

Where it emits nothing:

  • shaders without LDS;
  • ds_bpermute, ds_permute and ds_swizzle;
  • a read after a read;
  • after an s_barrier;
  • the emulate path;
  • blocks behind an SCC branch that may split a wave64 subgroup (scc_logic takes a lane's own bit for a 32-bit op on one half of a lane mask).

With on, the index records lds_wave_order, the number of barriers emitted. docs/design.md has the row, with the spec text quoted.

Tested

  • GPU tests: cs_lds_wave_exchange (wave32) and cs_w64x_lds_wave_exchange (wave64, including the other half) run 512 groups × 256 rounds of four dependent exchanges; every thread must store 0. The check.py lab on an RTX 5070 Laptop and a Radeon 880M passes on both, with the default and with LEONIDA_LDS_WAVE_ORDER=1.
  • lds_fuzz (seed 1, 100 programs, wave both), native and --emulate, on both GPUs: no mismatch.
  • tests/semantic/test_lds_wave_order.py (31 tests): barrier placement, no barrier where none is needed, default off unchanged vs on, the metadata, a loop-carried pair, a join, and the wave64 SCC exception.
  • test_translate + test_shader_checks + tests/semantic: 1705 passed, 2 skipped (ms_f16_pack). The nested-barrier test ran and wasn't skipped. Tools were llvm-mc and spirv-val. This run was on the pre-rebase base. After the rebase onto current main, the LDS, barrier-round and shader-check tests pass (88).
  • Byte identity: with off, all 137 test shaders are byte-identical to main.

Honest limits

  • The race did not reproduce in 100 runs per variant on an RTX 5070 Laptop and a Radeon 880M (wave32 and native wave64). The SPIR-V is racy by the memory model, but these drivers kept program order. The tests pass with and without the option, so they show no benefit, only that it is harmless on these GPUs. There was no measurable cost either.

  • Intel is untested. Nested barriers lose the device on Xe-LPG; see the "Workgroup barriers" row.

  • The spec is ambiguous.

    • SPIR-V 1.6 r2 says a Subgroup-scope OpControlBarrier in non-uniform control flow is "defined by the client API". The current text dropped that sentence.
    • I found no explicit Vulkan rule for a plain Subgroup barrier in divergent flow.
    • GLSL_EXT_split_barrier says Subgroup-scope barriers need not be in uniform control flow under Vulkan.

    Hence the wave64 SCC exception and the opt-in default. Quotes and links are in docs/design.md.

  • Not done: skipping the barrier when a lane provably reads only its own slot.

Checklist

  • docs/design.md row (rule, why, source, how tested)
  • No game data, no keys
  • Default output byte-identical

AI-assisted (Claude Code).

🤖 Generated with Claude Code

…es of one wave with subgroup barriers

Default off; output unchanged. With on, a native compute/mesh shader gets an
OpControlBarrier Subgroup (AcquireRelease|WorkgroupMemory) before an LDS access that
conflicts with an earlier unordered one (forward data flow over the blocks; none after
s_barrier, in the emulate path, or behind an SCC branch that may split a wave64
subgroup). Tests: cs_lds_wave_exchange, cs_w64x_lds_wave_exchange, tests/semantic/
test_lds_wave_order.py; docs/design.md row with the quoted spec text.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Rainmaker33

Copy link
Copy Markdown

Tested ce3f264 (the rebased head) on NVIDIA GeForce RTX 3090 (Ampere, subgroup 32..32), driver 610.88 (Vulkan 1.4.341), Windows 11 Pro 26300: pass. This is a desktop Ampere run, next to your RTX 5070 Laptop and 880M results, which came from before the rebase.

The PR's diff applied cleanly to main 4947579. VS 2022, Vulkan SDK 1.4.363.0, llvm-mc 21.1.8; runtime built from this PR with scripts\build_runtime.ps1; overlay layers off.

  • build.py + check.py, with LEONIDA_LDS_WAVE_ORDER off and on:
    • cs_lds_wave_exchange: ok in both modes (512 groups × 256 rounds).
    • cs_w64x_lds_wave_exchange: SKIP natively ("full 64-wide compute subgroups unavailable"), and also with LEONIDA_W64_EMULATE=1 ("the device can't run this shader at 64 lanes on request"). So only the wave32 exchange ran on this GPU.
    • 129 of 165 pass in all four runs (both modes, native and emulated). The two emulated failures are cs_w64x_partial and cs_w64x_partial_scmp, which main's check.py also fails under emulation on this GPU.
  • tools/lds_fuzz.py --seed 1: 50/50 that ran match natively, and 100/100 with --emulate; 0 mismatches.
  • tests/semantic/test_lds_wave_order.py: OK.

@gilangjavier

Copy link
Copy Markdown

Tested ce3f264 on two GPUs in one laptop, Windows 11, MSVC 19.44, Vulkan SDK 1.4.363.0, llvm-mc 21.1.8 (WSL Debian), VK_LOADER_LAYERS_DISABLE=~implicit~, GPU picked with LEONIDA_VK_DEVICE: pass, with the option off and on.

GPU, driver off (run_gpu_tests.py --filter lds_wave_exchange) on (LEONIDA_LDS_WAVE_ORDER=1 build.py + check.py)
AMD Radeon 680M (gfx1035, RDNA2), 25.10.30.14 both PASS, 512 groups x 64: 0 mismatches both ok
NVIDIA RTX 3050 6GB Laptop, 582.05 cs_lds_wave_exchange PASS; cs_w64x_lds_wave_exchange SKIP (32-wide), PASS with LEONIDA_W64_EMULATE=1 cs_lds_wave_exchange ok; cs_w64x_* SKIP (32-wide)

With the option on, index.json records lds_wave_order: 8 for each of the two shaders and each .spvasm has 8 OpControlBarrier; off, none.

One note for testers: scripts/run_gpu_tests.py calls the translator itself and does not read LEONIDA_LDS_WAVE_ORDER, so setting it there still tests the default (0 barriers in the output). The "on" path is only exercised through runtime/test/shaders/build.py. No game data involved. AI-assisted.

@smowlyy

smowlyy commented Nov 22, 2026

Copy link
Copy Markdown
Contributor

Tested ce3f264 on Windows 11 Home 26300. AI-assisted (Claude Code). One possible sighting of the race, with the option off, that I could not reproduce afterwards; everything else passes.

Hardware: AMD Ryzen 5 7600X; iGPU AMD Radeon(TM) Graphics (RDNA2, subgroup 32..64), AMD driver 24.10.24 (Vulkan driver 2.0.302); NVIDIA GeForce RTX 5060 Ti, driver 610.88 (subgroup 32..32). MSVC 14.44, Vulkan SDK 1.4.363.0, llvm-mc 21.1.8, Python 3.12.10. Test programs built at ce3f264. Implicit layers off. No game files.

The one failure. In the first whole-suite run on the Radeon, native wave64, LEONIDA_LDS_WAVE_ORDER unset (option off, the default), both new tests failed:

FAIL  cs_lds_wave_exchange       512 groups x 64: 898 mismatches (first at 23: got 0x00000065)
FAIL  cs_w64x_lds_wave_exchange  512 groups x 64: 30 mismatches (first at 277: got 0x00000020)

Every other test in that run passed. I then repeated them on the same build and GPU, with nothing else running on the GPU:

run option off option on (LEONIDA_LDS_WAVE_ORDER=1)
--filter lds_wave_exchange 23/23 pass, 0 mismatches 23/23 pass, 0 mismatches
whole suite 3/3 pass 3/3 pass

So that's 1 bad run in 27 with the option off, and 0 in 26 with it on. That's not enough to say the option fixed it: I can't rule out something else on this machine during that first run. It's the only time I've seen these tests fail. If it is the race, it shows on an RDNA2 iGPU with the 24.10.24 Windows driver, under the PR's default (off).

Everything else, python -I scripts/run_gpu_tests.py, whole suite:

device mode result
Radeon iGPU native 88/187, 97 skipped, the 2 failures above (first run only)
Radeon iGPU LEONIDA_W64_EMULATE=1 90/187, 97 skipped, 0 failed
RTX 5060 Ti native 140/187, 47 skipped, 0 failed (cs_lds_wave_exchange pass; cs_w64x_lds_wave_exchange skips, no 64-wide subgroup)
RTX 5060 Ti LEONIDA_W64_EMULATE=1 172/187, 15 skipped, 0 failed

Most of the Radeon skips are its 128-byte push-constant limit (#2048 isn't in this base).

  • python -m unittest discover -s tests/semantic: 2598 tests OK.
  • python -I tests/test_shader_checks.py: OK.

@TheHoracio

Copy link
Copy Markdown
Contributor

Tested ce3f2644 (the rebased head) on two AMD GPUs in one PC, both pinned with LEONIDA_VK_DEVICE, Windows 11 Pro 26300, AMD driver 26.10.1, MSVC 19.4x, Vulkan SDK 1.4.363.0, llvm-mc 21.1.8 (built with scripts\build_llvm_mc.ps1): pass.

  • RX 7800 XT (RDNA3 desktop, gfx1101, subgroup 32..64, LLPC, 32.0.32015.7029) and Radeon iGPU (RDNA2, subgroup 32..64, AMD's non-LLPC compiler, 32.0.21045.16010).
  • build.py with LEONIDA_LDS_WAVE_ORDER unset: 206 shaders translated, 206 pass spirv-val, no lds_wave_order in the index. With =1: 11 shaders get 49 barriers in total.
  • check.py, both modes on both GPUs: 161 of 165 pass, 4 skipped:
    • the three mesh fixtures build.py does not build;
    • ps_w64x_readlane, because neither device can require a 64-wide fragment subgroup.
  • cs_lds_wave_exchange and cs_w64x_lds_wave_exchange are ok in both modes on both GPUs. These are native wave64 runs, so the cross-half exchange ran, which the RTX 3090 run above had to skip.
  • tools/lds_fuzz.py --seed 1 --programs 100 --wave both:
  • python -m unittest discover -s tests/semantic: 2598 OK, including test_lds_wave_order (31) and test_wave64_halves (57).

Like your runs, no race showed up without the option on either AMD part, so this shows that it does no harm on RDNA2/RDNA3 with the AMD Windows driver, not that it fixes anything there. Synthetic shaders only. AI-assisted.

@AlxcBTW

AlxcBTW commented Nov 22, 2026

Copy link
Copy Markdown
Contributor Author

@smowlyy, thank you. That's the first time anyone has seen these tests fail: 898 and 30 mismatches on an RDNA2 iGPU with the older 24.10.24 driver, option off, in a whole-suite run, i.e. with other work on the GPU. It also fits the mechanism: under load, waves of a workgroup are more likely to be split across SIMD slots and rescheduled. One run in 27 isn't proof, as you say, but it's the only failing data point anyone has.

If you have time, a stress run could tell the two apart. Loop only the two tests many times, with the option off and then on, while something else keeps the iGPU busy (a second run_gpu_tests.py in another shell, or any 3D load):

for /L %i in (1,1,200) do python -I scripts\run_gpu_tests.py --filter lds_wave_exchange >> off.txt
set LEONIDA_LDS_WAVE_ORDER=1
for /L %i in (1,1,200) do python -I scripts\run_gpu_tests.py --filter lds_wave_exchange >> on.txt

Then findstr /c:"FAIL" off.txt on.txt. Failures only in off.txt would be real evidence for making the option the default on AMD's older driver. Failures in both would point to something else.

@TheHoracio, thanks for the RX 7800 XT and RDNA2 runs. The cross-half exchange ran natively on both and passed in both modes.

AI-assisted (Claude Code).

@AlxcBTW

AlxcBTW commented Nov 22, 2026

Copy link
Copy Markdown
Contributor Author

What the AMD driver makes of the subgroup barrier, measured on the ISA. Earlier I'd seen an unaudited report that AMD's Windows driver lowers a Subgroup-scope OpControlBarrier to s_barrier, a workgroup barrier that would pair with other waves' barriers. I checked it on the Radeon 880M (AMD 26.11.2, LLPC) with VK_KHR_pipeline_executable_properties, dumping the driver's ISA. That's 54 pipelines: 6 variants × workgroup 32/64/256 × required subgroup size default/32/64.

  • No s_barrier, at any size. This covers a Subgroup control barrier in uniform flow, the same inside a divergent if, and a Subgroup OpMemoryBarrier. All of them compile with no s_barrier and no extra s_waitcnt. The barrier's only effect is that the compiler can't hoist the ds_load above the ds_store, which is exactly the ordering this option is for. At workgroup 64 with subgroup size 32, which is this PR's case:
    ds_store_b32 v0, v2
    ds_load_b32 v1, v1
    s_waitcnt lgkmcnt(0)
    
  • Control: a Workgroup barrier emits s_barrier only when the workgroup spans more than one wave, as expected.
  • This PR's cs_lds_wave_exchange translated with --lds-wave-order on (8 subgroup barriers): no s_barrier in the ISA. Without the option, the same shader also has none, but the compiler fully unrolls and reorders the loop (64 ds_ instructions against 16), so it is free to move LDS accesses around.
  • No hang: a subgroup barrier inside a branch that only some waves of a 256-wide workgroup take finished every run with 0 mismatches, on the 880M and on the RTX 5070 (621.24). NVIDIA returns no ISA text, so there I only have the run results.

So on this AMD driver the option costs nothing at run time and orders exactly what it should. That's one driver version on one GPU, and I haven't checked other AMD drivers.

@smowlyy, this also makes your one failing run on the 24.10.24 driver more interesting: without the barrier, that compiler is free to reorder.

AI-assisted (Claude Code). No game files.

@TheHoracio

Copy link
Copy Markdown
Contributor

@AlxcBTW, @smowlyy: I ran the stress test you asked for on both of my AMD GPUs: 0 failing runs in 3,200.

Setup:

  • The same ce3f2644 SPIR-V build.py made for my run above (option off, and LEONIDA_LDS_WAVE_ORDER=1).
  • vk_compute_test <spv> 512 zero64 called directly, the way check.py calls it: VKC_SUBGROUP_SIZE=32 for cs_lds_wave_exchange, --require-wave64 for cs_w64x_lds_wave_exchange. This is one launch per run, without a shader rebuild in between.
  • 200 runs for each test × mode × condition.
  • "Loaded": a second thread looped the whole check.py suite (165 shaders) on the same GPU the whole time.
  • The GPU was pinned with LEONIDA_VK_DEVICE.
GPU condition off, cs_lds_wave_exchange off, cs_w64x_lds_wave_exchange on, cs_lds_wave_exchange on, cs_w64x_lds_wave_exchange
Radeon iGPU (RDNA2, 32.0.21045.16010) idle 0/200 0/200 0/200 0/200
Radeon iGPU loaded (5 suite runs alongside) 0/200 0/200 0/200 0/200
RX 7800 XT (RDNA3, 32.0.32015.7029) idle 0/200 0/200 0/200 0/200
RX 7800 XT loaded (5 suite runs alongside) 0/200 0/200 0/200 0/200

Each cell is failing runs out of 200. Every run reported 0 mismatches, and there were no harness errors.

This does not contradict @smowlyy's single sighting. That was a different driver branch: Windows AMD 24.10.24 (Vulkan 2.0.302) on a Ryzen 5 7600X iGPU, while both of my GPUs run 26.10.1. It also happened under a whole-suite rebuild, which my loop did not reproduce exactly. If the race is real, it hasn't shown on 26.10.1 on either RDNA2 or RDNA3, so a 200+200 loop on the 24.10.24 machine is still the run that would settle it. Windows 11 Pro 26300. Synthetic shaders only. AI-assisted.

# Conflicts:
#	docs/design.md
#	tools/rdna2spirv.py
@AlxcBTW

AlxcBTW commented Nov 22, 2026

Copy link
Copy Markdown
Contributor Author

main is merged in (d900d526). The tools/rdna2spirv.py conflict is resolved by keeping both: lds_wave_order() next to main's new cur_either line, and both design.md rows. Rebasing again would need a force-push, which I can't do, so this is a merge. I'm happy for it to be squash-merged. test_translate, test_shader_checks and test_docs_links give 621 passed and 4 skipped; semantic test_lds_wave_order and test_wave64_halves are OK.

AI-assisted (Claude Code).

# Conflicts:
#	tests/test_shader_checks.py
#	tools/rdna2spirv.py
# Conflicts:
#	docs/design.md
#	tests/test_shader_checks.py
#	tools/rdna2spirv.py
@TreXito

TreXito commented Nov 23, 2026

Copy link
Copy Markdown
Contributor

Tested bf1a2d7c on NVIDIA GeForce RTX 3060 Ti (Ampere, subgroup 32..32), driver 580.173.02, Linux (kernel 6.18), Khronos validation layer 1.4.357. Two findings: one about the wiring, one about GPU-AV as a check.

1. scripts/run_gpu_tests.py ignores LEONIDA_LDS_WAVE_ORDER. Only runtime/test/shaders/build.py reads the variable. The harness builds its own translator command (step "2. Translate this run's inputs only"), and that command never gets --lds-wave-order on. So LEONIDA_LDS_WAVE_ORDER=1 python -I scripts/run_gpu_tests.py runs the default. Evidence: in that run, cs_lds_wave_exchange.spv is 14380 bytes with 0 OpControlBarrier, identical to the build without the variable. With the two lines below it is 14524 bytes with 8 OpControlBarrier %uint_3 %uint_3 %uint_264:

         cmd = [sys.executable, "-I", TRANSLATOR, selected_disasm, "--out", spirv_dir]
         if w64_emulated():   # wave64 compute/mesh exact on any subgroup size
             cmd.append("--wave64-emulate")
+        if os.environ.get("LEONIDA_LDS_WAVE_ORDER") == "1":   # subgroup barriers between LDS accesses of one wave
+            cmd += ["--lds-wave-order", "on"]

build.py + check.py runs are unaffected. Whole-suite run_gpu_tests.py runs with the variable set had the option off.

2. GPU-AV cannot check this option. VVL's shared-memory race pass only counts an OpControlBarrier with Workgroup scope as synchronization (shared_memory_data_race_pass.cpp L193-L201). It does not see Subgroup-scope barriers. So under VK_KHRONOS_VALIDATION_GPUAV_ENABLE=1, cs_lds_wave_exchange gets the same 6 race reports with the option off and on: loads in lanes 0-7 or 32-39, each against a neighbour lane's OpStore, over 3 direct runs. The words are exact either way.

Whole suite. Base: this head merged with #4025 (on #4005), #3347 and #4067, so the test programs honour LEONIDA_VK_VALIDATION. Harness fix applied for the "on" rows:

run suite cs_lds_wave_exchange
default 165/212, 47 skipped pass, 512 groups x 64: 0 mismatches
default + LEONIDA_VK_VALIDATION=1 165/212 pass
default + validation + GPU-AV 158/212 fail: 6 race reports, 0 mismatches
LEONIDA_LDS_WAVE_ORDER=1 165/212 pass, 0 mismatches, 8 subgroup barriers
=1 + validation + GPU-AV 158/212 fail: 6 race reports, 0 mismatches

No game files. AI-assisted (Claude Code).

…; note GPU-AV cannot check it

The harness builds its own translator command and ignored the variable, so
whole-suite runs with it set translated with the option off. Found by @TreXito
in review of ItsNotRexed#2345. GPU-AV's shared-memory race pass counts only Workgroup-scope
OpControlBarrier, so it reports the same races with the option off and on.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@AlxcBTW

AlxcBTW commented Nov 23, 2026

Copy link
Copy Markdown
Contributor Author

Thanks @TreXito, both findings were right.

1. Harness. I've pushed 0a7a52e2 with your fix: scripts/run_gpu_tests.py now adds --lds-wave-order on when LEONIDA_LDS_WAVE_ORDER=1. On the RTX 5070 with --filter cs_lds_wave_exchange, the translated shader is 14,380 bytes with 0 OpControlBarrier with the variable off, and 14,524 bytes with 8 with it on. That matches your numbers, and the test passes both ways (512 groups x 64, 0 mismatches). tests/test_run_gpu_tests.py and the related harness tests pass.

2. GPU-AV. The LDS row in docs/design.md now says that GPU-AV's shared-memory race check only counts Workgroup-scope barriers. It reports the same races in cs_lds_wave_exchange with the option off and on, so it can't check this option.

AI-assisted (Claude Code).

@evilclanker9000

Copy link
Copy Markdown
Contributor

Tested 0a7a52e on Windows 11 (MSVC BuildTools 2022, Ninja, RelWithDebInfo, -j 4; no Vulkan validation layer installed), one GPU at a time, device line confirmed: AMD Radeon RDNA2 iGPU (driver 26.10.1) and NVIDIA RTX 5080 (driver 616.92). Ran run_gpu_tests.py --filter lds_wave_exchange (the two new shaders), by default and with LEONIDA_LDS_WAVE_ORDER=1, plus pytest tests/semantic/test_lds_wave_order.py tests/test_shader_checks.py tests/test_translate.py (695 passed, 4 skipped for missing synthetic DXBC). Radeon (native wave64): cs_lds_wave_exchange and cs_w64x_lds_wave_exchange both PASS (512 groups x 64: 0 mismatches), 2/2, default and with the option on. RTX 5080: cs_lds_wave_exchange PASS (0 mismatches) both ways; cs_w64x_lds_wave_exchange SKIP (full 64-wide subgroups unavailable), PASS with LEONIDA_W64_EMULATE=1 (0 mismatches). No race was observed on either device. No game files.

AI-assisted.

@sperm

sperm commented Nov 23, 2026

Copy link
Copy Markdown

Tested 0a7a52e (a re-test at the new head) on AMD Radeon RX 9070 XT (RADV GFX1201, wave32/64) and the Ryzen 7 9800X3D iGPU (RADV RAPHAEL_MENDOCINO, gfx1036), Mesa 26.2.6, Linux 7.3.4: pass, no regressions.

No game files. AI-assisted.

@amarovndres

Copy link
Copy Markdown

Tested 0a7a52e2 on AMD Radeon RX 9060 XT (RDNA4, discrete, subgroup 32..64), AMD 26.10.1 (32.0.32015.7029, LLPC, Vulkan 1.4.359), Windows 11 Pro (build 26200): pass, in both modes.

  • scripts/run_gpu_tests.py (full suite; test programs, including this head's vk_compute_test zero64 mode, built with llvm-mingw; llvm-mc 23.1.6):
    • default: 198/212 passed, 14 skipped, 0 failed; cs_lds_wave_exchange and cs_w64x_lds_wave_exchange (native wave64): 512 groups x 64, 0 mismatches.
    • LEONIDA_LDS_WAVE_ORDER=1: 198/212 passed, 14 skipped, 0 failed; both exchanges 0 mismatches.
    • main d0835dd9 on the same machine: 196/210, the same 14 skipped, so nothing regresses.
  • tests/semantic/test_lds_wave_order.py: 31/31 OK; tests/test_shader_checks.py: 75/75 OK.

As expected on AMD, the exchange is already right without the barriers (a wave's lanes run each instruction together here), so this run shows the opt-in mode costs no correctness on RDNA4 rather than that it is needed; the discriminating runs are the 32-wide GPUs.

AI-assisted (Claude Code). Synthetic shaders only, no game files.

@bobcatchris

Copy link
Copy Markdown
Contributor

Tested 0a7a52e206fd9bf66df38e9ac5bba0e1b918af8a on AMD Radeon Pro V540 (RDNA1, Navi 12; RADV/Mesa 25.2.8-0ubuntu0.24.04.4, Ubuntu 24.04.4, Linux 7.0.0-31-generic, Vulkan 1.4.318). This box is described as gfx1012; tools/hw_oracle reports gfx1011 for this Navi 12 part. Cards pinned with DRI_PRIME=pci-0000_1c_00_0! and pci-0000_1f_00_0! (one process each).

  • Command: python3 -I scripts/run_gpu_tests.py --filter cs_lds_wave_exchange --build runtime/build/linux: 1/1 passed (512 groups x 64, 0 mismatches) on both cards, with the option off and again with LEONIDA_LDS_WAVE_ORDER=1.
  • Command: python3 -I scripts/run_gpu_tests.py --build runtime/build/linux: 184/212 passed, 26 skipped, 2 failed on both cards in both modes (216 shaders translated, 216 pass spirv-val). PR base 03b09a08 in a separate worktree with the same toolchain: 182/210 passed, 26 skipped, 2 failed — two extra passing tests, no regression from the opt-in path.
  • The two failures (cs_signed_zero_nan, cs_w32_salu64) are pre-existing with identical words on base.
  • Toolchain note: built with Khronos Vulkan-Headers 1.4.335 locally (-DVulkan_INCLUDE_DIR=...) because this head's vk_harness uses VK_KHR_pipeline_binary; Ubuntu 24.04's 1.3.275 headers cannot compile it. GCC 13.3.0, llvm-mc 21.1.8, SPIRV-Tools 2026.1.

Counts and pass/fail only; no game data. No code changes.

AI-assisted.

@MKS2508

MKS2508 commented Nov 23, 2026

Copy link
Copy Markdown

Tested 0a7a52e20 on AMD RX 5700 (RADV NAVI10), Mesa 26.2.3, Vulkan 1.4.357, NixOS (LLVM 21.1.8): pass

178/186 pass, 8 skipped. Both of this PR's shaders pass: cs_lds_wave_exchange and cs_w64x_lds_wave_exchange. Skips are environmental (mesh fixtures, VK_KHR_fragment_shader_barycentric).

RDNA1/RADV check claimed as SHADER-837 in #7049.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.