gpu tests: preserve subgroup coverage in the dynamic R32_UINT fixture #2790

Closed
DIGITALWORLD-PL wants to merge 2 commits from upstream-pr/2790 into main
DIGITALWORLD-PL commented 2026-11-30 21:09:14 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by DIGITALWORLD-PL on 2026-11-30T21:09:14Z.


Claimed in the coordination issue as TEST-DYNAMIC-R32-SUBGROUP.

What and why

The cs_w64x_dynamic_r32_uint fixture uses an 8×8×1 workgroup. Native execution requests and confirms 64 lanes without setting REQUIRE_FULL_SUBGROUPS, which requires the X dimension to be a multiple of the requested subgroup size. The emulation run uses the device default and checks the eight output words at any width. It still forwards an explicit VKC_SUBGROUP_SIZE diagnostic override. The fixture bypasses the index's width hint so it cannot reintroduce a 32-lane requirement.

Tested

  • Full CPU semantic suite: 6,720 tests across 553 files, with zero files failing.
  • Three CPU regression tests with 14 scenarios passed on the PR branch. Simulated 8-, 32-, and 64-lane devices cover both correct data and a wrong word in emulation. The same scenarios cover native confirmation and error handling and an explicit diagnostic width.
  • Filtered hardware run at commit 5dc5252551b5118b71f909fe067d30df23cd8efe: 1 passed, 0 failed, 0 skipped. The harness identified the RTX 5090 (32..32) with no explicit width request. All eight words matched. A separate raw readback matched all 64 words against 0x8A600250. The emitted module passed SPIRV-Tools v2026.4 for Vulkan 1.2.

Follow-up after review

  • Retested on the RTX 5090 (subgroup 32..32). The emulated run used the default width and passed. An explicit diagnostic request for 64 also passed the data check and now reports that the requested width was unavailable and the output was checked at the device width. Both emulated readbacks matched 64/64 words. The saved modules passed Vulkan 1.2 validation.
  • The native filter returned SKIP on the RTX 5090. Native execution with a confirmed subgroup width of 64 is covered by CPU simulations. The hardware evidence here is for the emulated run and the native skip on a 32-wide device.
  • Kept the exit-code guard on subgroup availability. The existing WAVE32_PIN_DUMPS caller of subgroup_pin_skip already gates it on rc == 0. Both paths report a failed dispatch as a failure even if its output also mentions an unavailable width.
  • All 82 tests in tests/test_run_gpu_tests.py passed after the follow-up.

GPUs tested: NVIDIA GeForce RTX 5090, driver 621.01, Windows build 10.0.26300.

AI-assisted: OpenAI Codex (GPT-6.2 Astra for the v2 correction and independent review, GPT-6.2 Sol for publishing, the final branch check and the review follow-up).

  • Based on the current main and the comparison shows a clean merge.
  • One topic.
  • The tests used synthetic data.
<!-- greyfinch-sync:ubiquitarianism/leonida:issue:5573798013 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2790). Originally posted by [DIGITALWORLD-PL](https://github.com/DIGITALWORLD-PL) on 2026-11-30T21:09:14Z. --- Claimed in the coordination issue as [TEST-DYNAMIC-R32-SUBGROUP](https://github.com/ProjectLeonida/mandy/issues/2570#issuecomment-7291936887). ### What and why The `cs_w64x_dynamic_r32_uint` fixture uses an 8×8×1 workgroup. Native execution requests and confirms 64 lanes without setting `REQUIRE_FULL_SUBGROUPS`, which requires the X dimension to be a multiple of the requested subgroup size. The emulation run uses the device default and checks the eight output words at any width. It still forwards an explicit `VKC_SUBGROUP_SIZE` diagnostic override. The fixture bypasses the index's width hint so it cannot reintroduce a 32-lane requirement. ### Tested - Full CPU semantic suite: 6,720 tests across 553 files, with zero files failing. - Three CPU regression tests with 14 scenarios passed on the PR branch. Simulated 8-, 32-, and 64-lane devices cover both correct data and a wrong word in emulation. The same scenarios cover native confirmation and error handling and an explicit diagnostic width. - Filtered hardware run at commit `5dc5252551b5118b71f909fe067d30df23cd8efe`: 1 passed, 0 failed, 0 skipped. The harness identified the RTX 5090 (32..32) with no explicit width request. All eight words matched. A separate raw readback matched all 64 words against `0x8A600250`. The emitted module passed SPIRV-Tools v2026.4 for Vulkan 1.2. ### Follow-up after review - Retested on the RTX 5090 (subgroup 32..32). The emulated run used the default width and passed. An explicit diagnostic request for 64 also passed the data check and now reports that the requested width was unavailable and the output was checked at the device width. Both emulated readbacks matched 64/64 words. The saved modules passed Vulkan 1.2 validation. - The native filter returned `SKIP` on the RTX 5090. Native execution with a confirmed subgroup width of 64 is covered by CPU simulations. The hardware evidence here is for the emulated run and the native skip on a 32-wide device. - Kept the exit-code guard on subgroup availability. The existing `WAVE32_PIN_DUMPS` caller of `subgroup_pin_skip` already gates it on `rc == 0`. Both paths report a failed dispatch as a failure even if its output also mentions an unavailable width. - All 82 tests in `tests/test_run_gpu_tests.py` passed after the follow-up. GPUs tested: NVIDIA GeForce RTX 5090, driver 621.01, Windows build 10.0.26300. AI-assisted: OpenAI Codex (GPT-6.2 Astra for the v2 correction and independent review, GPT-6.2 Sol for publishing, the final branch check and the review follow-up). - [x] Based on the current main and the comparison shows a clean merge. - [x] One topic. - [x] The tests used synthetic data.
OreoFR commented 2026-11-30 21:18:57 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by OreoFR on 2026-11-30T21:18:57Z.


Checked by OreoFR on macOS 27.2.1, Apple M5 (MoltenVK 1.4.2), Python 3.12.16, main a596adfac merged with head 5dc525255.

  • MEASURED, red (main + only this PR's test): tests/test_run_gpu_tests.py 6 failed, 10 passed. Green (main + this PR): 81 passed, 136 subtests passed.
  • MEASURED, the full GPU suite on the M5 with this PR (runtime built like the macos job): 204/276 passed, 72 skipped, 0 failed, the same totals as main 8f41d7d01 earlier today (204/276, 0 failed). No test changed outcome.
  • cs_w64x_dynamic_r32_uint itself is skipped on this device on both sides (Apple's subgroups are 4..32): main says "no 64-wide compute subgroup on this device", this PR says "the device can't run this shader at 64 lanes on request". So the fixed path is not exercised here; the hardware coverage is the PR's RTX 5090 run.

AI-assisted: Claude Code

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7292226815 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2790#issuecomment-7292226815). Originally posted by [OreoFR](https://github.com/OreoFR) on 2026-11-30T21:18:57Z. --- Checked by OreoFR on macOS 27.2.1, Apple M5 (MoltenVK 1.4.2), Python 3.12.16, `main` `a596adfac` merged with head `5dc525255`. - MEASURED, red (`main` + only this PR's test): `tests/test_run_gpu_tests.py` 6 failed, 10 passed. Green (`main` + this PR): **81 passed, 136 subtests passed**. - MEASURED, the full GPU suite on the M5 with this PR (runtime built like the `macos` job): **204/276 passed, 72 skipped, 0 failed**, the same totals as `main` `8f41d7d01` earlier today (204/276, 0 failed). No test changed outcome. - `cs_w64x_dynamic_r32_uint` itself is **skipped** on this device on both sides (Apple's subgroups are 4..32): `main` says "no 64-wide compute subgroup on this device", this PR says "the device can't run this shader at 64 lanes on request". So the fixed path is not exercised here; the hardware coverage is the PR's RTX 5090 run. AI-assisted: Claude Code
KelboLive commented 2026-12-01 05:54:53 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by KelboLive on 2026-12-01T05:54:53Z.

Review: COMMENTED


The fix is right, and I checked the Vulkan rule rather than taking it from the body: --require-wave64 sets REQUIRE_FULL_SUBGROUPS, and with LocalSize 8×8×1 the x dimension (8) is not a multiple of 64 (VUID-…-flags-02759), so the old native path could never be legal on a 64-wide device; requiredSubgroupSize = 64 alone has no such VU, and only needs a power-of-two within the device range. The new tests bite: reverting only scripts/run_gpu_tests.py to d8ca18240 fails all three (14 scenarios), and 81 + 4 harness tests pass.

The gap is evidence, and it is worth saying in the body: both the 5090 in the body and this 4070 Ti SUPER report subgroup 32..32, so before and after the native filter prints SKIP (two different reasons), and the "1 passed, 0 skipped" is the 32-lane emulated run. The branch that changed — native with requiredSubgroupSize=64 — is only exercised by the mock. An AMD/64-wide run would close it; a sentence in the body would at least be honest about it.

Two smaller things:

  • The skip is gated on rc == 0, so an "unavailable" line with a nonzero exit reports FAIL, where subgroup_pin_skip (used elsewhere in the runner) skips regardless of the exit code. Make the two consistent.
  • LEONIDA_W64_EMULATE=1 VKC_SUBGROUP_SIZE=64 on this 32-lane GPU prints PASS without noting that 64 was unavailable (verified directly against the harness: compute subgroup size: 64 not available, exit 0). Pre-existing and arguably fine because the words are width-independent, but it is a pass-at-the-wrong-width case a reader would not expect.

No registry change is needed — the fixture is auto-discovered and docs/testing.md already says cs_w64x_* skip on 32-wide GPUs.

<!-- greyfinch-sync:ubiquitarianism/leonida:review:6125883355 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2790#pullrequestreview-6125883355). Originally posted by [KelboLive](https://github.com/KelboLive) on 2026-12-01T05:54:53Z. **Review:** COMMENTED --- The fix is right, and I checked the Vulkan rule rather than taking it from the body: `--require-wave64` sets `REQUIRE_FULL_SUBGROUPS`, and with `LocalSize 8×8×1` the x dimension (8) is not a multiple of 64 (VUID-…-flags-02759), so the old native path could never be legal on a 64-wide device; `requiredSubgroupSize = 64` alone has no such VU, and only needs a power-of-two within the device range. The new tests bite: reverting only `scripts/run_gpu_tests.py` to `d8ca18240` fails all three (14 scenarios), and 81 + 4 harness tests pass. The gap is evidence, and it is worth saying in the body: **both the 5090 in the body and this 4070 Ti SUPER report subgroup 32..32**, so before and after the native filter prints SKIP (two different reasons), and the "1 passed, 0 skipped" is the 32-lane **emulated** run. The branch that changed — native with `requiredSubgroupSize=64` — is only exercised by the mock. An AMD/64-wide run would close it; a sentence in the body would at least be honest about it. Two smaller things: - The skip is gated on `rc == 0`, so an "unavailable" line with a nonzero exit reports **FAIL**, where `subgroup_pin_skip` (used elsewhere in the runner) skips regardless of the exit code. Make the two consistent. - `LEONIDA_W64_EMULATE=1 VKC_SUBGROUP_SIZE=64` on this 32-lane GPU prints **PASS** without noting that 64 was unavailable (verified directly against the harness: `compute subgroup size: 64 not available`, exit 0). Pre-existing and arguably fine because the words are width-independent, but it is a pass-at-the-wrong-width case a reader would not expect. No registry change is needed — the fixture is auto-discovered and `docs/testing.md` already says `cs_w64x_*` skip on 32-wide GPUs.
merzleckeier commented 2026-12-01 12:07:41 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by merzleckeier on 2026-12-01T12:07:41Z.


Independent GPU check of f4b416242 on c60ce461a, with #2867 on both sides so the hand-written fixture is translated as declared wave64. All 82 runner unit tests passed. On the earlier 1b8371637 base, the four new tests produced 15 failing cases when run against the upstream runner.

On the RTX 4070 SUPER (NVIDIA 620.73.4), I requested subgroup size 64 with emulation enabled. Both runs read back all eight expected words. The PR additionally reports that the requested size is unavailable and that the output was checked at device width. In the first pair on 1b8371637, AMD Raphael (RADV 26.3.1) passed native 64 and emulated execution, while NVIDIA passed emulated execution and correctly skipped native 64. These were synthetic Vulkan dispatches.

AI-assisted with OpenAI Codex.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7310688572 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2790#issuecomment-7310688572). Originally posted by [merzleckeier](https://github.com/merzleckeier) on 2026-12-01T12:07:41Z. --- Independent GPU check of `f4b416242` on `c60ce461a`, with #2867 on both sides so the hand-written fixture is translated as declared wave64. All 82 runner unit tests passed. On the earlier `1b8371637` base, the four new tests produced 15 failing cases when run against the upstream runner. On the RTX 4070 SUPER (NVIDIA 620.73.4), I requested subgroup size 64 with emulation enabled. Both runs read back all eight expected words. The PR additionally reports that the requested size is unavailable and that the output was checked at device width. In the first pair on `1b8371637`, AMD Raphael (RADV 26.3.1) passed native 64 and emulated execution, while NVIDIA passed emulated execution and correctly skipped native 64. These were synthetic Vulkan dispatches. AI-assisted with OpenAI Codex.
aslan2142 commented 2026-12-01 16:46:58 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by aslan2142 on 2026-12-01T16:46:58Z.


Closing this PR because the legacy C++ Vulkan runtime (and legacy Python shader compiler) is now considered deprecated in favor of the new Rust Vulkan runtime (in progress) and the Rust DX12 runtime (d3d12/) available now. Thank you for the contribution! If you believe this PR was closed by mistake (for example, if it still applies to active tools, d3d12/, or general docs), please feel free to reopen it.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7318222162 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/2790#issuecomment-7318222162). Originally posted by [aslan2142](https://github.com/aslan2142) on 2026-12-01T16:46:58Z. --- Closing this PR because the legacy C++ Vulkan runtime (and legacy Python shader compiler) is now considered deprecated in favor of the new Rust Vulkan runtime (in progress) and the Rust DX12 runtime (`d3d12/`) available now. Thank you for the contribution! If you believe this PR was closed by mistake (for example, if it still applies to active tools, `d3d12/`, or general docs), please feel free to reopen it.

Pull request closed

Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
ProjectLeonida/mandy!2790
No description provided.