Repository navigation
Conversation
…y reads through The SRT evaluator records every raw read with the user-data word its address is based on, and marks a word used as a plain value. The result also names the user-data word behind each shader-data dword. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A draw whose user-data words differ only in pointers the capture read through looks up an alias key built from the contents behind them, shifts the cached variant's runs by the pointer delta, validates them by value and patches the forwarded shader-data words. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…d user words Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A pixel shader loads its colour through a user-data pointer. Drawn from a third address with the same contents it hits the cached draw; with other contents it does not; the addresses seen before still hit exactly. AI-assisted (Claude Code). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… user words Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…d again With APS5_VERIFY_DRAW_ENTRIES=1 every hit is captured again, so drawHit is false and no relocated hit counted for its shader set's trial, which judged every set unproductive and turned the relocation off under the very mode meant to check it. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…; patch relocated push constants without copying the result Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…first Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…prepared shader A stage's donor is found by its prepared shader, its own user words and the contents behind its relocatable words, so a texture learned under one state serves every state. A draw whose first stages validate reuses them when a later stage misses, and a known decode is reused on a miss. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…moved The recompiler reports the captured words that are a buffer descriptor's base address and nothing else (never an operand of the walk), and where each lands in the result. Validation masks them, and a hit that differs only there patches the new addresses into a copy of the result. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…thout a copy Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…utside merged programs Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A pixel shader loads a buffer descriptor through a user-data pointer and reads its colour from that buffer. Drawn again with the descriptor's base address changed, with the same or other contents, it hits the cached draw; with APS5_NO_DRAW_RELOCATION=1 it does not. AI-assisted (Claude Code). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… slots Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…e shader as values A pushed user word the resource walk never reads (RADV's base-vertex SGPR, new on every draw) took part in the draw key and the relocation alias, so a shader set whose pointers moved could never match. Such words are learned beside a set's pointer words as forwarded: left out of the alias, accepted on a relocation and patched into the pushed data like a moved pointer. A set without any pointer word, and a relocation that cannot reuse every stage, leave the draw to main's data-only path. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
… draw with the word patched Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Every relocated stage was deep-copied into a fresh variant and a fresh entry built, nine heap allocations a stage, on every draw whose pointers moved. The clones and entries now come from a small pool that keeps their vectors' capacity, returned when the last reference drops, and the per-stage move and patch lists are thread-local scratch. On Ratchet & Clank under RetroArch's PCSX2 core, 31 fewer heap allocations per draw out of 167. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
|
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.
|
|
Tested on Linux (Arch), With the dependencies from the description (#4943 and #5609) merged first,
AI-assisted: yes |
|
Root cause of the Reproduced on Linux (Arch), RX 9070 XT (RADV, Mesa 26.2.4), Release, PR head
Fix tested on the same head: make both pools immortal, the same pattern as other process-lifetime singletons in the driver: RelocationPool<DispatchVariant>& variantPool() {
static auto* pool = new RelocationPool<DispatchVariant>();
return *pool;
}
RelocationPool<DrawEntry>& entryPool() {
static auto* pool = new RelocationPool<DrawEntry>();
return *pool;
}With this change AI-assisted: yes (Claude Code) |
|
Rebase handoff + independent confirmation of the abort — rebased onto current Verified on Linux (CachyOS, kernel 7.2.9, GCC 16.2.1, Ninja, Release,
To pick it up: Head is |
|
Correction on the |
|
Reviewing this for a possible 007 Windows cross-test after our current loading probe. Public baseline63ec3b290 is mainca13a56a5 plus the title's carried fixes and #6616; 150 selected native checks pass, one Linux-only import case skips. Menu remains1.911FPS, GPU180.25ms/present, so there is still substantial CPU preparation cost. Recent menu report: GitHub reports current heads #6539=12a5f02d and #5609=09238da8 conflict with main. Do you have a newer current-main rebase/WIP to use before I duplicate that integration work? I can review/adapt meanwhile; no title data needed. Overlap to preserve: our #7508 at858c36315 replaces the per-word tagging scan in tagVariantRuns with ForEachRelocationRun; it retains #6454's AppendSharedWords first inside each emitted partition callback. SleglJan already cross-tested that combination on Linux and noted your adjacent edit. Public integration has that same partitioning. Any combination needs both provenance/shared-word handling and the forwarded-value patches, with the existing changed-green readback control kept. I will report exact heads and native/title evidence for an actual test. AI-assisted: Codex; raw title data remains local. |
|
Thanks for this. Two things before it can be reviewed:
|
|
Additional local integration evidence for the pool-lifetime and current SRT metadata concerns above (AI-assisted: yes). I combined PR head
After these adaptations, seven focused tests passed five repetitions each (35 executions): shader disk cache, moved buffer, relocation, and draw-cache reuse/default-off/verify/inline. Linux/RADV, Hades II native controls also completed, but do not establish a forwarding performance benefit or regression. An initial cold-cache run had black timed captures during a long frame stall; a later ordinary-settings repeat rendered the hub. The cache conditions differed, so the initial black captures should not be attributed to forwarding from these runs. This does not settle the general value-only rule or replace the requested current-main rebase/review. |
|
The repair source is now available on JJenkx/AnyPS5, The relevant repairs are:
Matched focused validation on Arch Linux / AMD Radeon RX 6650 XT / RADV 26.2.4:
Both runs used: ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 \
VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation \
ctest --test-dir build-full -R '^(agc_shader_memory|agc_driver_draw_(data_hit_user_words(_verify)?|cache_relocation|cache_moved_buffer)|agc_shader_disk_cache)$' -VThe moved-buffer test is absent on main; the other five test names match. Conventions checks pass. These results establish focused correctness coverage, not a title FPS improvement. AI-assisted: yes. |
|
A matched Hades II measurement is now available for the integration branch above (AI-assisted: yes). This pair does not show a speedup. Baseline Both legs used identical starting save hashes, the same inputs and rendered Underworld room, separate initially empty shader/Mesa caches, the same hardware and trace settings (
The official summary reports The complete official summary lines, full source pins and comparison conditions are in comparison.json. Full traces are retained locally. Next I will investigate preparation/lookup costs before proposing any speed claim. |
|
A bounded-cache correctness follow-up is available in 198bca0fd0 on the existing integration branch. AI-assisted: yes. This depends on the relocation stack; it is not an isolated patch against main or a performance claim.
The regression exercises both stage and decode donor maps: updates at capacity preserve every other key and replace payloads; repeated new insertions retain the newest entry, stay within the bound, and account for evictions. The unconditional-pruning negative control fails with Full Linux Hades II PPSA36082 also reached the expected Underworld room, then closed normally after 188 seconds; PID gone and kernel setting restored. Warm shader cache: 199 hits, zero misses. The sparse screenshot shows no obvious new corruption. Instrumented timings vary, so no title speedup is claimed. Native core validation was not requested; the validation result above applies to the focused tests. |
|
Matched measurement of the integration branch on another title and platform, where the miss pattern is exactly what this stack targets. It shows no gain; the candidate is slower here. AI-assisted: yes. Setup
This scene issues ~1,650 draws per frame. With
Candidate data-only hits per 10 s: 219k stages reused, 530k compiled, against 208k/611k on main. So the relocation path converts a few more lookups, but on this title the per-draw cost it adds outweighs that. That matches the earlier per-draw content hashing concern. The queue worker stays ~90 % busy in both builds, and the frame is worker-bound. Summaries are in my local evidence; I can share the |
What
Third step for #4054, stacked on #5609. A user-data word that the resource walk never reads, and that the compiled stage only receives as a pushed value, still took part in the draw key and in the relocation alias. RADV's base-vertex SGPR is one: it changes on every draw, so a title whose draws would otherwise relocate across its moved pointers missed on every draw anyway. On Ratchet & Clank under RetroArch's PCSX2 core, 0.1% of draws hit the cache.
shaderDataUserWords) the resource walk did not read at all:DispatchVariant::forwardedWords.forwarded. They stay out of the alias key, a relocation accepts any change to them, and the new value is patched into the pushed data the same way a moved pointer's value is.main's data-only path (perf(agc): cache a draw key the second time it is seen #5216's shape reuse), which already owns that case. A relocation that finds the draw's decode but not every stage also gives way to that path when it applies, instead of claiming the draw with an incomplete entry.APS5_NO_FORWARDED_RELOCATION=1turns the forwarded words off;APS5_NO_DRAW_RELOCATION=1still turns the whole thing off.Related: #5656 (on #494) lets a data-only hit reuse a stage whose changed user words it never reads; it counts the words a layout forwards into shader data as read, so a changed forwarded word still recompiles the stage there. This PR patches such a word on the relocation path instead. The two touch different paths and no shared code.
Only the commits after #5609's head are this PR.
Tested
Windows 11, NVIDIA GeForce RTX 5070 Ti, MinGW-w64 GCC 15.2.0, on main
940eba9a2with #4943 and #5609.ctest: 1271 of 1292 pass, 14 skipped.guest_call_trace_abort,windows_backtrace_reportandagc_driver_store_over_untrackedfail, and fail the same way on plain main here;agc_driver_prepared_graphics_prebuild_0/_1andundeliverable_host_exceptionfail under my test runner because it skips their environment changes and pass pattern, and pass run with those;agc_driver_multisample_fill_host_onlyfailed once in the parallel run and passes alone.agc_driver_draw_cache_relocation: a pixel shader reads its red channel through a user-data pointer and its green channel from a user word it gets as a value. Eight draws with the same contents at moving addresses and a changing green value hit the cached draw from the fifth on (0 hits withAPS5_NO_FORWARDED_RELOCATION=1), and a hit given green 1.0 writes 255 to the target (64 if the value is not patched: checked by removing the patch).main'sagc_driver_draw_cache_reusecases pass unchanged: their user words are plain values, which still go through the data-only path.operator newimports) 167 to 136, audio produced in the heavy intro scenes 41-43% of real time to 45-47%.APS5_VERIFY_DRAW_ENTRIES=1, which captures every hit again and compares: 0 stages differed; the last four 10 s windows of the run captured 868,744 hits again.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt.mdfiles or images added to the repository (attach them to this PR)🤖 Generated with Claude Code