perf(shader): fold integer compares by value sets and known bits #6176

Merged
mitul72 merged 3 commits from upstream-pr/6176 into main 2026-10-18 21:27:00 +00:00
mitul72 commented 2026-10-15 00:29:39 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by mitul72 on 2026-10-15T00:29:39Z.


What

Two commits.

Integer compare folding: IEqual32 and INotEqual32 against a constant fold when the other operand has a value set of at most 64 values (through shifts, bitfield extracts, and/or/xor/mul/umin with a constant, add and select) that excludes the constant or holds only it, or when a known bit of the operand contradicts the constant. Known bits come from constants, shifts and bitfield extracts by constants, and/or/xor, add (up to the first unknown bit), mul (trailing zeros), umin, select, phi and lane reads. ULessThan32 against a constant folds from the known-bit and value-set bounds. A fold pass computes known bits and value set once per compared operand, and a sum is not enumerated when its two operand sets hold more than 65 values together. All folds are identities of the operand's possible values; out-of-range M0 handling of the relative indexing lowerings is unchanged. With M0 = 4i + k, three of every four entries of an s_movrels/s_movreld compare chain fold away.

SPIR-V constant sharing: specialization emitted a new OpConstant per folded result. A folded value now reuses an existing constant of the same type and value for the operands the specialization decodes; other consumers (subgroup, extended instructions) keep their own definitions. An OpBitcast to its operand's type, or back to the type before a previous bitcast, becomes a copy. A compute program with one formatted load shrinks from 10730 to 1117 words, so the formatted-load sharing check now compares the words two more loads add with the words the first added.

Tests: IntegerFolding, additions to SpirvOptimizer, and the execution test RelativeIndexingKnownBits.

Tested

Linux, RX 9060 XT (RADV GFX12, local Mesa). Full ctest passes except agc_driver_tessellation, which segfaults inside RADV while linking pipeline libraries on unmodified upstream 703aa8f63 as well.

Performance, old base (upstream d53960612 + #454 + the 1D fix), Astro Bot hub, GPU busy per frame: 166 ms vs 172-179 ms (-4 to -5%); with APS5_LOOP_GUARD=64, 136 ms vs 141-143 ms. Not re-measured individually on 703aa8f63.

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none (the measurement base also included #454 and the 1D fix; the change itself is independent)
  • Unblocks: none
  • GPUs tested: AMD Radeon RX 9060 XT (RADV GFX12, local Mesa build), Linux
  • AI-assisted: yes

🤖 Generated with Claude Code

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4866398652 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6176). Originally posted by [mitul72](https://github.com/mitul72) on 2026-10-15T00:29:39Z. --- ### What Two commits. Integer compare folding: `IEqual32` and `INotEqual32` against a constant fold when the other operand has a value set of at most 64 values (through shifts, bitfield extracts, and/or/xor/mul/umin with a constant, add and select) that excludes the constant or holds only it, or when a known bit of the operand contradicts the constant. Known bits come from constants, shifts and bitfield extracts by constants, and/or/xor, add (up to the first unknown bit), mul (trailing zeros), umin, select, phi and lane reads. `ULessThan32` against a constant folds from the known-bit and value-set bounds. A fold pass computes known bits and value set once per compared operand, and a sum is not enumerated when its two operand sets hold more than 65 values together. All folds are identities of the operand's possible values; out-of-range M0 handling of the relative indexing lowerings is unchanged. With M0 = 4i + k, three of every four entries of an `s_movrels`/`s_movreld` compare chain fold away. SPIR-V constant sharing: specialization emitted a new `OpConstant` per folded result. A folded value now reuses an existing constant of the same type and value for the operands the specialization decodes; other consumers (subgroup, extended instructions) keep their own definitions. An `OpBitcast` to its operand's type, or back to the type before a previous bitcast, becomes a copy. A compute program with one formatted load shrinks from 10730 to 1117 words, so the formatted-load sharing check now compares the words two more loads add with the words the first added. Tests: `IntegerFolding`, additions to `SpirvOptimizer`, and the execution test `RelativeIndexingKnownBits`. ### Tested Linux, RX 9060 XT (RADV GFX12, local Mesa). Full `ctest` passes except `agc_driver_tessellation`, which segfaults inside RADV while linking pipeline libraries on unmodified upstream 703aa8f63 as well. Performance, old base (upstream d53960612 + #454 + the 1D fix), Astro Bot hub, GPU busy per frame: 166 ms vs 172-179 ms (-4 to -5%); with `APS5_LOOP_GUARD=64`, 136 ms vs 141-143 ms. Not re-measured individually on 703aa8f63. ### Checklist - [x] Based on current `main`; no other open PR implements the same functions - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except [technical debt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed under Silent stubs in their library's [technical debt](https://github.com/boykopovar/AnyPS5/tree/main/docs/dev/debt) file - [x] No notes, investigation `.md` files or images added to the repository (attach them to this PR) - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: none (the measurement base also included #454 and the 1D fix; the change itself is independent) - [x] Unblocks: none - [x] GPUs tested: AMD Radeon RX 9060 XT (RADV GFX12, local Mesa build), Linux - [x] AI-assisted: yes 🤖 Generated with [Claude Code](https://claude.com/claude-code)
github-actions[bot] commented 2026-10-15 07:33:06 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-15T07:33:06Z.


Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.

Pull request Conflicting files (lines on main) Same exports Same new files
PR 6644 core/libs/prx/libSceAgcDriver/tests/SpirvOptimizer.cpp L550

Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.

Pull request Shared files not compared
PR 1341 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 1368 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 1395 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 2434 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 4650 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 4891 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 5021 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/shader/recompiler/Optimization/include/Optimization/ConstantFolder.hpp
core/shader/recompiler/Optimization/src/ConstantFolder.cpp
PR 5371 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 5426 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 5499 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 5500 core/shader/recompiler/Optimization/src/ConstantFolder.cpp
PR 5925 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6044 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6185 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6186 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6192 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6234 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6280 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6300 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6320 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6360 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6412 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6481 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6486 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6499 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6501 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6503 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6535 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6747 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6763 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6788 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6808 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6868 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6937 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6941 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6946 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6947 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6963 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 7201 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 7223 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 7332 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 7395 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 7615 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 7642 core/libs/prx/libSceAgcDriver/CMakeLists.txt
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6186950492 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6176#issuecomment-6186950492). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-15T07:33:06Z. --- <!-- pr-overlap --> Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in **Depends on**. | Pull request | Conflicting files (lines on `main`) | Same exports | Same new files | |---|---|---|---| | [PR 6644](https://www.github.com/boykopovar/AnyPS5/pull/6644) | `core/libs/prx/libSceAgcDriver/tests/SpirvOptimizer.cpp` [L550](https://github.com/boykopovar/AnyPS5/blob/0d1c299a91bf492ad860fac691200ac6f101608f/core/libs/prx/libSceAgcDriver/tests/SpirvOptimizer.cpp#L550) | | | Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap. | Pull request | Shared files not compared | |---|---| | [PR 1341](https://www.github.com/boykopovar/AnyPS5/pull/1341) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 1368](https://www.github.com/boykopovar/AnyPS5/pull/1368) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 1395](https://www.github.com/boykopovar/AnyPS5/pull/1395) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 2434](https://www.github.com/boykopovar/AnyPS5/pull/2434) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 4650](https://www.github.com/boykopovar/AnyPS5/pull/4650) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 4891](https://www.github.com/boykopovar/AnyPS5/pull/4891) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 5021](https://www.github.com/boykopovar/AnyPS5/pull/5021) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt`<br>`core/shader/recompiler/Optimization/include/Optimization/ConstantFolder.hpp`<br>`core/shader/recompiler/Optimization/src/ConstantFolder.cpp` | | [PR 5371](https://www.github.com/boykopovar/AnyPS5/pull/5371) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 5426](https://www.github.com/boykopovar/AnyPS5/pull/5426) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 5499](https://www.github.com/boykopovar/AnyPS5/pull/5499) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 5500](https://www.github.com/boykopovar/AnyPS5/pull/5500) | `core/shader/recompiler/Optimization/src/ConstantFolder.cpp` | | [PR 5925](https://www.github.com/boykopovar/AnyPS5/pull/5925) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 6044](https://www.github.com/boykopovar/AnyPS5/pull/6044) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 6185](https://www.github.com/boykopovar/AnyPS5/pull/6185) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 6186](https://www.github.com/boykopovar/AnyPS5/pull/6186) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 6192](https://www.github.com/boykopovar/AnyPS5/pull/6192) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 6234](https://www.github.com/boykopovar/AnyPS5/pull/6234) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 6280](https://www.github.com/boykopovar/AnyPS5/pull/6280) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 6300](https://www.github.com/boykopovar/AnyPS5/pull/6300) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 6320](https://www.github.com/boykopovar/AnyPS5/pull/6320) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 6360](https://www.github.com/boykopovar/AnyPS5/pull/6360) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 6412](https://www.github.com/boykopovar/AnyPS5/pull/6412) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 6481](https://www.github.com/boykopovar/AnyPS5/pull/6481) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 6486](https://www.github.com/boykopovar/AnyPS5/pull/6486) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 6499](https://www.github.com/boykopovar/AnyPS5/pull/6499) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 6501](https://www.github.com/boykopovar/AnyPS5/pull/6501) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 6503](https://www.github.com/boykopovar/AnyPS5/pull/6503) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 6535](https://www.github.com/boykopovar/AnyPS5/pull/6535) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 6747](https://www.github.com/boykopovar/AnyPS5/pull/6747) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 6763](https://www.github.com/boykopovar/AnyPS5/pull/6763) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 6788](https://www.github.com/boykopovar/AnyPS5/pull/6788) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 6808](https://www.github.com/boykopovar/AnyPS5/pull/6808) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 6868](https://www.github.com/boykopovar/AnyPS5/pull/6868) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 6937](https://www.github.com/boykopovar/AnyPS5/pull/6937) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 6941](https://www.github.com/boykopovar/AnyPS5/pull/6941) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 6946](https://www.github.com/boykopovar/AnyPS5/pull/6946) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 6947](https://www.github.com/boykopovar/AnyPS5/pull/6947) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 6963](https://www.github.com/boykopovar/AnyPS5/pull/6963) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 7201](https://www.github.com/boykopovar/AnyPS5/pull/7201) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 7223](https://www.github.com/boykopovar/AnyPS5/pull/7223) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 7332](https://www.github.com/boykopovar/AnyPS5/pull/7332) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 7395](https://www.github.com/boykopovar/AnyPS5/pull/7395) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 7615](https://www.github.com/boykopovar/AnyPS5/pull/7615) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 7642](https://www.github.com/boykopovar/AnyPS5/pull/7642) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` |
Neithennn commented 2026-10-15 15:52:32 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Neithennn on 2026-10-15T15:52:32Z.


Windows NVIDIA run, since the description lists RADV only.

Windows 11 Pro 26200, NVIDIA GeForce RTX 4080 (driver 617.42), AMD Ryzen 7 5800X, WinLibs GCC 15.2.0 r7, Ninja, Release, bundled dependencies, BUILD_TESTING=ON, ANYPS5_NO_SHADER_CACHE=1. Head 088f9509b merged onto main 92e50418f; full build succeeds.

  • agc_integer_folding, agc_driver_relative_indexing_known_bits, agc_driver_relative_indexing, agc_driver_scalar_relative_indexing, agc_formatted_buffer_once, agc_formatted_buffer_byte_stores: pass.
  • Full ctest -j 8: 1296/1296, including agc_driver_tessellation. Unchanged main on the same machine: 1294/1294.

Correctness only; no performance measurement and no title run.

AI-assisted: yes (runs done with Claude Code).

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6196282657 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6176#issuecomment-6196282657). Originally posted by [Neithennn](https://github.com/Neithennn) on 2026-10-15T15:52:32Z. --- Windows NVIDIA run, since the description lists RADV only. Windows 11 Pro 26200, NVIDIA GeForce RTX 4080 (driver 617.42), AMD Ryzen 7 5800X, WinLibs GCC 15.2.0 r7, Ninja, Release, bundled dependencies, `BUILD_TESTING=ON`, `ANYPS5_NO_SHADER_CACHE=1`. Head `088f9509b` merged onto main `92e50418f`; full build succeeds. - `agc_integer_folding`, `agc_driver_relative_indexing_known_bits`, `agc_driver_relative_indexing`, `agc_driver_scalar_relative_indexing`, `agc_formatted_buffer_once`, `agc_formatted_buffer_byte_stores`: pass. - Full `ctest -j 8`: 1296/1296, including `agc_driver_tessellation`. Unchanged main on the same machine: 1294/1294. Correctness only; no performance measurement and no title run. AI-assisted: yes (runs done with Claude Code).
nicolasfalesy commented 2026-10-16 08:52:43 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by nicolasfalesy on 2026-10-16T08:52:43Z.


Tested on Linux (Arch), c++ (GCC) 16.2.1 20260810, Release, BUILD_TESTING=ON, main at 5d9dcc42d2ec5401aebd089028b8d4d7410a77b4. GPU tests ran on lavapipe (Mesa 26.2.2, llvmpipe with LLVM 22.1.8).

agc_driver_relative_indexing_known_bits (this PR's test) fails on main plus this PR (2 of 2):

AGC graphics: relative indexing with known M0 bits: wave32 lane 8 movrels_readfirstlane_add is 0x00000008, expected 0x0000180b

Most likely cause: lavapipe runs subgroups of 8 here (other tests print "subgroup size 8 does not hold exactly one wave32"), so a wave32 v_readfirstlane cannot see lane 0 from lane 8. Other wave32 tests skip on such devices, for example BitfieldMask.cpp:85 (if (device->Target().subgroupSize < Threads)). RelativeIndexingKnownBits.cpp:107-112 runs both Run(*device, 32, 32) and Run(*device, 64, 64) without that check.

Suggested fix: skip with VulkanTestSkipped when device->Target().subgroupSize is smaller than the wave.

Separately, this PR breaks two existing tests when merged with an older open PR (same main, lavapipe). Each PR alone passes, main alone passes, and each pair fails (2 of 2):

  1. With #5315, agc_shader_disk_cache fails:
variants that differ only in a folded constant specialized to different SPIR-V

This is the check at ShaderDiskCache.cpp:1381 of #5315 (require(rgba == bgra, ...)). Both PRs change SpirvSpecialization.cpp. Most likely cause: the new shareConstants() of this PR (called at SpirvSpecialization.cpp:558) merges constants with the same type and value, so which constant id survives can depend on the folded selector (4 or 6 in that test), and the two specialized modules then differ. Whichever PR lands second needs to keep the output independent of the selector or adjust the test.

  1. With #5353, agc_redundant_value_elimination fails:
  2 pure instructions repeat an earlier one in their block of the 1832-word module
a wave64 shader that reads one register in several float operations computes nothing twice in a block

The two PRs share no file (#5353 changes DescriptorBindingBuilder.cpp and SpirvRuntimeBuffer.cpp), so this is a behaviour interaction. I did not find the exact cause.

AI-assisted: yes

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6211823063 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6176#issuecomment-6211823063). Originally posted by [nicolasfalesy](https://github.com/nicolasfalesy) on 2026-10-16T08:52:43Z. --- Tested on Linux (Arch), `c++ (GCC) 16.2.1 20260810`, Release, `BUILD_TESTING=ON`, `main` at `5d9dcc42d2ec5401aebd089028b8d4d7410a77b4`. GPU tests ran on lavapipe (Mesa 26.2.2, llvmpipe with LLVM 22.1.8). `agc_driver_relative_indexing_known_bits` (this PR's test) fails on `main` plus this PR (2 of 2): ``` AGC graphics: relative indexing with known M0 bits: wave32 lane 8 movrels_readfirstlane_add is 0x00000008, expected 0x0000180b ``` Most likely cause: lavapipe runs subgroups of 8 here (other tests print "subgroup size 8 does not hold exactly one wave32"), so a wave32 `v_readfirstlane` cannot see lane 0 from lane 8. Other wave32 tests skip on such devices, for example `BitfieldMask.cpp:85` (`if (device->Target().subgroupSize < Threads)`). `RelativeIndexingKnownBits.cpp:107-112` runs both `Run(*device, 32, 32)` and `Run(*device, 64, 64)` without that check. Suggested fix: skip with `VulkanTestSkipped` when `device->Target().subgroupSize` is smaller than the wave. Separately, this PR breaks two existing tests when merged with an older open PR (same `main`, lavapipe). Each PR alone passes, `main` alone passes, and each pair fails (2 of 2): 1. With #5315, `agc_shader_disk_cache` fails: ``` variants that differ only in a folded constant specialized to different SPIR-V ``` This is the check at `ShaderDiskCache.cpp:1381` of #5315 (`require(rgba == bgra, ...)`). Both PRs change `SpirvSpecialization.cpp`. Most likely cause: the new `shareConstants()` of this PR (called at `SpirvSpecialization.cpp:558`) merges constants with the same type and value, so which constant id survives can depend on the folded selector (4 or 6 in that test), and the two specialized modules then differ. Whichever PR lands second needs to keep the output independent of the selector or adjust the test. 2. With #5353, `agc_redundant_value_elimination` fails: ``` 2 pure instructions repeat an earlier one in their block of the 1832-word module a wave64 shader that reads one register in several float operations computes nothing twice in a block ``` The two PRs share no file (#5353 changes `DescriptorBindingBuilder.cpp` and `SpirvRuntimeBuffer.cpp`), so this is a behaviour interaction. I did not find the exact cause. AI-assisted: yes
github-actions[bot] commented 2026-10-18 19:29:01 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-18T19:29:01Z.


This pull request is labeled perf, so it needs the summary line of a capture on main and one with the change, from the same title, scene and machine, as the Performance report form asks. Please paste both aps5-summary.jsonl lines, attach the two traces and add the output of tools/trace_digest.py.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6254166990 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6176#issuecomment-6254166990). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-18T19:29:01Z. --- <!-- pr-labels-perf --> This pull request is labeled `perf`, so it needs the summary line of a capture on `main` and one with the change, from the same title, scene and machine, as the Performance report form asks. Please paste both `aps5-summary.jsonl` lines, attach the two traces and add the output of `tools/trace_digest.py`.
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
boykopovar/AnyPS5!6176
No description provided.