fix(agc): fail a template's proof on a released texture and audit it with the full walk #8047

Merged
fisherjoey merged 4 commits from upstream-pr/8047 into main 2026-10-20 15:46:08 +00:00
fisherjoey commented 2026-10-19 18:44:46 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by fisherjoey on 2026-10-19T18:44:46Z.


What

A cached ShaderResources (a dispatch or draw template) is reused when Revalidate proves it current. The fast proof checks each bound sampled texture's memory, keys and pending writes, but not whether the sampled lookup would still return the bound Texture. A template over an unchanged surface can therefore keep an object the lookup no longer returns (#8040). This PR makes two changes.

  • Released textures: fastRevalidate and fastRevalidateEach fail, with the new reason replaced texture, when a bound texture is Released(). That is the flag #6492 sets when the sampled cache drops a texture something still holds. #6492 drops such templates at the next ResourceCache::Insert. Until that Insert, Find still served them and their fast proof passed. With this change the full walk runs, its lookup returns the new entry, the proof fails, and the template is rebuilt. Cost: one atomic load per bound texture per proof.
  • Audit: a template whose last full walk is more than APS5_TEMPLATE_AUDIT_MS old (default 1000 ms, 0 turns it off) takes the full walk in place of the fast proof, with the new reason audit. This covers the case nothing marks: the lookup would now return something else for an unchanged surface, but no lookup has run, so no entry was replaced. For example, a snapshot's surface becomes host-imported and the lookup would view its storage image instead. The walk repeats the real lookups, a different answer fails the proof, the template is rebuilt, and the entry that lookup replaced is released, which then fails every other template binding it. An unchanged template passes the walk and goes back to the fast proof. The interval is a variable so the tests can use 250 ms, and it has a row in docs/dev/ENVIRONMENT.md.

Fixes #8040

Tested

  • New agc_driver_resource_cache_replaced_texture: a template over a write-watched snapshot takes the fast proof, the test clears the sampled cache without touching the memory, and the next proof has to fail. With main's ShaderResources sources it fails on lavapipe with a template binding a texture whose cache entry left still proved current. With this change it passes.
  • New agc_driver_resource_cache_lookup_changed (250 ms interval, skips without host imports): past the interval, an unchanged template takes the full walk once, keeps its texture, and the next proof is fast again. Then the test host-imports the surface with no lookup in between. The proof past the interval has to fail, and the rebuild has to bind the storage view. With main's sources it fails on lavapipe with a proof past the audit interval did not take the full walk. With this change it passes.
  • The 66 tests run by agc_driver_sampled_cache_budget_tests, agc_driver_recorder_tests, agc_driver_image_table_cache_bounds_tests and agc_driver_draw_cache_reuse_tests on this branch (main f52509acc), Linux, Release, GCC 16. On lavapipe (Mesa llvmpipe): 61 pass and 5 skip for missing capabilities. On an NVIDIA GeForce RTX 5070 Ti (driver 595.91.07, ANYPS5_REQUIRE_VULKAN=1): all 66 pass. The two new tests passed 20 of 20 repeats on lavapipe and 5 of 5 on the RTX 5070 Ti. The Khronos validation layer isn't installed on this machine, so I haven't done the validation-layer comparison against main yet.
  • tools/check_conventions.py --base origin/main passes.
  • Demon's Souls PPSA01341 v1.07, Linux (Nobara, kernel 7.2), RTX 5070 Ti, driver 595.91.07, 900 s per run from boot through New Game into the first level, judged by the indexed-indirect draw ratio from #8040 (normal 200 to 225, crawl 410 to 475) and a screenshot at t+400 s. These runs were not on current main. The base was main ccb0c0926 (before #6492) plus #6926, #6280, #6567 (merged since), the stencil-export workaround (never upstream), the ImportWatched page-digest change from #7981, a guarded unit-shadow publish run in its wait-only mode (APS5_WB_GUARD_PUBLISH=wait, the same idea as #7984), and diagnostics that were off in these runs. The fix on that base was this audit plus an in-cache flag in place of Released(). That flag was the first version of the first change; #6492's flag marks the same erases.
    • Without the fix, about 60% of runs crawl. The first version with only the in-cache check crawled in 2 of 2 runs (median ratio 439 and 436).
    • With the audit: 3 of 3 runs normal (median 216, 214, 213). At a 60% base rate, 3 clean runs happen by chance about 6% of the time. These runs had no storage-cache evictions in the level, a condition under which all 7 runs before the fixes crawled.
    • Cost: 8.73, 8.89 and 8.75 presents per 10 s in the level, against about 9.0 for normal runs of the same set without the fix (2 to 3%). No speed claim beyond that; these were not measuring runs.
  • On current main the title still crawls: main 676269473 with #6280, #6926, #7844 and the stencil workaround crawled in both runs that reached the level warm (median ratio 414 and 438, 5.92 and 5.55 presents per 10 s). The same set with only libSceAgcDriver.prx rebuilt with this fix (so the shader cache stayed warm): all three runs were normal from the first level window (median 213 to 214) at 8.84, 9.21 and 9.38 presents per 10 s, with no crash over the full 900 s. None of the five runs had a storage-cache eviction, so no run was rescued by one. Small sample: 2 base runs and 3 with the fix.
  • #6492 added Released() and the lazy drop at Insert. This PR reuses the flag in the proof and adds the audit for the case where nothing is released.
  • #6192 (open) changes fastRevalidate near these lines. It doesn't add an identity check, so the two don't overlap in purpose, but whichever lands second may need a rebase.

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); this change adds no stubs
  • 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; none added
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Fixes: #8040
  • Unblocks: none
  • GPUs tested: lavapipe (Mesa llvmpipe), Linux, for the tests; NVIDIA GeForce RTX 5070 Ti, driver 595.91.07, Linux (Nobara, kernel 7.2), for the tests and the game runs
  • AI-assisted: yes

AI-assisted: yes

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4925718774 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/8047). Originally posted by [fisherjoey](https://github.com/fisherjoey) on 2026-10-19T18:44:46Z. --- ### What A cached `ShaderResources` (a dispatch or draw template) is reused when `Revalidate` proves it current. The fast proof checks each bound sampled texture's memory, keys and pending writes, but not whether the sampled lookup would still return the bound `Texture`. A template over an unchanged surface can therefore keep an object the lookup no longer returns (#8040). This PR makes two changes. - Released textures: `fastRevalidate` and `fastRevalidateEach` fail, with the new reason `replaced texture`, when a bound texture is `Released()`. That is the flag #6492 sets when the sampled cache drops a texture something still holds. #6492 drops such templates at the next `ResourceCache::Insert`. Until that Insert, `Find` still served them and their fast proof passed. With this change the full walk runs, its lookup returns the new entry, the proof fails, and the template is rebuilt. Cost: one atomic load per bound texture per proof. - Audit: a template whose last full walk is more than `APS5_TEMPLATE_AUDIT_MS` old (default 1000 ms, `0` turns it off) takes the full walk in place of the fast proof, with the new reason `audit`. This covers the case nothing marks: the lookup would now return something else for an unchanged surface, but no lookup has run, so no entry was replaced. For example, a snapshot's surface becomes host-imported and the lookup would view its storage image instead. The walk repeats the real lookups, a different answer fails the proof, the template is rebuilt, and the entry that lookup replaced is released, which then fails every other template binding it. An unchanged template passes the walk and goes back to the fast proof. The interval is a variable so the tests can use 250 ms, and it has a row in `docs/dev/ENVIRONMENT.md`. Fixes #8040 ### Tested - New `agc_driver_resource_cache_replaced_texture`: a template over a write-watched snapshot takes the fast proof, the test clears the sampled cache without touching the memory, and the next proof has to fail. With main's `ShaderResources` sources it fails on lavapipe with `a template binding a texture whose cache entry left still proved current`. With this change it passes. - New `agc_driver_resource_cache_lookup_changed` (250 ms interval, skips without host imports): past the interval, an unchanged template takes the full walk once, keeps its texture, and the next proof is fast again. Then the test host-imports the surface with no lookup in between. The proof past the interval has to fail, and the rebuild has to bind the storage view. With main's sources it fails on lavapipe with `a proof past the audit interval did not take the full walk`. With this change it passes. - The 66 tests run by `agc_driver_sampled_cache_budget_tests`, `agc_driver_recorder_tests`, `agc_driver_image_table_cache_bounds_tests` and `agc_driver_draw_cache_reuse_tests` on this branch (main f52509acc), Linux, Release, GCC 16. On lavapipe (Mesa llvmpipe): 61 pass and 5 skip for missing capabilities. On an NVIDIA GeForce RTX 5070 Ti (driver 595.91.07, `ANYPS5_REQUIRE_VULKAN=1`): all 66 pass. The two new tests passed 20 of 20 repeats on lavapipe and 5 of 5 on the RTX 5070 Ti. The Khronos validation layer isn't installed on this machine, so I haven't done the validation-layer comparison against main yet. - `tools/check_conventions.py --base origin/main` passes. - Demon's Souls PPSA01341 v1.07, Linux (Nobara, kernel 7.2), RTX 5070 Ti, driver 595.91.07, 900 s per run from boot through New Game into the first level, judged by the indexed-indirect draw ratio from #8040 (normal 200 to 225, crawl 410 to 475) and a screenshot at t+400 s. These runs were not on current main. The base was main ccb0c0926 (before #6492) plus #6926, #6280, #6567 (merged since), the stencil-export workaround (never upstream), the `ImportWatched` page-digest change from #7981, a guarded unit-shadow publish run in its wait-only mode (`APS5_WB_GUARD_PUBLISH=wait`, the same idea as #7984), and diagnostics that were off in these runs. The fix on that base was this audit plus an in-cache flag in place of `Released()`. That flag was the first version of the first change; #6492's flag marks the same erases. - Without the fix, about 60% of runs crawl. The first version with only the in-cache check crawled in 2 of 2 runs (median ratio 439 and 436). - With the audit: 3 of 3 runs normal (median 216, 214, 213). At a 60% base rate, 3 clean runs happen by chance about 6% of the time. These runs had no storage-cache evictions in the level, a condition under which all 7 runs before the fixes crawled. - Cost: 8.73, 8.89 and 8.75 presents per 10 s in the level, against about 9.0 for normal runs of the same set without the fix (2 to 3%). No speed claim beyond that; these were not measuring runs. - On current main the title still crawls: main 676269473 with #6280, #6926, #7844 and the stencil workaround crawled in both runs that reached the level warm (median ratio 414 and 438, 5.92 and 5.55 presents per 10 s). The same set with only `libSceAgcDriver.prx` rebuilt with this fix (so the shader cache stayed warm): all three runs were normal from the first level window (median 213 to 214) at 8.84, 9.21 and 9.38 presents per 10 s, with no crash over the full 900 s. None of the five runs had a storage-cache eviction, so no run was rescued by one. Small sample: 2 base runs and 3 with the fix. ### Related - #6492 added `Released()` and the lazy drop at `Insert`. This PR reuses the flag in the proof and adds the audit for the case where nothing is released. - #6192 (open) changes `fastRevalidate` near these lines. It doesn't add an identity check, so the two don't overlap in purpose, but whichever lands second may need a rebase. ### 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 - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); this change adds no stubs - [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; none added - [x] Generic behaviour, not specific to one title - [x] Depends on: none - [x] Fixes: #8040 - [x] Unblocks: none - [x] GPUs tested: lavapipe (Mesa llvmpipe), Linux, for the tests; NVIDIA GeForce RTX 5070 Ti, driver 595.91.07, Linux (Nobara, kernel 7.2), for the tests and the game runs - [x] AI-assisted: yes AI-assisted: yes
github-actions[bot] commented 2026-10-19 18:59:16 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-19T18:59:16Z.


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

Pull request Shared files not compared
PR 1368 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 1395 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 2434 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 5021 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/tests/execution/SampledCacheBudget.cpp
PR 5371 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 5426 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 5431 core/libs/prx/libSceAgcDriver/CMakeLists.txt
docs/dev/ENVIRONMENT.md
PR 5499 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 5925 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6044 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6146 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6177 core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 6185 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6186 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6187 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6188 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Graphics/include/ShaderResources.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 6192 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Graphics/include/ShaderResources.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 6194 core/libs/prx/libSceAgcDriver/Graphics/include/ShaderResources.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 6202 core/libs/prx/libSceAgcDriver/Graphics/include/ShaderResources.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 6209 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6223 core/libs/prx/libSceAgcDriver/Graphics/include/ShaderResources.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 6280 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6300 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6412 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Graphics/include/ShaderResources.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 6481 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 6498 core/libs/prx/libSceAgcDriver/Graphics/include/ShaderResources.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 6501 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6636 core/libs/prx/libSceAgcDriver/Graphics/include/ShaderResources.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
docs/dev/ENVIRONMENT.md
PR 6658 docs/dev/ENVIRONMENT.md
PR 6682 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6683 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6747 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6788 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6808 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6868 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6946 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Graphics/include/ShaderResources.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
docs/dev/ENVIRONMENT.md
PR 6947 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Graphics/include/ShaderResources.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
docs/dev/ENVIRONMENT.md
PR 6951 docs/dev/ENVIRONMENT.md
PR 6959 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 7002 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Graphics/include/ShaderResources.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 7048 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 7085 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 7154 core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 7201 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 7395 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 7446 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 7457 core/libs/prx/libSceAgcDriver/CMakeLists.txt
docs/dev/ENVIRONMENT.md
PR 7464 core/libs/prx/libSceAgcDriver/CMakeLists.txt
docs/dev/ENVIRONMENT.md
PR 7484 core/libs/prx/libSceAgcDriver/Graphics/include/ShaderResources.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
docs/dev/ENVIRONMENT.md
PR 7505 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 7514 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 7604 core/libs/prx/libSceAgcDriver/CMakeLists.txt
docs/dev/ENVIRONMENT.md
PR 7642 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Graphics/include/ShaderResources.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
docs/dev/ENVIRONMENT.md
PR 7644 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 7647 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 7689 core/libs/prx/libSceAgcDriver/Graphics/include/ShaderResources.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 7800 core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Graphics/include/ShaderResources.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
core/libs/prx/libSceAgcDriver/tests/execution/SampledCacheBudget.cpp
PR 7922 docs/dev/ENVIRONMENT.md
PR 8004 docs/dev/ENVIRONMENT.md
PR 8014 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 8077 docs/dev/ENVIRONMENT.md
PR 8134 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 8206 core/libs/prx/libSceAgcDriver/CMakeLists.txt
docs/dev/ENVIRONMENT.md
PR 8267 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 8489 core/libs/prx/libSceAgcDriver/CMakeLists.txt
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6274916766 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/8047#issuecomment-6274916766). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-19T18:59:16Z. --- <!-- pr-overlap --> Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap. | Pull request | Shared files not compared | |---|---| | [PR 1368](https://www.github.com/boykopovar/AnyPS5/pull/1368) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 1395](https://www.github.com/boykopovar/AnyPS5/pull/1395) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 2434](https://www.github.com/boykopovar/AnyPS5/pull/2434) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 5021](https://www.github.com/boykopovar/AnyPS5/pull/5021) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt`<br>`core/libs/prx/libSceAgcDriver/tests/execution/SampledCacheBudget.cpp` | | [PR 5371](https://www.github.com/boykopovar/AnyPS5/pull/5371) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 5426](https://www.github.com/boykopovar/AnyPS5/pull/5426) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 5431](https://www.github.com/boykopovar/AnyPS5/pull/5431) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt`<br>`docs/dev/ENVIRONMENT.md` | | [PR 5499](https://www.github.com/boykopovar/AnyPS5/pull/5499) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 5925](https://www.github.com/boykopovar/AnyPS5/pull/5925) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 6044](https://www.github.com/boykopovar/AnyPS5/pull/6044) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 6146](https://www.github.com/boykopovar/AnyPS5/pull/6146) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 6177](https://www.github.com/boykopovar/AnyPS5/pull/6177) | `core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp` | | [PR 6185](https://www.github.com/boykopovar/AnyPS5/pull/6185) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 6186](https://www.github.com/boykopovar/AnyPS5/pull/6186) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 6187](https://www.github.com/boykopovar/AnyPS5/pull/6187) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 6188](https://www.github.com/boykopovar/AnyPS5/pull/6188) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt`<br>`core/libs/prx/libSceAgcDriver/Graphics/include/ShaderResources.hpp`<br>`core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp` | | [PR 6192](https://www.github.com/boykopovar/AnyPS5/pull/6192) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt`<br>`core/libs/prx/libSceAgcDriver/Graphics/include/ShaderResources.hpp`<br>`core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp` | | [PR 6194](https://www.github.com/boykopovar/AnyPS5/pull/6194) | `core/libs/prx/libSceAgcDriver/Graphics/include/ShaderResources.hpp`<br>`core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp` | | [PR 6202](https://www.github.com/boykopovar/AnyPS5/pull/6202) | `core/libs/prx/libSceAgcDriver/Graphics/include/ShaderResources.hpp`<br>`core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp` | | [PR 6209](https://www.github.com/boykopovar/AnyPS5/pull/6209) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 6223](https://www.github.com/boykopovar/AnyPS5/pull/6223) | `core/libs/prx/libSceAgcDriver/Graphics/include/ShaderResources.hpp`<br>`core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp` | | [PR 6280](https://www.github.com/boykopovar/AnyPS5/pull/6280) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 6300](https://www.github.com/boykopovar/AnyPS5/pull/6300) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 6412](https://www.github.com/boykopovar/AnyPS5/pull/6412) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt`<br>`core/libs/prx/libSceAgcDriver/Graphics/include/ShaderResources.hpp`<br>`core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp` | | [PR 6481](https://www.github.com/boykopovar/AnyPS5/pull/6481) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt`<br>`core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp` | | [PR 6498](https://www.github.com/boykopovar/AnyPS5/pull/6498) | `core/libs/prx/libSceAgcDriver/Graphics/include/ShaderResources.hpp`<br>`core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp` | | [PR 6501](https://www.github.com/boykopovar/AnyPS5/pull/6501) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 6636](https://www.github.com/boykopovar/AnyPS5/pull/6636) | `core/libs/prx/libSceAgcDriver/Graphics/include/ShaderResources.hpp`<br>`core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp`<br>`docs/dev/ENVIRONMENT.md` | | [PR 6658](https://www.github.com/boykopovar/AnyPS5/pull/6658) | `docs/dev/ENVIRONMENT.md` | | [PR 6682](https://www.github.com/boykopovar/AnyPS5/pull/6682) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 6683](https://www.github.com/boykopovar/AnyPS5/pull/6683) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 6747](https://www.github.com/boykopovar/AnyPS5/pull/6747) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 6788](https://www.github.com/boykopovar/AnyPS5/pull/6788) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 6808](https://www.github.com/boykopovar/AnyPS5/pull/6808) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 6868](https://www.github.com/boykopovar/AnyPS5/pull/6868) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 6946](https://www.github.com/boykopovar/AnyPS5/pull/6946) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt`<br>`core/libs/prx/libSceAgcDriver/Graphics/include/ShaderResources.hpp`<br>`core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp`<br>`docs/dev/ENVIRONMENT.md` | | [PR 6947](https://www.github.com/boykopovar/AnyPS5/pull/6947) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt`<br>`core/libs/prx/libSceAgcDriver/Graphics/include/ShaderResources.hpp`<br>`core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp`<br>`docs/dev/ENVIRONMENT.md` | | [PR 6951](https://www.github.com/boykopovar/AnyPS5/pull/6951) | `docs/dev/ENVIRONMENT.md` | | [PR 6959](https://www.github.com/boykopovar/AnyPS5/pull/6959) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 7002](https://www.github.com/boykopovar/AnyPS5/pull/7002) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt`<br>`core/libs/prx/libSceAgcDriver/Graphics/include/ShaderResources.hpp`<br>`core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp` | | [PR 7048](https://www.github.com/boykopovar/AnyPS5/pull/7048) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 7085](https://www.github.com/boykopovar/AnyPS5/pull/7085) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 7154](https://www.github.com/boykopovar/AnyPS5/pull/7154) | `core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp` | | [PR 7201](https://www.github.com/boykopovar/AnyPS5/pull/7201) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 7395](https://www.github.com/boykopovar/AnyPS5/pull/7395) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 7446](https://www.github.com/boykopovar/AnyPS5/pull/7446) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 7457](https://www.github.com/boykopovar/AnyPS5/pull/7457) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt`<br>`docs/dev/ENVIRONMENT.md` | | [PR 7464](https://www.github.com/boykopovar/AnyPS5/pull/7464) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt`<br>`docs/dev/ENVIRONMENT.md` | | [PR 7484](https://www.github.com/boykopovar/AnyPS5/pull/7484) | `core/libs/prx/libSceAgcDriver/Graphics/include/ShaderResources.hpp`<br>`core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp`<br>`docs/dev/ENVIRONMENT.md` | | [PR 7505](https://www.github.com/boykopovar/AnyPS5/pull/7505) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 7514](https://www.github.com/boykopovar/AnyPS5/pull/7514) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 7604](https://www.github.com/boykopovar/AnyPS5/pull/7604) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt`<br>`docs/dev/ENVIRONMENT.md` | | [PR 7642](https://www.github.com/boykopovar/AnyPS5/pull/7642) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt`<br>`core/libs/prx/libSceAgcDriver/Graphics/include/ShaderResources.hpp`<br>`core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp`<br>`docs/dev/ENVIRONMENT.md` | | [PR 7644](https://www.github.com/boykopovar/AnyPS5/pull/7644) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 7647](https://www.github.com/boykopovar/AnyPS5/pull/7647) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 7689](https://www.github.com/boykopovar/AnyPS5/pull/7689) | `core/libs/prx/libSceAgcDriver/Graphics/include/ShaderResources.hpp`<br>`core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp` | | [PR 7800](https://www.github.com/boykopovar/AnyPS5/pull/7800) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt`<br>`core/libs/prx/libSceAgcDriver/Graphics/include/ShaderResources.hpp`<br>`core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp`<br>`core/libs/prx/libSceAgcDriver/tests/execution/SampledCacheBudget.cpp` | | [PR 7922](https://www.github.com/boykopovar/AnyPS5/pull/7922) | `docs/dev/ENVIRONMENT.md` | | [PR 8004](https://www.github.com/boykopovar/AnyPS5/pull/8004) | `docs/dev/ENVIRONMENT.md` | | [PR 8014](https://www.github.com/boykopovar/AnyPS5/pull/8014) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 8077](https://www.github.com/boykopovar/AnyPS5/pull/8077) | `docs/dev/ENVIRONMENT.md` | | [PR 8134](https://www.github.com/boykopovar/AnyPS5/pull/8134) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 8206](https://www.github.com/boykopovar/AnyPS5/pull/8206) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt`<br>`docs/dev/ENVIRONMENT.md` | | [PR 8267](https://www.github.com/boykopovar/AnyPS5/pull/8267) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` | | [PR 8489](https://www.github.com/boykopovar/AnyPS5/pull/8489) | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` |
fisherjoey commented 2026-10-19 19:13:44 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by fisherjoey on 2026-10-19T19:13:44Z.


Results on a current-main base, with this PR's driver swapped in and nothing else changed.

Base: main 676269473 plus #6280, #6926 and #7844, and a local stencil-export workaround that Demon's Souls needs on this NVIDIA box (not part of any PR). Demon's Souls (PPSA01341 v1.07), RTX 5070 Ti, NVIDIA 595.91.07, default texture cache budget, 900 s per run. The crawl measure is indexed indirect draws per (indirect + multi-indirect) draw per 10 s window: about 210 normally, about 410-440 in the crawl.

Build Run Ratio (median) Presents per 10 s
base 229 ~415 (crawl) 5.92
base 230 438 (crawl) 5.55
base + this PR 231 213 8.84
base + this PR 232 214 9.21
base + this PR 233 213-214 9.38

No crashes in the three runs with the PR, and no storage cache evictions in any of the five, so none of them was rescued by an eviction. Small sample, but the base crawled in both runs that reached the level, and the PR runs were normal from the first level window.

AI-assisted: yes

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6275196533 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/8047#issuecomment-6275196533). Originally posted by [fisherjoey](https://github.com/fisherjoey) on 2026-10-19T19:13:44Z. --- Results on a current-main base, with this PR's driver swapped in and nothing else changed. Base: `main` 676269473 plus #6280, #6926 and #7844, and a local stencil-export workaround that Demon's Souls needs on this NVIDIA box (not part of any PR). Demon's Souls (PPSA01341 v1.07), RTX 5070 Ti, NVIDIA 595.91.07, default texture cache budget, 900 s per run. The crawl measure is indexed indirect draws per (indirect + multi-indirect) draw per 10 s window: about 210 normally, about 410-440 in the crawl. | Build | Run | Ratio (median) | Presents per 10 s | |---|---|---|---| | base | 229 | ~415 (crawl) | 5.92 | | base | 230 | 438 (crawl) | 5.55 | | base + this PR | 231 | 213 | 8.84 | | base + this PR | 232 | 214 | 9.21 | | base + this PR | 233 | 213-214 | 9.38 | No crashes in the three runs with the PR, and no storage cache evictions in any of the five, so none of them was rescued by an eviction. Small sample, but the base crawled in both runs that reached the level, and the PR runs were normal from the first level window. AI-assisted: yes
MarcZX10 commented 2026-10-19 20:31:17 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-19T20:31:17Z.


Thanks for the current-main comparison. Two base runs crawled while the three PR runs were normal from the first level window, and none of the five had storage-cache evictions; that is useful evidence for the audit change, with the small sample size clearly stated. The description still says more current-main runs are queued. Please fold this table and its limitation into the Tested section so the PR summary reflects the new result.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6276666730 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/8047#issuecomment-6276666730). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-19T20:31:17Z. --- Thanks for the current-main comparison. Two base runs crawled while the three PR runs were normal from the first level window, and none of the five had storage-cache evictions; that is useful evidence for the audit change, with the small sample size clearly stated. The description still says more current-main runs are queued. Please fold this table and its limitation into the Tested section so the PR summary reflects the new result.
fisherjoey commented 2026-10-19 21:42:04 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by fisherjoey on 2026-10-19T21:42:04Z.


Done, the Tested section now has the five-run table result and the small-sample note.

AI-assisted: yes

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6278032325 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/8047#issuecomment-6278032325). Originally posted by [fisherjoey](https://github.com/fisherjoey) on 2026-10-19T21:42:04Z. --- Done, the Tested section now has the five-run table result and the small-sample note. AI-assisted: yes
oneandonlydean commented 2026-10-20 01:53:23 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-20T01:53:23Z.


Thanks for this. One small change to the new test, please.

resource-lookup-changed exits 77 with "skipped, the lookup-changed test requires host imports" and "skipped, the host import of the watched surface was refused". Neither text matches the device-limitation pattern in tools/check_skips.py, so on any runner without host imports the job would fail instead of recording a skip. Linux CI's llvmpipe has host imports, so it doesn't show up today. Could you use the existing phrase "skipped, host imports are unavailable" for both? That one matches.

Separately, the time-based audit (part 2) changes behaviour for every title, so it is going to the maintainer for a design call. The Released check (part 1) looks good.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6281482144 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/8047#issuecomment-6281482144). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-10-20T01:53:23Z. --- Thanks for this. One small change to the new test, please. `resource-lookup-changed` exits 77 with "skipped, the lookup-changed test requires host imports" and "skipped, the host import of the watched surface was refused". Neither text matches the device-limitation pattern in `tools/check_skips.py`, so on any runner without host imports the job would fail instead of recording a skip. Linux CI's llvmpipe has host imports, so it doesn't show up today. Could you use the existing phrase "skipped, host imports are unavailable" for both? That one matches. Separately, the time-based audit (part 2) changes behaviour for every title, so it is going to the maintainer for a design call. The Released check (part 1) looks good.
wachi35676 commented 2026-10-20 01:56:42 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by wachi35676 on 2026-10-20T01:56:42Z.


Windows runs of the tests (the PR ran them on Linux only), on NVIDIA and on an AMD iGPU.

Setup: Windows 11 26300, MinGW GCC 15.2 Release, main eb7500680 + this PR (3c43ce33a, merges cleanly). GPUs: RTX 5070 Ti (NVIDIA 617.42) and Ryzen 5 9600X Radeon iGPU (ANYPS5_GPU=AMD, 32.0.21042.62), both with ANYPS5_REQUIRE_VULKAN=1.

  • agc_driver_resource_cache_replaced_texture and agc_driver_resource_cache_lookup_changed passed 5 of 5 on each GPU. Neither skipped: host imports are available on both drivers.
  • Negative control: I put ShaderResources.cpp and ShaderResources.hpp back to main and kept the tests. Both tests fail on both GPUs, with the messages the PR gives: a template binding a texture whose cache entry left still proved current and a proof past the audit interval did not take the full walk.
  • ctest -R "agc|shader|spirv|recomp" (825 tests, which include the sampled-cache-budget, recorder, image-table and draw-cache-reuse groups): on NVIDIA 2 failed (msaa_dcc_clear_4, pass_input_hazard); on AMD 5 failed (agc_trimmed_import, msaa_dcc_clear_4, layered_volume_vertex_no_gpl, draw_cache_reuse_off, stencil_replay_no_gpl). All of these also fail on main on this machine. No new failures.
  • check_conventions.py --base origin/main passes.

No title runs here, so the Demon's Souls result and the 2-3% audit cost are not re-measured. One small point from reading the code: APS5_TEMPLATE_AUDIT_MS goes through strtoull, so a value that is not a number reads as 0 and turns the audit off without a message.

AI-assisted: yes (Claude Code); results above were run on this machine.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6281521863 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/8047#issuecomment-6281521863). Originally posted by [wachi35676](https://github.com/wachi35676) on 2026-10-20T01:56:42Z. --- Windows runs of the tests (the PR ran them on Linux only), on NVIDIA and on an AMD iGPU. Setup: Windows 11 26300, MinGW GCC 15.2 Release, `main` eb7500680 + this PR (3c43ce33a, merges cleanly). GPUs: RTX 5070 Ti (NVIDIA 617.42) and Ryzen 5 9600X Radeon iGPU (`ANYPS5_GPU=AMD`, 32.0.21042.62), both with `ANYPS5_REQUIRE_VULKAN=1`. - `agc_driver_resource_cache_replaced_texture` and `agc_driver_resource_cache_lookup_changed` passed 5 of 5 on each GPU. Neither skipped: host imports are available on both drivers. - Negative control: I put `ShaderResources.cpp` and `ShaderResources.hpp` back to main and kept the tests. Both tests fail on both GPUs, with the messages the PR gives: `a template binding a texture whose cache entry left still proved current` and `a proof past the audit interval did not take the full walk`. - `ctest -R "agc|shader|spirv|recomp"` (825 tests, which include the sampled-cache-budget, recorder, image-table and draw-cache-reuse groups): on NVIDIA 2 failed (`msaa_dcc_clear_4`, `pass_input_hazard`); on AMD 5 failed (`agc_trimmed_import`, `msaa_dcc_clear_4`, `layered_volume_vertex_no_gpl`, `draw_cache_reuse_off`, `stencil_replay_no_gpl`). All of these also fail on main on this machine. No new failures. - `check_conventions.py --base origin/main` passes. No title runs here, so the Demon's Souls result and the 2-3% audit cost are not re-measured. One small point from reading the code: `APS5_TEMPLATE_AUDIT_MS` goes through `strtoull`, so a value that is not a number reads as `0` and turns the audit off without a message. AI-assisted: yes (Claude Code); results above were run on this machine.
MarcZX10 commented 2026-10-20 10:36:07 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-20T10:36:07Z.


I checked exact head 3c43ce33a074c1c6df0579e458a777f6c0224426: resource-lookup-changed still prints “skipped, the lookup-changed test requires host imports” and “skipped, the host import of the watched surface was refused.” Neither matches DEVICE_LIMITATION in tools/check_skips.py; the existing “skipped, host imports are unavailable” prefix does. Could you update both skip messages as requested so a host without import support is classified as a device skip?

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6288978796 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/8047#issuecomment-6288978796). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-20T10:36:07Z. --- I checked exact head `3c43ce33a074c1c6df0579e458a777f6c0224426`: `resource-lookup-changed` still prints “skipped, the lookup-changed test requires host imports” and “skipped, the host import of the watched surface was refused.” Neither matches `DEVICE_LIMITATION` in `tools/check_skips.py`; the existing “skipped, host imports are unavailable” prefix does. Could you update both skip messages as requested so a host without import support is classified as a device skip?
fisherjoey commented 2026-10-20 15:12:27 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by fisherjoey on 2026-10-20T15:12:27Z.


Both skip messages in resource-lookup-changed now print the existing "skipped, host imports are unavailable", so a runner without host imports records a device skip (56ddbbbd0).

I meant to rebase onto main, but the branch already had main merged in (1cb64823e), so I added the commit on top of that merge instead of force-pushing over it. The branch merges cleanly with current main 286908f91.

On this head, agc_driver_resource_cache_replaced_texture and agc_driver_resource_cache_lookup_changed passed 3 of 3 each on lavapipe (llvmpipe) and on an RTX 5070 Ti (NVIDIA 595.91.07), both with ANYPS5_REQUIRE_VULKAN=1. Neither skipped. check_skips.py on the ctest junit and check_conventions.py --base origin/main both pass.

Thanks @wachi35676 for the Windows runs on NVIDIA and AMD, and for the negative control.

AI-assisted: yes

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6294190305 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/8047#issuecomment-6294190305). Originally posted by [fisherjoey](https://github.com/fisherjoey) on 2026-10-20T15:12:27Z. --- Both skip messages in `resource-lookup-changed` now print the existing "skipped, host imports are unavailable", so a runner without host imports records a device skip (56ddbbbd0). I meant to rebase onto main, but the branch already had main merged in (1cb64823e), so I added the commit on top of that merge instead of force-pushing over it. The branch merges cleanly with current main 286908f91. On this head, `agc_driver_resource_cache_replaced_texture` and `agc_driver_resource_cache_lookup_changed` passed 3 of 3 each on lavapipe (llvmpipe) and on an RTX 5070 Ti (NVIDIA 595.91.07), both with `ANYPS5_REQUIRE_VULKAN=1`. Neither skipped. `check_skips.py` on the ctest junit and `check_conventions.py --base origin/main` both pass. Thanks @wachi35676 for the Windows runs on NVIDIA and AMD, and for the negative control. AI-assisted: yes
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!8047
No description provided.