fix(shader): fold descriptor web paths that hold the lane index or texels #12132

Merged
mrfelek merged 4 commits from upstream-pr/12132 into main 2026-11-03 08:10:05 +00:00
mrfelek commented 2026-10-27 22:31:46 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by mrfelek on 2026-10-27T22:31:46Z.


What

Follow-up to #8077. A descriptor web path whose T# dwords are per-lane values left in the registers was not rebuilt, and the read stopped with "GetImageResource dword 0 is not a valid runtime value". There are two kinds: the lane index from v_mbcnt, and arithmetic on texels from an image read. PPSA26344 compute shader 0x800037fe00 has a texel path into its waterfall loop, which #8077 does not fold.

  • HoldsControlValue becomes HoldsFoldableValue and also folds LaneId, ImageRead and the ImageSample* results. These paths select the first descriptor and record an InvalidDescriptor fault when a lane takes them, like the program counter, EXEC and lane mask paths. APS5_STRICT_DESCRIPTOR_WEBS still throws.
  • Folding exposed per-lane selections taken in the wrong order. When a tuple held selects from two blocks, the first one found became the outer selector even if it sat in the dominating block, so the inner selector in the later block did not dominate its use ("value IR instruction definition does not dominate its use"). WebSelector now takes the select in the latest block first.
  • The technical debt entry and ENVIRONMENT.md name the two new path kinds.

Tested

  • ShaderMemory: verifyDescriptorWebLaneIndexFold and verifyDescriptorWebSelectOrder fail without the change and pass with it.
  • agc_driver_descriptor_web_faults: 4 new lane-index cases (first arm, second arm, folded path faults at the read, no fault with no lane enabled).
  • On top of #8077 before it merged, on Linux (Ubuntu 26.10, RTX 3080 Ti, NVIDIA 615.71.09, validation layer, no shader cache): ctest -R "agc_shader_|image_table|descriptor_web" 40/40 pass, 0 VUID. The only log difference from #8077 alone is the expected fault of the folded case.
  • PPSA26344 (Ghost of Yōtei), cold run with #10228: no "not a valid runtime value" stops (all three shaders that hit it before get through), no faults. The run then stops at the existing unclamped blending NotImplemented, as on main.
  • Rebased onto current main (f759e165d9), Linux, GCC 13: ctest -R "agc_shader_|image_table|descriptor_web|request_serializer|agc_driver_graphics" passes, with the Vulkan tests (agc_driver_descriptor_web_faults, the image table tests, agc_shader_fusion) run on lavapipe.

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
  • Fixes: none
  • Unblocks: PPSA26344 #675
  • GPUs tested: NVIDIA GeForce RTX 3080 Ti, driver 615.71.09, Ubuntu 26.10
  • AI-assisted: yes

AI-assisted. Tested by me on my own machine.

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5042098520 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/12132). Originally posted by [mrfelek](https://github.com/mrfelek) on 2026-10-27T22:31:46Z. --- ### What Follow-up to #8077. A descriptor web path whose T# dwords are per-lane values left in the registers was not rebuilt, and the read stopped with "GetImageResource dword 0 is not a valid runtime value". There are two kinds: the lane index from `v_mbcnt`, and arithmetic on texels from an image read. PPSA26344 compute shader 0x800037fe00 has a texel path into its waterfall loop, which #8077 does not fold. - `HoldsControlValue` becomes `HoldsFoldableValue` and also folds `LaneId`, `ImageRead` and the `ImageSample*` results. These paths select the first descriptor and record an `InvalidDescriptor` fault when a lane takes them, like the program counter, EXEC and lane mask paths. `APS5_STRICT_DESCRIPTOR_WEBS` still throws. - Folding exposed per-lane selections taken in the wrong order. When a tuple held selects from two blocks, the first one found became the outer selector even if it sat in the dominating block, so the inner selector in the later block did not dominate its use ("value IR instruction definition does not dominate its use"). `WebSelector` now takes the select in the latest block first. - The technical debt entry and `ENVIRONMENT.md` name the two new path kinds. ### Tested - `ShaderMemory`: `verifyDescriptorWebLaneIndexFold` and `verifyDescriptorWebSelectOrder` fail without the change and pass with it. - `agc_driver_descriptor_web_faults`: 4 new lane-index cases (first arm, second arm, folded path faults at the read, no fault with no lane enabled). - On top of #8077 before it merged, on Linux (Ubuntu 26.10, RTX 3080 Ti, NVIDIA 615.71.09, validation layer, no shader cache): `ctest -R "agc_shader_|image_table|descriptor_web"` 40/40 pass, 0 VUID. The only log difference from #8077 alone is the expected fault of the folded case. - PPSA26344 (Ghost of Yōtei), cold run with #10228: no "not a valid runtime value" stops (all three shaders that hit it before get through), no faults. The run then stops at the existing unclamped blending `NotImplemented`, as on main. - Rebased onto current main (f759e165d9), Linux, GCC 13: `ctest -R "agc_shader_|image_table|descriptor_web|request_serializer|agc_driver_graphics"` passes, with the Vulkan tests (`agc_driver_descriptor_web_faults`, the image table tests, `agc_shader_fusion`) run on lavapipe. ### 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 - [x] Fixes: none - [x] Unblocks: PPSA26344 #675 - [x] GPUs tested: NVIDIA GeForce RTX 3080 Ti, driver 615.71.09, Ubuntu 26.10 - [x] AI-assisted: yes AI-assisted. Tested by me on my own machine.
Superseabas commented 2026-11-02 18:37:13 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Superseabas on 2026-11-02T18:37:13Z.

Review: APPROVED


Head e77dbfd892 merged onto current main b28bb77217 (clean merge, local only): code read, red/green check and a run on two Windows GPUs with GCC 16.2.

Windows 11 Home 10.0.26200, Ryzen 7 7700X, WinLibs GCC 16.2.0 (x86_64-ucrt-posix-seh, r3), Release, BUILD_TESTING=ON. ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation, ctest -R '^(agc_shader_.*|.*image_table.*|.*descriptor_web.*)$', ANYPS5_GPU selecting the device (confirmed by Selected GPU):

GPU Driver main merged
NVIDIA GeForce RTX 5070 Ti (10de:2c05) 621.01 57 of 57 57 of 57
AMD Radeon Graphics, Ryzen 7 7700X iGPU (1002:164e) AMD 26.10.1 57 of 57 57 of 57
  • No VUID- lines and no missing-layer line on either side.
  • agc_shader_memory and agc_driver_descriptor_web_faults: 3 of 3 on each GPU.
  • Red check: the merged tree with only ResourceTracker.cpp taken back from main fails both tests with GetImageResource dword 0 is not a valid runtime value, the stop the description names.
  • check_conventions.py --base main passes on the merge.

Read through the change: the three new kinds in HoldsFoldableValue (LaneId, ImageRead, the ImageSample* results) take the existing fold, the first descriptor plus an InvalidDescriptor fault, and APS5_STRICT_DESCRIPTOR_WEBS still throws. WebSelector now takes the selecting value from the latest block in BlockOrder, with the first one found kept on a tie as before, and the order map is built before it is first needed. The dead code pass after SplitDescriptorPhis runs only when a web was folded. It erases instructions from their blocks without freeing them, so the IrValue* keys in m_splitFailures and m_edgeSelectors cannot be reused by a new value. The debt entry and ENVIRONMENT.md name the two new kinds. I found nothing to change.

AI-assisted: yes (Claude Code)

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5741494438 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/12132#pullrequestreview-5741494438). Originally posted by [Superseabas](https://github.com/Superseabas) on 2026-11-02T18:37:13Z. **Review:** APPROVED --- Head `e77dbfd892` merged onto current `main` `b28bb77217` (clean merge, local only): code read, red/green check and a run on two Windows GPUs with GCC 16.2. Windows 11 Home 10.0.26200, Ryzen 7 7700X, WinLibs GCC 16.2.0 (`x86_64-ucrt-posix-seh`, r3), Release, `BUILD_TESTING=ON`. `ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation`, `ctest -R '^(agc_shader_.*|.*image_table.*|.*descriptor_web.*)$'`, `ANYPS5_GPU` selecting the device (confirmed by `Selected GPU`): | GPU | Driver | `main` | merged | |---|---|---|---| | NVIDIA GeForce RTX 5070 Ti (`10de:2c05`) | 621.01 | 57 of 57 | 57 of 57 | | AMD Radeon Graphics, Ryzen 7 7700X iGPU (`1002:164e`) | AMD 26.10.1 | 57 of 57 | 57 of 57 | - No `VUID-` lines and no missing-layer line on either side. - `agc_shader_memory` and `agc_driver_descriptor_web_faults`: 3 of 3 on each GPU. - Red check: the merged tree with only `ResourceTracker.cpp` taken back from `main` fails both tests with `GetImageResource dword 0 is not a valid runtime value`, the stop the description names. - `check_conventions.py --base main` passes on the merge. Read through the change: the three new kinds in `HoldsFoldableValue` (`LaneId`, `ImageRead`, the `ImageSample*` results) take the existing fold, the first descriptor plus an `InvalidDescriptor` fault, and `APS5_STRICT_DESCRIPTOR_WEBS` still throws. `WebSelector` now takes the selecting value from the latest block in `BlockOrder`, with the first one found kept on a tie as before, and the order map is built before it is first needed. The dead code pass after `SplitDescriptorPhis` runs only when a web was folded. It erases instructions from their blocks without freeing them, so the `IrValue*` keys in `m_splitFailures` and `m_edgeSelectors` cannot be reused by a new value. The debt entry and `ENVIRONMENT.md` name the two new kinds. I found nothing to change. AI-assisted: yes (Claude Code)
XairRrR commented 2026-11-02 21:49:08 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by XairRrR on 2026-11-02T21:49:08Z.

Review: APPROVED


Reviewed — approved

The fold for lane-index and texel descriptor web paths, the select-order fix and the dead code pass after a fold each make their own test pass, and each test fails when its part of the change is removed. Conventions, build and the focused Vulkan tests pass on lavapipe.

What I ran

Head e77dbfd892d1b153ea1aa847a0cc3725d4680b46 merged with --no-ff into main 9090972b7e91fd266819cbd77a8b058e177b5682 (merged tree 9312c56fd7653b413bf00b3b7ff91a01ff2bd953). Release build with GCC 14.2.0 on Debian 13, Vulkan through lavapipe (Mesa 26.1.6). No GPU.

git diff --check 9090972b7e91fd266819cbd77a8b058e177b5682...e77dbfd892d1b153ea1aa847a0cc3725d4680b46
python3 tools/check_conventions.py --base 9090972b7e91fd266819cbd77a8b058e177b5682
ctest --test-dir build -j8 --test-load 32 --output-on-failure -R "^(agc_shader_memory|agc_driver_descriptor_web_faults)$"
env ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 ctest --test-dir build -V -R "^agc_driver_descriptor_web_faults$"
# negative controls (see below), each followed by
ninja -C build -j32 -l32 agc_shader_memory_tests agc_driver_descriptor_web_faults_tests
env ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 ctest --test-dir build --output-on-failure -R "^(agc_shader_memory|agc_driver_descriptor_web_faults)$"
git status --porcelain

The bot also ran the selected tests and the Khronos validation comparison against main.

Results

Check Result
git diff --check clean
check_conventions.py All conventions checks passed
Configure / build / libs ok
Selected tests (bot run, 2031 run) 1913 passed, 111 skipped (all expected per check_skips.py), 0 new failures, 0 timeouts; 7 failures that also fail on main (agc_driver_division, the denormal-mode tests, unwrap_self, vector_constant_factor_tininess)
Vulkan validation vs main (757 tests) layer loaded in 756, missing in none; 0 tests with new VUIDs
agc_shader_memory passed, 8.3–9.2 s
agc_driver_descriptor_web_faults (ANYPS5_REQUIRE_VULKAN=1, no shader cache) passed, 0.7–0.8 s
agc_driver_descriptor_web_faults tail (merged tree)
[gpu] deferred write-back failed: BDA access failed: address=0x0 instruction=0xb0 bytes=0 stage=4 reason=8
[gpu] deferred write-back failed: BDA access failed: address=0xd2c00055bcf9a59c instruction=0xb0 bytes=0 stage=4 reason=8
[gpu] deferred write-back failed: BDA access failed: address=0x0 instruction=0xa8 bytes=0 stage=4 reason=8
descriptor web fault tests passed

The fault at instruction=0xa8 is the expected fault of the new folded lane-index case (LaneIndexSamplePc = 0xa8).

Negative control

I tried three reverts, one at a time, and restored the merged file after each:

  1. All of ResourceTracker.cpp taken from main: both tests fail with the stop the description names:
    GetImageResource dword 0 is not a valid runtime value; ... descriptor web: a descriptor dword is not rebuilt from user data, the SRT and uniform operations before the read (LaneId)
    
    This confirms the red check in Superseabas's review.
  2. Merged tracker without the if (m_foldedWeb) DeadCodeEliminator{}.Eliminate(m_program); block: agc_shader_memory fails with SrtWalker::EvaluateRuntimeSources failed to evaluate runtime sources: descriptor source 0 dword 0: Unreachable(null, null). This matches the commit's claim that verifyDescriptorWebTexelFold needs the extra pass.
  3. Merged tracker with the lane selector back to "first found" (if (lane == nullptr || index > laneOrder) replaced by if (lane == nullptr)): agc_shader_memory fails with Recompile: value IR instruction definition does not dominate its use. This matches the select-order claim.

agc_driver_descriptor_web_faults passes in controls 2 and 3, as expected: its new cases only cover the lane-index path. After the last restore and rebuild, both tests pass again and git status --porcelain is empty.

Findings

Blocking

None.

Non-blocking

  • ImageGatherRaw results are not folded (core/shader/recompiler/Optimization/src/ResourceTracker.cpp:1461-1471). HoldsFoldableValue now folds ImageRead and the three ImageSample* opcodes, but not ImageGatherRaw or the image atomics' returned values. A path whose T# dwords come from a gather still stops with "not a valid runtime value". It throws, so no rule is broken. However, the debt entry and ENVIRONMENT.md say "texels" in general. Either add ImageGatherRaw to the list or say "image reads and samples" in the two docs.
  • No test feeds a sample result into the T#. verifyDescriptorWebTexelFold covers only ImageRead (image_load). Whether an ImageSample* result reaches the fold through the ops that HoldsFoldableValue recurses into (IsRuntimeUniformOp, CompositeExtractU32x4) has no test. A case with image_sample in that arm would pin it. This is optional.

Not verified

  • Hardware GPUs: this machine has only lavapipe. The thread reports runs on NVIDIA (Linux and Windows) and AMD (RDNA 4, Windows; Ryzen iGPU), which I did not reproduce.
  • The PPSA26344 claim (all three shaders get through, then the stop at unclamped blending). No titles are run here.
  • That ordering by BlockOrder index always picks a dominated select. I checked it only for the tested two-block shape; a tuple whose selects sit in sibling blocks would reach the phi path instead.
<!-- greyfinch-sync:boykopovar/AnyPS5:review:5743882196 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/12132#pullrequestreview-5743882196). Originally posted by [XairRrR](https://github.com/XairRrR) on 2026-11-02T21:49:08Z. **Review:** APPROVED --- # Reviewed — approved The fold for lane-index and texel descriptor web paths, the select-order fix and the dead code pass after a fold each make their own test pass, and each test fails when its part of the change is removed. Conventions, build and the focused Vulkan tests pass on lavapipe. ## What I ran Head `e77dbfd892d1b153ea1aa847a0cc3725d4680b46` merged with `--no-ff` into `main` `9090972b7e91fd266819cbd77a8b058e177b5682` (merged tree `9312c56fd7653b413bf00b3b7ff91a01ff2bd953`). Release build with GCC 14.2.0 on Debian 13, Vulkan through lavapipe (Mesa 26.1.6). No GPU. ``` git diff --check 9090972b7e91fd266819cbd77a8b058e177b5682...e77dbfd892d1b153ea1aa847a0cc3725d4680b46 python3 tools/check_conventions.py --base 9090972b7e91fd266819cbd77a8b058e177b5682 ctest --test-dir build -j8 --test-load 32 --output-on-failure -R "^(agc_shader_memory|agc_driver_descriptor_web_faults)$" env ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 ctest --test-dir build -V -R "^agc_driver_descriptor_web_faults$" # negative controls (see below), each followed by ninja -C build -j32 -l32 agc_shader_memory_tests agc_driver_descriptor_web_faults_tests env ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 ctest --test-dir build --output-on-failure -R "^(agc_shader_memory|agc_driver_descriptor_web_faults)$" git status --porcelain ``` The bot also ran the selected tests and the Khronos validation comparison against `main`. ## Results | Check | Result | |---|---| | `git diff --check` | clean | | `check_conventions.py` | All conventions checks passed | | Configure / build / `libs` | ok | | Selected tests (bot run, 2031 run) | 1913 passed, 111 skipped (all expected per `check_skips.py`), 0 new failures, 0 timeouts; 7 failures that also fail on `main` (`agc_driver_division`, the denormal-mode tests, `unwrap_self`, `vector_constant_factor_tininess`) | | Vulkan validation vs `main` (757 tests) | layer loaded in 756, missing in none; 0 tests with new VUIDs | | `agc_shader_memory` | passed, 8.3–9.2 s | | `agc_driver_descriptor_web_faults` (`ANYPS5_REQUIRE_VULKAN=1`, no shader cache) | passed, 0.7–0.8 s | <details><summary>agc_driver_descriptor_web_faults tail (merged tree)</summary> ``` [gpu] deferred write-back failed: BDA access failed: address=0x0 instruction=0xb0 bytes=0 stage=4 reason=8 [gpu] deferred write-back failed: BDA access failed: address=0xd2c00055bcf9a59c instruction=0xb0 bytes=0 stage=4 reason=8 [gpu] deferred write-back failed: BDA access failed: address=0x0 instruction=0xa8 bytes=0 stage=4 reason=8 descriptor web fault tests passed ``` The fault at `instruction=0xa8` is the expected fault of the new folded lane-index case (`LaneIndexSamplePc = 0xa8`). </details> ## Negative control I tried three reverts, one at a time, and restored the merged file after each: 1. **All of `ResourceTracker.cpp` taken from `main`:** both tests fail with the stop the description names: ``` GetImageResource dword 0 is not a valid runtime value; ... descriptor web: a descriptor dword is not rebuilt from user data, the SRT and uniform operations before the read (LaneId) ``` This confirms the red check in Superseabas's review. 2. **Merged tracker without the `if (m_foldedWeb) DeadCodeEliminator{}.Eliminate(m_program);` block:** `agc_shader_memory` fails with `SrtWalker::EvaluateRuntimeSources failed to evaluate runtime sources: descriptor source 0 dword 0: Unreachable(null, null)`. This matches the commit's claim that `verifyDescriptorWebTexelFold` needs the extra pass. 3. **Merged tracker with the lane selector back to "first found"** (`if (lane == nullptr || index > laneOrder)` replaced by `if (lane == nullptr)`): `agc_shader_memory` fails with `Recompile: value IR instruction definition does not dominate its use`. This matches the select-order claim. `agc_driver_descriptor_web_faults` passes in controls 2 and 3, as expected: its new cases only cover the lane-index path. After the last restore and rebuild, both tests pass again and `git status --porcelain` is empty. ## Findings ### Blocking None. ### Non-blocking - **`ImageGatherRaw` results are not folded** (`core/shader/recompiler/Optimization/src/ResourceTracker.cpp:1461-1471`). `HoldsFoldableValue` now folds `ImageRead` and the three `ImageSample*` opcodes, but not `ImageGatherRaw` or the image atomics' returned values. A path whose T# dwords come from a gather still stops with "not a valid runtime value". It throws, so no rule is broken. However, the debt entry and `ENVIRONMENT.md` say "texels" in general. Either add `ImageGatherRaw` to the list or say "image reads and samples" in the two docs. - **No test feeds a sample result into the T#.** `verifyDescriptorWebTexelFold` covers only `ImageRead` (`image_load`). Whether an `ImageSample*` result reaches the fold through the ops that `HoldsFoldableValue` recurses into (`IsRuntimeUniformOp`, `CompositeExtractU32x4`) has no test. A case with `image_sample` in that arm would pin it. This is optional. ## Not verified - Hardware GPUs: this machine has only lavapipe. The thread reports runs on NVIDIA (Linux and Windows) and AMD (RDNA 4, Windows; Ryzen iGPU), which I did not reproduce. - The PPSA26344 claim (all three shaders get through, then the stop at unclamped blending). No titles are run here. - That ordering by `BlockOrder` index always picks a dominated select. I checked it only for the tested two-block shape; a tuple whose selects sit in sibling blocks would reach the phi path instead. <!-- anyps5-bots job=1918 head=e77dbfd892d1b153ea1aa847a0cc3725d4680b46 -->
XairRrR commented 2026-11-02 23:13:59 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by XairRrR on 2026-11-02T23:13:59Z.

Review: APPROVED


Re-checked — approved

The new commit b5f1d6b44d changes only docs. The debt entry and the APS5_STRICT_DESCRIPTOR_WEBS row now say "image read or sample result" instead of "texels", and they add that a path through a gather or through an image atomic's returned value still throws. This resolves my first non-blocking finding. The code is the same as at e77dbfd892, and it still builds and passes its tests on current main.

What changed since my last review

  • One new commit, b5f1d6b44d (docs only): docs/dev/debt/shader.md and docs/dev/ENVIRONMENT.md. git diff e77dbfd892..b5f1d6b44d touches just these two lines. The first three commits are identical to the ones I reviewed.
  • The author replied that they left the image_sample test out, and offered to add it.

What I ran

Head b5f1d6b44d0c7a1b84af0294ce531c53a3a3b64d merged with --no-ff into main 5cb015caaaaf83f8ee431414ee6a457b5b307d49 (merged tree 190318aa9f62115ea939dbcf6893d0afa7b8b1f2). Release build, GCC 14.2.0, Debian 13, Vulkan through lavapipe (Mesa 26.1.6). No GPU.

git diff --check 5cb015caaaaf83f8ee431414ee6a457b5b307d49...b5f1d6b44d0c7a1b84af0294ce531c53a3a3b64d
python3 tools/check_conventions.py --base 5cb015caaaaf83f8ee431414ee6a457b5b307d49
git diff e77dbfd892d1b153ea1aa847a0cc3725d4680b46 b5f1d6b44d0c7a1b84af0294ce531c53a3a3b64d --stat
# negative control: ResourceTracker.cpp from main
git show 5cb015caaaaf83f8ee431414ee6a457b5b307d49:core/shader/recompiler/Optimization/src/ResourceTracker.cpp > core/shader/recompiler/Optimization/src/ResourceTracker.cpp
ninja -C build -j32 -l32 agc_driver_image_sample_lod_clamp_tests agc_shader_memory_tests agc_driver_descriptor_web_faults_tests
env ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 ctest --test-dir build -j8 --test-load 32 --output-on-failure -R "^(agc_driver_image_sample_lod_clamp_shader_lane|agc_shader_memory|agc_driver_descriptor_web_faults)$"
# restore the merged file
git show 190318aa9f62115ea939dbcf6893d0afa7b8b1f2:core/shader/recompiler/Optimization/src/ResourceTracker.cpp > core/shader/recompiler/Optimization/src/ResourceTracker.cpp
ninja -C build -j32 -l32 agc_driver_image_sample_lod_clamp_tests agc_shader_memory_tests agc_driver_descriptor_web_faults_tests
env ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 ctest --test-dir build -j8 --test-load 32 --output-on-failure -R "^(agc_shader_memory|agc_driver_descriptor_web_faults)$"
git status --porcelain

The bot also built the merged tree, ran 2167 selected tests and compared the Khronos validation layer output with main.

Check Result
git diff --check clean
check_conventions.py All conventions checks passed
Configure / build / libs ok
Vulkan validation vs main (759 tests) layer loaded in 758, missing in none; 0 tests with new VUIDs
agc_shader_memory (merged) passed, 9.4 s
agc_driver_descriptor_web_faults (merged, no shader cache) passed, 0.8 s
Bot's selected tests: 2 "new" failures neither comes from this PR (see below)

The bot listed two "new failures". It compared against an older main baseline (096c45570f), so I checked both:

  • agc_driver_image_sample_lod_clamp_shader_lane still fails after ResourceTracker.cpp, the PR's only production file, is taken back from main. The message is the same: thread 0 component 1 is 0.000000, expected 0.062500. So it comes from main. One candidate is #12980 (min-LOD pinned level), merged after the baseline; I did not bisect.
  • unwrap_self … test_new_output_inherits_the_destination_directory_group fails at os.chown(..., -1, group) with EINVAL in the sandbox. This is a test under tools/tests, and the PR touches no file under tools/, so the failure is not the PR's.

Negative control: with ResourceTracker.cpp from main, agc_shader_memory and agc_driver_descriptor_web_faults both fail again with GetImageResource dword 0 is not a valid runtime value … (LaneId). With the merged file back, both pass, and git status --porcelain is empty.

Previous findings

  • Resolved: ImageGatherRaw and image atomic results are not folded, but the docs said "texels". Both docs now say "image read or sample result", and the debt entry says that a path through a gather or through an image atomic's returned value still throws. This matches the opcode list in HoldsFoldableValue, which is unchanged.
  • Still open (optional): no test feeds an ImageSample* result into the T#. The author left it out and offered to add it. It was optional, and it still does not block.

New findings

Blocking

None.

Non-blocking

None.

Not verified

  • Hardware GPUs: this machine has only lavapipe. The NVIDIA and AMD runs in the thread are on e77dbfd892. The new commit changes only docs, so they still apply to the code.
  • The PPSA26344 claim. No titles are run here.
<!-- greyfinch-sync:boykopovar/AnyPS5:review:5744771958 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/12132#pullrequestreview-5744771958). Originally posted by [XairRrR](https://github.com/XairRrR) on 2026-11-02T23:13:59Z. **Review:** APPROVED --- # Re-checked — approved The new commit `b5f1d6b44d` changes only docs. The debt entry and the `APS5_STRICT_DESCRIPTOR_WEBS` row now say "image read or sample result" instead of "texels", and they add that a path through a gather or through an image atomic's returned value still throws. This resolves my first non-blocking finding. The code is the same as at `e77dbfd892`, and it still builds and passes its tests on current `main`. ## What changed since my last review - One new commit, `b5f1d6b44d` (docs only): `docs/dev/debt/shader.md` and `docs/dev/ENVIRONMENT.md`. `git diff e77dbfd892..b5f1d6b44d` touches just these two lines. The first three commits are identical to the ones I reviewed. - The author replied that they left the `image_sample` test out, and offered to add it. ## What I ran Head `b5f1d6b44d0c7a1b84af0294ce531c53a3a3b64d` merged with `--no-ff` into `main` `5cb015caaaaf83f8ee431414ee6a457b5b307d49` (merged tree `190318aa9f62115ea939dbcf6893d0afa7b8b1f2`). Release build, GCC 14.2.0, Debian 13, Vulkan through lavapipe (Mesa 26.1.6). No GPU. ``` git diff --check 5cb015caaaaf83f8ee431414ee6a457b5b307d49...b5f1d6b44d0c7a1b84af0294ce531c53a3a3b64d python3 tools/check_conventions.py --base 5cb015caaaaf83f8ee431414ee6a457b5b307d49 git diff e77dbfd892d1b153ea1aa847a0cc3725d4680b46 b5f1d6b44d0c7a1b84af0294ce531c53a3a3b64d --stat # negative control: ResourceTracker.cpp from main git show 5cb015caaaaf83f8ee431414ee6a457b5b307d49:core/shader/recompiler/Optimization/src/ResourceTracker.cpp > core/shader/recompiler/Optimization/src/ResourceTracker.cpp ninja -C build -j32 -l32 agc_driver_image_sample_lod_clamp_tests agc_shader_memory_tests agc_driver_descriptor_web_faults_tests env ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 ctest --test-dir build -j8 --test-load 32 --output-on-failure -R "^(agc_driver_image_sample_lod_clamp_shader_lane|agc_shader_memory|agc_driver_descriptor_web_faults)$" # restore the merged file git show 190318aa9f62115ea939dbcf6893d0afa7b8b1f2:core/shader/recompiler/Optimization/src/ResourceTracker.cpp > core/shader/recompiler/Optimization/src/ResourceTracker.cpp ninja -C build -j32 -l32 agc_driver_image_sample_lod_clamp_tests agc_shader_memory_tests agc_driver_descriptor_web_faults_tests env ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 ctest --test-dir build -j8 --test-load 32 --output-on-failure -R "^(agc_shader_memory|agc_driver_descriptor_web_faults)$" git status --porcelain ``` The bot also built the merged tree, ran 2167 selected tests and compared the Khronos validation layer output with `main`. | Check | Result | |---|---| | `git diff --check` | clean | | `check_conventions.py` | All conventions checks passed | | Configure / build / `libs` | ok | | Vulkan validation vs `main` (759 tests) | layer loaded in 758, missing in none; 0 tests with new VUIDs | | `agc_shader_memory` (merged) | passed, 9.4 s | | `agc_driver_descriptor_web_faults` (merged, no shader cache) | passed, 0.8 s | | Bot's selected tests: 2 "new" failures | neither comes from this PR (see below) | The bot listed two "new failures". It compared against an older `main` baseline (`096c45570f`), so I checked both: - **`agc_driver_image_sample_lod_clamp_shader_lane`** still fails after `ResourceTracker.cpp`, the PR's only production file, is taken back from `main`. The message is the same: `thread 0 component 1 is 0.000000, expected 0.062500`. So it comes from `main`. One candidate is #12980 (min-LOD pinned level), merged after the baseline; I did not bisect. - **`unwrap_self … test_new_output_inherits_the_destination_directory_group`** fails at `os.chown(..., -1, group)` with `EINVAL` in the sandbox. This is a test under `tools/tests`, and the PR touches no file under `tools/`, so the failure is not the PR's. Negative control: with `ResourceTracker.cpp` from `main`, `agc_shader_memory` and `agc_driver_descriptor_web_faults` both fail again with `GetImageResource dword 0 is not a valid runtime value … (LaneId)`. With the merged file back, both pass, and `git status --porcelain` is empty. ## Previous findings - **Resolved:** `ImageGatherRaw` and image atomic results are not folded, but the docs said "texels". Both docs now say "image read or sample result", and the debt entry says that a path through a gather or through an image atomic's returned value still throws. This matches the opcode list in `HoldsFoldableValue`, which is unchanged. - **Still open (optional):** no test feeds an `ImageSample*` result into the T#. The author left it out and offered to add it. It was optional, and it still does not block. ## New findings ### Blocking None. ### Non-blocking None. ## Not verified - Hardware GPUs: this machine has only lavapipe. The NVIDIA and AMD runs in the thread are on `e77dbfd892`. The new commit changes only docs, so they still apply to the code. - The PPSA26344 claim. No titles are run here. <!-- anyps5-bots job=2699 head=b5f1d6b44d0c7a1b84af0294ce531c53a3a3b64d -->
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!12132
No description provided.