perf(agc): keep joined host imports when an address-based build picks a window block #16130
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/16130"
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 sktharunbalaji13-cmd on 2026-11-05T18:31:24Z.
What
importRunBoundschose the largest power-of-two window block holding a range even when a joined import already overlapped that block. Importing that block retired the join, and the nextUploadre-created it, so a title that joins a run across window edges re-imported the same memory on every build, bumped the imports epoch each time and never published its address space (space hits 0,unpublishedequal to the builds).A window block that overlaps a joined import is now skipped and the next smaller block, or the single range, is used; a range inside the join hits the join through
findImport. New regression testimportWindowKeepsJoinTestsinBdaResources.cpp.Tested
Windows 11 26200, AMD Ryzen 7 7840HS, 16 GB RAM, NVIDIA GeForce RTX 4060 Laptop GPU (8 GB), driver 617.42.
Focused tests,
ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation ctest -R "agc_driver_(address_draw_space_reuse|host_import_windows|resident_heap_mirror|graphics|address_space_teardown)" -V:agc_driver_graphicsagc_driver_graphicsfails withAGC graphics: an address-based build imported a window over a joined import and retired it, the other four passVUID-line orwas not found but was requested by env var VK_INSTANCE_LAYERSGhost of Tsushima Director's Cut (PPSA02225), same launch and scene,
APS5_TRACE_SECONDS=45:25,APS5_PROFILE_DRAW=1. Both runs are the same local build (the known-zero scan fix from #15967 that this title needs on 16 GB RAM, a depth capture touch and trace counters) with the joined-import check off formainand on for the change. That tree sits on an oldermain(e772fb25cc); this PR is the same two-file change rebased ontoce694129c4without a rebuild (neither file changed in between).Vulkan.Dispatch.shader_resourcesper frame[address]imports pass per build (late)[address]space hits per 10 s (late)The game is still far from a steady frame rate: the
[address]mirror prepare (41 to 69 ms) and compare (15 ms) per build remain, and this PR leaves them alone.Second pair on clean commits. The two summary lines below this table come from one build whose
commitand dirty state are the same for both runs, so they do not identify the two builds. I repeated the comparison with two local builds of one tree that differ only in the joined-import check:3fe8829a8abfwithout it andd842941d04e3with it. Same title, scene and machine,APS5_TRACE_SECONDS=60:25,APS5_PROFILE_DRAW=1, 145 s runs back to back, game window opened passively (the launcher neither raises nor captures it). The tree is the one above (known-zero scan fix from #15967, trace counters, unmerged depth-surface experiments switched on withAPS5_SOFT_DEPTH_CHECKS=1so the title survives to the window), and neither build contains the change of #16188.3fe8829a8abf3fe8829a8abfd842941d04e3d842941d04e3Without the check the address space is never published (
space hits0 of every 37 or 38 builds) and the imports pass costs 50 and 64 ms per build; with it the imports pass costs 1.4 to 2.3 ms and the space is published for 40 of 62 and 62 of 75 builds. Presents in the 25 s window go from 55 and 38 to 89 and 93 (1.5 and 2.2 fps to 3.6 and 3.7 fps), frame time p50 from 352 and 572 ms to 187 and 184 ms, GPU busy per present from 91.9 and 104.6 ms to 67.0 and 70.8 ms. Every run contains frames of several seconds around its stalls (the slowest frame is 3.2 to 5.5 s in all four), so p99 does not separate the builds. The title is still far from a steady frame rate; this PR leaves the mirror prepare and compare work per build alone.trace_digest.py summary lines of the second pair (without C0a, C0b, then with C1a, C1b)
trace_digest.py summary lines (main, then this PR)
Traces, digests, the fps and
[address]lines of both full runs and both ctest logs: https://github.com/sktharunbalaji13-cmd/AnyPS5/tree/evidence/got-ram-logo/ghost-of-tsushima/join-2026-11-05Traces, digests and logs of the second pair: https://github.com/sktharunbalaji13-cmd/AnyPS5/tree/evidence/got-ram-logo/ghost-of-tsushima/commits-2026-11-06
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)🤖 Generated with Claude Code, OpenCode, Command Code and Gemini