fix(vk): pin compute, task and mesh stages to 32 lanes only within maxComputeWorkgroupSubgroups #1556

Open
jcabarca wants to merge 2 commits from jcabarca/Longshot:fix/vk-subgroup-pin-limit into main
Contributor

Type: fix · Risk: low · Tested on: Windows 11 IoT Enterprise LTSC 24H2 (build 26100.9711), AMD Radeon RX 9070 XT, AMD Software: Adrenalin Edition 26.10.1 · Needs: none

TL;DR

On GPUs that can fix a shader to 32-lane groups, the emulator fixed every compute, task and mesh shader that way, even when the shader's workgroup is larger than 32 lanes times the number of groups the GPU allows in one workgroup. Vulkan forbids that, and such a pipeline can fail to build or misbehave. This PR pins a stage only when its workgroup fits, and translates the larger compute programs for a non-pinned subgroup. A new test fails on main and passes here.

Breakdown

  • Who it helps: players on a GPU that lists compute, task or mesh in requiredSubgroupSizeStages and whose maxComputeWorkgroupSubgroups is below 32
  • What was wrong: the 32-lane pin was chained on every listed stage without checking the workgroup against maxComputeWorkgroupSubgroups
  • What changes: a compute, task or mesh stage is pinned only when its workgroup is at most 32 times maxComputeWorkgroupSubgroups; an unpinned compute program takes the long warp path
  • What does not change: a GPU whose limit covers 1024 invocations (32 or more subgroups) pins exactly as before and keeps its shader cache; graphics stages without a workgroup are unchanged
  • How it was checked: a game-free test fails on main and passes here, and the checks that read the pin pass; the game runs normally on the test PC
  • What is still open: no GPU with a limit below 32 was at hand
  • Risk: low: an unpinned stage uses the profile main already uses on a GPU without the compute pin

Why

pin_subgroup chains requiredSubgroupSize 32 on every compute, task and mesh stage the GPU lists, without reading maxComputeWorkgroupSubgroups, which breaks VUID-VkPipelineShaderStageCreateInfo-pNext-02756 for any workgroup larger than 32 times that limit. See #1448, which changes the same profile_pinned().

How to reproduce

Seen on: not seen in the game: found by reading pin_subgroup() in gpu/vk/vk_draw.cpp. It applies to any GPU that lists compute, task or mesh in requiredSubgroupSizeStages with maxComputeWorkgroupSubgroups below the workgroup's invocations divided by 32 (the limit has no required minimum)
Settings and switches: defaults
Steps: game-free: python -I -B tests/test_subgroup_pin_limit.py --cxx clang++ on a main checkout with this PR's tests/test_subgroup_pin_limit.py; it compiles the pin code against stand-in Vulkan calls and a device with 16 subgroups per workgroup
Expected: a 1024 x 1 x 1 compute workgroup on that device gets no VkPipelineShaderStageRequiredSubgroupSizeCreateInfo
Actual: on main it is pinned: CHECK failed (1024 x 1 x 1, 16 subgroups): (ci.stage.pNext != nullptr) == pinned

What changed

The 32-lane pin now also checks the stage's workgroup against maxComputeWorkgroupSubgroups, and the translator emits an unpinned compute program for a non-pinned subgroup.

  • vk: gpu/vk/vk_internal.h: new dev.max_workgroup_subgroups and an inline pins_32(stage, invocations = 64): false unless the stage is in dev.sg32_stages; for compute, task and mesh, true only when invocations <= 32 * max_workgroup_subgroups.
  • vk: gpu/vk/vk_main.cpp: dev.max_workgroup_subgroups is read from VkPhysicalDeviceSubgroupSizeControlProperties::maxComputeWorkgroupSubgroups (core in 1.3, already in main's properties chain).
  • vk: gpu/vk/vk_draw.cpp: pin_subgroup() takes the workgroup's invocations and uses pins_32; the compute pipelines pass x * y * z.
  • vk: gpu/vk/vk_shader.cpp: profile_pinned(invocations) returns the pinned profile only when pins_32 holds, else profile(); profile_graphics() uses pins_32(stage); translate_into() passes the program's workgroup; translator_stamp() adds the limit only when 32 times it is below 1024, so other GPUs keep their caches.
  • tests: new tests/test_subgroup_pin_limit.py; test_amd_fragment_warp, test_amd_subgroup_profiles, test_compute_pin, test_pipeline_state_computes and test_precompile_compute_guard follow the new signatures.

The bug, step by step:

  1. On a GPU with subgroupSizeControl, dev.sg32_stages holds requiredSubgroupSizeStages.
  2. pin_subgroup() chains VkPipelineShaderStageRequiredSubgroupSizeCreateInfo with requiredSubgroupSize 32 on every stage in that mask.
  3. A guest compute workgroup can be up to 1024 x 1 x 1 invocations. maxComputeWorkgroupSubgroups has no required minimum (not in the required-limits table), so on a GPU whose limit is below 32 such a workgroup exceeds 32 times the limit, and the pipeline breaks 02756.
  4. Task and mesh workgroups are at most 63 threads (a 6-bit field), so they are pinned whenever the limit is at least 2.

The rules (validusage.json):

  • VUID-VkPipelineShaderStageCreateInfo-pNext-02756: "If a VkPipelineShaderStageRequiredSubgroupSizeCreateInfo structure is included in the pNext chain and stage is VK_SHADER_STAGE_COMPUTE_BIT, VK_SHADER_STAGE_MESH_BIT_EXT, or VK_SHADER_STAGE_TASK_BIT_EXT, the local workgroup size of the shader must be less than or equal to the product of VkPipelineShaderStageRequiredSubgroupSizeCreateInfo::requiredSubgroupSize and maxComputeWorkgroupSubgroups"
  • VUID-VkPipelineShaderStageCreateInfo-pNext-02755 (unchanged, still met): "If a VkPipelineShaderStageRequiredSubgroupSizeCreateInfo structure is included in the pNext chain, the subgroupSizeControl feature must be enabled, and stage must be a valid bit specified in requiredSubgroupSizeStages"
  • VUID-VkPipelineShaderStageCreateInfo-pNext-02757 (unchanged, still met): REQUIRE_FULL_SUBGROUPS is set only after the pin is kept and x is a multiple of 32, as on main.

Before (main):

const Shader::Profile& profile_pinned() {
    static const Shader::Profile p = [] {
        Shader::Profile q = profile();
        if (dev.sg32_stages & VK_SHADER_STAGE_COMPUTE_BIT) q.warp_size_potentially_larger_than_guest = false, q.max_subgroup_size = 32;
        return q;
    }();
    return p;
}

After:

const Shader::Profile& profile_pinned(uint64_t invocations = 64) {
    static const Shader::Profile p = [] {
        Shader::Profile q = profile();
        q.warp_size_potentially_larger_than_guest = false, q.max_subgroup_size = 32;
        return q;
    }();
    return pins_32(VK_SHADER_STAGE_COMPUTE_BIT, invocations) ? p : profile();
}

What the test checks: on devices with 32, 16 and 1 subgroups per workgroup, compute, task and mesh stages of several sizes get the pin struct only when the workgroup fits, full subgroups only when x is a multiple of 32; it also checks that the compute translation no longer takes the pinned profile whatever its workgroup.

Start reading at pins_32 in gpu/vk/vk_internal.h.

Measurements

Verdict: it fixes the bug: test_subgroup_pin_limit fails on main and passes here. Both interleaved runs gave the same result. No speed change is expected on a GPU whose limit covers 1024 invocations: it pins as before; elsewhere only the oversized workgroups lose the pin.

Hardware: Windows 11 IoT Enterprise LTSC 24H2 (build 26100.9711), AMD Radeon RX 9070 XT, AMD Software: Adrenalin Edition 26.10.1; the test is game-free (it compiles a cut-out of the pin code with llvm-mingw, it does not use the GPU); Python 3.12
Scene: none, game-free
Method: this PR's test run against each side's checkout, 2 runs each, interleaved (main, PR, main, PR); the result is pass/fail, so the median is the result both runs gave
How to reproduce: python -I -B tests/test_subgroup_pin_limit.py --cxx clang++ from each side's checkout

Before: main @ 6fbeca96 After: this PR @ 3c96b782
tests/test_subgroup_pin_limit.py, run 1 fails passes
tests/test_subgroup_pin_limit.py, run 2 fails passes
tests/test_subgroup_pin_limit.py, median fails passes
run 1, main @ 6fbeca96, test_subgroup_pin_limit: exit 1
CHECK failed (1024 x 1 x 1, 16 subgroups): (ci.stage.pNext != nullptr) == pinned
run 1, this PR @ 3c96b782, test_subgroup_pin_limit: exit 0
32-lane pins follow maxComputeWorkgroupSubgroups for compute, task and mesh stages ok
run 2, main @ 6fbeca96, test_subgroup_pin_limit: exit 1
CHECK failed (1024 x 1 x 1, 16 subgroups): (ci.stage.pNext != nullptr) == pinned
run 2, this PR @ 3c96b782, test_subgroup_pin_limit: exit 0
32-lane pins follow maxComputeWorkgroupSubgroups for compute, task and mesh stages ok

Flags and settings

None.

Testing

Tested: on this branch, Windows, Python 3.12, llvm-mingw clang++: test_subgroup_pin_limit passes (fails on main), and the checks that read the changed code pass: test_amd_fragment_warp, test_amd_subgroup_profiles, test_compute_pin, test_pipeline_state_computes, test_precompile_compute_guard, test_fallback_pipeline_state.

Built and played: this commit builds on Windows (llvm-mingw back end) and on Linux (longshot_vk.so, without and with AMD FSR 4). Played on Windows 11 IoT Enterprise LTSC 24H2 (build 26100.9711), AMD Radeon RX 9070 XT, AMD Software: Adrenalin Edition 26.10.1: the game runs normally.

Not tested: a GPU with maxComputeWorkgroupSubgroups below 32: the RX 9070 XT's limit covers 1024 invocations, so the unpinned path did not run on a GPU; the test covers it. Linux was built, not run.

Must be tested: None.

Risks

What could break: on a GPU whose limit is below 32, the larger compute programs are no longer pinned and take the long warp path, the one main already uses on a GPU without the compute pin; their shaders are translated again once (the cache key adds the limit only there). Other GPUs keep their pins and caches.

Turning it off: revert the commit.

Compatibility: Nothing changes on a GPU whose limit covers 1024 invocations. Elsewhere the shader cache is rebuilt once.

Checklist

Everyone

  • One topic.
  • The title is a Conventional Commit (type(scope): description) of the status line's type.
  • Why gives the reason plainly and links the issues that fit (the tracker searched). (no issue fits)
  • Tested on my own PC where it runs (in the game, for a change the game runs), as Testing's Tested says; what wasn't is in Not tested.
  • Measurements has a verdict, or one line saying why there is nothing to measure.
  • Nothing gets worse that I know of: any cost (speed, latency, memory, a setup that worked before) is measured and named in Measurements or Risks.
  • Testing names what was tested, what wasn't, and what must still be tested, where and how.
  • Rebased on current main.
  • python -I -B tests/run_all.py passes (any failure that also fails on main is named). (the checks that read the changed code, on this PR, Windows: all listed in Tested pass)
  • No game files, dumps, build output or generated files.
  • third_party/ untouched (a new folder with a PROVENANCE.md instead).
  • The license is OK: GPL-3.0-or-later, nothing incompatible and nothing decompiled.

When it applies

  • AI assistance recorded with Assisted-by: / Co-Authored-By: trailers.
  • A game-free test added for the fix, failing on main and passing here.
  • A check under tests/ that reads changed source updated in this PR, not weakened. (five checks follow the new pin_subgroup and profile_pinned signatures)
  • Host code builds on both Windows (llvm-mingw) and Linux, with UTF-8 paths.
**Type:** fix · **Risk:** low · **Tested on:** Windows 11 IoT Enterprise LTSC 24H2 (build 26100.9711), AMD Radeon RX 9070 XT, AMD Software: Adrenalin Edition 26.10.1 · **Needs:** none ## TL;DR On GPUs that can fix a shader to 32-lane groups, the emulator fixed every compute, task and mesh shader that way, even when the shader's workgroup is larger than 32 lanes times the number of groups the GPU allows in one workgroup. Vulkan forbids that, and such a pipeline can fail to build or misbehave. This PR pins a stage only when its workgroup fits, and translates the larger compute programs for a non-pinned subgroup. A new test fails on main and passes here. ## Breakdown - **Who it helps:** players on a GPU that lists compute, task or mesh in requiredSubgroupSizeStages and whose maxComputeWorkgroupSubgroups is below 32 - **What was wrong:** the 32-lane pin was chained on every listed stage without checking the workgroup against maxComputeWorkgroupSubgroups - **What changes:** a compute, task or mesh stage is pinned only when its workgroup is at most 32 times maxComputeWorkgroupSubgroups; an unpinned compute program takes the long warp path - **What does not change:** a GPU whose limit covers 1024 invocations (32 or more subgroups) pins exactly as before and keeps its shader cache; graphics stages without a workgroup are unchanged - **How it was checked:** a game-free test fails on main and passes here, and the checks that read the pin pass; the game runs normally on the test PC - **What is still open:** no GPU with a limit below 32 was at hand - **Risk:** low: an unpinned stage uses the profile main already uses on a GPU without the compute pin ## Why `pin_subgroup` chains `requiredSubgroupSize` 32 on every compute, task and mesh stage the GPU lists, without reading `maxComputeWorkgroupSubgroups`, which breaks VUID-VkPipelineShaderStageCreateInfo-pNext-02756 for any workgroup larger than 32 times that limit. See #1448, which changes the same `profile_pinned()`. ## How to reproduce **Seen on:** not seen in the game: found by reading `pin_subgroup()` in `gpu/vk/vk_draw.cpp`. It applies to any GPU that lists compute, task or mesh in `requiredSubgroupSizeStages` with `maxComputeWorkgroupSubgroups` below the workgroup's invocations divided by 32 (the limit has no required minimum) **Settings and switches:** defaults **Steps:** game-free: `python -I -B tests/test_subgroup_pin_limit.py --cxx clang++` on a main checkout with this PR's `tests/test_subgroup_pin_limit.py`; it compiles the pin code against stand-in Vulkan calls and a device with 16 subgroups per workgroup **Expected:** a 1024 x 1 x 1 compute workgroup on that device gets no `VkPipelineShaderStageRequiredSubgroupSizeCreateInfo` **Actual:** on main it is pinned: `CHECK failed (1024 x 1 x 1, 16 subgroups): (ci.stage.pNext != nullptr) == pinned` ## What changed The 32-lane pin now also checks the stage's workgroup against `maxComputeWorkgroupSubgroups`, and the translator emits an unpinned compute program for a non-pinned subgroup. - vk: `gpu/vk/vk_internal.h`: new `dev.max_workgroup_subgroups` and an inline `pins_32(stage, invocations = 64)`: false unless the stage is in `dev.sg32_stages`; for compute, task and mesh, true only when `invocations <= 32 * max_workgroup_subgroups`. - vk: `gpu/vk/vk_main.cpp`: `dev.max_workgroup_subgroups` is read from `VkPhysicalDeviceSubgroupSizeControlProperties::maxComputeWorkgroupSubgroups` (core in 1.3, already in main's properties chain). - vk: `gpu/vk/vk_draw.cpp`: `pin_subgroup()` takes the workgroup's invocations and uses `pins_32`; the compute pipelines pass x * y * z. - vk: `gpu/vk/vk_shader.cpp`: `profile_pinned(invocations)` returns the pinned profile only when `pins_32` holds, else `profile()`; `profile_graphics()` uses `pins_32(stage)`; `translate_into()` passes the program's workgroup; `translator_stamp()` adds the limit only when 32 times it is below 1024, so other GPUs keep their caches. - tests: new `tests/test_subgroup_pin_limit.py`; `test_amd_fragment_warp`, `test_amd_subgroup_profiles`, `test_compute_pin`, `test_pipeline_state_computes` and `test_precompile_compute_guard` follow the new signatures. The bug, step by step: 1. On a GPU with `subgroupSizeControl`, `dev.sg32_stages` holds `requiredSubgroupSizeStages`. 2. `pin_subgroup()` chains `VkPipelineShaderStageRequiredSubgroupSizeCreateInfo` with `requiredSubgroupSize` 32 on every stage in that mask. 3. A guest compute workgroup can be up to 1024 x 1 x 1 invocations. `maxComputeWorkgroupSubgroups` has no required minimum (not in the required-limits table), so on a GPU whose limit is below 32 such a workgroup exceeds 32 times the limit, and the pipeline breaks 02756. 4. Task and mesh workgroups are at most 63 threads (a 6-bit field), so they are pinned whenever the limit is at least 2. The rules (validusage.json): - VUID-VkPipelineShaderStageCreateInfo-pNext-02756: "If a VkPipelineShaderStageRequiredSubgroupSizeCreateInfo structure is included in the pNext chain and stage is VK_SHADER_STAGE_COMPUTE_BIT, VK_SHADER_STAGE_MESH_BIT_EXT, or VK_SHADER_STAGE_TASK_BIT_EXT, the local workgroup size of the shader must be less than or equal to the product of VkPipelineShaderStageRequiredSubgroupSizeCreateInfo::requiredSubgroupSize and maxComputeWorkgroupSubgroups" - VUID-VkPipelineShaderStageCreateInfo-pNext-02755 (unchanged, still met): "If a VkPipelineShaderStageRequiredSubgroupSizeCreateInfo structure is included in the pNext chain, the subgroupSizeControl feature must be enabled, and stage must be a valid bit specified in requiredSubgroupSizeStages" - VUID-VkPipelineShaderStageCreateInfo-pNext-02757 (unchanged, still met): `REQUIRE_FULL_SUBGROUPS` is set only after the pin is kept and x is a multiple of 32, as on main. Before (main): ```cpp const Shader::Profile& profile_pinned() { static const Shader::Profile p = [] { Shader::Profile q = profile(); if (dev.sg32_stages & VK_SHADER_STAGE_COMPUTE_BIT) q.warp_size_potentially_larger_than_guest = false, q.max_subgroup_size = 32; return q; }(); return p; } ``` After: ```cpp const Shader::Profile& profile_pinned(uint64_t invocations = 64) { static const Shader::Profile p = [] { Shader::Profile q = profile(); q.warp_size_potentially_larger_than_guest = false, q.max_subgroup_size = 32; return q; }(); return pins_32(VK_SHADER_STAGE_COMPUTE_BIT, invocations) ? p : profile(); } ``` What the test checks: on devices with 32, 16 and 1 subgroups per workgroup, compute, task and mesh stages of several sizes get the pin struct only when the workgroup fits, full subgroups only when x is a multiple of 32; it also checks that the compute translation no longer takes the pinned profile whatever its workgroup. Start reading at `pins_32` in `gpu/vk/vk_internal.h`. ## Measurements **Verdict:** it fixes the bug: `test_subgroup_pin_limit` fails on main and passes here. Both interleaved runs gave the same result. No speed change is expected on a GPU whose limit covers 1024 invocations: it pins as before; elsewhere only the oversized workgroups lose the pin. Hardware: Windows 11 IoT Enterprise LTSC 24H2 (build 26100.9711), AMD Radeon RX 9070 XT, AMD Software: Adrenalin Edition 26.10.1; the test is game-free (it compiles a cut-out of the pin code with llvm-mingw, it does not use the GPU); Python 3.12 Scene: none, game-free Method: this PR's test run against each side's checkout, 2 runs each, interleaved (main, PR, main, PR); the result is pass/fail, so the median is the result both runs gave How to reproduce: `python -I -B tests/test_subgroup_pin_limit.py --cxx clang++` from each side's checkout | | Before: main @ 6fbeca96 | After: this PR @ 3c96b782 | |---|---|---| | `tests/test_subgroup_pin_limit.py`, run 1 | fails | passes | | `tests/test_subgroup_pin_limit.py`, run 2 | fails | passes | | `tests/test_subgroup_pin_limit.py`, median | fails | passes | ``` run 1, main @ 6fbeca96, test_subgroup_pin_limit: exit 1 CHECK failed (1024 x 1 x 1, 16 subgroups): (ci.stage.pNext != nullptr) == pinned run 1, this PR @ 3c96b782, test_subgroup_pin_limit: exit 0 32-lane pins follow maxComputeWorkgroupSubgroups for compute, task and mesh stages ok run 2, main @ 6fbeca96, test_subgroup_pin_limit: exit 1 CHECK failed (1024 x 1 x 1, 16 subgroups): (ci.stage.pNext != nullptr) == pinned run 2, this PR @ 3c96b782, test_subgroup_pin_limit: exit 0 32-lane pins follow maxComputeWorkgroupSubgroups for compute, task and mesh stages ok ``` ### Flags and settings None. ## Testing **Tested:** on this branch, Windows, Python 3.12, llvm-mingw clang++: `test_subgroup_pin_limit` passes (fails on main), and the checks that read the changed code pass: `test_amd_fragment_warp`, `test_amd_subgroup_profiles`, `test_compute_pin`, `test_pipeline_state_computes`, `test_precompile_compute_guard`, `test_fallback_pipeline_state`. **Built and played:** this commit builds on Windows (llvm-mingw back end) and on Linux (`longshot_vk.so`, without and with AMD FSR 4). Played on Windows 11 IoT Enterprise LTSC 24H2 (build 26100.9711), AMD Radeon RX 9070 XT, AMD Software: Adrenalin Edition 26.10.1: the game runs normally. **Not tested:** a GPU with `maxComputeWorkgroupSubgroups` below 32: the RX 9070 XT's limit covers 1024 invocations, so the unpinned path did not run on a GPU; the test covers it. Linux was built, not run. **Must be tested:** None. ## Risks **What could break:** on a GPU whose limit is below 32, the larger compute programs are no longer pinned and take the long warp path, the one main already uses on a GPU without the compute pin; their shaders are translated again once (the cache key adds the limit only there). Other GPUs keep their pins and caches. **Turning it off:** revert the commit. **Compatibility:** Nothing changes on a GPU whose limit covers 1024 invocations. Elsewhere the shader cache is rebuilt once. ## Checklist ### Everyone - [x] One topic. - [x] The title is a Conventional Commit (`type(scope): description`) of the status line's type. - [x] Why gives the reason plainly and links the issues that fit (the tracker searched). (no issue fits) - [x] Tested on my own PC where it runs (in the game, for a change the game runs), as Testing's Tested says; what wasn't is in Not tested. - [x] Measurements has a verdict, or one line saying why there is nothing to measure. - [x] Nothing gets worse that I know of: any cost (speed, latency, memory, a setup that worked before) is measured and named in Measurements or Risks. - [x] Testing names what was tested, what wasn't, and what must still be tested, where and how. - [x] Rebased on current `main`. - [x] `python -I -B tests/run_all.py` passes (any failure that also fails on `main` is named). (the checks that read the changed code, on this PR, Windows: all listed in Tested pass) - [x] No game files, dumps, build output or generated files. - [x] `third_party/` untouched (a new folder with a `PROVENANCE.md` instead). - [x] The license is OK: GPL-3.0-or-later, nothing incompatible and nothing decompiled. ### When it applies - [x] AI assistance recorded with `Assisted-by:` / `Co-Authored-By:` trailers. - [x] A game-free test added for the fix, failing on `main` and passing here. - [x] A check under `tests/` that reads changed source updated in this PR, not weakened. (five checks follow the new `pin_subgroup` and `profile_pinned` signatures) - [x] Host code builds on both Windows (llvm-mingw) and Linux, with UTF-8 paths.
pin_subgroup chains requiredSubgroupSize 32 on compute, task and mesh stages whatever their workgroup; VUID-VkPipelineShaderStageCreateInfo-pNext-02756 limits the workgroup to requiredSubgroupSize * maxComputeWorkgroupSubgroups. Fails on main: a 1024-invocation compute workgroup is pinned on a device with 16 subgroups.

Assisted-by: GitHub Copilot
fix(vk): pin compute, task and mesh stages to 32 lanes only within maxComputeWorkgroupSubgroups
Some checks failed
Website / Website on Cloudflare (pull_request_target) Has been skipped
PR description / Description follows the template (pull_request_target) Successful in 7s
CI / Conventional Commit title (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been cancelled
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been cancelled
CI / Workflow lint (actionlint) (pull_request) Has been cancelled
Guide screenshots / Guide images and local UI source review (pull_request) Has been cancelled
Third-party parts / As their notes say (pull_request) Has been cancelled
Third-party parts / The same as upstream (pull_request) Has been cancelled
3c96b78262
VUID-VkPipelineShaderStageCreateInfo-pNext-02756 limits a workgroup with requiredSubgroupSize to requiredSubgroupSize * maxComputeWorkgroupSubgroups invocations. pin_subgroup pinned every compute, task and mesh stage the GPU listed; now pins_32 also checks the workgroup, and the translator takes the long warp path for an unpinned compute program.

Assisted-by: GitHub Copilot
Author
Contributor

Tested in game: Windows 11 IoT Enterprise LTSC 24H2 (build 26100.9711), AMD Radeon RX 9070 XT, AMD Software: Adrenalin Edition 26.10.1: played with this change; the game runs normally, no rendering errors or crashes seen.

Tested in game: Windows 11 IoT Enterprise LTSC 24H2 (build 26100.9711), AMD Radeon RX 9070 XT, AMD Software: Adrenalin Edition 26.10.1: played with this change; the game runs normally, no rendering errors or crashes seen.
jcabarca changed title from WIP: fix(vk): pin compute, task and mesh stages to 32 lanes only within maxComputeWorkgroupSubgroups to fix(vk): pin compute, task and mesh stages to 32 lanes only within maxComputeWorkgroupSubgroups 2026-11-18 06:09:01 +00:00
Author
Contributor

Rebased onto main @ 7daafa7a; the related tests pass on it.

Rebased onto main @ 7daafa7a; the related tests pass on it.
jcabarca force-pushed fix/vk-subgroup-pin-limit from 3c96b78262
Some checks failed
Website / Website on Cloudflare (pull_request_target) Has been skipped
PR description / Description follows the template (pull_request_target) Successful in 7s
CI / Conventional Commit title (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been cancelled
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been cancelled
CI / Workflow lint (actionlint) (pull_request) Has been cancelled
Guide screenshots / Guide images and local UI source review (pull_request) Has been cancelled
Third-party parts / As their notes say (pull_request) Has been cancelled
Third-party parts / The same as upstream (pull_request) Has been cancelled
to a9762fa447
Some checks are pending
CI / Conventional Commit title (pull_request) Blocked by required conditions
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Blocked by required conditions
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Blocked by required conditions
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Blocked by required conditions
CI / Workflow lint (actionlint) (pull_request) Blocked by required conditions
Guide screenshots / Guide images and local UI source review (pull_request) Blocked by required conditions
Third-party parts / As their notes say (pull_request) Blocked by required conditions
Third-party parts / The same as upstream (pull_request) Blocked by required conditions
Website / Website on Cloudflare (pull_request) Blocked by required conditions
PR description / Description follows the template (pull_request_target) Successful in 4s
2026-11-18 08:49:25 +00:00
Compare
Some checks are pending
CI / Conventional Commit title (pull_request) Blocked by required conditions
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Blocked by required conditions
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Blocked by required conditions
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Blocked by required conditions
CI / Workflow lint (actionlint) (pull_request) Blocked by required conditions
Guide screenshots / Guide images and local UI source review (pull_request) Blocked by required conditions
Third-party parts / As their notes say (pull_request) Blocked by required conditions
Third-party parts / The same as upstream (pull_request) Blocked by required conditions
Website / Website on Cloudflare (pull_request) Blocked by required conditions
PR description / Description follows the template (pull_request_target) Successful in 4s
This pull request doesn't have enough approvals yet. 0 of 1 approvals granted.
Some workflows are waiting to be reviewed.
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 'fix/vk-subgroup-pin-limit:jcabarca-fix/vk-subgroup-pin-limit'
git switch 'jcabarca-fix/vk-subgroup-pin-limit'
Sign in to join this conversation.
No reviewers
No milestone
No project
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.

Dependencies

No dependencies set

Reference
MagicBeanDev/Longshot!1556
No description provided.