Repository navigation
perf(agc): serve freed host blocks up to 4 KB from a per-thread cache - #24515
Conversation
HostAllocator cached freed blocks only up to 1 KB, so the blocks a draw allocates over that size went to the system heap on every draw: the DrawTail, the patched RecompileResult copy and that copy's binding vector, 1.4 to 3.7 KB each, about 120 k allocations a second on the queue worker of the Sonic Origins S3K page. The size classes now reach 4 KB. A class over 1 KB keeps at most 256 KB of blocks, a thread at most 4 MB of them, and there is no depot for them. Every 65,536 large frees a thread gives back the stock of the classes nothing popped from since the last trim, so classes that are only freed into cannot hold the budget.
MarcZX10
left a comment
There was a problem hiding this comment.
Reviewed — looks good
Nothing blocks this change; the performance evidence is author supplied, and the reviewed allocator logic and tests support merging.
What I ran
Reviewed head 9a8304ae075f10e5e48893c0354d10de080f8c79. Read the prepared description, commit summary, diff and both changed source files using repo_read.py; inspected allocator build references. No commands or tests were run in this review.
Results
| Check | Result | Note |
|---|---|---|
| Diff and source review | passed | Two changed files read |
| Test execution | not run | Results in the description are author reported |
| Performance validation | not run | Traces and measurements were not independently checked |
Findings
Blocking
None.
Non-blocking
None.
Not verified
The PR description reports Windows allocator tests and convention checks passing, plus same-scene performance measurements; these were not run or independently verified. The prepared file manifest lists both changed files as included, and both full texts were read. No files.json was available in the review folder, so excluded-file details were not verified.
To get this to a good state
Nothing is required.
What
The host allocator caches freed blocks per thread only up to 1 KB. On the Sonic Origins S3K menu page every draw allocates blocks over that on the queue worker: the
DrawTail(1568 B with its control block), the patchedRecompileResultcopy's control block (2136 B), that copy's three-bindingDescriptorBindingvector (1368 B), and a 3680 B block on one draw in five. That is about 120 k allocations per second, all freed on the same thread, and each one goes to the system heap (malloc, about 125 ns). In the sampler it is 58 and 48 of the worker's 3,843 samples in two windows of main (1.5 and 1.25%); their frees add about 0.4%. The draw's commit closure (680 B) is already under the cache limit.This change extends the size classes from 1 KB to 4 KB for blocks the cache keeps:
What did not work first. A 512 KB budget with a trim that counted a free as use served only 3 to 14% of the worker's allocations of the four hot classes: blocks that were only freed into never looked idle and filled the budget (
failbudgetwas 95% of the misses). Counting pops only fixed it, and then the hot classes needed a few MB, which is where the 4 MB limit comes from (high-water stock per class on the worker: 1568 B 72 blocks, 2144 B 58, 1376 B 526, 3680 B 451).What it does and does not show. The worker's over-1 KB allocation path leaves its top call sites and its allocator share falls by about 1 point (below). The committer's allocator share rose by about 0.5 point in the sampler, and the frame difference is inside the run-to-run noise of this scene (main alone spans 17.13 to 17.68 FPS in sampler windows and 17.99 to 18.48 in traced runs). One point of worker time is about 0.6 ms of a 58 ms frame, so even if all of it reached the frame the gain would be about 1%, below what four pairs can resolve. I am proposing it for the drop in the targeted work, not for a measured frame-rate gain.
Memory. At most 4 MB per thread for blocks over 1 KB, held only by threads that free such blocks (here the queue worker, the draw committer and one more thread). A thread that ends gives its blocks back to the heap, as before for the small classes.
Overlap:
tools/pr_overlap.pyover 2,267 open PRs finds one that shares a file: #16753 adds an include at line 1 oftests/HostAllocator.cpp, next to the<algorithm>include this change adds (a one-line textual conflict for whichever lands second). No open PR touchesHostAllocator.cpp. The commit merges cleanly onto maine481b135558f, 27 commits after the measured base, none of them in the allocator files.Tested
Windows 11 (10.0.26300), NVIDIA GeForce RTX 2080 Ti (driver 610.88), Intel Core i9-9900K. Sonic Origins (PPSA05324) menu on the S3K page, 3840x2160, default environment. Measured commits: main
42f6354612c9and this commit (9a8304ae075f) on top of it, built in the same build directory; no other PR or commit is needed. In traced runs 1 and 2 the change ran as the same diff before it was committed (the trace saysdirty).Census (counting build on the same page, not part of this PR): worker, 35.9 k draws per second, allocations over 1 KB per draw: 1568 B 1.00, 2136 B 1.00, 1368 B 0.96, 3680 B 0.20, every one freed on the worker. Committer: 1 to 2 KB blocks at 14 k per second (1984 B 7.4 k, allocated and freed on the committer).
Sampler (
APS5_SAMPLE_WORKERandAPS5_SAMPLE_COMMITTER, one 60 s window per arm on the S3K page, 3,843 samples per thread, two orders; system DLL time is charged to the driver frame that called it):operator new+operator delete, with what they calloperator newinto the system heap (samples)operator new+operator deleteDrawPipeline::EnqueueWindow 1 ran the PR first and main second; window 2 the reverse. The sampler suspends each thread about every 20 ms and lowers the FPS it reads by about 0.6.
Traced runs (
APS5_TRACE_SECONDS=200:15, same page, quiet machine, eight runs in four pairs, both orders; walker FPS, thentools/trace_digest.pyframe times and GPU busy per present):The pairs read +1.8, +2.5, -1.1 and +0.9% in FPS. The PR's p99 is worse by one 122 ms stall in run 4. In the retained trace events the queue worker is busy 12.70 ms per frame (main) against 12.65 (PR) and the draw committer 24.62 against 24.43: inside the noise. The worker's trace buffer fills after about 5.8 s and the committer's after about 14 s in every run, so per-thread slice times cover retained events only. The eight traces are attached as one zip per run (listed after this paragraph); the digests of the four runs whose commits differ (3 and 4) are below.
Trace zips, in table order (main 1, PR 1, PR 2, main 2, main 3, PR 3, PR 4, main 4):
Hit rate. A diagnostic build of this design with a 16 MB budget and a 4 MB class cap (not part of this PR) served 91 to 95% of the worker's allocations of the four hot classes from the cache. The committed 4 MB and 256 KB limits were not instrumented, so their hit rate is not measured.
Tests (
agc_driver_host_allocator): the existing checks now cover sizes up to 4096 and run on fresh threads or in chunks of sizes, because a thread's large budget carries over between checks. New checks:Broken copies of the change, each built against these tests, are caught in 10 of 10 cases: the thread budget not enforced, the class share not enforced, a pop or a trim leaving the byte count, no trim, a trim that frees the classes in use, a free counted as use, a pop not counted as use, the largest class back at 1 KB, and a large block filed by its class size instead of the size it holds.
The focused set passes identically on main and on this change under Vulkan validation: 63 tests matched, 43 passed, 0 failed, 0
VUID-lines, no layer-missing line (ANYPS5_REQUIRE_VULKAN=1,ANYPS5_NO_SHADER_CACHE=1,VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation). 18 of them are skipped by this build'sANYPS5_AGC_EXECUTION_TESTSlist and 2 (agc_shader_result_memo_budget,agc_vertex_layer_export) were not run on either arm becauseobjcopyfailed after linking their executables. Full ctest was not run.tools/check_conventions.pypasses.Digest: main, run 3 (commit 42f6354)
seconds 200:15 from present 4485: 238 presents, frame p50 62.6 / p90 65.8 / p99 69.1 / max 71.0 ms, GPU busy 33.1 ms per present
NVIDIA GeForce RTX 2080 Ti, NVIDIA 610.88, Windows 10.0.26300, 3840x2160, commit 42f6354, dropped: yes
{"commit":"42f6354612c9","dirty":false,"env":{"APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"200:15"},"gpu":"NVIDIA GeForce RTX 2080 Ti","driver":"NVIDIA 610.88","os":"Windows 10.0.26300","cpu":"Intel(R) Core(TM) i9-9900K CPU @ 3.60GHz","cpu_threads":16,"memory_mib":65468,"title_id":"PPSA05324","title":"Sonic Origins","content_version":"02.002.000","resolution":"3840x2160","window":{"spec":"seconds 200:15","first_present":4485,"ms":15025.332},"presents":238,"frame_ms":{"p50":62.617,"p90":65.788,"p99":69.087,"max":71.009},"gpu_busy_ms_per_present":33.083,"worker_busy_pct":{"queue worker 0x0":96.665},"phase_totals_ms":{"Driver.Completion":2.05,"Driver.Dispatch":1082.613,"Driver.Dispatch.capture_resources":16.076,"Driver.Dispatch.decode_key_device_setup":710.05,"Driver.Dispatch.lookup_cache":14.39,"Driver.Dispatch.materialize":3.576,"Driver.Dispatch.prepared_invocation":2.992,"Driver.Draw":10984.747,"Driver.Draw.device_setup":788.798,"Driver.Draw.draw_enqueued":2421.886,"Driver.Draw.post_compile_prepare":185.985,"Driver.Draw.prepare":1362.044,"Driver.Draw.shader_compile_and_link":5980.765,"Driver.EndSubmission":11.649,"Driver.Packet":14510.457,"Driver.Packet.device_lock":171.511,"Driver.Packet.dispatch":1086.557,"Driver.Packet.draw":11201.111,"Driver.Packet.execute":406.143,"Driver.Packet.flip_flush":6.834,"Driver.Packet.flush_between_packets":479.884,"Driver.Packet.memory_wait":0.002,"Driver.Packet.pipeline_drain":242.752,"Driver.Packet.pipeline_prepare":252.943,"Driver.Packet.prepare_memory":273.776,"Driver.Packet.rendering_wait":0.449,"Driver.Present":3440.936,"Driver.Present.acquire_image":3.426,"Driver.Present.device_setup":0.27,"Driver.Present.gpu_mutex_wait":158.613,"Driver.Present.inflight_wait":0.761,"Driver.Present.present_display_buffer":43.699,"Driver.Present.queue_present":46.759,"Driver.Present.release_and_callback":0.869,"Driver.Present.render_fence_wait":3185.71,"Driver.Present.resize":0.577,"Driver.Present.validate":0.078,"Driver.Suspend":0.062,"GpuMutex.wait.dispatch":0.079,"GpuMutex.wait.draw":62.834,"GpuMutex.wait.end":1.873,"GpuMutex.wait.fill":8.592,"GpuMutex.wait.flush":0.351,"GpuMutex.wait.label":6.543,"GpuMutex.wait.other":8.235,"GpuMutex.wait.present":157.688,"GpuMutex.wait.wait":2.838,"Graphics.Draw":9210.027,"Graphics.Draw.draw_and_resource_release":7044.578,"Graphics.Draw.index_upload":462.127,"Graphics.Draw.validate":785.261,"Graphics.Draw.vertex_upload":771.735,"Graphics.DrawWithRecipe":690.999,"Graphics.DrawWithRecipe.draw_and_resource_release":661.267,"Graphics.DrawWithRecipe.index_upload":4.643,"Graphics.DrawWithRecipe.validate":10.819,"Graphics.DrawWithRecipe.vertex_upload":9.546,"Recorder.Reap":134.561,"Recorder.Submit":457.955,"Recorder.WaitSerial":3396.464,"Resources.Complete":97.936,"Resources.Prepare":53.554,"Shader.DrawStage":3931.985,"Shader.DrawStage.capture_resources":1791.026,"Shader.DrawStage.materialize":1067.223,"Shader.DrawStage.prepared_invocation":986.818,"Shader.ResolveAbi":170.021,"Shader.ResolveGraphicsAbi":62.707,"Shader.ResolveGraphicsStagesAbi":169.766,"VideoOut.Flip":3440.944,"VideoOut.Flip.completion_mutex_wait":0.363,"VideoOut.Flip.config_mutex_wait":0.026,"VideoOut.Flip.frame_limit":0.166,"VideoOut.Flip.notify_game":9.822,"VideoOut.Flip.present":3427.229,"VideoOut.Flip.validate":0.433,"VideoOut.Flip.vblank_wait":0.168,"VideoOut.Flip.window_prepare":0.422,"VideoOut.Flip.window_title":1.94,"VideoOut.Readiness":1.559,"VideoOut.Readiness.locks_validate":0.893,"Vulkan.Acquire":3.107,"Vulkan.Acquire.acquire_fence_wait":0.542,"Vulkan.Acquire.acquire_image":1.643,"Vulkan.Acquire.fence_reset":0.682,"Vulkan.Acquire.retired_swapchains":0.159,"Vulkan.Dispatch":179.836,"Vulkan.Dispatch.command_record":58.398,"Vulkan.Dispatch.shader_resources":120.176,"Vulkan.DispatchRecipe":0.631,"Vulkan.DispatchRecipe.command_record":0.63,"Vulkan.DrawFromRecipe":700.457,"Vulkan.Present":23.387,"Vulkan.Present.command_record_scale":8.241,"Vulkan.Present.pixel_upload":3.23,"Vulkan.Present.queue_submit":11.629,"Vulkan.QueuePresent":45.603,"Vulkan.QueuePresent.queue_present":45.207,"Vulkan.Retire":3185.093,"Vulkan.Retire.wait":3179.375},"top_phases_ms_per_frame":{"Driver.Packet":60.968,"Driver.Packet.draw":47.063,"Driver.Draw":46.154,"Graphics.Draw":38.698,"Graphics.Draw.draw_and_resource_release":29.599,"Driver.Draw.shader_compile_and_link":25.129,"Shader.DrawStage":16.521,"VideoOut.Flip":14.458},"owned_draw_counts":{"OwnedDraw.evicted_other":942},"graphics_track":{"Graphics.Barrier.copy":952,"Graphics.Barrier.dispatch-lead":1471,"Graphics.Barrier.dispatch-trail":2621,"Graphics.Barrier.draw":39127,"Graphics.Barrier.fill-clear":2380,"Graphics.Barrier.label-run":40720,"Graphics.Barrier.present-blit":476,"Graphics.Barrier.shadow-publish":2,"Graphics.Barrier.staging-in":2228,"Graphics.Barrier.staging-out":476,"Graphics.Barrier.storage-upload":27142,"Graphics.Barrier.storage-writeback":2476,"Graphics.BarrierMerged.dispatch-lead":1150,"Graphics.BarrierMerged.shadow-publish":2,"Graphics.BarrierMerged.staging-in":156,"Graphics.BarrierMerged.staging-out":476,"Graphics.BarrierMerged.storage-writeback":393,"Graphics.Copy":1430,"Graphics.Copy.bytes":15262560,"Graphics.RenderPass":19262,"Graphics.RenderPass.Close.command":7322,"Graphics.RenderPass.Close.image":26,"Graphics.RenderPass.Close.key":935,"Graphics.RenderPass.Close.new-batch":10979,"Graphics.RenderPass.Continued":481566},"trace_dropped":true,"trace_dropped_threads":{"queue worker 0x0":{"events_full_after_s":5.742,"events_lost":424071,"totals_full":false},"draw committer":{"events_full_after_s":13.815,"events_lost":22748,"totals_full":false}},"trace":"aps5-trace-42f6354612c9-29200.json.gz"}Incomplete trace: recorded data was lost. Slice-based timings, waits and batch inventories cover retained events only; missing slices are not idle time. Summary statistics are reported separately.
Slowest frames (largest slices inside each, inclusive)
Persistent spikes (frame time above the fastest frame that separates it from a longer frame; one entry per stall, not per frame)
Threads (ms per frame)
Largest slices (ms per frame, inclusive, all threads): batch 32.9, Graphics.Draw 21.0, VideoOut.Flip 14.5, Driver.Present 14.5, VideoOut.Flip.present 14.4, Recorder.WaitSerial 14.3, Driver.Present.render_fence_wait 13.4, Vulkan.Retire 13.4, Vulkan.Retire.wait 13.4, Driver.Packet 13.1
Longest waits
Largest GPU batches (GPU ranges inside, and the CPU slices that recorded each, inclusive)
Digest: this PR, run 3 (commit 9a8304a)
seconds 200:15 from present 4516: 239 presents, frame p50 62.2 / p90 67.7 / p99 74.7 / max 80.6 ms, GPU busy 31.5 ms per present
NVIDIA GeForce RTX 2080 Ti, NVIDIA 610.88, Windows 10.0.26300, 3840x2160, commit 9a8304a, dropped: yes
{"commit":"9a8304ae075f","dirty":false,"env":{"APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"200:15"},"gpu":"NVIDIA GeForce RTX 2080 Ti","driver":"NVIDIA 610.88","os":"Windows 10.0.26300","cpu":"Intel(R) Core(TM) i9-9900K CPU @ 3.60GHz","cpu_threads":16,"memory_mib":65468,"title_id":"PPSA05324","title":"Sonic Origins","content_version":"02.002.000","resolution":"3840x2160","window":{"spec":"seconds 200:15","first_present":4516,"ms":15021.488},"presents":239,"frame_ms":{"p50":62.22,"p90":67.721,"p99":74.721,"max":80.632},"gpu_busy_ms_per_present":31.48,"worker_busy_pct":{"queue worker 0x0":96.619},"phase_totals_ms":{"Driver.Completion":3.328,"Driver.Dispatch":1154.63,"Driver.Dispatch.capture_resources":17.641,"Driver.Dispatch.decode_key_device_setup":771.755,"Driver.Dispatch.lookup_cache":15.264,"Driver.Dispatch.materialize":3.441,"Driver.Dispatch.prepared_invocation":3.257,"Driver.Draw":10824.127,"Driver.Draw.device_setup":735.18,"Driver.Draw.draw_enqueued":2394.296,"Driver.Draw.post_compile_prepare":183.951,"Driver.Draw.prepare":1306.196,"Driver.Draw.shader_compile_and_link":5960.871,"Driver.EndSubmission":33.92,"Driver.Packet":14476.303,"Driver.Packet.device_lock":170.224,"Driver.Packet.dispatch":1158.763,"Driver.Packet.draw":11031.82,"Driver.Packet.execute":413.45,"Driver.Packet.flip_flush":8.075,"Driver.Packet.flush_between_packets":475.396,"Driver.Packet.memory_wait":0.009,"Driver.Packet.pipeline_drain":274.262,"Driver.Packet.pipeline_prepare":253.814,"Driver.Packet.prepare_memory":269.374,"Driver.Packet.rendering_wait":0.657,"Driver.Present":3031.643,"Driver.Present.acquire_image":3.54,"Driver.Present.device_setup":0.275,"Driver.Present.gpu_mutex_wait":79.294,"Driver.Present.inflight_wait":0.606,"Driver.Present.present_display_buffer":43.089,"Driver.Present.queue_present":45.276,"Driver.Present.release_and_callback":0.783,"Driver.Present.render_fence_wait":2857.688,"Driver.Present.resize":0.639,"Driver.Present.validate":0.145,"Driver.Suspend":0.091,"GpuMutex.wait.dispatch":0.048,"GpuMutex.wait.draw":54.938,"GpuMutex.wait.end":1.217,"GpuMutex.wait.fill":4.658,"GpuMutex.wait.flush":0.674,"GpuMutex.wait.label":4.969,"GpuMutex.wait.other":4.719,"GpuMutex.wait.present":78.528,"GpuMutex.wait.wait":3.832,"Graphics.Draw":9142.825,"Graphics.Draw.draw_and_resource_release":6991.612,"Graphics.Draw.index_upload":463.917,"Graphics.Draw.validate":799.105,"Graphics.Draw.vertex_upload":741.309,"Graphics.DrawWithRecipe":652.507,"Graphics.DrawWithRecipe.draw_and_resource_release":625.928,"Graphics.DrawWithRecipe.index_upload":3.498,"Graphics.DrawWithRecipe.validate":10.013,"Graphics.DrawWithRecipe.vertex_upload":8.495,"Recorder.Reap":132.698,"Recorder.Submit":514.773,"Recorder.WaitSerial":2996.287,"Resources.Complete":103.873,"Resources.Prepare":70.559,"Shader.DrawStage":3948.058,"Shader.DrawStage.capture_resources":1826.339,"Shader.DrawStage.materialize":1065.168,"Shader.DrawStage.prepared_invocation":964.172,"Shader.ResolveAbi":155.553,"Shader.ResolveGraphicsAbi":65.632,"Shader.ResolveGraphicsStagesAbi":150.202,"VideoOut.Flip":3034.61,"VideoOut.Flip.completion_mutex_wait":0.451,"VideoOut.Flip.config_mutex_wait":0.026,"VideoOut.Flip.frame_limit":0.19,"VideoOut.Flip.notify_game":11.625,"VideoOut.Flip.present":3018.987,"VideoOut.Flip.validate":0.304,"VideoOut.Flip.vblank_wait":0.224,"VideoOut.Flip.window_prepare":0.499,"VideoOut.Flip.window_title":1.999,"VideoOut.Readiness":1.038,"VideoOut.Readiness.locks_validate":0.429,"Vulkan.Acquire":3.248,"Vulkan.Acquire.acquire_fence_wait":0.601,"Vulkan.Acquire.acquire_image":1.648,"Vulkan.Acquire.fence_reset":0.705,"Vulkan.Acquire.retired_swapchains":0.137,"Vulkan.Dispatch":176.892,"Vulkan.Dispatch.command_record":55.641,"Vulkan.Dispatch.shader_resources":120.135,"Vulkan.DispatchRecipe":1.593,"Vulkan.DispatchRecipe.command_record":1.586,"Vulkan.DrawFromRecipe":660.326,"Vulkan.Present":23.063,"Vulkan.Present.command_record_scale":8.596,"Vulkan.Present.pixel_upload":2.362,"Vulkan.Present.queue_submit":11.797,"Vulkan.QueuePresent":44.375,"Vulkan.QueuePresent.queue_present":44.047,"Vulkan.Retire":2857.063,"Vulkan.Retire.wait":2851.471},"top_phases_ms_per_frame":{"Driver.Packet":60.57,"Driver.Packet.draw":46.158,"Driver.Draw":45.289,"Graphics.Draw":38.254,"Graphics.Draw.draw_and_resource_release":29.254,"Driver.Draw.shader_compile_and_link":24.941,"Shader.DrawStage":16.519,"VideoOut.Flip":12.697},"owned_draw_counts":{"OwnedDraw.evicted_other":1208},"graphics_track":{"Graphics.Barrier.copy":956,"Graphics.Barrier.dispatch-lead":1333,"Graphics.Barrier.dispatch-trail":2632,"Graphics.Barrier.draw":39539,"Graphics.Barrier.fill-clear":2390,"Graphics.Barrier.input-mirror":178,"Graphics.Barrier.label-run":40940,"Graphics.Barrier.present-blit":478,"Graphics.Barrier.shadow-publish":2,"Graphics.Barrier.staging-in":2840,"Graphics.Barrier.staging-out":478,"Graphics.Barrier.storage-upload":27256,"Graphics.Barrier.storage-writeback":2505,"Graphics.BarrierMerged.dispatch-lead":1299,"Graphics.BarrierMerged.label-run":7,"Graphics.BarrierMerged.shadow-publish":2,"Graphics.BarrierMerged.staging-in":510,"Graphics.BarrierMerged.staging-out":478,"Graphics.BarrierMerged.storage-writeback":376,"Graphics.Copy":2331,"Graphics.Copy.bytes":15810760,"Graphics.RenderPass":19467,"Graphics.RenderPass.Close.command":7408,"Graphics.RenderPass.Close.image":11,"Graphics.RenderPass.Close.key":958,"Graphics.RenderPass.Close.label":7,"Graphics.RenderPass.Close.new-batch":11083,"Graphics.RenderPass.Continued":484837},"trace_dropped":true,"trace_dropped_threads":{"queue worker 0x0":{"events_full_after_s":5.893,"events_lost":406948,"totals_full":false},"draw committer":{"events_full_after_s":14.379,"events_lost":11685,"totals_full":false}},"trace":"aps5-trace-9a8304ae075f-37740.json.gz"}Incomplete trace: recorded data was lost. Slice-based timings, waits and batch inventories cover retained events only; missing slices are not idle time. Summary statistics are reported separately.
Slowest frames (largest slices inside each, inclusive)
Persistent spikes (frame time above the fastest frame that separates it from a longer frame; one entry per stall, not per frame)
Threads (ms per frame)
Largest slices (ms per frame, inclusive, all threads): batch 31.5, Graphics.Draw 20.8, Driver.Packet 13.0, VideoOut.Flip 12.7, Driver.Present 12.7, VideoOut.Flip.present 12.6, Recorder.WaitSerial 12.5, Driver.Present.render_fence_wait 12.0, Vulkan.Retire 12.0, Vulkan.Retire.wait 11.9
Longest waits
Largest GPU batches (GPU ranges inside, and the CPU slices that recorded each, inclusive)
Digest: this PR, run 4 (commit 9a8304a)
seconds 200:15 from present 4589: 243 presents, frame p50 60.6 / p90 66.4 / p99 85.3 / max 122.6 ms, GPU busy 31.2 ms per present
NVIDIA GeForce RTX 2080 Ti, NVIDIA 610.88, Windows 10.0.26300, 3840x2160, commit 9a8304a, dropped: yes
{"commit":"9a8304ae075f","dirty":false,"env":{"APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"200:15"},"gpu":"NVIDIA GeForce RTX 2080 Ti","driver":"NVIDIA 610.88","os":"Windows 10.0.26300","cpu":"Intel(R) Core(TM) i9-9900K CPU @ 3.60GHz","cpu_threads":16,"memory_mib":65468,"title_id":"PPSA05324","title":"Sonic Origins","content_version":"02.002.000","resolution":"3840x2160","window":{"spec":"seconds 200:15","first_present":4589,"ms":15020.878},"presents":243,"frame_ms":{"p50":60.61,"p90":66.434,"p99":85.341,"max":122.622},"gpu_busy_ms_per_present":31.182,"worker_busy_pct":{"queue worker 0x0":96.611},"phase_totals_ms":{"Driver.Completion":2.808,"Driver.Dispatch":1123.888,"Driver.Dispatch.capture_resources":16.991,"Driver.Dispatch.decode_key_device_setup":752.397,"Driver.Dispatch.lookup_cache":13.994,"Driver.Dispatch.materialize":3.252,"Driver.Dispatch.prepared_invocation":2.985,"Driver.Draw":10889.331,"Driver.Draw.device_setup":727.058,"Driver.Draw.draw_enqueued":2534.249,"Driver.Draw.post_compile_prepare":177.93,"Driver.Draw.prepare":1312.502,"Driver.Draw.shader_compile_and_link":5894.626,"Driver.EndSubmission":17.732,"Driver.Packet":14491.168,"Driver.Packet.device_lock":171.819,"Driver.Packet.dispatch":1127.788,"Driver.Packet.draw":11099.561,"Driver.Packet.execute":427.004,"Driver.Packet.flip_flush":6.649,"Driver.Packet.flush_between_packets":469.691,"Driver.Packet.memory_wait":0.014,"Driver.Packet.pipeline_drain":251.676,"Driver.Packet.pipeline_prepare":256.355,"Driver.Packet.prepare_memory":274.76,"Driver.Packet.rendering_wait":0.356,"Driver.Present":3154.348,"Driver.Present.acquire_image":3.317,"Driver.Present.device_setup":0.268,"Driver.Present.gpu_mutex_wait":158.652,"Driver.Present.inflight_wait":0.763,"Driver.Present.present_display_buffer":44.488,"Driver.Present.queue_present":46.485,"Driver.Present.release_and_callback":0.819,"Driver.Present.render_fence_wait":2898.677,"Driver.Present.resize":0.529,"Driver.Present.validate":0.096,"Driver.Suspend":0.056,"GpuMutex.wait.draw":58.464,"GpuMutex.wait.end":2.372,"GpuMutex.wait.fill":6.898,"GpuMutex.wait.flush":0.668,"GpuMutex.wait.label":6.44,"GpuMutex.wait.other":5.54,"GpuMutex.wait.present":157.871,"GpuMutex.wait.wait":2.461,"Graphics.Draw":9529.638,"Graphics.Draw.draw_and_resource_release":7306.033,"Graphics.Draw.index_upload":487.169,"Graphics.Draw.validate":798.87,"Graphics.Draw.vertex_upload":780.254,"Graphics.DrawWithRecipe":654.726,"Graphics.DrawWithRecipe.draw_and_resource_release":630.713,"Graphics.DrawWithRecipe.index_upload":2.972,"Graphics.DrawWithRecipe.validate":9.092,"Graphics.DrawWithRecipe.vertex_upload":7.454,"Recorder.Reap":134.076,"Recorder.Submit":460.526,"Recorder.WaitSerial":3115.288,"Resources.Complete":98.049,"Resources.Prepare":53.459,"Shader.DrawStage":3915.91,"Shader.DrawStage.capture_resources":1838.677,"Shader.DrawStage.materialize":1012.084,"Shader.DrawStage.prepared_invocation":976.427,"Shader.ResolveAbi":162.997,"Shader.ResolveGraphicsAbi":66.32,"Shader.ResolveGraphicsStagesAbi":158.181,"VideoOut.Flip":3158.279,"VideoOut.Flip.completion_mutex_wait":0.395,"VideoOut.Flip.config_mutex_wait":0.026,"VideoOut.Flip.frame_limit":0.18,"VideoOut.Flip.notify_game":9.901,"VideoOut.Flip.present":3144.552,"VideoOut.Flip.validate":0.314,"VideoOut.Flip.vblank_wait":0.171,"VideoOut.Flip.window_prepare":0.413,"VideoOut.Flip.window_title":1.982,"VideoOut.Readiness":1.2,"VideoOut.Readiness.locks_validate":0.512,"Vulkan.Acquire":3.014,"Vulkan.Acquire.acquire_fence_wait":0.615,"Vulkan.Acquire.acquire_image":1.669,"Vulkan.Acquire.fence_reset":0.513,"Vulkan.Acquire.retired_swapchains":0.133,"Vulkan.Dispatch":177.374,"Vulkan.Dispatch.command_record":57.735,"Vulkan.Dispatch.shader_resources":118.595,"Vulkan.DrawFromRecipe":663.011,"Vulkan.Present":23.939,"Vulkan.Present.command_record_scale":8.17,"Vulkan.Present.pixel_upload":3.151,"Vulkan.Present.queue_submit":12.294,"Vulkan.QueuePresent":45.272,"Vulkan.QueuePresent.queue_present":44.836,"Vulkan.Retire":2898.292,"Vulkan.Retire.wait":2893.284},"top_phases_ms_per_frame":{"Driver.Packet":59.634,"Driver.Packet.draw":45.677,"Driver.Draw":44.812,"Graphics.Draw":39.217,"Graphics.Draw.draw_and_resource_release":30.066,"Driver.Draw.shader_compile_and_link":24.258,"Shader.DrawStage":16.115,"VideoOut.Flip":12.997},"owned_draw_counts":{"OwnedDraw.evicted_other":1138},"graphics_track":{"Graphics.Barrier.copy":972,"Graphics.Barrier.dispatch-lead":1495,"Graphics.Barrier.dispatch-trail":2676,"Graphics.Barrier.draw":40081,"Graphics.Barrier.fill":2,"Graphics.Barrier.fill-clear":2430,"Graphics.Barrier.input-mirror":122,"Graphics.Barrier.label-run":41461,"Graphics.Barrier.present-blit":486,"Graphics.Barrier.shadow-publish":3,"Graphics.Barrier.staging-in":2252,"Graphics.Barrier.staging-out":486,"Graphics.Barrier.storage-upload":27720,"Graphics.Barrier.storage-writeback":2526,"Graphics.BarrierMerged.dispatch-lead":1181,"Graphics.BarrierMerged.shadow-publish":3,"Graphics.BarrierMerged.staging-in":182,"Graphics.BarrierMerged.staging-out":486,"Graphics.BarrierMerged.storage-writeback":407,"Graphics.Copy":1582,"Graphics.Copy.bytes":15817440,"Graphics.RenderPass":19765,"Graphics.RenderPass.Close.command":7587,"Graphics.RenderPass.Close.image":18,"Graphics.RenderPass.Close.key":1010,"Graphics.RenderPass.Close.new-batch":11150,"Graphics.RenderPass.Continued":493461},"trace_dropped":true,"trace_dropped_threads":{"queue worker 0x0":{"events_full_after_s":5.794,"events_lost":413462,"totals_full":false},"draw committer":{"events_full_after_s":13.829,"events_lost":22853,"totals_full":false}},"trace":"aps5-trace-9a8304ae075f-10440.json.gz"}Incomplete trace: recorded data was lost. Slice-based timings, waits and batch inventories cover retained events only; missing slices are not idle time. Summary statistics are reported separately.
Slowest frames (largest slices inside each, inclusive)
Persistent spikes (frame time above the fastest frame that separates it from a longer frame; one entry per stall, not per frame)
Threads (ms per frame)
Largest slices (ms per frame, inclusive, all threads): batch 31.2, Graphics.Draw 20.9, Driver.Packet 13.2, VideoOut.Flip 13.0, Driver.Present 13.0, VideoOut.Flip.present 12.9, Recorder.WaitSerial 12.8, Driver.Present.render_fence_wait 11.9, Vulkan.Retire 11.9, Vulkan.Retire.wait 11.9
Longest waits
Largest GPU batches (GPU ranges inside, and the CPU slices that recorded each, inclusive)
Digest: main, run 4 (commit 42f6354)
seconds 200:15 from present 4970: 250 presents, frame p50 59.2 / p90 64.0 / p99 70.0 / max 72.2 ms, GPU busy 31.0 ms per present
NVIDIA GeForce RTX 2080 Ti, NVIDIA 610.88, Windows 10.0.26300, 3840x2160, commit 42f6354, dropped: yes
{"commit":"42f6354612c9","dirty":false,"env":{"APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"200:15"},"gpu":"NVIDIA GeForce RTX 2080 Ti","driver":"NVIDIA 610.88","os":"Windows 10.0.26300","cpu":"Intel(R) Core(TM) i9-9900K CPU @ 3.60GHz","cpu_threads":16,"memory_mib":65468,"title_id":"PPSA05324","title":"Sonic Origins","content_version":"02.002.000","resolution":"3840x2160","window":{"spec":"seconds 200:15","first_present":4970,"ms":15010.67},"presents":250,"frame_ms":{"p50":59.166,"p90":64.044,"p99":69.997,"max":72.25},"gpu_busy_ms_per_present":31.001,"worker_busy_pct":{"queue worker 0x0":96.665},"phase_totals_ms":{"Driver.Completion":2.479,"Driver.Dispatch":1093.169,"Driver.Dispatch.capture_resources":17.765,"Driver.Dispatch.decode_key_device_setup":724.489,"Driver.Dispatch.lookup_cache":14.022,"Driver.Dispatch.materialize":3.262,"Driver.Dispatch.prepared_invocation":2.948,"Driver.Draw":10916.648,"Driver.Draw.device_setup":791.659,"Driver.Draw.draw_enqueued":2365.04,"Driver.Draw.post_compile_prepare":183.502,"Driver.Draw.prepare":1332.49,"Driver.Draw.shader_compile_and_link":5987.694,"Driver.EndSubmission":15.551,"Driver.Packet":14492.007,"Driver.Packet.device_lock":175.407,"Driver.Packet.dispatch":1096.812,"Driver.Packet.draw":11129.699,"Driver.Packet.execute":420.823,"Driver.Packet.flip_flush":6.784,"Driver.Packet.flush_between_packets":476.638,"Driver.Packet.memory_wait":0.007,"Driver.Packet.pipeline_drain":249.186,"Driver.Packet.pipeline_prepare":257.95,"Driver.Packet.prepare_memory":277.201,"Driver.Packet.rendering_wait":0.327,"Driver.Present":3338.529,"Driver.Present.acquire_image":3.265,"Driver.Present.device_setup":0.377,"Driver.Present.gpu_mutex_wait":169.373,"Driver.Present.inflight_wait":0.68,"Driver.Present.present_display_buffer":45.152,"Driver.Present.queue_present":46.384,"Driver.Present.release_and_callback":0.712,"Driver.Present.render_fence_wait":3071.714,"Driver.Present.resize":0.623,"Driver.Present.validate":0.064,"Driver.Suspend":0.052,"GpuMutex.wait.dispatch":0.086,"GpuMutex.wait.draw":60.264,"GpuMutex.wait.end":1.57,"GpuMutex.wait.fill":11.89,"GpuMutex.wait.flush":0.927,"GpuMutex.wait.label":3.255,"GpuMutex.wait.other":3.506,"GpuMutex.wait.present":168.601,"GpuMutex.wait.wait":2.246,"Graphics.Draw":9349.33,"Graphics.Draw.draw_and_resource_release":7147.804,"Graphics.Draw.index_upload":471.809,"Graphics.Draw.validate":803.968,"Graphics.Draw.vertex_upload":766.092,"Graphics.DrawWithRecipe":629.84,"Graphics.DrawWithRecipe.draw_and_resource_release":611.279,"Graphics.DrawWithRecipe.index_upload":1.901,"Graphics.DrawWithRecipe.validate":7.805,"Graphics.DrawWithRecipe.vertex_upload":5.14,"Recorder.Reap":128.899,"Recorder.Submit":450.842,"Recorder.WaitSerial":3291.907,"Resources.Complete":78.799,"Resources.Prepare":51.386,"Shader.DrawStage":4025.453,"Shader.DrawStage.capture_resources":1846.461,"Shader.DrawStage.materialize":1088.049,"Shader.DrawStage.prepared_invocation":1003.087,"Shader.ResolveAbi":174.925,"Shader.ResolveGraphicsAbi":68.941,"Shader.ResolveGraphicsStagesAbi":180.102,"VideoOut.Flip":3353.486,"VideoOut.Flip.completion_mutex_wait":0.456,"VideoOut.Flip.config_mutex_wait":0.024,"VideoOut.Flip.frame_limit":0.178,"VideoOut.Flip.notify_game":23.605,"VideoOut.Flip.present":3325.747,"VideoOut.Flip.validate":0.373,"VideoOut.Flip.vblank_wait":0.238,"VideoOut.Flip.window_prepare":0.522,"VideoOut.Flip.window_title":1.905,"VideoOut.Readiness":1.302,"VideoOut.Readiness.locks_validate":0.537,"Vulkan.Acquire":2.98,"Vulkan.Acquire.acquire_fence_wait":0.524,"Vulkan.Acquire.acquire_image":1.615,"Vulkan.Acquire.fence_reset":0.622,"Vulkan.Acquire.retired_swapchains":0.123,"Vulkan.Dispatch":176.179,"Vulkan.Dispatch.command_record":57.061,"Vulkan.Dispatch.shader_resources":117.951,"Vulkan.DispatchRecipe":0.186,"Vulkan.DispatchRecipe.command_record":0.186,"Vulkan.DrawFromRecipe":637.238,"Vulkan.Present":24.443,"Vulkan.Present.command_record_scale":8.304,"Vulkan.Present.pixel_upload":2.76,"Vulkan.Present.queue_submit":13.017,"Vulkan.QueuePresent":45.007,"Vulkan.QueuePresent.queue_present":44.636,"Vulkan.Retire":3071.095,"Vulkan.Retire.wait":3064.48},"top_phases_ms_per_frame":{"Driver.Packet":57.968,"Driver.Packet.draw":44.519,"Driver.Draw":43.667,"Graphics.Draw":37.397,"Graphics.Draw.draw_and_resource_release":28.591,"Driver.Draw.shader_compile_and_link":23.951,"Shader.DrawStage":16.102,"VideoOut.Flip":13.414},"owned_draw_counts":{"OwnedDraw.evicted_other":1187},"graphics_track":{"Graphics.Barrier.copy":1000,"Graphics.Barrier.dispatch-lead":1507,"Graphics.Barrier.dispatch-trail":2753,"Graphics.Barrier.draw":40873,"Graphics.Barrier.fill-clear":2500,"Graphics.Barrier.label-run":42408,"Graphics.Barrier.present-blit":500,"Graphics.Barrier.shadow-publish":2,"Graphics.Barrier.staging-in":2336,"Graphics.Barrier.staging-out":500,"Graphics.Barrier.storage-upload":28510,"Graphics.Barrier.storage-writeback":2607,"Graphics.BarrierMerged.dispatch-lead":1246,"Graphics.BarrierMerged.shadow-publish":2,"Graphics.BarrierMerged.staging-in":168,"Graphics.BarrierMerged.staging-out":500,"Graphics.BarrierMerged.storage-writeback":406,"Graphics.Copy":1502,"Graphics.Copy.bytes":16032096,"Graphics.RenderPass":20152,"Graphics.RenderPass.Close.command":7816,"Graphics.RenderPass.Close.image":11,"Graphics.RenderPass.Close.key":1060,"Graphics.RenderPass.Close.new-batch":11265,"Graphics.RenderPass.Continued":507423},"trace_dropped":true,"trace_dropped_threads":{"queue worker 0x0":{"events_full_after_s":5.896,"events_lost":408247,"totals_full":false},"draw committer":{"events_full_after_s":14.126,"events_lost":16738,"totals_full":false}},"trace":"aps5-trace-42f6354612c9-36848.json.gz"}Incomplete trace: recorded data was lost. Slice-based timings, waits and batch inventories cover retained events only; missing slices are not idle time. Summary statistics are reported separately.
Slowest frames (largest slices inside each, inclusive)
Persistent spikes (frame time above the fastest frame that separates it from a longer frame; one entry per stall, not per frame)
Threads (ms per frame)
Largest slices (ms per frame, inclusive, all threads): batch 31.0, Graphics.Draw 19.9, VideoOut.Flip 13.4, Driver.Present 13.4, VideoOut.Flip.present 13.3, Recorder.WaitSerial 13.2, Driver.Present.render_fence_wait 12.3, Vulkan.Retire 12.3, Vulkan.Retire.wait 12.3, Driver.Packet 12.0
Longest waits
Largest GPU batches (GPU ranges inside, and the CPU slices that recorded each, inclusive)
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)