Repository navigation
perf(agc): reuse completed write observations across overlapping ranges - #17542
Merged
oneandonlydean merged 3 commits intoNov 9, 2026
Merged
oneandonlydean merged 3 commits into
oneandonlydean merged 3 commits into
Conversation
|
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.
|
12 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Replace the exact-start per-worker collection memo with an ordered union of completed, page-rounded observations. A fully contained request can reuse the observation even when it starts inside an earlier range, or when several successful adjacent/overlapping walks jointly cover it. Holes still require collection. The union is private to the worker and is discarded whenever its collection epoch, unwatch serial or mapping generation changes. Failed walks never publish coverage; fresh/uncached collection, the 64-entry ring and shared-memo mode retain their behavior. Lockless hits return the last fully published
tracker.stablegeneration, not a concurrent walk's generation.Reject wrapped page-rounded bounds before all memo lookups. The new extreme-address regression exposed an existing ring-cache hit for a wrapped range.
No descriptor-content check, CPU/GPU write stamp, backing lifetime, resource residency check or GPU dependency is removed. There are no title-specific addresses, exceptions or new switches. This is a small observation-layer change, separate from descriptor-heap and write-subscription PRs.
The branch is based on main
0bae53facde88e56d2859f4d39cece93c9aab761; final head99c145ed4684f18c1b82086348bfd70273d78d5a. The captured integration uses pinned main095ff72367c43bd3111f5c96ff56d87a720cd8f2. The subsequent main commits change title-run tooling and unrelated voice/text-to-speech libraries; AGC, shader recompiler, libc and libkernel source are identical across those main bases.Tested
Windows 11 build 26200, Release, WinLibs GCC 15.2.0; Ryzen 5 5600, 16 GiB RAM; NVIDIA GeForce RTX 5070, NVIDIA driver 616.64.
Focused validation logs, test results and overlap review are attached with the timing evidence. The identical GPU test selection is run on current main with the regression fixtures and on the final candidate, with
ANYPS5_REQUIRE_VULKAN=1,ANYPS5_NO_SHADER_CACHE=1,VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation,VK_LOADER_LAYERS_DISABLE=~implicit~, usingctest --test-dir C:/Users/playl/AppData/Local/Temp/ap5p15 -R <pattern> -V.The coverage tests exercise interior containment after ring eviction, adjacent ranges in both orders, bridge/overlap/containing ranges, holes, empty/overflowing addresses, new epochs, unwatch/mapping invalidation, a second worker, explicit driver writes and mandatory uncached collection. Existing mapping-history, draw-descriptor and resource-cache tests remain included.
Performance scene: Sniper Ghost Warrior Contracts 2, PPSA03131, 01.004.000, stationary initial tutorial position at 3840x2160. Same machine, original savedata seed, scripted controller inputs and default game settings. Owned title relinked with
--windows --no-patches; offline and dummy audio. Both variants completed warm runs in the same scene before measurement. Retained order A1, B1-retry, A2, B2; onlyAPS5_TRACE_SECONDS=240:40and its output directory enabled for timing. No diagnostic profiling switches, game-log redirection, frame dumps, compilation, GPU tests or overlap scans during retained captures. B1 was closed accidentally by the user before its capture completed; it produced no completed timing window and is explicitly excluded, then repeated in place.Pure main stops at the tutorial's independent dual-source MIN blend, so gameplay comparison uses identical prerequisites on both sides: #17187, #17157, #16286 and #17255. A is clean integration
504135cf2b198ffca60257e6fffe4bcc13d3b15e; B isa2ab9931fac4cdd1ee7e7c4453a7e4a51b02659a. Production source differs only in this PR'sGuestMemory.cpp, which is identical to the final public implementation. All staged libraries exceptlibSceAgcDriver.prxare byte-identical. The fork'sperf/sniper-observation-coveragebranch contains both integration commits. These common title prerequisites are not carried in this PR.The two pairs show +3.25% and +2.49% mean FPS in this scene. This is a modest repeated scene-specific gain; no title unlock, campaign-wide gain or reduction in worst-frame latency is claimed. Tails vary in both directions between runs.
tools/performance_compare.py --require-matching-contextaccepts both pairs. Event buffers fill early: complete frame summaries are retained, while slice inventories are partial (totals_full=false). Missing event slices are not treated as idle time or full-window scope totals. The digests preserve the warnings.A1,
tools/trace_digest.py:seconds 240:40 from present 10221: 412 presents, frame p50 96.6 / p90 101.1 / p99 108.1 / max 120.5 ms, GPU busy 24.3 ms per present
NVIDIA GeForce RTX 5070, NVIDIA 616.64, Windows 10.0.26200, 3840x2160, commit 504135c, dropped: yes
{"commit":"504135cf2b19","dirty":false,"env":{"APS5_NET_DISCONNECTED":"1","APS5_PAD_INPUT_FILE":"<path>","APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"240:40"},"gpu":"NVIDIA GeForce RTX 5070","driver":"NVIDIA 616.64","os":"Windows 10.0.26200","cpu":"AMD Ryzen 5 5600 6-Core Processor","cpu_threads":12,"memory_mib":16311,"title_id":"PPSA03131","title":"Sniper Ghost Warrior Contracts 2","content_version":"01.004.000","resolution":"3840x2160","window":{"spec":"seconds 240:40","first_present":10221,"ms":40022.045},"presents":412,"frame_ms":{"p50":96.610,"p90":101.070,"p99":108.097,"max":120.521},"gpu_busy_ms_per_present":24.345,"worker_busy_pct":{"queue worker 0x0":96.364},"top_phases_ms_per_frame":{"Driver.Packet":93.579,"Driver.Packet.draw":58.829,"Driver.Draw":58.072,"Graphics.Draw":55.898,"Graphics.Draw.draw_and_resource_release":41.310,"Driver.Draw.shader_compile_and_link":27.433,"Driver.Draw.draw_enqueued":20.518,"Driver.Packet.dispatch":15.634},"trace_dropped":true,"trace_dropped_threads":{"queue worker 0x0":{"events_full_after_s":5.578,"events_lost":1636252,"totals_full":false},"draw committer":{"events_full_after_s":11.521,"events_lost":643399,"totals_full":false}},"trace":"aps5-trace-504135cf2b19-29608.json.gz"}B1-retry,
tools/trace_digest.py:seconds 240:40 from present 6896: 426 presents, frame p50 92.6 / p90 99.0 / p99 124.0 / max 184.3 ms, GPU busy 24.1 ms per present
NVIDIA GeForce RTX 5070, NVIDIA 616.64, Windows 10.0.26200, 3840x2160, commit a2ab993, dropped: yes
{"commit":"a2ab9931fac4","dirty":false,"env":{"APS5_NET_DISCONNECTED":"1","APS5_PAD_INPUT_FILE":"<path>","APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"240:40"},"gpu":"NVIDIA GeForce RTX 5070","driver":"NVIDIA 616.64","os":"Windows 10.0.26200","cpu":"AMD Ryzen 5 5600 6-Core Processor","cpu_threads":12,"memory_mib":16311,"title_id":"PPSA03131","title":"Sniper Ghost Warrior Contracts 2","content_version":"01.004.000","resolution":"3840x2160","window":{"spec":"seconds 240:40","first_present":6896,"ms":40078.026},"presents":426,"frame_ms":{"p50":92.568,"p90":98.955,"p99":124.030,"max":184.302},"gpu_busy_ms_per_present":24.134,"worker_busy_pct":{"queue worker 0x0":96.346},"top_phases_ms_per_frame":{"Driver.Packet":90.608,"Driver.Packet.draw":59.046,"Driver.Draw":58.322,"Graphics.Draw":54.949,"Graphics.Draw.draw_and_resource_release":40.678,"Driver.Draw.shader_compile_and_link":29.292,"Driver.Draw.draw_enqueued":19.368,"Shader.DrawStage":16.347},"trace_dropped":true,"trace_dropped_threads":{"queue worker 0x0":{"events_full_after_s":5.653,"events_lost":1665933,"totals_full":false},"draw committer":{"events_full_after_s":11.763,"events_lost":658586,"totals_full":false}},"trace":"aps5-trace-a2ab9931fac4-1952.json.gz"}A2,
tools/trace_digest.py:seconds 240:40 from present 6905: 415 presents, frame p50 95.0 / p90 103.8 / p99 133.9 / max 147.0 ms, GPU busy 24.3 ms per present
NVIDIA GeForce RTX 5070, NVIDIA 616.64, Windows 10.0.26200, 3840x2160, commit 504135c, dropped: yes
{"commit":"504135cf2b19","dirty":false,"env":{"APS5_NET_DISCONNECTED":"1","APS5_PAD_INPUT_FILE":"<path>","APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"240:40"},"gpu":"NVIDIA GeForce RTX 5070","driver":"NVIDIA 616.64","os":"Windows 10.0.26200","cpu":"AMD Ryzen 5 5600 6-Core Processor","cpu_threads":12,"memory_mib":16311,"title_id":"PPSA03131","title":"Sniper Ghost Warrior Contracts 2","content_version":"01.004.000","resolution":"3840x2160","window":{"spec":"seconds 240:40","first_present":6905,"ms":40052.116},"presents":415,"frame_ms":{"p50":94.982,"p90":103.773,"p99":133.863,"max":146.982},"gpu_busy_ms_per_present":24.277,"worker_busy_pct":{"queue worker 0x0":96.379},"top_phases_ms_per_frame":{"Driver.Packet":92.985,"Driver.Packet.draw":59.623,"Driver.Draw":58.872,"Graphics.Draw":55.785,"Graphics.Draw.draw_and_resource_release":41.318,"Driver.Draw.shader_compile_and_link":27.338,"Driver.Draw.draw_enqueued":21.480,"Shader.DrawStage":15.584},"trace_dropped":true,"trace_dropped_threads":{"queue worker 0x0":{"events_full_after_s":5.503,"events_lost":1619627,"totals_full":false},"draw committer":{"events_full_after_s":11.433,"events_lost":639889,"totals_full":false}},"trace":"aps5-trace-504135cf2b19-4132.json.gz"}B2,
tools/trace_digest.py:seconds 240:40 from present 6839: 425 presents, frame p50 93.6 / p90 97.4 / p99 107.7 / max 128.7 ms, GPU busy 24.3 ms per present
NVIDIA GeForce RTX 5070, NVIDIA 616.64, Windows 10.0.26200, 3840x2160, commit a2ab993, dropped: yes
{"commit":"a2ab9931fac4","dirty":false,"env":{"APS5_NET_DISCONNECTED":"1","APS5_PAD_INPUT_FILE":"<path>","APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"240:40"},"gpu":"NVIDIA GeForce RTX 5070","driver":"NVIDIA 616.64","os":"Windows 10.0.26200","cpu":"AMD Ryzen 5 5600 6-Core Processor","cpu_threads":12,"memory_mib":16311,"title_id":"PPSA03131","title":"Sniper Ghost Warrior Contracts 2","content_version":"01.004.000","resolution":"3840x2160","window":{"spec":"seconds 240:40","first_present":6839,"ms":40019.229},"presents":425,"frame_ms":{"p50":93.621,"p90":97.405,"p99":107.675,"max":128.697},"gpu_busy_ms_per_present":24.256,"worker_busy_pct":{"queue worker 0x0":96.383},"top_phases_ms_per_frame":{"Driver.Packet":90.720,"Driver.Packet.draw":57.293,"Driver.Draw":56.578,"Graphics.Draw":54.803,"Graphics.Draw.draw_and_resource_release":40.638,"Driver.Draw.shader_compile_and_link":27.460,"Driver.Draw.draw_enqueued":19.407,"Shader.DrawStage":15.318},"trace_dropped":true,"trace_dropped_threads":{"queue worker 0x0":{"events_full_after_s":5.455,"events_lost":1652377,"totals_full":false},"draw committer":{"events_full_after_s":11.397,"events_lost":660713,"totals_full":false}},"trace":"aps5-trace-a2ab9931fac4-7524.json.gz"}Evidence archive: timing traces, digests, comparisons and validation logs
Final validation: candidate
99c145ed4684f18c1b82086348bfd70273d78d5apasses 12/12; current-main production plus the identical regression fixtures (f6ca157aeca61ebdc9dff356be62265e863aa02b) passes all 9 existing tests, while the 3 new coverage cases fail at their intended reuse/wrapped-range assertions. Neither log hasVUID-errors, a missing requested validation layer or skipped CTest tests. Linux-only fake-watch cases were not run locally; no Linux claim is made.Final overlap check scanned 1,970 open PRs, 28 sharing files. The tool exits 2 for 14 conflicted comparisons: #5021, #6186, #6188, #6192, #6209, #7604, #7642, #10193, #12840, #13928, #13929, #15136, #15529 and #15807. Their full patches were manually reviewed and their fetched heads are unchanged at this final check; none modifies
EpochCollectMap,epochCollectMaporcollectWrites. No duplicate interval-union implementation was found. This does not duplicate #12745's write subscriptions, #17226's content hashes or #9508's descriptor heap/queue batching.python tools/check_conventions.py --base origin/mainwas run as required: the fork's old main comparison reports 123 findings/18 errors in pre-existing upstream changes. The same source check against actualupstream/mainpasses. The final PR title/body are checked against actual main before publication. No fork-main update or unrelated source fix is included.The automatic GitHub checks were queued when opened. A manual full Linux/Windows build dispatch was attempted and GitHub returned HTTP 403: this repository requires administrator rights to dispatch that workflow. The local Windows GPU validation above is completed; no completed full CI build is claimed for this PR.
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)