Repository navigation
Conversation
|
@Thunderhawkk Could you compare the same Wolverine scene on |
|
Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.
|
|
The new mixed-DCC case captures 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 Please check the resolved-count expectation and both texel readbacks in the native test. This is a source review of |
|
Windows NVIDIA run, since the host CPU guard stopped the test on your machine: 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,
No performance measurement. AI-assisted: yes (runs done with Claude Code). |
|
@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, One caveat first: on plain
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. |
|
Onimusha: Way of the Sword (PPSA27836) data, Windows 11 26200, RTX 5070 (NVIDIA 617.42), WinLibs GCC 15.2, Release. Base:
The change reuses nothing in this title. I added local counters (not for merging) at the eligibility test in
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 AI-assisted: measured with Claude Code. The counters were a local diff, removed after the runs. |
Wolverine (PPSA03671): image-table counters on this PR, from the splash phaseSystem: Linux, RTX 3080 Ti 12 GB (NVIDIA 615.71.09)
AI-assisted; the runs are from my machine. |
Wolverine (PPSA03671): why most image-table elements are not reused on this PRSystem: Linux, RTX 3080 Ti 12 GB (NVIDIA 615.71.09) Where the elements goThe counters record, for each element that reaches the reuse check, the first condition it fails, in the order of the
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 authorShould 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. |
|
|
|
ef724aa to
64a5a02
Compare
|
@MarcZX10 One thing at head a58ce71 that may be part of the counter shift reported above, from reading The element's texture is looked up with the narrowed words: const auto sampledWords = firstLayerWords(words, binding.imageShapes.at(element), narrowed, true); // :4975
...
texture = cachedTexture(context, sampledWords, resource, components, guestBytes, depthCompare, multisampleViewType);but the remembered entry is keyed with the raw words: remembered.key = MakeTextureKey(context.device, words, components, depthCompare); // :4997
This is from reading the code only; I have not run the branch. The title I am looking at (Crysis Remastered, CUSA18659) uses no image tables ( AI-assisted: yes |
Ghost of Yōtei: the
|
| build | reused | resolved | replayed |
|---|---|---|---|
A, main |
393 | 2,137 | 773 |
| B, this PR | 148 | 1,129 | 0 |
B + sampledWords key |
137 | 1,137 | 0 |
These are the cumulative values on each run's last summary line. They level off early: A was already at 383 / 1,990 / 751 by 96 s. replayed is 0 on every summary line of both B runs (27 and 29 lines). Across six other runs of plain B, the final reused value ranged from 122 to 141. So 148 → 137 is within run-to-run noise. I did not count how many elements firstLayerWords narrows in this title. So this shows only that the key change alone does not restore replay here. It may still be right for narrowed elements.
2. Same counters on main at f2d874c1fd (tip when run)
This confirms the 0-replay result from my previous comment on a newer main. f2d874c1fd does not change ShaderResources.cpp from f1a7b02028, and the PR still merges cleanly. One run per arm:
| build | reused | resolved | replayed |
|---|---|---|---|
A, main |
394 | 2,144 | 789 |
| B, this PR | 122 | 1,129 | 0 |
agc_driver_image_table_reuse (lavapipe) fails on this merge with the same message: a driver store over an entry: 2 reused and 1 resolved tables, expected 1 and 1.
3. Load-phase timing (main at f1a7b02028, 4 runs per arm)
This is the [resources] images took N ms (33673 textures …) phase of the single 33,673-texture resource build: image binding lookups plus image-table resolution. It appears once per run. The order was A B B A A B B A, after one discarded warm-up run per arm. Stock logging, no counter patch, and B is this PR without the key change. I did not repeat the timing on f2d874c1fd.
| pair | A | B | B vs A |
|---|---|---|---|
| 1 | 49,519 ms | 56,072 ms | +13.2% |
| 2 | 46,725 ms | 49,441 ms | +5.8% |
| 3 | 51,466 ms | 61,084 ms | +18.7% |
| 4 | 56,098 ms | 52,449 ms | −6.5% |
| mean | 50,952 ms | 54,762 ms | +7.5% |
B was slower in 3 of 4 pairs, but A's own runs range over 9,373 ms, which is wider than the 3,810 ms gap. So these runs show neither a speed-up nor a clear slowdown in this phase. Presents were 468–480 in every run, and there were no DEVICE_LOST lines, Xid errors or crashes across the 8 runs. I have tools/trace_digest.py output for all 8 runs and can attach it.
@MarcZX10 so in this title, the open question from your last check is still which replay predicate fails. If that data would help, I can rerun with a count per predicate on the replay check (cached/reusable elements, replayable, samplers). I can also paste the counter-patch diff.
AI-assisted: yes
|
@Dextroid17 Thanks for measuring the key change. So in Ghost of Yōtei the AI-assisted: yes |
MarcZX10
left a comment
There was a problem hiding this comment.
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 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.- 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.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. - @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 matchesImageTableReuse.cppL241. Not verified here; no build. - @Dextroid17 asks which replay predicate fails and offers per-predicate counts. Your call. The predicates are
TableCurrentandCachedTableTextures(ShaderResources.cppL1767-L1792). - @fogydes (2026-11-01 12:27 UTC): clean merge with upstream/main, confirmed. Merge commit
5cf07f861din history, confirmed. MissingFixes:line, confirmed: the body has no such line, and the template has it at L16.
Sources
AnyPS5/core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
Lines 1767 to 1792 in a58ce71
AnyPS5/.github/pull_request_template.md
Line 16 in a58ce71
Not verified
|
Heads-up from RESIDENT EVIL requiem (PPSA31246) on a Ryzen + RX 9070 XT, 32 GiB RAM. I compared main plus a few pending fixes (#9950, #9999, #12575, #12458, #11630, #15399, #15416, #15499), with and without this PR merged on top. Both runs used the same save, Continue path and env, and lasted 25 minutes each:
So on this title the per-entry reuse makes loading about 3× slower. I haven't profiled where the time goes yet. Separately, on an earlier tree with this PR merged,
That merge had a conflict in |
|
@QRMOE it is not your conflict resolution: a clean merge of AI-assisted: yes |
Validation run (queue item 36) — FAIL on Linux/AMDVerdict: FAIL — Environment
Focused pattern (identical matched set in both trees, 22 tests)
Test commands (both trees, identical env,
|
|
Hi @MarcZX10, a heads-up about how a small change of mine fits with this PR. It is not posted as a PR yet. The maintainer on #25529 asked me to say it here first. What I found. On Marvel's Wolverine (PPSA03671, Windows 10, RTX 3060 Ti 8 GB, Ryzen 7 5700X) the slow part of the game spends about 7 of every 10 seconds binding image tables. In my first full run only 0.5% of the tables were reused. One reason is that some tables hold a pair: a 2D-array entry and a flat 2D entry that share one texture. Those tables were never remembered, so every draw rebuilt them. What my change does. It teaches the remembered table about those pairs, so the table can be reused and the shared texture is bound the same way as a fresh lookup would. It touches the same function as yours ( How well it works (honest version). I ran the fixed build 6 times for about 14 minutes each on the same scene, and the unfixed build once:
Why it is small. Reuse only works when the textures of a table are still in the texture cache and the table is still in the list of 4. In my runs the sampled-texture cache was full (2 GiB budget) and textures kept getting thrown out and rebuilt, and every queue ordering point (about 29 per second) clears the list. So most draws still rebuild their tables. I did not try to change that, because it is shared memory handling and overlaps your work. Is the problem solved by this? Only partly. The pair-table cause is fixed, but the game is still very slow in that scene (about 0.2 frames per second), because of the full texture cache and the table list being cleared often. What is missing, not caused by this change. Two shaders in this game are still refused and I skip them in these runs, so the scene is not fully drawn: Side effect I noticed. Runs of the same build differ a lot from each other (#26053), so one run is not enough to judge a speed change here. Everything is in the issues linked above and in #25529. If you would rather I build on your branch, tell me and I will do that instead. AI-assisted. |
|
@adriadam10 @Dextroid17 @fdfawef324 @ntamas94 — checked against head adriadam10, test expectation ( adriadam10, performance ( ntamas94, key mismatch. Confirmed by reading: Dextroid17, which replay predicate fails. That needs per-predicate counters from a run I did not do. No answer from my side; it stays with the author's measurement. fdfawef324, mixed-DCC expectation. Current head expects Verification from this pass
The PR body still has no |
|
@adriadam10 @ntamas94 Pushed Decisions, one per open item:
Verification:
Not changed in this pass: the mixed-DCC expectation (@fdfawef324) and the per-predicate replay counters (@Dextroid17). |
|
@MarcZX10 this is perf work and stays open, but it cannot pass on 6ed02f9. What I need:
The body also lacks the template Fixes: line. |
|
@oneandonlydean @MarcZX10 on point 3 — my runs, so I measured it. Ghost of Yōtei (PPSA26344), load phase, RTX 3080 Ti, 4K: main at f2d874c vs this PR's head 6ed02f9 merged onto it (merge 4e088bd1dd), with the same per-predicate counters compiled into both builds (local diagnostic patch, one ~7-min run per side, APS5_NO_PIPELINE_BINARIES=1 on both). Eviction isn't it. Slot pressure on the 4-entry list dropped 0 tables on main and 2 on the PR over ~3000 lookups each; the 1039 / 731 "by state change" entries in the raw lines are the state-change flush both builds share, not the list filling up. What Same for Why main never remembers a non-empty table in this phase: of 108,846 per-element checks on the PR side, 51,657 pass, 35,005 fail on Counter lines, zero fields trimmed (M = main f2d874c + counters, P = PR merge 4e088bd1dd + counters; "partial at remember" = partial reuse hits): Current main has already closed this gap from the other side: 92d0ebc (#15563, committed Nov 7, merged Nov 8) gates Caveats: one title, one GPU, load phase only, one run per side cut by the 7-min launcher timeout (so lookup totals differ and only the categorical counts are compared; the earlier M1/P3 pair showed the same split: 767 vs 0 replayed, 1086 vs 1 full). Main stops checking a table's elements at the first one that fails (3,611 element verdicts vs 108,846), so only the PR-side breakdown is complete. AI-assisted: yes |
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.