perf(agc): reuse eligible image table entries independently #6340

Open
MarcZX10 wants to merge 11 commits from upstream-pr/6340 into main
MarcZX10 commented 2026-10-15 12:19:33 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-15T12:19:33Z.


What

Reuse eligible image-table entries independently under the existing collect-epoch and invalidation rules. Today one DCC-backed or otherwise ineligible entry prevents the cache from remembering every clean entry in that table. #6099 reports about 100,000 elements resolved per 10 seconds and no table reuse in its measured Wolverine scene.

This stores eligibility and a guest-memory generation proof per element. Repeated tables reuse an entry only while its texture-cache key and object still match; entries with pending writes or cache misses resolve normally. A pending-write serial change during validation causes a full lookup retry. Rejected entries are re-resolved instead of replaying cached rejection results.

The execution test adds mixed clean/DCC entries and a pending GPU write to one image in a separate guest-memory tracking block, checking that unaffected siblings remain reusable. No speedup is claimed until the reporter's same-scene before/after counters are available.

Tested

  • Linux x86_64, GCC 12: both changed C++ translation units compile. The test executable linked on the previous upstream snapshot; its full build needed a temporary template disambiguator for an unrelated baseline expression, which was reverted before commit. After rebasing on current main, both changed translation units compile directly.
  • python3 tools/check_conventions.py --base upstream/main --head HEAD and git diff --check pass.
  • Runtime execution stopped at AnyPS5's host CPU guard: Intel Xeon E5-1620 v2 lacks LZCNT, BMI1/BMI2, MOVBE, AVX2 and FMA. No GPU test or same-scene performance comparison ran here.
  • Requested the reporter to capture the same counters on main and this branch.

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
  • Unblocks: none
  • GPUs tested: none; host CPU guard stopped the test before Vulkan setup
  • AI-assisted: yes

Related: #5961 and #6099.

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4873126444 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6340). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-15T12:19:33Z. --- ### What Reuse eligible image-table entries independently under the existing collect-epoch and invalidation rules. Today one DCC-backed or otherwise ineligible entry prevents the cache from remembering every clean entry in that table. #6099 reports about 100,000 elements resolved per 10 seconds and no table reuse in its measured Wolverine scene. This stores eligibility and a guest-memory generation proof per element. Repeated tables reuse an entry only while its texture-cache key and object still match; entries with pending writes or cache misses resolve normally. A pending-write serial change during validation causes a full lookup retry. Rejected entries are re-resolved instead of replaying cached rejection results. The execution test adds mixed clean/DCC entries and a pending GPU write to one image in a separate guest-memory tracking block, checking that unaffected siblings remain reusable. No speedup is claimed until the reporter's same-scene before/after counters are available. ### Tested - Linux x86_64, GCC 12: both changed C++ translation units compile. The test executable linked on the previous upstream snapshot; its full build needed a temporary `template` disambiguator for an unrelated baseline expression, which was reverted before commit. After rebasing on current `main`, both changed translation units compile directly. - `python3 tools/check_conventions.py --base upstream/main --head HEAD` and `git diff --check` pass. - Runtime execution stopped at AnyPS5's host CPU guard: Intel Xeon E5-1620 v2 lacks LZCNT, BMI1/BMI2, MOVBE, AVX2 and FMA. No GPU test or same-scene performance comparison ran here. - Requested the reporter to capture the same counters on `main` and this branch. ### 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`); silent stubs are listed under Silent stubs in their library's technical 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] Unblocks: none - [x] GPUs tested: none; host CPU guard stopped the test before Vulkan setup - [x] AI-assisted: yes Related: #5961 and #6099.
MarcZX10 commented 2026-10-15 12:20:56 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-15T12:20:56Z.


@Thunderhawkk Could you compare the same Wolverine scene on main and this branch and share the image-table resolved/reused counts plus [resources] timings? The PR is marked draft while I wait for the before/after performance data required for this change.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6191909339 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6340#issuecomment-6191909339). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-15T12:20:56Z. --- @Thunderhawkk Could you compare the same Wolverine scene on `main` and this branch and share the image-table resolved/reused counts plus `[resources]` timings? The PR is marked draft while I wait for the before/after performance data required for this change.
fdfawef324 commented 2026-10-15 13:46:46 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by fdfawef324 on 2026-10-15T13:46:46Z.


The new mixed-DCC case captures before before both dispatches, but its Expect(before, 1, 1, ...) appears inconsistent with the new counter semantics.

On the intended path, the first build resolves the table (0 reused / 1 resolved). The second build reuses its clean siblings and still resolves the DCC entry, which is excluded by the resource.dccAddress == 0 eligibility condition (1 reused / 1 resolved). The combined delta is therefore 1 reused / 2 resolved. A successful fast revalidation bypasses both counter increments, so that path would not produce the expected 1 / 1 either.

Please check the resolved-count expectation and both texel readbacks in the native test. This is a source review of ef724aad62280d62ec5ca297803da1155051819f; I have not executed the GPU case.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6193609132 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6340#issuecomment-6193609132). Originally posted by [fdfawef324](https://github.com/fdfawef324) on 2026-10-15T13:46:46Z. --- The new mixed-DCC case captures `before` before both dispatches, but its `Expect(before, 1, 1, ...)` appears inconsistent with the new counter semantics. On the intended path, the first build resolves the table (0 reused / 1 resolved). The second build reuses its clean siblings and still resolves the DCC entry, which is excluded by the `resource.dccAddress == 0` eligibility condition (1 reused / 1 resolved). The combined delta is therefore 1 reused / 2 resolved. A successful fast revalidation bypasses both counter increments, so that path would not produce the expected 1 / 1 either. Please check the resolved-count expectation and both texel readbacks in the native test. This is a source review of `ef724aad62280d62ec5ca297803da1155051819f`; I have not executed the GPU case.
Neithennn commented 2026-10-15 15:14:58 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Neithennn on 2026-10-15T15:14:58Z.


Windows NVIDIA run, since the host CPU guard stopped the test on your machine: agc_driver_image_table_reuse fails with this PR, at an existing case, before the new mixed-DCC case is reached.

Windows 11 Pro 26200, NVIDIA GeForce RTX 4080 (driver 617.42), AMD Ryzen 7 5800X, WinLibs GCC 15.2.0 r7, Ninja, Release, bundled dependencies, BUILD_TESTING=ON, ANYPS5_NO_SHADER_CACHE=1. Head ef724aad6 merged onto main ff23657f3; full build succeeds.

AGC graphics: image table reuse: a CPU write collected in a new epoch, then two dispatches: 2 reused and 2 resolved tables, expected 1 and 2
  • agc_driver_image_table_reuse: fails 8/8 with this PR (targeted, broad and 6 serial reruns); passed in both baseline runs on unchanged main ff23657f3 on the same machine.
  • The failing check is the existing Expect(before, 3 - CpuWriteResolutions, CpuWriteResolutions, ...) ("a CPU write collected in a new epoch, then two dispatches"). On Windows CpuWriteResolutions is 2, so it expects 1 reused / 2 resolved; this branch counts 2 reused / 2 resolved, one reused table more than expected. Linux uses CpuWriteResolutions = 1; I have not run Linux, so I do not know whether it fails there.
  • Because the test stops there, the new mixed-DCC case, and the Expect(before, 1, 1, ...) questioned above, did not run here.
  • Other targeted tests pass: agc_driver_image_table, agc_driver_image_table_cache, agc_driver_image_table_cache_bounds, agc_driver_bindless_images, agc_shader_bindless.
  • ctest -R "agc_|shader|recompiler|spirv|video_out" -j 8: 621/623; the other failure is agc_driver_store_over_untracked (#6347/#6383), also on main.

No performance measurement.

AI-assisted: yes (runs done with Claude Code).

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6195497298 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6340#issuecomment-6195497298). Originally posted by [Neithennn](https://github.com/Neithennn) on 2026-10-15T15:14:58Z. --- Windows NVIDIA run, since the host CPU guard stopped the test on your machine: `agc_driver_image_table_reuse` fails with this PR, at an existing case, before the new mixed-DCC case is reached. Windows 11 Pro 26200, NVIDIA GeForce RTX 4080 (driver 617.42), AMD Ryzen 7 5800X, WinLibs GCC 15.2.0 r7, Ninja, Release, bundled dependencies, `BUILD_TESTING=ON`, `ANYPS5_NO_SHADER_CACHE=1`. Head `ef724aad6` merged onto main `ff23657f3`; full build succeeds. ```text AGC graphics: image table reuse: a CPU write collected in a new epoch, then two dispatches: 2 reused and 2 resolved tables, expected 1 and 2 ``` - `agc_driver_image_table_reuse`: fails 8/8 with this PR (targeted, broad and 6 serial reruns); passed in both baseline runs on unchanged main `ff23657f3` on the same machine. - The failing check is the existing `Expect(before, 3 - CpuWriteResolutions, CpuWriteResolutions, ...)` ("a CPU write collected in a new epoch, then two dispatches"). On Windows `CpuWriteResolutions` is 2, so it expects 1 reused / 2 resolved; this branch counts 2 reused / 2 resolved, one reused table more than expected. Linux uses `CpuWriteResolutions = 1`; I have not run Linux, so I do not know whether it fails there. - Because the test stops there, the new mixed-DCC case, and the `Expect(before, 1, 1, ...)` questioned above, did not run here. - Other targeted tests pass: `agc_driver_image_table`, `agc_driver_image_table_cache`, `agc_driver_image_table_cache_bounds`, `agc_driver_bindless_images`, `agc_shader_bindless`. - `ctest -R "agc_|shader|recompiler|spirv|video_out" -j 8`: 621/623; the other failure is `agc_driver_store_over_untracked` (#6347/#6383), also on main. No performance measurement. AI-assisted: yes (runs done with Claude Code).
Thunderhawkk commented 2026-10-15 15:21:50 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Thunderhawkk on 2026-10-15T15:21:50Z.


@MarcZX100 Thanks — ran the Wolverine (PPSA03671) comparison on this machine: same scene/save, RTX 5070 Ti (16 GiB), 24 GB RAM, driver 617.42, 5-minute runs, warm shader cache, APS5_PROFILE_DRAW=1.

One caveat first: on plain main and on this branch the scene does not reach steady gameplay here — both die with a device OOM during the load phase (vkAllocateMemory ... Vulkan result -2, ~52k storage images created before dying, 3–4 minutes in). That is the #5961 memory problem, not your change. So the numbers below are from a matched pair: main + #6174 + #6194 vs the same tree + your commit, run back to back with identical settings. Both still die the same way at ~4 minutes, but they reach the same point, so the deltas are attributable.

metric base (main + #6174 + #6194) + ef724aad6
image tables reused / resolved (cumulative, end of run) 0 / 93 63 / 94
storage images hits / created 50,492 / 52,675 50,495 / 52,182
[resources] at 931 builds: images / stage B 91,755 ms / 96,021 ms 84,949 ms / 88,776 ms
[resources] at 1,007 builds: images / stage B 151,452 ms / 156,542 ms 133,050 ms / 137,596 ms
run end device OOM at ~4:01 device OOM at ~3:50

Your change clearly engages: on the base the all-or-nothing reuse path never fires (0 reused), while with your commit 63 of 94 resolved tables (~2/3) reuse elements, and the resource-build totals at matched build counts come out 7–12% lower (single runs each — indicative).

Two notes on reading these counters:

  • they count tables with at least one reused/resolved element, so they show engagement but not the element-level work saved;
  • an element-level counter (reused vs rejected per reason) would quantify the win — that is also what I am capturing for the #5961 question.

If you want gameplay-phase numbers: on this machine main-derived builds die in the load phase, so it needs the memory-side work to survive past it — happy to rerun on a base that includes it.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6195648890 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6340#issuecomment-6195648890). Originally posted by [Thunderhawkk](https://github.com/Thunderhawkk) on 2026-10-15T15:21:50Z. --- @MarcZX100 Thanks — ran the Wolverine (PPSA03671) comparison on this machine: same scene/save, RTX 5070 Ti (16 GiB), 24 GB RAM, driver 617.42, 5-minute runs, warm shader cache, `APS5_PROFILE_DRAW=1`. One caveat first: on plain `main` and on this branch the scene does not reach steady gameplay here — both die with a device OOM during the load phase (`vkAllocateMemory ... Vulkan result -2`, ~52k storage images created before dying, 3–4 minutes in). That is the #5961 memory problem, not your change. So the numbers below are from a matched pair: `main + #6174 + #6194` vs the same tree + your commit, run back to back with identical settings. Both still die the same way at ~4 minutes, but they reach the same point, so the deltas are attributable. | metric | base (main + #6174 + #6194) | + ef724aad6 | |---|---|---| | image tables reused / resolved (cumulative, end of run) | 0 / 93 | 63 / 94 | | storage images hits / created | 50,492 / 52,675 | 50,495 / 52,182 | | [resources] at 931 builds: images / stage B | 91,755 ms / 96,021 ms | 84,949 ms / 88,776 ms | | [resources] at 1,007 builds: images / stage B | 151,452 ms / 156,542 ms | 133,050 ms / 137,596 ms | | run end | device OOM at ~4:01 | device OOM at ~3:50 | Your change clearly engages: on the base the all-or-nothing reuse path never fires (0 reused), while with your commit 63 of 94 resolved tables (~2/3) reuse elements, and the resource-build totals at matched build counts come out 7–12% lower (single runs each — indicative). Two notes on reading these counters: - they count *tables* with at least one reused/resolved element, so they show engagement but not the element-level work saved; - an element-level counter (reused vs rejected per reason) would quantify the win — that is also what I am capturing for the #5961 question. If you want gameplay-phase numbers: on this machine main-derived builds die in the load phase, so it needs the memory-side work to survive past it — happy to rerun on a base that includes it.
simonbronk commented 2026-10-15 15:23:57 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by simonbronk on 2026-10-15T15:23:57Z.


Onimusha: Way of the Sword (PPSA27836) data, Windows 11 26200, RTX 5070 (NVIDIA 617.42), WinLibs GCC 15.2, Release. Base: main 0afa6a607 plus the title's open PRs (#5907 #5776 #5770 #5703 #5841 #5884 #5915 #5815). ef724aad6 cherry-picked cleanly on top. Scene: boot to the language menu, 150 s, APS5_PROFILE_DRAW=1, warm shader cache.

base + ef724aad6
image tables reused / resolved (cumulative, [textures]) 0 / 1833 0 / 2250
[resources] images phase 16.9 s over 13000 builds 18.5 s over 16000 builds

The change reuses nothing in this title. I added local counters (not for merging) at the eligibility test in resolveImageTables to see why:

  • elements that reached the test: 20000. Of these, 19999 had looked->generation == 0 and 8276 had looked->source != nullptr. None had compressed keys or a dccAddress. Reusable: 0.
  • tables at the store check: 1800. None had a reusable element, so RememberTable never ran. epoch was never 0, and CurrentTableState() != state happened only 23 times.

So in this title the generation proof is missing, not the DCC rule. The sampled images live in memory that the generation tracker does not cover. The same run's [textures] line reports untracked snapshots 16310 kept by the write-watch hint. Per-entry reuse would need a proof that works over untracked memory, for example the write-watch hint that the snapshots already use. That is likely a separate change from this one.

AI-assisted: measured with Claude Code. The counters were a local diff, removed after the runs.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6195692098 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6340#issuecomment-6195692098). Originally posted by [simonbronk](https://github.com/simonbronk) on 2026-10-15T15:23:57Z. --- Onimusha: Way of the Sword (PPSA27836) data, Windows 11 26200, RTX 5070 (NVIDIA 617.42), WinLibs GCC 15.2, Release. Base: `main` 0afa6a607 plus the title's open PRs (#5907 #5776 #5770 #5703 #5841 #5884 #5915 #5815). `ef724aad6` cherry-picked cleanly on top. Scene: boot to the language menu, 150 s, `APS5_PROFILE_DRAW=1`, warm shader cache. | | base | + ef724aad6 | |---|---|---| | image tables reused / resolved (cumulative, `[textures]`) | 0 / 1833 | 0 / 2250 | | `[resources]` images phase | 16.9 s over 13000 builds | 18.5 s over 16000 builds | The change reuses nothing in this title. I added local counters (not for merging) at the eligibility test in `resolveImageTables` to see why: - elements that reached the test: 20000. Of these, 19999 had `looked->generation == 0` and 8276 had `looked->source != nullptr`. None had compressed keys or a `dccAddress`. **Reusable: 0.** - tables at the store check: 1800. None had a reusable element, so `RememberTable` never ran. `epoch` was never 0, and `CurrentTableState() != state` happened only 23 times. So in this title the generation proof is missing, not the DCC rule. The sampled images live in memory that the generation tracker does not cover. The same run's `[textures]` line reports `untracked snapshots 16310 kept by the write-watch hint`. Per-entry reuse would need a proof that works over untracked memory, for example the write-watch hint that the snapshots already use. That is likely a separate change from this one. AI-assisted: measured with Claude Code. The counters were a local diff, removed after the runs.
mrfelek commented 2026-10-15 16:13:30 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by mrfelek on 2026-10-15T16:13:30Z.


Wolverine (PPSA03671): image-table counters on this PR, from the splash phase

System: Linux, RTX 3080 Ti 12 GB (NVIDIA 615.71.09)
Builds: main plus #5998 (base), and the same plus this PR at head ef724aad6. Both built from origin/main with the same libraries and the same relinked executable.
Setup: APS5_PROFILE_DRAW=1 APS5_PROFILE_GPU=1, no input, 150 s after start. Both runs reached the Sony splash.

Build Image tables reused / resolved (cumulative) Last [resources] images phase
base 0 / 190 652 ms (2,512 textures, 13 buffers)
+ ef724aad6 137 / 206 574 ms (2,513 textures, 20 buffers)
  • This is the first title in our tests where the reuse path runs: 137 entries are reused on this PR, and none on base.
  • The [resources] values are single samples from the last log line, so they don't show a performance difference. Both runs were still on the splash.
  • Frame rate was not measured. Both ran at about 0.27 FPS on the splash, so there's no in-game number.
  • The counts are consistent with the Wolverine reuse counts in Thunderhawkk's comment (63 reused, on a different machine).
  • Not tested: a menu or gameplay scene, and Windows.

AI-assisted; the runs are from my machine.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6196713280 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6340#issuecomment-6196713280). Originally posted by [mrfelek](https://github.com/mrfelek) on 2026-10-15T16:13:30Z. --- ## Wolverine (PPSA03671): image-table counters on this PR, from the splash phase **System:** Linux, RTX 3080 Ti 12 GB (NVIDIA 615.71.09) **Builds:** `main` plus #5998 (base), and the same plus this PR at head `ef724aad6`. Both built from `origin/main` with the same libraries and the same relinked executable. **Setup:** `APS5_PROFILE_DRAW=1 APS5_PROFILE_GPU=1`, no input, 150 s after start. Both runs reached the Sony splash. | Build | Image tables reused / resolved (cumulative) | Last `[resources]` images phase | |---|---|---| | base | 0 / 190 | 652 ms (2,512 textures, 13 buffers) | | + `ef724aad6` | 137 / 206 | 574 ms (2,513 textures, 20 buffers) | - This is the first title in our tests where the reuse path runs: 137 entries are reused on this PR, and none on base. - The `[resources]` values are single samples from the last log line, so they don't show a performance difference. Both runs were still on the splash. - Frame rate was not measured. Both ran at about 0.27 FPS on the splash, so there's no in-game number. - The counts are consistent with the Wolverine reuse counts in Thunderhawkk's comment (63 reused, on a different machine). - Not tested: a menu or gameplay scene, and Windows. AI-assisted; the runs are from my machine.
mrfelek commented 2026-10-15 16:31:27 +00:00 (Migrated from github.com)

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


Wolverine (PPSA03671): why most image-table elements are not reused on this PR

System: Linux, RTX 3080 Ti 12 GB (NVIDIA 615.71.09)
Build: main plus #5998 plus this PR at head ef724aad6, with local diagnostic counters in the reuse check (not for merging)
Scene: same as the earlier counters comment: Wolverine, APS5_PROFILE_DRAW=1 APS5_PROFILE_GPU=1, no input, 150 s, Sony splash

Where the elements go

The counters record, for each element that reaches the reuse check, the first condition it fails, in the order of the remembered.reusable expression. The totals are per element over the run, not per table.

Reason Elements
The lookup entry is a storage-image view (source != nullptr) 292,315
Surface not tracked yet (generation == 0) 1,624
No CPU-write epoch yet (epoch == 0) 0
No lookup entry 0
Lookup is a different texture 0
Compressed keys 0
DCC address present 0
Reusable 24,061
  • The storage-image case accounts for almost every failure. About 276,000 sampled textures in this run are created from storage images, so the reuse check excludes most of what this title samples.
  • The other checks almost never fail here.

The table-level counter (137 reused, 206 resolved) and these per-element totals count different things, so they don't add up to each other.

Question for the author

Should the reuse check cover storage-image views, or is excluding them intended? If it's intended, most of this title's image-table elements will not be reused by this PR.

Not tested: a menu or gameplay scene, Windows.

AI-assisted; the runs are from my machine.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6197076107 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6340#issuecomment-6197076107). Originally posted by [mrfelek](https://github.com/mrfelek) on 2026-10-15T16:31:27Z. --- ## Wolverine (PPSA03671): why most image-table elements are not reused on this PR **System:** Linux, RTX 3080 Ti 12 GB (NVIDIA 615.71.09) **Build:** `main` plus #5998 plus this PR at head `ef724aad6`, with local diagnostic counters in the reuse check (not for merging) **Scene:** same as the earlier counters comment: Wolverine, `APS5_PROFILE_DRAW=1 APS5_PROFILE_GPU=1`, no input, 150 s, Sony splash ### Where the elements go The counters record, for each element that reaches the reuse check, the first condition it fails, in the order of the `remembered.reusable` expression. The totals are per element over the run, not per table. | Reason | Elements | |---|---| | The lookup entry is a storage-image view (`source != nullptr`) | 292,315 | | Surface not tracked yet (`generation == 0`) | 1,624 | | No CPU-write epoch yet (`epoch == 0`) | 0 | | No lookup entry | 0 | | Lookup is a different texture | 0 | | Compressed keys | 0 | | DCC address present | 0 | | **Reusable** | **24,061** | - The storage-image case accounts for almost every failure. About 276,000 sampled textures in this run are created from storage images, so the reuse check excludes most of what this title samples. - The other checks almost never fail here. The table-level counter (137 reused, 206 resolved) and these per-element totals count different things, so they don't add up to each other. ### Question for the author Should the reuse check cover storage-image views, or is excluding them intended? If it's intended, most of this title's image-table elements will not be reused by this PR. Not tested: a menu or gameplay scene, Windows. AI-assisted; the runs are from my machine.
mrfelek commented 2026-10-15 16:59:16 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by mrfelek on 2026-10-15T16:59:16Z.


agc_driver_image_table_reuse on Linux: fails with this PR at head ef724aad6

System: Linux, Ryzen 9 5950X, RTX 3080 Ti (NVIDIA 615.71.09), GCC 15, Release
Build: origin/main at b576c3d5a (current main with this PR's head merged on top, no other changes), ANYPS5_ENABLE_SPIRV_TOOLS=OFF, target tests/agc_driver_image_table_reuse_tests

Result

The test exits with code 1. The failing check is:

AGC graphics: image table reuse: CPU writes to a new table's 64 KiB block, then an image store leaving results pending over an entry: 3 reused and 2 resolved tables, expected 2 and 2

So this case reuses one more table than the test expects.

Relation to the Windows report above

Neithennn's Windows failure (CPU write collected in a new epoch, then two dispatches: 2 reused and 2 resolved tables, expected 1 and 2) is a different case in the same file. On Linux, this is the second failing case I've seen, so the two may share a cause in how reuse is counted.

I haven't checked whether this case passes without the PR, because the test doesn't exist on main.

AI-assisted; the runs are from my machine.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6197626166 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6340#issuecomment-6197626166). Originally posted by [mrfelek](https://github.com/mrfelek) on 2026-10-15T16:59:16Z. --- ## `agc_driver_image_table_reuse` on Linux: fails with this PR at head `ef724aad6` **System:** Linux, Ryzen 9 5950X, RTX 3080 Ti (NVIDIA 615.71.09), GCC 15, Release **Build:** `origin/main` at `b576c3d5a` (current main with this PR's head merged on top, no other changes), `ANYPS5_ENABLE_SPIRV_TOOLS=OFF`, target `tests/agc_driver_image_table_reuse_tests` ### Result The test exits with code 1. The failing check is: ``` AGC graphics: image table reuse: CPU writes to a new table's 64 KiB block, then an image store leaving results pending over an entry: 3 reused and 2 resolved tables, expected 2 and 2 ``` So this case reuses one more table than the test expects. ### Relation to the Windows report above Neithennn's Windows failure (`CPU write collected in a new epoch, then two dispatches: 2 reused and 2 resolved tables, expected 1 and 2`) is a different case in the same file. On Linux, this is the second failing case I've seen, so the two may share a cause in how reuse is counted. I haven't checked whether this case passes without the PR, because the test doesn't exist on `main`. AI-assisted; the runs are from my machine.
mrfelek commented 2026-10-15 17:01:54 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by mrfelek on 2026-10-15T17:01:54Z.


agc_driver_image_table_reuse on Linux: the Windows check passes here

System: Linux, Ryzen 9 5950X, RTX 3080 Ti (NVIDIA 615.71.09), GCC 15, Release
Build: origin/main at b576c3d5a plus this PR's head ef724aad6, no other changes.

The check reported from Windows

The case a CPU write collected in a new epoch, then two dispatches (line 338 of ImageTableReuse.cpp) runs before the case that fails on Linux, which is at line 370. On this build the test gets past line 338 and reaches the later case, so the Windows check passes here.

What this means

  • The Windows failure does not reproduce on Linux with this head.
  • The Linux failure in my earlier comment is a different case, in RunImageStore, which runs later in the same test.

So the two reports may not be the same bug. The Windows failure may depend on the platform, the build, or the test ordering.

AI-assisted; the runs are from my machine.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6197680300 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6340#issuecomment-6197680300). Originally posted by [mrfelek](https://github.com/mrfelek) on 2026-10-15T17:01:54Z. --- ## `agc_driver_image_table_reuse` on Linux: the Windows check passes here **System:** Linux, Ryzen 9 5950X, RTX 3080 Ti (NVIDIA 615.71.09), GCC 15, Release **Build:** `origin/main` at `b576c3d5a` plus this PR's head `ef724aad6`, no other changes. ### The check reported from Windows The case `a CPU write collected in a new epoch, then two dispatches` (line 338 of `ImageTableReuse.cpp`) runs before the case that fails on Linux, which is at line 370. On this build the test gets past line 338 and reaches the later case, so the Windows check passes here. ### What this means - The Windows failure does not reproduce on Linux with this head. - The Linux failure in my earlier comment is a different case, in `RunImageStore`, which runs later in the same test. So the two reports may not be the same bug. The Windows failure may depend on the platform, the build, or the test ordering. AI-assisted; the runs are from my machine.
mrfelek commented 2026-10-15 20:42:34 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by mrfelek on 2026-10-15T20:42:34Z.


agc_driver_image_table_reuse on Linux: still fails at head ef724aad6

Setup

  • Head: ef724aad6, clean worktree of the PR head, Release
  • Host: Linux, Ryzen 9 5950X, RTX 3080 Ti, NVIDIA 615.71.09

Result

  • Build: exit 0
  • agc_driver_image_table_reuse_tests: exit 1
  • Failing case: image table reuse: CPU writes to a new table's 64 KiB block, then an image store leaving results pending over an entry: 3 reused and 2 resolved tables, expected 2 and 2

This matches the run I posted at 16:59. The head is unchanged since then.

AI-assisted; the build and run are from my machine.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6201864443 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6340#issuecomment-6201864443). Originally posted by [mrfelek](https://github.com/mrfelek) on 2026-10-15T20:42:34Z. --- ## `agc_driver_image_table_reuse` on Linux: still fails at head `ef724aad6` **Setup** - Head: `ef724aad6`, clean worktree of the PR head, Release - Host: Linux, Ryzen 9 5950X, RTX 3080 Ti, NVIDIA 615.71.09 **Result** - Build: exit 0 - `agc_driver_image_table_reuse_tests`: exit 1 - Failing case: `image table reuse: CPU writes to a new table's 64 KiB block, then an image store leaving results pending over an entry: 3 reused and 2 resolved tables, expected 2 and 2` This matches the run I posted at 16:59. The head is unchanged since then. AI-assisted; the build and run are from my machine.
MarcZX10 commented 2026-10-15 21:40:43 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-15T21:40:43Z.


Thanks for repeating the Linux run. I traced the reported 3 reused / 2 resolved result to the partial-reuse behavior this PR adds: after a pending GPU write invalidates one image, the next dispatch reuses unaffected elements and resolves the changed element, so that dispatch increments both table counters. The Linux expectation now includes that mixed dispatch (3 / 2); the Windows expectation also adds one reuse (2 / 2). The texel-value assertions still check the updated image result and the unaffected entries.

The same adjustment applies to the collect-epoch CPU-write case: unaffected entries can remain reusable while the changed entry is resolved. I updated that expected reuse count as well. This is a test-only follow-up; the production change is unchanged.

On this head, conventions and git diff --check pass. The local test binary still cannot start here because the host CPU guard rejects this Xeon before Vulkan setup, so I have not rerun the GPU test. Could you rerun agc_driver_image_table_reuse on this head when the CI check finishes, to confirm the updated totals on your Linux/RTX 3080 Ti setup? The Windows count remains from the earlier reported run, not a new execution.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6202858867 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6340#issuecomment-6202858867). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-15T21:40:43Z. --- Thanks for repeating the Linux run. I traced the reported `3 reused / 2 resolved` result to the partial-reuse behavior this PR adds: after a pending GPU write invalidates one image, the next dispatch reuses unaffected elements and resolves the changed element, so that dispatch increments both table counters. The Linux expectation now includes that mixed dispatch (`3 / 2`); the Windows expectation also adds one reuse (`2 / 2`). The texel-value assertions still check the updated image result and the unaffected entries. The same adjustment applies to the collect-epoch CPU-write case: unaffected entries can remain reusable while the changed entry is resolved. I updated that expected reuse count as well. This is a test-only follow-up; the production change is unchanged. On this head, conventions and `git diff --check` pass. The local test binary still cannot start here because the host CPU guard rejects this Xeon before Vulkan setup, so I have not rerun the GPU test. Could you rerun `agc_driver_image_table_reuse` on this head when the CI check finishes, to confirm the updated totals on your Linux/RTX 3080 Ti setup? The Windows count remains from the earlier reported run, not a new execution.
mrfelek commented 2026-10-15 22:29:26 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by mrfelek on 2026-10-15T22:29:26Z.


agc_driver_image_table_reuse on Linux at head 64a5a024a: a different case fails

Setup

  • Head: 64a5a024a, clean worktree of the PR head, Release
  • Host: Linux, Ryzen 9 5950X, RTX 3080 Ti, NVIDIA 615.71.09

Result

  • Build: exit 0
  • agc_driver_image_table_reuse_tests: exit 1
  • Failing case: image table reuse: a CPU write collected in a new epoch, then two dispatches with unaffected entries reusable: 2 reused and 1 resolved tables, expected 3 and 1

The case from the earlier head (3 reused / 2 resolved, expected 2 and 2) is not reported in this run. The test stops at the first failing check, so the later cases haven't run here. The collect-epoch case is the one the updated expectation covers, and it expects three reused tables. We get two.

AI-assisted; the build and run are from my machine.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6203596319 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6340#issuecomment-6203596319). Originally posted by [mrfelek](https://github.com/mrfelek) on 2026-10-15T22:29:26Z. --- ## `agc_driver_image_table_reuse` on Linux at head `64a5a024a`: a different case fails **Setup** - Head: `64a5a024a`, clean worktree of the PR head, Release - Host: Linux, Ryzen 9 5950X, RTX 3080 Ti, NVIDIA 615.71.09 **Result** - Build: exit 0 - `agc_driver_image_table_reuse_tests`: exit 1 - Failing case: `image table reuse: a CPU write collected in a new epoch, then two dispatches with unaffected entries reusable: 2 reused and 1 resolved tables, expected 3 and 1` The case from the earlier head (`3 reused / 2 resolved`, expected `2 and 2`) is not reported in this run. The test stops at the first failing check, so the later cases haven't run here. The collect-epoch case is the one the updated expectation covers, and it expects three reused tables. We get two. AI-assisted; the build and run are from my machine.
MarcZX10 commented 2026-10-15 23:12:26 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-15T23:12:26Z.


Thanks for the run. I traced this to the collect-epoch assertion: it covers three dispatches, so on Linux the expected delta is 2 reused / 1 resolved (the previous expectation); the 3 reused / 2 resolved total belongs to the separate image-store case, which covers the mixed reuse/resolution after the pending store. I corrected only the collect-epoch expectation in commit 7edfb19f7 and pushed it. git diff --check and conventions pass. I could not run the Vulkan test locally because this host fails AnyPS5’s CPU-feature gate before Vulkan initialization. Could you rerun the target at the new head?

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6204212373 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6340#issuecomment-6204212373). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-15T23:12:26Z. --- Thanks for the run. I traced this to the collect-epoch assertion: it covers three dispatches, so on Linux the expected delta is `2 reused / 1 resolved` (the previous expectation); the `3 reused / 2 resolved` total belongs to the separate image-store case, which covers the mixed reuse/resolution after the pending store. I corrected only the collect-epoch expectation in commit `7edfb19f7` and pushed it. `git diff --check` and conventions pass. I could not run the Vulkan test locally because this host fails AnyPS5’s CPU-feature gate before Vulkan initialization. Could you rerun the target at the new head?
mrfelek commented 2026-10-15 23:43:45 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by mrfelek on 2026-10-15T23:43:45Z.


agc_driver_image_table_reuse on Linux at head 7edfb19f7: a different case fails

Setup

  • Head: 7edfb19f7, clean worktree of the PR head, Release
  • Host: Linux, Ryzen 9 5950X, RTX 3080 Ti, NVIDIA 615.71.09

Result

  • Build: exit 0
  • agc_driver_image_table_reuse_tests: exit 1
  • Failing case: image table reuse: a table whose images include a separate tracking block: 1 reused and 2 resolved tables, expected 1 and 1

The collect-epoch case from the earlier run no longer appears as the failure. The test stops at the first failing check, so the cases after this one have not run here.

AI-assisted; the build and run are from my machine.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6204616264 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6340#issuecomment-6204616264). Originally posted by [mrfelek](https://github.com/mrfelek) on 2026-10-15T23:43:45Z. --- ## `agc_driver_image_table_reuse` on Linux at head `7edfb19f7`: a different case fails **Setup** - Head: `7edfb19f7`, clean worktree of the PR head, Release - Host: Linux, Ryzen 9 5950X, RTX 3080 Ti, NVIDIA 615.71.09 **Result** - Build: exit 0 - `agc_driver_image_table_reuse_tests`: exit 1 - Failing case: `image table reuse: a table whose images include a separate tracking block: 1 reused and 2 resolved tables, expected 1 and 1` The collect-epoch case from the earlier run no longer appears as the failure. The test stops at the first failing check, so the cases after this one have not run here. AI-assisted; the build and run are from my machine.
mrfelek commented 2026-10-15 23:45:48 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by mrfelek on 2026-10-15T23:45:48Z.


Possible fix for the tracking-block case (proposal, not verified against the code)

At head 7edfb19f7, on Linux, RunSelectivePendingWrite expects 1 reused / 1 resolved across its two dispatches (entry 23, then entry 5). The run gives 1 reused / 2 resolved.

The collect-epoch case was corrected for the same reason: after a CPU write, unaffected entries stay reusable and the changed entry is resolved, so one dispatch can count both. If the extra resolve here comes from the first dispatch after the epoch bump, the expectation for this step would be 1 / 2, following that correction.

What we did not check: which dispatch produces the second resolve. Our run only shows the totals. If it is not the first dispatch after the bump, the count points at a real reuse problem for the separate block, and the expectation should stay.

We would change nothing until you confirm which one the design intends.

AI-assisted; the proposal is from reading the test output, and the code was not traced.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6204641638 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6340#issuecomment-6204641638). Originally posted by [mrfelek](https://github.com/mrfelek) on 2026-10-15T23:45:48Z. --- ## Possible fix for the tracking-block case (proposal, not verified against the code) At head `7edfb19f7`, on Linux, `RunSelectivePendingWrite` expects `1 reused / 1 resolved` across its two dispatches (entry 23, then entry 5). The run gives `1 reused / 2 resolved`. The collect-epoch case was corrected for the same reason: after a CPU write, unaffected entries stay reusable and the changed entry is resolved, so one dispatch can count both. If the extra resolve here comes from the first dispatch after the epoch bump, the expectation for this step would be `1 / 2`, following that correction. What we did not check: which dispatch produces the second resolve. Our run only shows the totals. If it is not the first dispatch after the bump, the count points at a real reuse problem for the separate block, and the expectation should stay. We would change nothing until you confirm which one the design intends. AI-assisted; the proposal is from reading the test output, and the code was not traced.
MarcZX10 commented 2026-10-16 11:22:03 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-16T11:22:03Z.


I traced the RunSelectivePendingWrite counts and updated the first expectation in commit 1c42a9c66.

The collect-epoch bump invalidates the previous table. Across the first two dispatches, the first resolves the table, while the second can reuse unaffected entries and resolve the separate-block entry that was not reusable. That yields one reuse and two resolutions, matching the reported 1 / 2. The later pending-store check still expects 1 / 1: that single dispatch reuses clean siblings and resolves only the pending entry.

git diff --check and tools/check_conventions.py --base upstream/main pass. I could not run the GPU target on this host, so the reported RTX 3080 Ti run remains the runtime evidence. Could you rerun the focused target at head 1c42a9c66 to confirm the updated expectation and the later case?

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6214401974 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6340#issuecomment-6214401974). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-16T11:22:03Z. --- I traced the `RunSelectivePendingWrite` counts and updated the first expectation in commit `1c42a9c66`. The collect-epoch bump invalidates the previous table. Across the first two dispatches, the first resolves the table, while the second can reuse unaffected entries and resolve the separate-block entry that was not reusable. That yields one reuse and two resolutions, matching the reported `1 / 2`. The later pending-store check still expects `1 / 1`: that single dispatch reuses clean siblings and resolves only the pending entry. `git diff --check` and `tools/check_conventions.py --base upstream/main` pass. I could not run the GPU target on this host, so the reported RTX 3080 Ti run remains the runtime evidence. Could you rerun the focused target at head `1c42a9c66` to confirm the updated expectation and the later case?
MarcZX10 commented 2026-10-16 16:32:13 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-16T16:32:13Z.


I checked the mixed-DCC counter path and corrected the regression expectation in b05c53750: the first dispatch resolves the table, and the second reuses its clean entries while resolving the DCC entry that cannot be cached, so the combined delta is 1 reused / 2 resolved. The two texel readbacks are unchanged. Conventions and git diff --check pass; I could not run this Vulkan fixture locally because this host fails the emulator's CPU-feature gate before Vulkan setup. Could you rerun agc_driver_image_table_reuse on the new head?

On the storage-backed views: excluding looked->source != nullptr is intentional in this change. The current proof uses guest-memory generation and DCC keys, which do not prove a mutable storage image's contents stayed unchanged after GPU writes. Including those views needs a storage-image version/pending-write proof and is outside this patch. The title counters show that this limits reuse for storage-view-heavy scenes; this PR makes no claim to cover those entries.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6220059101 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6340#issuecomment-6220059101). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-16T16:32:13Z. --- I checked the mixed-DCC counter path and corrected the regression expectation in `b05c53750`: the first dispatch resolves the table, and the second reuses its clean entries while resolving the DCC entry that cannot be cached, so the combined delta is **1 reused / 2 resolved**. The two texel readbacks are unchanged. Conventions and `git diff --check` pass; I could not run this Vulkan fixture locally because this host fails the emulator's CPU-feature gate before Vulkan setup. Could you rerun `agc_driver_image_table_reuse` on the new head? On the storage-backed views: excluding `looked->source != nullptr` is intentional in this change. The current proof uses guest-memory generation and DCC keys, which do not prove a mutable storage image's contents stayed unchanged after GPU writes. Including those views needs a storage-image version/pending-write proof and is outside this patch. The title counters show that this limits reuse for storage-view-heavy scenes; this PR makes no claim to cover those entries.
Scramblrrrr commented 2026-10-16 16:58:54 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Scramblrrrr on 2026-10-16T16:58:54Z.


Windows RTX 5070 Ti (617.42) cross-test: public integration Scramblrrrr/AnyPS5@517d4cce9a37018082325b50aab3dcab58f285d2 combines current #6454 1752c4a89 (including #6537), current main 66e290f1c, #6340 b05c53750, #6567 544e7afb3, #6440/#6471/#6868, plus the separately listed 007 shader correctness prerequisites. All 22 selected native checks passed, no skips (11.25 s), including queued-draw vouches, image-table reuse, column memo, draw reuse/verify/inline, serializer, and shader disk cache. The image-table test also passed with table replay and kept descriptor sets disabled. Conventions pass. No title performance result yet for this integration.

I found fixture issues while combining the current heads, with a synthetic-only repair in 517d4cce9:

  • The mixed-DCC case uses TableCode's R128 image instruction (0xf09c8f08). Its descriptor words 4–7 are zero by definition, so the DCC enable bit never reaches the driver. The repair uses a full image descriptor for this case, widens the scalar load to include it, and asserts that a materialized table entry actually carries the DCC bit. With an isolated guest block it gets the intended 1 reuse / 2 resolutions and both texel readbacks pass.
  • Windows CPU-write cases give 2 reuse / 2 resolution and 3 reuse / 3 resolution: one dispatch can count both. Existing texel checks retained.
  • In the separate-block store case, UnwatchSerial changes (2→3) while Store runs. CurrentTableState therefore invalidates the whole table; the next dispatch correctly resolves it (0 reuse / 1 resolution), with correct stored texels. The test now checks whether watch coverage changed rather than demanding partial reuse after the global proof was invalidated.

These are test-only integration adjustments, not a new production cache shortcut. Sharing the findings before the 007 run so authors can review the expectations independently. AI-assisted.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6220528511 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6340#issuecomment-6220528511). Originally posted by [Scramblrrrr](https://github.com/Scramblrrrr) on 2026-10-16T16:58:54Z. --- Windows RTX 5070 Ti (617.42) cross-test: public integration `Scramblrrrr/AnyPS5@517d4cce9a37018082325b50aab3dcab58f285d2` combines current #6454 `1752c4a89` (including #6537), current main `66e290f1c`, #6340 `b05c53750`, #6567 `544e7afb3`, #6440/#6471/#6868, plus the separately listed 007 shader correctness prerequisites. All 22 selected native checks passed, no skips (11.25 s), including queued-draw vouches, image-table reuse, column memo, draw reuse/verify/inline, serializer, and shader disk cache. The image-table test also passed with table replay and kept descriptor sets disabled. Conventions pass. No title performance result yet for this integration. I found fixture issues while combining the current heads, with a synthetic-only repair in `517d4cce9`: - The mixed-DCC case uses TableCode's R128 image instruction (`0xf09c8f08`). Its descriptor words 4–7 are zero by definition, so the DCC enable bit never reaches the driver. The repair uses a full image descriptor for this case, widens the scalar load to include it, and asserts that a materialized table entry actually carries the DCC bit. With an isolated guest block it gets the intended 1 reuse / 2 resolutions and both texel readbacks pass. - Windows CPU-write cases give 2 reuse / 2 resolution and 3 reuse / 3 resolution: one dispatch can count both. Existing texel checks retained. - In the separate-block store case, UnwatchSerial changes (2→3) while Store runs. CurrentTableState therefore invalidates the whole table; the next dispatch correctly resolves it (0 reuse / 1 resolution), with correct stored texels. The test now checks whether watch coverage changed rather than demanding partial reuse after the global proof was invalidated. These are test-only integration adjustments, not a new production cache shortcut. Sharing the findings before the 007 run so authors can review the expectations independently. AI-assisted.
MarcZX10 commented 2026-10-16 17:12:40 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-16T17:12:40Z.


Thanks for the Windows cross-test and for separating the fixture defects from the cache behavior. I addressed the relevant findings in commit d367300b6 on the current PR head:

  • The mixed-DCC test now uses a full image instruction for that case and checks the materialized descriptor has the DCC enable bit before relying on it as coverage.
  • The table reuse counts now include the resolution on each dispatch, and the separate-block pending-store expectation accounts for whether write-watch coverage changed and invalidated the full table proof.

Validation on Linux: the agc_driver_image_table_reuse_tests target builds with GCC 12.2. CTest starts the executable but the host CPU guard stops it before Vulkan setup because this Xeon lacks LZCNT, BMI1/2, MOVBE, AVX2 and FMA. I have not rerun the Windows Vulkan test. Could you rerun agc_driver_image_table_reuse on d367300b6 when convenient and report whether the updated checks pass?

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6220766934 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6340#issuecomment-6220766934). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-16T17:12:40Z. --- Thanks for the Windows cross-test and for separating the fixture defects from the cache behavior. I addressed the relevant findings in commit `d367300b6` on the current PR head: - The mixed-DCC test now uses a full image instruction for that case and checks the materialized descriptor has the DCC enable bit before relying on it as coverage. - The table reuse counts now include the resolution on each dispatch, and the separate-block pending-store expectation accounts for whether write-watch coverage changed and invalidated the full table proof. Validation on Linux: the `agc_driver_image_table_reuse_tests` target builds with GCC 12.2. CTest starts the executable but the host CPU guard stops it before Vulkan setup because this Xeon lacks LZCNT, BMI1/2, MOVBE, AVX2 and FMA. I have not rerun the Windows Vulkan test. Could you rerun `agc_driver_image_table_reuse` on `d367300b6` when convenient and report whether the updated checks pass?
Scramblrrrr commented 2026-10-16 17:19:07 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Scramblrrrr on 2026-10-16T17:19:07Z.


Thanks, picked up d367300b6 into our integration at d8547a54e06e7d7fafecb7f3223f01cd09896277. Fresh Windows/RTX5070Ti617.42 agc_driver_image_table_reuse PASSES (both pending-store and full-DCC checks reached); all22 selected native controls pass11.65s, no skips. Your updated test flow is retained, including reuse of the original block for RunSelectivePendingWrite; our only remaining test-file differences from d367 are #6454's extra replay/descriptor-write assertions and cstdlib include. No fresh-block workaround needed. The source is public on codex/first-light-wave64-current.

Qualification: this is an integration cross-test with #6454/#6537/#6567/#6471/#6868 and now #4339, not a clean-main build of #6340 alone. The earlier pre-wave integration517d also passed the corresponding repaired fixture. AI-assisted: Codex.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6220878540 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6340#issuecomment-6220878540). Originally posted by [Scramblrrrr](https://github.com/Scramblrrrr) on 2026-10-16T17:19:07Z. --- Thanks, picked up d367300b6 into our integration at d8547a54e06e7d7fafecb7f3223f01cd09896277. Fresh Windows/RTX5070Ti617.42 agc_driver_image_table_reuse PASSES (both pending-store and full-DCC checks reached); all22 selected native controls pass11.65s, no skips. Your updated test flow is retained, including reuse of the original block for RunSelectivePendingWrite; our only remaining test-file differences from d367 are #6454's extra replay/descriptor-write assertions and cstdlib include. No fresh-block workaround needed. The source is public on codex/first-light-wave64-current. Qualification: this is an integration cross-test with #6454/#6537/#6567/#6471/#6868 and now #4339, not a clean-main build of #6340 alone. The earlier pre-wave integration517d also passed the corresponding repaired fixture. AI-assisted: Codex.
MarcZX10 commented 2026-10-16 17:20:25 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-16T17:20:25Z.


Thanks for the fresh Windows cross-test. It confirms the updated mixed-DCC and pending-store assertions in the integrated head, with all 22 selected checks passing. I have noted the integration includes the listed companion PRs, so I am treating it as cross-test evidence rather than a clean-main run of #6340 alone. No title performance result is claimed.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6220899792 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6340#issuecomment-6220899792). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-16T17:20:25Z. --- Thanks for the fresh Windows cross-test. It confirms the updated mixed-DCC and pending-store assertions in the integrated head, with all 22 selected checks passing. I have noted the integration includes the listed companion PRs, so I am treating it as cross-test evidence rather than a clean-main run of #6340 alone. No title performance result is claimed.
mrfelek commented 2026-10-16 20:03:10 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by mrfelek on 2026-10-16T20:03:10Z.


Reran agc_driver_image_table_reuse on d367300b6 alone (PR head, base 31cbb55d7), Release, BUILD_TESTING=ON, ANYPS5_AGC_EXECUTION_TESTS=ImageTableReuse:

  • Linux (RTX 3080 Ti, NVIDIA 615.71.09, GCC 15.3): fails in 3 of 3 runs at a pending write invalidating one table element while its siblings remain reusable: 0 reused and 1 resolved tables, expected 1 and 1.
  • Windows (RTX A2000 Laptop, NVIDIA 610.60, WinLibs GCC 15.2): passes in 3 of 3 runs.

Cause on Linux: RunSelectivePendingWrite reuses block, which RunTests already wrote through a dispatch. On Linux the sibling textures are then views of storage images (looked->source != nullptr), which this PR deliberately does not reuse. After the first resolve only the separate-block entry is reusable, and after the store nothing is.

Possible test change: give RunSelectivePendingWrite a fresh GuestBlock, and expect 1, 1 for the first pair, since on a clean block the second dispatch reuses the whole table:

-    Expect(before, 1, 2, "a table whose images include a separate tracking block");
+    Expect(before, 1, 1, "a table whose images include a separate tracking block");
...
-        RunSelectivePendingWrite(*device, block, separate);
+        GuestBlock selective;
+        RunSelectivePendingWrite(*device, selective, separate);

With this change the test passes in 3 of 3 runs on both Linux and Windows.

AI-assisted: this comment was drafted with the help of Claude Code and checked against the test output by us.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6223669527 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6340#issuecomment-6223669527). Originally posted by [mrfelek](https://github.com/mrfelek) on 2026-10-16T20:03:10Z. --- Reran `agc_driver_image_table_reuse` on `d367300b6` alone (PR head, base `31cbb55d7`), Release, `BUILD_TESTING=ON`, `ANYPS5_AGC_EXECUTION_TESTS=ImageTableReuse`: - Linux (RTX 3080 Ti, NVIDIA 615.71.09, GCC 15.3): fails in 3 of 3 runs at `a pending write invalidating one table element while its siblings remain reusable: 0 reused and 1 resolved tables, expected 1 and 1`. - Windows (RTX A2000 Laptop, NVIDIA 610.60, WinLibs GCC 15.2): passes in 3 of 3 runs. **Cause on Linux:** `RunSelectivePendingWrite` reuses `block`, which `RunTests` already wrote through a dispatch. On Linux the sibling textures are then views of storage images (`looked->source != nullptr`), which this PR deliberately does not reuse. After the first resolve only the separate-block entry is reusable, and after the store nothing is. **Possible test change:** give `RunSelectivePendingWrite` a fresh `GuestBlock`, and expect `1, 1` for the first pair, since on a clean block the second dispatch reuses the whole table: ```diff - Expect(before, 1, 2, "a table whose images include a separate tracking block"); + Expect(before, 1, 1, "a table whose images include a separate tracking block"); ... - RunSelectivePendingWrite(*device, block, separate); + GuestBlock selective; + RunSelectivePendingWrite(*device, selective, separate); ``` With this change the test passes in 3 of 3 runs on both Linux and Windows. AI-assisted: this comment was drafted with the help of Claude Code and checked against the test output by us.
MarcZX10 commented 2026-10-16 20:05:08 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-16T20:05:08Z.


Thanks for the exact-head Linux result and the Windows comparison. The Linux failure comes from fixture history: the selective test reused block after RunTests had dispatched storage images, leaving the Linux table on the path that intentionally does not reuse those source-backed textures. I gave the selective case its own GuestBlock and updated the initial two-dispatch expectation to 1 reuse / 1 resolution, matching the clean fixture. This retains the later pending-write check. The suggested patch was reported passing 3/3 on both Linux and Windows; I applied that change as 84ebd666a. git diff --check and conventions pass. I did not run the GPU test locally.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6223703873 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6340#issuecomment-6223703873). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-16T20:05:08Z. --- Thanks for the exact-head Linux result and the Windows comparison. The Linux failure comes from fixture history: the selective test reused `block` after `RunTests` had dispatched storage images, leaving the Linux table on the path that intentionally does not reuse those source-backed textures. I gave the selective case its own `GuestBlock` and updated the initial two-dispatch expectation to 1 reuse / 1 resolution, matching the clean fixture. This retains the later pending-write check. The suggested patch was reported passing 3/3 on both Linux and Windows; I applied that change as `84ebd666a`. `git diff --check` and conventions pass. I did not run the GPU test locally.
MarcZX10 commented 2026-10-18 03:12:20 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-18T03:12:20Z.


Rebased this branch onto 2626e5ee7 (current upstream main) and resolved the ShaderResources.cpp overlap with the newer storage-image table path. The per-entry reuse path now explicitly skips entries marked writable, while keeping their positions aligned in the reuse record; the storage path retains its own capacity and write tracking.

The rebased diff is limited to ShaderResources.cpp and ImageTableReuse.cpp; git diff --check passes. The seven replayed commits retain my author identity. I could not run the targeted test here because this checkout has no configured AnyPS5 build tree. Existing reported Linux/Windows test results above are from the prior head, so this rebase still needs CI or a fresh target run.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6245066881 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6340#issuecomment-6245066881). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-18T03:12:20Z. --- Rebased this branch onto `2626e5ee7` (current upstream main) and resolved the `ShaderResources.cpp` overlap with the newer storage-image table path. The per-entry reuse path now explicitly skips entries marked writable, while keeping their positions aligned in the reuse record; the storage path retains its own capacity and write tracking. The rebased diff is limited to `ShaderResources.cpp` and `ImageTableReuse.cpp`; `git diff --check` passes. The seven replayed commits retain my author identity. I could not run the targeted test here because this checkout has no configured AnyPS5 build tree. Existing reported Linux/Windows test results above are from the prior head, so this rebase still needs CI or a fresh target run.
Mustafa1p commented 2026-10-18 15:55:44 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Mustafa1p on 2026-10-18T15:55:44Z.


@MarcZX10 Overlap coordination with #6937: I reviewed pinned head 0dad1b2acf65d407da1fc0241e67d91da910a003. Your per-entry table reuse removes ReusedTable::queries and replaces the whole-table proof in TableCurrent; #6937 currently checks the recorder's pending copied-buffer-write snapshot against those queries before accepting the unchanged guest-memory generation. This is separate from StorageTexture::PendingSerial and must survive whichever patch lands first.

#6937 is still draft, waiting on selector #7570, validation follow-up #7573, and the maintainer's review-scope decision. I do not ask you to hold this independent optimization for it. If #6340 lands first, I can adapt #6937's pending-write check to each eligible element and re-run whole/mixed/disjoint tests. If #6937 lands first, the per-entry conversion needs to retain the same overlapping-write rejection. The existing mixed-table case on main is control coverage, not a claimed regression of a per-entry optimization.

Does that ordering/adaptation plan work for you? I have not claimed the combined #6340/#6937 paths are validated or this overlap is resolved. AI-assisted: yes.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6251961600 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6340#issuecomment-6251961600). Originally posted by [Mustafa1p](https://github.com/Mustafa1p) on 2026-10-18T15:55:44Z. --- @MarcZX10 Overlap coordination with #6937: I reviewed pinned head `0dad1b2acf65d407da1fc0241e67d91da910a003`. Your per-entry table reuse removes `ReusedTable::queries` and replaces the whole-table proof in `TableCurrent`; #6937 currently checks the recorder's pending copied-buffer-write snapshot against those queries before accepting the unchanged guest-memory generation. This is separate from `StorageTexture::PendingSerial` and must survive whichever patch lands first. #6937 is still draft, waiting on selector #7570, validation follow-up #7573, and the maintainer's review-scope decision. I do not ask you to hold this independent optimization for it. If #6340 lands first, I can adapt #6937's pending-write check to each eligible element and re-run whole/mixed/disjoint tests. If #6937 lands first, the per-entry conversion needs to retain the same overlapping-write rejection. The existing mixed-table case on main is control coverage, not a claimed regression of a per-entry optimization. Does that ordering/adaptation plan work for you? I have not claimed the combined #6340/#6937 paths are validated or this overlap is resolved. AI-assisted: yes.
MarcZX10 commented 2026-10-18 16:03:07 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-18T16:03:07Z.


Thanks for spelling out the interaction. I agree the recorder's pending copied-buffer-write snapshot is a separate proof from StorageTexture::PendingSerial and the guest generation query. The current #6340 head carries the per-element guest-generation and overlapping storage-write checks, but it does not yet include #6937's new snapshot check because that change is not on main.

Either order works for me: if #6937 lands first, I can rebase and preserve its pending-copy rejection per reusable element; if #6340 lands first, please add the snapshot-vs-query check in your follow-up as you described. The current tests do not establish this interaction, so I won't claim that they do.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6252035343 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6340#issuecomment-6252035343). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-18T16:03:07Z. --- Thanks for spelling out the interaction. I agree the recorder's pending copied-buffer-write snapshot is a separate proof from `StorageTexture::PendingSerial` and the guest generation query. The current #6340 head carries the per-element guest-generation and overlapping storage-write checks, but it does not yet include #6937's new snapshot check because that change is not on `main`. Either order works for me: if #6937 lands first, I can rebase and preserve its pending-copy rejection per reusable element; if #6340 lands first, please add the snapshot-vs-query check in your follow-up as you described. The current tests do not establish this interaction, so I won't claim that they do.
MarcZX10 commented 2026-10-18 23:46:02 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-18T23:46:02Z.


@Mustafa1p Yes, that ordering/adaptation plan works. #6340 is independent and does not need to wait on #6937. If #6340 lands first, #6937 should adapt the pending copied-buffer-write check to the per-entry reuse path; if #6937 lands first, I will preserve its overlapping-write rejection in #6340. Agreed that the existing mixed-table control does not validate the combined path, so we should not claim that coverage until it is added and rerun.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6256660922 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6340#issuecomment-6256660922). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-18T23:46:02Z. --- @Mustafa1p Yes, that ordering/adaptation plan works. #6340 is independent and does not need to wait on #6937. If #6340 lands first, #6937 should adapt the pending copied-buffer-write check to the per-entry reuse path; if #6937 lands first, I will preserve its overlapping-write rejection in #6340. Agreed that the existing mixed-table control does not validate the combined path, so we should not claim that coverage until it is added and rerun.
Scramblrrrr commented 2026-10-19 14:04:22 +00:00 (Migrated from github.com)

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


Combined #6340/#6937 Windows WIP now public at adfd0c4b2, based on our tested 007 integration162c34ee8/main3bb15be09:
https://github.com/Scramblrrrr/AnyPS5/tree/codex/first-light-entry-cache-oct19b

Retains #6340 published0dad1b2ac and #6937 published8f52b46de authorship. Integration adapts the pending copied-write snapshot check per reusable element in both TableCurrent and fresh-entry installation. It preserves main/#6454 full-table sampler replay, plus replay for eligible unchanged entries of a partial table; writable/source-backed entries stay outside this proof.

Focused NVIDIA RTX5070Ti617.42/Windows checks: all five pending-write modes pass, including a strengthened mixed-table warm assertion (tracked siblings reused while the untracked entry resolves), with full RGBA/surface/source/sentinel oracles retained. Paired negative changes ONLY the two per-entry SnapshotOverlaps checks, retaining cachedTexture's separate #6937 fix and unchanged fixture EXEs: whole and mixed cases fail, disjoint and both direct-snapshot controls pass (3/5,2.22s). Exact positive source restored/recompiled:5/5 pass2.15s; EXE hashes unchanged.

Existing image-table fixture initially expected1reuse/1resolution after a driver store; the combined path gives2reuse/1resolution: first dispatch resolves the changed entry while reusing siblings, second reuses the refreshed table. Both original texel readbacks pass. Integration expectation updated to describe that behavior; image-table reuse then passes. Broader affected checks are still running; NOT staged/title-tested, no FPS/unblock or validation-layer claim. AI-assisted: Codex. Raw title data stays local.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6269110376 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6340#issuecomment-6269110376). Originally posted by [Scramblrrrr](https://github.com/Scramblrrrr) on 2026-10-19T14:04:22Z. --- Combined #6340/#6937 Windows WIP now public at adfd0c4b2, based on our tested 007 integration162c34ee8/main3bb15be09: https://github.com/Scramblrrrr/AnyPS5/tree/codex/first-light-entry-cache-oct19b Retains #6340 published0dad1b2ac and #6937 published8f52b46de authorship. Integration adapts the pending copied-write snapshot check per reusable element in both TableCurrent and fresh-entry installation. It preserves main/#6454 full-table sampler replay, plus replay for eligible unchanged entries of a partial table; writable/source-backed entries stay outside this proof. Focused NVIDIA RTX5070Ti617.42/Windows checks: all five pending-write modes pass, including a strengthened mixed-table warm assertion (tracked siblings reused while the untracked entry resolves), with full RGBA/surface/source/sentinel oracles retained. Paired negative changes ONLY the two per-entry SnapshotOverlaps checks, retaining cachedTexture's separate #6937 fix and unchanged fixture EXEs: whole and mixed cases fail, disjoint and both direct-snapshot controls pass (3/5,2.22s). Exact positive source restored/recompiled:5/5 pass2.15s; EXE hashes unchanged. Existing image-table fixture initially expected1reuse/1resolution after a driver store; the combined path gives2reuse/1resolution: first dispatch resolves the changed entry while reusing siblings, second reuses the refreshed table. Both original texel readbacks pass. Integration expectation updated to describe that behavior; image-table reuse then passes. Broader affected checks are still running; NOT staged/title-tested, no FPS/unblock or validation-layer claim. AI-assisted: Codex. Raw title data stays local.
Scramblrrrr commented 2026-10-19 14:19:26 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Scramblrrrr on 2026-10-19T14:19:26Z.


Follow-up on adfd0c4b2368: broad Windows/RTX5070Ti checks finished,165PASS+one expected Linux-only sparse-import skip (166 cases,69.89s). Additional table-replay/kept-set-disabled image-table and pending whole/mixed controls3/3PASS1.41s. Final full libs packaging after the committed head records adfd/dirty=false; all353runtime modules SHA-verified, prior runtime backed up.

007 reached the offline main menu. Six contained moving-menu intervals:135presents/61.214159s=2.20537FPS, GPU182.87059ms/present. Preceding162c34ee8 baseline, same imported/cache1024/window16M/import4096MiB/resource16/SDR/SPIRV-toolsOFF settings:131/61.806467s=2.11952FPS, GPU180.67138ms. Small difference from one animated-menu sample each; not a proven speedup or gameplay/unblock claim. Both warm, but the pipeline journal also gained level entries during the preceding baseline's Resume probe, so cache contents are not identical. Menu output observed before/after; no pixel-equivalence or audio claim. Raw title data stays local. AI-assisted: Codex.

The combined per-entry guard red/green proof above is the correctness finding; this title timing is exploratory. Official digests below.

Baseline:
6 intervals, 264.9 to 326.7 s, 131 presents
NVIDIA GeForce RTX 5070 Ti, NVIDIA 617.42, Windows 10.0.26200, 3840x2160, commit 162c34ee813b

# seconds presents p50 p90 p99 max GPU busy busiest worker largest phase
1 265-275 22 470.5 503.1 518.7 518.7 181.5 100 % Driver.Packet 2328.9
2 275-286 21 480.7 500.7 800.9 800.9 180.6 100 % Driver.Packet 2443.8
3 286-296 22 462.5 501.1 548.0 548.0 181.4 101 % Driver.Packet 2295.9
4 296-306 22 481.1 511.5 566.0 566.0 179.4 100 % Driver.Packet 2368.5
5 306-316 22 454.7 520.8 546.7 546.7 181.0 101 % Driver.Packet 2308.9
6 316-327 22 478.7 506.6 516.7 516.7 180.1 100 % Driver.Packet 2346.5
p99 ms  *@****  0-800.9
gpu ms  @@@@@@  0-181.5

Combined per-entry cache:
6 intervals, 291.6 to 352.8 s, 135 presents
NVIDIA GeForce RTX 5070 Ti, NVIDIA 617.42, Windows 10.0.26200, 3840x2160, commit adfd0c4b2368

# seconds presents p50 p90 p99 max GPU busy busiest worker largest phase
1 292-302 23 450.8 486.0 525.6 525.6 184.7 100 % Driver.Packet 2254.8
2 302-312 23 463.3 483.7 534.8 534.8 182.1 100 % Driver.Packet 2221.5
3 312-322 22 459.6 495.7 558.5 558.5 185.4 101 % Driver.Packet 2293.8
4 322-333 23 453.7 504.7 541.5 541.5 186.0 100 % Driver.Packet 2210.3
5 333-343 22 468.8 505.6 556.2 556.2 171.4 100 % Driver.Packet 2291.8
6 343-353 22 449.6 488.5 587.2 587.2 187.4 101 % Driver.Packet 2282.2
p99 ms  %%@%@@  0-587.2
gpu ms  @@@@%@  0-187.4
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6269443961 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6340#issuecomment-6269443961). Originally posted by [Scramblrrrr](https://github.com/Scramblrrrr) on 2026-10-19T14:19:26Z. --- Follow-up on adfd0c4b2368: broad Windows/RTX5070Ti checks finished,165PASS+one expected Linux-only sparse-import skip (166 cases,69.89s). Additional table-replay/kept-set-disabled image-table and pending whole/mixed controls3/3PASS1.41s. Final full libs packaging after the committed head records adfd/dirty=false; all353runtime modules SHA-verified, prior runtime backed up. 007 reached the offline main menu. Six contained moving-menu intervals:135presents/61.214159s=2.20537FPS, GPU182.87059ms/present. Preceding162c34ee8 baseline, same imported/cache1024/window16M/import4096MiB/resource16/SDR/SPIRV-toolsOFF settings:131/61.806467s=2.11952FPS, GPU180.67138ms. Small difference from one animated-menu sample each; not a proven speedup or gameplay/unblock claim. Both warm, but the pipeline journal also gained level entries during the preceding baseline's Resume probe, so cache contents are not identical. Menu output observed before/after; no pixel-equivalence or audio claim. Raw title data stays local. AI-assisted: Codex. The combined per-entry guard red/green proof above is the correctness finding; this title timing is exploratory. Official digests below. Baseline: **6 intervals**, 264.9 to 326.7 s, 131 presents NVIDIA GeForce RTX 5070 Ti, NVIDIA 617.42, Windows 10.0.26200, 3840x2160, commit 162c34ee813b | # | seconds | presents | p50 | p90 | p99 | max | GPU busy | busiest worker | largest phase | |---|---|---|---|---|---|---|---|---|---| | 1 | 265-275 | 22 | 470.5 | 503.1 | 518.7 | 518.7 | 181.5 | 100 % | Driver.Packet 2328.9 | | 2 | 275-286 | 21 | 480.7 | 500.7 | 800.9 | 800.9 | 180.6 | 100 % | Driver.Packet 2443.8 | | 3 | 286-296 | 22 | 462.5 | 501.1 | 548.0 | 548.0 | 181.4 | 101 % | Driver.Packet 2295.9 | | 4 | 296-306 | 22 | 481.1 | 511.5 | 566.0 | 566.0 | 179.4 | 100 % | Driver.Packet 2368.5 | | 5 | 306-316 | 22 | 454.7 | 520.8 | 546.7 | 546.7 | 181.0 | 101 % | Driver.Packet 2308.9 | | 6 | 316-327 | 22 | 478.7 | 506.6 | 516.7 | 516.7 | 180.1 | 100 % | Driver.Packet 2346.5 | ``` p99 ms *@**** 0-800.9 gpu ms @@@@@@ 0-181.5 ``` Combined per-entry cache: **6 intervals**, 291.6 to 352.8 s, 135 presents NVIDIA GeForce RTX 5070 Ti, NVIDIA 617.42, Windows 10.0.26200, 3840x2160, commit adfd0c4b2368 | # | seconds | presents | p50 | p90 | p99 | max | GPU busy | busiest worker | largest phase | |---|---|---|---|---|---|---|---|---|---| | 1 | 292-302 | 23 | 450.8 | 486.0 | 525.6 | 525.6 | 184.7 | 100 % | Driver.Packet 2254.8 | | 2 | 302-312 | 23 | 463.3 | 483.7 | 534.8 | 534.8 | 182.1 | 100 % | Driver.Packet 2221.5 | | 3 | 312-322 | 22 | 459.6 | 495.7 | 558.5 | 558.5 | 185.4 | 101 % | Driver.Packet 2293.8 | | 4 | 322-333 | 23 | 453.7 | 504.7 | 541.5 | 541.5 | 186.0 | 100 % | Driver.Packet 2210.3 | | 5 | 333-343 | 22 | 468.8 | 505.6 | 556.2 | 556.2 | 171.4 | 100 % | Driver.Packet 2291.8 | | 6 | 343-353 | 22 | 449.6 | 488.5 | 587.2 | 587.2 | 187.4 | 101 % | Driver.Packet 2282.2 | ``` p99 ms %%@%@@ 0-587.2 gpu ms @@@@%@ 0-187.4 ```
MarcZX10 commented 2026-10-19 16:52:33 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-19T16:52:33Z.


Thank you for publishing the combined #6340/#6937 integration branch and completing the broader Windows/RTX 5070 Ti checks. I understand the per-entry snapshot checks now cover the partial-table reuse case, the paired negative controls fail as expected, and the title/menu sample is explicitly exploratory rather than evidence of a speedup or gameplay fix. I have not incorporated that integration branch into this PR’s head yet, so I’ll keep the combined-branch results distinct from this PR’s current-head status.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6272482788 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6340#issuecomment-6272482788). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-19T16:52:33Z. --- Thank you for publishing the combined #6340/#6937 integration branch and completing the broader Windows/RTX 5070 Ti checks. I understand the per-entry snapshot checks now cover the partial-table reuse case, the paired negative controls fail as expected, and the title/menu sample is explicitly exploratory rather than evidence of a speedup or gameplay fix. I have not incorporated that integration branch into this PR’s head yet, so I’ll keep the combined-branch results distinct from this PR’s current-head status.
github-actions[bot] commented 2026-10-20 10:00:36 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-20T10:00:36Z.


This pull request is labeled perf, so it needs the summary line of a capture on main and one with the change, from the same title, scene and machine, as the Performance report form asks. Please paste both aps5-summary.jsonl lines, attach the two traces and add the output of tools/trace_digest.py.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6288395375 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6340#issuecomment-6288395375). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-20T10:00:36Z. --- <!-- pr-labels-perf --> This pull request is labeled `perf`, so it needs the summary line of a capture on `main` and one with the change, from the same title, scene and machine, as the Performance report form asks. Please paste both `aps5-summary.jsonl` lines, attach the two traces and add the output of `tools/trace_digest.py`.
MarcZX10 commented 2026-10-20 10:03:19 +00:00 (Migrated from github.com)

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


I updated this branch to current main and kept #6937 separate. The merge preserves upstream's whole-table replay path when every entry is reusable, while retaining this PR's per-entry fallback for partial reuse. The follow-up also preserves each entry's bind result for replay.

Validation on the updated head: both changed C++ translation units (ShaderResources.cpp and ImageTableReuse.cpp) compile with GCC 12 using the existing Linux Release configuration. GitHub conventions, eligibility, labels, and report checks pass. GitHub's Linux, Windows, and other platform build jobs are skipped for this PR, so this is compile validation only; the runtime test remains unavailable on this Xeon host because it lacks the CPU features required by AnyPS5.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6288440034 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6340#issuecomment-6288440034). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-20T10:03:19Z. --- I updated this branch to current `main` and kept #6937 separate. The merge preserves upstream's whole-table replay path when every entry is reusable, while retaining this PR's per-entry fallback for partial reuse. The follow-up also preserves each entry's bind result for replay. Validation on the updated head: both changed C++ translation units (`ShaderResources.cpp` and `ImageTableReuse.cpp`) compile with GCC 12 using the existing Linux Release configuration. GitHub conventions, eligibility, labels, and report checks pass. GitHub's Linux, Windows, and other platform build jobs are skipped for this PR, so this is compile validation only; the runtime test remains unavailable on this Xeon host because it lacks the CPU features required by AnyPS5.
MarcZX10 commented 2026-10-20 21:48:13 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-20T21:48:13Z.


Thanks for the broad correctness and runtime report. The combined per-entry guard has a red/green proof, while the 007 menu timing is explicitly exploratory and not presented as a measured speedup or gameplay unblock. I’ve noted the complete runtime-module digest checks and the cache-state limitation.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6302364296 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6340#issuecomment-6302364296). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-20T21:48:13Z. --- Thanks for the broad correctness and runtime report. The combined per-entry guard has a red/green proof, while the 007 menu timing is explicitly exploratory and not presented as a measured speedup or gameplay unblock. I’ve noted the complete runtime-module digest checks and the cache-state limitation.
MarcZX10 commented 2026-10-21 03:26:06 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-21T03:26:06Z.


Thanks for the broad Windows/RTX 5070 Ti run and the targeted table-replay, kept-set-disabled, and pending-write controls. The 165 passing checks plus the one documented Linux-only skip provide useful evidence for the integrated #6340/#6937 path. I will keep it attributed to the combined head and won’t treat it as a run of #6340 alone.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6307265241 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6340#issuecomment-6307265241). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-21T03:26:06Z. --- Thanks for the broad Windows/RTX 5070 Ti run and the targeted table-replay, kept-set-disabled, and pending-write controls. The 165 passing checks plus the one documented Linux-only skip provide useful evidence for the integrated #6340/#6937 path. I will keep it attributed to the combined head and won’t treat it as a run of #6340 alone.
adriadam10 commented 2026-10-31 12:54:14 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-31T12:54:14Z.

Review: CHANGES_REQUESTED


Thanks for the work. Two things block this:

  • core/libs/prx/libSceAgcDriver/tests/execution/ImageTableReuse.cpp:384 ("a driver store over an entry"): @mrfelek reports agc_driver_image_table_reuse failing with this PR merged on current main (Linux, RTX 3080 Ti): 2 reused and 1 resolved tables, expected 1 and 1; plain main passes. After GuestMemory::Write over entry 11 the other entries are reused, so under the new per-entry counters the table counts as reused. Please update the expectation (and re-check the other Expect calls against the merged head on Linux and Windows) and confirm the test passes without edits to the fixture order.
  • The PR is labeled perf: please paste the aps5-summary.jsonl line of main and of this branch from the same title, scene and machine, plus the tools/trace_digest.py output. The data in the thread so far shows no gain: GTA V frame rate is level (62/61 vs 63/60 presents per 20 s), Onimusha reuses nothing and its [resources] images phase went from 16.9 s to 18.5 s, and in GTA V most misses (237,584 of ~292,000 resolved entries) have no previous table, which this change cannot help. If the gain is only for Wolverine, show that scene's before/after, or drop perf if the change is meant as groundwork.
<!-- greyfinch-sync:boykopovar/AnyPS5:review:5722784555 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6340#pullrequestreview-5722784555). Originally posted by [adriadam10](https://github.com/adriadam10) on 2026-10-31T12:54:14Z. **Review:** CHANGES_REQUESTED --- Thanks for the work. Two things block this: - `core/libs/prx/libSceAgcDriver/tests/execution/ImageTableReuse.cpp:384` ("a driver store over an entry"): @mrfelek reports `agc_driver_image_table_reuse` failing with this PR merged on current `main` (Linux, RTX 3080 Ti): `2 reused and 1 resolved tables, expected 1 and 1`; plain `main` passes. After `GuestMemory::Write` over entry 11 the other entries are reused, so under the new per-entry counters the table counts as reused. Please update the expectation (and re-check the other `Expect` calls against the merged head on Linux and Windows) and confirm the test passes without edits to the fixture order. - The PR is labeled `perf`: please paste the `aps5-summary.jsonl` line of `main` and of this branch from the same title, scene and machine, plus the `tools/trace_digest.py` output. The data in the thread so far shows no gain: GTA V frame rate is level (62/61 vs 63/60 presents per 20 s), Onimusha reuses nothing and its `[resources]` images phase went from 16.9 s to 18.5 s, and in GTA V most misses (237,584 of ~292,000 resolved entries) have no previous table, which this change cannot help. If the gain is only for Wolverine, show that scene's before/after, or drop `perf` if the change is meant as groundwork.
MarcZX10 commented 2026-11-02 04:56:47 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-02T04:56:47Z.

Review: COMMENTED


Replies checked — key mismatch confirmed by reading, Fixes line missing, no build

The remembered.key mismatch that a reviewer traced is in the code at this head, and the open question is which replay predicate fails, which is still unmeasured.

What I ran

  • Live head a58ce71d12bf06a898f50cb8d1e2bad7c52a7bcd (OPEN, unchanged from batch).
  • gh api comments, review comments and reviews on #6340, newer than 2026-11-01T01:48:05Z, excluding MarcZX10 and bots.
  • gh pr view 6340 --json body,statusCheckRollup.
  • git show a58ce71d:<path> for ShaderResources.cpp and ImageTableReuse.cpp.
  • git log --merges d14a186f..a58ce71d; git merge-tree --write-tree upstream/main a58ce71d.
  • Nothing was built or run.

Results

Check Result Note
Live head matches batch OPEN
merge-tree vs upstream/main exit 0 clean; 13029 behind, 9 ahead
Merge commits in branch 1 (5cf07f861d) confirmed
PR body vs template Fixes: line missing template L16
Hosted conventions SUCCESS others SKIPPED

Findings

  • @ntamas94 (2026-11-01 17:44 UTC): the reused element is cached under sampledWords (ShaderResources.cpp L4987) but remembered with words (L4997). The cache lookup (findTexture, L1789) uses element.key, so narrowed elements miss. Confirmed by reading. Not reproduced. The key change is your call.
  • @Dextroid17 (2026-11-01 18:13 UTC): reports agc_driver_image_table_reuse (lavapipe) fails on this merge with "2 reused and 1 resolved tables, expected 1 and 1". The message format matches ImageTableReuse.cpp L241. Not verified here; no build.
  • @Dextroid17 asks which replay predicate fails and offers per-predicate counts. Your call. The predicates are TableCurrent and CachedTableTextures (ShaderResources.cpp L1767-L1792).
  • @fogydes (2026-11-01 12:27 UTC): clean merge with upstream/main, confirmed. Merge commit 5cf07f861d in history, confirmed. Missing Fixes: line, confirmed: the body has no such line, and the template has it at L16.

Sources

Not verified

  • The lavapipe failure, the Ghost of Yotei timings and counters, and the per-predicate question.
  • Any build or test result.
  • The pairwise merge checks against #6867, #6905, #6913 and #6921 claimed by fogydes.
<!-- greyfinch-sync:boykopovar/AnyPS5:review:5732245406 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6340#pullrequestreview-5732245406). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-02T04:56:47Z. **Review:** COMMENTED --- # Replies checked — key mismatch confirmed by reading, Fixes line missing, no build The `remembered.key` mismatch that a reviewer traced is in the code at this head, and the open question is which replay predicate fails, which is still unmeasured. ## What I ran - Live head `a58ce71d12bf06a898f50cb8d1e2bad7c52a7bcd` (OPEN, unchanged from batch). - `gh api` comments, review comments and reviews on #6340, newer than 2026-11-01T01:48:05Z, excluding MarcZX10 and bots. - `gh pr view 6340 --json body,statusCheckRollup`. - `git show a58ce71d:<path>` for `ShaderResources.cpp` and `ImageTableReuse.cpp`. - `git log --merges d14a186f..a58ce71d`; `git merge-tree --write-tree upstream/main a58ce71d`. - Nothing was built or run. ## Results | Check | Result | Note | |---|---|---| | Live head | matches batch | OPEN | | `merge-tree` vs upstream/main | exit 0 | clean; 13029 behind, 9 ahead | | Merge commits in branch | 1 (`5cf07f861d`) | confirmed | | PR body vs template `Fixes:` line | missing | template L16 | | Hosted `conventions` | SUCCESS | others SKIPPED | ## Findings - @ntamas94 (2026-11-01 17:44 UTC): the reused element is cached under `sampledWords` (`ShaderResources.cpp` L4987) but remembered with `words` (L4997). The cache lookup (`findTexture`, L1789) uses `element.key`, so narrowed elements miss. Confirmed by reading. Not reproduced. The key change is your call. - @Dextroid17 (2026-11-01 18:13 UTC): reports `agc_driver_image_table_reuse` (lavapipe) fails on this merge with "2 reused and 1 resolved tables, expected 1 and 1". The message format matches `ImageTableReuse.cpp` L241. Not verified here; no build. - @Dextroid17 asks which replay predicate fails and offers per-predicate counts. Your call. The predicates are `TableCurrent` and `CachedTableTextures` (`ShaderResources.cpp` L1767-L1792). - @fogydes (2026-11-01 12:27 UTC): clean merge with upstream/main, confirmed. Merge commit `5cf07f861d` in history, confirmed. Missing `Fixes:` line, confirmed: the body has no such line, and the template has it at L16. ## Sources - https://github.com/boykopovar/AnyPS5/blob/a58ce71d12bf06a898f50cb8d1e2bad7c52a7bcd/core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp#L4987 - https://github.com/boykopovar/AnyPS5/blob/a58ce71d12bf06a898f50cb8d1e2bad7c52a7bcd/core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp#L4997 - https://github.com/boykopovar/AnyPS5/blob/a58ce71d12bf06a898f50cb8d1e2bad7c52a7bcd/core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp#L1767-L1792 - https://github.com/boykopovar/AnyPS5/blob/a58ce71d12bf06a898f50cb8d1e2bad7c52a7bcd/core/libs/prx/libSceAgcDriver/tests/execution/ImageTableReuse.cpp#L241 - https://github.com/boykopovar/AnyPS5/blob/a58ce71d12bf06a898f50cb8d1e2bad7c52a7bcd/.github/pull_request_template.md#L16 ## Not verified - The lavapipe failure, the Ghost of Yotei timings and counters, and the per-predicate question. - Any build or test result. - The pairwise merge checks against #6867, #6905, #6913 and #6921 claimed by fogydes.
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

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

Merge

Merge the changes and update on Forgejo.

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

git switch 'main'
git merge --no-ff 'upstream-pr/6340'
git switch 'upstream-pr/6340'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/6340'
git switch 'upstream-pr/6340'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/6340'
git switch 'main'
git merge --squash 'upstream-pr/6340'
git switch 'main'
git merge --ff-only 'upstream-pr/6340'
git switch 'main'
git merge 'upstream-pr/6340'
git push origin 'main'
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
boykopovar/AnyPS5!6340
No description provided.