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

@kapitche kapitche commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor

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

What and why

On the Intel UHD 770 (driver 32.0.101.6129, subgroup 8..32) gl_SubgroupSize is 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 there. main skips every tier A and B pixel fixture on such a device ("may run fewer live lanes than 32"), which hides the fixtures that do not read across the two 16-lane rows and any regression in the channels that do not.

This measures the live width and judges what it can:

  • ps_live_width.asm: a probe pixel shader that writes popcount(exec_lo) to mrt0.
  • w64_graphics.py: live_width() runs it through vk_harness with vs_ids and returns the largest word. On a device with subgroups below 32 that could not be held to 32 or 64, every ps_ tier A/B fixture is now judged in full, except the output channels listed in NEEDS_LIVE_LANES = {name: (lanes, channels)} when the measured width is smaller: ps_w64_a_permlane r2,r3; _a_swizzle and _a_bpermute r2 (the lane L ^ 16 round trips). Those fixtures return a Skip that names the live width and the unjudged channels once the other channels match; a mismatch in any other channel is still a failure. When the probe cannot run, the old whole-fixture skip stays.
  • A device that can require 32 or 64 is unchanged (nothing is measured).

Tested

Windows 11, RelWithDebInfo, build.py output, w64_graphics.py on the 10 ps_ tier A/B fixtures:

before (main) this PR
RTX 4080 SUPER 10 ok 10 ok
Intel UHD 770 (16 live lanes measured) 10 SKIP 7 ok, 3 SKIP naming r2 / r2,r3 as not judged

Negative control, Intel: with _a_bpermute's derived r0 changed, the fixture fails (4096 of 4096 pixels differ) instead of skipping. python -I -m pytest tests/test_wave64_halves_fixtures.py (Python 3.12.16, Linux): 10 passed, 1 skipped; with w64_graphics.py from main, the two new tests fail.

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.

@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).

@evilclanker9000

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.

@kapitche

Copy link
Copy Markdown
Contributor Author

Thanks both. Checked at df03a8ae on Windows 11 (build dir and shaders built from this head, only vk_harness built):

  • live_width() itself, called directly: 32 on the RTX 4080 SUPER and 16 on the Intel UHD 770, the same pair of numbers as in the description.
  • w64_graphics.py over all 26 fixtures: RTX 4080 SUPER 14 ok, 12 skipped (the 12 tier C cases: "needs a device that can require both 64 and 32, or W64G_REF"), 0 failed, which matches Kev-Ball's 3080 Ti run. Intel UHD 770 5 ok, 21 skipped, 0 failed; the Intel's ps_w64_a_*/ps_w64_b_* skips come from the live-lane skip already on main, not from this PR.

So on a 32-lane NVIDIA card nothing is skipped because of this PR. But throny's point stands: NEEDS_LIVE_LANES is empty on purpose, so w64_graphics.py never runs the new probe on any GPU until a PR lists a fixture in it (#2260's three permutes are the first). Until then the probe is exercised only by the call above and by tests/test_wave64_halves_fixtures.py, which fakes the draw and the probe. That is the hook as described, not a defect, so I am leaving the PR as it is.

@PingasMech

Copy link
Copy Markdown

TEST-433 on Intel UHD 770, Windows driver 32.0.101.7088: I’d keep the within-row checks running and report the cross-row checks separately. I tested df03a8ae merged locally with main de671352. The existing minimum-subgroup-size check skipped all ten tier A/B pixel fixtures on this device before the new probe could affect the verdict.

I drew each fixture directly and checked its output against the runner’s existing expectations. Seven passed in full, including ps_w64_a_discard and the heap checks for ps_w64_b_ballot_atomic. For the other three, these are mismatching pixels out of 4,096, by output channel:

Fixture R G B A
ps_w64_a_bpermute 0 0 4,095 0
ps_w64_a_swizzle 0 0 4,095 0
ps_w64_a_permlane 0 0 4,096 4,096

Only the channels that read the other 16-lane row disagreed. In instrumented versions of all three draws, every pixel reported subgroup size 32 and an active-lane ballot of 0x0000ffff. The lane ^ 16 partner was absent at all 4,096 pixels. Changing the two round trips to lane ^ 8 in bpermute/swizzle, and using same-row v_permlane16 for the permlane round trips, made all four channels match at every pixel in all three fixtures.

A negative control shows what the blanket skip hides: I changed only bpermute’s R read from the neighbouring lane to its own lane. R then disagreed at all 4,096 pixels, but the unmodified runner still exited 0 with SKIP. Splitting the cross-row outputs into their own checks would let the seven complete fixtures and the eight defined channels in these three catch regressions on this Intel GPU.

AI-assisted. Repository-owned synthetic fixtures, compiled and validated with spirv-val; 64×64 Vulkan fragment draws.

@kapitche

Copy link
Copy Markdown
Contributor Author

Thanks, you were right that the blanket skip hid more than it had to. Verified on an Intel UHD 770 (driver 32.0.101.6129) and an RTX 4080 SUPER, Windows 11, rebased on current main (head 998929b):

  • Intel, measured live width 16: before, all 10 ps_ tier A/B fixtures SKIP; now 7 pass in full and the 3 permute fixtures SKIP with a message naming the unjudged channels (_a_permlane r2,r3; _a_swizzle and _a_bpermute r2) and saying the other channels match.
  • RTX 4080 SUPER: 10 ok, unchanged.
  • Negative control on Intel: changing _a_bpermute's derived r0 now fails 4096 of 4096 pixels instead of exiting 0 with SKIP.
  • Unit tests: 10 passed, 1 skipped (Python 3.12.16, Linux); with main's w64_graphics.py the two new tests fail.

I did not re-derive your per-channel mismatch counts or your lane ^ 8 / same-row variants; the split relies on the r2/r3 channels being the L ^ 16 round trips by the fixture headers. Where the probe cannot run, the old whole-fixture skip stays. The PR description is updated.

@ricardotanaka

Copy link
Copy Markdown

Re-tested the current head 998929bc (after the checks above) merged onto main 3faac557, on an AMD Radeon RX 7600 (RDNA3, AMD 26.11.2 proprietary driver, subgroup 32..64), Windows 11 26200: pass. As expected for a device that can require 32 or 64, nothing changes here:

  • w64_graphics.py <build.py out> runtime/build: 23 ok, 4 SKIP (gs_w64_c_lane_id, vs_w64_c_bcnt_export, vs_w64_c_lane_id, vs_w64_c_readlane: "tier C needs a device that can require both 64 and 32"), 0 failures; all 10 ps_ tier A/B fixtures ok.
  • run_gpu_tests.py with LEONIDA_VK_VALIDATION=1: 202/218 passed, 16 skipped, 0 failed, no validation messages; ps_live_width is skipped as "run by w64_graphics.py".
  • pytest tests/test_wave64_halves_fixtures.py: 11 passed.

AI-assisted (Claude Code).

@KkelebekK

Copy link
Copy Markdown

Tested 998929b on AMD Radeon 780M (RADV PHOENIX, gfx1103 / RDNA3, Mesa 26.2.6, subgroup 32..64) and NVIDIA GeForce RTX 4070 Laptop (620.70.06, subgroup 32..32), Linux (CachyOS, kernel 7.3.4): pass, with one concern about the W64G_REF path on a narrow fragment stage (mocked only, below).

Merge-base d974c88a; the PR merges cleanly into main 3faac557 (git merge-tree). The PR changes no C++ or CMake file, so the test programs come from an existing build of main af70fc78 (the sources of the Vulkan harnesses are the same; the only runtime differences between that build and this head are in the xgameruntime shims and their CMake entries).

  • scripts/run_gpu_tests.py full suite, 218 cases, no FAIL anywhere. 780M: 202 passed, 16 skipped. 4070 plain: 170 passed, 48 skipped. 4070 with LEONIDA_W64_EMULATE=1: 201 passed, 17 skipped. Merge-base, same machine: 202/217 (15 skipped), 170/217 (47), 201/217 (16). The only per-test difference is the new ps_live_width row: SKIP (run by w64_graphics.py) in all three.
  • Earlier report on this PR: the suite failed ps_live_width with "no checker defined". Not at this head: --filter ps_live_width gives that SKIP on all three configs. At the first commit alone (8e21ff65) it still gives FAIL ps_live_width no checker defined, so d050f603 is what fixes it.
  • w64_graphics.py, 27 fixtures: 780M plain, 780M with RADV_PERFTEST=gewave32, 4070 plain and 4070 with the 780M's 64-lane results (W64G_SAVE_REF / W64G_REF) are line by line identical to the merge-base run. 780M: 27 ok in both modes. 4070 plain: tier A/B ok, tier C skipped as before (the SKIP "tier C needs a device that can require both 64 and 32, or W64G_REF"); with the 780M reference: 27 ok.
  • live_width() measured through the translated probe: 64 on the 780M, 32 on the 4070. Neither device has a subgroup minimum below 32, so the new narrow-stage branch (measure, then skip only the L ^ 16 channels) is not reached on this hardware; I could only exercise it through the PR's own mocked tests.
  • tests/test_wave64_halves_fixtures.py: 11 passed; tests/test_run_gpu_tests.py: 41 passed. With the PR's new tests copied onto the merge-base w64_graphics.py: 2 failed (live_width does not exist there), 9 passed.

Concern, mocked (no device here has a 16-lane fragment stage): with W64G_REF set, the tier A/B reference comparison at the end of check() uses comparable(name, ...), which does not take ignore. I reproduced it with the same mocked setup as the PR's _narrow_stage test plus a reference holding the correct 64-lane words: without W64G_REF the fixture gives the new SKIP naming r2; with it, ps_w64_a_bpermute returns a failure, "the run differs from the 64-lane reference", because the garbage r2 is compared to the reference. If a narrow device is meant to be used with W64G_REF, comparable would need to drop the ignored channels too.

Synthetic inputs only, no game data. AI-assisted.

@thesubtleties

Copy link
Copy Markdown

Tested 998929bc on both halves under Linux, CachyOS Linux 7.3.5, LLVM 23.1.5: pass, no regressions.

  • NVIDIA GeForce RTX 3080 (Ampere, subgroup 32..32), driver 620.73.04: LEONIDA_W64_EMULATE=1 run_gpu_tests.py: 222/222 translated and pass spirv-val; 201/218 passed, 0 failed; ps_live_width SKIP (run by w64_graphics.py). w64_graphics.py: 15 ok, 12 SKIP (all tier C, "needs a device that can require both 64 and 32"), identical to main.
  • AMD Radeon RDNA2 iGPU of a Ryzen 7 7800X3D (RADV RAPHAEL_MENDOCINO, Mesa 26.3.1, subgroup 32..64): run_gpu_tests.py: 202/218 passed, 0 failed. w64_graphics.py: 27 ok, 0 SKIP (RADV can require both sizes here, so the tier C fixtures run too), identical to main.
  • pytest tests/test_wave64_halves_fixtures.py: 11 passed (9 on main).

Test programs rebuilt from the PR head; compared against main 3faac557 on the same machine. No game files. AI-assisted (Claude Code).

@DenRakEiw

Copy link
Copy Markdown
Contributor

Tested 998929bc on Windows 11, Vulkan SDK 1.4.363.0, LLVM 21.1.8 (amdgcn via WSL), Python 3.12.10 (no game files): pass.

  • Trial-merged onto origin/main (3faac557): clean.
  • ps_live_width.asm translated and passed spirv-val (1/1).
  • python -I -m pytest tests/test_wave64_halves_fixtures.py: 11/11 passed.

AI-assisted (Gemini 4 Neon).

@gertify

gertify commented Nov 23, 2026

Copy link
Copy Markdown

Tested 998929b on Intel UHD 630 (CFL GT2, subgroup 8..32), Mesa 25.2.8 ANV, Ubuntu 24.04, LEONIDA_VK_DEVICE=Intel: pass. This GPU also measures 16 live fragment lanes.

  • w64_graphics.live_width on Intel: 16. With LEONIDA_VK_DEVICE=NoSuchDevice it returns None and vk_harness exits 1 with "no Vulkan physical device matches".
  • w64_graphics.py on Intel: no FAIL lines. Pixel tier A/B: 7 ok and 3 SKIP (ps_w64_a_bpermute r2, ps_w64_a_permlane r2 and r3, ps_w64_a_swizzle r2), each skip naming "16 live lanes per subgroup here, measured with ps_live_width". Tier C fixtures skip ("tier C needs a device that can require both 64 and 32, or W64G_REF").
  • pytest tests/test_wave64_halves_fixtures.py: 11 passed.

AI-assisted.

@kapitche

Copy link
Copy Markdown
Contributor Author

Thanks, the W64G_REF path was a real gap. comparable() did not take ignore, so on a narrow fragment stage the unjudged L ^ 16 channels were still compared with the 64-lane reference. I reproduced it with your mocked setup (reference holding the correct 64-lane words, garbage in r2 only): the run returned "differs from the 64-lane reference" instead of the SKIP naming r2.

Pushed 7429f2e: comparable(name, words, heap, ignore=()) drops the ignored channels from both sides, and the reference comparison passes ignore. New test test_reference_comparison_skips_the_channels_a_narrow_stage_does_not_judge covers both directions: garbage only in r2 gives the SKIP naming r2, and a wrong within-row channel against the reference is still a failure.

Tested: python -I -m pytest tests/test_wave64_halves_fixtures.py on Linux, Python 3.12.16: 11 passed, 1 skipped (the llvm-mc test needing spirv-as). Negative control: with w64_graphics.py from the previous head the new test fails (1 failed, 10 passed). Still mocked only: I have no 64-lane reference device on this PC (RTX 4080 SUPER runs 32, UHD 770 runs 16 live lanes), so the real W64G_REF-with-a-narrow-stage run is not exercised.

@PeterGrieffindor

Copy link
Copy Markdown

Tested 7429f2e0 merged with main 3faac557 (clean merge) on AMD Radeon RX 9070 XT (RDNA4, subgroup 32..64), AMD 26.11.2 (LLPC), Windows driver 32.0.32029.2010, Windows 11 Pro build 26300: pass, and nothing changes on this card, as intended for a device whose subgroups are never narrower than 32. Harness programs from a main 3faac557 build (MSVC 14.51); llvm-mc 21.1.8, SPIRV-Tools v2026.4. No game files.

  • pytest tests/test_wave64_halves_fixtures.py: 12 passed. Negative control: with main's w64_graphics.py, 3 of the 12 fail.
  • build.py, then w64_graphics.py: 27 fixtures, 23 ok and 4 SKIP, line for line the same output as main. The ok ones: ps tier A 6, B 4 and C 8 (the fragment stage takes a required size of 64 and of 32 here, so the tier C comparison runs), vs A 1 and B 3, gs A 1. The 4 skips are the vertex and geometry tier C fixtures, which need RADV's switch.
  • The new probe run by hand, vk_harness vs_ids.spv ps_live_width.spv: 64 on every pixel, so the fragment stage has 64 live lanes at its default size. w64_graphics.py itself does not reach the probe on this device (smallest subgroup size 32).
  • scripts/run_gpu_tests.py, native wave64: 222 shaders translated and valid, 202/218 passed, 16 skipped, 0 failed. main: 221 shaders, 202/217, 15 skipped. The one extra skip is ps_live_width ("run by w64_graphics.py").

AI-assisted (Claude Mythos 5.2).

@CryingLaughing

Copy link
Copy Markdown
Contributor

Tested 7429f2e merged onto main 3faac55 on native Windows 11 build 26200, MSVC 19.44, Khronos validation 1.4.357. This exercises the W64G_REF fix on real UHD 770 hardware. The three reference files contain 4,096 pixels each, generated independently from the formulas in the bpermute, permlane and swizzle fixture headers. All 11 input modules passed spirv-val.

Adapter Live fragment lanes at all 4,096 probe pixels Clean reference run of nine targeted tier A/B fixtures
Intel UHD 770, 32.0.101.7088 16 Six pass in full, three partial skips, zero failures
RTX 4080, 621.01 32 All nine pass in full

On Intel, the three partial skips named only r2 for bpermute/swizzle and r2/r3 for permlane. Direct GPU readbacks matched the formulas at every pixel in the other channels. With the same clean reference files, harness, and shaders, the prior runner from 998929b falsely failed all three comparisons.

I then flipped one word in the saved bpermute reference, leaving the shader and derived checks intact. An r2 change still gave the expected partial skip on Intel; an r0 change failed specifically in the saved-reference comparison. The RTX 4080 detected both changes. The direct draws confirmed the selected GPU and validation layer and reported zero validation errors.

AI-assisted. Repository-owned synthetic inputs only.

…xcept the lane L ^ 16 channels, which are reported as not judged (measured with ps_live_width)
@kapitche

Copy link
Copy Markdown
Contributor Author

Rebased onto current main (new head 7a56cc1a3). The first part of this PR (the measured-live-width skip, the run_gpu_tests probe fix and the narrow-stage judging) is already on main, so the branch is down to the last two commits: the W64G_REF and narrow-stage comparison changes in w64_graphics.py and tests/test_wave64_halves_fixtures.py. pytest tests/test_wave64_halves_fixtures.py: 11 passed, 1 skipped (Python 3.12.16, Linux); with main's w64_graphics.py swapped in, 3 of them fail. Mergeable again.

@nicknickalive

Copy link
Copy Markdown

Tested 7a56cc1 (trial-merged onto main 561b65a) on NVIDIA GeForce RTX 5090 (610.88, subgroup 32..32) and AMD Radeon iGPU (RDNA2, AMD 32.0.21036.18, subgroup 32..64), Windows 11 Pro 26200: pass (unit tests only; Intel path not testable here).

  • pytest tests/test_wave64_halves_fixtures.py: 12 passed
  • The change only alters behaviour on devices with subgroup max < 32 (Intel); neither device here is one, and main's build has no spirv/ dir for w64_graphics.py, so the fixture run was not done.

No game files. 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.