fix(agc): disturb a snapshot attempt by guest mappings only when its image views changed #15399

Closed
JJenkx wants to merge 5 commits from upstream-pr/15399 into main
JJenkx commented 2026-11-03 05:17:50 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by JJenkx on 2026-11-03T05:17:50Z.


What

A further empty-view case is now handled: when a capture contains neither registered image views nor table-view identities, unrelated generation churn no longer forces a stable-generation recheck. Descriptor-source identity is still checked first; a remap of descriptor backing still disturbs the attempt. Captures containing any view keep the generation bracket and all view checks. This follow-up is B-Howell's 63c8907c7942c27199e114c9c8808895bf67631d, adopted with their authorship and co-author attribution preserved.

A runtime resource snapshot is taken up to three times, and an attempt counts as disturbed when the image-view generation moves during it. That generation is GuestAllocationsGeneration, which every guest map or unmap anywhere advances, including ordinary heap traffic: the application heap's default malloc/free/realloc (ApplicationHeap.cpp) go through GuestHeap, whose every allocation and free opens a GuestAllocations::Mutation. A title that maps or unmaps memory while a snapshot is taken therefore disturbs every attempt, even when none of the image views the snapshot captured were touched, and the title ends with runtime resource snapshot did not stabilize.

Seen in Code Violet (PPSA26528) on main 128b5c49ba with per-attempt logging (a local diagnostic, not part of this PR): all three attempts were disturbed by the image generation alone, with the descriptor scope unchanged:

[snapdiag] snapshot did not stabilize: [attempt 0: tables 0 fill 0 images 1 scope 0->0->0] [attempt 1: tables 0 fill 0 images 1 scope 0->0->0] [attempt 2: tables 0 fill 0 images 1 scope 0->0->0]

Each captured image view already records the result of the GuestAllocationsLookup it was normalized from (range, allocation, backing serial, access flags). This adds an optional SrtRuntime::imageViewCurrent callback; ShaderMemory implements it by repeating that lookup and comparing every recorded field (a view captured without a range must still have none). When the generation moved during an attempt, Materialize now counts the attempt as disturbed only if one of the image views it captured, in registeredImages or in a table's resourceViews, is no longer current. A runtime without the callback keeps the old rule, and the exception path is unchanged. This matches how the recompile cache already keys a snapshot (Recompiler.cpp): it mixes every per-view lookup field and leaves the generation out. The recheck runs in a pass the generation must hold across, like the registered-view checks in the dispatch cache and graphics resources: if the generation moves during the pass, the pass runs once more, and if it moves again the attempt counts as disturbed. The snapshot keeps the generation of the pass that confirmed its views.

Descriptor memory is checked the same way. Every page the capture reads keeps the identity (address, size, backingSerial) of the guest allocation it was read from, and SrtRuntime::sourcesCurrent (ShaderMemory::sourcesCurrent) rechecks them at the start of each recheck pass: pages whose allocation changed are dropped from the capture's cache and the attempt is disturbed, so a retry reads fresh descriptor words. Allocations no read touched still do not disturb it.

Scope: the old rule also treated any unrelated mapping change as a disturbance. Reads of memory that is unmapped during an attempt still fail through readWords and the exception path, which keeps the generation check.

Tested

Current-main refresh: head 44498d7819bc7877520bb33a56391bed24a09024 is the four original PR commits rebased onto main 086c0686c8adff3ee648fdbe34e0b0b647e1d511, followed by B-Howell's empty-view fix/test. The original four patches are unchanged by rebase (range-diff attached).

Linux 7.2.11, GCC 16.2.1 Release: test-only negative 5f8ca565223e6930c5a6310201f764710ffd20b0 uses the same rebased old production code plus the new fixture. Both agc_shader_memory and agc_shader_type_zero_image_materialization fail with runtime resource snapshot did not stabilize. On the new head both pass with the ICD disabled, including the source-remap refusal and existing changed-view/backing-remap assertions. The no-view case verifies that source checks still run, no view checks run, the T# is retained, and no image-allocation generation is bound.

The same focused 15-case Vulkan suite passes 15/15 on main 086c068 and on this head, with ANYPS5_REQUIRE_VULKAN=1, ANYPS5_NO_SHADER_CACHE=1, the real Khronos validation layer, and the same profiling environment on the same RX 6650 XT/RADV 26.2.6 host. Layer insertion and GPU selection are confirmed; no skips or VUIDs, source/library hashes unchanged. Patch, raw paired logs, negative/positive fixtures and rebase proof, SHA-256 c330b2cd390cdc6ea240466bccac7cf4237c5edb4d4c30ab395f5c0ff8f0ef5a (internal manifest and upload digest verified). The negative fixture is also fetchable at JJenkx:evidence/pr15399-zero-view-negative-20261103. Conventions and whitespace checks pass.

These are new Linux host/GPU checks, not new Windows, God of War Ragnarök or FPS results. B-Howell's broader Windows/title observations remain attributed to their comment and original pins. Earlier title results and reviewer approvals below retain their original heads. Existing documented limitations are unchanged.

tests/ShaderMemory.cpp adds a capture whose pending-write query maps and unmaps an unrelated 64-byte guest allocation on every read, so the generation moves during every attempt while the captured views stay current. It must stabilize and capture the descriptor. On main 7feb37ee3e with only this test, the capture throws runtime resource snapshot did not stabilize; with this change all of agc_shader_memory_tests passes (Linux, GCC 16.2.1, Release).

verifyImageViewChangeDuringRecheck drives CaptureResources with a hand-built SrtRuntime whose first view check replaces the view's mapping before the recheck ends; the kept snapshot must hold the replaced mapping's identity and the current generation. On the previous head 6835d3db96 with only this test it fails (image view recheck: a snapshot kept a view whose mapping changed while the views were rechecked); with the change agc_shader_memory_tests passes.

A further block registers the SRT page as a guest allocation, reads it word by word, and once all eight T# words have been read rewrites the T# to another image and remaps the SRT's backing; the image allocations stay current. The kept snapshot must hold the new T# and not the old one. On the previous head 9391c9f155 with only this block it fails (descriptor backing: a capture kept descriptor words read before their memory was remapped); with the change agc_shader_memory_tests passes.

Code Violet (PPSA26528), same machine, scripted input, APS5_PROFILE_DRAW=1 (the profiler slows the snapshot, so profiled runs abort more often), 110 s per run, main and this change alternating:

runs aborted with runtime resource snapshot did not stabilize
main 128b5c49ba 3 1 (cv-ic-main3, exit 134)
this change, on main 7feb37ee3e 3 0

7feb37ee3e is 128b5c49ba plus 237 main commits, none of which changes ResourceMaterializer.cpp, SrtWalker.hpp or ShaderMemory.cpp. The abort is intermittent, so these counts alone are weak evidence. A local diagnostic build of this change (not part of this PR) counted the attempts in profiled runs: in two runs, 73,728 and 94,208 attempts, the guest allocation generation moved during 22 and 36 of them. Every one of those attempts still had all its captured image views current (0 views changed), so main would have retried each of them, and three in a row end the title. Neither run aborted. That is the case this change accepts and main retries.

No claim is made for Mortal Shell II (PPSA34008); its one snapshot abort could not be attributed.

Related AGC GPU tests on this change at 7a9ecdc365 (ctest -R "^agc_.*(snapshot|srt|descriptor|materializ|capture|shader_|bindless|resource|image|layer|registered)|^agc_driver_graphics$", with VK_LAYER_KHRONOS_validation, ANYPS5_REQUIRE_VULKAN=1, ANYPS5_NO_SHADER_CACHE=1, AMD Radeon RX 6650 XT): 204 of 204 pass, the layer is inserted in 122 of them, and there are no VUID- lines. On the previous head 9391c9f155 with only the new descriptor-backing block, the same set fails agc_shader_memory and agc_shader_type_zero_image_materialization; both run the function that holds the new tests.

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: PPSA26528 #6256 (snapshot aborts)
  • GPUs tested: AMD Radeon RX 6650 XT (RADV NAVI23), Mesa 26.2.6, Arch Linux
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5132292431 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/15399). Originally posted by [JJenkx](https://github.com/JJenkx) on 2026-11-03T05:17:50Z. --- ### What A further empty-view case is now handled: when a capture contains neither registered image views nor table-view identities, unrelated generation churn no longer forces a stable-generation recheck. Descriptor-source identity is still checked first; a remap of descriptor backing still disturbs the attempt. Captures containing any view keep the generation bracket and all view checks. This follow-up is B-Howell's `63c8907c7942c27199e114c9c8808895bf67631d`, adopted with their authorship and co-author attribution preserved. A runtime resource snapshot is taken up to three times, and an attempt counts as disturbed when the image-view generation moves during it. That generation is `GuestAllocationsGeneration`, which every guest map or unmap anywhere advances, including ordinary heap traffic: the application heap's default `malloc`/`free`/`realloc` (`ApplicationHeap.cpp`) go through `GuestHeap`, whose every allocation and free opens a `GuestAllocations::Mutation`. A title that maps or unmaps memory while a snapshot is taken therefore disturbs every attempt, even when none of the image views the snapshot captured were touched, and the title ends with `runtime resource snapshot did not stabilize`. Seen in Code Violet (PPSA26528) on `main` `128b5c49ba` with per-attempt logging (a local diagnostic, not part of this PR): all three attempts were disturbed by the image generation alone, with the descriptor scope unchanged: ``` [snapdiag] snapshot did not stabilize: [attempt 0: tables 0 fill 0 images 1 scope 0->0->0] [attempt 1: tables 0 fill 0 images 1 scope 0->0->0] [attempt 2: tables 0 fill 0 images 1 scope 0->0->0] ``` Each captured image view already records the result of the `GuestAllocationsLookup` it was normalized from (range, allocation, backing serial, access flags). This adds an optional `SrtRuntime::imageViewCurrent` callback; `ShaderMemory` implements it by repeating that lookup and comparing every recorded field (a view captured without a range must still have none). When the generation moved during an attempt, `Materialize` now counts the attempt as disturbed only if one of the image views it captured, in `registeredImages` or in a table's `resourceViews`, is no longer current. A runtime without the callback keeps the old rule, and the exception path is unchanged. This matches how the recompile cache already keys a snapshot (`Recompiler.cpp`): it mixes every per-view lookup field and leaves the generation out. The recheck runs in a pass the generation must hold across, like the registered-view checks in the dispatch cache and graphics resources: if the generation moves during the pass, the pass runs once more, and if it moves again the attempt counts as disturbed. The snapshot keeps the generation of the pass that confirmed its views. Descriptor memory is checked the same way. Every page the capture reads keeps the identity (address, size, `backingSerial`) of the guest allocation it was read from, and `SrtRuntime::sourcesCurrent` (`ShaderMemory::sourcesCurrent`) rechecks them at the start of each recheck pass: pages whose allocation changed are dropped from the capture's cache and the attempt is disturbed, so a retry reads fresh descriptor words. Allocations no read touched still do not disturb it. Scope: the old rule also treated any unrelated mapping change as a disturbance. Reads of memory that is unmapped during an attempt still fail through `readWords` and the exception path, which keeps the generation check. ### Tested Current-main refresh: head `44498d7819bc7877520bb33a56391bed24a09024` is the four original PR commits rebased onto main `086c0686c8adff3ee648fdbe34e0b0b647e1d511`, followed by B-Howell's empty-view fix/test. The original four patches are unchanged by rebase (range-diff attached). Linux 7.2.11, GCC 16.2.1 Release: test-only negative `5f8ca565223e6930c5a6310201f764710ffd20b0` uses the same rebased old production code plus the new fixture. Both `agc_shader_memory` and `agc_shader_type_zero_image_materialization` fail with `runtime resource snapshot did not stabilize`. On the new head both pass with the ICD disabled, including the source-remap refusal and existing changed-view/backing-remap assertions. The no-view case verifies that source checks still run, no view checks run, the T# is retained, and no image-allocation generation is bound. The same focused 15-case Vulkan suite passes 15/15 on main `086c068` and on this head, with `ANYPS5_REQUIRE_VULKAN=1`, `ANYPS5_NO_SHADER_CACHE=1`, the real Khronos validation layer, and the same profiling environment on the same RX 6650 XT/RADV 26.2.6 host. Layer insertion and GPU selection are confirmed; no skips or VUIDs, source/library hashes unchanged. [Patch, raw paired logs, negative/positive fixtures and rebase proof](https://github.com/JJenkx/AnyPS5/releases/download/linux-validation-20261023/pr15399-zero-view-44498d78-main086-20261103.tar.gz), SHA-256 `c330b2cd390cdc6ea240466bccac7cf4237c5edb4d4c30ab395f5c0ff8f0ef5a` (internal manifest and upload digest verified). The negative fixture is also fetchable at [`JJenkx:evidence/pr15399-zero-view-negative-20261103`](https://github.com/JJenkx/AnyPS5/tree/evidence/pr15399-zero-view-negative-20261103). Conventions and whitespace checks pass. These are new Linux host/GPU checks, not new Windows, God of War Ragnarök or FPS results. B-Howell's broader Windows/title observations remain attributed to their comment and original pins. Earlier title results and reviewer approvals below retain their original heads. Existing documented limitations are unchanged. `tests/ShaderMemory.cpp` adds a capture whose pending-write query maps and unmaps an unrelated 64-byte guest allocation on every read, so the generation moves during every attempt while the captured views stay current. It must stabilize and capture the descriptor. On `main` `7feb37ee3e` with only this test, the capture throws `runtime resource snapshot did not stabilize`; with this change all of `agc_shader_memory_tests` passes (Linux, GCC 16.2.1, Release). `verifyImageViewChangeDuringRecheck` drives `CaptureResources` with a hand-built `SrtRuntime` whose first view check replaces the view's mapping before the recheck ends; the kept snapshot must hold the replaced mapping's identity and the current generation. On the previous head `6835d3db96` with only this test it fails (`image view recheck: a snapshot kept a view whose mapping changed while the views were rechecked`); with the change `agc_shader_memory_tests` passes. A further block registers the SRT page as a guest allocation, reads it word by word, and once all eight T# words have been read rewrites the T# to another image and remaps the SRT's backing; the image allocations stay current. The kept snapshot must hold the new T# and not the old one. On the previous head `9391c9f155` with only this block it fails (`descriptor backing: a capture kept descriptor words read before their memory was remapped`); with the change `agc_shader_memory_tests` passes. Code Violet (PPSA26528), same machine, scripted input, `APS5_PROFILE_DRAW=1` (the profiler slows the snapshot, so profiled runs abort more often), 110 s per run, `main` and this change alternating: | | runs | aborted with `runtime resource snapshot did not stabilize` | |---|---|---| | `main` `128b5c49ba` | 3 | 1 (`cv-ic-main3`, exit 134) | | this change, on `main` `7feb37ee3e` | 3 | 0 | `7feb37ee3e` is `128b5c49ba` plus 237 `main` commits, none of which changes `ResourceMaterializer.cpp`, `SrtWalker.hpp` or `ShaderMemory.cpp`. The abort is intermittent, so these counts alone are weak evidence. A local diagnostic build of this change (not part of this PR) counted the attempts in profiled runs: in two runs, 73,728 and 94,208 attempts, the guest allocation generation moved during 22 and 36 of them. Every one of those attempts still had all its captured image views current (0 views changed), so `main` would have retried each of them, and three in a row end the title. Neither run aborted. That is the case this change accepts and `main` retries. No claim is made for Mortal Shell II (PPSA34008); its one snapshot abort could not be attributed. Related AGC GPU tests on this change at `7a9ecdc365` (`ctest -R "^agc_.*(snapshot|srt|descriptor|materializ|capture|shader_|bindless|resource|image|layer|registered)|^agc_driver_graphics$"`, with `VK_LAYER_KHRONOS_validation`, `ANYPS5_REQUIRE_VULKAN=1`, `ANYPS5_NO_SHADER_CACHE=1`, AMD Radeon RX 6650 XT): 204 of 204 pass, the layer is inserted in 122 of them, and there are no `VUID-` lines. On the previous head `9391c9f155` with only the new descriptor-backing block, the same set fails `agc_shader_memory` and `agc_shader_type_zero_image_materialization`; both run the function that holds the new tests. ### 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: PPSA26528 #6256 (snapshot aborts) - [x] GPUs tested: AMD Radeon RX 6650 XT (RADV NAVI23), Mesa 26.2.6, Arch Linux - [x] AI-assisted: yes
MarcZX10 commented 2026-11-03 05:22:46 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-03T05:22:46Z.

Review: CHANGES_REQUESTED


Reviewed — changes requested

The post-capture image-view validation can miss a mapping change that occurs during its own lookup pass, allowing a stale snapshot to be accepted.

What I ran

Reviewed all four changed files at head 6835d3db96406fffbe19d7111202e3fb29cda4f8, against PR base d1ae628bc2f62459cce1e9872ba5632c938c71f2. The no-build merge preview against that base was clean. Environment: Debian Linux x86_64, Python 3.11.2, GCC 12.2.0; no compiler or build was run.

python3 tools/pr_precheck.py --repo boykopovar/AnyPS5 --pr 15399
git diff --check d1ae628bc2f62459cce1e9872ba5632c938c71f2...6835d3db96406fffbe19d7111202e3fb29cda4f8
gh pr checks 15399 -R boykopovar/AnyPS5
git show 6835d3db96406fffbe19d7111202e3fb29cda4f8:core/libs/prx/libSceAgcDriver/tests/cmake/agc_shader_memory_tests.cmake | rg -n 'ShaderMemory\.cpp|agc_shader_memory'

Results

Check Result Note
Diff and conventions passed Exact-head whitespace and repository conventions passed.
Main merge preview passed Clean against the recorded PR base.
Test registration passed Existing agc_shader_memory_tests target includes this source.
Hosted policy checks not run Six policy checks were still queued at the final refresh.
Author GPU test report reported The author reports 204 focused tests on an AMD GPU; I did not reproduce them.
Build and CTest not run No local compilation or runtime tests.
Optional precheck audits not run Helper scripts are absent from the isolated PR snapshot.
Precheck checks and raw output
| Check | Status | Command / reason |
| Check | Status | Command / reason |
|---|---|---|
| build_and_compile | not_applicable | `The precheck deliberately does not configure, build, or compile AnyPS5.` |
| diff_check | passed | `git diff --check d1ae628bc2f62459cce1e9872ba5632c938c71f2...6835d3db96406fffbe19d7111202e3fb29cda4f8` |
| conventions_and_pr_template | passed | `/usr/bin/python3 tools/check_conventions.py --base d1ae628bc2f62459cce1e9872ba5632c938c71f2 --head 6835d3db96406fffbe19d7111202e3fb29cda4f8 --title fix(agc): disturb a snapshot attempt by guest mappings only when its image views changed --body /tmp/anyps5-pr-precheck/boykopovar-AnyPS5-pr-15399-6835d3db9640/pr-body.md` |
| changed_export_abi_audit | failed | `/usr/bin/python3 tools/pr_abi_audit.py --base d1ae628bc2f62459cce1e9872ba5632c938c71f2 --head 6835d3db96406fffbe19d7111202e3fb29cda4f8 --json` |
| python_syntax | not_applicable | `No changed Python implementation files.` |
| related_python_unit_tests | not_applicable | `No changed tools/ module has an existing sibling tools/tests/test_<module>.py suite.` |
| python_test_registration | not_applicable | `No changed test_*.py files.` |
| live_dependency_and_mergeability_check | passed | `/usr/bin/python3 /marc/AnyPS5/tools/pr_stack_check.py 15399 --repo boykopovar/AnyPS5 --output-dir /tmp/anyps5-pr-precheck/boykopovar-AnyPS5-pr-15399-6835d3db9640/stack` |
| build_dependent_cpp_tests | not_applicable | `Not run: C++ tests need exact-head binaries, which require a build; the precheck does not build.` |
| test_quality_heuristics | failed | `/usr/bin/python3 /tmp/anyps5-pr-precheck/boykopovar-AnyPS5-pr-15399-6835d3db9640/head-6835d3db9640-414c46fc/tools/pr_test_quality.py --root /tmp/anyps5-pr-precheck/boykopovar-AnyPS5-pr-15399-6835d3db9640/head-6835d3db9640-414c46fc --json core/libs/prx/libSceAgcDriver/Execution/src/ShaderMemory.cpp core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp core/shader/recompiler/Optimization/include/Optimization/SrtWalker.hpp core/shader/recompiler/Optimization/src/ResourceMaterializer.cpp` |
| negative_controls | not_applicable | `No changed Python test module in tools/ can be run as a no-build base-source control.` |

Precheck output:

/tmp/anyps5-pr-precheck/boykopovar-AnyPS5-pr-15399-6835d3db9640/report.md
/tmp/anyps5-pr-precheck/boykopovar-AnyPS5-pr-15399-6835d3db9640/report.json
Conclusion: checks failed
All conventions checks passed.
/usr/bin/python3: can't open file '/tmp/anyps5-pr-precheck/boykopovar-AnyPS5-pr-15399-6835d3db9640/head-6835d3db9640-414c46fc/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-15399-6835d3db9640/head-6835d3db9640-414c46fc/tools/pr_test_quality.py': [Errno 2] No such file or directory

Hosted check snapshot at final refresh:

conventions    pending    0    https://github.com/boykopovar/AnyPS5/actions/runs/41583090125/job/125742178682
eligibility    pending    0    https://github.com/boykopovar/AnyPS5/actions/runs/41583090119/job/125742177779
intake    pending    0    https://github.com/boykopovar/AnyPS5/actions/runs/41583090227/job/125742179692
labels    pending    0    https://github.com/boykopovar/AnyPS5/actions/runs/41583090201/job/125742179979
library-portability    pending    0    https://github.com/boykopovar/AnyPS5/actions/runs/41583090198/job/125742177924
report    pending    0    https://github.com/boykopovar/AnyPS5/actions/runs/41583090092/job/125742177409

Negative control

The author reports that the new regression fails on main commit 7feb37ee3e when run without this change, and that 204 focused tests passed on an AMD Radeon RX 6650 XT. I did not independently reproduce either result because both require building and running the C++ tests.

Findings

Blocking

At the end of the capture, afterImageGeneration is sampled before the imageViewCurrent callbacks run. If a captured image mapping changes after its identity was checked but before the lookup pass finishes, imagesMoved() can still return false and the snapshot is accepted even though that view is stale. The adjacent repository checks for registered views bracket their lookup loops with generation reads; this path does not. Please make the validation safe against a registry change during the revalidation pass, and add a regression where a captured view changes during that pass.

Non-blocking

None.

Sources

Not verified

I did not run a local build, CTest, GPU or console test, or an independent negative control. All six hosted policy checks were pending when last checked; no hosted AGC/shader test run was available. The optional ABI and test-quality helper scripts could not run in the isolated PR snapshot.

To get this to a good state

Ensure a relevant mapping change cannot slip past the view-validation pass, and add a regression that exercises a captured-view change during validation. I will rerun the no-build precheck and inspect the full diff on the new head; the focused C++/GPU checks should also be rerun there.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5747585817 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/15399#pullrequestreview-5747585817). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-03T05:22:46Z. **Review:** CHANGES_REQUESTED --- # Reviewed — changes requested The post-capture image-view validation can miss a mapping change that occurs during its own lookup pass, allowing a stale snapshot to be accepted. ## What I ran Reviewed all four changed files at head `6835d3db96406fffbe19d7111202e3fb29cda4f8`, against PR base `d1ae628bc2f62459cce1e9872ba5632c938c71f2`. The no-build merge preview against that base was clean. Environment: Debian Linux x86_64, Python 3.11.2, GCC 12.2.0; no compiler or build was run. ```sh python3 tools/pr_precheck.py --repo boykopovar/AnyPS5 --pr 15399 git diff --check d1ae628bc2f62459cce1e9872ba5632c938c71f2...6835d3db96406fffbe19d7111202e3fb29cda4f8 gh pr checks 15399 -R boykopovar/AnyPS5 git show 6835d3db96406fffbe19d7111202e3fb29cda4f8:core/libs/prx/libSceAgcDriver/tests/cmake/agc_shader_memory_tests.cmake | rg -n 'ShaderMemory\.cpp|agc_shader_memory' ``` ## Results | Check | Result | Note | |---|---|---| | Diff and conventions | passed | Exact-head whitespace and repository conventions passed. | | Main merge preview | passed | Clean against the recorded PR base. | | Test registration | passed | Existing `agc_shader_memory_tests` target includes this source. | | Hosted policy checks | not run | Six policy checks were still queued at the final refresh. | | Author GPU test report | reported | The author reports 204 focused tests on an AMD GPU; I did not reproduce them. | | Build and CTest | not run | No local compilation or runtime tests. | | Optional precheck audits | not run | Helper scripts are absent from the isolated PR snapshot. | <details><summary>Precheck checks and raw output</summary> ```text | Check | Status | Command / reason | | Check | Status | Command / reason | |---|---|---| | build_and_compile | not_applicable | `The precheck deliberately does not configure, build, or compile AnyPS5.` | | diff_check | passed | `git diff --check d1ae628bc2f62459cce1e9872ba5632c938c71f2...6835d3db96406fffbe19d7111202e3fb29cda4f8` | | conventions_and_pr_template | passed | `/usr/bin/python3 tools/check_conventions.py --base d1ae628bc2f62459cce1e9872ba5632c938c71f2 --head 6835d3db96406fffbe19d7111202e3fb29cda4f8 --title fix(agc): disturb a snapshot attempt by guest mappings only when its image views changed --body /tmp/anyps5-pr-precheck/boykopovar-AnyPS5-pr-15399-6835d3db9640/pr-body.md` | | changed_export_abi_audit | failed | `/usr/bin/python3 tools/pr_abi_audit.py --base d1ae628bc2f62459cce1e9872ba5632c938c71f2 --head 6835d3db96406fffbe19d7111202e3fb29cda4f8 --json` | | python_syntax | not_applicable | `No changed Python implementation files.` | | related_python_unit_tests | not_applicable | `No changed tools/ module has an existing sibling tools/tests/test_<module>.py suite.` | | python_test_registration | not_applicable | `No changed test_*.py files.` | | live_dependency_and_mergeability_check | passed | `/usr/bin/python3 /marc/AnyPS5/tools/pr_stack_check.py 15399 --repo boykopovar/AnyPS5 --output-dir /tmp/anyps5-pr-precheck/boykopovar-AnyPS5-pr-15399-6835d3db9640/stack` | | build_dependent_cpp_tests | not_applicable | `Not run: C++ tests need exact-head binaries, which require a build; the precheck does not build.` | | test_quality_heuristics | failed | `/usr/bin/python3 /tmp/anyps5-pr-precheck/boykopovar-AnyPS5-pr-15399-6835d3db9640/head-6835d3db9640-414c46fc/tools/pr_test_quality.py --root /tmp/anyps5-pr-precheck/boykopovar-AnyPS5-pr-15399-6835d3db9640/head-6835d3db9640-414c46fc --json core/libs/prx/libSceAgcDriver/Execution/src/ShaderMemory.cpp core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp core/shader/recompiler/Optimization/include/Optimization/SrtWalker.hpp core/shader/recompiler/Optimization/src/ResourceMaterializer.cpp` | | negative_controls | not_applicable | `No changed Python test module in tools/ can be run as a no-build base-source control.` | ``` Precheck output: ```text /tmp/anyps5-pr-precheck/boykopovar-AnyPS5-pr-15399-6835d3db9640/report.md /tmp/anyps5-pr-precheck/boykopovar-AnyPS5-pr-15399-6835d3db9640/report.json Conclusion: checks failed All conventions checks passed. /usr/bin/python3: can't open file '/tmp/anyps5-pr-precheck/boykopovar-AnyPS5-pr-15399-6835d3db9640/head-6835d3db9640-414c46fc/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-15399-6835d3db9640/head-6835d3db9640-414c46fc/tools/pr_test_quality.py': [Errno 2] No such file or directory ``` Hosted check snapshot at final refresh: ```text conventions pending 0 https://github.com/boykopovar/AnyPS5/actions/runs/41583090125/job/125742178682 eligibility pending 0 https://github.com/boykopovar/AnyPS5/actions/runs/41583090119/job/125742177779 intake pending 0 https://github.com/boykopovar/AnyPS5/actions/runs/41583090227/job/125742179692 labels pending 0 https://github.com/boykopovar/AnyPS5/actions/runs/41583090201/job/125742179979 library-portability pending 0 https://github.com/boykopovar/AnyPS5/actions/runs/41583090198/job/125742177924 report pending 0 https://github.com/boykopovar/AnyPS5/actions/runs/41583090092/job/125742177409 ``` </details> ## Negative control The author reports that the new regression fails on `main` commit `7feb37ee3e` when run without this change, and that 204 focused tests passed on an AMD Radeon RX 6650 XT. I did not independently reproduce either result because both require building and running the C++ tests. ## Findings ### Blocking At the end of the capture, `afterImageGeneration` is sampled before the `imageViewCurrent` callbacks run. If a captured image mapping changes after its identity was checked but before the lookup pass finishes, `imagesMoved()` can still return false and the snapshot is accepted even though that view is stale. The adjacent repository checks for registered views bracket their lookup loops with generation reads; this path does not. Please make the validation safe against a registry change during the revalidation pass, and add a regression where a captured view changes during that pass. ### Non-blocking None. ## Sources - [Snapshot validation at this head](https://github.com/boykopovar/AnyPS5/blob/6835d3db96406fffbe19d7111202e3fb29cda4f8/core/shader/recompiler/Optimization/src/ResourceMaterializer.cpp#L2713-L2735) - [New unrelated-mapping regression at this head](https://github.com/boykopovar/AnyPS5/blob/6835d3db96406fffbe19d7111202e3fb29cda4f8/core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp#L2085-L2108) - [Dispatch-cache identity validation pattern at this head](https://github.com/boykopovar/AnyPS5/blob/6835d3db96406fffbe19d7111202e3fb29cda4f8/core/libs/prx/libSceAgcDriver/Execution/include/Driver/Dispatch/DispatchCache.hpp#L27-L45) - [Shader-resource identity validation pattern at this head](https://github.com/boykopovar/AnyPS5/blob/6835d3db96406fffbe19d7111202e3fb29cda4f8/core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp#L58-L78) ## Not verified I did not run a local build, CTest, GPU or console test, or an independent negative control. All six hosted policy checks were pending when last checked; no hosted AGC/shader test run was available. The optional ABI and test-quality helper scripts could not run in the isolated PR snapshot. ## To get this to a good state Ensure a relevant mapping change cannot slip past the view-validation pass, and add a regression that exercises a captured-view change during validation. I will rerun the no-build precheck and inspect the full diff on the new head; the focused C++/GPU checks should also be rerun there.
XairRrR commented 2026-11-03 07:18:18 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by XairRrR on 2026-11-03T07:18:18Z.

Review: APPROVED


Reviewed — approved

The merged tree builds and the selected tests show no new failures. Both new regressions fail when their production change is reverted, which confirms the earlier blocking finding (a view changing during the recheck) is fixed.

What I ran

Head 9391c9f15503043d80c7a88f252386d38337d91c, main d1ae628bc2f62459cce1e9872ba5632c938c71f2, merged with --no-ff in a clean worktree (merged tree 0849c9523cb8a7877a46d6fa836e1e03f6cf8a1c). Machine: Debian 13 VM, 32 vCPU (two Intel Xeon Gold 6136, AVX2/FMA), GCC 14.2.0, Release, Ninja, Vulkan through lavapipe (Mesa 26.1.6, LLVM 19), no GPU.

git diff --check d1ae628bc2f62459cce1e9872ba5632c938c71f2...9391c9f15503043d80c7a88f252386d38337d91c
python3 tools/check_conventions.py --base d1ae628bc2f62459cce1e9872ba5632c938c71f2
ctest --test-dir build -j8 --test-load 32 --output-on-failure -R "^(agc_shader_memory|agc_shader_type_zero_image_materialization)$"
# negative control A
git show d1ae628bc2:core/libs/prx/libSceAgcDriver/Execution/src/ShaderMemory.cpp > core/libs/prx/libSceAgcDriver/Execution/src/ShaderMemory.cpp
ninja -C build -j32 -l32 agc_shader_memory_tests
ctest --test-dir build --output-on-failure -R "^agc_shader_type_zero_image_materialization$"
# negative control B (ShaderMemory.cpp restored from the merged tree)
git show 6835d3db9640:core/shader/recompiler/Optimization/src/ResourceMaterializer.cpp > core/shader/recompiler/Optimization/src/ResourceMaterializer.cpp
ninja -C build -j32 -l32 agc_shader_memory_tests
ctest --test-dir build --output-on-failure -R "^agc_shader_type_zero_image_materialization$"
# negative control C
git show d1ae628bc2:core/shader/recompiler/Optimization/src/ResourceMaterializer.cpp > core/shader/recompiler/Optimization/src/ResourceMaterializer.cpp
ninja -C build -j32 -l32 agc_shader_memory_tests
ctest --test-dir build --output-on-failure -R "^agc_shader_type_zero_image_materialization$"
# restore
git show 0849c9523c:core/shader/recompiler/Optimization/src/ResourceMaterializer.cpp > core/shader/recompiler/Optimization/src/ResourceMaterializer.cpp
git status --porcelain
ninja -C build -j32 -l32 agc_shader_memory_tests
ctest --test-dir build -j8 --test-load 32 --output-on-failure -R "^(agc_shader_memory|agc_shader_type_zero_image_materialization)$"

Results

Check Result
git diff --check clean
check_conventions.py All conventions checks passed
Configure / build / libs (script) passed
Selected tests (script, 2138 run) 2018 passed, 113 skipped (all expected per check_skips.py), 0 new failures, 0 timeouts. 7 failures are also on main: agc_driver_division, agc_driver_f32_denormal_flush, agc_driver_f64_div_scale_denormal_modes, agc_driver_f64_fma_denormal_modes, agc_driver_mullit_f32_denormal_modes, unwrap_self_..._group, vector_constant_factor_tininess
Vulkan validation vs main (script, lavapipe) 767 tests, layer loaded in 766, no test missing the layer, 0 tests with new VUID- lines
agc_shader_memory, agc_shader_type_zero_image_materialization (merged tree) both pass (9.07 s and 0.04 s)
Worktree after the controls git status --porcelain empty; both tests pass again after the rebuild

Negative control

The two new checks run from verifyTypeZeroImageMaterialization, so they run under agc_shader_type_zero_image_materialization.

Production files reverted Result
A: Execution/src/ShaderMemory.cpp from main (no imageViewCurrent callback, so the old rule applies) fails: runtime resource snapshot did not stabilize (the unrelated-churn capture)
B: ResourceMaterializer.cpp from the previous head 6835d3db96 (recheck without the generation bracket) fails: image view recheck: a snapshot kept a view whose mapping changed while the views were rechecked
C: ResourceMaterializer.cpp from main fails: runtime resource snapshot did not stabilize

Control B confirms the author's claim. It also shows that the blocking finding in MarcZX10's review of 6835d3db96 is fixed by 335dc0429b. I did not revert SrtWalker.hpp: the test sets the new field, so the test would not compile without it.

Control outputs
A: 1/1 Test #2146: agc_shader_type_zero_image_materialization ...***Failed    0.01 sec
   runtime resource snapshot did not stabilize
B: image view recheck: a snapshot kept a view whose mapping changed while the views were rechecked
C: 1/1 Test #2146: agc_shader_type_zero_image_materialization ...***Failed    0.02 sec
   runtime resource snapshot did not stabilize

Findings

Blocking

None.

Non-blocking

  • Descriptor memory remapped during an attempt is no longer retried (comment by oneandonlydean). The source-level observation is correct, but the retry it asks to keep gave little protection on main either.
    • It is true that descriptorScope only returns rawInvalidations (ShaderMemory.cpp L579-L593). Those count pending-write invalidations, not mapping changes. So when descriptor memory is remapped while all captured image identities stay current, the attempt is now accepted (ResourceMaterializer.cpp L2728-L2743).
    • However, the ShaderMemory page cache persists across the three attempts of one capture:
      • lazy pages and fully valid non-word-wise pages are served from page->words (L546-L547);
      • a valid word-wise word is dropped only on a pending-write query (L383-L389) or by a raw invalidation.
    • So on main, a retry caused by the generation alone mostly re-reads the same cached descriptor bytes. It does not reliably get fresh ones.
    • A guest that remaps descriptor memory while the GPU reads it is racing on hardware too.
    • I do not consider this blocking. If a guard for descriptor remaps is wanted, it should invalidate the cached pages of the remapped range, not only retry. That would be a separate change.

Not verified

  • No title was run; the Code Violet (PPSA26528) abort counts in the description are the author's.
  • No hardware GPU run: Vulkan tests and the validation comparison ran on lavapipe only. The AMD RX 6650 XT results are the author's. The AMD RX 6300 and NVIDIA RTX 2000 Ada bot runs in the discussion tested the previous head 6835d3d, not 9391c9f.
  • I did not check whether other SrtRuntime producers should also set imageViewCurrent. Those without it keep the old rule, which is safe.
<!-- greyfinch-sync:boykopovar/AnyPS5:review:5748448231 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/15399#pullrequestreview-5748448231). Originally posted by [XairRrR](https://github.com/XairRrR) on 2026-11-03T07:18:18Z. **Review:** APPROVED --- # Reviewed — approved The merged tree builds and the selected tests show no new failures. Both new regressions fail when their production change is reverted, which confirms the earlier blocking finding (a view changing during the recheck) is fixed. ## What I ran Head `9391c9f15503043d80c7a88f252386d38337d91c`, `main` `d1ae628bc2f62459cce1e9872ba5632c938c71f2`, merged with `--no-ff` in a clean worktree (merged tree `0849c9523cb8a7877a46d6fa836e1e03f6cf8a1c`). Machine: Debian 13 VM, 32 vCPU (two Intel Xeon Gold 6136, AVX2/FMA), GCC 14.2.0, Release, Ninja, Vulkan through lavapipe (Mesa 26.1.6, LLVM 19), no GPU. ``` git diff --check d1ae628bc2f62459cce1e9872ba5632c938c71f2...9391c9f15503043d80c7a88f252386d38337d91c python3 tools/check_conventions.py --base d1ae628bc2f62459cce1e9872ba5632c938c71f2 ctest --test-dir build -j8 --test-load 32 --output-on-failure -R "^(agc_shader_memory|agc_shader_type_zero_image_materialization)$" # negative control A git show d1ae628bc2:core/libs/prx/libSceAgcDriver/Execution/src/ShaderMemory.cpp > core/libs/prx/libSceAgcDriver/Execution/src/ShaderMemory.cpp ninja -C build -j32 -l32 agc_shader_memory_tests ctest --test-dir build --output-on-failure -R "^agc_shader_type_zero_image_materialization$" # negative control B (ShaderMemory.cpp restored from the merged tree) git show 6835d3db9640:core/shader/recompiler/Optimization/src/ResourceMaterializer.cpp > core/shader/recompiler/Optimization/src/ResourceMaterializer.cpp ninja -C build -j32 -l32 agc_shader_memory_tests ctest --test-dir build --output-on-failure -R "^agc_shader_type_zero_image_materialization$" # negative control C git show d1ae628bc2:core/shader/recompiler/Optimization/src/ResourceMaterializer.cpp > core/shader/recompiler/Optimization/src/ResourceMaterializer.cpp ninja -C build -j32 -l32 agc_shader_memory_tests ctest --test-dir build --output-on-failure -R "^agc_shader_type_zero_image_materialization$" # restore git show 0849c9523c:core/shader/recompiler/Optimization/src/ResourceMaterializer.cpp > core/shader/recompiler/Optimization/src/ResourceMaterializer.cpp git status --porcelain ninja -C build -j32 -l32 agc_shader_memory_tests ctest --test-dir build -j8 --test-load 32 --output-on-failure -R "^(agc_shader_memory|agc_shader_type_zero_image_materialization)$" ``` ## Results | Check | Result | |---|---| | `git diff --check` | clean | | `check_conventions.py` | All conventions checks passed | | Configure / build / `libs` (script) | passed | | Selected tests (script, 2138 run) | 2018 passed, 113 skipped (all expected per `check_skips.py`), 0 new failures, 0 timeouts. 7 failures are also on `main`: `agc_driver_division`, `agc_driver_f32_denormal_flush`, `agc_driver_f64_div_scale_denormal_modes`, `agc_driver_f64_fma_denormal_modes`, `agc_driver_mullit_f32_denormal_modes`, `unwrap_self_..._group`, `vector_constant_factor_tininess` | | Vulkan validation vs `main` (script, lavapipe) | 767 tests, layer loaded in 766, no test missing the layer, 0 tests with new `VUID-` lines | | `agc_shader_memory`, `agc_shader_type_zero_image_materialization` (merged tree) | both pass (9.07 s and 0.04 s) | | Worktree after the controls | `git status --porcelain` empty; both tests pass again after the rebuild | ## Negative control The two new checks run from `verifyTypeZeroImageMaterialization`, so they run under `agc_shader_type_zero_image_materialization`. | Production files reverted | Result | |---|---| | A: `Execution/src/ShaderMemory.cpp` from `main` (no `imageViewCurrent` callback, so the old rule applies) | fails: `runtime resource snapshot did not stabilize` (the unrelated-churn capture) | | B: `ResourceMaterializer.cpp` from the previous head `6835d3db96` (recheck without the generation bracket) | fails: `image view recheck: a snapshot kept a view whose mapping changed while the views were rechecked` | | C: `ResourceMaterializer.cpp` from `main` | fails: `runtime resource snapshot did not stabilize` | Control B confirms the author's claim. It also shows that the blocking finding in MarcZX10's review of `6835d3db96` is fixed by `335dc0429b`. I did not revert `SrtWalker.hpp`: the test sets the new field, so the test would not compile without it. <details><summary>Control outputs</summary> ``` A: 1/1 Test #2146: agc_shader_type_zero_image_materialization ...***Failed 0.01 sec runtime resource snapshot did not stabilize B: image view recheck: a snapshot kept a view whose mapping changed while the views were rechecked C: 1/1 Test #2146: agc_shader_type_zero_image_materialization ...***Failed 0.02 sec runtime resource snapshot did not stabilize ``` </details> ## Findings ### Blocking None. ### Non-blocking - **Descriptor memory remapped during an attempt is no longer retried (comment by oneandonlydean). The source-level observation is correct, but the retry it asks to keep gave little protection on `main` either.** - It is true that `descriptorScope` only returns `rawInvalidations` ([ShaderMemory.cpp L579-L593](https://github.com/boykopovar/AnyPS5/blob/9391c9f15503043d80c7a88f252386d38337d91c/core/libs/prx/libSceAgcDriver/Execution/src/ShaderMemory.cpp#L579-L593)). Those count pending-write invalidations, not mapping changes. So when descriptor memory is remapped while all captured image identities stay current, the attempt is now accepted ([ResourceMaterializer.cpp L2728-L2743](https://github.com/boykopovar/AnyPS5/blob/9391c9f15503043d80c7a88f252386d38337d91c/core/shader/recompiler/Optimization/src/ResourceMaterializer.cpp#L2728-L2743)). - However, the `ShaderMemory` page cache persists across the three attempts of one capture: - lazy pages and fully valid non-word-wise pages are served from `page->words` ([L546-L547](https://github.com/boykopovar/AnyPS5/blob/9391c9f15503043d80c7a88f252386d38337d91c/core/libs/prx/libSceAgcDriver/Execution/src/ShaderMemory.cpp#L546-L547)); - a valid word-wise word is dropped only on a pending-write query ([L383-L389](https://github.com/boykopovar/AnyPS5/blob/9391c9f15503043d80c7a88f252386d38337d91c/core/libs/prx/libSceAgcDriver/Execution/src/ShaderMemory.cpp#L383-L389)) or by a raw invalidation. - So on `main`, a retry caused by the generation alone mostly re-reads the same cached descriptor bytes. It does not reliably get fresh ones. - A guest that remaps descriptor memory while the GPU reads it is racing on hardware too. - I do not consider this blocking. If a guard for descriptor remaps is wanted, it should invalidate the cached pages of the remapped range, not only retry. That would be a separate change. ## Not verified - No title was run; the Code Violet (PPSA26528) abort counts in the description are the author's. - No hardware GPU run: Vulkan tests and the validation comparison ran on lavapipe only. The AMD RX 6650 XT results are the author's. The AMD RX 6300 and NVIDIA RTX 2000 Ada bot runs in the discussion tested the previous head `6835d3d`, not `9391c9f`. - I did not check whether other `SrtRuntime` producers should also set `imageViewCurrent`. Those without it keep the old rule, which is safe. <!-- anyps5-bots job=3097 head=9391c9f15503043d80c7a88f252386d38337d91c -->
MarcZX10 commented 2026-11-03 07:39:52 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-03T07:39:52Z.

Review: APPROVED


Re-checked — new head, looks good

The generation-bracketed image recheck and deterministic regression address my prior blocker; applicable hosted checks and the independent exact-head build/test report pass.

What I ran

Reviewed the complete 68-line delta from previously reviewed head 6835d3db96406fffbe19d7111202e3fb29cda4f8 to current head 9391c9f15503043d80c7a88f252386d38337d91c, against base d1ae628bc2f62459cce1e9872ba5632c938c71f2; git diff --check passed. I inspected the image-generation bracket, callback implementation, regression, descriptor read caching and exact-head hosted checks. Environment: Debian Linux x86_64, Python 3.11.2, GCC 12.2.0. I did not build or run CTest locally.

git diff --check 6835d3db96406fffbe19d7111202e3fb29cda4f8...9391c9f15503043d80c7a88f252386d38337d91c
git diff 6835d3db96406fffbe19d7111202e3fb29cda4f8...9391c9f15503043d80c7a88f252386d38337d91c -- core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp core/shader/recompiler/Optimization/src/ResourceMaterializer.cpp
gh pr checks 15399 --repo boykopovar/AnyPS5

Results

Check Result Note
Diff and image-view recheck passed A moving generation retries; a stable pass binds the snapshot to that generation.
Regression test passed Registered and invoked by the existing materialization test.
Hosted applicable checks passed Windows, relinker matrix, ASan and policy checks passed.
Linux and specialized jobs not applicable Workflow jobs were skipped.
Exact-head build and selected tests passed An independent reviewer reports lavapipe build/tests and three negative controls passed.
Local build and CTest not run I did not compile locally.
Unedited hosted check output
conventions	pass	23s	https://github.com/boykopovar/AnyPS5/actions/runs/41591204521/job/125768110775
eligibility	pass	6s	https://github.com/boykopovar/AnyPS5/actions/runs/41590434033/job/125765664851
labels	pass	6s	https://github.com/boykopovar/AnyPS5/actions/runs/41591204581/job/125769721148
library-portability	pass	1m3s	https://github.com/boykopovar/AnyPS5/actions/runs/41590433965/job/125765660256
relinker (macos-latest, clang++)	pass	3m53s	https://github.com/boykopovar/AnyPS5/actions/runs/41590434033/job/125768058064
relinker (macos-latest, clang++, x86_64)	pass	7m35s	https://github.com/boykopovar/AnyPS5/actions/runs/41590434033/job/125768058060
relinker (ubuntu-latest, g++)	pass	3m14s	https://github.com/boykopovar/AnyPS5/actions/runs/41590434033/job/125768057987
relinker (windows-latest, g++)	pass	9m56s	https://github.com/boykopovar/AnyPS5/actions/runs/41590434033/job/125768058074
relinker-asan	pass	2m53s	https://github.com/boykopovar/AnyPS5/actions/runs/41590434033/job/125768057925
report	pass	58s	https://github.com/boykopovar/AnyPS5/actions/runs/41590433989/job/125765660364
windows	pass	7m36s	https://github.com/boykopovar/AnyPS5/actions/runs/41590434033/job/125768057919
edge-watch	skipping	0	https://github.com/boykopovar/AnyPS5/actions/runs/41590434033/job/125768060177
linux	skipping	0	https://github.com/boykopovar/AnyPS5/actions/runs/41590434033/job/125768059153
register-context	skipping	0	https://github.com/boykopovar/AnyPS5/actions/runs/41590434033/job/125768059770
write-watch	skipping	0	https://github.com/boykopovar/AnyPS5/actions/runs/41590434033/job/125768059209

Negative control

I did not run a negative control. The author and independent reviewer report that reverting the image-generation bracket makes the new regression fail; the independent report also says reverting the relevant ShaderMemory.cpp/ResourceMaterializer.cpp variants fails the test. These are reported results, not runs I performed.

Findings

Blocking

None found in this head. The new generation bracket addresses the stale image-view validation race from my prior review.

Non-blocking

Descriptor backing remaps during capture remain a separate consistency question. descriptorScope reports raw-page invalidations, while the image-view generation covers guest-allocation layout changes; descriptor pages may remain cached through a retry. The previous generation-only retry therefore did not itself prove fresh descriptor bytes were reread. I do not consider this a regression introduced by the current change or a blocker for this approval. If capture must guarantee consistency across descriptor remaps, handle that separately by invalidating affected cached descriptor ranges and adding a deterministic test.

Sources

Not verified

I did not independently compile, run the lavapipe tests, execute negative controls, run on a physical GPU or test console behavior. The independent reviewer reports Debian 13, GCC 14.2.0 and lavapipe; the author's AMD hardware run is separate reported evidence.

To get this to a good state

No change is requested for this head. If descriptor-remap consistency is pursued, add it as a separate change with a targeted cache-invalidation regression. I will rerun the no-build checks and review any new head.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5748628693 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/15399#pullrequestreview-5748628693). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-03T07:39:52Z. **Review:** APPROVED --- # Re-checked — new head, looks good The generation-bracketed image recheck and deterministic regression address my prior blocker; applicable hosted checks and the independent exact-head build/test report pass. ## What I ran Reviewed the complete 68-line delta from previously reviewed head `6835d3db96406fffbe19d7111202e3fb29cda4f8` to current head `9391c9f15503043d80c7a88f252386d38337d91c`, against base `d1ae628bc2f62459cce1e9872ba5632c938c71f2`; `git diff --check` passed. I inspected the image-generation bracket, callback implementation, regression, descriptor read caching and exact-head hosted checks. Environment: Debian Linux x86_64, Python 3.11.2, GCC 12.2.0. I did not build or run CTest locally. ```sh git diff --check 6835d3db96406fffbe19d7111202e3fb29cda4f8...9391c9f15503043d80c7a88f252386d38337d91c git diff 6835d3db96406fffbe19d7111202e3fb29cda4f8...9391c9f15503043d80c7a88f252386d38337d91c -- core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp core/shader/recompiler/Optimization/src/ResourceMaterializer.cpp gh pr checks 15399 --repo boykopovar/AnyPS5 ``` ## Results | Check | Result | Note | |---|---|---| | Diff and image-view recheck | passed | A moving generation retries; a stable pass binds the snapshot to that generation. | | Regression test | passed | Registered and invoked by the existing materialization test. | | Hosted applicable checks | passed | Windows, relinker matrix, ASan and policy checks passed. | | Linux and specialized jobs | not applicable | Workflow jobs were skipped. | | Exact-head build and selected tests | passed | An independent reviewer reports lavapipe build/tests and three negative controls passed. | | Local build and CTest | not run | I did not compile locally. | <details> <summary>Unedited hosted check output</summary> ```text conventions pass 23s https://github.com/boykopovar/AnyPS5/actions/runs/41591204521/job/125768110775 eligibility pass 6s https://github.com/boykopovar/AnyPS5/actions/runs/41590434033/job/125765664851 labels pass 6s https://github.com/boykopovar/AnyPS5/actions/runs/41591204581/job/125769721148 library-portability pass 1m3s https://github.com/boykopovar/AnyPS5/actions/runs/41590433965/job/125765660256 relinker (macos-latest, clang++) pass 3m53s https://github.com/boykopovar/AnyPS5/actions/runs/41590434033/job/125768058064 relinker (macos-latest, clang++, x86_64) pass 7m35s https://github.com/boykopovar/AnyPS5/actions/runs/41590434033/job/125768058060 relinker (ubuntu-latest, g++) pass 3m14s https://github.com/boykopovar/AnyPS5/actions/runs/41590434033/job/125768057987 relinker (windows-latest, g++) pass 9m56s https://github.com/boykopovar/AnyPS5/actions/runs/41590434033/job/125768058074 relinker-asan pass 2m53s https://github.com/boykopovar/AnyPS5/actions/runs/41590434033/job/125768057925 report pass 58s https://github.com/boykopovar/AnyPS5/actions/runs/41590433989/job/125765660364 windows pass 7m36s https://github.com/boykopovar/AnyPS5/actions/runs/41590434033/job/125768057919 edge-watch skipping 0 https://github.com/boykopovar/AnyPS5/actions/runs/41590434033/job/125768060177 linux skipping 0 https://github.com/boykopovar/AnyPS5/actions/runs/41590434033/job/125768059153 register-context skipping 0 https://github.com/boykopovar/AnyPS5/actions/runs/41590434033/job/125768059770 write-watch skipping 0 https://github.com/boykopovar/AnyPS5/actions/runs/41590434033/job/125768059209 ``` </details> ## Negative control I did not run a negative control. The author and independent reviewer report that reverting the image-generation bracket makes the new regression fail; the independent report also says reverting the relevant `ShaderMemory.cpp`/`ResourceMaterializer.cpp` variants fails the test. These are reported results, not runs I performed. ## Findings ### Blocking None found in this head. The new generation bracket addresses the stale image-view validation race from my prior review. ### Non-blocking Descriptor backing remaps during capture remain a separate consistency question. `descriptorScope` reports raw-page invalidations, while the image-view generation covers guest-allocation layout changes; descriptor pages may remain cached through a retry. The previous generation-only retry therefore did not itself prove fresh descriptor bytes were reread. I do not consider this a regression introduced by the current change or a blocker for this approval. If capture must guarantee consistency across descriptor remaps, handle that separately by invalidating affected cached descriptor ranges and adding a deterministic test. ## Sources - [Stable two-pass image-view validation](https://github.com/boykopovar/AnyPS5/blob/9391c9f15503043d80c7a88f252386d38337d91c/core/shader/recompiler/Optimization/src/ResourceMaterializer.cpp#L2713-L2750) - [Regression that mutates a view during validation](https://github.com/boykopovar/AnyPS5/blob/9391c9f15503043d80c7a88f252386d38337d91c/core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp#L1469-L1524) - [Descriptor invalidation scope and cached page reads](https://github.com/boykopovar/AnyPS5/blob/9391c9f15503043d80c7a88f252386d38337d91c/core/libs/prx/libSceAgcDriver/Execution/src/ShaderMemory.cpp#L360-L389), [scope implementation](https://github.com/boykopovar/AnyPS5/blob/9391c9f15503043d80c7a88f252386d38337d91c/core/libs/prx/libSceAgcDriver/Execution/src/ShaderMemory.cpp#L482-L490) - [Independent exact-head test report](https://github.com/boykopovar/AnyPS5/pull/15399#pullrequestreview-5748448231) ## Not verified I did not independently compile, run the lavapipe tests, execute negative controls, run on a physical GPU or test console behavior. The independent reviewer reports Debian 13, GCC 14.2.0 and lavapipe; the author's AMD hardware run is separate reported evidence. ## To get this to a good state No change is requested for this head. If descriptor-remap consistency is pursued, add it as a separate change with a targeted cache-invalidation regression. I will rerun the no-build checks and review any new head.
XairRrR commented 2026-11-03 08:05:53 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by XairRrR on 2026-11-03T08:05:53Z.

Review: APPROVED


Re-checked — approved

The new commit 7a9ecdc365 makes a remap of the memory that descriptor words were read from disturb the snapshot attempt and drop those cached pages. Its regression fails without the change and passes with it. Two non-blocking gaps remain in how far this guard reaches.

What changed since my last review

  • One new commit, 7a9ecdc365. Commits 1–3 are unchanged (the range-diff shows them as equal).
    • Each ShaderMemory::Page now records the guest allocation (address, size, backingSerial) found at the page base when the page is created.
    • A new SrtRuntime::sourcesCurrent callback (ShaderMemory::sourcesCurrent) rechecks those records. It drops pages whose allocation changed and reports the attempt as disturbed.
    • ResourceMaterializer calls it at the start of each generation-bracketed recheck pass.
    • A new test block remaps the SRT's backing after its T# was read and requires the kept snapshot to hold the new T#.
  • The author's reply answers oneandonlydean's comment. That comment matches the non-blocking finding in my previous review.
  • The description now covers the descriptor-memory check.

What I ran

Head 7a9ecdc3652c481d545de4726a15be0995beaaf5, main d1ae628bc2f62459cce1e9872ba5632c938c71f2, merged with --no-ff in a clean worktree (merged tree cbbf0d4df8c529f5a44f818c319c5f206e3d7c1b). Machine: Debian 13 VM, 32 vCPU (two Intel Xeon Gold 6136), GCC 14.2.0, Release, Ninja, Vulkan through lavapipe (Mesa 26.1.6, LLVM 19), no GPU.

git diff --check d1ae628bc2f62459cce1e9872ba5632c938c71f2...7a9ecdc3652c481d545de4726a15be0995beaaf5
python3 tools/check_conventions.py --base d1ae628bc2f62459cce1e9872ba5632c938c71f2
ctest --test-dir build -j8 --test-load 32 --output-on-failure -R "^(agc_shader_memory|agc_shader_type_zero_image_materialization)$"
# control D: all four production files from the previous head
for f in core/libs/prx/libSceAgcDriver/Execution/src/ShaderMemory.cpp core/libs/prx/libSceAgcDriver/Execution/include/ShaderMemory.hpp core/shader/recompiler/Optimization/src/ResourceMaterializer.cpp core/shader/recompiler/Optimization/include/Optimization/SrtWalker.hpp; do git show 9391c9f15503:$f > $f; done
ninja -C build -j32 -l32 agc_shader_memory_tests
ctest --test-dir build --output-on-failure -R "^agc_shader_type_zero_image_materialization$"
# control E: only ResourceMaterializer.cpp from the previous head (the callback is set but never called)
for f in <ShaderMemory.cpp ShaderMemory.hpp SrtWalker.hpp>; do git show cbbf0d4df8:$f > $f; done
ninja -C build -j32 -l32 agc_shader_memory_tests
ctest --test-dir build --output-on-failure -R "^agc_shader_type_zero_image_materialization$"
# restore
git show cbbf0d4df8:core/shader/recompiler/Optimization/src/ResourceMaterializer.cpp > core/shader/recompiler/Optimization/src/ResourceMaterializer.cpp
git status --porcelain
ninja -C build -j32 -l32 agc_shader_memory_tests
ctest --test-dir build -j8 --test-load 32 --output-on-failure -R "^(agc_shader_memory|agc_shader_type_zero_image_materialization)$"
Check Result
git diff --check clean
check_conventions.py All conventions checks passed
Configure / build / libs (script) passed
Selected tests (script, 2138 run) 2018 passed, 113 skipped (all expected per check_skips.py), 0 new failures, 0 timeouts. The 7 failures (agc_driver_division, the four denormal-mode tests, unwrap_self_..._group, vector_constant_factor_tininess) also fail on main.
Vulkan validation vs main (script, lavapipe) 767 tests; the layer loaded in 766, and no test reports the layer missing; 0 tests with new VUID- lines
agc_shader_memory / agc_shader_type_zero_image_materialization pass (8.05 s / 0.01 s)
Negative control D fails: descriptor backing: a capture kept descriptor words read before their memory was remapped
Negative control E fails with the same message
After restoring git status --porcelain empty; both tests pass again (8.90 s total)

Control E shows that the new test fails because sourcesCurrent is not called. The new Page fields alone do not make it pass.

Previous findings

  • Non-blocking: a remap of descriptor memory during an attempt is no longer retried (also raised by oneandonlydean). Mostly resolved.
    • A remap of the allocation at the base of a cached page is now detected, and the page is dropped so the retry reads fresh words.
    • Controls D and E fail without the change, and the test passes with it.
    • The two remaining gaps are listed under New findings.

New findings

Blocking

None.

Non-blocking

  1. Only the allocation at the page base is tracked (ShaderMemory.cpp L332-L336, L600-L606).
    • GuestAllocations keeps one flat range per allocation. Heap blocks are registered one by one (GuestHeap.cpp L302-L303), so a 4 KiB ShaderMemory page can hold several ranges.
    • The page keeps only the result of GuestAllocationsLookup(base). A descriptor table in an allocation that starts inside the page is not covered: removing and re-adding that allocation is not seen, because the lookup at the page base returns the same range, or none, as before.
    • So the description's statement that each page "keeps the identity … of the guest allocation it was read from" holds only for allocations that cover the page base. The test uses a page-aligned SRT, so it does not exercise this case.
    • I found this by reading the code; I did not run it.
    • Suggested fix: record every range that overlaps the bytes a page served (or a range version for the page's span), or narrow the claim in the description.
  2. Stale pages survive an attempt that the descriptor scope disturbed (ResourceMaterializer.cpp L2729-L2733, L2744-L2745).
    • sourcesCurrent runs only inside imagesMoved(). imagesMoved() is short-circuited when the descriptorScope condition is already true.
    • Sequence: the descriptor memory is remapped during an attempt that rawInvalidations also disturbed. The pages are not dropped. The next attempt samples beforeImageGeneration after the remap, so its generation does not move and the stale cached words are accepted.
    • main has the same page-cache staleness on a generation retry, so this is not a regression.
    • Suggested fix: call sourcesCurrent whenever the generation moved, before or independently of the descriptorScope check.

Not verified

  • No title was run. The Code Violet (PPSA26528) results are the author's.
  • No hardware GPU run: the Vulkan tests and the validation comparison ran on lavapipe only.
    • The AMD RX 6650 XT results at 7a9ecdc365 are the author's.
    • The AMD and NVIDIA bot runs in the discussion tested 6835d3d and 9391c9f, not this head.
  • I did not run the cost of sourcesCurrent (one locked registry lookup per cached page, on each recheck pass of an attempt whose generation moved) under a title load.
  • The two non-blocking gaps come from reading the source. I wrote no test for them.
<!-- greyfinch-sync:boykopovar/AnyPS5:review:5748862380 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/15399#pullrequestreview-5748862380). Originally posted by [XairRrR](https://github.com/XairRrR) on 2026-11-03T08:05:53Z. **Review:** APPROVED --- # Re-checked — approved The new commit `7a9ecdc365` makes a remap of the memory that descriptor words were read from disturb the snapshot attempt and drop those cached pages. Its regression fails without the change and passes with it. Two non-blocking gaps remain in how far this guard reaches. ## What changed since my last review - One new commit, `7a9ecdc365`. Commits 1–3 are unchanged (the range-diff shows them as equal). - Each `ShaderMemory::Page` now records the guest allocation (address, size, `backingSerial`) found at the page base when the page is created. - A new `SrtRuntime::sourcesCurrent` callback (`ShaderMemory::sourcesCurrent`) rechecks those records. It drops pages whose allocation changed and reports the attempt as disturbed. - `ResourceMaterializer` calls it at the start of each generation-bracketed recheck pass. - A new test block remaps the SRT's backing after its T# was read and requires the kept snapshot to hold the new T#. - The author's reply answers oneandonlydean's comment. That comment matches the non-blocking finding in my previous review. - The description now covers the descriptor-memory check. ## What I ran Head `7a9ecdc3652c481d545de4726a15be0995beaaf5`, `main` `d1ae628bc2f62459cce1e9872ba5632c938c71f2`, merged with `--no-ff` in a clean worktree (merged tree `cbbf0d4df8c529f5a44f818c319c5f206e3d7c1b`). Machine: Debian 13 VM, 32 vCPU (two Intel Xeon Gold 6136), GCC 14.2.0, Release, Ninja, Vulkan through lavapipe (Mesa 26.1.6, LLVM 19), no GPU. ``` git diff --check d1ae628bc2f62459cce1e9872ba5632c938c71f2...7a9ecdc3652c481d545de4726a15be0995beaaf5 python3 tools/check_conventions.py --base d1ae628bc2f62459cce1e9872ba5632c938c71f2 ctest --test-dir build -j8 --test-load 32 --output-on-failure -R "^(agc_shader_memory|agc_shader_type_zero_image_materialization)$" # control D: all four production files from the previous head for f in core/libs/prx/libSceAgcDriver/Execution/src/ShaderMemory.cpp core/libs/prx/libSceAgcDriver/Execution/include/ShaderMemory.hpp core/shader/recompiler/Optimization/src/ResourceMaterializer.cpp core/shader/recompiler/Optimization/include/Optimization/SrtWalker.hpp; do git show 9391c9f15503:$f > $f; done ninja -C build -j32 -l32 agc_shader_memory_tests ctest --test-dir build --output-on-failure -R "^agc_shader_type_zero_image_materialization$" # control E: only ResourceMaterializer.cpp from the previous head (the callback is set but never called) for f in <ShaderMemory.cpp ShaderMemory.hpp SrtWalker.hpp>; do git show cbbf0d4df8:$f > $f; done ninja -C build -j32 -l32 agc_shader_memory_tests ctest --test-dir build --output-on-failure -R "^agc_shader_type_zero_image_materialization$" # restore git show cbbf0d4df8:core/shader/recompiler/Optimization/src/ResourceMaterializer.cpp > core/shader/recompiler/Optimization/src/ResourceMaterializer.cpp git status --porcelain ninja -C build -j32 -l32 agc_shader_memory_tests ctest --test-dir build -j8 --test-load 32 --output-on-failure -R "^(agc_shader_memory|agc_shader_type_zero_image_materialization)$" ``` | Check | Result | |---|---| | `git diff --check` | clean | | `check_conventions.py` | All conventions checks passed | | Configure / build / `libs` (script) | passed | | Selected tests (script, 2138 run) | 2018 passed, 113 skipped (all expected per `check_skips.py`), 0 new failures, 0 timeouts. The 7 failures (`agc_driver_division`, the four denormal-mode tests, `unwrap_self_..._group`, `vector_constant_factor_tininess`) also fail on `main`. | | Vulkan validation vs `main` (script, lavapipe) | 767 tests; the layer loaded in 766, and no test reports the layer missing; 0 tests with new `VUID-` lines | | `agc_shader_memory` / `agc_shader_type_zero_image_materialization` | pass (8.05 s / 0.01 s) | | Negative control D | fails: `descriptor backing: a capture kept descriptor words read before their memory was remapped` | | Negative control E | fails with the same message | | After restoring | `git status --porcelain` empty; both tests pass again (8.90 s total) | Control E shows that the new test fails because `sourcesCurrent` is not called. The new `Page` fields alone do not make it pass. ## Previous findings - **Non-blocking: a remap of descriptor memory during an attempt is no longer retried (also raised by oneandonlydean).** Mostly resolved. - A remap of the allocation at the base of a cached page is now detected, and the page is dropped so the retry reads fresh words. - Controls D and E fail without the change, and the test passes with it. - The two remaining gaps are listed under New findings. ## New findings ### Blocking None. ### Non-blocking 1. **Only the allocation at the page base is tracked** ([ShaderMemory.cpp L332-L336](https://github.com/boykopovar/AnyPS5/blob/7a9ecdc3652c481d545de4726a15be0995beaaf5/core/libs/prx/libSceAgcDriver/Execution/src/ShaderMemory.cpp#L332-L336), [L600-L606](https://github.com/boykopovar/AnyPS5/blob/7a9ecdc3652c481d545de4726a15be0995beaaf5/core/libs/prx/libSceAgcDriver/Execution/src/ShaderMemory.cpp#L600-L606)). - `GuestAllocations` keeps one flat range per allocation. Heap blocks are registered one by one ([GuestHeap.cpp L302-L303](https://github.com/boykopovar/AnyPS5/blob/7a9ecdc3652c481d545de4726a15be0995beaaf5/core/libs/prx/libc/src/GuestHeap.cpp#L302-L303)), so a 4 KiB `ShaderMemory` page can hold several ranges. - The page keeps only the result of `GuestAllocationsLookup(base)`. A descriptor table in an allocation that starts inside the page is not covered: removing and re-adding that allocation is not seen, because the lookup at the page base returns the same range, or none, as before. - So the description's statement that each page "keeps the identity … of the guest allocation it was read from" holds only for allocations that cover the page base. The test uses a page-aligned SRT, so it does not exercise this case. - I found this by reading the code; I did not run it. - Suggested fix: record every range that overlaps the bytes a page served (or a range version for the page's span), or narrow the claim in the description. 2. **Stale pages survive an attempt that the descriptor scope disturbed** ([ResourceMaterializer.cpp L2729-L2733, L2744-L2745](https://github.com/boykopovar/AnyPS5/blob/7a9ecdc3652c481d545de4726a15be0995beaaf5/core/shader/recompiler/Optimization/src/ResourceMaterializer.cpp#L2729-L2745)). - `sourcesCurrent` runs only inside `imagesMoved()`. `imagesMoved()` is short-circuited when the `descriptorScope` condition is already true. - Sequence: the descriptor memory is remapped during an attempt that `rawInvalidations` also disturbed. The pages are not dropped. The next attempt samples `beforeImageGeneration` after the remap, so its generation does not move and the stale cached words are accepted. - `main` has the same page-cache staleness on a generation retry, so this is not a regression. - Suggested fix: call `sourcesCurrent` whenever the generation moved, before or independently of the `descriptorScope` check. ## Not verified - No title was run. The Code Violet (PPSA26528) results are the author's. - No hardware GPU run: the Vulkan tests and the validation comparison ran on lavapipe only. - The AMD RX 6650 XT results at `7a9ecdc365` are the author's. - The AMD and NVIDIA bot runs in the discussion tested `6835d3d` and `9391c9f`, not this head. - I did not run the cost of `sourcesCurrent` (one locked registry lookup per cached page, on each recheck pass of an attempt whose generation moved) under a title load. - The two non-blocking gaps come from reading the source. I wrote no test for them. <!-- anyps5-bots job=3183 head=7a9ecdc3652c481d545de4726a15be0995beaaf5 -->
MarcZX10 commented 2026-11-03 08:09:08 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-03T08:09:08Z.

Review: APPROVED


Re-checked — new head, approved

The descriptor-source identity check and regression for remapping those source pages address the prior blocker, and the exact-head Windows tests pass.

What I ran

Reviewed PR #15399 at head 7a9ecdc3652c481d545de4726a15be0995beaaf5, against base d1ae628bc2f62459cce1e9872ba5632c938c71f2. I inspected the complete 69-line delta across five files since the previously reviewed head; the precheck reports a clean merge preview. Environment: Debian Linux x86_64, Python 3.11.2, GCC 12.2.0, Git 2.39.5. GitHub Actions built the changed AGC test target and ran the Windows CTest selection. I did not build or run CTest locally.

python3 tools/pr_precheck.py --repo boykopovar/AnyPS5 --pr 15399
git diff --check refs/review/session-20261103/15399-reviewed refs/review/session-20261103/15399-head
python3 tools/pr_test_quality.py --root /tmp/anyps5-pr-precheck/boykopovar-AnyPS5-pr-15399-7a9ecdc3652c/head-7a9ecdc3652c-4f6121c8 --json core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp
gh run view 41598769926 --repo boykopovar/AnyPS5 --job 125792317274 --log > /tmp/anyps5-15399-windows.log
gh api repos/boykopovar/AnyPS5/commits/7a9ecdc3652c481d545de4726a15be0995beaaf5/check-runs --jq '.check_runs | map({name,status,conclusion,head_sha})'
gh pr checks 15399 --repo boykopovar/AnyPS5

Results

Check Result Note
Source and new regression review passed The captured descriptor pages are invalidated when their registered backing changes.
Windows build and selected CTest passed Both affected shader-memory tests pass on the exact head.
Hosted applicable checks passed Windows, relinker matrix, portability and policy checks pass.
Author-reported AMD validation run not run The author reports 204/204 focused tests pass on an RX 6650 XT.
Local build, CTest and GPU run not run No local compile or hardware test.
Optional precheck helper scripts failed The isolated PR snapshot lacks two reviewer-only scripts.
Unedited check output

Precheck statuses:

diff_check: passed
conventions_and_pr_template: passed
changed_export_abi_audit: failed — tools/pr_abi_audit.py is absent from the isolated PR snapshot
live_dependency_and_mergeability_check: passed
test_quality_heuristics: failed — tools/pr_test_quality.py is absent from the isolated PR snapshot
build_dependent_cpp_tests: not applicable — no build was run by the precheck

The local test-quality heuristic also flagged ShaderMemory.cpp as possibly unregistered. I inspected the exact-head CMake fragment and confirmed it is compiled into agc_shader_memory_tests and its CTest target is registered; the warning is a false positive.

Windows CTest excerpts:

windows Build and run changed guest core/libs tests 2026-11-03T08:03:56.2528462Z           Start 2207: agc_shader_type_zero_image_materialization
windows Build and run changed guest core/libs tests 2026-11-03T08:03:56.2839089Z 1639/3064 Test #2207: agc_shader_type_zero_image_materialization ............................   Passed    0.03 sec
windows Build and run changed guest core/libs tests 2026-11-03T08:03:56.5261891Z           Start 2217: agc_shader_memory
windows Build and run changed guest core/libs tests 2026-11-03T08:03:57.3314750Z 1649/3064 Test #2217: agc_shader_memory .....................................................   Passed    0.80 sec
windows Build and run changed guest core/libs tests 2026-11-03T08:05:47.5911316Z 100% tests passed, 0 tests failed out of 3064

Applicable hosted checks on the exact head: Windows, conventions, eligibility, intake, labels, library portability, report and relinker jobs passed; Linux and specialized jobs were skipped by workflow filters. The PR description reports its RX 6650 XT focused run with validation enabled, 204/204 passing and no VUID- lines. That hardware run was not independently reproduced here.

Negative control

Assertion Change to code under test Did the test fail?
Remapping the descriptor's backing after its eight T# words are read must make the capture retry and retain the new T#. The author reports running the new regression on the preceding head 9391c9f155 and on this head. Yes on the preceding head; the author reports the regression and focused suite pass on 7a9ecdc365. I did not reproduce this locally.

Findings

Blocking

None found in the reviewed source and test delta.

Non-blocking

The focused AMD/Vulkan run is author-reported; this review independently confirms the exact-head Windows build and tests, not the AMD hardware result or console behavior.

Sources

Not verified

I did not run local compilation, CTest, the AMD/Vulkan validation suite, or console behavior. The attached independent AMD log describes the previous head 9391c9f155, so I did not count it as evidence for the new head; the exact-head AMD results are the author's report in the PR discussion.

To get this to a good state

No code change is requested for this head. If it changes, I will review the new delta and rerun the applicable checks.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5748891926 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/15399#pullrequestreview-5748891926). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-03T08:09:08Z. **Review:** APPROVED --- # Re-checked — new head, approved The descriptor-source identity check and regression for remapping those source pages address the prior blocker, and the exact-head Windows tests pass. ## What I ran Reviewed PR #15399 at head `7a9ecdc3652c481d545de4726a15be0995beaaf5`, against base `d1ae628bc2f62459cce1e9872ba5632c938c71f2`. I inspected the complete 69-line delta across five files since the previously reviewed head; the precheck reports a clean merge preview. Environment: Debian Linux x86_64, Python 3.11.2, GCC 12.2.0, Git 2.39.5. GitHub Actions built the changed AGC test target and ran the Windows CTest selection. I did not build or run CTest locally. ```sh python3 tools/pr_precheck.py --repo boykopovar/AnyPS5 --pr 15399 git diff --check refs/review/session-20261103/15399-reviewed refs/review/session-20261103/15399-head python3 tools/pr_test_quality.py --root /tmp/anyps5-pr-precheck/boykopovar-AnyPS5-pr-15399-7a9ecdc3652c/head-7a9ecdc3652c-4f6121c8 --json core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp gh run view 41598769926 --repo boykopovar/AnyPS5 --job 125792317274 --log > /tmp/anyps5-15399-windows.log gh api repos/boykopovar/AnyPS5/commits/7a9ecdc3652c481d545de4726a15be0995beaaf5/check-runs --jq '.check_runs | map({name,status,conclusion,head_sha})' gh pr checks 15399 --repo boykopovar/AnyPS5 ``` ## Results | Check | Result | Note | |---|---|---| | Source and new regression review | passed | The captured descriptor pages are invalidated when their registered backing changes. | | Windows build and selected CTest | passed | Both affected shader-memory tests pass on the exact head. | | Hosted applicable checks | passed | Windows, relinker matrix, portability and policy checks pass. | | Author-reported AMD validation run | not run | The author reports 204/204 focused tests pass on an RX 6650 XT. | | Local build, CTest and GPU run | not run | No local compile or hardware test. | | Optional precheck helper scripts | failed | The isolated PR snapshot lacks two reviewer-only scripts. | <details> <summary>Unedited check output</summary> Precheck statuses: ```text diff_check: passed conventions_and_pr_template: passed changed_export_abi_audit: failed — tools/pr_abi_audit.py is absent from the isolated PR snapshot live_dependency_and_mergeability_check: passed test_quality_heuristics: failed — tools/pr_test_quality.py is absent from the isolated PR snapshot build_dependent_cpp_tests: not applicable — no build was run by the precheck ``` The local test-quality heuristic also flagged `ShaderMemory.cpp` as possibly unregistered. I inspected the exact-head CMake fragment and confirmed it is compiled into `agc_shader_memory_tests` and its CTest target is registered; the warning is a false positive. Windows CTest excerpts: ```text windows Build and run changed guest core/libs tests 2026-11-03T08:03:56.2528462Z Start 2207: agc_shader_type_zero_image_materialization windows Build and run changed guest core/libs tests 2026-11-03T08:03:56.2839089Z 1639/3064 Test #2207: agc_shader_type_zero_image_materialization ............................ Passed 0.03 sec windows Build and run changed guest core/libs tests 2026-11-03T08:03:56.5261891Z Start 2217: agc_shader_memory windows Build and run changed guest core/libs tests 2026-11-03T08:03:57.3314750Z 1649/3064 Test #2217: agc_shader_memory ..................................................... Passed 0.80 sec windows Build and run changed guest core/libs tests 2026-11-03T08:05:47.5911316Z 100% tests passed, 0 tests failed out of 3064 ``` Applicable hosted checks on the exact head: Windows, conventions, eligibility, intake, labels, library portability, report and relinker jobs passed; Linux and specialized jobs were skipped by workflow filters. The PR description reports its RX 6650 XT focused run with validation enabled, 204/204 passing and no `VUID-` lines. That hardware run was not independently reproduced here. </details> ## Negative control | Assertion | Change to code under test | Did the test fail? | |---|---|---| | Remapping the descriptor's backing after its eight T# words are read must make the capture retry and retain the new T#. | The author reports running the new regression on the preceding head `9391c9f155` and on this head. | Yes on the preceding head; the author reports the regression and focused suite pass on `7a9ecdc365`. I did not reproduce this locally. | ## Findings ### Blocking None found in the reviewed source and test delta. ### Non-blocking The focused AMD/Vulkan run is author-reported; this review independently confirms the exact-head Windows build and tests, not the AMD hardware result or console behavior. ## Sources - [Descriptor-page identity captured at the reviewed head](https://github.com/boykopovar/AnyPS5/blob/7a9ecdc3652c481d545de4726a15be0995beaaf5/core/libs/prx/libSceAgcDriver/Execution/src/ShaderMemory.cpp#L330-L336) - [Changed-page invalidation at the reviewed head](https://github.com/boykopovar/AnyPS5/blob/7a9ecdc3652c481d545de4726a15be0995beaaf5/core/libs/prx/libSceAgcDriver/Execution/src/ShaderMemory.cpp#L600-L617) - [Descriptor-remap regression at the reviewed head](https://github.com/boykopovar/AnyPS5/blob/7a9ecdc3652c481d545de4726a15be0995beaaf5/core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp#L2164-L2197) - [Recheck integration at the reviewed head](https://github.com/boykopovar/AnyPS5/blob/7a9ecdc3652c481d545de4726a15be0995beaaf5/core/shader/recompiler/Optimization/src/ResourceMaterializer.cpp#L2728-L2745) ## Not verified I did not run local compilation, CTest, the AMD/Vulkan validation suite, or console behavior. The attached independent AMD log describes the previous head `9391c9f155`, so I did not count it as evidence for the new head; the exact-head AMD results are the author's report in the PR discussion. ## To get this to a good state No code change is requested for this head. If it changes, I will review the new delta and rerun the applicable checks.
XairRrR commented 2026-11-03 20:50:57 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by XairRrR on 2026-11-03T20:50:57Z.

Review: APPROVED


Re-checked — approved

The new commit 44498d7819 lets a recheck pass accept an attempt that captured no image view as soon as its descriptor sources are current, without waiting for the generation to hold. Its new test fails without the change and passes with it. No blocking issue remains.

What changed since my last review

  • The four earlier commits were rebased onto main 086c068 with no changes (delta.patch shows = for all four).
  • One new commit, 44498d7819 (B-Howell's 63c8907c79, adopted):
    • ResourceMaterializer.cpp (+4): imagesMoved() computes viewsCaptured, which is true when registeredImages or any table resourceViews entry has identities. When nothing was captured, the pass returns "not moved" right after sourcesCurrent succeeds, so the generation bracket no longer applies.
    • tests/ShaderMemory.cpp: new verifyUnviewedSnapshotDuringMappingChurn. The generation moves on every read. With sources current, the capture must be accepted with no view checks, imageAllocationGeneration == 0 and the T# kept. With sources stale, it must end with did not stabilize after 3 source checks.
  • The description and the author's reply now describe this follow-up.

What I ran

Head 44498d7819bc7877520bb33a56391bed24a09024, main 086c0686c8adff3ee648fdbe34e0b0b647e1d511, merged with --no-ff in a clean worktree (merged tree c4e529728923afee0c33f1b5e156f8c7ccd5844b). Machine: Debian 13 VM, 32 vCPU (two Intel Xeon Gold 6136), GCC 14.2.0, Release, Ninja, Vulkan through lavapipe (Mesa 26.1.6, LLVM 19), no GPU.

git diff --check 086c0686c8adff3ee648fdbe34e0b0b647e1d511...44498d7819bc7877520bb33a56391bed24a09024
python3 tools/check_conventions.py --base 086c0686c8adff3ee648fdbe34e0b0b647e1d511
# negative control: ResourceMaterializer.cpp from the previous (rebased) head 913ecea7d3
git show 913ecea7d360:core/shader/recompiler/Optimization/src/ResourceMaterializer.cpp > core/shader/recompiler/Optimization/src/ResourceMaterializer.cpp
ninja -C build -j32 -l32 agc_shader_memory_tests
ctest --test-dir build -j8 --test-load 32 --output-on-failure -R "^(agc_shader_memory|agc_shader_type_zero_image_materialization)$"
git show c4e529728923afee0c33f1b5e156f8c7ccd5844b:core/shader/recompiler/Optimization/src/ResourceMaterializer.cpp > core/shader/recompiler/Optimization/src/ResourceMaterializer.cpp
# attribution of the VUIDs the script flagged in agc_driver_image_gather_volume
env VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation ANYPS5_NO_SHADER_CACHE=1 ANYPS5_REQUIRE_VULKAN=1 ctest --test-dir build -V -R "^agc_driver_image_gather_volume$"
for f in <ShaderMemory.hpp ShaderMemory.cpp SrtWalker.hpp ResourceMaterializer.cpp>; do git show 086c0686c8ad:$f > $f; done
ninja -C build -j32 -l32 agc_driver_image_gather_volume_tests
env VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation ANYPS5_NO_SHADER_CACHE=1 ANYPS5_REQUIRE_VULKAN=1 ctest --test-dir build -V -R "^agc_driver_image_gather_volume$"
for f in <same four files>; do git show c4e529728923:$f > $f; done
git status --porcelain
ninja -C build -j32 -l32 agc_driver_image_gather_volume_tests agc_shader_memory_tests
ctest --test-dir build -j8 --test-load 32 --output-on-failure -R "^(agc_shader_memory|agc_shader_type_zero_image_materialization)$"
Check Result
git diff --check clean
check_conventions.py All conventions checks passed
Configure / build / libs (script) passed
Selected tests (script, 2178 run) 2056 passed and 115 skipped (all expected per check_skips.py). 0 new failures, 0 timeouts. The 7 failures also fail on main. agc_driver_alpha_to_coverage_sample_mask_export passed on rerun.
Vulkan validation vs main (script) 783 tests. The layer loaded in 782 and no test reported it missing. One test, agc_driver_image_gather_volume, was flagged with new VKSamplerCreateInfo-addressMode* VUIDs marked "test not run on main".
Those VUIDs with the PR's production files restored from main 086c068 The same 4 VUIDs, 2 lines each. They come from main (the baseline was older), not from this PR.
Negative control (see below) Both tests fail
After restoring git status --porcelain is empty. agc_shader_memory (8.4 s) and agc_shader_type_zero_image_materialization (0.02 s) pass.
Negative control output
1/2 Test #2183: agc_shader_type_zero_image_materialization ...***Failed    0.01 sec
runtime resource snapshot did not stabilize
2/2 Test #2193: agc_shader_memory ............................***Failed    1.54 sec
runtime resource snapshot did not stabilize

The negative control used only ResourceMaterializer.cpp from the previous head, because the new test needs the callbacks from the earlier commits to compile. It confirms the author's and B-Howell's reported result.

Previous findings

  • Non-blocking 1: only the allocation at the page base is tracked. Still open. ShaderMemory.cpp is unchanged by the new commit: L332-L336 still records only GuestAllocationsLookup(base).
    • It now matters a little more. For an attempt with no views, sourcesCurrent is the only check left once the generation moves.
    • It remains non-blocking because main does not re-read cached pages on a generation retry either.
  • Non-blocking 2: stale pages survive an attempt that the descriptor scope disturbed. Still open. At ResourceMaterializer.cpp L2786, imagesMoved() (and so sourcesCurrent) is still skipped when the descriptorScope condition is already true.

New findings

Blocking

None.

Non-blocking

  1. Pages created by place() carry no page identity, or a stale one (B-Howell raised this in the discussion; I confirm it by reading the code, and the author's reply does not address it).
    • addPage L293-L316 resets the masks but not hasRange, rangeAddress, rangeBytes or backingSerial.
    • Only page() sets them, at L330-L336.
    • A page that place() creates is reached from spill and from the paged || overlapping branch of supplyWords. Such a page keeps whatever identity the pooled page had, or hasRange = false if the page is new.
    • sourcesCurrent can then drop that page and report the attempt as disturbed even though nothing was remapped.
    • Supplied words are vouched-unchanged guest words (Unwritten, ResourceMaterializer.cpp L1311-L1316). So I expect the effect to be an extra retry under churn, not stale data. That retry is the failure mode this PR is meant to remove.
    • Suggested fix: move the identity lookup from page() into addPage(), so every cached page records the allocation at its base. Add a test that spills a supplied block under generation churn.

Not verified

  • No title was run. The Code Violet (PPSA26528) and God of War Ragnarök (PPSA08329) results are reported by the author and by B-Howell.
  • No hardware GPU run here, only lavapipe. The RX 6650 XT run at this head is the author's report.
  • The place() finding comes from reading the code. I wrote no test for it.
  • I did not measure the cost of the extra sourcesCurrent passes under title load.
<!-- greyfinch-sync:boykopovar/AnyPS5:review:5759284912 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/15399#pullrequestreview-5759284912). Originally posted by [XairRrR](https://github.com/XairRrR) on 2026-11-03T20:50:57Z. **Review:** APPROVED --- # Re-checked — approved The new commit `44498d7819` lets a recheck pass accept an attempt that captured no image view as soon as its descriptor sources are current, without waiting for the generation to hold. Its new test fails without the change and passes with it. No blocking issue remains. ## What changed since my last review - The four earlier commits were rebased onto `main` `086c068` with no changes (delta.patch shows `=` for all four). - One new commit, `44498d7819` (B-Howell's `63c8907c79`, adopted): - `ResourceMaterializer.cpp` (+4): `imagesMoved()` computes `viewsCaptured`, which is true when `registeredImages` or any table `resourceViews` entry has identities. When nothing was captured, the pass returns "not moved" right after `sourcesCurrent` succeeds, so the generation bracket no longer applies. - `tests/ShaderMemory.cpp`: new `verifyUnviewedSnapshotDuringMappingChurn`. The generation moves on every read. With sources current, the capture must be accepted with no view checks, `imageAllocationGeneration == 0` and the T# kept. With sources stale, it must end with `did not stabilize` after 3 source checks. - The description and the author's reply now describe this follow-up. ## What I ran Head `44498d7819bc7877520bb33a56391bed24a09024`, `main` `086c0686c8adff3ee648fdbe34e0b0b647e1d511`, merged with `--no-ff` in a clean worktree (merged tree `c4e529728923afee0c33f1b5e156f8c7ccd5844b`). Machine: Debian 13 VM, 32 vCPU (two Intel Xeon Gold 6136), GCC 14.2.0, Release, Ninja, Vulkan through lavapipe (Mesa 26.1.6, LLVM 19), no GPU. ``` git diff --check 086c0686c8adff3ee648fdbe34e0b0b647e1d511...44498d7819bc7877520bb33a56391bed24a09024 python3 tools/check_conventions.py --base 086c0686c8adff3ee648fdbe34e0b0b647e1d511 # negative control: ResourceMaterializer.cpp from the previous (rebased) head 913ecea7d3 git show 913ecea7d360:core/shader/recompiler/Optimization/src/ResourceMaterializer.cpp > core/shader/recompiler/Optimization/src/ResourceMaterializer.cpp ninja -C build -j32 -l32 agc_shader_memory_tests ctest --test-dir build -j8 --test-load 32 --output-on-failure -R "^(agc_shader_memory|agc_shader_type_zero_image_materialization)$" git show c4e529728923afee0c33f1b5e156f8c7ccd5844b:core/shader/recompiler/Optimization/src/ResourceMaterializer.cpp > core/shader/recompiler/Optimization/src/ResourceMaterializer.cpp # attribution of the VUIDs the script flagged in agc_driver_image_gather_volume env VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation ANYPS5_NO_SHADER_CACHE=1 ANYPS5_REQUIRE_VULKAN=1 ctest --test-dir build -V -R "^agc_driver_image_gather_volume$" for f in <ShaderMemory.hpp ShaderMemory.cpp SrtWalker.hpp ResourceMaterializer.cpp>; do git show 086c0686c8ad:$f > $f; done ninja -C build -j32 -l32 agc_driver_image_gather_volume_tests env VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation ANYPS5_NO_SHADER_CACHE=1 ANYPS5_REQUIRE_VULKAN=1 ctest --test-dir build -V -R "^agc_driver_image_gather_volume$" for f in <same four files>; do git show c4e529728923:$f > $f; done git status --porcelain ninja -C build -j32 -l32 agc_driver_image_gather_volume_tests agc_shader_memory_tests ctest --test-dir build -j8 --test-load 32 --output-on-failure -R "^(agc_shader_memory|agc_shader_type_zero_image_materialization)$" ``` | Check | Result | |---|---| | `git diff --check` | clean | | `check_conventions.py` | All conventions checks passed | | Configure / build / `libs` (script) | passed | | Selected tests (script, 2178 run) | 2056 passed and 115 skipped (all expected per `check_skips.py`). 0 new failures, 0 timeouts. The 7 failures also fail on `main`. `agc_driver_alpha_to_coverage_sample_mask_export` passed on rerun. | | Vulkan validation vs `main` (script) | 783 tests. The layer loaded in 782 and no test reported it missing. One test, `agc_driver_image_gather_volume`, was flagged with new `VKSamplerCreateInfo-addressMode*` VUIDs marked "test not run on main". | | Those VUIDs with the PR's production files restored from `main` `086c068` | The same 4 VUIDs, 2 lines each. They come from `main` (the baseline was older), not from this PR. | | Negative control (see below) | Both tests fail | | After restoring | `git status --porcelain` is empty. `agc_shader_memory` (8.4 s) and `agc_shader_type_zero_image_materialization` (0.02 s) pass. | <details><summary>Negative control output</summary> ``` 1/2 Test #2183: agc_shader_type_zero_image_materialization ...***Failed 0.01 sec runtime resource snapshot did not stabilize 2/2 Test #2193: agc_shader_memory ............................***Failed 1.54 sec runtime resource snapshot did not stabilize ``` </details> The negative control used only `ResourceMaterializer.cpp` from the previous head, because the new test needs the callbacks from the earlier commits to compile. It confirms the author's and B-Howell's reported result. ## Previous findings - **Non-blocking 1: only the allocation at the page base is tracked.** Still open. `ShaderMemory.cpp` is unchanged by the new commit: [L332-L336](https://github.com/boykopovar/AnyPS5/blob/44498d7819bc7877520bb33a56391bed24a09024/core/libs/prx/libSceAgcDriver/Execution/src/ShaderMemory.cpp#L332-L336) still records only `GuestAllocationsLookup(base)`. - It now matters a little more. For an attempt with no views, `sourcesCurrent` is the only check left once the generation moves. - It remains non-blocking because `main` does not re-read cached pages on a generation retry either. - **Non-blocking 2: stale pages survive an attempt that the descriptor scope disturbed.** Still open. At [ResourceMaterializer.cpp L2786](https://github.com/boykopovar/AnyPS5/blob/44498d7819bc7877520bb33a56391bed24a09024/core/shader/recompiler/Optimization/src/ResourceMaterializer.cpp#L2766-L2786), `imagesMoved()` (and so `sourcesCurrent`) is still skipped when the `descriptorScope` condition is already true. ## New findings ### Blocking None. ### Non-blocking 1. **Pages created by `place()` carry no page identity, or a stale one** (B-Howell raised this in the discussion; I confirm it by reading the code, and the author's reply does not address it). - [`addPage` L293-L316](https://github.com/boykopovar/AnyPS5/blob/44498d7819bc7877520bb33a56391bed24a09024/core/libs/prx/libSceAgcDriver/Execution/src/ShaderMemory.cpp#L293-L316) resets the masks but not `hasRange`, `rangeAddress`, `rangeBytes` or `backingSerial`. - Only `page()` sets them, at [L330-L336](https://github.com/boykopovar/AnyPS5/blob/44498d7819bc7877520bb33a56391bed24a09024/core/libs/prx/libSceAgcDriver/Execution/src/ShaderMemory.cpp#L330-L336). - A page that [`place()`](https://github.com/boykopovar/AnyPS5/blob/44498d7819bc7877520bb33a56391bed24a09024/core/libs/prx/libSceAgcDriver/Execution/src/ShaderMemory.cpp#L677-L687) creates is reached from `spill` and from the `paged || overlapping` branch of `supplyWords`. Such a page keeps whatever identity the pooled page had, or `hasRange = false` if the page is new. - [`sourcesCurrent`](https://github.com/boykopovar/AnyPS5/blob/44498d7819bc7877520bb33a56391bed24a09024/core/libs/prx/libSceAgcDriver/Execution/src/ShaderMemory.cpp#L600-L612) can then drop that page and report the attempt as disturbed even though nothing was remapped. - Supplied words are vouched-unchanged guest words (`Unwritten`, [ResourceMaterializer.cpp L1311-L1316](https://github.com/boykopovar/AnyPS5/blob/44498d7819bc7877520bb33a56391bed24a09024/core/shader/recompiler/Optimization/src/ResourceMaterializer.cpp#L1311-L1316)). So I expect the effect to be an extra retry under churn, not stale data. That retry is the failure mode this PR is meant to remove. - Suggested fix: move the identity lookup from `page()` into `addPage()`, so every cached page records the allocation at its base. Add a test that spills a supplied block under generation churn. ## Not verified - No title was run. The Code Violet (PPSA26528) and God of War Ragnarök (PPSA08329) results are reported by the author and by B-Howell. - No hardware GPU run here, only lavapipe. The RX 6650 XT run at this head is the author's report. - The `place()` finding comes from reading the code. I wrote no test for it. - I did not measure the cost of the extra `sourcesCurrent` passes under title load. <!-- anyps5-bots job=3588 head=44498d7819bc7877520bb33a56391bed24a09024 -->

Pull request closed

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!15399
No description provided.