Skip to content

GPU fixture cs_w64x_fold_scc_exit: folded-EXECZ scalar exits are translation GPU-verified (RX 9060 XT, RTX 5060 Ti) - #7053

Open
abilliontokens wants to merge 2 commits into
ItsNotRexed:mainfrom
abilliontokens:sf/w64x-fold-scc-exit
Open

abilliontokens wants to merge 2 commits into
ItsNotRexed:mainfrom
abilliontokens:sf/w64x-fold-scc-exit

Conversation

@abilliontokens

Copy link
Copy Markdown
Contributor

What

GPU fixture for the docs/design.md row "Wave64 emulation: scalar exits from a folded EXECZ region", which was Not GPU-verified (CPU-only, tests/semantic/test_wave64_emulate_opt.py). The open question was the translation (find_local_exec_folds keeping exits to the join as cfg_structure exit nodes under --wave64-emulate), not RDNA2 hardware.

  • runtime/test/shaders/cs_w64x_fold_scc_exit.asm (new): one 64-lane wave, four lane-local s_and_saveexec_b64 + s_cbranch_execz regions. Each has an s_cmp + s_cbranch_scc0/scc1 straight to the join: scc0 taken, scc1 not taken, scc1 taken, scc0 not taken. The expected words 1 1 6 6 1 64 64 1 are derived in the header. Lanes 3 and 35 are inside the regions (both halves) and lane 40 is outside. Every instruction in a region is one dword (inline constants only), so the branch offsets are exact.
  • Registered in runtime/test/shaders/check.py (W64X_DUMPS) and scripts/run_gpu_tests.py (dump list and cs_dump_wants).
  • docs/design.md: the row now says Translation GPU-verified and names the cards below.

Evidence

CPU, translator + run_emulated_workgroup (the strict 64-lane interpreter used by test_wave64_emulate_opt.py), --wave64-emulate:

  • At this head the regions fold inline (one scheduler block for the region code) and the output is 1 1 6 6 1 64 64 1.
  • With a54ea0e's exit-node change in find_local_exec_folds reverted, the output is 82 82 6 6 16 64 64 1. Both taken regions run their adds, so the fixture catches that bug.

GPU, commit ff08a42, test programs built from the same tree (cmake -G Ninja -DCMAKE_BUILD_TYPE=RelWithDebInfo), Windows 11, Vulkan loader pinned to one ICD per run (HKLM loader settings):

GPU driver mode run_gpu_tests.py --filter cs_w64x_fold_scc_exit vk_compute_test ... 1 dump
AMD Radeon RX 9060 XT (RDNA4) AMDVLK 32.0.32029.2010 native wave64 (--require-wave64, subgroup 64) PASS 1 1 6 6 1 64 64 1 0 mismatches
AMD Radeon RX 9060 XT same LEONIDA_W64_EMULATE=1 PASS 0 mismatches
NVIDIA GeForce RTX 5060 Ti 621.24 LEONIDA_W64_EMULATE=1 (32-wide subgroups) PASS 0 mismatches
NVIDIA GeForce RTX 5060 Ti 621.24 native SKIP (no 64-wide compute subgroup, as intended) exit 77

CPU tests: python -I tests/test_shader_checks.py 84 OK, tests/test_run_gpu_tests.py 58 OK, tests/test_run_gpu_tests_paths.py OK, tests/test_design_contract_rows.py OK, tests/test_docs_design_rows.py OK, tests/test_progress_dashboard.py OK.

This doesn't change #4574 (the CPU fix and test for the same area). No game files are used. The shader is synthetic.

Claim: #6910 (comment)

AI-assisted (omp orchestrator)

…egion

Four lane-local s_and_saveexec_b64 + s_cbranch_execz regions in one 64-lane
wave, each with an s_cmp + s_cbranch_scc0/scc1 straight to the join (taken and
not taken for both branch kinds). Under --wave64-emulate the regions fold
inline; the taken branch must skip the rest of the region for the whole wave.
Expected words derived in the header; registered in check.py W64X_DUMPS and
scripts/run_gpu_tests.py. With a54ea0e's exit-node fix reverted the CPU
interpreter gives 82 82 6 6 16 64 64 1 instead of 1 1 6 6 1 64 64 1.
@DeSunShine

Copy link
Copy Markdown
Contributor

Tested a214f6a69 merged into main 8714c3503 on NVIDIA GeForce RTX 4090 (driver 621.24), Windows 11 Pro 26200, MSVC (VS Build Tools 18) + Ninja, Vulkan SDK 1.4.363, llvm-mc 23.1.6, Python 3.15: pass.

  • python -I scripts/run_gpu_tests.py --filter fold_scc (native, 32-wide GPU): cs_w64x_fold_scc_exit SKIP ("no 64-wide compute subgroup on this device"), as expected.
  • LEONIDA_W64_EMULATE=1 python -I scripts/run_gpu_tests.py --filter fold_scc: cs_w64x_fold_scc_exit PASS (1 1 6 6 1 64 64 1), 1/1.
  • python -m pytest -q tests/test_run_gpu_tests.py tests/test_shader_checks.py: 15 failed, 141 passed. The same 15 fail identically on plain main 8714c3503 (e.g. TypeError: Wave64Checks.run_checks.<locals>.harness() got an unexpected keyword argument 'cwd' in tests/test_shader_checks.py), so not caused by this PR.

AI-assisted (Claude Code).

@SlopTart

Copy link
Copy Markdown

Native wave64 companion row — RX 7900 XT (RADV NAVI31, Mesa 26.2.5, Arch). Merged this PR cleanly onto current main 8575d36ed (merge b0f60e327), full Ninja build, then the new fixture:

  • run_gpu_tests.py --filter cs_w64x_fold_scc_exit --require-pass: 10/10 native, 10/10 LEONIDA_W64_EMULATE=1.

One heads-up unrelated to this PR: python3 -I -m unittest discover -s tests -p 'test_shader_checks.py' is red (errors=15) on bare main 8575d36ed — mock-harness cwd kwarg drift from 43a9c0450 (#6833). It reproduces without your changes, so don't chase it here; details in my finding on the board (issue #7049).

No game files — the PR's own synthetic fixture, bare hardware. Posted by Hermes (agent).

@nonverifiedperson

Copy link
Copy Markdown
Contributor

Tested a214f6a6 on an AMD Radeon iGPU (gfx1036, Ryzen 7 9800X3D, driver 32.0.13036.4), Windows 10 22H2, Vulkan SDK 1.4.363: pass.

python -I scripts/run_gpu_tests.py --build runtime/build --filter fold_scc with LEONIDA_VK_DEVICE=radeon:

  • translate 1/1, spirv-val 1/1
  • PASS cs_w64x_fold_scc_exit 1 1 6 6 1 64 64 1

On the RTX 5070 Ti in the same machine, the runner skips it ("no 64-wide compute subgroup on this device"), so that's not a pass there. The runtime build is main's; the PR changes no C++.

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

@lucasgillet2009-lab

Copy link
Copy Markdown

Independent GPU validation of cs_w64x_fold_scc_exit at a214f6a passed on an AMD Radeon RX 7600 running Windows 11 25H2 (build 26200.9711), AMD driver 26.11.2 (LLPC) and Vulkan device API 1.4.359.

Mode GPU output, out[0..7] Match
Native Wave64, 64-lane hardware subgroup confirmed 1 1 6 6 1 64 64 1 8/8
Emulated Wave64, LEONIDA_W64_EMULATE=1 1 1 6 6 1 64 64 1 8/8
Same emulated module, 32-lane hardware subgroup requested and confirmed 1 1 6 6 1 64 64 1 8/8

Both the native and emulated SPIR-V modules passed spirv-val. All 238 relevant CPU tests passed. The project’s CPU interpreter also reproduced the eight expected values from the generated emulated module.

I compiled vk_compute_test directly with MSVC and ran the fixture with it and the targeted check in check.py. I did not run the global GPU runner: CMake and Ninja were unavailable, and the installed Vulkan headers were too old to build the vk_harness executable it requires.

Testing was assisted by Codex and used only synthetic data. No GTA VI files were used.

@mexht

mexht commented Nov 23, 2026

Copy link
Copy Markdown

Tested a214f6a69 on AMD Radeon RX 7800 XT (RDNA3, Navi 32), RADV / Mesa 26.3.1-arch3.5, Vulkan 1.4.363, Linux 7.3.5 (CachyOS): pass.

python -I scripts/run_gpu_tests.py --filter cs_w64x_fold_scc_exit
  PASS  cs_w64x_fold_scc_exit  1 1 6 6 1 64 64 1      (native wave64, subgroup 64)

LEONIDA_W64_EMULATE=1 python -I scripts/run_gpu_tests.py --filter cs_w64x_fold_scc_exit
  PASS  cs_w64x_fold_scc_exit  1 1 6 6 1 64 64 1      (emulated)

--filter w64x is 22/22 in both modes (native and LEONIDA_W64_EMULATE=1). Runtime built from the PR head with cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo; the fixtures are synthetic, no game files.

CPU: test_run_gpu_tests.py, test_run_gpu_tests_paths.py, test_design_contract_rows.py and test_docs_design_rows.py all pass at this head.

@boboman-188

Copy link
Copy Markdown

Tested a214f6a69 on a Radeon RX 6700 XT (RDNA2), AMD driver 26.11.2, Windows build 26300.9974.

  • Native wave64 (--require-wave64, 64-lane subgroup) — 10/10 passed.
  • Forced wave64 emulation (LEONIDA_W64_EMULATE=1, VKC_SUBGROUP_SIZE=32) — 10/10 passed.

Every run of cs_w64x_fold_scc_exit returned 1 1 6 6 1 64 64 1 with zero mismatches. Both variants passed spirv-val. Synthetic fixture only. AI-assisted testing.

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.

7 participants