feat(agc): serve lane-keyed, pointer and runtime image-table columns #10193

Open
Celegans12 wants to merge 146 commits from upstream-pr/10193 into main
Celegans12 commented 2026-10-23 12:38:57 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Celegans12 on 2026-10-23T12:38:57Z.


What

Stacked on #9508, which retains #7642 and both dependency authors' original commits. Please review the device-image-table changes and the merge resolution.

With APS5_KEEP_UNEXPECTED_DEVICE_IMAGES=1, keep keys missed by the CPU pre-pass on the device image path. Resolve recorded misses so later dispatches can use pointer, indirect and GPU-derived runtime T# columns. Present settlement follows the existing GPU-path policy; heap availability follows the parent's extension-revision policy. Sampler support remains in #13928/#13929.

Merge current #9508 and main, preserving main's interpolation and feature-digest cache keys alongside device-table selection. Request format 57 records that selection for replay, accepts supported formats through 52 and 55, and rejects unsupported 50, 53, 54 and 56. Shader-cache format 75 separates the combined layout from the earlier formats. The reported title-scale cache growth remains unresolved.

The combined-stack scan reports 66 shared-line or export overlaps, including dependent #13928/#13929 and the request/cache-format branches; 142 conflicting branches could not be compared. Reconcile formats and shared changes as those PRs land.

Tested

Based on main 096c45570f and #9508. Windows 11 / MinGW-w64 GCC 15.2.0, Release with -DBUILD_TESTING=ON and SPIR-V Tools: 23 selected serializer, shader-cache, image-table, heap-slot and device-path tests passed three times on NVIDIA RTX 3080 Laptop / 610.62 with validation 1.4.363; no VUIDs or skips. The serializer test failed before recording the device-table flag and passed after the fix; it also checks version-55 compatibility and reserved-version rejection.

Ubuntu 24.04 WSL / Mesa 25.2.8 llvmpipe / LLVM 20.1.2, validation 1.4.363: nine cases passed three times, including the shader-cache and column tests; 14 heap-dependent cases skipped. No VUIDs were reported. Asynchronous userfaultfd write protection and native descriptor-heap coverage were unavailable.

Not tested: full suite, native Linux heap, current titles/FPS, persistent-cache growth, production windowed presentation or the external old-layer failure. A contributor measured an earlier head on a local title stack with additional experiments; that does not validate this head or settle cache growth.

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: #9508
  • Fixes: none
  • Unblocks: PPSA26344 #675
  • GPUs tested: NVIDIA RTX 3080 Laptop, 610.62, Windows 11; Mesa 25.2.8 llvmpipe / LLVM 20.1.2, Ubuntu 24.04 WSL
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4982851959 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/10193). Originally posted by [Celegans12](https://github.com/Celegans12) on 2026-10-23T12:38:57Z. --- ### What Stacked on #9508, which retains #7642 and both dependency authors' original commits. Please review the device-image-table changes and the merge resolution. With `APS5_KEEP_UNEXPECTED_DEVICE_IMAGES=1`, keep keys missed by the CPU pre-pass on the device image path. Resolve recorded misses so later dispatches can use pointer, indirect and GPU-derived runtime T# columns. Present settlement follows the existing GPU-path policy; heap availability follows the parent's extension-revision policy. Sampler support remains in #13928/#13929. Merge current #9508 and main, preserving main's interpolation and feature-digest cache keys alongside device-table selection. Request format 57 records that selection for replay, accepts supported formats through 52 and 55, and rejects unsupported 50, 53, 54 and 56. Shader-cache format 75 separates the combined layout from the earlier formats. The reported title-scale cache growth remains unresolved. The combined-stack scan reports 66 shared-line or export overlaps, including dependent #13928/#13929 and the request/cache-format branches; 142 conflicting branches could not be compared. Reconcile formats and shared changes as those PRs land. ### Tested Based on `main` 096c45570f and #9508. Windows 11 / MinGW-w64 GCC 15.2.0, Release with `-DBUILD_TESTING=ON` and SPIR-V Tools: 23 selected serializer, shader-cache, image-table, heap-slot and device-path tests passed three times on NVIDIA RTX 3080 Laptop / 610.62 with validation 1.4.363; no VUIDs or skips. The serializer test failed before recording the device-table flag and passed after the fix; it also checks version-55 compatibility and reserved-version rejection. Ubuntu 24.04 WSL / Mesa 25.2.8 llvmpipe / LLVM 20.1.2, validation 1.4.363: nine cases passed three times, including the shader-cache and column tests; 14 heap-dependent cases skipped. No VUIDs were reported. Asynchronous userfaultfd write protection and native descriptor-heap coverage were unavailable. Not tested: full suite, native Linux heap, current titles/FPS, persistent-cache growth, production windowed presentation or the external old-layer failure. A contributor measured an earlier head on a local title stack with additional experiments; that does not validate this head or settle cache growth. ### Checklist <!-- Rules behind each item: https://github.com/boykopovar/AnyPS5/blob/main/CONTRIBUTING.md --> - [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: #9508 - [x] Fixes: none - [x] Unblocks: PPSA26344 #675 - [x] GPUs tested: NVIDIA RTX 3080 Laptop, 610.62, Windows 11; Mesa 25.2.8 llvmpipe / LLVM 20.1.2, Ubuntu 24.04 WSL - [x] AI-assisted: yes
MarcZX10 commented 2026-10-23 12:45:11 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-23T12:45:11Z.

Review: CHANGES_REQUESTED


Reviewed the three-commit delta after #7642 head 594b34659a97084c2d8fe5cb29896f1f216b4cf6, as requested. The new pointer/indirect shader tests and the lane/pointer device-path tests cover useful portions, but the Tested section does not identify successful results on this PR head: it gives the 12/12 NVIDIA/lavapipe counts for #7642, then says the new tests fail on that base. The hosted checks on this head are only conventions/intake/labels; runtime jobs are skipped by policy. Please report exact-head results for the new tests, with the focused AGC validation-layer settings and no missing-layer/VUID output. In particular, agc_shader_device_runtime_address_columns verifies compilation/planning only; please add or provide a device-path regression proving a runtime-address T# is recorded as a miss, resolved at Present, and serves the correct texel in the following batch with APS5_KEEP_UNEXPECTED_DEVICE_IMAGES. The stack depends on #7642, whose current PR head is not mergeable with main, so refresh the stack and rerun its focused tests once that base is rebased before merge.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5628385195 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/10193#pullrequestreview-5628385195). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-23T12:45:11Z. **Review:** CHANGES_REQUESTED --- Reviewed the three-commit delta after #7642 head `594b34659a97084c2d8fe5cb29896f1f216b4cf6`, as requested. The new pointer/indirect shader tests and the lane/pointer device-path tests cover useful portions, but the Tested section does not identify successful results on this PR head: it gives the 12/12 NVIDIA/lavapipe counts for #7642, then says the new tests fail on that base. The hosted checks on this head are only conventions/intake/labels; runtime jobs are skipped by policy. Please report exact-head results for the new tests, with the focused AGC validation-layer settings and no missing-layer/VUID output. In particular, `agc_shader_device_runtime_address_columns` verifies compilation/planning only; please add or provide a device-path regression proving a runtime-address T# is recorded as a miss, resolved at Present, and serves the correct texel in the following batch with `APS5_KEEP_UNEXPECTED_DEVICE_IMAGES`. The stack depends on #7642, whose current PR head is not mergeable with main, so refresh the stack and rerun its focused tests once that base is rebased before merge.
adriadam10 commented 2026-10-28 14:42:32 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-28T14:42:32Z.

Review: CHANGES_REQUESTED


Reviewed the four commits after #7642 (295a49f641..7880ded9da).

  • core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp:3741-3742: drop the two expectFailure(... "GetImageResource dword 0 is not a valid runtime value" ...) checks for the run-time-address T# with the switch off, as @oneandonlydean asked on 2026-10-27. They assert that an unsupported shape throws and break as soon as it is supported; the device-column cases can stay.
  • Unanswered report from @mrfelek on Ghost of Yōtei with APS5_KEEP_UNEXPECTED_DEVICE_IMAGES=1: the shader disk cache went from 23 to 65 GB in 155 s. Every program is persisted twice (gpuResolvedImages=1, then the fallback with 0) and vertex modules are 6-9 MB each. Anything kept alive needs a stated bound and peak size before/after: please persist the eligibility verdict with the plan entry (or decide it before the first compile) so the discarded variant is not stored, and say how big the cache is for the same scene afterwards.
  • Merge order: this is stacked on #7642 (draft, conflicts with main) and #9508. Once they land, rebase the four commits and make sure the 3rdparty/Vulkan-Headers pointer in the combined diff comes only from a PR meant to change it.
<!-- greyfinch-sync:boykopovar/AnyPS5:review:5684513980 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/10193#pullrequestreview-5684513980). Originally posted by [adriadam10](https://github.com/adriadam10) on 2026-10-28T14:42:32Z. **Review:** CHANGES_REQUESTED --- Reviewed the four commits after #7642 (295a49f641..7880ded9da). - `core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp:3741-3742`: drop the two `expectFailure(... "GetImageResource dword 0 is not a valid runtime value" ...)` checks for the run-time-address T# with the switch off, as @oneandonlydean asked on 2026-10-27. They assert that an unsupported shape throws and break as soon as it is supported; the device-column cases can stay. - Unanswered report from @mrfelek on Ghost of Yōtei with `APS5_KEEP_UNEXPECTED_DEVICE_IMAGES=1`: the shader disk cache went from 23 to 65 GB in 155 s. Every program is persisted twice (`gpuResolvedImages=1`, then the fallback with 0) and vertex modules are 6-9 MB each. Anything kept alive needs a stated bound and peak size before/after: please persist the eligibility verdict with the plan entry (or decide it before the first compile) so the discarded variant is not stored, and say how big the cache is for the same scene afterwards. - Merge order: this is stacked on #7642 (draft, conflicts with `main`) and #9508. Once they land, rebase the four commits and make sure the `3rdparty/Vulkan-Headers` pointer in the combined diff comes only from a PR meant to change it.
adriadam10 commented 2026-10-29 17:17:03 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-29T17:17:03Z.

Review: CHANGES_REQUESTED


Still blocked, nothing new on the head since the last review (7880ded9da). Open points:

  • core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp:3741-3742: drop the two expectFailure(... "GetImageResource dword 0 is not a valid runtime value" ...) checks for the run-time-address T# with the switch off, as @oneandonlydean asked. They assert that an unsupported shape throws and break as soon as it is supported; the device-column cases can stay.
  • @mrfelek's report on Ghost of Yōtei with APS5_KEEP_UNEXPECTED_DEVICE_IMAGES=1 is unanswered: the shader disk cache went from 23 to 65 GB in 155 s because every program is persisted twice (gpuResolvedImages=1, then the fallback with 0), with 6-9 MB vertex modules. This needs a design change on your side: persist the eligibility verdict with the plan entry (or decide it before the first compile) so the discarded variant is not stored, and state the cache size for the same scene before/after.
  • Merge order: stacked on #7642 (draft, conflicts with main) and #9508. After they land, rebase the four commits and make sure the 3rdparty/Vulkan-Headers pointer in the combined diff comes only from a PR meant to change it.
<!-- greyfinch-sync:boykopovar/AnyPS5:review:5701997717 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/10193#pullrequestreview-5701997717). Originally posted by [adriadam10](https://github.com/adriadam10) on 2026-10-29T17:17:03Z. **Review:** CHANGES_REQUESTED --- Still blocked, nothing new on the head since the last review (7880ded9da). Open points: - `core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp:3741-3742`: drop the two `expectFailure(... "GetImageResource dword 0 is not a valid runtime value" ...)` checks for the run-time-address T# with the switch off, as @oneandonlydean asked. They assert that an unsupported shape throws and break as soon as it is supported; the device-column cases can stay. - @mrfelek's report on Ghost of Yōtei with `APS5_KEEP_UNEXPECTED_DEVICE_IMAGES=1` is unanswered: the shader disk cache went from 23 to 65 GB in 155 s because every program is persisted twice (`gpuResolvedImages=1`, then the fallback with 0), with 6-9 MB vertex modules. This needs a design change on your side: persist the eligibility verdict with the plan entry (or decide it before the first compile) so the discarded variant is not stored, and state the cache size for the same scene before/after. - Merge order: stacked on #7642 (draft, conflicts with `main`) and #9508. After they land, rebase the four commits and make sure the `3rdparty/Vulkan-Headers` pointer in the combined diff comes only from a PR meant to change it.
MarcZX10 commented 2026-10-31 13:14:58 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-31T13:14:58Z.

Review: CHANGES_REQUESTED


Re-checked — new head, changes requested

The new head updates the descriptor-heap revision gate, but the previously measured shader-cache growth remains unresolved and the current source still creates distinct ordinary and GPU-resolved shader variants.

What I ran

Reviewed head 8403a9b05c85c4fe6f276e816ab9cb1220e13746 against PR base 60bdb061356db736928eee431cd8bd4c9ba68036; the stack check reports #10193 clean when applied alone to current main cd087bd12c258cf6dbb82e203bafd20d9fe2596c, while dependency #7642 conflicts with current main. Environment: Linux x86_64, Python 3.11.2, GCC 12.2.0. I did not build or run GPU tests locally.

python3 tools/pr_precheck.py --repo boykopovar/AnyPS5 --pr 10193
git diff --check 60bdb061356db736928eee431cd8bd4c9ba68036...8403a9b05c85c4fe6f276e816ab9cb1220e13746

Results

Check Result
Diff whitespace and conventions Passed
Dependency and merge preview #10193 is clean when applied alone; #7642 conflicts with current main, so the stack is not ready to land. I am not requesting a rebase before its dependency is resolved.
ABI and test-quality helper scripts The precheck could not run these because their scripts are absent from the isolated PR checkout. This is not a code-test failure.
Hosted CI on head 8403a9b Windows, Linux/Windows/macOS relinker, ASAN, conventions, eligibility, portability, labels, and report jobs passed; Linux and specialized write-watch/register-context jobs were skipped; the macOS x86_64 relinker job remained in progress at final refresh.
GPU tests The author reports 18/18 focused CTests on a merged validation tree with shader caching disabled. I did not run them, and they do not measure disk-cache growth. An automated NVIDIA report on an earlier head is not treated as current-head evidence.
Descriptor-heap compatibility gate The current head uses the extension revision and validation-layer version; the older device-API-version concern is addressed in this head.
Unedited local precheck output
All conventions checks passed.
/usr/bin/python3: can't open file '/tmp/anyps5-pr-precheck/boykopovar-AnyPS5-pr-10193-8403a9b05c85/head-8403a9b05c85-40f72234/tools/pr_abi_audit.py': [Errno 2] No such file or directory
/usr/bin/python3: can't open file '/tmp/anyps5-pr-precheck/boykopovar-AnyPS5-pr-10193-8403a9b05c85/head-8403a9b05c85-40f72234/tools/pr_test_quality.py': [Errno 2] No such file or directory

git diff --check produced no output. The precheck confirmed both head and PR base were unchanged at completion.

Findings

Blocking

A contributor measured the shader cache growing from 23 GB to 65 GB in 155 seconds on earlier head 414f92ab8c with APS5_GPU_HEAP=1, APS5_GPU_PATH=1, and APS5_KEEP_UNEXPECTED_DEVICE_IMAGES=1. The author later said that the ordinary and heap variants were still both prepared and persisted, and that the scene had not been rerun or the growth fixed. On the current head, ShaderRegistry.cpp still prepares a normal entry and then an entry with gpuResolvedImages=true; CacheKey.hpp includes that flag, giving the two variants distinct cache identities. The current additions settle unexpected-key batches, but I found no cache-size bound or eviction that addresses the reported growth. Please prevent or bound persistence of discarded/duplicate variants, then rerun the same scene on the updated head and report cache growth and peak size. The older measurement is not presented as a measurement of this head.

Non-blocking

The new pointer/runtime-address tests and unexpected-batch settling cover additional behavior. The reported test runs disable the shader cache, so they do not resolve the blocking cache-growth finding.

Sources

Not verified

I did not rerun Ghost of Yōtei, measure cache growth on head 8403a9b, build, or independently run the focused GPU tests. I did not verify other GPUs or console behavior. The reported 23-to-65 GB result is from an older head; the current-head magnitude is unmeasured.

To get this to a good state

Prevent or bound duplicate/discarded variant persistence and report the same-scene cache measurement on the updated head. I will rerun the relevant checks and reassess that exact head.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5722852177 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/10193#pullrequestreview-5722852177). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-31T13:14:58Z. **Review:** CHANGES_REQUESTED --- # Re-checked — new head, changes requested The new head updates the descriptor-heap revision gate, but the previously measured shader-cache growth remains unresolved and the current source still creates distinct ordinary and GPU-resolved shader variants. ## What I ran Reviewed head `8403a9b05c85c4fe6f276e816ab9cb1220e13746` against PR base `60bdb061356db736928eee431cd8bd4c9ba68036`; the stack check reports #10193 clean when applied alone to current `main` `cd087bd12c258cf6dbb82e203bafd20d9fe2596c`, while dependency #7642 conflicts with current `main`. Environment: Linux x86_64, Python 3.11.2, GCC 12.2.0. I did not build or run GPU tests locally. ```sh python3 tools/pr_precheck.py --repo boykopovar/AnyPS5 --pr 10193 git diff --check 60bdb061356db736928eee431cd8bd4c9ba68036...8403a9b05c85c4fe6f276e816ab9cb1220e13746 ``` ## Results | Check | Result | |---|---| | Diff whitespace and conventions | Passed | | Dependency and merge preview | #10193 is clean when applied alone; #7642 conflicts with current `main`, so the stack is not ready to land. I am not requesting a rebase before its dependency is resolved. | | ABI and test-quality helper scripts | The precheck could not run these because their scripts are absent from the isolated PR checkout. This is not a code-test failure. | | Hosted CI on head `8403a9b` | Windows, Linux/Windows/macOS relinker, ASAN, conventions, eligibility, portability, labels, and report jobs passed; Linux and specialized write-watch/register-context jobs were skipped; the macOS x86_64 relinker job remained in progress at final refresh. | | GPU tests | The author reports 18/18 focused CTests on a merged validation tree with shader caching disabled. I did not run them, and they do not measure disk-cache growth. An automated NVIDIA report on an earlier head is not treated as current-head evidence. | | Descriptor-heap compatibility gate | The current head uses the extension revision and validation-layer version; the older device-API-version concern is addressed in this head. | <details><summary>Unedited local precheck output</summary> ```text All conventions checks passed. /usr/bin/python3: can't open file '/tmp/anyps5-pr-precheck/boykopovar-AnyPS5-pr-10193-8403a9b05c85/head-8403a9b05c85-40f72234/tools/pr_abi_audit.py': [Errno 2] No such file or directory /usr/bin/python3: can't open file '/tmp/anyps5-pr-precheck/boykopovar-AnyPS5-pr-10193-8403a9b05c85/head-8403a9b05c85-40f72234/tools/pr_test_quality.py': [Errno 2] No such file or directory ``` `git diff --check` produced no output. The precheck confirmed both head and PR base were unchanged at completion. </details> ## Findings ### Blocking A contributor measured the shader cache growing from 23 GB to 65 GB in 155 seconds on earlier head `414f92ab8c` with `APS5_GPU_HEAP=1`, `APS5_GPU_PATH=1`, and `APS5_KEEP_UNEXPECTED_DEVICE_IMAGES=1`. The author later said that the ordinary and heap variants were still both prepared and persisted, and that the scene had not been rerun or the growth fixed. On the current head, `ShaderRegistry.cpp` still prepares a normal entry and then an entry with `gpuResolvedImages=true`; `CacheKey.hpp` includes that flag, giving the two variants distinct cache identities. The current additions settle unexpected-key batches, but I found no cache-size bound or eviction that addresses the reported growth. Please prevent or bound persistence of discarded/duplicate variants, then rerun the same scene on the updated head and report cache growth and peak size. The older measurement is not presented as a measurement of this head. ### Non-blocking The new pointer/runtime-address tests and unexpected-batch settling cover additional behavior. The reported test runs disable the shader cache, so they do not resolve the blocking cache-growth finding. ## Sources - [Original 23 GB to 65 GB measurement](https://github.com/boykopovar/AnyPS5/pull/10193#issuecomment-6382996160) and [author's statement that the scene had not been rerun](https://github.com/boykopovar/AnyPS5/pull/10193#issuecomment-6538499976). - [Current shader registry prepares the ordinary and GPU-resolved entries](https://github.com/boykopovar/AnyPS5/blob/8403a9b05c85c4fe6f276e816ab9cb1220e13746/core/libs/prx/libSceAgcDriver/Execution/src/Driver/Shaders/ShaderRegistry.cpp#L1386-L1404). - [Current shader cache key includes `gpuResolvedImages`](https://github.com/boykopovar/AnyPS5/blob/8403a9b05c85c4fe6f276e816ab9cb1220e13746/core/shader/recompiler/CacheKey.hpp#L350-L370). - [Current unexpected-image expectation memo is host-thread-local](https://github.com/boykopovar/AnyPS5/blob/8403a9b05c85c4fe6f276e816ab9cb1220e13746/core/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/HeapStages.cpp#L780-L788). - [Current descriptor-heap revision policy](https://github.com/boykopovar/AnyPS5/blob/8403a9b05c85c4fe6f276e816ab9cb1220e13746/core/libs/prx/libSceAgcDriver/Execution/include/DescriptorHeapVersions.hpp#L9-L12). ## Not verified I did not rerun Ghost of Yōtei, measure cache growth on head `8403a9b`, build, or independently run the focused GPU tests. I did not verify other GPUs or console behavior. The reported 23-to-65 GB result is from an older head; the current-head magnitude is unmeasured. ## To get this to a good state Prevent or bound duplicate/discarded variant persistence and report the same-scene cache measurement on the updated head. I will rerun the relevant checks and reassess that exact head.
XairRrR commented 2026-11-02 21:07:41 +00:00 (Migrated from github.com)

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

Review: CHANGES_REQUESTED


Reviewed — changes requested

The merged tree builds and the tests the change reaches pass. Reverting the PR's planner change makes its new shader tests fail, as it should. One problem blocks: the agc_driver_presentation_pass_gpu_heap variant this stack registers fails tools/check_skips.py on lavapipe, the step main's Linux CI job runs after ctest.

What I ran

Head d2ec292f746d038b713f0b39a74d653322a1a6b4 merged into main 9090972b7e91fd266819cbd77a8b058e177b5682 with --no-ff, giving merged tree 602d26c5e88754cb806633947d3b9d83fea8fc18. The machine is Debian 13 (a VM with 32 vCPU, Xeon Gold 6136) with GCC 14.2.0 and lavapipe (Mesa 26.1.6, LLVM 19). It has no GPU and no VK_EXT_descriptor_heap.

git diff --check 9090972b7e91fd266819cbd77a8b058e177b5682...d2ec292f746d038b713f0b39a74d653322a1a6b4
python3 tools/check_conventions.py --base 9090972b7e91fd266819cbd77a8b058e177b5682
python3 tools/check_skips.py build/ctest.xml
ANYPS5_REQUIRE_VULKAN=1 GALLIUM_OVERRIDE_CPU_CAPS=avx ctest --test-dir build -V -R "agc_driver_presentation_pass_gpu_heap|agc_driver_device_image_path_unexpected|agc_driver_device_image_path_runtime_address|agc_driver_heap_draw_sample_heap$"
ANYPS5_REQUIRE_VULKAN=1 GALLIUM_OVERRIDE_CPU_CAPS=avx ctest --test-dir build -j8 --test-load 32 --output-on-failure -R "device_image|request_serializer|heap_template_budget|agc_shader_memory|agc_shader_device|agc_shader_table_trailer|agc_driver_heap_walk_memo|shader_disk_cache|descriptor_heap_versions|agc_driver_draw_relocate_user_values"
# negative control (see below)
ninja -C build -j32 -l32 agc_shader_memory_tests
ctest --test-dir build --output-on-failure -R "agc_shader_device_(pointer|runtime)"

Results

Check Result
git diff --check clean
check_conventions.py passed
Configure, build, libs passed
Tests the change reaches (3737 run by the job script) no new failures and no timeouts. The 9 known failures also fail on main.
check_skips.py failed: agc_driver_presentation_pass_gpu_heap is a new unexpected skip. guest_net_ctl is also flagged, but it skips on main too.
Validation-layer comparison (873 tests, layer loaded in 872, none missing) no new VUID- lines compared with main
Focused run: 24 device image, serializer, shader cache and table-column tests 18 passed and 6 skipped. The skips are every _gpu_path, _unexpected, _pointer, _runtime_address, _table_heap and _gpu_heap case, because lavapipe lacks VK_EXT_descriptor_heap.
Shader cache format, request serializer FormatVersion goes from 51 on main to 75. Requests are written at version 57; versions 53, 54 and 56 are rejected and 55 stays readable. request_serializer passes.
3rdparty/Vulkan-Headers pointer The bump (2fa2034 → 5d94bb4) comes only from #9508's 1be42301d4, which needs VK_EXT_descriptor_heap. This answers the earlier question about where the pointer comes from.
check_skips.py
error: agc_driver_presentation_pass_gpu_heap skipped
error: guest_net_ctl skipped
2 test(s) skipped for a reason that is not expected: the job lost that coverage and ctest still reports every test as passed
exit=1
agc_driver_presentation_pass_gpu_heap output (tail)
presentation source in host memory: skipped, the device offers no host memory type for the image
...
skipped, the device lacks VK_EXT_descriptor_heap, or the maintenance5, slot room and push data the GPU heap needs with it, so the GPU heap has nothing to run through
Test #1832: agc_driver_presentation_pass_gpu_heap ..........***Skipped   3.40 sec

Negative control

The PR's production change from main is too intertwined with the stacked #7642 and #9508 code to restore whole files. I reverted only this PR's own planner hunks in core/shader/recompiler/Optimization/src/ResourceTracker.cpp:

  • the PlanRuntimeAddressColumn call site at line 1977;
  • line 2053, which I put back to the pre-PR form if (!column.sampler && !column.address && !column.indirect && column.pointerHops.empty()).

Then I rebuilt agc_shader_memory_tests.

  • agc_shader_device_pointer_columns failed: the pointer column of a GPU-mode stage is not read through the device image table.
  • agc_shader_device_runtime_address_columns failed: GetImageResource dword 0 is not a valid runtime value; ....

I restored the file from the merged tree and rebuilt. Both tests pass again, and git status --porcelain is empty.

agc_driver_device_image_table includes the PR's new SettlesUnexpectedBatches case, and it passes here. The driver-level _unexpected, _pointer and _runtime_address cases skip on this machine, so I could not run a control for them.

Findings

Blocking

  • agc_driver_presentation_pass_gpu_heap fails check_skips.py on lavapipe: tests/PresentationPass.cpp#L793 and #L830-L834.
    • What happens: the _gpu_heap variant (from #9508 in this stack) first runs the non-heap suites, which print presentation source in host memory: skipped, the device offers no host memory type for the image. It then exits 77 for the missing descriptor heap.
    • Why the check rejects it: check_skips.py needs every skipped, line of a skipped test to match DEVICE_LIMITATION. "the device offers no ..." does not match, so the test counts as an unexpected skip and the script exits 1.
    • Impact: the same script runs right after ctest in main's Linux job (build.yml), also on lavapipe without VK_EXT_descriptor_heap. Merging as is should turn that step red. On main only the plain agc_driver_presentation_pass exists, and it passes, so nothing is flagged there.
    • Suggested fix (either works):
      • Reword line 793 to a form the checker accepts, for example skipped, the device has no host memory type for the image.
      • Or, in the GpuHeapEnabled() branch, check SkipWithoutDescriptorHeap() before running the non-heap suites, so the variant prints only the heap reason.

Non-blocking

  • The debt entry does not cover APS5_KEEP_UNEXPECTED_DEVICE_IMAGES: docs/dev/debt/libSceAgcDriver.md#L366.
    • The entry says only later draws take the CPU map and a dispatch is recorded again at once.
    • With the switch, neither happens. Draws and dispatches with unexpected keys keep reading zeros for each new key until the miss ring resolves it.
    • VulkanDevice::SettleDeviceImageMisses also makes each present wait for the GPU, which removes the overlap between frames.
    • ENVIRONMENT.md describes this, but the debt file is where the console difference belongs. Please add a sentence there.
  • Pointer, indirect and address columns now go to the device table under plain APS5_GPU_PATH: ResourceTracker.cpp#L2053 changes this for APS5_GPU_PATH without the keep switch, not only for the opt-in mode.
    • When their expectation is incomplete, the program now compiles a device variant first, falls back, and recompiles on the CPU map.
    • That is one more persisted variant per such program, which bears on the open cache-growth question.
    • Consider gating these columns on KeepsUnexpectedPrograms(), or say in the description that the plain GPU-path behaviour changes.
  • The checklist's Depends on line lists only #9508: the description, commit 44164d4438 and the 2026-11-01 commits say this branch carries two parent PRs. Please list #7642 on Depends on too, unless it has merged.
  • Cache growth is still open: I add no new evidence on the cache-growth finding from MarcZX10 and adriadam10.
    • mrfelek's latest same-scene measurement (2026-11-01) shows the growth bounded: +52% cache size and +30% programs, stopping when loading ends. It is not unbounded.
    • It applies only with the opt-in switches, and the author says the twin persistence is not fixed.

Not verified

  • Anything on a device with VK_EXT_descriptor_heap. Every _gpu_heap, _gpu_path, _unexpected, _pointer, _runtime_address and _table_heap case skips on lavapipe here, so this run did not reach the PR's runtime paths: the miss settle at present and the runtime-address column served from the table. The validation comparison does not cover them either.
  • Shader disk cache growth, and behaviour in titles.
  • Windows and MinGW builds.
  • That the present-time wait in SettleDeviceImageMisses keeps the lock order GuestMemory::GpuMutex → table mutex everywhere. I read only the call sites the PR adds, and those follow it.

To get this to a good state

  1. Make agc_driver_presentation_pass_gpu_heap skip with reasons check_skips.py accepts, by rewording line 793 or checking the heap first. Then confirm python3 tools/check_skips.py build/ctest.xml passes on lavapipe.
  2. Extend the device image table debt entry to cover APS5_KEEP_UNEXPECTED_DEVICE_IMAGES: zero reads and the present-time wait.
  3. Update Depends on with every open parent PR.
  4. Answer the open cache-growth change requests.
<!-- greyfinch-sync:boykopovar/AnyPS5:review:5743359592 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/10193#pullrequestreview-5743359592). Originally posted by [XairRrR](https://github.com/XairRrR) on 2026-11-02T21:07:41Z. **Review:** CHANGES_REQUESTED --- # Reviewed — changes requested The merged tree builds and the tests the change reaches pass. Reverting the PR's planner change makes its new shader tests fail, as it should. One problem blocks: the `agc_driver_presentation_pass_gpu_heap` variant this stack registers fails `tools/check_skips.py` on lavapipe, the step `main`'s Linux CI job runs after ctest. ## What I ran Head `d2ec292f746d038b713f0b39a74d653322a1a6b4` merged into `main` `9090972b7e91fd266819cbd77a8b058e177b5682` with `--no-ff`, giving merged tree `602d26c5e88754cb806633947d3b9d83fea8fc18`. The machine is Debian 13 (a VM with 32 vCPU, Xeon Gold 6136) with GCC 14.2.0 and lavapipe (Mesa 26.1.6, LLVM 19). It has no GPU and no `VK_EXT_descriptor_heap`. ``` git diff --check 9090972b7e91fd266819cbd77a8b058e177b5682...d2ec292f746d038b713f0b39a74d653322a1a6b4 python3 tools/check_conventions.py --base 9090972b7e91fd266819cbd77a8b058e177b5682 python3 tools/check_skips.py build/ctest.xml ANYPS5_REQUIRE_VULKAN=1 GALLIUM_OVERRIDE_CPU_CAPS=avx ctest --test-dir build -V -R "agc_driver_presentation_pass_gpu_heap|agc_driver_device_image_path_unexpected|agc_driver_device_image_path_runtime_address|agc_driver_heap_draw_sample_heap$" ANYPS5_REQUIRE_VULKAN=1 GALLIUM_OVERRIDE_CPU_CAPS=avx ctest --test-dir build -j8 --test-load 32 --output-on-failure -R "device_image|request_serializer|heap_template_budget|agc_shader_memory|agc_shader_device|agc_shader_table_trailer|agc_driver_heap_walk_memo|shader_disk_cache|descriptor_heap_versions|agc_driver_draw_relocate_user_values" # negative control (see below) ninja -C build -j32 -l32 agc_shader_memory_tests ctest --test-dir build --output-on-failure -R "agc_shader_device_(pointer|runtime)" ``` ## Results | Check | Result | |---|---| | `git diff --check` | clean | | `check_conventions.py` | passed | | Configure, build, `libs` | passed | | Tests the change reaches (3737 run by the job script) | no new failures and no timeouts. The 9 known failures also fail on `main`. | | `check_skips.py` | **failed**: `agc_driver_presentation_pass_gpu_heap` is a new unexpected skip. `guest_net_ctl` is also flagged, but it skips on `main` too. | | Validation-layer comparison (873 tests, layer loaded in 872, none missing) | no new `VUID-` lines compared with `main` | | Focused run: 24 device image, serializer, shader cache and table-column tests | 18 passed and 6 skipped. The skips are every `_gpu_path`, `_unexpected`, `_pointer`, `_runtime_address`, `_table_heap` and `_gpu_heap` case, because lavapipe lacks `VK_EXT_descriptor_heap`. | | Shader cache format, request serializer | `FormatVersion` goes from 51 on `main` to 75. Requests are written at version 57; versions 53, 54 and 56 are rejected and 55 stays readable. `request_serializer` passes. | | `3rdparty/Vulkan-Headers` pointer | The bump (`2fa2034` → `5d94bb4`) comes only from #9508's `1be42301d4`, which needs `VK_EXT_descriptor_heap`. This answers the earlier question about where the pointer comes from. | <details><summary>check_skips.py</summary> ``` error: agc_driver_presentation_pass_gpu_heap skipped error: guest_net_ctl skipped 2 test(s) skipped for a reason that is not expected: the job lost that coverage and ctest still reports every test as passed exit=1 ``` </details> <details><summary>agc_driver_presentation_pass_gpu_heap output (tail)</summary> ``` presentation source in host memory: skipped, the device offers no host memory type for the image ... skipped, the device lacks VK_EXT_descriptor_heap, or the maintenance5, slot room and push data the GPU heap needs with it, so the GPU heap has nothing to run through Test #1832: agc_driver_presentation_pass_gpu_heap ..........***Skipped 3.40 sec ``` </details> ## Negative control The PR's production change from main is too intertwined with the stacked #7642 and #9508 code to restore whole files. I reverted only this PR's own planner hunks in `core/shader/recompiler/Optimization/src/ResourceTracker.cpp`: - the `PlanRuntimeAddressColumn` call site at line 1977; - line 2053, which I put back to the pre-PR form `if (!column.sampler && !column.address && !column.indirect && column.pointerHops.empty())`. Then I rebuilt `agc_shader_memory_tests`. - `agc_shader_device_pointer_columns` failed: `the pointer column of a GPU-mode stage is not read through the device image table`. - `agc_shader_device_runtime_address_columns` failed: `GetImageResource dword 0 is not a valid runtime value; ...`. I restored the file from the merged tree and rebuilt. Both tests pass again, and `git status --porcelain` is empty. `agc_driver_device_image_table` includes the PR's new `SettlesUnexpectedBatches` case, and it passes here. The driver-level `_unexpected`, `_pointer` and `_runtime_address` cases skip on this machine, so I could not run a control for them. ## Findings ### Blocking - **`agc_driver_presentation_pass_gpu_heap` fails `check_skips.py` on lavapipe:** [tests/PresentationPass.cpp#L793](https://github.com/boykopovar/AnyPS5/blob/d2ec292f746d038b713f0b39a74d653322a1a6b4/core/libs/prx/libSceAgcDriver/tests/PresentationPass.cpp#L793) and [#L830-L834](https://github.com/boykopovar/AnyPS5/blob/d2ec292f746d038b713f0b39a74d653322a1a6b4/core/libs/prx/libSceAgcDriver/tests/PresentationPass.cpp#L830-L834). - **What happens:** the `_gpu_heap` variant (from #9508 in this stack) first runs the non-heap suites, which print `presentation source in host memory: skipped, the device offers no host memory type for the image`. It then exits 77 for the missing descriptor heap. - **Why the check rejects it:** `check_skips.py` needs every `skipped,` line of a skipped test to match [`DEVICE_LIMITATION`](https://github.com/boykopovar/AnyPS5/blob/9090972b7e91fd266819cbd77a8b058e177b5682/tools/check_skips.py#L7). "the device offers no ..." does not match, so the test counts as an unexpected skip and the script exits 1. - **Impact:** the same script runs right after ctest in `main`'s Linux job (`build.yml`), also on lavapipe without `VK_EXT_descriptor_heap`. Merging as is should turn that step red. On `main` only the plain `agc_driver_presentation_pass` exists, and it passes, so nothing is flagged there. - **Suggested fix (either works):** - Reword line 793 to a form the checker accepts, for example `skipped, the device has no host memory type for the image`. - Or, in the `GpuHeapEnabled()` branch, check `SkipWithoutDescriptorHeap()` before running the non-heap suites, so the variant prints only the heap reason. ### Non-blocking - **The debt entry does not cover `APS5_KEEP_UNEXPECTED_DEVICE_IMAGES`:** [docs/dev/debt/libSceAgcDriver.md#L366](https://github.com/boykopovar/AnyPS5/blob/d2ec292f746d038b713f0b39a74d653322a1a6b4/docs/dev/debt/libSceAgcDriver.md#L366). - The entry says only later draws take the CPU map and a dispatch is recorded again at once. - With the switch, neither happens. Draws and dispatches with unexpected keys keep reading zeros for each new key until the miss ring resolves it. - [`VulkanDevice::SettleDeviceImageMisses`](https://github.com/boykopovar/AnyPS5/blob/d2ec292f746d038b713f0b39a74d653322a1a6b4/core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp#L4243) also makes each present wait for the GPU, which removes the overlap between frames. - `ENVIRONMENT.md` describes this, but the debt file is where the console difference belongs. Please add a sentence there. - **Pointer, indirect and address columns now go to the device table under plain `APS5_GPU_PATH`:** [ResourceTracker.cpp#L2053](https://github.com/boykopovar/AnyPS5/blob/d2ec292f746d038b713f0b39a74d653322a1a6b4/core/shader/recompiler/Optimization/src/ResourceTracker.cpp#L2053) changes this for `APS5_GPU_PATH` without the keep switch, not only for the opt-in mode. - When their expectation is incomplete, the program now compiles a device variant first, falls back, and recompiles on the CPU map. - That is one more persisted variant per such program, which bears on the open cache-growth question. - Consider gating these columns on `KeepsUnexpectedPrograms()`, or say in the description that the plain GPU-path behaviour changes. - **The checklist's `Depends on` line lists only #9508:** the description, commit `44164d4438` and the 2026-11-01 commits say this branch carries two parent PRs. Please list #7642 on `Depends on` too, unless it has merged. - **Cache growth is still open:** I add no new evidence on the cache-growth finding from MarcZX10 and adriadam10. - mrfelek's latest same-scene measurement (2026-11-01) shows the growth bounded: +52% cache size and +30% programs, stopping when loading ends. It is not unbounded. - It applies only with the opt-in switches, and the author says the twin persistence is not fixed. ## Not verified - Anything on a device with `VK_EXT_descriptor_heap`. Every `_gpu_heap`, `_gpu_path`, `_unexpected`, `_pointer`, `_runtime_address` and `_table_heap` case skips on lavapipe here, so this run did not reach the PR's runtime paths: the miss settle at present and the runtime-address column served from the table. The validation comparison does not cover them either. - Shader disk cache growth, and behaviour in titles. - Windows and MinGW builds. - That the present-time wait in `SettleDeviceImageMisses` keeps the lock order `GuestMemory::GpuMutex` → table mutex everywhere. I read only the call sites the PR adds, and those follow it. ## To get this to a good state 1. Make `agc_driver_presentation_pass_gpu_heap` skip with reasons `check_skips.py` accepts, by rewording line 793 or checking the heap first. Then confirm `python3 tools/check_skips.py build/ctest.xml` passes on lavapipe. 2. Extend the device image table debt entry to cover `APS5_KEEP_UNEXPECTED_DEVICE_IMAGES`: zero reads and the present-time wait. 3. Update `Depends on` with every open parent PR. 4. Answer the open cache-growth change requests. <!-- anyps5-bots job=2247 head=d2ec292f746d038b713f0b39a74d653322a1a6b4 -->
MarcZX10 commented 2026-11-14 09:03:35 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-14T09:03:35Z.

Review: COMMENTED


Reviewed — comments

The PR combines broad descriptor heap, device image table, shader serialization, and merge-resolution changes; the prepared diff is too large to verify comprehensively in this review.

What I ran

  • Inspected the prepared description, commit list, manifest, and initial diff excerpt for head d2ec292f746d038b713f0b39a74d653322a1a6b4.
  • No build or tests were run.

Results

Check Result Note
Prepared artifacts passed Read description, commits, manifest, and diff excerpt
Source review not run Change spans many files and was not read comprehensively
Tests not run No commands executed

Findings

Blocking

None verified from the inspected excerpt.

Non-blocking

  • The description reports unresolved title-scale shader-cache growth and incomplete coverage for native Linux heap behavior, full-suite execution, and current titles. These remain open validation areas.

Not verified

  • Most changed source files and diff hunks were not read, so correctness, security, performance, and test coverage are not verified across the change.
  • files.json was not accessible through the available review reader; the manifest shows many changed files, including excluded files that were not inspected.
  • Author-reported test results were not independently run.

To get this to a good state

Nothing is required for this comment. Optional: complete targeted review of the remaining changed files and validate the unresolved scenarios described above.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5903331363 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/10193#pullrequestreview-5903331363). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-14T09:03:35Z. **Review:** COMMENTED --- # Reviewed — comments The PR combines broad descriptor heap, device image table, shader serialization, and merge-resolution changes; the prepared diff is too large to verify comprehensively in this review. ## What I ran - Inspected the prepared description, commit list, manifest, and initial diff excerpt for head `d2ec292f746d038b713f0b39a74d653322a1a6b4`. - No build or tests were run. ## Results | Check | Result | Note | |---|---|---| | Prepared artifacts | passed | Read description, commits, manifest, and diff excerpt | | Source review | not run | Change spans many files and was not read comprehensively | | Tests | not run | No commands executed | ## Findings ### Blocking None verified from the inspected excerpt. ### Non-blocking - The description reports unresolved title-scale shader-cache growth and incomplete coverage for native Linux heap behavior, full-suite execution, and current titles. These remain open validation areas. ## Not verified - Most changed source files and diff hunks were not read, so correctness, security, performance, and test coverage are not verified across the change. - `files.json` was not accessible through the available review reader; the manifest shows many changed files, including excluded files that were not inspected. - Author-reported test results were not independently run. ## To get this to a good state Nothing is required for this comment. Optional: complete targeted review of the remaining changed files and validate the unresolved scenarios described above.
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/10193:upstream-pr/10193'
git switch 'upstream-pr/10193'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'upstream-pr/10193'
git switch 'upstream-pr/10193'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/10193'
git switch 'upstream-pr/10193'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/10193'
git switch 'main'
git merge --squash 'upstream-pr/10193'
git switch 'main'
git merge --ff-only 'upstream-pr/10193'
git switch 'main'
git merge 'upstream-pr/10193'
git push origin 'main'
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!10193
No description provided.