Skip to content

subgroup_size: reject malformed device size ranges - #2216

Open
whoalin1 wants to merge 1 commit into
ProjectLeonida:mainfrom
whoalin1:subgroup-malformed-caps
Open

whoalin1 wants to merge 1 commit into
ProjectLeonida:mainfrom
whoalin1:subgroup-malformed-caps

Conversation

@whoalin1

Copy link
Copy Markdown
Contributor

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 lixonik 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.

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

Copy link
Copy Markdown

Verified on main a73a57e (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

Tauwni commented Nov 26, 2026

Copy link
Copy Markdown
Contributor

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

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

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.

4 participants