subgroup_size: reject malformed device size ranges #2216

Closed
leonida/mandy
whoalin1 wants to merge 0 commits from subgroup-malformed-caps into main

Pull request closed

This pull request cannot be reopened because the branch was deleted.

whoalin1 commented 2026-11-26 06:33:12 +00:00

Summary

  • treat half-zero, inverted, or non-power-of-two subgroup min/max ranges as malformed instead of trusting them for requiredSubgroupSize
  • keep device_default / unknown_device fallbacks when a default size is or is not available
  • add synthetic regressions for half-zero, mirror half-zero, inverted, non-power-of-two, and valid control ranges

Item: SUBGROUP-MALFORMED-CAPS

This carries forward the still-uncarried fix in old-pr/9881, originally written by Andretuta, reapplied and verified on current main.

Tests

Under the local machine coordination lock:

  • control: patched subgroup_size_test against the unpatched header fails at the first half-zero-range expectation
  • fixed: the same test compiles and exits 0: subgroup size decision: AMD-like, NVIDIA-like, old RADV, limits, create-info chain and query OK
  • git diff --cached --check — pass

A full CMake configure is not possible in this shell because it does not initialize the Windows SDK environment; the test was instead compiled directly with the same MSVC 14.44 toolset and Vulkan SDK include path used by the existing configured build. No game files or GPU.

AI-assisted with Devin.

## Summary - treat half-zero, inverted, or non-power-of-two subgroup min/max ranges as malformed instead of trusting them for `requiredSubgroupSize` - keep `device_default` / `unknown_device` fallbacks when a default size is or is not available - add synthetic regressions for half-zero, mirror half-zero, inverted, non-power-of-two, and valid control ranges Item: SUBGROUP-MALFORMED-CAPS This carries forward the still-uncarried fix in old-pr/9881, originally written by Andretuta, reapplied and verified on current main. ## Tests Under the local machine coordination lock: - control: patched `subgroup_size_test` against the unpatched header fails at the first half-zero-range expectation - fixed: the same test compiles and exits 0: `subgroup size decision: AMD-like, NVIDIA-like, old RADV, limits, create-info chain and query OK` - `git diff --cached --check` — pass A full CMake configure is not possible in this shell because it does not initialize the Windows SDK environment; the test was instead compiled directly with the same MSVC 14.44 toolset and Vulkan SDK include path used by the existing configured build. No game files or GPU. AI-assisted with Devin.
lixonik reviewed 2026-11-26 08:47:46 +00:00
lixonik left a comment
No description provided.
The native Windows CMake build and `subgroup_size` CTest passed. I also compiled a separate 1,458-case CPU matrix over minimum, maximum and default properties, wave32/wave64 requests, and compute, mesh and fragment stages. The expected outcomes used power-of-two bounds checked with `std::has_single_bit`. The base had 414 mismatches and the PR had zero. No GPU or game files. AI-assisted.
real-rusher commented 2026-11-26 10:06:20 +00:00

Verified on main a73a57e1 (Ubuntu 24.04 x86-64, GCC 13, Ninja, no GPU). Merges cleanly. ctest -R '^subgroup_size$' passes with this PR. The PR's runtime/test/subgroup_size_test.cpp built against main's runtime/src/subgroup_size.h fails, so the new cases fail on main and pass with the fix.

AI-assisted: yes (Claude Code)

Verified on main a73a57e1 (Ubuntu 24.04 x86-64, GCC 13, Ninja, no GPU). Merges cleanly. ctest -R '^subgroup_size$' passes with this PR. The PR's runtime/test/subgroup_size_test.cpp built against main's runtime/src/subgroup_size.h fails, so the new cases fail on main and pass with the fix. AI-assisted: yes (Claude Code)
Tauwni commented 2026-11-26 12:55:04 +00:00

Tested a286c4898 on an Apple M3 (macOS 26.5.1), with the test programs built from this branch.

  • subgroup_size_test builds with Apple clang and passes: "subgroup size decision: AMD-like, NVIDIA-like, old RADV, limits, create-info chain and query OK" (main passes too).
  • The real ranges of the three Mac drivers are all valid powers of two, and the new checks keep them: MoltenVK 1.4.2 4..32, KosmicKrisp (Mesa 26.3.1) 32..32, llvmpipe 4..4.
  • scripts/run_gpu_tests.py gives the same results as main a73a57e13 on every driver: MoltenVK 195 pass / 70 skip (229 / 36 with LEONIDA_W64_EMULATE=1), KosmicKrisp 190 / 73, llvmpipe 177 / 90 (212 / 55 emulated). The failures are the known ones (#1724, #1518, #1774 on MoltenVK, #2229's on KosmicKrisp), none new.

AI-assisted (Claude Code). No game data.

Tested `a286c4898` on an Apple M3 (macOS 26.5.1), with the test programs built from this branch. - `subgroup_size_test` builds with Apple clang and passes: "subgroup size decision: AMD-like, NVIDIA-like, old RADV, limits, create-info chain and query OK" (`main` passes too). - The real ranges of the three Mac drivers are all valid powers of two, and the new checks keep them: MoltenVK 1.4.2 `4..32`, KosmicKrisp (Mesa 26.3.1) `32..32`, llvmpipe `4..4`. - `scripts/run_gpu_tests.py` gives the same results as `main` `a73a57e13` on every driver: MoltenVK 195 pass / 70 skip (229 / 36 with `LEONIDA_W64_EMULATE=1`), KosmicKrisp 190 / 73, llvmpipe 177 / 90 (212 / 55 emulated). The failures are the known ones (#1724, #1518, #1774 on MoltenVK, #2229's on KosmicKrisp), none new. AI-assisted (Claude Code). No game data.
DadaCap commented 2026-11-28 07:38:07 +00:00

Thanks for this! Closing it as a duplicate of #1651 after a maintainer check that compared the two diffs commit by commit, not just the titles.

This pull request is an exact copy of #1651 (the same diff, line for line), which is older. Keeping #1651 so the fix lands once.

If you think something here is not covered by #1651, say so and we'll reopen it.

AI-assisted (Claude Code), posted for DadaCap (maintainer).

Thanks for this! Closing it as a duplicate of #1651 after a maintainer check that compared the two diffs commit by commit, not just the titles. This pull request is an exact copy of #1651 (the same diff, line for line), which is older. Keeping #1651 so the fix lands once. If you think something here is not covered by #1651, say so and we'll reopen it. _AI-assisted (Claude Code), posted for DadaCap (maintainer)._
Sign in to join this conversation.
No description provided.