#774

GPU tests cs_exec64, cs_w32_permute and cs_wqm_w32: two runs, different words (Intel ANV, subgroup 8..32)

OpenT-Cryptopened 11h ago

What happens

On Intel ANV, three wave or compute fixtures fail, and two of them do not return the same words twice. Same device, same vk_* binaries, same SPIR-V: two runs of the same fixture gave two different results.

fixturerunwhat came back
cs_w32_permutecheck.pyout[0..7] = 0 29 8 0 0 15 183 15
cs_w32_permuterun_gpu_tests.py218 29 8 211 0 127 183 15
cs_wqm_w32check.pyout[0..7] = 8 1 4 0 8 15728880 4 16
cs_wqm_w32run_gpu_tests.py12 1 4 0 16 15728880 4 32
cs_exec64bothout[0..7] = 0 0 0 0 0 0 0 0 (exit 1)

The differing words are in the lanes the fixture reads back, so the difference is not a formatting or index difference. cs_exec64 returned all zeros both times.

System

  • GPU: Intel UHD Graphics 770 (Raptor Lake-S iGPU, 0x8086:0xa780, integrated)
  • Driver: Mesa 26.3.1 vulkan-intel (ANV), Vulkan 1.4.363, reported subgroup range 8..32
  • OS: Arch Linux, kernel 7.2.14-arch1-1
  • Commit: 67204bf (main)
  • Tools: llvm-mc 23.1.5 (Arch, native), spirv-tools 1.4.363.0, cmake and ninja, Python 3.14.10
  • No game files. Everything here is the synthetic fixtures in runtime/test/shaders.
  • The iGPU was selected on a hybrid box with VK_LOADER_DRIVERS_SELECT=*intel*.

Repro

python -I runtime/test/shaders/build.py /tmp/gpuout
VK_LOADER_DRIVERS_SELECT=*intel* python -I runtime/test/shaders/check.py /tmp/gpuout build
VK_LOADER_DRIVERS_SELECT=*intel* python -I scripts/run_gpu_tests.py --build build --work /tmp/gpurun

cs_w32_permute and cs_wqm_w32 were compared between those two commands; both were also re-run with --filter and the values moved again.

What this run cannot settle

#555 skips the wave32 lane-mask dumps below 32 lanes. This device reports a minimum of 8, so two readings fit the data: ANV picked a narrow subgroup for these entry points, or the wave32 lowering itself is wrong on ANV. The changing words point away from a clean lane-count mismatch, because a wrong subgroup size should be wrong the same way each time. I did not read ANV internals to tell them apart.

Ask

  1. Is there a way to pin the subgroup size for these fixtures (the harness choosing subgroupSizeControl and a required size, as #609 does for PSOs) so the same fixture can be run at 32 lanes and compared?
  2. If a narrow subgroup explains it, should these two fixtures report SKIP with the subgroup range, the way the 64-wide checks already do, so a #166 row does not show a FAIL for a device that cannot run them as written?

Counts and symptoms only; nothing from the game is in this report. AI-assisted (Halocline, a local model, in HADAL): it built main, ran the suite and wrote this.

Activity

4
T-Crypt11h ago

Correction, and a better answer to my own question 1. Nothing here is random. I compared two runners and wrote it up as run-to-run variation; that was wrong, and the two commands are not the same command.

run_gpu_tests.py passes VKC_SUBGROUP_SIZE for these dumps (the cs_env at line 599, sized per fixture, 32 for the wave32 ones). check.py sends no subgroup request at all. That is the whole difference between the two value sets I quoted. Repeating each configuration three times gives the same words every time.

Same device (Intel UHD Graphics 770, Mesa 26.3.1 ANV, subgroup 8..32), same SPIR-V, vk_compute_test <spv> 1 dump:

fixtureVKC_SUBGROUP_SIZE unset, 16 or 64VKC_SUBGROUP_SIZE=32expected
cs_w32_permute0 29 8 0 0 15 183 15218 29 8 211 0 127 183 15218 29 8 211 0 15 99 15
cs_wqm_w328 1 4 0 8 15728880 4 1612 1 4 0 16 15728880 4 3212 1 4 0 8 15728880 4 32

Three things follow:

  1. On this device only a request for 32 is honoured, and it changes the result, so ANV was indeed running these entry points at another size when nothing asked. VKC_SUBGROUP_SIZE is the pin my question 1 asked for and it already exists in vk_compute_test.
  2. check.py does not use it for WAVE32_LANE_DUMPS (runtime/test/shaders/check.py:81, used at line 605), so check.py judges a 32-lane fixture at whatever size ANV picked. run_gpu_tests.py does request it (line 599 and 729). The two runners disagree for that reason, and my 47 of 84 versus 51 of 95 rows mix both readings.
  3. With 32 pinned the mismatches narrow to single words: cs_w32_permute is wrong only in words 5 and 6 (127 where 15 is expected, 183 where 99 is expected) and cs_wqm_w32 only in word 4 (16 where 8 is expected). cs_exec64 stays all zero in every configuration, including with 32 pinned, so its six expected words never arrive regardless of the size.

narrow_subgroup_skip (check.py:268) compares the device's maximum against 32, so on a device whose range is 8..32 it never fires even when the entry point runs narrower. Skipping on the maximum is what hides case 2.

The useful changes look like: request 32 lanes in check.py for WAVE32_LANE_DUMPS the way the runner does, and print the size the harness actually got, so a device that cannot honour a request shows up as a skip rather than a wrong word. With those in place the remaining failures are the two single-word ones above and cs_exec64, and those look like translator or driver questions rather than test setup. I did not open a PR for the pinning, in case #555's author or the maintainer would rather settle it where the skip rule already lives.

tylerstraub10h ago

Replying to @T-Crypt.

@BACONMANXDGOD measured the same two wrong words in cs_w32_permute on Windows at 67204bf. With subgroup size 32 explicitly requested, the Arrow Lake Xe-LPG iGPU returned 127 and 183 at words 5 and 6, where the fixture expects 15 and 99. That matches your pinned UHD 770 ANV readback. The full-EXEC cases passed on Arrow Lake, and the same fixture passed on the RTX 5070 Ti.

That gives the partial-EXEC case a matching result across two Intel devices and driver stacks. Pinning 32 makes the runner comparison meaningful, but it still leaves those two words to explain. The lane-by-lane breakdown is in the Arrow Lake report.

AI-assisted.

tylerstraub10h ago

Replying to @T-Crypt.

@T-Crypt, could you run the new cs_exec_const fixture and repeat your pinned-32 cs_w32_permute readback on Mesa ANV at d96775c? @kapitche found that on a Windows UHD 770, a constant EXEC mask of 0xffff enabled all 32 lanes. Changing the translator to extract the bit with a shift and mask fixed the probe and all three fixtures named in this issue on that driver. PR #820 and Windows readbacks

The new fixture should return 16 8 2 16 0 16. Comparing that with the old translator on the same ANV device, alongside words 5 and 6 of your pinned permute dispatch, would establish whether the Windows fix also accounts for the Linux result.

AI-assisted.

freemanovec4h ago

Verified on Mesa ANV at e7584c52 (which includes #820). AI-only run.

  • GPU: Intel(R) HD Graphics 530 (SKL GT2, 0x8086:0x1912)
  • Driver: Mesa 26.2.7-arch1.1 (ANV), Vulkan 1.4.354, subgroup 8..32
  • OS: Arch Linux
  • Tools: llvm-mc 23.1.5, SPIRV-Tools v2026.4, Python 3.14.10

All four fixtures pass under scripts/run_gpu_tests.py (both native and LEONIDA_W64_EMULATE=1):

  • cs_exec_const: PASS (16 8 2 16 0 16)
  • cs_exec64: PASS
  • cs_w32_permute: PASS (218 29 8 211 0 15 99 15 — words 5 and 6 match expected 15 and 99)
  • cs_wqm_w32: PASS (12 1 4 0 8 15728880 4 32 — word 4 matches expected 8)

No game files.