perf(agc): vertex-stage fetch resources leave same-shape draws unrelocatable (PPSA03524: 96% of blocking user words unmarked) #26595
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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 akkadbakkad89 on 2026-11-24T08:54:36Z.
Summary
On titles that rotate per-draw resource pointers through a descriptor ring (UE4 pattern), the draw data-hit path already reuses the decode for 99.7% of lookups — but the stage variants still re-materialize, because vertex stages carrying fetch resources are categorically ineligible for relocation tagging. The result on GTA: San Andreas (PPSA03524): ~28% of stage slots reuse a donor variant, every draw key is unique,
record.Matchescan never hit, and every draw pays the full ~53 µslocalDevice->Draw()recording path on the committer (~7.1 s of 10 s).The eligibility gate is in
Execution/src/Driver/Draw/DrawCapture.cpp:resourcesNum != 0(or any decode-time read) skipstagVariantRuns/tagUserValueWordsentirely, so the vertex stage'sasBaseuser words are never marked. #13610 added relocation for moved V#s and fetch subroutines in user words, but this gate sits in front of that marking — a stage with vertex fetch resources never reaches it.Measured (PPSA03524, RTX 3070, Windows 11,
maindba06f681a, in-world)[draw-cache]: 133,689 lookups → 154 full hits (0.1%), 133,535 data-only hits;user words/pointers onlyfor essentially every miss[draw-relocate]: 100,351 alias lookups → 154 donors, 0 refusalsdataPositionsempty — no FlattenedSrt bindings in this title)Full datapoint with phase breakdown: https://github.com/boykopovar/AnyPS5/issues/17533#issuecomment-7125377282
Proposed path
tagVariantRuns/tagUserValueWordson vertex stages and extend the relocated/patched variant construction to re-materializevertexInfofetch-resource descriptors from current user words (it isshared_ptr<const>baked state — a relocated variant needs a freshly built one).relocateDrawEntryalready does per-variant — validation, pending-write and gate checks unchanged as the safety net.recompile ~9 µs/drawdrops,Matchesunblocks recipe replay on data hits, and the ~53 µs commit path shrinks accordingly.Validation would follow #13610's precedent:
agc_driver_draw_relocate_*tests extended to a vertex-fetch-resource case,APS5_VERIFY_DRAW_DATA_HITS=1runs, and before/afteraps5-summary.jsonl+trace_digeston the same scene.Caveats
vertexInfois decode-baked state — re-materializing it on a patched variant needs care around fetch-resource rebinding (the same questionMovedDispatchBuffers/PrepareDrawBindingsanswers on the dispatch side, so there may be an established pattern).Related
AI-assisted: yes. Measurements and instrumentation are from this machine (RTX 3070 / Windows 11).