subgroup_size: reject malformed device size ranges #2216

Open
github-bot wants to merge 1 commit from github-bot/gh-2216 into main AGit
Owner

@⁠whoalin1 on GitHub · 2026-11-26 06:33 UTC · original
whoalin1:subgroup-malformed-caps → main · +75 −4 · 2 files · 1 commits · open

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.

**@⁠whoalin1** on GitHub · 2026-11-26 06:33 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/2216) `whoalin1:subgroup-malformed-caps` → `main` · +75 −4 · 2 files · 1 commits · open ## 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.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 10:22:35 +00:00
Author
Owner

@⁠lixonik on GitHub · 2026-11-26 08:47 UTC · original · reviewed

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.

**@⁠lixonik** on GitHub · 2026-11-26 08:47 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/2216#pullrequestreview-6070941886) · **reviewed** 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.
Author
Owner

@⁠real-rusher on GitHub · 2026-11-26 10:06 UTC · original

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)

**@⁠real-rusher** on GitHub · 2026-11-26 10:06 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/2216#issuecomment-7188913691) 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)
Author
Owner

@⁠Tauwni on GitHub · 2026-11-26 12:55 UTC · original

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.

**@⁠Tauwni** on GitHub · 2026-11-26 12:55 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/2216#issuecomment-7192629987) 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.
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/2216/head:github-bot/gh-2216'
git switch 'github-bot/gh-2216'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-2216'
git switch 'github-bot/gh-2216'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-2216'
git switch 'github-bot/gh-2216'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-2216'
git switch 'main'
git merge --squash 'github-bot/gh-2216'
git switch 'main'
git merge --ff-only 'github-bot/gh-2216'
git switch 'main'
git merge 'github-bot/gh-2216'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.