Skip to content

perf(agc): copy a descriptor region behind pending GPU work on the GPU whatever its size - #13263

Merged
oneandonlydean merged 3 commits into
boykopovar:mainfrom
EagleBearerYS:fix/agc-buffer-upload-pending-gpu-copy
Nov 19, 2026
Merged

oneandonlydean merged 3 commits into
boykopovar:mainfrom
EagleBearerYS:fix/agc-buffer-upload-pending-gpu-copy

Conversation

@EagleBearerYS

@EagleBearerYS EagleBearerYS commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

What

When a dispatch's or draw's build uploads a descriptor region that isn't aligned inside its host import, the driver can copy it on the GPU from the import (recordGpuCopies) instead of reading it on the CPU. On main that GPU copy is allowed only up to APS5_GPU_COPY_MAX_KIB (1024 KiB by default, gpuCopyEligible). A larger region takes the CPU copy in copyRegion, and its GuestMemory::Read goes through the flush hook. So when GPU work is still pending over the region, the CPU waits for it, under the GPU mutex in UploadFinish:

  • a pending write: a pending-write sync, which submits the open batch;
  • pending storage results or unit shadows: a recorded-store sync.

This change copies such a region on the GPU whatever its size, when there is pending GPU work over it: a pending write, pending storage results, or a unit shadow.

Why that's safe: the bound isn't there for correctness. The GPU copy uses the same host-visible buffer as the CPU copy, and for a region with no GPU work over it the CPU copy never waits, so keeping that region on the CPU stays the cheaper choice. Behind GPU work, the GPU path already records everything the CPU would have waited for:

  • order: the copy goes into the open batch after its producer, behind the leading barrier;
  • queued key and label stores: they're recorded first;
  • pending storage results: they're recorded ahead of the copy, and unit shadows are published;
  • writes that land on the CPU: a copied buffer's write-back and completion labels are synced at the start of UploadFinish.

How it decides:

  • New copyBehindGpuWork(region, locked): holds for a GPU-copyable region the active recorder has GPU work over.
  • UploadPrepare: asks the recorder's published pending-write snapshot, which needs no lock.
  • UploadFinish: asks the recorder under the GPU mutex.
  • A region the snapshot flagged but the recorder no longer sees as pending: takes the CPU copy, which then doesn't wait.

Unchanged:

  • regions below the bound;
  • regions behind no GPU work;
  • a region no single import covers;
  • sparse regions;
  • APS5_CPU_COPIES=1, which disables every GPU copy.

The APS5_GPU_COPY_MAX_KIB row in ENVIRONMENT.md now says the cap doesn't apply behind GPU work.

Pending:

  • whether Resident Evil Village (PPSA01556)'s uploads take this path (below).

Resident Evil Village (PPSA01556)

Static menu, profiled boot (APS5_PROFILE_DRAW=1) on main ebb4075 plus #12478. Its [hooksync] lines show these buffer-upload waits per 10 s:

  • pending-write syncs: 0x0 DISPATCH_DIRECT buffer-upload, 65 syncs, 238 ms, average access 11,632 KiB over an average noted range of 3,162 KiB;
  • recorded-store syncs: 0x28 DISPATCH_DIRECT buffer-upload, 29 syncs, 364 ms.

Not confirmed yet: whether those regions lie inside one host import, which is the case this change covers, or cross several registered allocations, which it doesn't. A profiled boot with this change will tell, from its [buffers] line and the buffer-upload syncs left.

UFC 6 (PPSA23566), by Logan1h

Logan1h's pair, on Windows 11 (10.0.26300), a Ryzen 5 7500F and an NVIDIA GeForce RTX 4070 SUPER (driver 621.14), with a WinLibs GCC 15.2 Release build. Clock state not stated.

  • Arms: A is main b7aeb6f with a local diagnostic-counters patch, which they note changes no behaviour. B adds this PR (their merge cbc3300846 of 5a09407).
  • Scene: both from the same save, driven by hand into the same practice fight. Combat windows only, 10 s each: 34 for A, 23 for B.
Metric A (main) B (this PR)
Fight load (save read to vvms/training) 554.8 s 305.0 s
Presents per 10 s 8.2 12.7
Frame p50 / p90 856 / 1165 ms 821 / 932 ms
GPU busy per present 305 ms 196 ms
UploadFinish wait per present 116 ms 64 ms
CompletePendingCpuWrites wait per present 91 ms 58 ms
Upload classify + cpu-copy wait per present 24.5 ms 6.0 ms
[hooksync] buffer-upload waits per present 81 ms 35 ms
  • Same workload: UploadFinish calls per present are 552 for A and 548 for B.
  • A stalled run: one of the two B runs stalled on the loading screen. A retry with the same binary and save loaded the fight in 305 s. The tester attributes the stall to an intermittent issue on main; not checked by us.
  • Tests on the RTX 4070 SUPER, with the Khronos validation layer: agc_buffer_upload_pending_gpu_copy, agc_driver_depth_plane_sampling, agc_driver_depth_plane_sampling_evicting and agc_driver_draw_recipe_data passed, with no VUID- lines.
  • Summary lines (comment): one combat window per arm, the one closest to that arm's median frame p50.
    • A (main): 11 presents in 10.30 s, frame p50 856 ms and p90 1,212 ms, GPU busy 403 ms per present.
    • B (this PR): 12 presents in 10.28 s, frame p50 821 ms and p90 1,054 ms, GPU busy 194 ms per present.
    • tools/pr_labels.py reads them as different configurations, since their summary_every 10 windows start at different presents (window.first_present 188038 and 3835). The same-window pair below is the one it takes.
The two lines

A, main b7aeb6f with the diagnostic-counters patch:

{"commit": "3ac73c78593d", "dirty": false, "env": {"APS5_DRAW_PIPELINE": "1", "APS5_LOG_TIMESTAMPS": "1", "APS5_MIMALLOC": "1", "APS5_PIPELINE_DISPATCH": "1", "APS5_PROFILE_DRAW": "1", "APS5_SKIP_REFUSED_DRAWS": "1", "APS5_TRACE_SUMMARY_EVERY": "10"}, "gpu": "NVIDIA GeForce RTX 4070 SUPER", "driver": "NVIDIA 621.14", "os": "Windows 10.0.26300", "cpu": "AMD Ryzen 5 7500F 6-Core Processor", "cpu_threads": 12, "memory_mib": 32372, "title_id": "PPSA23566", "title": "EA SPORTS\u2122 UFC\u00ae 6", "content_version": "01.005.000", "resolution": "1920x1080", "window": {"spec": "summary_every 10", "first_present": 188038, "ms": 10300.394}, "interval_start_s": 4287.852, "interval_end_s": 4298.152, "presents": 11, "frame_ms": {"p50": 856.462, "p90": 1212.137, "p99": 1225.667, "max": 1225.667}, "gpu_busy_ms_per_present": 403.24, "worker_busy_pct": {"queue worker 0x0": 94.218, "queue worker 0x29": 11.784, "queue worker 0x2a": 12.573, "queue worker 0x2b": 13.764, "queue worker 0x2c": 6.193, "queue worker 0x2d": 5.753, "queue worker 0x2e": 6.246, "queue worker 0x2f": 5.635, "queue worker 0x28": 5.737}, "phase_totals_ms": {"Driver.Completion": 0.214, "Driver.Dispatch": 7205.413, "Driver.Dispatch.capture_resources": 88.665, "Driver.Dispatch.decode_key_device_setup": 21.525, "Driver.Dispatch.lookup_cache": 121.337, "Driver.Dispatch.materialize": 172.912, "Driver.Dispatch.prepared_invocation": 12.024, "Driver.Draw": 6819.909, "Driver.Draw.device_setup": 53.637, "Driver.Draw.draw_enqueued": 5567.354, "Driver.Draw.post_compile_prepare": 7.158, "Driver.Draw.prepare": 296.854, "Driver.Draw.shader_compile_and_link": 875.827, "Driver.EndSubmission": 69.356, "Driver.Packet": 16606.981, "Driver.Packet.device_lock": 18.976, "Driver.Packet.dispatch": 7115.354, "Driver.Packet.draw": 6839.514, "Driver.Packet.execute": 466.599, "Driver.Packet.flip_flush": 0.352, "Driver.Packet.flush_between_packets": 84.035, "Driver.Packet.memory_wait": 1695.822, "Driver.Packet.pipeline_drain": 89.688, "Driver.Packet.pipeline_prepare": 29.644, "Driver.Packet.prepare_memory": 98.816, "Driver.Packet.rendering_wait": 0.018, "Driver.Present": 72.754, "Driver.Present.acquire_image": 0.176, "Driver.Present.device_setup": 0.006, "Driver.Present.gpu_mutex_wait": 0.102, "Driver.Present.inflight_wait": 0.035, "Driver.Present.present_display_buffer": 1.562, "Driver.Present.queue_present": 4.772, "Driver.Present.release_and_callback": 0.014, "Driver.Present.render_fence_wait": 66.031, "Driver.Present.resize": 0.027, "Driver.Present.validate": 0.005, "Driver.Suspend": 0.003, "GpuMutex.wait.dispatch": 342.443, "GpuMutex.wait.draw": 4645.961, "GpuMutex.wait.end": 68.032, "GpuMutex.wait.fill": 0.026, "GpuMutex.wait.flush": 14.202, "GpuMutex.wait.hook": 90.999, "GpuMutex.wait.indirect": 0.311, "GpuMutex.wait.label": 38.068, "GpuMutex.wait.other": 0.071, "GpuMutex.wait.present": 0.062, "GpuMutex.wait.wait": 0.086, "Graphics.Draw": 2107.219, "Graphics.Draw.draw_and_resource_release": 1914.387, "Graphics.Draw.index_upload": 108.775, "Graphics.Draw.validate": 65.736, "Graphics.Draw.vertex_upload": 7.565, "Graphics.DrawWithRecipe": 2.751, "Graphics.DrawWithRecipe.draw_and_resource_release": 2.689, "Graphics.DrawWithRecipe.index_upload": 0.003, "Graphics.DrawWithRecipe.validate": 0.028, "Graphics.DrawWithRecipe.vertex_upload": 0.018, "Recorder.Reap": 79.277, "Recorder.Submit": 119.37, "Recorder.Sync": 3872.204, "Recorder.WaitSerial": 109.118, "Resources.Complete": 6153.95, "Resources.Prepare": 234.482, "Shader.DrawStage": 750.588, "Shader.DrawStage.capture_resources": 562.537, "Shader.DrawStage.materialize": 116.963, "Shader.DrawStage.prepared_invocation": 63.87, "Shader.ResolveAbi": 0.43, "Shader.ResolveGraphicsAbi": 0.523, "Shader.ResolveGraphicsStagesAbi": 1.812, "VideoOut.Flip": 73.927, "VideoOut.Flip.completion_mutex_wait": 0.011, "VideoOut.Flip.config_mutex_wait": 0.002, "VideoOut.Flip.frame_limit": 0.008, "VideoOut.Flip.notify_game": 0.084, "VideoOut.Flip.present": 73.07, "VideoOut.Flip.validate": 0.014, "VideoOut.Flip.vblank_wait": 0.009, "VideoOut.Flip.window_prepare": 0.025, "VideoOut.Flip.window_title": 0.7, "VideoOut.Readiness": 0.024, "VideoOut.Readiness.locks_validate": 0.011, "Vulkan.Acquire": 0.164, "Vulkan.Acquire.acquire_fence_wait": 0.024, "Vulkan.Acquire.acquire_image": 0.108, "Vulkan.Acquire.fence_reset": 0.021, "Vulkan.Acquire.retired_swapchains": 0.007, "Vulkan.ComputePipeline": 41.235, "Vulkan.Dispatch": 5926.275, "Vulkan.Dispatch.command_record": 68.606, "Vulkan.Dispatch.shader_resources": 5854.082, "Vulkan.DispatchRecipe": 18.939, "Vulkan.DispatchRecipe.command_record": 18.848, "Vulkan.DrawFromRecipe": 2.77, "Vulkan.Present": 1.121, "Vulkan.Present.command_record_scale": 0.466, "Vulkan.Present.pixel_upload": 0.06, "Vulkan.Present.queue_submit": 0.587, "Vulkan.QueuePresent": 4.748, "Vulkan.QueuePresent.queue_present": 4.73, "Vulkan.Retire": 66.025, "Vulkan.Retire.wait": 65.862}, "top_phases_ms_per_frame": {"Driver.Packet": 1509.726, "Driver.Dispatch": 655.038, "Driver.Packet.dispatch": 646.85, "Driver.Packet.draw": 621.774, "Driver.Draw": 619.992, "Resources.Complete": 559.45, "Vulkan.Dispatch": 538.752, "Vulkan.Dispatch.shader_resources": 532.189}, "owned_draw_counts": {}, "graphics_track": {"Graphics.Barrier.copy": 76, "Graphics.Barrier.dispatch-lead": 4126, "Graphics.Barrier.dispatch-trail": 6230, "Graphics.Barrier.draw": 14587, "Graphics.Barrier.fill": 172, "Graphics.Barrier.indirect-args": 814, "Graphics.Barrier.input-mirror": 4169, "Graphics.Barrier.label-run": 1302, "Graphics.Barrier.present-blit": 22, "Graphics.Barrier.shadow-publish": 857, "Graphics.Barrier.staging-in": 2387, "Graphics.Barrier.staging-out": 1291, "Graphics.Barrier.storage-upload": 1528, "Graphics.Barrier.storage-writeback": 3020, "Graphics.Barrier.template-refresh": 17, "Graphics.BarrierMerged.dispatch-lead": 3732, "Graphics.BarrierMerged.fill": 26, "Graphics.BarrierMerged.label-run": 12, "Graphics.BarrierMerged.shadow-publish": 827, "Graphics.BarrierMerged.staging-in": 1893, "Graphics.BarrierMerged.staging-out": 1291, "Graphics.BarrierMerged.storage-writeback": 923, "Graphics.Copy": 8503, "Graphics.Copy.bytes": 369511974, "Graphics.RenderPass": 6959, "Graphics.RenderPass.Close.command": 5954, "Graphics.RenderPass.Close.image": 47, "Graphics.RenderPass.Close.key": 159, "Graphics.RenderPass.Close.label": 12, "Graphics.RenderPass.Close.new-batch": 787, "Graphics.RenderPass.Continued": 37843}, "trace_dropped": false, "trace": ""}

B, their merge cbc3300846 of this PR's 5a09407:

{"commit": "cbc33008466a", "dirty": false, "env": {"APS5_DRAW_PIPELINE": "1", "APS5_LOG_TIMESTAMPS": "1", "APS5_MIMALLOC": "1", "APS5_PIPELINE_DISPATCH": "1", "APS5_PROFILE_DRAW": "1", "APS5_SKIP_REFUSED_DRAWS": "1", "APS5_TRACE_SUMMARY_EVERY": "10"}, "gpu": "NVIDIA GeForce RTX 4070 SUPER", "driver": "NVIDIA 621.14", "os": "Windows 10.0.26300", "cpu": "AMD Ryzen 5 7500F 6-Core Processor", "cpu_threads": 12, "memory_mib": 32372, "title_id": "PPSA23566", "title": "EA SPORTS\u2122 UFC\u00ae 6", "content_version": "01.005.000", "resolution": "1920x1080", "window": {"spec": "summary_every 10", "first_present": 3835, "ms": 10279.705}, "interval_start_s": 839.79, "interval_end_s": 850.07, "presents": 12, "frame_ms": {"p50": 820.98, "p90": 1053.6, "p99": 1080.731, "max": 1080.731}, "gpu_busy_ms_per_present": 194.206, "worker_busy_pct": {"queue worker 0x0": 96.707, "queue worker 0x29": 6.322, "queue worker 0x2a": 5.961, "queue worker 0x2b": 6.351, "queue worker 0x2c": 12.333, "queue worker 0x2d": 13.018, "queue worker 0x2e": 14.13, "queue worker 0x2f": 14.511, "queue worker 0x28": 6.567}, "phase_totals_ms": {"Driver.Completion": 0.347, "Driver.Dispatch": 7704.94, "Driver.Dispatch.capture_resources": 127.952, "Driver.Dispatch.decode_key_device_setup": 35.12, "Driver.Dispatch.lookup_cache": 73.628, "Driver.Dispatch.materialize": 23.495, "Driver.Dispatch.prepared_invocation": 17.098, "Driver.Draw": 7365.637, "Driver.Draw.device_setup": 61.581, "Driver.Draw.draw_enqueued": 6112.491, "Driver.Draw.post_compile_prepare": 19.801, "Driver.Draw.prepare": 177.521, "Driver.Draw.shader_compile_and_link": 971.043, "Driver.EndSubmission": 140.611, "Driver.Packet": 17941.023, "Driver.Packet.device_lock": 21.89, "Driver.Packet.dispatch": 7688.551, "Driver.Packet.draw": 7389.123, "Driver.Packet.execute": 501.559, "Driver.Packet.flip_flush": 4.481, "Driver.Packet.flush_between_packets": 100.013, "Driver.Packet.memory_wait": 1646.57, "Driver.Packet.pipeline_drain": 38.013, "Driver.Packet.pipeline_prepare": 35.824, "Driver.Packet.prepare_memory": 100.501, "Driver.Packet.rendering_wait": 0.022, "Driver.Present": 12.582, "Driver.Present.acquire_image": 0.171, "Driver.Present.device_setup": 0.006, "Driver.Present.gpu_mutex_wait": 0.075, "Driver.Present.inflight_wait": 0.031, "Driver.Present.present_display_buffer": 1.819, "Driver.Present.queue_present": 5.234, "Driver.Present.release_and_callback": 0.015, "Driver.Present.render_fence_wait": 5.18, "Driver.Present.resize": 0.024, "Driver.Present.validate": 0.004, "Driver.Suspend": 0.002, "GpuMutex.wait.dispatch": 223.65, "GpuMutex.wait.draw": 6011.895, "GpuMutex.wait.end": 39.734, "GpuMutex.wait.fill": 0.024, "GpuMutex.wait.flush": 8.453, "GpuMutex.wait.hook": 0.101, "GpuMutex.wait.indirect": 0.108, "GpuMutex.wait.label": 46.798, "GpuMutex.wait.present": 0.036, "GpuMutex.wait.wait": 0.123, "Graphics.Draw": 1447.216, "Graphics.Draw.draw_and_resource_release": 1263.996, "Graphics.Draw.index_upload": 87.755, "Graphics.Draw.validate": 74.484, "Graphics.Draw.vertex_upload": 8.329, "Graphics.DrawWithRecipe": 5.481, "Graphics.DrawWithRecipe.draw_and_resource_release": 5.376, "Graphics.DrawWithRecipe.index_upload": 0.005, "Graphics.DrawWithRecipe.validate": 0.045, "Graphics.DrawWithRecipe.vertex_upload": 0.032, "Recorder.Reap": 88.973, "Recorder.Submit": 99.334, "Recorder.Sync": 3605.844, "Recorder.WaitSerial": 0.194, "Resources.Complete": 6708.887, "Resources.Prepare": 157.835, "Shader.DrawStage": 841.355, "Shader.DrawStage.capture_resources": 648.685, "Shader.DrawStage.materialize": 112.291, "Shader.DrawStage.prepared_invocation": 72.756, "Shader.ResolveAbi": 1.12, "Shader.ResolveGraphicsAbi": 0.794, "Shader.ResolveGraphicsStagesAbi": 3.894, "VideoOut.Flip": 13.62, "VideoOut.Flip.completion_mutex_wait": 0.012, "VideoOut.Flip.config_mutex_wait": 0.002, "VideoOut.Flip.frame_limit": 0.006, "VideoOut.Flip.notify_game": 0.085, "VideoOut.Flip.present": 12.895, "VideoOut.Flip.validate": 0.015, "VideoOut.Flip.vblank_wait": 0.008, "VideoOut.Flip.window_prepare": 0.017, "VideoOut.Flip.window_title": 0.577, "VideoOut.Readiness": 0.024, "VideoOut.Readiness.locks_validate": 0.011, "Vulkan.Acquire": 0.159, "Vulkan.Acquire.acquire_fence_wait": 0.025, "Vulkan.Acquire.acquire_image": 0.104, "Vulkan.Acquire.fence_reset": 0.021, "Vulkan.Acquire.retired_swapchains": 0.006, "Vulkan.Dispatch": 6678.578, "Vulkan.Dispatch.command_record": 126.724, "Vulkan.Dispatch.shader_resources": 6546.945, "Vulkan.DispatchRecipe": 9.627, "Vulkan.DispatchRecipe.command_record": 9.501, "Vulkan.DrawFromRecipe": 5.515, "Vulkan.Present": 1.437, "Vulkan.Present.command_record_scale": 0.471, "Vulkan.Present.pixel_upload": 0.079, "Vulkan.Present.queue_submit": 0.878, "Vulkan.QueuePresent": 5.214, "Vulkan.QueuePresent.queue_present": 5.196, "Vulkan.Retire": 5.182, "Vulkan.Retire.wait": 4.993}, "top_phases_ms_per_frame": {"Driver.Packet": 1495.085, "Driver.Dispatch": 642.078, "Driver.Packet.dispatch": 640.713, "Driver.Packet.draw": 615.76, "Driver.Draw": 613.803, "Resources.Complete": 559.074, "Vulkan.Dispatch": 556.548, "Vulkan.Dispatch.shader_resources": 545.579}, "owned_draw_counts": {"OwnedDraw.evicted_other": 66}, "graphics_track": {"Graphics.Barrier.dispatch-lead": 7665, "Graphics.Barrier.dispatch-trail": 10669, "Graphics.Barrier.draw": 12226, "Graphics.Barrier.fill": 262, "Graphics.Barrier.indirect-args": 1476, "Graphics.Barrier.input-mirror": 859, "Graphics.Barrier.label-run": 1698, "Graphics.Barrier.present-blit": 24, "Graphics.Barrier.shadow-publish": 455, "Graphics.Barrier.staging-in": 13353, "Graphics.Barrier.staging-out": 5858, "Graphics.Barrier.storage-upload": 1296, "Graphics.Barrier.storage-writeback": 2663, "Graphics.Barrier.template-refresh": 38, "Graphics.BarrierMerged.dispatch-lead": 5956, "Graphics.BarrierMerged.fill": 28, "Graphics.BarrierMerged.label-run": 14, "Graphics.BarrierMerged.shadow-publish": 443, "Graphics.BarrierMerged.staging-in": 6201, "Graphics.BarrierMerged.staging-out": 5858, "Graphics.BarrierMerged.storage-writeback": 1028, "Graphics.Copy": 25125, "Graphics.Copy.bytes": 3778831928, "Graphics.RenderPass": 5592, "Graphics.RenderPass.Close.command": 4037, "Graphics.RenderPass.Close.image": 26, "Graphics.RenderPass.Close.key": 252, "Graphics.RenderPass.Close.label": 14, "Graphics.RenderPass.Close.new-batch": 1263, "Graphics.RenderPass.Continued": 48591}, "trace_dropped": false, "trace": ""}
  • Same-window pair (comment): one 60 s window per arm (APS5_TRACE_SECONDS=0:60 with a trigger file, opened once the fight was on screen), same save and practice fight, driven by hand, the same APS5_* settings in both arms, driver 621.24. tools/performance_compare.py finds no configuration differences.
Metric A (main) B (this PR) Change
Presents in the window 62 63
Frame p50 974.2 ms 945.7 ms −2.9%
Frame p90 1,049.4 ms 1,107.6 ms +5.5%
Frame p99 1,266.7 ms 1,467.8 ms +15.9%
Mean frame 978.5 ms 966.4 ms −1.2%
GPU busy per present 222.8 ms 187.2 ms −15.9%
Copy MiB per present 259.6 381.7 +47.1%
  • The spread: at about 1 frame per second, each window holds about 62 presents, so its p90 and p99 rest on a few frames. The tester reads the multi-window aggregates above as the steadier figures.
  • The copies: more copy volume is what this change is expected to show. A region over APS5_GPU_COPY_MAX_KIB behind pending GPU work is now copied on the GPU, where main waited and read it on the CPU.
  • Traces (comment, release assets): both aps5-trace-*.json.gz files of this pair, with the full tools/trace_digest.py output for each (digest-A.txt, digest-B.txt). Each digest's header gives the same window, presents, frame percentiles and GPU busy as its summary line.
    • Incomplete traces: queue worker 0x0's event buffer filled 21.9 s into A's window (481,507 events lost) and 20.8 s into B's (523,008 lost). So the event traces omit part of that worker's work after those points. The summary lines' phase totals still include it.
    • Slowest frames: A's are 1,266.7, 1,254.0, 1,248.6, 1,093.7 and 1,078.4 ms; B's are 1,467.8, 1,420.2, 1,332.8, 1,274.1 and 1,177.9 ms. In each, the largest slices are queue workers 0x29 to 0x2b waiting idle (Driver.WorkerWait.idle_and_completion_poll) for the whole frame. These are the retained slices only: A's three slowest frames (from 49.6 s) and B's third (23.1 s) come after queue worker 0x0's buffer filled, so that worker's slices for them are missing.
The two same-window lines

A, main b7aeb6f with the diagnostic-counters patch:

{"commit": "3ac73c78593d", "dirty": false, "env": {"APS5_DRAW_PIPELINE": "1", "APS5_LOG_TIMESTAMPS": "1", "APS5_MIMALLOC": "1", "APS5_PIPELINE_DISPATCH": "1", "APS5_PROFILE_DRAW": "1", "APS5_SKIP_REFUSED_DRAWS": "1", "APS5_TRACE_ALL_PHASES": "1", "APS5_TRACE_SECONDS": "0:60", "APS5_TRACE_SUMMARY_EVERY": "10", "APS5_TRACE_TRIGGER_FILE": "<path>"}, "gpu": "NVIDIA GeForce RTX 4070 SUPER", "driver": "NVIDIA 621.24", "os": "Windows 10.0.26300", "cpu": "AMD Ryzen 5 7500F 6-Core Processor", "cpu_threads": 12, "memory_mib": 32372, "title_id": "PPSA23566", "title": "EA SPORTS\u2122 UFC\u00ae 6", "content_version": "01.005.000", "resolution": "1920x1080", "window": {"spec": "seconds 0:60", "first_present": 4445, "ms": 60667.543}, "presents": 62, "frame_ms": {"p50": 974.217, "p90": 1049.354, "p99": 1266.741, "max": 1266.741}, "gpu_busy_ms_per_present": 222.763, "worker_busy_pct": {"queue worker 0x0": 98.097, "queue worker 0x29": 9.814, "queue worker 0x2a": 10.251, "queue worker 0x2b": 10.332, "queue worker 0x2c": 10.578, "queue worker 0x2d": 8.861, "queue worker 0x2e": 8.58, "queue worker 0x2f": 9.797, "queue worker 0x28": 9.756}, "phase_totals_ms": {"Driver.Completion": 1.363, "Driver.Dispatch": 48857.51, "Driver.Dispatch.capture_resources": 740.673, "Driver.Dispatch.decode_key_device_setup": 192.7, "Driver.Dispatch.lookup_cache": 590.147, "Driver.Dispatch.materialize": 144.039, "Driver.Dispatch.prepared_invocation": 104.957, "Driver.Draw": 43847.68, "Driver.Draw.device_setup": 321.63, "Driver.Draw.draw_enqueued": 37429.006, "Driver.Draw.post_compile_prepare": 46.456, "Driver.Draw.prepare": 986.143, "Driver.Draw.shader_compile_and_link": 4943.771, "Driver.EndSubmission": 502.527, "Driver.Packet": 106311.381, "Driver.Packet.device_lock": 113.82, "Driver.Packet.dispatch": 48832.991, "Driver.Packet.draw": 43980.431, "Driver.Packet.execute": 1701.35, "Driver.Packet.flip_flush": 2.227, "Driver.Packet.flush_between_packets": 487.441, "Driver.Packet.memory_wait": 8587.898, "Driver.Packet.pipeline_drain": 259.087, "Driver.Packet.pipeline_prepare": 185.613, "Driver.Packet.prepare_memory": 481.297, "Driver.Packet.rendering_wait": 0.098, "Driver.Present": 69.318, "Driver.Present.acquire_image": 0.93, "Driver.Present.device_setup": 0.03, "Driver.Present.gpu_mutex_wait": 0.594, "Driver.Present.inflight_wait": 0.178, "Driver.Present.present_display_buffer": 8.261, "Driver.Present.queue_present": 26.237, "Driver.Present.release_and_callback": 0.087, "Driver.Present.render_fence_wait": 32.712, "Driver.Present.resize": 0.132, "Driver.Present.validate": 0.023, "Driver.Suspend": 0.011, "GpuMutex.wait.dispatch": 1413.598, "GpuMutex.wait.draw": 36059.61, "GpuMutex.wait.end": 142.186, "GpuMutex.wait.fill": 0.299, "GpuMutex.wait.flush": 103.357, "GpuMutex.wait.hook": 33.336, "GpuMutex.wait.indirect": 0.964, "GpuMutex.wait.label": 518.561, "GpuMutex.wait.other": 0.672, "GpuMutex.wait.present": 0.343, "GpuMutex.wait.wait": 1.23, "Graphics.Draw": 7626.864, "Graphics.Draw.draw_and_resource_release": 6540.725, "Graphics.Draw.index_upload": 569.344, "Graphics.Draw.validate": 392.465, "Graphics.Draw.vertex_upload": 47.69, "Graphics.DrawWithRecipe": 29.235, "Graphics.DrawWithRecipe.draw_and_resource_release": 28.749, "Graphics.DrawWithRecipe.index_upload": 0.023, "Graphics.DrawWithRecipe.validate": 0.207, "Graphics.DrawWithRecipe.vertex_upload": 0.144, "Recorder.Reap": 626.493, "Recorder.Submit": 597.614, "Recorder.Sync": 25584.288, "Recorder.WaitSerial": 4.952, "Resources.Complete": 43545.917, "Resources.Prepare": 1086.663, "Shader.DrawStage": 4340.06, "Shader.DrawStage.capture_resources": 3329.717, "Shader.DrawStage.materialize": 594.025, "Shader.DrawStage.prepared_invocation": 375.737, "Shader.ResolveAbi": 9.236, "Shader.ResolveGraphicsAbi": 4.105, "Shader.ResolveGraphicsStagesAbi": 20.026, "VideoOut.Flip": 75.738, "VideoOut.Flip.completion_mutex_wait": 0.063, "VideoOut.Flip.config_mutex_wait": 0.009, "VideoOut.Flip.frame_limit": 0.03, "VideoOut.Flip.notify_game": 0.45, "VideoOut.Flip.present": 71.766, "VideoOut.Flip.validate": 0.103, "VideoOut.Flip.vblank_wait": 0.044, "VideoOut.Flip.window_prepare": 0.092, "VideoOut.Flip.window_title": 3.153, "VideoOut.Readiness": 0.131, "VideoOut.Readiness.locks_validate": 0.06, "Vulkan.Acquire": 0.864, "Vulkan.Acquire.acquire_fence_wait": 0.13, "Vulkan.Acquire.acquire_image": 0.561, "Vulkan.Acquire.fence_reset": 0.118, "Vulkan.Acquire.retired_swapchains": 0.032, "Vulkan.Dispatch": 43476.893, "Vulkan.Dispatch.command_record": 739.761, "Vulkan.Dispatch.shader_resources": 42711.666, "Vulkan.DispatchRecipe": 62.644, "Vulkan.DispatchRecipe.command_record": 61.951, "Vulkan.DrawFromRecipe": 29.443, "Vulkan.Present": 6.069, "Vulkan.Present.command_record_scale": 2.381, "Vulkan.Present.pixel_upload": 0.459, "Vulkan.Present.queue_submit": 3.173, "Vulkan.QueuePresent": 26.058, "Vulkan.QueuePresent.queue_present": 25.945, "Vulkan.Retire": 32.698, "Vulkan.Retire.wait": 31.637}, "top_phases_ms_per_frame": {"Driver.Packet": 1714.7, "Driver.Dispatch": 788.024, "Driver.Packet.dispatch": 787.629, "Driver.Packet.draw": 709.362, "Driver.Draw": 707.221, "Resources.Complete": 702.353, "Vulkan.Dispatch": 701.24, "Vulkan.Dispatch.shader_resources": 688.898}, "owned_draw_counts": {}, "graphics_track": {"Graphics.Barrier.copy": 240, "Graphics.Barrier.dispatch-lead": 42466, "Graphics.Barrier.dispatch-trail": 56057, "Graphics.Barrier.draw": 82652, "Graphics.Barrier.fill": 1572, "Graphics.Barrier.indirect-args": 7587, "Graphics.Barrier.input-mirror": 14254, "Graphics.Barrier.label-run": 8482, "Graphics.Barrier.present-blit": 124, "Graphics.Barrier.shadow-publish": 2585, "Graphics.Barrier.staging-in": 69860, "Graphics.Barrier.staging-out": 30156, "Graphics.Barrier.storage-upload": 6724, "Graphics.Barrier.storage-writeback": 14791, "Graphics.Barrier.template-refresh": 335, "Graphics.BarrierMerged.dispatch-lead": 28765, "Graphics.BarrierMerged.fill": 184, "Graphics.BarrierMerged.label-run": 86, "Graphics.BarrierMerged.shadow-publish": 2479, "Graphics.BarrierMerged.staging-in": 29553, "Graphics.BarrierMerged.staging-out": 30156, "Graphics.BarrierMerged.storage-writeback": 5049, "Graphics.Copy": 139250, "Graphics.Copy.bytes": 16875346660, "Graphics.RenderPass": 38549, "Graphics.RenderPass.Close.command": 30286, "Graphics.RenderPass.Close.image": 181, "Graphics.RenderPass.Close.key": 1246, "Graphics.RenderPass.Close.label": 86, "Graphics.RenderPass.Close.new-batch": 6750, "Graphics.RenderPass.Continued": 242028}, "trace_dropped": true, "trace_dropped_threads": {"queue worker 0x0": {"events_full_after_s": 21.88, "events_lost": 481507, "totals_full": false}}, "trace": "aps5-trace-3ac73c78593d-11720.json.gz"}

B, their merge cbc3300846 of this PR's 5a09407:

{"commit": "cbc33008466a", "dirty": false, "env": {"APS5_DRAW_PIPELINE": "1", "APS5_LOG_TIMESTAMPS": "1", "APS5_MIMALLOC": "1", "APS5_PIPELINE_DISPATCH": "1", "APS5_PROFILE_DRAW": "1", "APS5_SKIP_REFUSED_DRAWS": "1", "APS5_TRACE_ALL_PHASES": "1", "APS5_TRACE_SECONDS": "0:60", "APS5_TRACE_SUMMARY_EVERY": "10", "APS5_TRACE_TRIGGER_FILE": "<path>"}, "gpu": "NVIDIA GeForce RTX 4070 SUPER", "driver": "NVIDIA 621.24", "os": "Windows 10.0.26300", "cpu": "AMD Ryzen 5 7500F 6-Core Processor", "cpu_threads": 12, "memory_mib": 32372, "title_id": "PPSA23566", "title": "EA SPORTS\u2122 UFC\u00ae 6", "content_version": "01.005.000", "resolution": "1920x1080", "window": {"spec": "seconds 0:60", "first_present": 3584, "ms": 60881.035}, "presents": 63, "frame_ms": {"p50": 945.706, "p90": 1107.58, "p99": 1467.772, "max": 1467.772}, "gpu_busy_ms_per_present": 187.248, "worker_busy_pct": {"queue worker 0x0": 97.616, "queue worker 0x29": 10.314, "queue worker 0x2a": 11.016, "queue worker 0x2b": 10.778, "queue worker 0x2c": 8.872, "queue worker 0x2d": 10.64, "queue worker 0x2e": 10.917, "queue worker 0x2f": 10.046, "queue worker 0x28": 10.118}, "phase_totals_ms": {"Driver.Completion": 1.683, "Driver.Dispatch": 47883.6, "Driver.Dispatch.capture_resources": 746.527, "Driver.Dispatch.decode_key_device_setup": 196.995, "Driver.Dispatch.lookup_cache": 583.098, "Driver.Dispatch.materialize": 166.953, "Driver.Dispatch.prepared_invocation": 99.513, "Driver.Draw": 47402.291, "Driver.Draw.device_setup": 367.482, "Driver.Draw.draw_enqueued": 40494.185, "Driver.Draw.post_compile_prepare": 50.037, "Driver.Draw.prepare": 1066.909, "Driver.Draw.shader_compile_and_link": 5290.617, "Driver.EndSubmission": 420.931, "Driver.Packet": 109356.533, "Driver.Packet.device_lock": 117.496, "Driver.Packet.dispatch": 47861.928, "Driver.Packet.draw": 47534.663, "Driver.Packet.execute": 1517.833, "Driver.Packet.flip_flush": 2.125, "Driver.Packet.flush_between_packets": 534.211, "Driver.Packet.memory_wait": 9644.9, "Driver.Packet.pipeline_drain": 267.762, "Driver.Packet.pipeline_prepare": 193.815, "Driver.Packet.prepare_memory": 511.476, "Driver.Packet.rendering_wait": 0.132, "Driver.Present": 88.626, "Driver.Present.acquire_image": 0.958, "Driver.Present.device_setup": 0.032, "Driver.Present.gpu_mutex_wait": 0.697, "Driver.Present.inflight_wait": 0.179, "Driver.Present.present_display_buffer": 8.64, "Driver.Present.queue_present": 27.49, "Driver.Present.release_and_callback": 0.098, "Driver.Present.render_fence_wait": 50.224, "Driver.Present.resize": 0.133, "Driver.Present.validate": 0.026, "Driver.Suspend": 0.015, "GpuMutex.wait.dispatch": 2238.763, "GpuMutex.wait.draw": 37692.046, "GpuMutex.wait.end": 179.837, "GpuMutex.wait.fill": 0.256, "GpuMutex.wait.flush": 45.701, "GpuMutex.wait.hook": 23.598, "GpuMutex.wait.indirect": 0.734, "GpuMutex.wait.label": 569.519, "GpuMutex.wait.other": 6.159, "GpuMutex.wait.present": 0.457, "GpuMutex.wait.wait": 0.725, "Graphics.Draw": 8827.595, "Graphics.Draw.draw_and_resource_release": 7604.427, "Graphics.Draw.index_upload": 653.428, "Graphics.Draw.validate": 444.998, "Graphics.Draw.vertex_upload": 47.77, "Graphics.DrawWithRecipe": 37.483, "Graphics.DrawWithRecipe.draw_and_resource_release": 37.028, "Graphics.DrawWithRecipe.index_upload": 0.023, "Graphics.DrawWithRecipe.validate": 0.192, "Graphics.DrawWithRecipe.vertex_upload": 0.13, "Recorder.Reap": 613.163, "Recorder.Submit": 570.947, "Recorder.Sync": 23291.265, "Recorder.WaitSerial": 1.753, "Resources.Complete": 41549.272, "Resources.Prepare": 1070.003, "Shader.DrawStage": 4635.947, "Shader.DrawStage.capture_resources": 3556.026, "Shader.DrawStage.materialize": 638.359, "Shader.DrawStage.prepared_invocation": 397.98, "Shader.ResolveAbi": 5.276, "Shader.ResolveGraphicsAbi": 4.879, "Shader.ResolveGraphicsStagesAbi": 17.689, "VideoOut.Flip": 99.788, "VideoOut.Flip.completion_mutex_wait": 0.117, "VideoOut.Flip.config_mutex_wait": 0.01, "VideoOut.Flip.frame_limit": 0.057, "VideoOut.Flip.notify_game": 0.582, "VideoOut.Flip.present": 90.862, "VideoOut.Flip.validate": 0.075, "VideoOut.Flip.vblank_wait": 0.041, "VideoOut.Flip.window_prepare": 0.094, "VideoOut.Flip.window_title": 7.913, "VideoOut.Readiness": 0.13, "VideoOut.Readiness.locks_validate": 0.06, "Vulkan.Acquire": 0.887, "Vulkan.Acquire.acquire_fence_wait": 0.145, "Vulkan.Acquire.acquire_image": 0.578, "Vulkan.Acquire.fence_reset": 0.109, "Vulkan.Acquire.retired_swapchains": 0.032, "Vulkan.Dispatch": 41542.601, "Vulkan.Dispatch.command_record": 765.417, "Vulkan.Dispatch.shader_resources": 40750.716, "Vulkan.DispatchRecipe": 64.13, "Vulkan.DispatchRecipe.command_record": 63.37, "Vulkan.DrawFromRecipe": 37.656, "Vulkan.Present": 6.529, "Vulkan.Present.command_record_scale": 2.446, "Vulkan.Present.pixel_upload": 0.453, "Vulkan.Present.queue_submit": 3.576, "Vulkan.QueuePresent": 27.362, "Vulkan.QueuePresent.queue_present": 27.256, "Vulkan.Retire": 50.23, "Vulkan.Retire.wait": 49.07}, "top_phases_ms_per_frame": {"Driver.Packet": 1735.818, "Driver.Dispatch": 760.057, "Driver.Packet.dispatch": 759.713, "Driver.Packet.draw": 754.518, "Driver.Draw": 752.417, "Resources.Complete": 659.512, "Vulkan.Dispatch": 659.406, "Vulkan.Dispatch.shader_resources": 646.837}, "owned_draw_counts": {}, "graphics_track": {"Graphics.Barrier.dispatch-lead": 45703, "Graphics.Barrier.dispatch-trail": 57634, "Graphics.Barrier.draw": 103043, "Graphics.Barrier.fill": 1365, "Graphics.Barrier.indirect-args": 8157, "Graphics.Barrier.input-mirror": 24229, "Graphics.Barrier.label-run": 9020, "Graphics.Barrier.present-blit": 126, "Graphics.Barrier.shadow-publish": 2592, "Graphics.Barrier.staging-in": 77731, "Graphics.Barrier.staging-out": 34818, "Graphics.Barrier.storage-upload": 6692, "Graphics.Barrier.storage-writeback": 13464, "Graphics.Barrier.template-refresh": 490, "Graphics.BarrierMerged.dispatch-lead": 28245, "Graphics.BarrierMerged.fill": 171, "Graphics.BarrierMerged.label-run": 73, "Graphics.BarrierMerged.shadow-publish": 2432, "Graphics.BarrierMerged.staging-in": 34111, "Graphics.BarrierMerged.staging-out": 34818, "Graphics.BarrierMerged.storage-writeback": 5274, "Graphics.Copy": 152518, "Graphics.Copy.bytes": 25217545222, "Graphics.RenderPass": 48747, "Graphics.RenderPass.Close.command": 40582, "Graphics.RenderPass.Close.image": 188, "Graphics.RenderPass.Close.key": 1208, "Graphics.RenderPass.Close.label": 73, "Graphics.RenderPass.Close.new-batch": 6696, "Graphics.RenderPass.Continued": 238362}, "trace_dropped": true, "trace_dropped_threads": {"queue worker 0x0": {"events_full_after_s": 20.777, "events_lost": 523008, "totals_full": false}}, "trace": "aps5-trace-cbc33008466a-2952.json.gz"}

Tested

  • agc_buffer_upload_pending_gpu_copy (new), run as agc_driver_recorder_tests --pending-upload-gpu-copy-only. The full recorder run includes it too.
    • Setup: a 4 MiB write-watched, host-imported block. A vkCmdCopyBuffer in the open batch writes a 1 MiB pattern at +1 MiB, noted as a pending write.
    • The upload: under the GPU mutex, the build uploads a 3 MiB region at +4100. That's misaligned for storage buffers and three times the old bound.
    • It must make 0 flush-hook waits and 0 submissions, with the producer still pending.
    • The bytes: a GPU copy of the descriptor's bound range must hold the producer's pattern over its megabyte and the original bytes elsewhere. Guest memory must hold the pattern after the sync.
  • Red (main plus the test only): "the upload of a misaligned 3 MiB region over a pending GPU write waited for it on the CPU (1 flush-hook waits, 1 submissions)". Since d75ba83 the message names the write's size: "over a pending 1024 KiB GPU write".
  • Linux (Ubuntu 24.04, GCC 13.3, Release, CI's flags, lavapipe, as an unprivileged user):
    • the new test: ×10, 10 of 10 passed;
    • ctest -R '^agc' once, 1,136 tests: 1,060 passed, 75 skipped, 1 failed. The one failure, agc_driver_image_sample_force_degamma, is that VM's known llvmpipe JIT illegal instruction (vpdpwssd) and fails on main there too.
  • GitHub, ×10 on both runners (run): the new test and the copy and staging tests around it.
    • Linux (llvmpipe 20.1.2): 78 tests, all 10 runs passed, 8 skipped. With main's code, agc_buffer_upload_pending_gpu_copy fails with the message above, and so does agc_driver_recorder, the full recorder run that includes it.
    • Windows: 94 tests, 4 run and passed, 90 skipped. The runner has no Vulkan device, so this test skips there; no Windows red is claimed.
    • Suites: libc and libkernel pass: 198 and 304 tests on Linux, 225 and 326 on Windows.
  • Validation layer (Khronos validation on GitHub's Linux runner, llvmpipe 20.1.2, run): the same 78 tests with the fix report one VUID, VUID-VkDeviceCreateInfo-pNext-pNext, which main's run reports too, so the fix adds none. The layer loaded in both runs. In this mode main's side runs main's own tree, so the new test is only in the fix's side.
  • agc_buffer_upload_pending_gpu_copy_bytes (new in d75ba83), run as agc_driver_recorder_tests --pending-upload-gpu-copy-bytes-only. The full recorder run includes it too. It uploads the same misaligned 3 MiB region with a 4 KiB pending write inside it, at +2 MiB.
    • What both tests now check: where the region is copied, and how many bytes.
      • The bytes: GuestBufferMemory::CopiedBytes() must equal the region's 3 MiB, so nothing is copied twice.
      • On the GPU: the upload must note exactly one read, a GpuCopy read in the open batch. It must cover the region's first and last DWORD and neither DWORD just outside it. A CPU copy notes no read, and over the pending write it would have waited, which the wait check rules out.
    • Red (main's code with the tests, on Linux): both fail at the wait check, "the upload of a misaligned 3 MiB region over a pending 4 KiB GPU write waited for it on the CPU (1 flush-hook waits, 1 submissions)", and the same with 1024 KiB for the first test. In a local build with that check forced to pass, the byte count passes, since main's CPU copy also copies the 3 MiB once. The GPU check fails with "did not copy the region once on the GPU (0 reads noted)".
    • So the change moves the copy and drops the wait: the region's bytes are the same 3 MiB on both.
    • Linux (Ubuntu 24.04, GCC 13.3, Release, CI's flags, lavapipe, LLVM 20.1.2, as an unprivileged user): both tests ×10, 10 of 10 passed. check_test_registration.py and check_conventions.py pass.
    • GitHub, both tests (run):
      • Linux (llvmpipe, LLVM 20.1.2): with main's code both failed in all 3 runs, with the two messages above. With this PR: 2 run, 2 pass, 0 skip, 0 fail, 10 runs in a row.
      • Windows: 2 run, 0 pass, 2 skip (no Vulkan device), 0 fail. No Windows red is claimed.
      • Suites: with this PR, libc and libkernel pass: 199 and 308 tests on Linux, 226 and 330 on Windows. They ran with APS5_SKIP_TIMING_TESTS=1, which relaxes only precise_wait's median bounds on GitHub's hosted runners.
    • Validation layer (Khronos validation on GitHub's Linux runner, llvmpipe, Mesa 25.2.8, LLVM 20.1.2, run): with this PR the layer loaded in both tests, which passed and reported no VUIDs. main's side runs main's own tree, which has neither test, so it made no Vulkan instance and there is nothing to compare. The run is marked failed for that reason.
  • Checks: check_conventions.py and check_test_registration.py pass. MinGW-w64 -fsyntax-only shows no new diagnostic.
  • NVIDIA GeForce RTX 4090, by @domx4q, with the Khronos validation layer (comment): Arch Linux (kernel 7.3.4), GCC 16.2.1 Release, driver 620.70.06, Vulkan 1.4.357, validation layer 1.4.363.1, with ANYPS5_REQUIRE_VULKAN=1 and ANYPS5_NO_SHADER_CACHE=1. This head d75ba83 merged onto main e4caa07 (their merge 4d8299bc5e, clean), against main e4caa07 alone, ctest -R '^agc_(driver_recorder$|buffer_upload|.*(copy|staging))'. main: 55 of 55 pass. This PR: 57 of 57 pass, including the two tests main doesn't have, agc_buffer_upload_pending_gpu_copy and _bytes, each with the layer loaded, and agc_driver_recorder. 19 of the tests create no Vulkan instance. No VUID- line on either side, and every device test selected the RTX 4090.

Overlap:

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Fixes: none
  • Unblocks: none
  • GPUs tested: llvmpipe (Mesa 25.2.8, LLVM 20.1.2) on GitHub's Linux runner and lavapipe on Ubuntu 24.04; NVIDIA GeForce RTX 4070 SUPER (drivers 621.14 and 621.24, Windows 11), by Logan1h; NVIDIA GeForce RTX 4090 (driver 620.70.06, Arch Linux, with the validation layer), by @domx4q
  • AI-assisted: yes

…U whatever its size

A misaligned descriptor region inside a host import is copied out of the
import by the GPU only up to APS5_GPU_COPY_MAX_KIB (1 MiB). A larger one
was read on the CPU, and when a pending GPU write, pending storage results
or a unit shadow covered it, that read waited in the flush hook for the
producer's batch (the [hooksync] "buffer-upload" syncs).

Such a region now takes the GPU copy whatever its size: the copy is
recorded after the producer in batch order, behind the barrier and the
pending-results flush the GPU path already records, so the bytes are the
same and the CPU does not wait. UploadFinish asks the recorder under the
GPU mutex; UploadPrepare, which holds no lock, asks the published
pending-write snapshot. Larger regions behind no GPU work keep the CPU
copy, which never waits for them. Completion write-backs and labels over
the range are still synced first by CompletePendingCpuWrites, so a pending
write the copy sees has landed in the import on the GPU.

The test (agc_buffer_upload_pending_gpu_copy) uploads a 3 MiB misaligned
region over a GPU write still in the open batch: the upload makes no
flush-hook wait and no submission, and a GPU read of the bound buffer
holds the producer's bytes.
@github-actions github-actions Bot added perf Performance change perf numbers missing perf pull request without a before and after summary line labels Oct 30, 2026
@github-actions

Copy link
Copy Markdown

This pull request is labeled perf, so it needs the summary line of a capture on main and one with the change, from the same title, scene and machine, as the Performance report form asks. Please paste both aps5-summary.jsonl lines, attach the two traces and add the output of tools/trace_digest.py.

@github-actions

github-actions Bot commented Oct 30, 2026 •

Copy link
Copy Markdown

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.

Pull request Shared files not compared
PR 1368 core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 1395 core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 1896 docs/dev/ENVIRONMENT.md
PR 4448 core/libs/prx/libSceAgcDriver/Graphics/include/GuestBufferMemory.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 4472 docs/dev/ENVIRONMENT.md
PR 5372 core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
PR 5925 core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 6186 core/libs/prx/libSceAgcDriver/Graphics/include/GuestBufferMemory.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
core/libs/prx/libSceAgcDriver/tests/cmake/agc_driver_recorder_tests.cmake
docs/dev/ENVIRONMENT.md
PR 6188 core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 6192 core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 6197 core/libs/prx/libSceAgcDriver/Graphics/include/GuestBufferMemory.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
PR 6209 core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 6481 core/libs/prx/libSceAgcDriver/Graphics/include/GuestBufferMemory.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
PR 6924 docs/dev/ENVIRONMENT.md
PR 7275 docs/dev/ENVIRONMENT.md
PR 9345 docs/dev/ENVIRONMENT.md
PR 9356 docs/dev/ENVIRONMENT.md
PR 9387 docs/dev/ENVIRONMENT.md
PR 9508 core/libs/prx/libSceAgcDriver/Graphics/include/GuestBufferMemory.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
core/libs/prx/libSceAgcDriver/tests/cmake/agc_driver_recorder_tests.cmake
docs/dev/ENVIRONMENT.md
PR 9712 core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
core/libs/prx/libSceAgcDriver/tests/cmake/agc_driver_recorder_tests.cmake
docs/dev/ENVIRONMENT.md
PR 9852 core/libs/prx/libSceAgcDriver/Graphics/include/GuestBufferMemory.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
docs/dev/ENVIRONMENT.md
PR 10193 core/libs/prx/libSceAgcDriver/Graphics/include/GuestBufferMemory.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
core/libs/prx/libSceAgcDriver/tests/cmake/agc_driver_recorder_tests.cmake
docs/dev/ENVIRONMENT.md
PR 10442 core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
docs/dev/ENVIRONMENT.md
PR 10443 core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
core/libs/prx/libSceAgcDriver/tests/cmake/agc_driver_recorder_tests.cmake
docs/dev/ENVIRONMENT.md
PR 11435 docs/dev/ENVIRONMENT.md
PR 11436 docs/dev/ENVIRONMENT.md
PR 12157 core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
PR 12324 docs/dev/ENVIRONMENT.md
PR 12746 docs/dev/ENVIRONMENT.md
PR 12849 docs/dev/ENVIRONMENT.md
PR 13148 core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
PR 13809 core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
core/libs/prx/libSceAgcDriver/tests/cmake/agc_driver_recorder_tests.cmake
docs/dev/ENVIRONMENT.md
PR 13863 core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
core/libs/prx/libSceAgcDriver/tests/cmake/agc_driver_recorder_tests.cmake
docs/dev/ENVIRONMENT.md
PR 13920 core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
core/libs/prx/libSceAgcDriver/tests/cmake/agc_driver_recorder_tests.cmake
docs/dev/ENVIRONMENT.md
PR 13928 core/libs/prx/libSceAgcDriver/Graphics/include/GuestBufferMemory.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
core/libs/prx/libSceAgcDriver/tests/cmake/agc_driver_recorder_tests.cmake
docs/dev/ENVIRONMENT.md
PR 13929 core/libs/prx/libSceAgcDriver/Graphics/include/GuestBufferMemory.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
core/libs/prx/libSceAgcDriver/tests/cmake/agc_driver_recorder_tests.cmake
docs/dev/ENVIRONMENT.md
PR 14262 core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
core/libs/prx/libSceAgcDriver/tests/cmake/agc_driver_recorder_tests.cmake
docs/dev/ENVIRONMENT.md
PR 15136 core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
core/libs/prx/libSceAgcDriver/tests/cmake/agc_driver_recorder_tests.cmake
PR 15296 core/libs/prx/libSceAgcDriver/Graphics/include/GuestBufferMemory.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
PR 15529 core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
core/libs/prx/libSceAgcDriver/tests/cmake/agc_driver_recorder_tests.cmake
docs/dev/ENVIRONMENT.md
PR 15548 docs/dev/ENVIRONMENT.md
PR 15570 core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
core/libs/prx/libSceAgcDriver/tests/cmake/agc_driver_recorder_tests.cmake
docs/dev/ENVIRONMENT.md
PR 15621 core/libs/prx/libSceAgcDriver/Graphics/include/GuestBufferMemory.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
PR 16793 docs/dev/ENVIRONMENT.md
PR 16831 core/libs/prx/libSceAgcDriver/Graphics/include/GuestBufferMemory.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
docs/dev/ENVIRONMENT.md
PR 17611 docs/dev/ENVIRONMENT.md
PR 18082 core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
core/libs/prx/libSceAgcDriver/tests/cmake/agc_driver_recorder_tests.cmake
docs/dev/ENVIRONMENT.md
PR 18173 core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
core/libs/prx/libSceAgcDriver/tests/cmake/agc_driver_recorder_tests.cmake
docs/dev/ENVIRONMENT.md
PR 18226 docs/dev/ENVIRONMENT.md
PR 18293 docs/dev/ENVIRONMENT.md
PR 18369 core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
core/libs/prx/libSceAgcDriver/tests/cmake/agc_driver_recorder_tests.cmake
docs/dev/ENVIRONMENT.md
PR 19054 core/libs/prx/libSceAgcDriver/Graphics/include/GuestBufferMemory.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
docs/dev/ENVIRONMENT.md
PR 19130 docs/dev/ENVIRONMENT.md
PR 19445 docs/dev/ENVIRONMENT.md
PR 19697 core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
core/libs/prx/libSceAgcDriver/tests/cmake/agc_driver_recorder_tests.cmake
docs/dev/ENVIRONMENT.md
PR 20172 docs/dev/ENVIRONMENT.md
PR 20187 docs/dev/ENVIRONMENT.md
PR 20315 core/libs/prx/libSceAgcDriver/Graphics/include/GuestBufferMemory.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
core/libs/prx/libSceAgcDriver/tests/cmake/agc_driver_recorder_tests.cmake
docs/dev/ENVIRONMENT.md
PR 20519 docs/dev/ENVIRONMENT.md
PR 20831 core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 21238 core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
core/libs/prx/libSceAgcDriver/tests/cmake/agc_driver_recorder_tests.cmake
docs/dev/ENVIRONMENT.md
PR 21746 docs/dev/ENVIRONMENT.md
PR 22018 core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
core/libs/prx/libSceAgcDriver/tests/cmake/agc_driver_recorder_tests.cmake
PR 22190 core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
core/libs/prx/libSceAgcDriver/tests/cmake/agc_driver_recorder_tests.cmake
docs/dev/ENVIRONMENT.md
PR 22424 docs/dev/ENVIRONMENT.md
PR 22434 docs/dev/ENVIRONMENT.md
PR 22647 core/libs/prx/libSceAgcDriver/Graphics/include/GuestBufferMemory.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
docs/dev/ENVIRONMENT.md
PR 22697 core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
core/libs/prx/libSceAgcDriver/tests/cmake/agc_driver_recorder_tests.cmake
docs/dev/ENVIRONMENT.md
PR 22944 core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
docs/dev/ENVIRONMENT.md
PR 22957 core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
docs/dev/ENVIRONMENT.md
PR 23058 core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
core/libs/prx/libSceAgcDriver/tests/cmake/agc_driver_recorder_tests.cmake
PR 23234 core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
PR 23243 docs/dev/ENVIRONMENT.md
PR 23244 docs/dev/ENVIRONMENT.md
PR 23248 docs/dev/ENVIRONMENT.md

@github-actions github-actions Bot added build docs agc libSceAgc* needs rebase Conflicts with main, rebase needed labels Oct 31, 2026
The conflict in core/libs/prx/libSceAgcDriver/CMakeLists.txt from boykopovar#12862's split is resolved with tools/agc_test_split.py resolve, which moves this PR's test registrations into tests/cmake/.
@github-actions github-actions Bot removed the needs rebase Conflicts with main, rebase needed label Nov 1, 2026

@CnRJay CnRJay left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The perf(agc) title makes a speed claim, and the evidence for it does not meet the bar yet.

  1. No tools/trace_digest.py summaries. The only numbers are APS5_PROFILE_DRAW=1 [hooksync] lines for main ("65 syncs, 238 ms", "29 syncs, 364 ms" per 10 s). Those say the waits exist, not that removing them makes the scene faster. Please attach trace_digest summaries of main and of this branch from the same machine and scene (frame p50/p90/p99, GPU busy per present), with the RE Village menu named by title ID and a log line showing the large pending-write upload is reached on main.

  2. No hardware GPU. "GPUs tested" lists llvmpipe/lavapipe only. The change turns a CPU Read into a vkCmdCopyBuffer of unbounded size into the open batch, so the cost moves to the GPU timeline. On a discrete card that copy reads from a host-imported system-memory range over PCIe, and with APS5_GPU_COPY_MAX_KIB removed as a bound for this case a 3+ MiB (or much larger) descriptor range is copied on every build behind pending work. Please run it on a real GPU and show GPU busy per present does not rise.

  3. The size bound is removed, not replaced. copyBehindGpuWork has no upper limit and no per-frame budget. Is there a case where the pending overlap is a few bytes inside a very large descriptor range (PendingWriteOverlaps / AnyShadowedOverlaps on region.begin..region.end)? Then the whole region is GPU-copied to avoid waiting for a small producer. A test with a small pending write inside a large region, counting copied bytes, would show whether that is bounded.

@EagleBearerYS

Copy link
Copy Markdown
Contributor Author

@CnRJay, thanks. This stays a draft until a pair decides the speed claim, and points 1 and 2 are what it needs before it's ready: trace_digest.py summaries of main and of this branch from the same machine and scene, on a hardware GPU, with GPU busy per present.

On point 3, from the code: as you say, the size bound is removed for this case, not replaced. When a pending write, a pending storage result or a shadowed range overlaps any part of the region, the GPU copies the whole region behind that work. For a region over the bound, main reads the same whole region on the CPU after waiting for the producer. So this PR changes where the copy runs and drops the wait, not how many bytes are copied. A test with a small pending write inside a large region, counting the copied bytes, would show that, and it's needed before this is marked ready too.

@mrfelek

mrfelek commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

PPSA22408 (Hot Wheels Infinite Rush), garage menu: no effect from this PR, and where the GPU copy is skipped

Linux, RTX 3080 Ti (NVIDIA 615.71.09), Ubuntu 26.10, Linux 7.3, Release. Same route into the garage each run, default settings, headless, APS5_DIAG_SYNC=1 in both arms.

Both arms contain the same local diagnostic (a stack counter on the flush hook's GPU waits). It is not part of any PR. A and B were alternated, two runs each, 266 s per run, and the table is the garage window (about 110 s on).

A B
Presents per second 6.72, 6.75 6.75, 6.67
GPU busy per present 86.1, 86.2 ms 86.1, 86.2 ms
Flush-hook syncs per 10 s 1,970 / 1,934 1,950 / 1,942
Time waited in them per 10 s 6.22 / 6.21 s 6.21 / 6.11 s

The row this PR targets is unchanged. In the first pair of runs, GuestBufferMemory::copyRegion called from UploadFinish (a CPU read of 648,000 bytes, a pending-write sync) is 67 syncs and 1,046 ms per 10 s in A and 67 syncs and 1,047 ms in B. That is about 16 ms per frame.

Why the GPU copy isn't reached. I printed the region at the copyRegion call in the steady garage state (sampled every 200th call):

importCovers=0 sparse=0 hostBacked=0 writable=1 eligible=1 behindSnapshot=1 anyPending=1 direct=0 recorder=1

The region passes this PR's eligibility test (eligible=1, with pending GPU work over it), but no host import covers it, so entry is null and the GPU-copy branch is never considered. The region's address also moves between frames. The imports aren't being refused (refused 0, failed 0 at shutdown). I haven't yet checked why importAccess makes none for it. I suspect the guest-allocation lease doesn't cover the whole region, but that is a guess.

So for this title the limit isn't the size cap or the eligibility rule. It is import coverage of this region. A question for the author: should the GPU copy be possible without a covering import, for example from a copy of the guest bytes?

I can paste the four aps5-summary.jsonl lines (A and B) if they help with the perf label.

AI-assisted.

@EagleBearerYS

Copy link
Copy Markdown
Contributor Author

@mrfelek, thanks for the pair. It answers the question for Hot Wheels Infinite Rush (PPSA22408): this PR doesn't reach that region.

Your guess about the lease matches the code. In UploadFinish, a region with no import yet gets one from importAccess (GuestBufferMemory.cpp L2437-2440 at this PR's head 5a09407). That function makes an import only when the registered allocations cover the whole region (runCovers(lease, begin, end)); otherwise it only looks up an existing one. So entry stays null and the region takes the CPU copy. That's the "a region no single import covers" case in the description, which this PR leaves as it is.

On a GPU copy from a copy of the guest bytes: making that copy is the CPU read this PR avoids. The bytes it needs are the ones the pending write produces, so taking them on the CPU means waiting for that write first, as copyRegion does now. The GPU copy avoids the wait only because its source is the import the producer writes through.

The case that can still go on the GPU is a region that crosses the boundary between two registered allocations, each with its own import. Utku Halis's e10f59a (in #12082, which its author closed) splits such a region into the imports it covers and copies it piece by piece. We keep it, with a follow-up for the pending-work case, on fix/agc-buffer-upload-pending-gpu-copy-spans, on top of this PR's first head. Whether it applies here depends on why runCovers fails: if the region crosses two registered allocations, it would apply; if part of it runs past registered memory, nothing here would.

The summary lines aren't needed for this one, since the pair shows no change. This stays a draft: its speed claim still needs a Resident Evil Village (PPSA01556) pair, which isn't planned yet.

@Logan1h

Logan1h commented Nov 15, 2026

Copy link
Copy Markdown
Contributor

Hardware verification + a paired in-game measurement of this PR on UFC 6 (PPSA23566).

Setup

Merge with current main (incl. #16648) — clean

The PR predates #16648, so I audited the interaction after merging:

  • The widened path only takes non-staged regions, so region.deviceLocal == false there → takeCarriedShadow() is unreachable for it; no carried-shadow interaction.
  • recorder->Keep(region->buffer) lands before the CopyBuffer, NotePendingRead after, the leading barrier orders SHADER_WRITE|TRANSFER_WRITE|HOST_WRITE → TRANSFER_READ, and FlushKeyStoresOverlapping/FlushStoresOverlapping run before the copies. No conflicts, no logic changes needed.

Focused tests on hardware (not SwiftShader)

ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation:

  • agc_buffer_upload_pending_gpu_copy (this PR's new test), agc_driver_depth_plane_sampling, agc_driver_depth_plane_sampling_evicting, agc_driver_draw_recipe_data — 4/4 Passed, 0 VUID- lines on the RTX 4070 SUPER.

Same-scene A/B, manual combat (10 s windows, per present)

Both runs from the same save, driven by hand into the same practice fight; combat windows only (A: 34 windows, B: 23).

Metric A (main) B (+PR) Δ
Fight load (save-read → vvms/training) 554.8 s 305.0 s −45%
Presents per 10 s 8.2 12.7 +55%
frame p50 / p90 856 / 1165 ms 821 / 932 ms −4% / −20%
GPU busy per present 305 ms 196 ms −36%
UploadFinish wait (ThreadWaitedMs) 116 ms 64 ms −45%
CompletePendingCpuWrites wait 91 ms 58 ms −36%
upload classify + cpu-copy wait 24.5 ms 6.0 ms −76%
[hooksync] buffer-upload waits 81 ms 35 ms −57%

UploadFinish calls per present are identical (552 vs 548), so this is the same workload.

Full raw logs (aps5-summary.jsonl + driver logs for both arms) are available if useful.

One disclosure

One of the two B runs stalled on the loading screen (renderer kept presenting at ~1.8 FPS, but game-logic events stopped entirely after the save read). A retry with the identical binary and save state loaded the fight in 305 s — faster than baseline — so I attribute that stall to a pre-existing intermittent issue on main, not to this PR (a byte-integrity review of the merged path came back clean as described above). Mentioning it so the data set is complete.

Net: this PR is a real, measurable win in this title's combat scene — the pending-write wait that used to serialize the upload path is mostly gone, and nothing in the remaining profile suggests it moved the cost somewhere worse. Nice change.

@EagleBearerYS

Copy link
Copy Markdown
Contributor Author

@Logan1h thanks for the hardware run, the UFC 6 (PPSA23566) pair, and the audit of the merge with #16648. It's the first pair for this PR on a hardware GPU in a scene the change reaches: same machine, save and fight, GPU busy per present 305 → 196 ms, with the same workload by your UploadFinish count (552 vs 548 per present). Thanks too for including the stalled B run.

The copied-bytes test from earlier in this thread (a small pending write inside a large region) is still ours to add.

EagleBearerYS added a commit to EagleBearerYS/AnyPS5 that referenced this pull request Nov 15, 2026
@EagleBearerYS

Copy link
Copy Markdown
Contributor Author

@Logan1h thanks again for the offer. Yes, please, to the aps5-summary.jsonl lines of both arms, pasted as text in a comment. With one line from main and one with this PR, the perf numbers missing label can clear.

The copied-bytes test is on the branch now (d75ba83).

@Logan1h

Logan1h commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

@EagleBearerYS Sure — here is one combat-window line per arm, pasted as text. Both are the window closest to the arm's median frame p50 across that arm's combat windows (34 for A, 23 for B; same save, same practice fight, manual drive). Aggregates and setup are in the table above.

main (b7aeb6f406 + the diagnostic-counters patch), arm A:

{"commit": "3ac73c78593d", "dirty": false, "env": {"APS5_DRAW_PIPELINE": "1", "APS5_LOG_TIMESTAMPS": "1", "APS5_MIMALLOC": "1", "APS5_PIPELINE_DISPATCH": "1", "APS5_PROFILE_DRAW": "1", "APS5_SKIP_REFUSED_DRAWS": "1", "APS5_TRACE_SUMMARY_EVERY": "10"}, "gpu": "NVIDIA GeForce RTX 4070 SUPER", "driver": "NVIDIA 621.14", "os": "Windows 10.0.26300", "cpu": "AMD Ryzen 5 7500F 6-Core Processor", "cpu_threads": 12, "memory_mib": 32372, "title_id": "PPSA23566", "title": "EA SPORTS\u2122 UFC\u00ae 6", "content_version": "01.005.000", "resolution": "1920x1080", "window": {"spec": "summary_every 10", "first_present": 188038, "ms": 10300.394}, "interval_start_s": 4287.852, "interval_end_s": 4298.152, "presents": 11, "frame_ms": {"p50": 856.462, "p90": 1212.137, "p99": 1225.667, "max": 1225.667}, "gpu_busy_ms_per_present": 403.24, "worker_busy_pct": {"queue worker 0x0": 94.218, "queue worker 0x29": 11.784, "queue worker 0x2a": 12.573, "queue worker 0x2b": 13.764, "queue worker 0x2c": 6.193, "queue worker 0x2d": 5.753, "queue worker 0x2e": 6.246, "queue worker 0x2f": 5.635, "queue worker 0x28": 5.737}, "phase_totals_ms": {"Driver.Completion": 0.214, "Driver.Dispatch": 7205.413, "Driver.Dispatch.capture_resources": 88.665, "Driver.Dispatch.decode_key_device_setup": 21.525, "Driver.Dispatch.lookup_cache": 121.337, "Driver.Dispatch.materialize": 172.912, "Driver.Dispatch.prepared_invocation": 12.024, "Driver.Draw": 6819.909, "Driver.Draw.device_setup": 53.637, "Driver.Draw.draw_enqueued": 5567.354, "Driver.Draw.post_compile_prepare": 7.158, "Driver.Draw.prepare": 296.854, "Driver.Draw.shader_compile_and_link": 875.827, "Driver.EndSubmission": 69.356, "Driver.Packet": 16606.981, "Driver.Packet.device_lock": 18.976, "Driver.Packet.dispatch": 7115.354, "Driver.Packet.draw": 6839.514, "Driver.Packet.execute": 466.599, "Driver.Packet.flip_flush": 0.352, "Driver.Packet.flush_between_packets": 84.035, "Driver.Packet.memory_wait": 1695.822, "Driver.Packet.pipeline_drain": 89.688, "Driver.Packet.pipeline_prepare": 29.644, "Driver.Packet.prepare_memory": 98.816, "Driver.Packet.rendering_wait": 0.018, "Driver.Present": 72.754, "Driver.Present.acquire_image": 0.176, "Driver.Present.device_setup": 0.006, "Driver.Present.gpu_mutex_wait": 0.102, "Driver.Present.inflight_wait": 0.035, "Driver.Present.present_display_buffer": 1.562, "Driver.Present.queue_present": 4.772, "Driver.Present.release_and_callback": 0.014, "Driver.Present.render_fence_wait": 66.031, "Driver.Present.resize": 0.027, "Driver.Present.validate": 0.005, "Driver.Suspend": 0.003, "GpuMutex.wait.dispatch": 342.443, "GpuMutex.wait.draw": 4645.961, "GpuMutex.wait.end": 68.032, "GpuMutex.wait.fill": 0.026, "GpuMutex.wait.flush": 14.202, "GpuMutex.wait.hook": 90.999, "GpuMutex.wait.indirect": 0.311, "GpuMutex.wait.label": 38.068, "GpuMutex.wait.other": 0.071, "GpuMutex.wait.present": 0.062, "GpuMutex.wait.wait": 0.086, "Graphics.Draw": 2107.219, "Graphics.Draw.draw_and_resource_release": 1914.387, "Graphics.Draw.index_upload": 108.775, "Graphics.Draw.validate": 65.736, "Graphics.Draw.vertex_upload": 7.565, "Graphics.DrawWithRecipe": 2.751, "Graphics.DrawWithRecipe.draw_and_resource_release": 2.689, "Graphics.DrawWithRecipe.index_upload": 0.003, "Graphics.DrawWithRecipe.validate": 0.028, "Graphics.DrawWithRecipe.vertex_upload": 0.018, "Recorder.Reap": 79.277, "Recorder.Submit": 119.37, "Recorder.Sync": 3872.204, "Recorder.WaitSerial": 109.118, "Resources.Complete": 6153.95, "Resources.Prepare": 234.482, "Shader.DrawStage": 750.588, "Shader.DrawStage.capture_resources": 562.537, "Shader.DrawStage.materialize": 116.963, "Shader.DrawStage.prepared_invocation": 63.87, "Shader.ResolveAbi": 0.43, "Shader.ResolveGraphicsAbi": 0.523, "Shader.ResolveGraphicsStagesAbi": 1.812, "VideoOut.Flip": 73.927, "VideoOut.Flip.completion_mutex_wait": 0.011, "VideoOut.Flip.config_mutex_wait": 0.002, "VideoOut.Flip.frame_limit": 0.008, "VideoOut.Flip.notify_game": 0.084, "VideoOut.Flip.present": 73.07, "VideoOut.Flip.validate": 0.014, "VideoOut.Flip.vblank_wait": 0.009, "VideoOut.Flip.window_prepare": 0.025, "VideoOut.Flip.window_title": 0.7, "VideoOut.Readiness": 0.024, "VideoOut.Readiness.locks_validate": 0.011, "Vulkan.Acquire": 0.164, "Vulkan.Acquire.acquire_fence_wait": 0.024, "Vulkan.Acquire.acquire_image": 0.108, "Vulkan.Acquire.fence_reset": 0.021, "Vulkan.Acquire.retired_swapchains": 0.007, "Vulkan.ComputePipeline": 41.235, "Vulkan.Dispatch": 5926.275, "Vulkan.Dispatch.command_record": 68.606, "Vulkan.Dispatch.shader_resources": 5854.082, "Vulkan.DispatchRecipe": 18.939, "Vulkan.DispatchRecipe.command_record": 18.848, "Vulkan.DrawFromRecipe": 2.77, "Vulkan.Present": 1.121, "Vulkan.Present.command_record_scale": 0.466, "Vulkan.Present.pixel_upload": 0.06, "Vulkan.Present.queue_submit": 0.587, "Vulkan.QueuePresent": 4.748, "Vulkan.QueuePresent.queue_present": 4.73, "Vulkan.Retire": 66.025, "Vulkan.Retire.wait": 65.862}, "top_phases_ms_per_frame": {"Driver.Packet": 1509.726, "Driver.Dispatch": 655.038, "Driver.Packet.dispatch": 646.85, "Driver.Packet.draw": 621.774, "Driver.Draw": 619.992, "Resources.Complete": 559.45, "Vulkan.Dispatch": 538.752, "Vulkan.Dispatch.shader_resources": 532.189}, "owned_draw_counts": {}, "graphics_track": {"Graphics.Barrier.copy": 76, "Graphics.Barrier.dispatch-lead": 4126, "Graphics.Barrier.dispatch-trail": 6230, "Graphics.Barrier.draw": 14587, "Graphics.Barrier.fill": 172, "Graphics.Barrier.indirect-args": 814, "Graphics.Barrier.input-mirror": 4169, "Graphics.Barrier.label-run": 1302, "Graphics.Barrier.present-blit": 22, "Graphics.Barrier.shadow-publish": 857, "Graphics.Barrier.staging-in": 2387, "Graphics.Barrier.staging-out": 1291, "Graphics.Barrier.storage-upload": 1528, "Graphics.Barrier.storage-writeback": 3020, "Graphics.Barrier.template-refresh": 17, "Graphics.BarrierMerged.dispatch-lead": 3732, "Graphics.BarrierMerged.fill": 26, "Graphics.BarrierMerged.label-run": 12, "Graphics.BarrierMerged.shadow-publish": 827, "Graphics.BarrierMerged.staging-in": 1893, "Graphics.BarrierMerged.staging-out": 1291, "Graphics.BarrierMerged.storage-writeback": 923, "Graphics.Copy": 8503, "Graphics.Copy.bytes": 369511974, "Graphics.RenderPass": 6959, "Graphics.RenderPass.Close.command": 5954, "Graphics.RenderPass.Close.image": 47, "Graphics.RenderPass.Close.key": 159, "Graphics.RenderPass.Close.label": 12, "Graphics.RenderPass.Close.new-batch": 787, "Graphics.RenderPass.Continued": 37843}, "trace_dropped": false, "trace": ""}

this PR (merge cbc3300846 of 5a09407), arm B:

{"commit": "cbc33008466a", "dirty": false, "env": {"APS5_DRAW_PIPELINE": "1", "APS5_LOG_TIMESTAMPS": "1", "APS5_MIMALLOC": "1", "APS5_PIPELINE_DISPATCH": "1", "APS5_PROFILE_DRAW": "1", "APS5_SKIP_REFUSED_DRAWS": "1", "APS5_TRACE_SUMMARY_EVERY": "10"}, "gpu": "NVIDIA GeForce RTX 4070 SUPER", "driver": "NVIDIA 621.14", "os": "Windows 10.0.26300", "cpu": "AMD Ryzen 5 7500F 6-Core Processor", "cpu_threads": 12, "memory_mib": 32372, "title_id": "PPSA23566", "title": "EA SPORTS\u2122 UFC\u00ae 6", "content_version": "01.005.000", "resolution": "1920x1080", "window": {"spec": "summary_every 10", "first_present": 3835, "ms": 10279.705}, "interval_start_s": 839.79, "interval_end_s": 850.07, "presents": 12, "frame_ms": {"p50": 820.98, "p90": 1053.6, "p99": 1080.731, "max": 1080.731}, "gpu_busy_ms_per_present": 194.206, "worker_busy_pct": {"queue worker 0x0": 96.707, "queue worker 0x29": 6.322, "queue worker 0x2a": 5.961, "queue worker 0x2b": 6.351, "queue worker 0x2c": 12.333, "queue worker 0x2d": 13.018, "queue worker 0x2e": 14.13, "queue worker 0x2f": 14.511, "queue worker 0x28": 6.567}, "phase_totals_ms": {"Driver.Completion": 0.347, "Driver.Dispatch": 7704.94, "Driver.Dispatch.capture_resources": 127.952, "Driver.Dispatch.decode_key_device_setup": 35.12, "Driver.Dispatch.lookup_cache": 73.628, "Driver.Dispatch.materialize": 23.495, "Driver.Dispatch.prepared_invocation": 17.098, "Driver.Draw": 7365.637, "Driver.Draw.device_setup": 61.581, "Driver.Draw.draw_enqueued": 6112.491, "Driver.Draw.post_compile_prepare": 19.801, "Driver.Draw.prepare": 177.521, "Driver.Draw.shader_compile_and_link": 971.043, "Driver.EndSubmission": 140.611, "Driver.Packet": 17941.023, "Driver.Packet.device_lock": 21.89, "Driver.Packet.dispatch": 7688.551, "Driver.Packet.draw": 7389.123, "Driver.Packet.execute": 501.559, "Driver.Packet.flip_flush": 4.481, "Driver.Packet.flush_between_packets": 100.013, "Driver.Packet.memory_wait": 1646.57, "Driver.Packet.pipeline_drain": 38.013, "Driver.Packet.pipeline_prepare": 35.824, "Driver.Packet.prepare_memory": 100.501, "Driver.Packet.rendering_wait": 0.022, "Driver.Present": 12.582, "Driver.Present.acquire_image": 0.171, "Driver.Present.device_setup": 0.006, "Driver.Present.gpu_mutex_wait": 0.075, "Driver.Present.inflight_wait": 0.031, "Driver.Present.present_display_buffer": 1.819, "Driver.Present.queue_present": 5.234, "Driver.Present.release_and_callback": 0.015, "Driver.Present.render_fence_wait": 5.18, "Driver.Present.resize": 0.024, "Driver.Present.validate": 0.004, "Driver.Suspend": 0.002, "GpuMutex.wait.dispatch": 223.65, "GpuMutex.wait.draw": 6011.895, "GpuMutex.wait.end": 39.734, "GpuMutex.wait.fill": 0.024, "GpuMutex.wait.flush": 8.453, "GpuMutex.wait.hook": 0.101, "GpuMutex.wait.indirect": 0.108, "GpuMutex.wait.label": 46.798, "GpuMutex.wait.present": 0.036, "GpuMutex.wait.wait": 0.123, "Graphics.Draw": 1447.216, "Graphics.Draw.draw_and_resource_release": 1263.996, "Graphics.Draw.index_upload": 87.755, "Graphics.Draw.validate": 74.484, "Graphics.Draw.vertex_upload": 8.329, "Graphics.DrawWithRecipe": 5.481, "Graphics.DrawWithRecipe.draw_and_resource_release": 5.376, "Graphics.DrawWithRecipe.index_upload": 0.005, "Graphics.DrawWithRecipe.validate": 0.045, "Graphics.DrawWithRecipe.vertex_upload": 0.032, "Recorder.Reap": 88.973, "Recorder.Submit": 99.334, "Recorder.Sync": 3605.844, "Recorder.WaitSerial": 0.194, "Resources.Complete": 6708.887, "Resources.Prepare": 157.835, "Shader.DrawStage": 841.355, "Shader.DrawStage.capture_resources": 648.685, "Shader.DrawStage.materialize": 112.291, "Shader.DrawStage.prepared_invocation": 72.756, "Shader.ResolveAbi": 1.12, "Shader.ResolveGraphicsAbi": 0.794, "Shader.ResolveGraphicsStagesAbi": 3.894, "VideoOut.Flip": 13.62, "VideoOut.Flip.completion_mutex_wait": 0.012, "VideoOut.Flip.config_mutex_wait": 0.002, "VideoOut.Flip.frame_limit": 0.006, "VideoOut.Flip.notify_game": 0.085, "VideoOut.Flip.present": 12.895, "VideoOut.Flip.validate": 0.015, "VideoOut.Flip.vblank_wait": 0.008, "VideoOut.Flip.window_prepare": 0.017, "VideoOut.Flip.window_title": 0.577, "VideoOut.Readiness": 0.024, "VideoOut.Readiness.locks_validate": 0.011, "Vulkan.Acquire": 0.159, "Vulkan.Acquire.acquire_fence_wait": 0.025, "Vulkan.Acquire.acquire_image": 0.104, "Vulkan.Acquire.fence_reset": 0.021, "Vulkan.Acquire.retired_swapchains": 0.006, "Vulkan.Dispatch": 6678.578, "Vulkan.Dispatch.command_record": 126.724, "Vulkan.Dispatch.shader_resources": 6546.945, "Vulkan.DispatchRecipe": 9.627, "Vulkan.DispatchRecipe.command_record": 9.501, "Vulkan.DrawFromRecipe": 5.515, "Vulkan.Present": 1.437, "Vulkan.Present.command_record_scale": 0.471, "Vulkan.Present.pixel_upload": 0.079, "Vulkan.Present.queue_submit": 0.878, "Vulkan.QueuePresent": 5.214, "Vulkan.QueuePresent.queue_present": 5.196, "Vulkan.Retire": 5.182, "Vulkan.Retire.wait": 4.993}, "top_phases_ms_per_frame": {"Driver.Packet": 1495.085, "Driver.Dispatch": 642.078, "Driver.Packet.dispatch": 640.713, "Driver.Packet.draw": 615.76, "Driver.Draw": 613.803, "Resources.Complete": 559.074, "Vulkan.Dispatch": 556.548, "Vulkan.Dispatch.shader_resources": 545.579}, "owned_draw_counts": {"OwnedDraw.evicted_other": 66}, "graphics_track": {"Graphics.Barrier.dispatch-lead": 7665, "Graphics.Barrier.dispatch-trail": 10669, "Graphics.Barrier.draw": 12226, "Graphics.Barrier.fill": 262, "Graphics.Barrier.indirect-args": 1476, "Graphics.Barrier.input-mirror": 859, "Graphics.Barrier.label-run": 1698, "Graphics.Barrier.present-blit": 24, "Graphics.Barrier.shadow-publish": 455, "Graphics.Barrier.staging-in": 13353, "Graphics.Barrier.staging-out": 5858, "Graphics.Barrier.storage-upload": 1296, "Graphics.Barrier.storage-writeback": 2663, "Graphics.Barrier.template-refresh": 38, "Graphics.BarrierMerged.dispatch-lead": 5956, "Graphics.BarrierMerged.fill": 28, "Graphics.BarrierMerged.label-run": 14, "Graphics.BarrierMerged.shadow-publish": 443, "Graphics.BarrierMerged.staging-in": 6201, "Graphics.BarrierMerged.staging-out": 5858, "Graphics.BarrierMerged.storage-writeback": 1028, "Graphics.Copy": 25125, "Graphics.Copy.bytes": 3778831928, "Graphics.RenderPass": 5592, "Graphics.RenderPass.Close.command": 4037, "Graphics.RenderPass.Close.image": 26, "Graphics.RenderPass.Close.key": 252, "Graphics.RenderPass.Close.label": 14, "Graphics.RenderPass.Close.new-batch": 1263, "Graphics.RenderPass.Continued": 48591}, "trace_dropped": false, "trace": ""}

@EagleBearerYS

Copy link
Copy Markdown
Contributor Author

@Logan1h thanks for the two lines, and for picking each arm's window nearest its median frame p50. They're in the description now, under UFC 6, with the numbers they show: GPU busy per present 403 ms on main and 194 ms with this PR in those windows.

One correction to what I wrote earlier: the perf numbers missing label doesn't clear with them. tools/pr_labels.py only accepts two lines from the same window. It reads summary_every windows that start at different presents as different configurations (window.first_present 188038 and 3835 here). That's down to how the check works, not to your lines.

@Logan1h

Logan1h commented Nov 16, 2026

Copy link
Copy Markdown
Contributor

Same-window pair, taken with APS5_TRACE_SECONDS=0:60 + a trigger file opened once the fight was on screen in each run (same save, same practice fight, manual drive; identical env on both arms). tools/performance_compare.py reports no configuration differences between them.

main (b7aeb6f406 + the diagnostic-counters patch), arm A:

{"commit": "3ac73c78593d", "dirty": false, "env": {"APS5_DRAW_PIPELINE": "1", "APS5_LOG_TIMESTAMPS": "1", "APS5_MIMALLOC": "1", "APS5_PIPELINE_DISPATCH": "1", "APS5_PROFILE_DRAW": "1", "APS5_SKIP_REFUSED_DRAWS": "1", "APS5_TRACE_ALL_PHASES": "1", "APS5_TRACE_SECONDS": "0:60", "APS5_TRACE_SUMMARY_EVERY": "10", "APS5_TRACE_TRIGGER_FILE": "<path>"}, "gpu": "NVIDIA GeForce RTX 4070 SUPER", "driver": "NVIDIA 621.24", "os": "Windows 10.0.26300", "cpu": "AMD Ryzen 5 7500F 6-Core Processor", "cpu_threads": 12, "memory_mib": 32372, "title_id": "PPSA23566", "title": "EA SPORTS\u2122 UFC\u00ae 6", "content_version": "01.005.000", "resolution": "1920x1080", "window": {"spec": "seconds 0:60", "first_present": 4445, "ms": 60667.543}, "presents": 62, "frame_ms": {"p50": 974.217, "p90": 1049.354, "p99": 1266.741, "max": 1266.741}, "gpu_busy_ms_per_present": 222.763, "worker_busy_pct": {"queue worker 0x0": 98.097, "queue worker 0x29": 9.814, "queue worker 0x2a": 10.251, "queue worker 0x2b": 10.332, "queue worker 0x2c": 10.578, "queue worker 0x2d": 8.861, "queue worker 0x2e": 8.58, "queue worker 0x2f": 9.797, "queue worker 0x28": 9.756}, "phase_totals_ms": {"Driver.Completion": 1.363, "Driver.Dispatch": 48857.51, "Driver.Dispatch.capture_resources": 740.673, "Driver.Dispatch.decode_key_device_setup": 192.7, "Driver.Dispatch.lookup_cache": 590.147, "Driver.Dispatch.materialize": 144.039, "Driver.Dispatch.prepared_invocation": 104.957, "Driver.Draw": 43847.68, "Driver.Draw.device_setup": 321.63, "Driver.Draw.draw_enqueued": 37429.006, "Driver.Draw.post_compile_prepare": 46.456, "Driver.Draw.prepare": 986.143, "Driver.Draw.shader_compile_and_link": 4943.771, "Driver.EndSubmission": 502.527, "Driver.Packet": 106311.381, "Driver.Packet.device_lock": 113.82, "Driver.Packet.dispatch": 48832.991, "Driver.Packet.draw": 43980.431, "Driver.Packet.execute": 1701.35, "Driver.Packet.flip_flush": 2.227, "Driver.Packet.flush_between_packets": 487.441, "Driver.Packet.memory_wait": 8587.898, "Driver.Packet.pipeline_drain": 259.087, "Driver.Packet.pipeline_prepare": 185.613, "Driver.Packet.prepare_memory": 481.297, "Driver.Packet.rendering_wait": 0.098, "Driver.Present": 69.318, "Driver.Present.acquire_image": 0.93, "Driver.Present.device_setup": 0.03, "Driver.Present.gpu_mutex_wait": 0.594, "Driver.Present.inflight_wait": 0.178, "Driver.Present.present_display_buffer": 8.261, "Driver.Present.queue_present": 26.237, "Driver.Present.release_and_callback": 0.087, "Driver.Present.render_fence_wait": 32.712, "Driver.Present.resize": 0.132, "Driver.Present.validate": 0.023, "Driver.Suspend": 0.011, "GpuMutex.wait.dispatch": 1413.598, "GpuMutex.wait.draw": 36059.61, "GpuMutex.wait.end": 142.186, "GpuMutex.wait.fill": 0.299, "GpuMutex.wait.flush": 103.357, "GpuMutex.wait.hook": 33.336, "GpuMutex.wait.indirect": 0.964, "GpuMutex.wait.label": 518.561, "GpuMutex.wait.other": 0.672, "GpuMutex.wait.present": 0.343, "GpuMutex.wait.wait": 1.23, "Graphics.Draw": 7626.864, "Graphics.Draw.draw_and_resource_release": 6540.725, "Graphics.Draw.index_upload": 569.344, "Graphics.Draw.validate": 392.465, "Graphics.Draw.vertex_upload": 47.69, "Graphics.DrawWithRecipe": 29.235, "Graphics.DrawWithRecipe.draw_and_resource_release": 28.749, "Graphics.DrawWithRecipe.index_upload": 0.023, "Graphics.DrawWithRecipe.validate": 0.207, "Graphics.DrawWithRecipe.vertex_upload": 0.144, "Recorder.Reap": 626.493, "Recorder.Submit": 597.614, "Recorder.Sync": 25584.288, "Recorder.WaitSerial": 4.952, "Resources.Complete": 43545.917, "Resources.Prepare": 1086.663, "Shader.DrawStage": 4340.06, "Shader.DrawStage.capture_resources": 3329.717, "Shader.DrawStage.materialize": 594.025, "Shader.DrawStage.prepared_invocation": 375.737, "Shader.ResolveAbi": 9.236, "Shader.ResolveGraphicsAbi": 4.105, "Shader.ResolveGraphicsStagesAbi": 20.026, "VideoOut.Flip": 75.738, "VideoOut.Flip.completion_mutex_wait": 0.063, "VideoOut.Flip.config_mutex_wait": 0.009, "VideoOut.Flip.frame_limit": 0.03, "VideoOut.Flip.notify_game": 0.45, "VideoOut.Flip.present": 71.766, "VideoOut.Flip.validate": 0.103, "VideoOut.Flip.vblank_wait": 0.044, "VideoOut.Flip.window_prepare": 0.092, "VideoOut.Flip.window_title": 3.153, "VideoOut.Readiness": 0.131, "VideoOut.Readiness.locks_validate": 0.06, "Vulkan.Acquire": 0.864, "Vulkan.Acquire.acquire_fence_wait": 0.13, "Vulkan.Acquire.acquire_image": 0.561, "Vulkan.Acquire.fence_reset": 0.118, "Vulkan.Acquire.retired_swapchains": 0.032, "Vulkan.Dispatch": 43476.893, "Vulkan.Dispatch.command_record": 739.761, "Vulkan.Dispatch.shader_resources": 42711.666, "Vulkan.DispatchRecipe": 62.644, "Vulkan.DispatchRecipe.command_record": 61.951, "Vulkan.DrawFromRecipe": 29.443, "Vulkan.Present": 6.069, "Vulkan.Present.command_record_scale": 2.381, "Vulkan.Present.pixel_upload": 0.459, "Vulkan.Present.queue_submit": 3.173, "Vulkan.QueuePresent": 26.058, "Vulkan.QueuePresent.queue_present": 25.945, "Vulkan.Retire": 32.698, "Vulkan.Retire.wait": 31.637}, "top_phases_ms_per_frame": {"Driver.Packet": 1714.7, "Driver.Dispatch": 788.024, "Driver.Packet.dispatch": 787.629, "Driver.Packet.draw": 709.362, "Driver.Draw": 707.221, "Resources.Complete": 702.353, "Vulkan.Dispatch": 701.24, "Vulkan.Dispatch.shader_resources": 688.898}, "owned_draw_counts": {}, "graphics_track": {"Graphics.Barrier.copy": 240, "Graphics.Barrier.dispatch-lead": 42466, "Graphics.Barrier.dispatch-trail": 56057, "Graphics.Barrier.draw": 82652, "Graphics.Barrier.fill": 1572, "Graphics.Barrier.indirect-args": 7587, "Graphics.Barrier.input-mirror": 14254, "Graphics.Barrier.label-run": 8482, "Graphics.Barrier.present-blit": 124, "Graphics.Barrier.shadow-publish": 2585, "Graphics.Barrier.staging-in": 69860, "Graphics.Barrier.staging-out": 30156, "Graphics.Barrier.storage-upload": 6724, "Graphics.Barrier.storage-writeback": 14791, "Graphics.Barrier.template-refresh": 335, "Graphics.BarrierMerged.dispatch-lead": 28765, "Graphics.BarrierMerged.fill": 184, "Graphics.BarrierMerged.label-run": 86, "Graphics.BarrierMerged.shadow-publish": 2479, "Graphics.BarrierMerged.staging-in": 29553, "Graphics.BarrierMerged.staging-out": 30156, "Graphics.BarrierMerged.storage-writeback": 5049, "Graphics.Copy": 139250, "Graphics.Copy.bytes": 16875346660, "Graphics.RenderPass": 38549, "Graphics.RenderPass.Close.command": 30286, "Graphics.RenderPass.Close.image": 181, "Graphics.RenderPass.Close.key": 1246, "Graphics.RenderPass.Close.label": 86, "Graphics.RenderPass.Close.new-batch": 6750, "Graphics.RenderPass.Continued": 242028}, "trace_dropped": true, "trace_dropped_threads": {"queue worker 0x0": {"events_full_after_s": 21.88, "events_lost": 481507, "totals_full": false}}, "trace": "aps5-trace-3ac73c78593d-11720.json.gz"}

this PR (merge cbc3300846 of 5a09407), arm B:

{"commit": "cbc33008466a", "dirty": false, "env": {"APS5_DRAW_PIPELINE": "1", "APS5_LOG_TIMESTAMPS": "1", "APS5_MIMALLOC": "1", "APS5_PIPELINE_DISPATCH": "1", "APS5_PROFILE_DRAW": "1", "APS5_SKIP_REFUSED_DRAWS": "1", "APS5_TRACE_ALL_PHASES": "1", "APS5_TRACE_SECONDS": "0:60", "APS5_TRACE_SUMMARY_EVERY": "10", "APS5_TRACE_TRIGGER_FILE": "<path>"}, "gpu": "NVIDIA GeForce RTX 4070 SUPER", "driver": "NVIDIA 621.24", "os": "Windows 10.0.26300", "cpu": "AMD Ryzen 5 7500F 6-Core Processor", "cpu_threads": 12, "memory_mib": 32372, "title_id": "PPSA23566", "title": "EA SPORTS\u2122 UFC\u00ae 6", "content_version": "01.005.000", "resolution": "1920x1080", "window": {"spec": "seconds 0:60", "first_present": 3584, "ms": 60881.035}, "presents": 63, "frame_ms": {"p50": 945.706, "p90": 1107.58, "p99": 1467.772, "max": 1467.772}, "gpu_busy_ms_per_present": 187.248, "worker_busy_pct": {"queue worker 0x0": 97.616, "queue worker 0x29": 10.314, "queue worker 0x2a": 11.016, "queue worker 0x2b": 10.778, "queue worker 0x2c": 8.872, "queue worker 0x2d": 10.64, "queue worker 0x2e": 10.917, "queue worker 0x2f": 10.046, "queue worker 0x28": 10.118}, "phase_totals_ms": {"Driver.Completion": 1.683, "Driver.Dispatch": 47883.6, "Driver.Dispatch.capture_resources": 746.527, "Driver.Dispatch.decode_key_device_setup": 196.995, "Driver.Dispatch.lookup_cache": 583.098, "Driver.Dispatch.materialize": 166.953, "Driver.Dispatch.prepared_invocation": 99.513, "Driver.Draw": 47402.291, "Driver.Draw.device_setup": 367.482, "Driver.Draw.draw_enqueued": 40494.185, "Driver.Draw.post_compile_prepare": 50.037, "Driver.Draw.prepare": 1066.909, "Driver.Draw.shader_compile_and_link": 5290.617, "Driver.EndSubmission": 420.931, "Driver.Packet": 109356.533, "Driver.Packet.device_lock": 117.496, "Driver.Packet.dispatch": 47861.928, "Driver.Packet.draw": 47534.663, "Driver.Packet.execute": 1517.833, "Driver.Packet.flip_flush": 2.125, "Driver.Packet.flush_between_packets": 534.211, "Driver.Packet.memory_wait": 9644.9, "Driver.Packet.pipeline_drain": 267.762, "Driver.Packet.pipeline_prepare": 193.815, "Driver.Packet.prepare_memory": 511.476, "Driver.Packet.rendering_wait": 0.132, "Driver.Present": 88.626, "Driver.Present.acquire_image": 0.958, "Driver.Present.device_setup": 0.032, "Driver.Present.gpu_mutex_wait": 0.697, "Driver.Present.inflight_wait": 0.179, "Driver.Present.present_display_buffer": 8.64, "Driver.Present.queue_present": 27.49, "Driver.Present.release_and_callback": 0.098, "Driver.Present.render_fence_wait": 50.224, "Driver.Present.resize": 0.133, "Driver.Present.validate": 0.026, "Driver.Suspend": 0.015, "GpuMutex.wait.dispatch": 2238.763, "GpuMutex.wait.draw": 37692.046, "GpuMutex.wait.end": 179.837, "GpuMutex.wait.fill": 0.256, "GpuMutex.wait.flush": 45.701, "GpuMutex.wait.hook": 23.598, "GpuMutex.wait.indirect": 0.734, "GpuMutex.wait.label": 569.519, "GpuMutex.wait.other": 6.159, "GpuMutex.wait.present": 0.457, "GpuMutex.wait.wait": 0.725, "Graphics.Draw": 8827.595, "Graphics.Draw.draw_and_resource_release": 7604.427, "Graphics.Draw.index_upload": 653.428, "Graphics.Draw.validate": 444.998, "Graphics.Draw.vertex_upload": 47.77, "Graphics.DrawWithRecipe": 37.483, "Graphics.DrawWithRecipe.draw_and_resource_release": 37.028, "Graphics.DrawWithRecipe.index_upload": 0.023, "Graphics.DrawWithRecipe.validate": 0.192, "Graphics.DrawWithRecipe.vertex_upload": 0.13, "Recorder.Reap": 613.163, "Recorder.Submit": 570.947, "Recorder.Sync": 23291.265, "Recorder.WaitSerial": 1.753, "Resources.Complete": 41549.272, "Resources.Prepare": 1070.003, "Shader.DrawStage": 4635.947, "Shader.DrawStage.capture_resources": 3556.026, "Shader.DrawStage.materialize": 638.359, "Shader.DrawStage.prepared_invocation": 397.98, "Shader.ResolveAbi": 5.276, "Shader.ResolveGraphicsAbi": 4.879, "Shader.ResolveGraphicsStagesAbi": 17.689, "VideoOut.Flip": 99.788, "VideoOut.Flip.completion_mutex_wait": 0.117, "VideoOut.Flip.config_mutex_wait": 0.01, "VideoOut.Flip.frame_limit": 0.057, "VideoOut.Flip.notify_game": 0.582, "VideoOut.Flip.present": 90.862, "VideoOut.Flip.validate": 0.075, "VideoOut.Flip.vblank_wait": 0.041, "VideoOut.Flip.window_prepare": 0.094, "VideoOut.Flip.window_title": 7.913, "VideoOut.Readiness": 0.13, "VideoOut.Readiness.locks_validate": 0.06, "Vulkan.Acquire": 0.887, "Vulkan.Acquire.acquire_fence_wait": 0.145, "Vulkan.Acquire.acquire_image": 0.578, "Vulkan.Acquire.fence_reset": 0.109, "Vulkan.Acquire.retired_swapchains": 0.032, "Vulkan.Dispatch": 41542.601, "Vulkan.Dispatch.command_record": 765.417, "Vulkan.Dispatch.shader_resources": 40750.716, "Vulkan.DispatchRecipe": 64.13, "Vulkan.DispatchRecipe.command_record": 63.37, "Vulkan.DrawFromRecipe": 37.656, "Vulkan.Present": 6.529, "Vulkan.Present.command_record_scale": 2.446, "Vulkan.Present.pixel_upload": 0.453, "Vulkan.Present.queue_submit": 3.576, "Vulkan.QueuePresent": 27.362, "Vulkan.QueuePresent.queue_present": 27.256, "Vulkan.Retire": 50.23, "Vulkan.Retire.wait": 49.07}, "top_phases_ms_per_frame": {"Driver.Packet": 1735.818, "Driver.Dispatch": 760.057, "Driver.Packet.dispatch": 759.713, "Driver.Packet.draw": 754.518, "Driver.Draw": 752.417, "Resources.Complete": 659.512, "Vulkan.Dispatch": 659.406, "Vulkan.Dispatch.shader_resources": 646.837}, "owned_draw_counts": {}, "graphics_track": {"Graphics.Barrier.dispatch-lead": 45703, "Graphics.Barrier.dispatch-trail": 57634, "Graphics.Barrier.draw": 103043, "Graphics.Barrier.fill": 1365, "Graphics.Barrier.indirect-args": 8157, "Graphics.Barrier.input-mirror": 24229, "Graphics.Barrier.label-run": 9020, "Graphics.Barrier.present-blit": 126, "Graphics.Barrier.shadow-publish": 2592, "Graphics.Barrier.staging-in": 77731, "Graphics.Barrier.staging-out": 34818, "Graphics.Barrier.storage-upload": 6692, "Graphics.Barrier.storage-writeback": 13464, "Graphics.Barrier.template-refresh": 490, "Graphics.BarrierMerged.dispatch-lead": 28245, "Graphics.BarrierMerged.fill": 171, "Graphics.BarrierMerged.label-run": 73, "Graphics.BarrierMerged.shadow-publish": 2432, "Graphics.BarrierMerged.staging-in": 34111, "Graphics.BarrierMerged.staging-out": 34818, "Graphics.BarrierMerged.storage-writeback": 5274, "Graphics.Copy": 152518, "Graphics.Copy.bytes": 25217545222, "Graphics.RenderPass": 48747, "Graphics.RenderPass.Close.command": 40582, "Graphics.RenderPass.Close.image": 188, "Graphics.RenderPass.Close.key": 1208, "Graphics.RenderPass.Close.label": 73, "Graphics.RenderPass.Close.new-batch": 6696, "Graphics.RenderPass.Continued": 238362}, "trace_dropped": true, "trace_dropped_threads": {"queue worker 0x0": {"events_full_after_s": 20.777, "events_lost": 523008, "totals_full": false}}, "trace": "aps5-trace-cbc33008466a-2952.json.gz"}

What the pair shows here: frame p50 974.2 -> 945.7 ms (-2.9%), mean frame 978.5 -> 966.4 ms (-1.2%), GPU busy per present 222.8 -> 187.2 ms (-15.9%). The p99 of this particular minute regressed (1266.7 -> 1467.8 ms, +15.9%) — at ~1 fps each window holds ~62 presents, so per-window variance is large; the multi-window aggregates from the table above (23-34 windows per arm) are the more stable read.

If the label flow also wants the window traces attached with trace_digest.py output, say so and I'll attach both.

@EagleBearerYS

Copy link
Copy Markdown
Contributor Author

@Logan1h thanks, that's the pair the check takes: the same seconds 0:60 window in both arms, and tools/pr_labels.py reads it as one configuration. It's in the description now under UFC 6, with your numbers and your note on the spread at about 1 fps.

On the traces: yes, please. For a perf PR, CONTRIBUTING asks for the two traces with tools/trace_digest.py output, and this pair's would be the ones.

@github-actions github-actions Bot removed the perf numbers missing perf pull request without a before and after summary line label Nov 16, 2026
@Logan1h

Logan1h commented Nov 16, 2026

Copy link
Copy Markdown
Contributor

Traces attached as release assets (GitHub comments can't carry files): https://github.com/Logan1h/AnyPS5/releases/tag/evidence-13263-ufc6-2026-11-16 — the two aps5-trace-*.json.gz of the seconds 0:60 pair above, plus the full tools/trace_digest.py output for each (digest-A.txt, digest-B.txt).

Heads of the digest output:

main (arm A):

seconds 0:60 from present 4445: 62 presents, frame p50 974.2 / p90 1049.4 / p99 1266.7 / max 1266.7 ms, GPU busy 222.8 ms per present
NVIDIA GeForce RTX 4070 SUPER, NVIDIA 621.24, Windows 10.0.26300, 1920x1080, commit 3ac73c78593d, dropped: yes

{"commit":"3ac73c78593d","dirty":false,"env":{"APS5_DRAW_PIPELINE":"1","APS5_LOG_TIMESTAMPS":"1","APS5_MIMALLOC":"1","APS5_PIPELINE_DISPATCH":"1","APS5_PROFILE_DRAW":"1","APS5_SKIP_REFUSED_DRAWS":"1","APS5_TRACE_ALL_PHASES":"1","APS5_TRACE_SECONDS":"0:60","APS5_TRACE_SUMMARY_EVERY":"10","APS5_TRACE_TRIGGER_FILE":"<path>"},"gpu":"NVIDIA GeForce RTX 4070 SUPER","driver":"NVIDIA 621.24","os":"Windows 10.0.26300","cpu":"AMD Ryzen 5 7500F 6-Core Processor","cpu_threads":12,"memory_mib":32372,"title_id":"PPSA23566","title":"EA SPORTS\u2122 UFC\u00ae 6","content_version":"01.005.000","resolution":"1920x1080","window":{"spec":"seconds 0:60","first_present":4445,"ms":60667.543},"presents":62,"frame_ms":{"p50":974.217,"p90":1049.354,"p99":1266.741,"max":1266.741},"gpu_busy_ms_per_present":222.763,"worker_busy_pct":{"queue worker 0x0":98.097,"queue worker 0x29":9.814,"queue worker 0x2a":10.251,"queue worker 0x2b":10.332,"queue worker 0x2c":10.578,"queue worker 0x2d":8.861,"queue worker 0x2e":8.58,"queue worker 0x2f":9.797,"queue worker 0x28":9.756},"phase_totals_ms":{"Driver.Completion":1.363,"Driver.Dispatch":48857.51,"Driver.Dispatch.capture_resources":740.673,"Driver.Dispatch.decode_key_device_setup":192.7,"Driver.Dispatch.lookup_cache":590.147,"Driver.Dispatch.materialize":144.039,"Driver.Dispatch.prepared_invocation":104.957,"Driver.Draw":43847.68,"Driver.Draw.device_setup":321.63,"Driver.Draw.draw_enqueued":37429.006,"Driver.Draw.post_compile_prepare":46.456,"Driver.Draw.prepare":986.143,"Driver.Draw.shader_compile_and_link":4943.771,"Driver.EndSubmission":502.527,"Driver.Packet":106311.381,"Driver.Packet.device_lock":113.82,"Driver.Packet.dispatch":48832.991,"Driver.Packet.draw":43980.431,"Driver.Packet.execute":1701.35,"Driver.Packet.flip_flush":2.227,"Driver.Packet.flush_between_packets":487.441,"Driver.Packet.memory_wait":8587.898,"Driver.Packet.pipeline_drain":259.087,"Driver.Packet.pipeline_prepare":185.613,"Driver.Packet.prepare_memory":481.297,"Driver.Packet.rendering_wait":0.098,"Driver.Present":69.318,"Driver.Present.acquire_image":0.93,"Driver.Present.device_setup":0.03,"Driver.Present.gpu_mutex_wait":0.594,"Driver.Present.inflight_wait":0.178,"Driver.Present.present_display_buffer":8.261,"Driver.Present.queue_present":26.237,"Driver.Present.release_and_callback":0.087,"Driver.Present.render_fence_wait":32.712,"Driver.Present.resize":0.132,"Driver.Present.validate":0.023,"Driver.Suspend":0.011,"GpuMutex.wait.dispatch":1413.598,"GpuMutex.wait.draw":36059.61,"GpuMutex.wait.end":142.186,"GpuMutex.wait.fill":0.299,"GpuMutex.wait.flush":103.357,"GpuMutex.wait.hook":33.336,"GpuMutex.wait.indirect":0.964,"GpuMutex.wait.label":518.561,"GpuMutex.wait.other":0.672,"GpuMutex.wait.present":0.343,"GpuMutex.wait.wait":1.23,"Graphics.Draw":7626.864,"Graphics.Draw.draw_and_resource_release":6540.725,"Graphics.Draw.index_upload":569.344,"Graphics.Draw.validate":392.465,"Graphics.Draw.vertex_upload":47.69,"Graphics.DrawWithRecipe":29.235,"Graphics.DrawWithRecipe.draw_and_resource_release":28.749,"Graphics.DrawWithRecipe.index_upload":0.023,"Graphics.DrawWithRecipe.validate":0.207,"Graphics.DrawWithRecipe.vertex_upload":0.144,"Recorder.Reap":626.493,"Recorder.Submit":597.614,"Recorder.Sync":25584.288,"Recorder.WaitSerial":4.952,"Resources.Complete":43545.917,"Resources.Prepare":1086.663,"Shader.DrawStage":4340.06,"Shader.DrawStage.capture_resources":3329.717,"Shader.DrawStage.materialize":594.025,"Shader.DrawStage.prepared_invocation":375.737,"Shader.ResolveAbi":9.236,"Shader.ResolveGraphicsAbi":4.105,"Shader.ResolveGraphicsStagesAbi":20.026,"VideoOut.Flip":75.738,"VideoOut.Flip.completion_mutex_wait":0.063,"VideoOut.Flip.config_mutex_wait":0.009,"VideoOut.Flip.frame_limit":0.03,"VideoOut.Flip.notify_game":0.45,"VideoOut.Flip.present":71.766,"VideoOut.Flip.validate":0.103,"VideoOut.Flip.vblank_wait":0.044,"VideoOut.Flip.window_prepare":0.092,"VideoOut.Flip.window_title":3.153,"VideoOut.Readiness":0.131,"VideoOut.Readiness.locks_validate":0.06,"Vulkan.Acquire":0.864,"Vulkan.Acquire.acquire_fence_wait":0.13,"Vulkan.Acquire.acquire_image":0.561,"Vulkan.Acquire.fence_reset":0.118,"Vulkan.Acquire.retired_swapchains":0.032,"Vulkan.Dispatch":43476.893,"Vulkan.Dispatch.command_record":739.761,"Vulkan.Dispatch.shader_resources":42711.666,"Vulkan.DispatchRecipe":62.644,"Vulkan.DispatchRecipe.command_record":61.951,"Vulkan.DrawFromRecipe":29.443,"Vulkan.Present":6.069,"Vulkan.Present.command_record_scale":2.381,"Vulkan.Present.pixel_upload":0.459,"Vulkan.Present.queue_submit":3.173,"Vulkan.QueuePresent":26.058,"Vulkan.QueuePresent.queue_present":25.945,"Vulkan.Retire":32.698,"Vulkan.Retire.wait":31.637},"top_phases_ms_per_frame":{"Driver.Packet":1714.7,"Driver.Dispatch":788.024,"Driver.Packet.dispatch":787.629,"Driver.Packet.draw":709.362,"Driver.Draw":707.221,"Resources.Complete":702.353,"Vulkan.Dispatch":701.24,"Vulkan.Dispatch.shader_resources":688.898},"owned_draw_counts":{},"graphics_track":{"Graphics.Barrier.copy":240,"Graphics.Barrier.dispatch-lead":42466,"Graphics.Barrier.dispatch-trail":56057,"Graphics.Barrier.draw":82652,"Graphics.Barrier.fill":1572,"Graphics.Barrier.indirect-args":7587,"Graphics.Barrier.input-mirror":14254,"Graphics.Barrier.label-run":8482,"Graphics.Barrier.present-blit":124,"Graphics.Barrier.shadow-publish":2585,"Graphics.Barrier.staging-in":69860,"Graphics.Barrier.staging-out":30156,"Graphics.Barrier.storage-upload":6724,"Graphics.Barrier.storage-writeback":14791,"Graphics.Barrier.template-refresh":335,"Graphics.BarrierMerged.dispatch-lead":28765,"Graphics.BarrierMerged.fill":184,"Graphics.BarrierMerged.label-run":86,"Graphics.BarrierMerged.shadow-publish":2479,"Graphics.BarrierMerged.staging-in":29553,"Graphics.BarrierMerged.staging-out":30156,"Graphics.BarrierMerged.storage-writeback":5049,"Graphics.Copy":139250,"Graphics.Copy.bytes":16875346660,"Graphics.RenderPass":38549,"Graphics.RenderPass.Close.command":30286,"Graphics.RenderPass.Close.image":181,"Graphics.RenderPass.Close.key":1246,"Graphics.RenderPass.Close.label":86,"Graphics.RenderPass.Close.new-batch":6750,"Graphics.RenderPass.Continued":242028},"trace_dropped":true,"trace_dropped_threads":{"queue worker 0x0":{"events_full_after_s":21.88,"events_lost":481507,"totals_full":false}},"trace":"aps5-trace-3ac73c78593d-11720.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.

  • queue worker 0x0: 481507 events lost; buffer full at 21879.6 ms

Slowest frames (largest slices inside each, inclusive)

  • present 4496: 1266.7 ms at 49587 ms: Driver.WorkerWait (queue worker 0x29) 1266.7, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x29) 1266.7, Driver.WorkerWait (queue worker 0x2b) 1266.7, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x2b) 1266.7
  • present 4497: 1254.0 ms at 50854 ms: Driver.WorkerWait (queue worker 0x29) 1254.0, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x29) 1254.0, Driver.WorkerWait (queue worker 0x2a) 1254.0, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x2a) 1254.0
  • present 4498: 1248.6 ms at 52108 ms: Driver.WorkerWait (queue worker 0x29) 1248.6, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x29) 1248.6, Driver.WorkerWait (queue worker 0x2a) 1248.6, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x2a) 1248.6
  • present 4451: 1093.7 ms at 5828 ms: Driver.WorkerWait (queue worker 0x29) 1093.7, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x29) 1093.7, Driver.WorkerWait (queue worker 0x2a) 1093.7, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x2a) 1093.7
  • present 4466: 1078.4 ms at 21098 ms: Driver.WorkerWait (queue worker 0x29) 1078.4, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x29) 1078.4, Driver.WorkerWait (queue worker 0x2a) 1078.4, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x2a) 1078.4

this PR (arm B):

seconds 0:60 from present 3584: 63 presents, frame p50 945.7 / p90 1107.6 / p99 1467.8 / max 1467.8 ms, GPU busy 187.2 ms per present
NVIDIA GeForce RTX 4070 SUPER, NVIDIA 621.24, Windows 10.0.26300, 1920x1080, commit cbc33008466a, dropped: yes

{"commit":"cbc33008466a","dirty":false,"env":{"APS5_DRAW_PIPELINE":"1","APS5_LOG_TIMESTAMPS":"1","APS5_MIMALLOC":"1","APS5_PIPELINE_DISPATCH":"1","APS5_PROFILE_DRAW":"1","APS5_SKIP_REFUSED_DRAWS":"1","APS5_TRACE_ALL_PHASES":"1","APS5_TRACE_SECONDS":"0:60","APS5_TRACE_SUMMARY_EVERY":"10","APS5_TRACE_TRIGGER_FILE":"<path>"},"gpu":"NVIDIA GeForce RTX 4070 SUPER","driver":"NVIDIA 621.24","os":"Windows 10.0.26300","cpu":"AMD Ryzen 5 7500F 6-Core Processor","cpu_threads":12,"memory_mib":32372,"title_id":"PPSA23566","title":"EA SPORTS\u2122 UFC\u00ae 6","content_version":"01.005.000","resolution":"1920x1080","window":{"spec":"seconds 0:60","first_present":3584,"ms":60881.035},"presents":63,"frame_ms":{"p50":945.706,"p90":1107.58,"p99":1467.772,"max":1467.772},"gpu_busy_ms_per_present":187.248,"worker_busy_pct":{"queue worker 0x0":97.616,"queue worker 0x29":10.314,"queue worker 0x2a":11.016,"queue worker 0x2b":10.778,"queue worker 0x2c":8.872,"queue worker 0x2d":10.64,"queue worker 0x2e":10.917,"queue worker 0x2f":10.046,"queue worker 0x28":10.118},"phase_totals_ms":{"Driver.Completion":1.683,"Driver.Dispatch":47883.6,"Driver.Dispatch.capture_resources":746.527,"Driver.Dispatch.decode_key_device_setup":196.995,"Driver.Dispatch.lookup_cache":583.098,"Driver.Dispatch.materialize":166.953,"Driver.Dispatch.prepared_invocation":99.513,"Driver.Draw":47402.291,"Driver.Draw.device_setup":367.482,"Driver.Draw.draw_enqueued":40494.185,"Driver.Draw.post_compile_prepare":50.037,"Driver.Draw.prepare":1066.909,"Driver.Draw.shader_compile_and_link":5290.617,"Driver.EndSubmission":420.931,"Driver.Packet":109356.533,"Driver.Packet.device_lock":117.496,"Driver.Packet.dispatch":47861.928,"Driver.Packet.draw":47534.663,"Driver.Packet.execute":1517.833,"Driver.Packet.flip_flush":2.125,"Driver.Packet.flush_between_packets":534.211,"Driver.Packet.memory_wait":9644.9,"Driver.Packet.pipeline_drain":267.762,"Driver.Packet.pipeline_prepare":193.815,"Driver.Packet.prepare_memory":511.476,"Driver.Packet.rendering_wait":0.132,"Driver.Present":88.626,"Driver.Present.acquire_image":0.958,"Driver.Present.device_setup":0.032,"Driver.Present.gpu_mutex_wait":0.697,"Driver.Present.inflight_wait":0.179,"Driver.Present.present_display_buffer":8.64,"Driver.Present.queue_present":27.49,"Driver.Present.release_and_callback":0.098,"Driver.Present.render_fence_wait":50.224,"Driver.Present.resize":0.133,"Driver.Present.validate":0.026,"Driver.Suspend":0.015,"GpuMutex.wait.dispatch":2238.763,"GpuMutex.wait.draw":37692.046,"GpuMutex.wait.end":179.837,"GpuMutex.wait.fill":0.256,"GpuMutex.wait.flush":45.701,"GpuMutex.wait.hook":23.598,"GpuMutex.wait.indirect":0.734,"GpuMutex.wait.label":569.519,"GpuMutex.wait.other":6.159,"GpuMutex.wait.present":0.457,"GpuMutex.wait.wait":0.725,"Graphics.Draw":8827.595,"Graphics.Draw.draw_and_resource_release":7604.427,"Graphics.Draw.index_upload":653.428,"Graphics.Draw.validate":444.998,"Graphics.Draw.vertex_upload":47.77,"Graphics.DrawWithRecipe":37.483,"Graphics.DrawWithRecipe.draw_and_resource_release":37.028,"Graphics.DrawWithRecipe.index_upload":0.023,"Graphics.DrawWithRecipe.validate":0.192,"Graphics.DrawWithRecipe.vertex_upload":0.13,"Recorder.Reap":613.163,"Recorder.Submit":570.947,"Recorder.Sync":23291.265,"Recorder.WaitSerial":1.753,"Resources.Complete":41549.272,"Resources.Prepare":1070.003,"Shader.DrawStage":4635.947,"Shader.DrawStage.capture_resources":3556.026,"Shader.DrawStage.materialize":638.359,"Shader.DrawStage.prepared_invocation":397.98,"Shader.ResolveAbi":5.276,"Shader.ResolveGraphicsAbi":4.879,"Shader.ResolveGraphicsStagesAbi":17.689,"VideoOut.Flip":99.788,"VideoOut.Flip.completion_mutex_wait":0.117,"VideoOut.Flip.config_mutex_wait":0.01,"VideoOut.Flip.frame_limit":0.057,"VideoOut.Flip.notify_game":0.582,"VideoOut.Flip.present":90.862,"VideoOut.Flip.validate":0.075,"VideoOut.Flip.vblank_wait":0.041,"VideoOut.Flip.window_prepare":0.094,"VideoOut.Flip.window_title":7.913,"VideoOut.Readiness":0.13,"VideoOut.Readiness.locks_validate":0.06,"Vulkan.Acquire":0.887,"Vulkan.Acquire.acquire_fence_wait":0.145,"Vulkan.Acquire.acquire_image":0.578,"Vulkan.Acquire.fence_reset":0.109,"Vulkan.Acquire.retired_swapchains":0.032,"Vulkan.Dispatch":41542.601,"Vulkan.Dispatch.command_record":765.417,"Vulkan.Dispatch.shader_resources":40750.716,"Vulkan.DispatchRecipe":64.13,"Vulkan.DispatchRecipe.command_record":63.37,"Vulkan.DrawFromRecipe":37.656,"Vulkan.Present":6.529,"Vulkan.Present.command_record_scale":2.446,"Vulkan.Present.pixel_upload":0.453,"Vulkan.Present.queue_submit":3.576,"Vulkan.QueuePresent":27.362,"Vulkan.QueuePresent.queue_present":27.256,"Vulkan.Retire":50.23,"Vulkan.Retire.wait":49.07},"top_phases_ms_per_frame":{"Driver.Packet":1735.818,"Driver.Dispatch":760.057,"Driver.Packet.dispatch":759.713,"Driver.Packet.draw":754.518,"Driver.Draw":752.417,"Resources.Complete":659.512,"Vulkan.Dispatch":659.406,"Vulkan.Dispatch.shader_resources":646.837},"owned_draw_counts":{},"graphics_track":{"Graphics.Barrier.dispatch-lead":45703,"Graphics.Barrier.dispatch-trail":57634,"Graphics.Barrier.draw":103043,"Graphics.Barrier.fill":1365,"Graphics.Barrier.indirect-args":8157,"Graphics.Barrier.input-mirror":24229,"Graphics.Barrier.label-run":9020,"Graphics.Barrier.present-blit":126,"Graphics.Barrier.shadow-publish":2592,"Graphics.Barrier.staging-in":77731,"Graphics.Barrier.staging-out":34818,"Graphics.Barrier.storage-upload":6692,"Graphics.Barrier.storage-writeback":13464,"Graphics.Barrier.template-refresh":490,"Graphics.BarrierMerged.dispatch-lead":28245,"Graphics.BarrierMerged.fill":171,"Graphics.BarrierMerged.label-run":73,"Graphics.BarrierMerged.shadow-publish":2432,"Graphics.BarrierMerged.staging-in":34111,"Graphics.BarrierMerged.staging-out":34818,"Graphics.BarrierMerged.storage-writeback":5274,"Graphics.Copy":152518,"Graphics.Copy.bytes":25217545222,"Graphics.RenderPass":48747,"Graphics.RenderPass.Close.command":40582,"Graphics.RenderPass.Close.image":188,"Graphics.RenderPass.Close.key":1208,"Graphics.RenderPass.Close.label":73,"Graphics.RenderPass.Close.new-batch":6696,"Graphics.RenderPass.Continued":238362},"trace_dropped":true,"trace_dropped_threads":{"queue worker 0x0":{"events_full_after_s":20.777,"events_lost":523008,"totals_full":false}},"trace":"aps5-trace-cbc33008466a-2952.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.

  • queue worker 0x0: 523008 events lost; buffer full at 20776.8 ms

Slowest frames (largest slices inside each, inclusive)

  • present 3589: 1467.8 ms at 4704 ms: Driver.WorkerWait (queue worker 0x29) 1467.8, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x29) 1467.8, Driver.WorkerWait (queue worker 0x2b) 1467.8, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x2b) 1467.8
  • present 3601: 1420.2 ms at 17626 ms: Driver.WorkerWait (queue worker 0x29) 1420.2, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x29) 1420.2, Driver.WorkerWait (queue worker 0x2a) 1420.2, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x2a) 1420.2
  • present 3606: 1332.8 ms at 23094 ms: Driver.WorkerWait (queue worker 0x29) 1332.8, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x29) 1332.8, Driver.WorkerWait (queue worker 0x2a) 1332.8, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x2a) 1332.8
  • present 3590: 1274.1 ms at 6171 ms: Driver.WorkerWait (queue worker 0x29) 1274.1, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x29) 1274.1, Driver.WorkerWait (queue worker 0x2a) 1274.1, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x2a) 1274.1
  • present 3592: 1177.9 ms at 8431 ms: Driver.WorkerWait (queue worker 0x29) 1177.9, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x29) 1177.9, Driver.WorkerWait (queue worker 0x2a) 1177.9, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x2a) 1177.9

Both traces are lossy at this event rate — the queue worker's event buffer fills ~22 s into each 60 s window (trace_dropped, noted by the digest itself; the retained slices stay representative for the first half of each window).

@EagleBearerYS

Copy link
Copy Markdown
Contributor Author

@Logan1h thanks for the traces and both digests. They're linked in the description under UFC 6, with the digests' note that queue worker 0x0's buffer filled about 21 s into each window.

@EagleBearerYS
EagleBearerYS marked this pull request as ready for review November 16, 2026 14:06
@domx4q

domx4q commented Nov 16, 2026

Copy link
Copy Markdown
Contributor

NVIDIA Linux run of the focused tests with the Khronos validation layer, main against this PR.

Setup: Arch Linux, kernel 7.3.4, GCC 16.2.1 Release, NVIDIA GeForce RTX 4090 (vendor 0x10de, device 0x2684), proprietary driver 620.70.06, Vulkan 1.4.357, Khronos validation layer 1.4.363.1. Head d75ba83d7a merged with --no-ff onto main e4caa07950 (4d8299bc5e, clean merge). Every test's Selected GPU name= line names the RTX 4090.

ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation VK_LOADER_DEBUG=layer ctest --test-dir build -R '^agc_(driver_recorder$|buffer_upload|.*(copy|staging))' -V
main e4caa07950 this PR
Result 55/55 passed 57/57 passed
Insert instance layer "VK_LAYER_KHRONOS_validation" 50 52
was not found but was requested by env var VK_INSTANCE_LAYERS 0 0
VUID- 0 0

The layer counts are log lines: 19 of the tests (agc_copy_data, agc_mapped_copy_*, agc_address_copy_cap* and others) create no Vulkan instance and some create two. The PR adds agc_buffer_upload_pending_gpu_copy and agc_buffer_upload_pending_gpu_copy_bytes, which do not exist on main; both pass on the 4090 (uploads behind a pending 1024 KiB GPU write tests passed), each with the layer inserted. agc_driver_recorder, the full recorder run that includes the new case, passes as well.

No new VUID- errors; all focused tests pass on Ada.

AI-assisted: yes (Claude Code)

@EagleBearerYS

Copy link
Copy Markdown
Contributor Author

@domx4q thanks for the RTX 4090 pair with the validation layer, and for checking that both new upload tests ran with the layer loaded. It's in the description under Tested, and in the GPUs tested line.

@MarcZX10 MarcZX10 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed — looks good

Nothing blocks this change; the reviewed code and reported checks support merging, and the optional points below are informational.

What I ran

Reviewed head d75ba83d7aa6a38019edbc1459de3c574abe5f64 using repo_read.py. No commands or tests were run in this review. The author reports targeted tests and CI results in the PR description; those were not run by me.

Results

Check Result Note
Changed source and tests passed New decision path and regression test inspected
Runtime checks not run Author-reported results only
Other repository checks not run No local toolchain run

Findings

Blocking

None.

Non-blocking

  • The diff’s comment at core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp:5137 still describes oversized regions as staying on the CPU path. It could mention the new exception when pending GPU work overlaps.

Not verified

  • core/libs/prx/libSceAgcDriver/tests/Recorder.cpp was not read in full; its added test bodies and changed dispatch lines were read. The full texts of the other four changed files were not read, but all added lines in them were inspected.
  • Tests, builds, console behavior, and the performance measurements in the description were not independently verified. The description’s reported test and CI outcomes are author-supplied.
  • Files reviewed: core/libs/prx/libSceAgcDriver/Graphics/include/GuestBufferMemory.hpp, core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp, added test sections and dispatch lines in core/libs/prx/libSceAgcDriver/tests/Recorder.cpp, core/libs/prx/libSceAgcDriver/tests/cmake/agc_driver_recorder_tests.cmake, and docs/dev/ENVIRONMENT.md. Excluded from full-text review: core/libs/prx/libSceAgcDriver/tests/Recorder.cpp, because it was too large for the review folder.

To get this to a good state

Nothing is required. The stale explanatory comment noted above is optional.

@oneandonlydean
oneandonlydean merged commit 5079ab5 into boykopovar:main Nov 19, 2026
20 of 22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agc libSceAgc* build docs perf Performance change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants