Repository navigation
perf(agc): keep joined host imports when an address-based build picks a window block - #16130
Conversation
… a window block importRunBounds chose the largest power-of-two window block holding a range even when a joined import already overlapped that block. The block's import retired the join, and the next Upload re-created it, so a game that joins a run across window edges re-imported the same memory every build, bumped the imports epoch each time and never published its address space. Skip a window block that overlaps a joined import and fall back to a smaller block or the single range; a range inside the join then hits the join through findImport. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
|
This pull request is labeled |
|
Windows check of head Setup: Windows 11 Enterprise 22621, WinLibs GCC 15.2 UCRT, Release. The hosted Windows check does not run these tests on pull requests.
AI-assisted: yes. |
✅ NVIDIA GPU test: passedPR head
Failing on main too (3, not counted against this PR)Validation IDs already present on main (9 IDs in 585 tests)Skipped (51)ReproduceAutomated build and test on a contributor's NVIDIA machine; it does not replace upstream CI. A new comment is posted for each new push. Full logs. |
|
Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends 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.
|
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(e772fb2); 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)
{"commit":"45abd7e51ba1","dirty":true,"env":{"APS5_PROFILE_DRAW":"1","APS5_SKIP_REFUSED_DRAWS":"1","APS5_TRACE_SECONDS":"45:25"},"gpu":"NVIDIA GeForce RTX 4060 Laptop GPU","driver":"NVIDIA 617.42","os":"Windows 10.0.26200","cpu":"AMD Ryzen 7 7840HS w/ Radeon 780M Graphics","cpu_threads":16,"memory_mib":15654,"title_id":"PPSA02225","title":"Ghost of Tsushima","content_version":"02.024.000","resolution":"3840x2160","window":{"spec":"seconds 45:25","first_present":312,"ms":25965.515},"presents":62,"frame_ms":{"p50":382.899,"p90":683.308,"p99":1962.104,"max":1962.104},"gpu_busy_ms_per_present":86.182,"worker_busy_pct":{"queue worker 0x0":72.647,"queue worker 0x40":14.831,"queue worker 0x20":73.991,"queue worker 0x48":84.54,"queue worker 0x38":0.0,"queue worker 0x52":0.0,"queue worker 0x30":0.0},"top_phases_ms_per_frame":{"Driver.Packet":1000.394,"Driver.Packet.dispatch":758.121,"Driver.Dispatch":663.441,"Vulkan.Dispatch":345.384,"Vulkan.Dispatch.shader_resources":341.168,"GpuMutex.wait.dispatch":279.42,"GpuMutex.wait.draw":158.368,"Driver.Packet.pipeline_drain":104.205},"trace_dropped":false,"trace":"base-45-25-aps5-trace.json.gz"}{"commit":"45abd7e51ba1","dirty":true,"env":{"APS5_PROFILE_DRAW":"1","APS5_SKIP_REFUSED_DRAWS":"1","APS5_TRACE_SECONDS":"45:25"},"gpu":"NVIDIA GeForce RTX 4060 Laptop GPU","driver":"NVIDIA 617.42","os":"Windows 10.0.26200","cpu":"AMD Ryzen 7 7840HS w/ Radeon 780M Graphics","cpu_threads":16,"memory_mib":15654,"title_id":"PPSA02225","title":"Ghost of Tsushima","content_version":"02.024.000","resolution":"3840x2160","window":{"spec":"seconds 45:25","first_present":480,"ms":25266.792},"presents":146,"frame_ms":{"p50":165.329,"p90":277.152,"p99":614.705,"max":674.703},"gpu_busy_ms_per_present":56.374,"worker_busy_pct":{"queue worker 0x0":58.181,"queue worker 0x40":28.458,"queue worker 0x20":83.404,"queue worker 0x48":76.912,"queue worker 0x38":0.0,"queue worker 0x52":0.0,"queue worker 0x30":0.0},"top_phases_ms_per_frame":{"Driver.Packet":418.796,"Driver.Packet.dispatch":286.358,"Driver.Dispatch":261.059,"Vulkan.Dispatch":130.814,"Vulkan.Dispatch.shader_resources":127.97,"GpuMutex.wait.dispatch":110.929,"Driver.Packet.memory_wait":46.66,"Driver.Packet.pipeline_drain":40.953},"trace_dropped":false,"trace":"join-45-25-aps5-trace.json.gz"}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