perf(agc): reuse eligible image table entries independently #6340
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/6340"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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
templatedisambiguator for an unrelated baseline expression, which was reverted before commit. After rebasing on currentmain, both changed translation units compile directly.python3 tools/check_conventions.py --base upstream/main --head HEADandgit diff --checkpass.mainand this branch.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)Related: #5961 and #6099.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-15T12:20:56Z.
@Thunderhawkk Could you compare the same Wolverine scene on
mainand 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.Imported from boykopovar/AnyPS5. Originally posted by fdfawef324 on 2026-10-15T13:46:46Z.
The new mixed-DCC case captures
beforebefore both dispatches, but itsExpect(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 == 0eligibility 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.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_reusefails 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. Headef724aad6merged onto mainff23657f3; full build succeeds.agc_driver_image_table_reuse: fails 8/8 with this PR (targeted, broad and 6 serial reruns); passed in both baseline runs on unchanged mainff23657f3on the same machine.Expect(before, 3 - CpuWriteResolutions, CpuWriteResolutions, ...)("a CPU write collected in a new epoch, then two dispatches"). On WindowsCpuWriteResolutionsis 2, so it expects 1 reused / 2 resolved; this branch counts 2 reused / 2 resolved, one reused table more than expected. Linux usesCpuWriteResolutions = 1; I have not run Linux, so I do not know whether it fails there.Expect(before, 1, 1, ...)questioned above, did not run here.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 isagc_driver_store_over_untracked(#6347/#6383), also on main.No performance measurement.
AI-assisted: yes (runs done with Claude Code).
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
mainand 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 + #6194vs 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.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:
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.
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:
main0afa6a607plus the title's open PRs (#5907 #5776 #5770 #5703 #5841 #5884 #5915 #5815).ef724aad6cherry-picked cleanly on top. Scene: boot to the language menu, 150 s,APS5_PROFILE_DRAW=1, warm shader cache.[textures])[resources]images phaseThe change reuses nothing in this title. I added local counters (not for merging) at the eligibility test in
resolveImageTablesto see why:looked->generation == 0and 8276 hadlooked->source != nullptr. None had compressed keys or adccAddress. Reusable: 0.RememberTablenever ran.epochwas never 0, andCurrentTableState() != statehappened 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 reportsuntracked 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.
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:
mainplus #5998 (base), and the same plus this PR at headef724aad6. Both built fromorigin/mainwith 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.[resources]images phaseef724aad6[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.AI-assisted; the runs are from my machine.
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:
mainplus #5998 plus this PR at headef724aad6, 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 splashWhere 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.reusableexpression. The totals are per element over the run, not per table.source != nullptr)generation == 0)epoch == 0)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.
Imported from boykopovar/AnyPS5. Originally posted by mrfelek on 2026-10-15T16:59:16Z.
agc_driver_image_table_reuseon Linux: fails with this PR at headef724aad6System: Linux, Ryzen 9 5950X, RTX 3080 Ti (NVIDIA 615.71.09), GCC 15, Release
Build:
origin/mainatb576c3d5a(current main with this PR's head merged on top, no other changes),ANYPS5_ENABLE_SPIRV_TOOLS=OFF, targettests/agc_driver_image_table_reuse_testsResult
The test exits with code 1. The failing check is:
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.
Imported from boykopovar/AnyPS5. Originally posted by mrfelek on 2026-10-15T17:01:54Z.
agc_driver_image_table_reuseon Linux: the Windows check passes hereSystem: Linux, Ryzen 9 5950X, RTX 3080 Ti (NVIDIA 615.71.09), GCC 15, Release
Build:
origin/mainatb576c3d5aplus this PR's headef724aad6, no other changes.The check reported from Windows
The case
a CPU write collected in a new epoch, then two dispatches(line 338 ofImageTableReuse.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
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.
Imported from boykopovar/AnyPS5. Originally posted by mrfelek on 2026-10-15T20:42:34Z.
agc_driver_image_table_reuseon Linux: still fails at headef724aad6Setup
ef724aad6, clean worktree of the PR head, ReleaseResult
agc_driver_image_table_reuse_tests: exit 1image 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 2This matches the run I posted at 16:59. The head is unchanged since then.
AI-assisted; the build and run are from my machine.
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 resolvedresult 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 --checkpass. 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 rerunagc_driver_image_table_reuseon 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.Imported from boykopovar/AnyPS5. Originally posted by mrfelek on 2026-10-15T22:29:26Z.
agc_driver_image_table_reuseon Linux at head64a5a024a: a different case failsSetup
64a5a024a, clean worktree of the PR head, ReleaseResult
agc_driver_image_table_reuse_tests: exit 1image 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 1The case from the earlier head (
3 reused / 2 resolved, expected2 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.
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); the3 reused / 2 resolvedtotal 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 commit7edfb19f7and pushed it.git diff --checkand 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?Imported from boykopovar/AnyPS5. Originally posted by mrfelek on 2026-10-15T23:43:45Z.
agc_driver_image_table_reuseon Linux at head7edfb19f7: a different case failsSetup
7edfb19f7, clean worktree of the PR head, ReleaseResult
agc_driver_image_table_reuse_tests: exit 1image table reuse: a table whose images include a separate tracking block: 1 reused and 2 resolved tables, expected 1 and 1The 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.
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,RunSelectivePendingWriteexpects1 reused / 1 resolvedacross its two dispatches (entry 23, then entry 5). The run gives1 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.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-16T11:22:03Z.
I traced the
RunSelectivePendingWritecounts and updated the first expectation in commit1c42a9c66.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 expects1 / 1: that single dispatch reuses clean siblings and resolves only the pending entry.git diff --checkandtools/check_conventions.py --base upstream/mainpass. 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 head1c42a9c66to confirm the updated expectation and the later case?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 andgit diff --checkpass; I could not run this Vulkan fixture locally because this host fails the emulator's CPU-feature gate before Vulkan setup. Could you rerunagc_driver_image_table_reuseon the new head?On the storage-backed views: excluding
looked->source != nullptris 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.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@517d4cce9a37018082325b50aab3dcab58f285d2combines current #64541752c4a89(including #6537), current main66e290f1c, #6340b05c53750, #6567544e7afb3, #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: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.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.
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
d367300b6on the current PR head:Validation on Linux: the
agc_driver_image_table_reuse_teststarget 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 rerunagc_driver_image_table_reuseond367300b6when convenient and report whether the updated checks pass?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.
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.
Imported from boykopovar/AnyPS5. Originally posted by mrfelek on 2026-10-16T20:03:10Z.
Reran
agc_driver_image_table_reuseond367300b6alone (PR head, base31cbb55d7), Release,BUILD_TESTING=ON,ANYPS5_AGC_EXECUTION_TESTS=ImageTableReuse:a pending write invalidating one table element while its siblings remain reusable: 0 reused and 1 resolved tables, expected 1 and 1.Cause on Linux:
RunSelectivePendingWritereusesblock, whichRunTestsalready 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
RunSelectivePendingWritea freshGuestBlock, and expect1, 1for the first pair, since on a clean block the second dispatch reuses the whole table: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.
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
blockafterRunTestshad 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 ownGuestBlockand 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 as84ebd666a.git diff --checkand conventions pass. I did not run the GPU test locally.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-18T03:12:20Z.
Rebased this branch onto
2626e5ee7(current upstream main) and resolved theShaderResources.cppoverlap 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.cppandImageTableReuse.cpp;git diff --checkpasses. 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.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 removesReusedTable::queriesand replaces the whole-table proof inTableCurrent; #6937 currently checks the recorder's pending copied-buffer-write snapshot against those queries before accepting the unchanged guest-memory generation. This is separate fromStorageTexture::PendingSerialand 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.
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::PendingSerialand 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 onmain.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.
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.
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.
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
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
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.
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 onmainand one with the change, from the same title, scene and machine, as the Performance report form asks. Please paste bothaps5-summary.jsonllines, attach the two traces and add the output oftools/trace_digest.py.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-20T10:03:19Z.
I updated this branch to current
mainand 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.cppandImageTableReuse.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.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.
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.
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 reportsagc_driver_image_table_reusefailing with this PR merged on currentmain(Linux, RTX 3080 Ti):2 reused and 1 resolved tables, expected 1 and 1; plainmainpasses. AfterGuestMemory::Writeover 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 otherExpectcalls against the merged head on Linux and Windows) and confirm the test passes without edits to the fixture order.perf: please paste theaps5-summary.jsonlline ofmainand of this branch from the same title, scene and machine, plus thetools/trace_digest.pyoutput. 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 dropperfif the change is meant as groundwork.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.keymismatch 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
a58ce71d12bf06a898f50cb8d1e2bad7c52a7bcd(OPEN, unchanged from batch).gh apicomments, 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>forShaderResources.cppandImageTableReuse.cpp.git log --merges d14a186f..a58ce71d;git merge-tree --write-tree upstream/main a58ce71d.Results
merge-treevs upstream/main5cf07f861d)Fixes:lineconventionsFindings
sampledWords(ShaderResources.cppL4987) but remembered withwords(L4997). The cache lookup (findTexture, L1789) useselement.key, so narrowed elements miss. Confirmed by reading. Not reproduced. The key change is your call.agc_driver_image_table_reuse(lavapipe) fails on this merge with "2 reused and 1 resolved tables, expected 1 and 1". The message format matchesImageTableReuse.cppL241. Not verified here; no build.TableCurrentandCachedTableTextures(ShaderResources.cppL1767-L1792).5cf07f861din history, confirmed. MissingFixes:line, confirmed: the body has no such line, and the template has it at L16.Sources
github.com/boykopovar/AnyPS5@a58ce71d12/core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp (L4987)github.com/boykopovar/AnyPS5@a58ce71d12/core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp (L4997)github.com/boykopovar/AnyPS5@a58ce71d12/core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp (L1767-L1792)github.com/boykopovar/AnyPS5@a58ce71d12/core/libs/prx/libSceAgcDriver/tests/execution/ImageTableReuse.cpp (L241)github.com/boykopovar/AnyPS5@a58ce71d12/.github/pull_request_template.md (L16)Not verified
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.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.