fix(agc): keep a build's own texture lookup records past the log bound #6944

Merged
EagleBearerYS merged 3 commits from upstream-pr/6944 into main 2026-10-19 14:48:00 +00:00
EagleBearerYS commented 2026-10-16 20:45:38 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by EagleBearerYS on 2026-10-16T20:45:38Z.


What

The sampled-texture lookup log (logLookup, Graphics/src/ShaderResources.cpp) keeps at most 1,024 records and drops its oldest half when it's full. Its comment assumed one build's lookups were "a few dozen at most".

  • What breaks: a draw or dispatch that binds more than ~1,000 textures through an image table loses its own earliest records partway through its build.
  • The effect: captureValidation then finds no record for those textures. Every later Revalidate fails the fast proof with no record and walks every texture.

The fix:

  • A mark: buildComplete and Revalidate's full walk mark where their own records start, through a small RAII guard, BuildLookups.
  • The trim: the bound now drops only records older than that mark. Lookups outside a build keep the old rule.
  • A counter: the [rescache] revalidate profile line counts the builds and full walks that kept their records past the bound.

The title. Resident Evil Village (PPSA01556) binds about 2,000 textures per draw at its main menu.

  • The tree: this line comes from our fast Resident Evil Village test tree, a941c63a67. logLookup is byte-identical there, in main f474fb7768, and in our three-title base: main plus only what Resident Evil Village needs to reach the menu. So the bound is hit the same way on all three. The base's own line, and an unprofiled before/after pair at the menu (presents per 10 s and p50), will be added with the next Resident Evil Village run; none is scheduled yet.
  • Its profiled menu run ends with this line:
    [rescache] revalidate 360177 calls 114580.7 ms: fast 328568, full 31214, failed 395; time: fast 44893.7 ms, full 69596.9 ms, failed 90.1 ms; fast-fail by reason: no record 29583 pending image 5955 memory changed 1292 depth surface 3; ...
    
  • At the menu (the run's second half): 15,528 full walks, 97.7% of them no record, at 2.32 ms each against 0.078 ms for a fast proof.
  • What that costs: about 1.0 s of every 10 s of queue 0's time, all inside the GPU mutex. Driver::commitDraw holds it across VulkanDevice::Draw, so the other queues wait on it too.

Cost of the fix:

  • Memory: a record is 136 bytes, so a 2,000-texture build holds 272,000 bytes while it runs. Since be77a9d7bd (from CnRJay's review), when the outermost build ends the log keeps only its newest 1,024 records, as logLookup would, and gives back its capacity once that is over 1.5 times the bound. A thread therefore holds at most the bound's 139,264 bytes after an oversized build. The trigger is 1.5 times rather than twice the bound because libstdc++ doubles the vector, so every build of 1,025 to 2,048 records ends at a capacity of exactly 2,048 (twice the bound). A log within the bound never reaches 1.5 times it: at most 1,024 records with libstdc++ and libc++, and 1,066 with MSVC's growth by half.
  • Build time: a 2,000-texture build spends ~0.3 ms more than main in captureValidation, which searches the log backwards for each texture. On main, that build searched only the half of its records it still had. It then paid a ~4.3 ms full walk on every later use.
  • A follow-up: a one-pass capture would remove most of that 0.3 ms. It rewrites captureValidation, which this PR changes, so it opens as its own PR once this one lands.

How: one commit, fix(agc): keep a build's own texture lookup records past the log bound. It holds the fix and the new test agc_driver_lookup_log_fits_build (tests/execution/LookupLogFitsBuild.cpp).

  • The setup: the test compiles a compute program that indexes a texture heap dynamically, against 1,500 T#s. They're 8×8 RGBA8 surfaces in a write-watched guest block.
  • The build: it builds a ShaderResources for it, which must be reusable and bind 1,500 sampled textures.
  • Then it requires, in order:
    • the fast proof, with memory unchanged after the build;
    • the full walk, after a store of an unchanged byte into texture 500;
    • the fast proof again, which checks the full walk's own capture;
    • the full walk and a refused proof, after a real change to that byte, so the fast path stays exact.

Tested

  • Linux (lavapipe, Mesa 25.2.8, gcc 13.3, CI's Linux configure), on main f474fb7768:

    • Red with main's logLookup: 5/5 fail with
      AGC graphics: lookup log: a set over 1500 textures took the full walk with its memory unchanged after the build
      
    • Green: 20/20.
    • ctest -R '^agc' --parallel 4 --timeout 120: 627/627 with the fix, against 626/626 on main, with the same 44 skips.
    • tools/check_test_registration.py: 919 test executables, none new and unrecorded.
  • be77a9d7bd, the shrink (Linux, lavapipe, CI's configuration): after its 1,500-texture build, agc_driver_lookup_log_fits_build now requires the thread's log capacity to be at or under the bound, and again after the full walk. The four Revalidate checks are unchanged.

    • Red without the three lines that trim and shrink: "AGC graphics: lookup log: the thread's log kept a capacity of 2048 records after a build of 1500 textures, over the bound of 1024".
    • Green: "the thread's log capacity is 0 records after the build". It passes 20/20, and ^agc passes 626 of 627 (44 skipped) twice; the one failure both times is agc_driver_preparation_scope_settle, a timing check under the sweep's parallel load that passes 11/11 alone.
    • GitHub runners (run, with #6452's MinGW fix for an unrelated test applied for this check only): on Linux the test and agc_driver_graphics pass 10/10; on Windows agc_driver_graphics passes 10/10 and the lookup log test skips without a Vulkan device. The ^agc sweeps' only failures are the settle check on Linux and agc_driver_pm4_replay_tool (0xc0000139) on Windows, which fails on main there too, and the suites' are precise_wait on Linux and guest_kqueue on Windows.
  • GitHub runners (run 38961983024):

    • Linux: red with main's logLookup; green 20/20. The libc and libkernel suites show no new failures. precise_wait failed once on main's side there, a known flake on that runner.
    • Windows: it builds with MinGW, but the test skips on that runner, which has no Vulkan device. guest_kqueue fails there with and without the change.
  • Cost on a dispatch-binding harness (lavapipe; a plain compute program indexing a texture heap; µs per dispatch, median of 5 windows). The harness isn't part of this PR.

    textures memory main this PR
    16 unchanged 64.7 59.0
    128 unchanged 99.3 96.8
    2,000 unchanged 4,673.6 749.0
    2,000 one word changed 4,549.8 727.8
    • At 2,000 textures: main's run made 12,057 full walks, all no record. With the fix it made 63,230 fast proofs and no full walk.
    • The bound as a check: with only the bound raised to 8,192, main gives 779.4 µs, so the fix matches it.
    • Below the bound: at 16 and 128 textures the log never reaches it. The differences there are noise.
  • Draws take the same path (buildComplete, and Revalidate's full walk), so Resident Evil Village's draws are covered. The title hasn't been run with the fix yet; the before/after pair above comes with its next run.

  • AMD Radeon 780M (RDNA 3, AMD driver 25.10.20.01), Windows 11 (WinLibs GCC 15.2.0, Release), run by keravyn-ops at be77a9d7b (comment): agc_driver_lookup_log_fits_build passes.

  • tools/check_conventions.py: passed.

Overlap. On main 36c69d5cc6, the overlap check finds two open PRs that conflict with this one. 13 others that touch this file conflict with main themselves, so it couldn't compare them. Merged against this PR's head by hand:

  • #6820 and #6718 (Zenodeon) and #6202 (MiguelAdolfsen) all add refreshForView, and a layers parameter to the cachedStorageTexture declaration, right after logLookup. That's where this PR adds BuildLookups. Keeping both sides resolves it, and those three PRs meet at that same declaration themselves.
  • #6373 (AlxcBTW) conflicts with main in ShaderResources.cpp, far from this PR's lines, and with this PR only there.
  • The other 11 merge with this PR cleanly. None of these 15 PRs changes logLookup, the lookup log's bound or Revalidate.
  • #6636 (ours) reuses address-based draw builds. Every reused build revalidates through this same Revalidate, so the two compose.

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
  • 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
  • Related: #6636
  • Unblocks: none
  • GPUs tested: lavapipe (Mesa 25.2.8) on Linux; AMD Radeon 780M (RDNA 3, AMD driver 25.10.20.01), Windows 11: the new test passes (keravyn-ops); the Windows runner has no Vulkan device
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4894068316 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6944). Originally posted by [EagleBearerYS](https://github.com/EagleBearerYS) on 2026-10-16T20:45:38Z. --- ### What The sampled-texture lookup log (`logLookup`, `Graphics/src/ShaderResources.cpp`) keeps at most 1,024 records and drops its oldest half when it's full. Its comment assumed one build's lookups were "a few dozen at most". - **What breaks:** a draw or dispatch that binds more than ~1,000 textures through an image table loses its own earliest records partway through its build. - **The effect:** `captureValidation` then finds no record for those textures. Every later `Revalidate` fails the fast proof with `no record` and walks every texture. **The fix:** - **A mark:** `buildComplete` and `Revalidate`'s full walk mark where their own records start, through a small RAII guard, `BuildLookups`. - **The trim:** the bound now drops only records older than that mark. Lookups outside a build keep the old rule. - **A counter:** the `[rescache] revalidate` profile line counts the builds and full walks that kept their records past the bound. **The title.** Resident Evil Village (PPSA01556) binds about 2,000 textures per draw at its main menu. - **The tree:** this line comes from our fast Resident Evil Village test tree, a941c63a67. `logLookup` is byte-identical there, in main f474fb7768, and in our three-title base: main plus only what Resident Evil Village needs to reach the menu. So the bound is hit the same way on all three. The base's own line, and an unprofiled before/after pair at the menu (presents per 10 s and p50), will be added with the next Resident Evil Village run; none is scheduled yet. - **Its profiled menu run** ends with this line: ``` [rescache] revalidate 360177 calls 114580.7 ms: fast 328568, full 31214, failed 395; time: fast 44893.7 ms, full 69596.9 ms, failed 90.1 ms; fast-fail by reason: no record 29583 pending image 5955 memory changed 1292 depth surface 3; ... ``` - **At the menu** (the run's second half): 15,528 full walks, 97.7% of them `no record`, at 2.32 ms each against 0.078 ms for a fast proof. - **What that costs:** about 1.0 s of every 10 s of queue 0's time, all inside the GPU mutex. `Driver::commitDraw` holds it across `VulkanDevice::Draw`, so the other queues wait on it too. **Cost of the fix:** - **Memory:** a record is 136 bytes, so a 2,000-texture build holds 272,000 bytes while it runs. Since be77a9d7bd (from CnRJay's review), when the outermost build ends the log keeps only its newest 1,024 records, as `logLookup` would, and gives back its capacity once that is over 1.5 times the bound. A thread therefore holds at most the bound's 139,264 bytes after an oversized build. The trigger is 1.5 times rather than twice the bound because libstdc++ doubles the vector, so every build of 1,025 to 2,048 records ends at a capacity of exactly 2,048 (twice the bound). A log within the bound never reaches 1.5 times it: at most 1,024 records with libstdc++ and libc++, and 1,066 with MSVC's growth by half. - **Build time:** a 2,000-texture build spends ~0.3 ms more than main in `captureValidation`, which searches the log backwards for each texture. On main, that build searched only the half of its records it still had. It then paid a ~4.3 ms full walk on every later use. - **A follow-up:** a one-pass capture would remove most of that 0.3 ms. It rewrites `captureValidation`, which this PR changes, so it opens as its own PR once this one lands. **How:** one commit, `fix(agc): keep a build's own texture lookup records past the log bound`. It holds the fix and the new test `agc_driver_lookup_log_fits_build` (`tests/execution/LookupLogFitsBuild.cpp`). - **The setup:** the test compiles a compute program that indexes a texture heap dynamically, against 1,500 T#s. They're 8×8 RGBA8 surfaces in a write-watched guest block. - **The build:** it builds a `ShaderResources` for it, which must be reusable and bind 1,500 sampled textures. - **Then it requires, in order:** - the fast proof, with memory unchanged after the build; - the full walk, after a store of an unchanged byte into texture 500; - the fast proof again, which checks the full walk's own capture; - the full walk and a refused proof, after a real change to that byte, so the fast path stays exact. ### Tested - **Linux** (lavapipe, Mesa 25.2.8, gcc 13.3, CI's Linux configure), on main f474fb7768: - **Red** with main's `logLookup`: 5/5 fail with ``` AGC graphics: lookup log: a set over 1500 textures took the full walk with its memory unchanged after the build ``` - **Green:** 20/20. - `ctest -R '^agc' --parallel 4 --timeout 120`: 627/627 with the fix, against 626/626 on main, with the same 44 skips. - `tools/check_test_registration.py`: 919 test executables, none new and unrecorded. - **be77a9d7bd, the shrink** (Linux, lavapipe, CI's configuration): after its 1,500-texture build, `agc_driver_lookup_log_fits_build` now requires the thread's log capacity to be at or under the bound, and again after the full walk. The four `Revalidate` checks are unchanged. - **Red** without the three lines that trim and shrink: "AGC graphics: lookup log: the thread's log kept a capacity of 2048 records after a build of 1500 textures, over the bound of 1024". - **Green:** "the thread's log capacity is 0 records after the build". It passes 20/20, and `^agc` passes 626 of 627 (44 skipped) twice; the one failure both times is `agc_driver_preparation_scope_settle`, a timing check under the sweep's parallel load that passes 11/11 alone. - **GitHub runners** ([run](https://github.com/EagleBearerYS/AnyPS5/actions/runs/38980667542), with #6452's MinGW fix for an unrelated test applied for this check only): on Linux the test and `agc_driver_graphics` pass 10/10; on Windows `agc_driver_graphics` passes 10/10 and the lookup log test skips without a Vulkan device. The `^agc` sweeps' only failures are the settle check on Linux and `agc_driver_pm4_replay_tool` (0xc0000139) on Windows, which fails on `main` there too, and the suites' are `precise_wait` on Linux and `guest_kqueue` on Windows. - **GitHub runners** ([run 38961983024](https://github.com/EagleBearerYS/AnyPS5/actions/runs/38961983024)): - **Linux:** red with main's `logLookup`; green 20/20. The libc and libkernel suites show no new failures. `precise_wait` failed once on main's side there, a known flake on that runner. - **Windows:** it builds with MinGW, but the test skips on that runner, which has no Vulkan device. `guest_kqueue` fails there with and without the change. - **Cost on a dispatch-binding harness** (lavapipe; a plain compute program indexing a texture heap; µs per dispatch, median of 5 windows). The harness isn't part of this PR. | textures | memory | main | this PR | |---|---|---|---| | 16 | unchanged | 64.7 | 59.0 | | 128 | unchanged | 99.3 | 96.8 | | 2,000 | unchanged | 4,673.6 | **749.0** | | 2,000 | one word changed | 4,549.8 | **727.8** | - **At 2,000 textures:** main's run made 12,057 full walks, all `no record`. With the fix it made 63,230 fast proofs and no full walk. - **The bound as a check:** with only the bound raised to 8,192, main gives 779.4 µs, so the fix matches it. - **Below the bound:** at 16 and 128 textures the log never reaches it. The differences there are noise. - **Draws** take the same path (`buildComplete`, and `Revalidate`'s full walk), so Resident Evil Village's draws are covered. The title hasn't been run with the fix yet; the before/after pair above comes with its next run. - **AMD Radeon 780M (RDNA 3, AMD driver 25.10.20.01), Windows 11** (WinLibs GCC 15.2.0, Release), run by keravyn-ops at be77a9d7b ([comment](https://github.com/boykopovar/AnyPS5/pull/6944#issuecomment-6232562332)): `agc_driver_lookup_log_fits_build` passes. - `tools/check_conventions.py`: passed. **Overlap.** On main 36c69d5cc6, the overlap check finds two open PRs that conflict with this one. 13 others that touch this file conflict with main themselves, so it couldn't compare them. Merged against this PR's head by hand: - **#6820 and #6718 (Zenodeon) and #6202 (MiguelAdolfsen)** all add `refreshForView`, and a `layers` parameter to the `cachedStorageTexture` declaration, right after `logLookup`. That's where this PR adds `BuildLookups`. Keeping both sides resolves it, and those three PRs meet at that same declaration themselves. - **#6373** (AlxcBTW) conflicts with `main` in `ShaderResources.cpp`, far from this PR's lines, and with this PR only there. - The other 11 merge with this PR cleanly. None of these 15 PRs changes `logLookup`, the lookup log's bound or `Revalidate`. - **#6636** (ours) reuses address-based draw builds. Every reused build revalidates through this same `Revalidate`, so the two compose. ### 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) - [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] Related: #6636 - [x] Unblocks: none - [x] GPUs tested: lavapipe (Mesa 25.2.8) on Linux; AMD Radeon 780M (RDNA 3, AMD driver 25.10.20.01), Windows 11: the new test passes (keravyn-ops); the Windows runner has no Vulkan device - [x] AI-assisted: yes
github-actions[bot] commented 2026-10-16 20:53:35 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-16T20:53:35Z.


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

Pull request Conflicting files (lines on main) Same exports Same new files
PR 6718 core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp L434-435
PR 6820 core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp L434-435

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 6177 core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 6188 core/libs/prx/libSceAgcDriver/Graphics/include/ShaderResources.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 6192 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 6223 core/libs/prx/libSceAgcDriver/Graphics/include/ShaderResources.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 6292 core/libs/prx/libSceAgcDriver/Graphics/include/ShaderResources.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 6340 core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 6615 core/libs/prx/libSceAgcDriver/Graphics/include/ShaderResources.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 6661 core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 6937 core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 6946 core/libs/prx/libSceAgcDriver/Graphics/include/ShaderResources.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 6947 core/libs/prx/libSceAgcDriver/Graphics/include/ShaderResources.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 6970 core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 6972 core/libs/prx/libSceAgcDriver/Graphics/include/ShaderResources.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 7002 core/libs/prx/libSceAgcDriver/Graphics/include/ShaderResources.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 7484 core/libs/prx/libSceAgcDriver/Graphics/include/ShaderResources.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 7689 core/libs/prx/libSceAgcDriver/Graphics/include/ShaderResources.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 7800 core/libs/prx/libSceAgcDriver/Graphics/include/ShaderResources.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6224494000 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6944#issuecomment-6224494000). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-16T20:53:35Z. --- <!-- pr-overlap --> Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in **Depends on**. | Pull request | Conflicting files (lines on `main`) | Same exports | Same new files | |---|---|---|---| | [PR 6718](https://www.github.com/boykopovar/AnyPS5/pull/6718) | `core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp` [L434-435](https://github.com/boykopovar/AnyPS5/blob/bcdee66d109008334b07c0ff73a27e845708675f/core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp#L434-L435) | | | | [PR 6820](https://www.github.com/boykopovar/AnyPS5/pull/6820) | `core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp` [L434-435](https://github.com/boykopovar/AnyPS5/blob/bcdee66d109008334b07c0ff73a27e845708675f/core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp#L434-L435) | | | 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 6177](https://www.github.com/boykopovar/AnyPS5/pull/6177) | `core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp` | | [PR 6188](https://www.github.com/boykopovar/AnyPS5/pull/6188) | `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/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 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 6292](https://www.github.com/boykopovar/AnyPS5/pull/6292) | `core/libs/prx/libSceAgcDriver/Graphics/include/ShaderResources.hpp`<br>`core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp` | | [PR 6340](https://www.github.com/boykopovar/AnyPS5/pull/6340) | `core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp` | | [PR 6615](https://www.github.com/boykopovar/AnyPS5/pull/6615) | `core/libs/prx/libSceAgcDriver/Graphics/include/ShaderResources.hpp`<br>`core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp` | | [PR 6661](https://www.github.com/boykopovar/AnyPS5/pull/6661) | `core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp` | | [PR 6937](https://www.github.com/boykopovar/AnyPS5/pull/6937) | `core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp` | | [PR 6946](https://www.github.com/boykopovar/AnyPS5/pull/6946) | `core/libs/prx/libSceAgcDriver/Graphics/include/ShaderResources.hpp`<br>`core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp` | | [PR 6947](https://www.github.com/boykopovar/AnyPS5/pull/6947) | `core/libs/prx/libSceAgcDriver/Graphics/include/ShaderResources.hpp`<br>`core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp` | | [PR 6970](https://www.github.com/boykopovar/AnyPS5/pull/6970) | `core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp` | | [PR 6972](https://www.github.com/boykopovar/AnyPS5/pull/6972) | `core/libs/prx/libSceAgcDriver/Graphics/include/ShaderResources.hpp`<br>`core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp` | | [PR 7002](https://www.github.com/boykopovar/AnyPS5/pull/7002) | `core/libs/prx/libSceAgcDriver/Graphics/include/ShaderResources.hpp`<br>`core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp` | | [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` | | [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/Graphics/include/ShaderResources.hpp`<br>`core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp` |
CnRJay commented 2026-10-16 22:07:32 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by CnRJay on 2026-10-16T22:07:32Z.

Review: COMMENTED


Good PR: the cause is shown with the title's own profile line (15,528 full walks at the menu, 97.7% of them no record, 2.32 ms each against 0.078 ms for a fast proof, about 1.0 s of every 10 s under the GPU mutex), the test fails on main 5/5 and passes 20/20, and the cost of the fix is stated.

Remaining points are small:

  • The thread-local log keeps the capacity of the largest build (272,000 bytes for 2,000 textures) on every thread that ever built one. Shrink it after a build that exceeded the old bound, so a loading thread doesn't hold it for the life of the process.
  • captureValidation now searches back through the whole build's records for every texture, so cost per build is quadratic in the texture count (the +0.3 ms at 2,000). The description defers the one-pass capture to a follow-up; that follow-up is worth opening now, since a title with a bigger table than Village's pays more than 0.3 ms.
  • The title evidence is the profile line of the Village tree and an estimate of the saving. A before/after summary pair at the menu (presents per 10 s and p50, no APS5_PROFILE_*, since the profile switch adds its own cost to the full walk) would turn "about 1.0 s of 10 s" into a measured gain. The description says the base's own line follows; please add it.
<!-- greyfinch-sync:boykopovar/AnyPS5:review:5554223875 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6944#pullrequestreview-5554223875). Originally posted by [CnRJay](https://github.com/CnRJay) on 2026-10-16T22:07:32Z. **Review:** COMMENTED --- Good PR: the cause is shown with the title's own profile line (15,528 full walks at the menu, 97.7% of them `no record`, 2.32 ms each against 0.078 ms for a fast proof, about 1.0 s of every 10 s under the GPU mutex), the test fails on `main` 5/5 and passes 20/20, and the cost of the fix is stated. Remaining points are small: - The thread-local log keeps the capacity of the largest build (272,000 bytes for 2,000 textures) on every thread that ever built one. Shrink it after a build that exceeded the old bound, so a loading thread doesn't hold it for the life of the process. - `captureValidation` now searches back through the whole build's records for every texture, so cost per build is quadratic in the texture count (the +0.3 ms at 2,000). The description defers the one-pass capture to a follow-up; that follow-up is worth opening now, since a title with a bigger table than Village's pays more than 0.3 ms. - The title evidence is the profile line of the Village tree and an estimate of the saving. A before/after summary pair at the menu (presents per 10 s and p50, no `APS5_PROFILE_*`, since the profile switch adds its own cost to the full walk) would turn "about 1.0 s of 10 s" into a measured gain. The description says the base's own line follows; please add it.
EagleBearerYS commented 2026-10-17 00:41:59 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by EagleBearerYS on 2026-10-17T00:41:59Z.


@CnRJay Thanks for the review.

  • Capacity: be77a9d7bd trims the log when the outermost build ends. It keeps the newest 1,024 records, as logLookup would, and gives back the capacity once that is over 1.5 times the bound, so a thread keeps at most 139,264 bytes after an oversized build. The trigger is 1.5 times the bound because libstdc++ doubles the vector: every build of 1,025 to 2,048 records ends at exactly twice the bound, so a "more than twice" rule would never fire for your 2,000-texture example. The test now checks the capacity after its 1,500-texture build: 2,048 records without the shrink, 0 with it.
  • The one-pass capture: it's the next change to this function. It rewrites captureValidation again, so I'll open it as its own PR once this one lands.
  • The pair: agreed that the profile switch adds its own cost to the full walk. The unprofiled before/after pair at the menu (presents per 10 s and p50), and the base's own line, will come with the next Resident Evil Village (PPSA01556) run. That run isn't scheduled yet, so I've changed the description to say so rather than "follows".
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6227477703 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6944#issuecomment-6227477703). Originally posted by [EagleBearerYS](https://github.com/EagleBearerYS) on 2026-10-17T00:41:59Z. --- @CnRJay Thanks for the review. - **Capacity:** be77a9d7bd trims the log when the outermost build ends. It keeps the newest 1,024 records, as `logLookup` would, and gives back the capacity once that is over 1.5 times the bound, so a thread keeps at most 139,264 bytes after an oversized build. The trigger is 1.5 times the bound because libstdc++ doubles the vector: every build of 1,025 to 2,048 records ends at exactly twice the bound, so a "more than twice" rule would never fire for your 2,000-texture example. The test now checks the capacity after its 1,500-texture build: 2,048 records without the shrink, 0 with it. - **The one-pass capture:** it's the next change to this function. It rewrites `captureValidation` again, so I'll open it as its own PR once this one lands. - **The pair:** agreed that the profile switch adds its own cost to the full walk. The unprofiled before/after pair at the menu (presents per 10 s and p50), and the base's own line, will come with the next Resident Evil Village (PPSA01556) run. That run isn't scheduled yet, so I've changed the description to say so rather than "follows".
keravyn-ops commented 2026-10-17 09:59:29 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by keravyn-ops on 2026-10-17T09:59:29Z.


AMD / Windows run of this PR at be77a9d7b: Radeon 780M (RDNA 3, 0x15bf), AMD driver 25.10.20.01 (32.0.21020.1007), Windows 11 Home 10.0.26100, WinLibs GCC 15.2.0 r7, Release.

Every ctest entry built from the test targets this PR changes passes (1):

  • agc_driver_lookup_log_fits_build (2.37 s): 537: lookup log fits build tests passed

AI-assisted: yes (runs made on the device above).

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6232562332 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6944#issuecomment-6232562332). Originally posted by [keravyn-ops](https://github.com/keravyn-ops) on 2026-10-17T09:59:29Z. --- AMD / Windows run of this PR at be77a9d7b: Radeon 780M (RDNA 3, 0x15bf), AMD driver 25.10.20.01 (32.0.21020.1007), Windows 11 Home 10.0.26100, WinLibs GCC 15.2.0 r7, Release. Every ctest entry built from the test targets this PR changes passes (1): - `agc_driver_lookup_log_fits_build` (2.37 s): `537: lookup log fits build tests passed` AI-assisted: yes (runs made on the device above).
adriadam10 commented 2026-10-19 14:49:04 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-19T14:49:04Z.


Checked the BuildLookups guard (nesting via outermost, the trim never drops past the build's mark, capacity released after an oversized build), the new test (registered through the tests/execution glob; it pins fast / full / fast / full-and-refused over 1,500 textures) and the author's red/green runs plus the Windows/AMD run from keravyn-ops; merged.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6270076750 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6944#issuecomment-6270076750). Originally posted by [adriadam10](https://github.com/adriadam10) on 2026-10-19T14:49:04Z. --- Checked the `BuildLookups` guard (nesting via `outermost`, the trim never drops past the build's mark, capacity released after an oversized build), the new test (registered through the `tests/execution` glob; it pins fast / full / fast / full-and-refused over 1,500 textures) and the author's red/green runs plus the Windows/AMD run from keravyn-ops; merged.
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!6944
No description provided.