Skip to content

TEST: w64_graphics skips fixtures that need many lanes on the measured live fragment width (Intel: 32 reported, 16 live) - #2998

Open
kapitche wants to merge 2 commits into
ItsNotRexed:mainfrom
kapitche:live-width-skip
Open

kapitche wants to merge 2 commits into
ItsNotRexed:mainfrom
kapitche:live-width-skip

Conversation

@kapitche

Copy link
Copy Markdown
Contributor

Claimed in the coordination issue as: #2891 (comment)

What and why

Some wave64 pixel fixtures read lanes that a fragment subgroup does not always have. The Intel UHD 770 (driver 32.0.101.6129, subgroup 8..32) reports gl_SubgroupSize 32 but only 16 invocations are live per fragment subgroup (ballot count 16, lane ids 0..15); a read of lane L ^ 16 returns garbage, which is what #2260's three permute fixtures hit. Neither "the size could not be required" nor the reported 8..32 range says that, and each skip written on that basis (#1585's ps_vcmpx_forms skip, #2260's TEST-433 skip) is both too broad and too indirect.

This adds a measurement and a hook, and changes no existing verdict:

  • runtime/test/shaders/ps_live_width.asm: a probe pixel shader that writes popcount(exec_lo) (the translator makes EXEC the subgroup ballot of live invocations) to mrt0.
  • w64_graphics.py: live_width() runs it through vk_harness with vs_ids and returns the largest word of the frame; NEEDS_LIVE_LANES = {fixture: lanes}; check() skips a listed fixture with a message naming the measured width when no size was required (64 or 32 applied) and the width is smaller, and judges it otherwise (also when the probe cannot run).
  • The dict is empty on main on purpose. I ran every merged tier A and B pixel fixture on the Intel at its default size and they all pass at 16 live lanes (ps_w64_a_skip, _a_one_lane, ps_w64_b_waterfall, _b_readfirstlane, _b_readlane_uniform, _b_ballot_atomic), so none of them should be skipped there.
  • TEST-319: GPU-check the wave64 graphics permutes on NVIDIA, and stop refusing lane-id bpermute addresses #2260's fixtures would add {"ps_w64_a_permlane": 32, "ps_w64_a_swizzle": 32, "ps_w64_a_bpermute": 32} and drop their _device_min skip. I did not touch that PR.

ps_vcmpx_forms does not need 32 live lanes. Its words are per-lane compares of uniform inputs, and its real cause on the Intel was the missing SignedZeroInfNanPreserve (#664); with that merged it passes 4096/4096 there at 16 live lanes. So it stays out of the list, and the width-based skip in check.py (vcmpx_forms_narrow_skip) is what #1718 removes.

Tested

Windows 11, RelWithDebInfo, w64_graphics.py, build dir from build.py:

measured live width main + this PR, fixtures not listed #2260 merged with main + this PR, its 3 permutes listed
RTX 4080 SUPER 32 all pass _a_bpermute, _a_permlane, _a_swizzle "A ok"
Intel UHD 770 16 _a_skip, _a_one_lane, _b_* pass (same as before) the three SKIP: "the fragment stage has 16 live lanes per subgroup here, measured with ps_live_width; this fixture needs 32"; _a_skip still ok

Without the listing (and before this change) the three permute fixtures fail on the Intel with the got words (1, 64, 4456512, 5242964) etc. from the finding on #2891.

python -I -m pytest tests/test_wave64_halves_fixtures.py (Python 3.12.16, Linux): 8 passed, 1 skipped. The new test fakes the draw and the probe: with width 16 the listed fixture skips and names the width, with 32 or an unavailable probe it is judged. Negative control: on main the test fails (no NEEDS_LIVE_LANES).

AI-assisted.

@Rainmaker33

Copy link
Copy Markdown

Tested 58e0e40 on NVIDIA GeForce RTX 3090 (Ampere, subgroup 32..32), driver 610.88 (Vulkan 1.4.341), Windows 11 Pro 26300: pass, and no change on NVIDIA, where all fragment lanes are live.

The PR's diff applied cleanly to main 1628210. VS 2022, Vulkan SDK 1.4.363.0, llvm-mc 21.1.8; harness programs from a CMake build of main; overlay layers off.

  • build.py + runtime/test/shaders/w64_graphics.py: 14 ok, 12 SKIP, 0 failures, identical line by line to main. The new skip doesn't trigger here, and the tier A/B fixtures still run.
  • I didn't run tests/test_wave64_halves_fixtures.py (it needs pytest, which isn't installed here).

@Doffi4

Doffi4 commented Nov 22, 2026

Copy link
Copy Markdown
Contributor

Independent Windows 11 (26200) test of 58e0e407. The translated ps_live_width probe reported 64 at all 4,096 pixels on Radeon 780M (26.11.2) and 32 at all 4,096 on RTX 5060 Laptop (621.01), with each ICD isolated and the device name confirmed. All six existing A/B pixel fixtures passed via w64_graphics.py on both GPUs, and all eight input modules passed spirv-val. This is additional AMD/NVIDIA coverage of the probe and existing verdicts. The below-required-width skip itself was not exercised on these cards. Synthetic inputs only. AI-assisted testing and reporting.

@Rossrocha

Copy link
Copy Markdown

Tested 58e0e40 (with #2997 also merged) onto main 1628210 on AMD Radeon RX 6600 (RDNA2, Navi 23, subgroup 32..64), AMD proprietary 26.11.2 (Vulkan 1.4.315), Windows 11 Pro 10.0.26300: pass. This adds the AMD side next to the NVIDIA and Intel rows.

  • ps_live_width measured through w64_graphics.live_width(): 64. The AMD Windows driver runs this pixel shader wave64 with every lane live, so no wide-lane fixture would be skipped here.
  • build.py: 215 shaders, 215 translated, 215 pass spirv-val
  • w64_graphics.py <out> runtime\build, exit 0: every tier A and B fixture ok (gs_w64_a_ring; ps_w64_a_bpermute, _a_one_lane, _a_permlane, _a_skip, _a_swizzle; ps_w64_b_* x4; vs_w64_a_skip; vs_w64_b_* x3)
  • Tier C (12 fixtures): SKIP "tier C needs a device that can require both 64 and 32, or W64G_REF". This driver lists only SHADER_STAGE_COMPUTE_BIT in requiredSubgroupSizeStages, so fragment and vertex sizes can't be required. Tier C needs a saved reference here.

AI-assisted (Claude Code): it merged the PRs, built them, ran the probe and the fixtures, and wrote this comment.

@javdc

javdc commented Nov 22, 2026 •

Copy link
Copy Markdown

Tested 58e0e40 on Steam Deck LCD (Jupiter), AMD Custom GPU 0405 "Van Gogh", RADV Mesa 26.2.0-devel (git-5c65d4fc31), Vulkan 1.4.350, SteamOS 3.9.5 (holo), kernel 7.2.7-valve2-2-neptune-72-g31504582a073: no unintended skips/regressions observed on this RADV Deck; w64_graphics GPU run inconclusive due to pre-existing 64-lane PS/GS harness crashes.

Unit tests:

  • python3 -m pytest tests/test_wave64_halves_fixtures.py -q — 8 passed, 1 skipped

w64_graphics (built 27 fixtures including ps_live_width, ran from PR worktree against main runtime build):

  • python3 runtime/test/shaders/w64_graphics.py <work> /home/deck/opencode/Leonida/runtime/build — VS w64 fixtures: 6/6 ok (vs_w64_a_skip, vs_w64_b_ballot_atomic, vs_w64_b_readlane_uniform, vs_w64_b_waterfall, vs_w64_c_bcnt_export, vs_w64_c_lane_id, vs_w64_c_readlane); all GS/PS 64-lane runs exited -11 on this Deck. Same 64-lane GS/PS exit -11 observed on main with the same fixture/build setup, so not a regression from this PR. No new live-width skips triggered on this RADV device.

AI-assisted (OpenCode).

@crastinator

Copy link
Copy Markdown
Contributor

Tested 58e0e40 merged into main 16282101 on an AMD Radeon RX 6700 XT, RADV Mesa 26.3.1, Linux. w64_graphics.py works: live_width() measures 64 live lanes per fragment subgroup on RDNA2 under RADV, and all 26 fixtures it runs pass. But scripts/run_gpu_tests.py fails the new probe on any GPU (FAIL ps_live_width no checker defined), because it takes every .asm fixture.

@kapitche I've opened kapitche#1 against your branch (crastinator:live-width-runner). It adds ps_live_width to run_gpu_tests.py's OTHER_HARNESS as run by w64_graphics.py, so it's translated but reported as SKIP. With it, the suite is 175/190 with no failures, native and emulated.

AI-assisted (Claude Code).

@smowlyy

smowlyy commented Nov 22, 2026

Copy link
Copy Markdown
Contributor

Defect at 58e0e40: scripts/run_gpu_tests.py now fails on every device that can run the new probe, because it judges ps_live_width like a fixture and finds no checker.

To reproduce (Windows 11, NVIDIA RTX 5060 Ti, driver 610.88; test programs built at 58e0e40 with scripts\build_runtime.ps1):

python -I scripts/run_gpu_tests.py --filter ps_live_width
  FAIL  ps_live_width         no checker defined
0/1 passed   (exit 1)

The whole suite gives the same FAIL with and without LEONIDA_W64_EMULATE=1 (142/190 and 173/190 there, the other failure being ps_sdwa_f16_const, which also fails on main). On the AMD Radeon iGPU (RDNA2, driver 24.10.24) it's only hidden, because the probe skips for the 128-byte push-constant limit.

Cause: run_suite takes every runtime/test/shaders/*.asm and leaves out only w64_graphics.FIXTURES (line 659). ps_live_width is a probe that w64_graphics.live_width() draws itself ("no expected words" in its header). It isn't in FIXTURES, check.py or OTHER_HARNESS, so it reaches "no checker defined" (line 1206). Leaving it out next to the W64_GRAPHICS_ONLY filter, or giving it a skip line like the run by ... fixtures, would keep the suite green. A tests/test_run_gpu_tests.py check that every .asm either has a checker or is excluded would catch the next one.

AI-assisted (Claude Code). AMD Ryzen 5 7600X, Windows 11 Home 26300, Vulkan SDK 1.4.363.0, llvm-mc 21.1.8, Python 3.12.10. No game files.

@Kam471 Kam471 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verified on the PR head: tests/test_wave64_halves_fixtures.py -> 8 passed, 1 skipped (no llvm-mc here). The skip uses live_width() from the probe's max mrt0 word (an EXEC ballot), not gl_SubgroupSize; an unknown probe is judged, never skipped, and full-width devices still run their lanes. python -I -m pytest tests -q --ignore=tests/semantic -> 4,664 passed, 660 skipped, 6,494 subtests, 1 failed; the one failure is the pre-existing test_report_paths.py::MacVolumeTests also present on the other tree. No game data or absolute paths. Approve.

Nits: the skip path is exercised only by a monkeypatched test and no fixture is gated yet (NEEDS_LIVE_LANES = {} is intentional in the body); ps_live_width.spv is built but not in FIXTURES.

… fragment width (ps_live_width), not the reported subgroup size
@kapitche

Copy link
Copy Markdown
Contributor Author

Rebased onto main 03b09a0; w64_graphics.py conflicted with #2260's TEST-433 _device_min skip (docstring, a variable, and the check() skip); kept both, so main's skip is unchanged and the NEEDS_LIVE_LANES hook sits after it; tests: tests/test_wave64_halves_fixtures.py 9 passed, 1 skipped (Python 3.12.16, Linux).

@Vonsek

Vonsek commented Nov 23, 2026

Copy link
Copy Markdown
Contributor

Tested d76b715 on Windows 11 (llvm-mc, spirv-tools; no Vulkan validation layer installed), one GPU at a time, device line confirmed: pytest tests/test_wave64_halves_fixtures.py: 10 passed. run_gpu_tests.py --filter w64 with this branch's w64_graphics.py and ps_live_width.asm: AMD Radeon RDNA2 iGPU (driver 26.10.1, subgroup 32..64) 25/26 passed, 1 skipped (ps_w64x_readlane: cannot require a 64-wide fragment subgroup), 0 failed; NVIDIA RTX 5080 (driver 616.92, subgroup 32..32) 0/26 passed, 26 skipped (no 64-wide subgroup), 0 failed. No game files.

AI-assisted.

@lunarminus

Copy link
Copy Markdown

Tested d76b715f merged onto main d0835dd9 on an AMD Radeon 760M (RDNA3 iGPU, gfx1103, subgroup 32..64), RADV Mesa 26.3.1, CachyOS Linux: fail. scripts/run_gpu_tests.py still fails the new probe (FAIL ps_live_width no checker defined), the same defect reported on 58e0e40 above. w64_graphics.py itself works here.

  • The merge was clean. Nothing under runtime/ C++/CMake changed, so the test programs come from a RelWithDebInfo build of d0835dd9.
  • python -m pytest tests/test_wave64_halves_fixtures.py: 10 passed.
  • scripts/run_gpu_tests.py --build runtime/build/linux:
    • native: 196/211 passed, 14 skipped, 1 failed
    • LEONIDA_W64_EMULATE=1: 196/211 passed, 14 skipped, 1 failed
    • d0835dd9 without the PR: 196/210 passed, 14 skipped in both modes
    • I compared the PASS/FAIL/SKIP word of every test line with the d0835dd9 run. In both modes the only difference is the new ps_live_width, which reports FAIL "no checker defined".
    • Cause: run_suite leaves out only w64_graphics.FIXTURES, and the probe is not in FIXTURES, check.py or OTHER_HARNESS. Adding it to OTHER_HARNESS as run by w64_graphics.py (as in run_gpu_tests: ps_live_width is w64_graphics.py's probe (#2998) kapitche/Leonida#1), or leaving it out next to W64_GRAPHICS_ONLY, would fix it.
  • runtime/test/shaders/build.py: 235 shaders, 235 translated, 235 pass spirv-val (234 on d0835dd9).
  • w64_graphics.live_width() measures 64 live lanes per fragment subgroup on RADV/RDNA3, so a NEEDS_LIVE_LANES entry would not skip here.
  • w64_graphics.py <out> runtime/build/linux: exit 0, all 26 fixtures ok (gs, ps and vs, tiers A to C). The output is identical line by line to d0835dd9's w64_graphics.py. The new skip path did not trigger, since NEEDS_LIVE_LANES is empty.

AI-assisted (Claude Code).

@kapitche

Copy link
Copy Markdown
Contributor Author

Thanks, that is a defect of this PR, not of RADV: ps_live_width.asm is a probe that w64_graphics.py runs, but run_gpu_tests.py assembles every .asm in the folder and the probe was in neither FIXTURES nor OTHER_HARNESS, so the suite reported "no checker defined". It reproduces with no special hardware: any full run_gpu_tests.py run failed it. My earlier runs used --filter w64, which does not select it.

Pushed a one-line fix on top (new commit, scripts/run_gpu_tests.py only): ps_live_width is added to OTHER_HARNESS as run by w64_graphics.py, so the suite still assembles and translates it and reports SKIP (run by w64_graphics.py), as for the other fixtures judged elsewhere. I did not touch the probe or NEEDS_LIVE_LANES; your 64 live lanes on RADV/RDNA3 and the identical w64_graphics.py output stand as they are.

Tested on Windows 11, Python 3.13.1, only vk_compute_test, vk_store_test and vk_harness built: run_gpu_tests.py --filter ps_live gives SKIP (run by w64_graphics.py) on the RTX 4080 SUPER and on the Intel UHD 770. Negative control: with run_gpu_tests.py from the previous head it gives FAIL ps_live_width no checker defined on the RTX 4080 SUPER.

@lunarminus

Copy link
Copy Markdown

Re-tested df03a8ae merged onto main d0835dd9 on the same AMD Radeon 760M (RDNA3 iGPU, gfx1103, subgroup 32..64), RADV Mesa 26.3.1, CachyOS Linux: pass. The fix works.

  • scripts/run_gpu_tests.py: 196/211 passed, 15 skipped, 0 failed, both native and with LEONIDA_W64_EMULATE=1. ps_live_width now reports SKIP (run by w64_graphics.py). Every other test line has the same result as d0835dd9 without the PR, in both modes.
  • runtime/test/shaders/w64_graphics.py on the build.py output: exit 0, all 26 fixtures ok.
  • pytest tests/test_wave64_halves_fixtures.py: 10 passed.

AI-assisted (Claude Code).

@Kev-Ball

Copy link
Copy Markdown

Tested df03a8ae on an NVIDIA GeForce RTX 3080 Ti (32-lane subgroups), driver 620.73.04, CachyOS Linux 7.3.5-2-cachyos. I rebuilt the Vulkan harnesses from this revision and selected the NVIDIA device explicitly.

The fragment live_width() probe measured 32 on this card. On the output of runtime/test/shaders/build.py (235/235 validated), w64_graphics.py reported 14 ok, 12 skipped, exit 0. The bpermute, permlane and swizzle pixel fixtures all passed. The 12 tier-C cases requested native 64 and 32 or a reference capture.

AI-assisted verification with synthetic inputs.

@sperm

sperm commented Nov 23, 2026

Copy link
Copy Markdown

Tested df03a8a (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.

  • Full python -I scripts/run_gpu_tests.py (Linux build of this branch's runtime/, LEONIDA_VK_DEVICE per GPU): 196/211 passed, 15 skipped, 0 failed on both GPUs. The new ps_live_width probe is now reported as SKIP (run by w64_graphics.py) instead of being run as a test with no checker. At the previous head it came out FAIL "no checker defined" on both GPUs. Every other test has the same result as at the merge base 03b09a0.
  • tests/test_wave64_halves_fixtures.py: 10 passed.

No game files. AI-assisted.

@throny

throny commented Nov 23, 2026

Copy link
Copy Markdown
Contributor

Tested df03a8a on NVIDIA RTX 4080, driver 610.88, Windows 11: pass, but not for the PR's own fixture (see last point)

Ran (MSVC 19.44 / VS 2022 BuildTools, Ninja, RelWithDebInfo, Vulkan SDK 1.4.363.0, native llvm-mc 23.1.6; test programs built from this head's tree, merge base 03b09a08):

  • python -I scripts/run_gpu_tests.py --build <build>: 164/211 passed, 47 skipped, 0 failed. ps_live_width is listed as SKIP (run by w64_graphics.py), as intended.
  • Not run: runtime/test/shaders/w64_graphics.py itself, so ps_live_width wasn't exercised on this card, and tests/test_wave64_halves_fixtures.py (needs pytest, not installed here).

A note for other testers: on a first attempt I paired this head's translator with test programs built from the newer main 7b7d73f8, and cs_bvh/cs_bvh32 failed. With test programs built from this head's own tree both pass. So that was my mismatched pairing, not this PR.

AI-assisted.

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.