Skip to content

perf(agc): drop per-batch fences when a timeline tracks completion - #20066

Merged
oneandonlydean merged 2 commits into
boykopovar:mainfrom
Meh7an:perf/agc-fenceless-batches
Nov 19, 2026
Merged

oneandonlydean merged 2 commits into
boykopovar:mainfrom
Meh7an:perf/agc-fenceless-batches

Conversation

@Meh7an

@Meh7an Meh7an commented Nov 14, 2026

Copy link
Copy Markdown
Contributor

What

Recorder gave every recorded batch a VkFence of its own and also signalled its timeline semaphore (serial = submissions + 1) in the same vkQueueSubmit. Recorder::Reap, which VulkanDevice::WriteLabelOnGpu and SubmitRecorded call on the draw committer, then asked the driver vkGetFenceStatus once per in-flight batch until one was not signalled. On the S3K menu page that is 1.0 to 1.8% of the committer's samples in Recorder::Reap on main, 31 to 49 of those samples in nvoglv64 (the driver's fence query).

perf(agc): drop per-batch fences when a timeline tracks completion

  • When the recorder has a timeline semaphore, its batches are submitted without a fence. A batch is complete when the timeline counter has reached its serial. Reap reads the counter once (when the newest in-flight serial is above the highest value already read) and retires batches by comparing serials; no per-batch fence is created, queried, reset or pooled.
  • APS5_BATCH_FENCES=1 restores the fence per batch and asks the fence whether a batch completed. A recorder without a timeline (extension absent, APS5_NO_TIMELINE, semaphore creation failed, Recorder(context) in tests) never takes the new path: its code is main's.
  • Code: Recorder::fenceless (set in the constructor when the timeline exists and the switch is absent), Recorder::readTimeline() (reads vkGetSemaphoreCounterValueKHR, keeps the maximum in reachedSerial, ignores a failed read), Recorder::gpuDone(batch) (fenced: vkGetFenceStatus == VK_SUCCESS; fenceless: serial != 0 && (serial <= reachedSerial || serial <= readTimeline())). signaled, unsignaled, DescribePendingWrite, the profile block of syncThroughUnlocked, finish's signaledAtStart and Reap ask gpuDone; finish(wait) waits on the timeline (WaitTimeline, same 5 s slices and warnings as the fence wait) only when the serial is above reachedSerial after a read. No public API changes; ensureOpen makes no fence when fenceless and Submit passes the batch's fence, null then.
  • Same completion as a fence per batch, for every configuration:
    • One queue. Every Recorder submits to context.queue only (the guest queues are tags on batches). Each submit signals the one timeline with the next serial, in submission order. The first synchronization scope of a vkQueueSubmit semaphore signal includes every earlier submission on that queue, exactly as a fence's does, so a counter value N means batches 1..N completed: the same prefix a fence per batch gives. WaitSerial to FinishUpTo and syncThroughUnlocked already rely on this on main. A batch is never counted done early: reachedSerial only holds values the counter returned, and a stale low read only keeps a batch in flight, as an unsignalled fence does.
    • Order. Reap, Sync, FinishUpTo and SyncThrough pop inFlight from the front, so completion order is serial order in both modes.
    • Failed submit. The failure throws before submitted and serial are set and DiscardUnsubmitted discards the batch; submissions is not consumed, so the next batch signals the same value (as on main). There is no fence to reset.
    • Device lost or a failed query. A failed counter read leaves reachedSerial alone, so Reap retires nothing (a lost vkGetFenceStatus is not VK_SUCCESS either). A failed timeline wait takes finish's existing path (vkDeviceWaitIdle unless VK_ERROR_DEVICE_LOST, release, throw).
    • Teardown. ~Recorder runs Sync(), which finishes every batch through WaitTimeline while the semaphore lives, and the waiters of unlockedWaiters are waited for before vkDestroySemaphore: unchanged. There are no fence objects to destroy.
    • Locking. Every reader of inFlight runs under the GPU mutex, so the non-atomic reachedSerial is as safe as inFlight; syncThroughUnlocked copies the function pointer before it releases the mutex and touches this only after the relock.
    • Several queues (not on main). One counter does not give per-lane prefix completion across two queues. Open feat(agc): add an opt-in compute queue lane #13863 adds a second queue lane with its own timeline and fence reads; it has to set fenceless = false (or give lane batches fences) while its lane is active. Declared under Overlaps.
  • docs/dev/ENVIRONMENT.md has a row for APS5_BATCH_FENCES (tools/env_reference.py --check, 617 names).

Not changed: the batch cap and the submit points (APS5_BATCH_CAP), what a batch waits for, the ProgressWatcher, the timeline values, and the work finish does after a batch completes (release, publishPendingWrites, NoteFinished: that is what is left under Reap below).

Which thread limits the scene. On the S3K page the draw committer is the busiest CPU thread (70 to 78% of its samples outside a wait in the sampler windows below, 41 to 42% in retained trace slices; the queue worker 22%) and the GPU is 57% busy, so neither saturates and the frame is paced by the committer-to-GPU chain. A committer saving can show in the frame but does not have to; it showed as about +1%.

Scope of the measurement. One title (Sonic Origins S3K page), one GPU (RTX 2080 Ti, NVIDIA 617.14) on Windows. The saving is the driver's fence queries and the per-batch fence creation and reset; other drivers and platforms are not measured, and the change is not claimed to be faster there. It never makes more driver calls than the fence path (a reap reads the counter at most once where it polled one fence per in-flight batch), and APS5_BATCH_FENCES=1 is the old behaviour.

Tested

Windows 11 (10.0.26300), NVIDIA GeForce RTX 2080 Ti (driver 617.14), Sonic Origins (PPSA05324) menu on the S3K page, 3840x2160, default environment. Measured commits: main f0c9b11f91c and this PR 4a2c126ca7a (one commit on top of it), clean builds of each. The code was written on main 44270d9910a (commit 1b044694cad); after the validation and mutation runs below main moved and docs/dev/ENVIRONMENT.md conflicted (the APS5_BATCH_CAP row next to the new row), so the branch was rebased onto f0c9b11f91c; Recorder.cpp, Recorder.hpp and the test merged without changes. The measurements below and the new test were run on the rebased commits; the validation protocol and the mutants on 44270d9910a and 1b044694cad.

New test agc_recorder_batch_fences (tests/RecorderBatchFences.cpp, a mock Vulkan device with an in-order controllable queue, held submissions, counters for fence creations, fence queries and waits, timeline reads and waits, and injectable failures; it runs on every platform the agc tests build on):

  • Three recorder configurations: fenceless (timeline, no switch), fenced (timeline with APS5_BATCH_FENCES set) and no timeline. Every scenario runs on each, with the data and the counts checked in each run: fenceless batches are submitted with no fence and none is created; fenced and no-timeline batches have one each.
  • Scenarios: configuration and fence counts; reap cost (a fenceless reap with four of eight batches complete makes 1 counter read and 0 fence queries, the fenced one 5 fence queries; four settled queries make 1 read; a reap right after a covering read makes none); a held first batch; partial prefix completion; WaitSerial with FinishUpTo and the unlocked SyncThrough (one semaphore wait for the whole prefix); a SyncThrough under the GPU lock; a failed submit; failed waits (VK_ERROR_DEVICE_LOST, VK_ERROR_OUT_OF_HOST_MEMORY); a failed counter read; failed timeline creation; and a 400-step random walk (submits, reaps, waits, completions) of a fenceless recorder compared step by step with a fence-only recorder on the same sequence; every case ends with no leaked fence or batch.
  • Mutants: 16 broken copies of Recorder.cpp, each built and run: 14 caught (an off-by-one in gpuDone, readTimeline never storing, a reap without its pre-read, the switch ignored, a fence made while fenceless, >= in Reap, signaled always true, finish always or never reading the timeline, DescribePendingWrite always signalled, a failed read taken as a value, fenceless without a timeline (two variants, found by a hang timeout), a finish waiting on a null fence (found by the crash)). 2 survive and are equivalent: a failed wait marking its already-popped batch as reached, and the serial != 0 guard of gpuDone (an in-flight batch never has serial 0).

Vulkan validation protocol (ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation, ctest -V, same machine and GPU, one build tree, each arm rebuilt):

  • Tests (78 on this PR, 77 on main): the agc_* tests that construct a Recorder and submit, wait or reap through it (label ordering, completion and write-back, submit progress and shutdown, kept bytes, batch cap and command batches, queue and pipelined waits, agc_recorder_*) and video_out_flip_labels*; main lacks the new test.
  • Results: this PR: 76 pass, 2 skip (video_out_flip_labels*), 78 of 78 accounted for. Main: 75 pass, the same 2 skips. This PR with APS5_BATCH_FENCES=1: the same 78 of 78.
  • Logs: none of the three contains was not found but was requested by env var VK_INSTANCE_LAYERS or a VUID- line.

tools/check_conventions.py --base upstream/main passes. Full ctest was not run.

Sampler (APS5_SAMPLE_COMMITTER, four overlapping 60 s windows of 3,843 committer samples each, snapshots 0-3, 1-4, 2-5 and 3-6; one sample is about 0.0145 ms of a frame; a warm boot of the new main came first). Both arms in the same order on the same page; the same window number is the same time since the page opened:

draw committer main f0c9b11f91c (windows 0-3 / 1-4 / 2-5 / 3-6) this PR 4a2c126ca7a
Recorder::Reap inclusive 68 (1.77%) / 66 (1.72%) / 49 (1.28%) / 38 (0.99%) 27 (0.70%) / 28 (0.73%) / 25 (0.65%) / 23 (0.60%)
of which in nvoglv64 (the driver) 48 / 49 / 41 / 31 5 / 2 / 0 / 2
VulkanDevice::WriteLabelOnGpu inclusive 95 / 88 / 80 / 65 77 / 73 / 68 / 67
VulkanDevice::SubmitRecorded inclusive 20 / 17 / 8 / 5 7 / 6 / 3 / 1
committer busy (samples outside a wait frame) 69.4 / 74.6 / 73.9 / 73.5% 70.3 / 75.3 / 77.7 / 77.9%
run FPS (median of the readings) 17.89 18.04
  • Saving: 15 to 41 fewer samples in Recorder::Reap in every window, 29.5 on average (0.77% of the committer, about 0.4 ms of a 55 ms frame). The driver part of Reap falls from 31-49 samples to 0-5; what is left under Reap is finish (release, publishPendingWrites, NoteFinished) and the single counter read (readTimeline, 0 to 5 samples). Reap shrinks over the run in both arms (the scene's batches per reap change); the comparison is window against window.
  • Busy share: I do not claim a lower busy share. It rose by 1 to 4 points in the PR arm in windows 1-4 to 3-6 and is 0.9 points higher in window 0-3, where both arms were at the same point after boot; the figure counts every sample outside a wait frame, and the committer's wait share is 22 to 31% in both arms. The result is in the frame times below.

Two traced runs per arm (APS5_TRACE_SECONDS=200:15), in main, PR, PR, main order, both commit IDs in the summaries:

main f0c9b11f91c this PR 4a2c126ca7a
reading FPS (median) 18.39 / 18.47 18.66 / 18.67
frame p50 58.6 / 58.4 ms 57.7 / 57.8 ms
frame p99 66.0 / 67.2 ms 66.1 / 65.0 ms
committer Graphics.Draw per frame (retained events) 23.1 / 23.3 ms 21.9 / 22.7 ms
committer busy per frame (retained events) 24.6 / 24.9 ms 23.1 / 24.1 ms
Recorder.Submit per frame 1.0 / 1.0 ms 0.8 / 0.9 ms
GPU busy per present 33.0 / 33.5 ms 32.9 / 32.7 ms
presents in the 15 s window 254 / 255 258 / 258
  • Result: about +0.2 FPS (+1.2%) and frame p50 0.6 to 0.9 ms lower in both PR runs, the committer's Graphics.Draw 0.6 to 1.4 ms lower per frame and Recorder.Submit 0.1 to 0.2 ms lower, p99 within the spread, GPU busy unchanged to slightly lower. The two main runs differ by 0.08 FPS and the two PR runs by 0.01; every PR run is faster than both main runs on FPS and p50. The sampler window's FPS (17.89 to 18.04, +0.8%) points the same way. The gain is small, as the sampler's 0.4 ms predicts, and the trace's committer difference (1.2 ms on average) is larger than the sampler's, so I read the trace figure as upper bound.
  • Dropped events: all four traces dropped events once the worker's buffer filled (at about 6 s), and the committer's buffer filled late in two of them (main run 1 at 14.8 s, PR run 1 at 13.9 s); slice figures cover retained events only.
  • Machine: the benchmark leases report 2.0% CPU on average and 16.9% at the peak for the warm boot and the two sampler runs, 1.9% and 9.8% for the four traced runs, quiet at the start of both. -PCbisect kept the executable staged earlier from an older main's relinker; both arms ran it, with each arm's own .prx modules swapped in. Traces: m321_traces_main_f0c9b11f91c.zip and m321_traces_pr_4a2c126ca7a.zip (two runs each, trace and aps5-summary.jsonl).
Digest of main `f0c9b11f91c`, run 1

seconds 200:15 from present 5121: 254 presents, frame p50 58.6 / p90 60.7 / p99 66.0 / max 70.6 ms, GPU busy 33.0 ms per present
NVIDIA GeForce RTX 2080 Ti, NVIDIA 617.14, Windows 10.0.26300, 3840x2160, commit f0c9b11, dropped: yes

{"commit":"f0c9b11f91cc","dirty":false,"env":{"APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"200:15"},"gpu":"NVIDIA GeForce RTX 2080 Ti","driver":"NVIDIA 617.14","os":"Windows 10.0.26300","cpu":"Intel(R) Core(TM) i9-9900K CPU @ 3.60GHz","cpu_threads":16,"memory_mib":32700,"title_id":"PPSA05324","title":"Sonic Origins","content_version":"02.002.000","resolution":"3840x2160","window":{"spec":"seconds 200:15","first_present":5121,"ms":15000.568},"presents":254,"frame_ms":{"p50":58.61,"p90":60.697,"p99":66.011,"max":70.58},"gpu_busy_ms_per_present":32.998,"worker_busy_pct":{"queue worker 0x0":96.654},"phase_totals_ms":{"Driver.Completion":1.309,"Driver.Dispatch":659.774,"Driver.Dispatch.capture_resources":16.858,"Driver.Dispatch.decode_key_device_setup":10.155,"Driver.Dispatch.lookup_cache":11.526,"Driver.Dispatch.materialize":2.792,"Driver.Dispatch.prepared_invocation":2.602,"Driver.Draw":10167.079,"Driver.Draw.device_setup":790.065,"Driver.Draw.draw_enqueued":2215.505,"Driver.Draw.post_compile_prepare":123.408,"Driver.Draw.prepare":1228.192,"Driver.Draw.shader_compile_and_link":5546.37,"Driver.EndSubmission":13.19,"Driver.Packet":14484.107,"Driver.Packet.device_lock":166.261,"Driver.Packet.dispatch":1793.722,"Driver.Packet.draw":10370.89,"Driver.Packet.execute":382.236,"Driver.Packet.flip_flush":8.336,"Driver.Packet.flush_between_packets":474.286,"Driver.Packet.memory_wait":0.005,"Driver.Packet.pipeline_drain":349.885,"Driver.Packet.pipeline_prepare":272.686,"Driver.Packet.prepare_memory":263.345,"Driver.Packet.rendering_wait":0.284,"Driver.Present":2906.745,"Driver.Present.acquire_image":2.973,"Driver.Present.device_setup":0.276,"Driver.Present.gpu_mutex_wait":53.709,"Driver.Present.inflight_wait":0.598,"Driver.Present.present_display_buffer":42.932,"Driver.Present.queue_present":108.993,"Driver.Present.release_and_callback":0.941,"Driver.Present.render_fence_wait":2695.476,"Driver.Present.resize":0.553,"Driver.Present.validate":0.08,"Driver.Suspend":0.05,"GpuMutex.wait.dispatch":0.133,"GpuMutex.wait.draw":33.152,"GpuMutex.wait.end":0.749,"GpuMutex.wait.fill":19.771,"GpuMutex.wait.flush":2.434,"GpuMutex.wait.label":3.787,"GpuMutex.wait.other":5.205,"GpuMutex.wait.present":52.947,"GpuMutex.wait.wait":2.224,"Graphics.Draw":9705.799,"Graphics.Draw.draw_and_resource_release":7544.336,"Graphics.Draw.index_upload":588.619,"Graphics.Draw.validate":740.374,"Graphics.Draw.vertex_upload":661.552,"Graphics.DrawWithRecipe":104.27,"Graphics.DrawWithRecipe.draw_and_resource_release":101.106,"Graphics.DrawWithRecipe.index_upload":0.262,"Graphics.DrawWithRecipe.validate":1.5,"Graphics.DrawWithRecipe.vertex_upload":0.735,"Recorder.Reap":119.31,"Recorder.Submit":304.449,"Recorder.WaitSerial":2872.018,"Resources.Complete":63.812,"Resources.Prepare":110.234,"Shader.DrawStage":3555.825,"Shader.DrawStage.capture_resources":1655.746,"Shader.DrawStage.materialize":902.539,"Shader.DrawStage.prepared_invocation":909.355,"Shader.ResolveAbi":152.02,"Shader.ResolveGraphicsAbi":55.455,"Shader.ResolveGraphicsStagesAbi":145.835,"VideoOut.Flip":2946.925,"VideoOut.Flip.completion_mutex_wait":0.65,"VideoOut.Flip.config_mutex_wait":0.028,"VideoOut.Flip.frame_limit":0.247,"VideoOut.Flip.notify_game":25.395,"VideoOut.Flip.present":2897.986,"VideoOut.Flip.validate":0.397,"VideoOut.Flip.vblank_wait":0.185,"VideoOut.Flip.window_prepare":0.631,"VideoOut.Flip.window_title":21.034,"VideoOut.Readiness":1.03,"VideoOut.Readiness.locks_validate":0.405,"Vulkan.Acquire":2.707,"Vulkan.Acquire.acquire_fence_wait":0.432,"Vulkan.Acquire.acquire_image":1.47,"Vulkan.Acquire.fence_reset":0.53,"Vulkan.Acquire.retired_swapchains":0.163,"Vulkan.Dispatch":219.669,"Vulkan.Dispatch.command_record":96.875,"Vulkan.Dispatch.shader_resources":121.617,"Vulkan.DispatchRecipe":0.819,"Vulkan.DispatchRecipe.command_record":0.818,"Vulkan.DrawFromRecipe":105.93,"Vulkan.Present":22.659,"Vulkan.Present.command_record_scale":7.756,"Vulkan.Present.pixel_upload":5.575,"Vulkan.Present.queue_submit":8.982,"Vulkan.QueuePresent":107.755,"Vulkan.QueuePresent.queue_present":107.045,"Vulkan.Retire":2695.058,"Vulkan.Retire.wait":2689.398},"top_phases_ms_per_frame":{"Driver.Packet":57.024,"Driver.Packet.draw":40.83,"Driver.Draw":40.028,"Graphics.Draw":38.212,"Graphics.Draw.draw_and_resource_release":29.702,"Driver.Draw.shader_compile_and_link":21.836,"Shader.DrawStage":13.999,"VideoOut.Flip":11.602},"owned_draw_counts":{"OwnedDraw.evicted_other":23363},"graphics_track":{"Graphics.Barrier.copy":2540,"Graphics.Barrier.dispatch-lead":1319,"Graphics.Barrier.dispatch-trail":2797,"Graphics.Barrier.draw":39162,"Graphics.Barrier.fill-clear":2540,"Graphics.Barrier.label-run":18635,"Graphics.Barrier.present-blit":508,"Graphics.Barrier.shadow-publish":510,"Graphics.Barrier.staging-in":2566,"Graphics.Barrier.staging-out":508,"Graphics.Barrier.storage-upload":29982,"Graphics.Barrier.storage-writeback":3338,"Graphics.BarrierMerged.dispatch-lead":1478,"Graphics.BarrierMerged.label-run":11,"Graphics.BarrierMerged.shadow-publish":510,"Graphics.BarrierMerged.staging-in":486,"Graphics.BarrierMerged.staging-out":508,"Graphics.BarrierMerged.storage-writeback":740,"Graphics.Copy":1780,"Graphics.Copy.bytes":16300800,"Graphics.RenderPass":19008,"Graphics.RenderPass.Close.command":11878,"Graphics.RenderPass.Close.image":505,"Graphics.RenderPass.Close.key":1338,"Graphics.RenderPass.Close.label":11,"Graphics.RenderPass.Close.new-batch":5276,"Graphics.RenderPass.Continued":479087},"trace_dropped":true,"trace_dropped_threads":{"queue worker 0x0":{"events_full_after_s":6.061,"events_lost":383854,"totals_full":false},"draw committer":{"events_full_after_s":14.81,"events_lost":3497,"totals_full":false}},"trace":"aps5-trace-f0c9b11f91cc-84288.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: 383854 events lost; buffer full at 6061.1 ms
  • draw committer: 3497 events lost; buffer full at 14810.4 ms

Slowest frames (largest slices inside each, inclusive)

  • present 5121: 70.6 ms at 0 ms: Driver.Packet (queue worker 0x0) 43.1, Graphics.Draw (draw committer) 31.9, batch (gpu) 31.7, Driver.Packet.draw (queue worker 0x0) 29.7
  • present 5214: 66.2 ms at 5480 ms: Driver.Packet (queue worker 0x0) 42.0, batch (gpu) 33.5, Driver.Packet.draw (queue worker 0x0) 31.6, Driver.Draw (queue worker 0x0) 30.4
  • present 5232: 66.0 ms at 6555 ms: batch (gpu) 37.5, Graphics.Draw (draw committer) 28.1, Graphics.Draw.draw_and_resource_release (draw committer) 20.0, VideoOut.Flip (presenter) 12.8
  • present 5349: 65.7 ms at 13471 ms: batch (gpu) 33.7, Graphics.Draw (draw committer) 28.1, Graphics.Draw.draw_and_resource_release (draw committer) 21.7, VideoOut.Flip (presenter) 12.0
  • present 5281: 65.5 ms at 9470 ms: batch (gpu) 34.7, Graphics.Draw (draw committer) 26.6, Graphics.Draw.draw_and_resource_release (draw committer) 21.0, VideoOut.Flip (presenter) 12.4

Persistent spikes (frame time above the fastest frame that separates it from a longer frame; one entry per stall, not per frame)

  • present 5121: 70.6 ms at 0 ms, persistence 14.3 ms
  • present 5214: 66.2 ms at 5480 ms, persistence 9.9 ms
  • present 5349: 65.7 ms at 13471 ms, persistence 8.8 ms
  • present 5281: 65.5 ms at 9470 ms, persistence 8.4 ms
  • present 5232: 66.0 ms at 6555 ms, persistence 8.3 ms
  • present 5180: 65.0 ms at 3477 ms, persistence 8.3 ms
  • present 5146: 64.7 ms at 1483 ms, persistence 8.1 ms
  • present 5332: 65.5 ms at 12471 ms, persistence 8.0 ms
  • present 5315: 65.0 ms at 11474 ms, persistence 7.9 ms
  • present 5298: 64.4 ms at 10474 ms, persistence 7.2 ms

Threads (ms per frame)

thread busy wait untraced in slices < 20 us largest
title 0.1 (0 %) 11.3 (19 %) 47.6 0.4 Shader.ResolveGraphicsStagesAbi 0.0, Shader.ResolveAbi 0.0
queue worker 0x0 13.0 (22 %) 0.0 (0 %) 46.0 50.0 Driver.Packet 13.0, Driver.EndSubmission 0.0
draw committer 24.6 (42 %) 0.2 (0 %) 34.2 37.4 Graphics.Draw 23.1, Recorder.Submit 1.0
title 0.0 (0 %) 0.0 (0 %) 59.0 0.0 Shader.ResolveAbi 0.0, Shader.ResolveGraphicsStagesAbi 0.0
title 0.0 (0 %) 0.0 (0 %) 59.0 0.0 Shader.ResolveAbi 0.0, Shader.ResolveGraphicsStagesAbi 0.0
title 0.0 (0 %) 0.0 (0 %) 59.0 0.0 Shader.ResolveAbi 0.0, Shader.ResolveGraphicsStagesAbi 0.0
title 0.0 (0 %) 0.0 (0 %) 59.0 0.1 Shader.ResolveAbi 0.0, Shader.ResolveGraphicsStagesAbi 0.0
presenter 0.8 (1 %) 10.8 (18 %) 47.4 0.0 VideoOut.Flip 11.6, Driver.Present 0.0
title 0.0 (0 %) 0.0 (0 %) 59.0 0.0 Shader.ResolveAbi 0.0, Shader.ResolveGraphicsStagesAbi 0.0
title 0.0 (0 %) 0.0 (0 %) 59.0 0.0 Shader.ResolveAbi 0.0, Shader.ResolveGraphicsStagesAbi 0.0
title 0.0 (0 %) 0.0 (0 %) 59.0 0.0 Shader.ResolveAbi 0.0, Shader.ResolveGraphicsStagesAbi 0.0
title 0.0 (0 %) 0.0 (0 %) 59.0 0.0 Shader.ResolveAbi 0.0, Shader.ResolveGraphicsStagesAbi 0.0
title 0.0 (0 %) 0.0 (0 %) 59.0 0.0 Shader.ResolveAbi 0.0, Shader.ResolveGraphicsStagesAbi 0.0
title 0.0 (0 %) 0.0 (0 %) 59.0 0.0 Shader.ResolveAbi 0.0, Shader.ResolveGraphicsStagesAbi 0.0
title 0.0 (0 %) 0.0 (0 %) 59.0 0.0 Shader.ResolveAbi 0.0, Shader.ResolveGraphicsStagesAbi 0.0
title 0.0 (0 %) 0.0 (0 %) 59.0 0.0 Shader.ResolveAbi 0.0, Shader.ResolveGraphicsStagesAbi 0.0
gpu 33.0 (56 %) 0.0 (0 %) 26.1 0.0 batch 33.0

Largest slices (ms per frame, inclusive, all threads): batch 33.0, Graphics.Draw 23.1, Graphics.Draw.draw_and_resource_release 14.3, Driver.Packet 13.0, VideoOut.Flip 11.6, Driver.Present 11.4, VideoOut.Flip.present 11.4, Recorder.WaitSerial 11.3, Driver.Present.render_fence_wait 10.6, Vulkan.Retire 10.6

Longest waits

  • Recorder.WaitSerial (title) 12.7 ms at 4894 ms, present 5204
  • Recorder.WaitSerial (title) 12.7 ms at 5009 ms, present 5205
  • Recorder.WaitSerial (title) 12.5 ms at 1078 ms, present 5139
  • Recorder.WaitSerial (title) 12.5 ms at 3477 ms, present 5180
  • Recorder.WaitSerial (title) 12.5 ms at 6555 ms, present 5231
  • Recorder.WaitSerial (title) 12.4 ms at 6074 ms, present 5223
  • Recorder.WaitSerial (title) 12.4 ms at 4778 ms, present 5201
  • Recorder.WaitSerial (title) 12.4 ms at 4602 ms, present 5199
  • Recorder.WaitSerial (title) 12.4 ms at 10359 ms, present 5296
  • Recorder.WaitSerial (title) 12.4 ms at 5957 ms, present 5221

Largest GPU batches (GPU ranges inside, and the CPU slices that recorded each, inclusive)

  • batch 60: 9.4 ms at 122 ms, present 5122: GPU no ranges; recorded by Driver.Packet (queue worker 0x0) 9.3, Driver.Packet.dispatch (queue worker 0x0) 4.8, Driver.Packet.draw (queue worker 0x0) 3.3, Driver.Draw (queue worker 0x0) 3.2
  • batch 7772: 9.3 ms at 12528 ms, present 5332: GPU no ranges; recorded by Graphics.Draw (draw committer) 0.5, Graphics.Draw.draw_and_resource_release (draw committer) 0.5, Resources.Complete (draw committer) 0.1
  • batch 8690: 9.3 ms at 13997 ms, present 5357: GPU no ranges; recorded by Graphics.Draw (draw committer) 0.5, Graphics.Draw.draw_and_resource_release (draw committer) 0.5, Resources.Complete (draw committer) 0.1
  • batch 8833: 9.2 ms at 14229 ms, present 5361: GPU no ranges; recorded by Graphics.Draw (draw committer) 0.4, Graphics.Draw.draw_and_resource_release (draw committer) 0.4, Resources.Complete (draw committer) 0.1
  • batch 4569: 9.2 ms at 7378 ms, present 5245: GPU no ranges; recorded by Graphics.Draw (draw committer) 0.5, Graphics.Draw.draw_and_resource_release (draw committer) 0.5, Resources.Complete (draw committer) 0.1
Digest of this PR `4a2c126ca7a`, run 1

seconds 200:15 from present 5146: 258 presents, frame p50 57.7 / p90 61.2 / p99 66.1 / max 69.9 ms, GPU busy 32.9 ms per present
NVIDIA GeForce RTX 2080 Ti, NVIDIA 617.14, Windows 10.0.26300, 3840x2160, commit 4a2c126, dropped: yes

{"commit":"4a2c126ca7a9","dirty":false,"env":{"APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"200:15"},"gpu":"NVIDIA GeForce RTX 2080 Ti","driver":"NVIDIA 617.14","os":"Windows 10.0.26300","cpu":"Intel(R) Core(TM) i9-9900K CPU @ 3.60GHz","cpu_threads":16,"memory_mib":32700,"title_id":"PPSA05324","title":"Sonic Origins","content_version":"02.002.000","resolution":"3840x2160","window":{"spec":"seconds 200:15","first_present":5146,"ms":15032.523},"presents":258,"frame_ms":{"p50":57.69,"p90":61.178,"p99":66.095,"max":69.921},"gpu_busy_ms_per_present":32.94,"worker_busy_pct":{"queue worker 0x0":96.603},"phase_totals_ms":{"Driver.Completion":2.1,"Driver.Dispatch":669.01,"Driver.Dispatch.capture_resources":15.68,"Driver.Dispatch.decode_key_device_setup":10.127,"Driver.Dispatch.lookup_cache":11.939,"Driver.Dispatch.materialize":2.694,"Driver.Dispatch.prepared_invocation":2.486,"Driver.Draw":10148.644,"Driver.Draw.device_setup":799.031,"Driver.Draw.draw_enqueued":2175.515,"Driver.Draw.post_compile_prepare":115.055,"Driver.Draw.prepare":1226.169,"Driver.Draw.shader_compile_and_link":5572.625,"Driver.EndSubmission":16.385,"Driver.Packet":14503.383,"Driver.Packet.device_lock":169.554,"Driver.Packet.dispatch":1801.892,"Driver.Packet.draw":10365.316,"Driver.Packet.execute":381.852,"Driver.Packet.flip_flush":7.394,"Driver.Packet.flush_between_packets":471.374,"Driver.Packet.memory_wait":0.026,"Driver.Packet.pipeline_drain":346.218,"Driver.Packet.pipeline_prepare":278.092,"Driver.Packet.prepare_memory":278.292,"Driver.Packet.rendering_wait":0.291,"Driver.Present":2972.961,"Driver.Present.acquire_image":3.241,"Driver.Present.device_setup":0.217,"Driver.Present.gpu_mutex_wait":49.369,"Driver.Present.inflight_wait":0.741,"Driver.Present.present_display_buffer":44.253,"Driver.Present.queue_present":105.464,"Driver.Present.release_and_callback":0.801,"Driver.Present.render_fence_wait":2767.995,"Driver.Present.resize":0.488,"Driver.Present.validate":0.076,"Driver.Suspend":0.053,"GpuMutex.wait.dispatch":0.137,"GpuMutex.wait.draw":34.391,"GpuMutex.wait.end":0.647,"GpuMutex.wait.fill":21.483,"GpuMutex.wait.flush":1.893,"GpuMutex.wait.label":2.398,"GpuMutex.wait.other":4.941,"GpuMutex.wait.present":48.528,"GpuMutex.wait.wait":1.489,"Graphics.Draw":9899.812,"Graphics.Draw.draw_and_resource_release":7675.24,"Graphics.Draw.index_upload":620.681,"Graphics.Draw.validate":735.455,"Graphics.Draw.vertex_upload":688.061,"Graphics.DrawWithRecipe":79.594,"Graphics.DrawWithRecipe.draw_and_resource_release":76.793,"Graphics.DrawWithRecipe.index_upload":0.253,"Graphics.DrawWithRecipe.validate":1.248,"Graphics.DrawWithRecipe.vertex_upload":0.581,"Recorder.Reap":81.248,"Recorder.Submit":288.718,"Recorder.WaitSerial":2935.124,"Resources.Complete":60.668,"Resources.Prepare":112.436,"Shader.DrawStage":3485.718,"Shader.DrawStage.capture_resources":1676.249,"Shader.DrawStage.materialize":830.319,"Shader.DrawStage.prepared_invocation":890.133,"Shader.ResolveAbi":154.274,"Shader.ResolveGraphicsAbi":55.904,"Shader.ResolveGraphicsStagesAbi":147.464,"VideoOut.Flip":3016.682,"VideoOut.Flip.completion_mutex_wait":0.772,"VideoOut.Flip.config_mutex_wait":0.066,"VideoOut.Flip.frame_limit":0.161,"VideoOut.Flip.notify_game":27.891,"VideoOut.Flip.present":2963.577,"VideoOut.Flip.validate":0.308,"VideoOut.Flip.vblank_wait":0.187,"VideoOut.Flip.window_prepare":0.391,"VideoOut.Flip.window_title":22.988,"VideoOut.Readiness":0.881,"VideoOut.Readiness.locks_validate":0.295,"Vulkan.Acquire":2.942,"Vulkan.Acquire.acquire_fence_wait":0.508,"Vulkan.Acquire.acquire_image":1.587,"Vulkan.Acquire.fence_reset":0.608,"Vulkan.Acquire.retired_swapchains":0.148,"Vulkan.Dispatch":224.312,"Vulkan.Dispatch.command_record":98.312,"Vulkan.Dispatch.shader_resources":124.78,"Vulkan.DrawFromRecipe":81.022,"Vulkan.Present":23.826,"Vulkan.Present.command_record_scale":8.139,"Vulkan.Present.pixel_upload":5.39,"Vulkan.Present.queue_submit":9.937,"Vulkan.QueuePresent":104.027,"Vulkan.QueuePresent.queue_present":103.359,"Vulkan.Retire":2767.662,"Vulkan.Retire.wait":2761.946},"top_phases_ms_per_frame":{"Driver.Packet":56.215,"Driver.Packet.draw":40.176,"Driver.Draw":39.336,"Graphics.Draw":38.371,"Graphics.Draw.draw_and_resource_release":29.749,"Driver.Draw.shader_compile_and_link":21.599,"Shader.DrawStage":13.511,"VideoOut.Flip":11.693},"owned_draw_counts":{"OwnedDraw.evicted_other":23626},"graphics_track":{"Graphics.Barrier.copy":2580,"Graphics.Barrier.dispatch-lead":1345,"Graphics.Barrier.dispatch-trail":2841,"Graphics.Barrier.draw":39806,"Graphics.Barrier.fill-clear":2580,"Graphics.Barrier.label-run":18974,"Graphics.Barrier.present-blit":516,"Graphics.Barrier.shadow-publish":518,"Graphics.Barrier.staging-in":2598,"Graphics.Barrier.staging-out":516,"Graphics.Barrier.storage-upload":30454,"Graphics.Barrier.storage-writeback":3393,"Graphics.BarrierMerged.dispatch-lead":1496,"Graphics.BarrierMerged.label-run":6,"Graphics.BarrierMerged.shadow-publish":518,"Graphics.BarrierMerged.staging-in":502,"Graphics.BarrierMerged.staging-out":516,"Graphics.BarrierMerged.storage-writeback":749,"Graphics.Copy":1808,"Graphics.Copy.bytes":16557504,"Graphics.RenderPass":19312,"Graphics.RenderPass.Close.command":12040,"Graphics.RenderPass.Close.image":513,"Graphics.RenderPass.Close.key":1352,"Graphics.RenderPass.Close.label":6,"Graphics.RenderPass.Close.new-batch":5402,"Graphics.RenderPass.Continued":486626},"trace_dropped":true,"trace_dropped_threads":{"queue worker 0x0":{"events_full_after_s":6.226,"events_lost":377128,"totals_full":false},"draw committer":{"events_full_after_s":13.904,"events_lost":21735,"totals_full":false}},"trace":"aps5-trace-4a2c126ca7a9-71740.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: 377128 events lost; buffer full at 6225.8 ms
  • draw committer: 21735 events lost; buffer full at 13904.0 ms

Slowest frames (largest slices inside each, inclusive)

  • present 5154: 69.9 ms at 468 ms: Driver.Packet (queue worker 0x0) 43.8, Graphics.Draw (draw committer) 36.9, batch (gpu) 33.4, Driver.Packet.draw (queue worker 0x0) 32.6
  • present 5176: 67.2 ms at 1769 ms: Driver.Packet (queue worker 0x0) 39.6, batch (gpu) 36.3, Driver.Packet.draw (queue worker 0x0) 28.9, Graphics.Draw (draw committer) 28.8
  • present 5391: 66.1 ms at 14266 ms: batch (gpu) 34.0, VideoOut.Flip (presenter) 12.1, VideoOut.Flip.present (presenter) 11.9, Driver.Present (presenter) 11.9
  • present 5400: 65.1 ms at 14794 ms: batch (gpu) 32.7, VideoOut.Flip (presenter) 11.8, VideoOut.Flip.present (presenter) 11.6, Driver.Present (presenter) 11.6
  • present 5245: 64.8 ms at 5778 ms: Driver.Packet (queue worker 0x0) 38.9, batch (gpu) 34.3, Driver.Packet.draw (queue worker 0x0) 29.0, Driver.Draw (queue worker 0x0) 28.1

Persistent spikes (frame time above the fastest frame that separates it from a longer frame; one entry per stall, not per frame)

  • present 5154: 69.9 ms at 468 ms, persistence 14.4 ms
  • present 5176: 67.2 ms at 1769 ms, persistence 11.0 ms
  • present 5391: 66.1 ms at 14266 ms, persistence 10.6 ms
  • present 5245: 64.8 ms at 5778 ms, persistence 9.2 ms
  • present 5400: 65.1 ms at 14794 ms, persistence 8.4 ms
  • present 5366: 64.5 ms at 12798 ms, persistence 8.3 ms
  • present 5290: 64.6 ms at 8424 ms, persistence 8.0 ms
  • present 5378: 64.1 ms at 13498 ms, persistence 7.7 ms
  • present 5348: 63.1 ms at 11767 ms, persistence 7.5 ms
  • present 5228: 63.9 ms at 4783 ms, persistence 7.4 ms

Threads (ms per frame)

thread busy wait untraced in slices < 20 us largest
title 0.1 (0 %) 11.4 (20 %) 46.8 0.4 Shader.ResolveGraphicsStagesAbi 0.0, Shader.ResolveAbi 0.0
queue worker 0x0 13.0 (22 %) 0.0 (0 %) 45.3 50.8 Driver.Packet 12.9, Driver.EndSubmission 0.0
draw committer 23.1 (40 %) 0.2 (0 %) 34.9 33.7 Graphics.Draw 21.9, Recorder.Submit 0.8
title 0.0 (0 %) 0.0 (0 %) 58.2 0.0 Shader.ResolveAbi 0.0, Shader.ResolveGraphicsStagesAbi 0.0
title 0.0 (0 %) 0.0 (0 %) 58.2 0.0 Shader.ResolveAbi 0.0, Shader.ResolveGraphicsAbi 0.0
title 0.0 (0 %) 0.0 (0 %) 58.2 0.0 Shader.ResolveAbi 0.0, Shader.ResolveGraphicsStagesAbi 0.0
title 0.0 (0 %) 0.0 (0 %) 58.2 0.0 Shader.ResolveAbi 0.0, Shader.ResolveGraphicsStagesAbi 0.0
presenter 0.8 (1 %) 10.9 (19 %) 46.5 0.0 VideoOut.Flip 11.7, Driver.Present 0.0
title 0.0 (0 %) 0.0 (0 %) 58.2 0.0 Shader.ResolveAbi 0.0, Shader.ResolveGraphicsStagesAbi 0.0
title 0.0 (0 %) 0.0 (0 %) 58.2 0.0 Shader.ResolveAbi 0.0, Shader.ResolveGraphicsStagesAbi 0.0
title 0.0 (0 %) 0.0 (0 %) 58.2 0.0 Shader.ResolveAbi 0.0, Shader.ResolveGraphicsStagesAbi 0.0
title 0.0 (0 %) 0.0 (0 %) 58.2 0.0 Shader.ResolveAbi 0.0, Shader.ResolveGraphicsStagesAbi 0.0
title 0.0 (0 %) 0.0 (0 %) 58.2 0.0 Shader.ResolveAbi 0.0, Shader.ResolveGraphicsStagesAbi 0.0
title 0.0 (0 %) 0.0 (0 %) 58.2 0.0 Shader.ResolveAbi 0.0, Shader.ResolveGraphicsStagesAbi 0.0
title 0.0 (0 %) 0.0 (0 %) 58.2 0.0 Shader.ResolveAbi 0.0, Shader.ResolveGraphicsStagesAbi 0.0
title 0.0 (0 %) 0.0 (0 %) 58.2 0.1 Shader.ResolveAbi 0.0, Shader.ResolveGraphicsStagesAbi 0.0
gpu 33.0 (57 %) 0.0 (0 %) 25.2 0.0 batch 33.0

Largest slices (ms per frame, inclusive, all threads): batch 33.0, Graphics.Draw 21.9, Graphics.Draw.draw_and_resource_release 14.5, Driver.Packet 12.9, VideoOut.Flip 11.7, Driver.Present 11.5, VideoOut.Flip.present 11.5, Recorder.WaitSerial 11.4, Driver.Present.render_fence_wait 10.7, Vulkan.Retire 10.7

Longest waits

  • Recorder.WaitSerial (title) 12.8 ms at 1594 ms, present 5173
  • Recorder.WaitSerial (title) 12.7 ms at 10448 ms, present 5324
  • Recorder.WaitSerial (title) 12.7 ms at 6957 ms, present 5264
  • Recorder.WaitSerial (title) 12.7 ms at 1769 ms, present 5176
  • Recorder.WaitSerial (title) 12.7 ms at 3687 ms, present 5208
  • Recorder.WaitSerial (title) 12.6 ms at 1072 ms, present 5163
  • Recorder.WaitSerial (title) 12.6 ms at 1478 ms, present 5171
  • Recorder.WaitSerial (title) 12.5 ms at 4153 ms, present 5216
  • Recorder.WaitSerial (title) 12.5 ms at 6019 ms, present 5248
  • Recorder.WaitSerial (title) 12.5 ms at 6899 ms, present 5263

Largest GPU batches (GPU ranges inside, and the CPU slices that recorded each, inclusive)

  • batch 939: 9.4 ms at 1529 ms, present 5171: GPU no ranges; recorded by Graphics.Draw (draw committer) 0.5, Graphics.Draw.draw_and_resource_release (draw committer) 0.5, Resources.Complete (draw committer) 0.0
  • batch 2705: 9.3 ms at 4320 ms, present 5219: GPU no ranges; recorded by Graphics.Draw (draw committer) 0.5, Graphics.Draw.draw_and_resource_release (draw committer) 0.5, Resources.Complete (draw committer) 0.0
  • batch 576: 9.3 ms at 948 ms, present 5161: GPU no ranges; recorded by Graphics.Draw (draw committer) 0.5, Graphics.Draw.draw_and_resource_release (draw committer) 0.5, Resources.Complete (draw committer) 0.0
  • batch 1529: 9.2 ms at 2464 ms, present 5187: GPU no ranges; recorded by Graphics.Draw (draw committer) 0.4, Graphics.Draw.draw_and_resource_release (draw committer) 0.4, Resources.Complete (draw committer) 0.0
  • batch 868: 9.2 ms at 1413 ms, present 5169: GPU no ranges; recorded by Graphics.Draw (draw committer) 0.5, Graphics.Draw.draw_and_resource_release (draw committer) 0.5, Resources.Complete (draw committer) 0.0
Digest of this PR `4a2c126ca7a`, run 2

seconds 200:15 from present 5139: 258 presents, frame p50 57.8 / p90 60.4 / p99 65.0 / max 67.0 ms, GPU busy 32.7 ms per present
NVIDIA GeForce RTX 2080 Ti, NVIDIA 617.14, Windows 10.0.26300, 3840x2160, commit 4a2c126, dropped: yes

{"commit":"4a2c126ca7a9","dirty":false,"env":{"APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"200:15"},"gpu":"NVIDIA GeForce RTX 2080 Ti","driver":"NVIDIA 617.14","os":"Windows 10.0.26300","cpu":"Intel(R) Core(TM) i9-9900K CPU @ 3.60GHz","cpu_threads":16,"memory_mib":32700,"title_id":"PPSA05324","title":"Sonic Origins","content_version":"02.002.000","resolution":"3840x2160","window":{"spec":"seconds 200:15","first_present":5139,"ms":15019.062},"presents":258,"frame_ms":{"p50":57.786,"p90":60.435,"p99":64.983,"max":67.003},"gpu_busy_ms_per_present":32.702,"worker_busy_pct":{"queue worker 0x0":96.575},"phase_totals_ms":{"Driver.Completion":1.551,"Driver.Dispatch":669.534,"Driver.Dispatch.capture_resources":16.184,"Driver.Dispatch.decode_key_device_setup":10.509,"Driver.Dispatch.lookup_cache":12.329,"Driver.Dispatch.materialize":2.829,"Driver.Dispatch.prepared_invocation":2.547,"Driver.Draw":10255.788,"Driver.Draw.device_setup":800.942,"Driver.Draw.draw_enqueued":2228.156,"Driver.Draw.post_compile_prepare":117.499,"Driver.Draw.prepare":1233.938,"Driver.Draw.shader_compile_and_link":5614.945,"Driver.EndSubmission":9.636,"Driver.Packet":14493.432,"Driver.Packet.device_lock":166.127,"Driver.Packet.dispatch":1731.977,"Driver.Packet.draw":10470.855,"Driver.Packet.execute":385.27,"Driver.Packet.flip_flush":7.755,"Driver.Packet.flush_between_packets":472.407,"Driver.Packet.memory_wait":0.035,"Driver.Packet.pipeline_drain":338.928,"Driver.Packet.pipeline_prepare":272.924,"Driver.Packet.prepare_memory":270.233,"Driver.Packet.rendering_wait":0.29,"Driver.Present":2944.181,"Driver.Present.acquire_image":3.3,"Driver.Present.device_setup":0.243,"Driver.Present.gpu_mutex_wait":71.762,"Driver.Present.inflight_wait":0.801,"Driver.Present.present_display_buffer":43.129,"Driver.Present.queue_present":111.43,"Driver.Present.release_and_callback":0.635,"Driver.Present.render_fence_wait":2712.055,"Driver.Present.resize":0.462,"Driver.Present.validate":0.103,"Driver.Suspend":0.05,"GpuMutex.wait.dispatch":0.065,"GpuMutex.wait.draw":26.736,"GpuMutex.wait.end":0.69,"GpuMutex.wait.fill":24.707,"GpuMutex.wait.flush":3.669,"GpuMutex.wait.label":2.638,"GpuMutex.wait.other":2.589,"GpuMutex.wait.present":71.014,"GpuMutex.wait.wait":2.054,"Graphics.Draw":9694.756,"Graphics.Draw.draw_and_resource_release":7491.699,"Graphics.Draw.index_upload":605.016,"Graphics.Draw.validate":749.248,"Graphics.Draw.vertex_upload":677.67,"Graphics.DrawWithRecipe":102.621,"Graphics.DrawWithRecipe.draw_and_resource_release":97.832,"Graphics.DrawWithRecipe.index_upload":0.273,"Graphics.DrawWithRecipe.validate":1.637,"Graphics.DrawWithRecipe.vertex_upload":0.775,"Recorder.Reap":77.705,"Recorder.Submit":285.602,"Recorder.WaitSerial":2904.981,"Resources.Complete":60.347,"Resources.Prepare":112.258,"Shader.DrawStage":3569.501,"Shader.DrawStage.capture_resources":1678.91,"Shader.DrawStage.materialize":883.913,"Shader.DrawStage.prepared_invocation":916.328,"Shader.ResolveAbi":154.027,"Shader.ResolveGraphicsAbi":56.574,"Shader.ResolveGraphicsStagesAbi":145.15,"VideoOut.Flip":2981.969,"VideoOut.Flip.completion_mutex_wait":0.674,"VideoOut.Flip.config_mutex_wait":0.031,"VideoOut.Flip.frame_limit":0.193,"VideoOut.Flip.notify_game":24.695,"VideoOut.Flip.present":2933.814,"VideoOut.Flip.validate":0.359,"VideoOut.Flip.vblank_wait":0.181,"VideoOut.Flip.window_prepare":0.419,"VideoOut.Flip.window_title":21.236,"VideoOut.Readiness":1.059,"VideoOut.Readiness.locks_validate":0.544,"Vulkan.Acquire":3.02,"Vulkan.Acquire.acquire_fence_wait":0.488,"Vulkan.Acquire.acquire_image":1.676,"Vulkan.Acquire.fence_reset":0.61,"Vulkan.Acquire.retired_swapchains":0.129,"Vulkan.Dispatch":222.594,"Vulkan.Dispatch.command_record":96.893,"Vulkan.Dispatch.shader_resources":124.317,"Vulkan.DispatchRecipe":0.814,"Vulkan.DispatchRecipe.command_record":0.81,"Vulkan.DrawFromRecipe":104.356,"Vulkan.Present":22.929,"Vulkan.Present.command_record_scale":7.771,"Vulkan.Present.pixel_upload":5.812,"Vulkan.Present.queue_submit":9.029,"Vulkan.QueuePresent":110.063,"Vulkan.QueuePresent.queue_present":109.246,"Vulkan.Retire":2711.832,"Vulkan.Retire.wait":2707.114},"top_phases_ms_per_frame":{"Driver.Packet":56.176,"Driver.Packet.draw":40.585,"Driver.Draw":39.751,"Graphics.Draw":37.577,"Graphics.Draw.draw_and_resource_release":29.038,"Driver.Draw.shader_compile_and_link":21.763,"Shader.DrawStage":13.835,"VideoOut.Flip":11.558},"owned_draw_counts":{"OwnedDraw.evicted_other":24007},"graphics_track":{"Graphics.Barrier.copy":2580,"Graphics.Barrier.dispatch-lead":1325,"Graphics.Barrier.dispatch-trail":2841,"Graphics.Barrier.draw":39819,"Graphics.Barrier.fill-clear":2580,"Graphics.Barrier.label-run":18991,"Graphics.Barrier.present-blit":516,"Graphics.Barrier.shadow-publish":518,"Graphics.Barrier.staging-in":2625,"Graphics.Barrier.staging-out":516,"Graphics.Barrier.storage-upload":30454,"Graphics.Barrier.storage-writeback":3411,"Graphics.BarrierMerged.dispatch-lead":1516,"Graphics.BarrierMerged.label-run":13,"Graphics.BarrierMerged.shadow-publish":518,"Graphics.BarrierMerged.staging-in":475,"Graphics.BarrierMerged.staging-out":516,"Graphics.BarrierMerged.storage-writeback":731,"Graphics.Copy":1808,"Graphics.Copy.bytes":16557504,"Graphics.RenderPass":19346,"Graphics.RenderPass.Close.command":12035,"Graphics.RenderPass.Close.image":512,"Graphics.RenderPass.Close.key":1382,"Graphics.RenderPass.Close.label":13,"Graphics.RenderPass.Close.new-batch":5404,"Graphics.RenderPass.Continued":486593},"trace_dropped":true,"trace_dropped_threads":{"queue worker 0x0":{"events_full_after_s":6.111,"events_lost":383951,"totals_full":false}},"trace":"aps5-trace-4a2c126ca7a9-95848.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: 383951 events lost; buffer full at 6111.0 ms

Slowest frames (largest slices inside each, inclusive)

  • present 5340: 67.0 ms at 11699 ms: batch (gpu) 31.6, Graphics.Draw (draw committer) 24.5, Graphics.Draw.draw_and_resource_release (draw committer) 14.8, VideoOut.Flip (presenter) 10.1
  • present 5310: 65.3 ms at 9958 ms: batch (gpu) 33.2, Graphics.Draw (draw committer) 26.1, Graphics.Draw.draw_and_resource_release (draw committer) 16.2, VideoOut.Flip (presenter) 11.7
  • present 5344: 65.0 ms at 11937 ms: batch (gpu) 33.5, Graphics.Draw (draw committer) 27.8, Graphics.Draw.draw_and_resource_release (draw committer) 21.4, VideoOut.Flip (presenter) 11.8
  • present 5172: 64.8 ms at 1921 ms: Driver.Packet (queue worker 0x0) 38.0, batch (gpu) 37.8, Graphics.Draw (draw committer) 26.8, Driver.Packet.draw (queue worker 0x0) 26.3
  • present 5224: 64.8 ms at 4936 ms: Driver.Packet (queue worker 0x0) 37.6, batch (gpu) 34.5, Graphics.Draw (draw committer) 28.1, Driver.Packet.draw (queue worker 0x0) 27.8

Persistent spikes (frame time above the fastest frame that separates it from a longer frame; one entry per stall, not per frame)

  • present 5340: 67.0 ms at 11699 ms, persistence 12.2 ms
  • present 5310: 65.3 ms at 9958 ms, persistence 10.5 ms
  • present 5172: 64.8 ms at 1921 ms, persistence 9.9 ms
  • present 5224: 64.8 ms at 4936 ms, persistence 9.0 ms
  • present 5344: 65.0 ms at 11937 ms, persistence 8.9 ms
  • present 5379: 64.5 ms at 13967 ms, persistence 8.7 ms
  • present 5276: 64.6 ms at 7965 ms, persistence 8.1 ms
  • present 5253: 63.9 ms at 6621 ms, persistence 7.8 ms
  • present 5293: 64.2 ms at 8964 ms, persistence 7.4 ms
  • present 5190: 62.8 ms at 2965 ms, persistence 7.3 ms

Threads (ms per frame)

thread busy wait untraced in slices < 20 us largest
title 0.1 (0 %) 11.3 (19 %) 46.9 0.4 Shader.ResolveGraphicsStagesAbi 0.0, Shader.ResolveAbi 0.0
queue worker 0x0 12.8 (22 %) 0.0 (0 %) 45.4 50.4 Driver.Packet 12.8, Driver.EndSubmission 0.0
draw committer 24.1 (41 %) 0.2 (0 %) 33.9 38.2 Graphics.Draw 22.7, Recorder.Submit 0.9
title 0.0 (0 %) 0.0 (0 %) 58.2 0.0 Shader.ResolveAbi 0.0, Shader.ResolveGraphicsStagesAbi 0.0
title 0.0 (0 %) 0.0 (0 %) 58.2 0.0 Shader.ResolveAbi 0.0, Shader.ResolveGraphicsStagesAbi 0.0
title 0.0 (0 %) 0.0 (0 %) 58.2 0.0 Shader.ResolveAbi 0.0, Shader.ResolveGraphicsStagesAbi 0.0
presenter 0.8 (1 %) 10.8 (19 %) 46.6 0.0 VideoOut.Flip 11.6, Driver.Present 0.0
title 0.0 (0 %) 0.0 (0 %) 58.2 0.0 Shader.ResolveAbi 0.0, Shader.ResolveGraphicsAbi 0.0
title 0.0 (0 %) 0.0 (0 %) 58.2 0.0 Shader.ResolveAbi 0.0, Shader.ResolveGraphicsStagesAbi 0.0
title 0.0 (0 %) 0.0 (0 %) 58.2 0.0 Shader.ResolveAbi 0.0, Shader.ResolveGraphicsAbi 0.0
title 0.0 (0 %) 0.0 (0 %) 58.2 0.1 Shader.ResolveAbi 0.0, Shader.ResolveGraphicsStagesAbi 0.0
title 0.0 (0 %) 0.0 (0 %) 58.2 0.0 Shader.ResolveAbi 0.0, Shader.ResolveGraphicsAbi 0.0
title 0.0 (0 %) 0.0 (0 %) 58.2 0.0 Shader.ResolveAbi 0.0, Shader.ResolveGraphicsStagesAbi 0.0
title 0.0 (0 %) 0.0 (0 %) 58.2 0.0 Shader.ResolveAbi 0.0, Shader.ResolveGraphicsAbi 0.0
title 0.0 (0 %) 0.0 (0 %) 58.2 0.0 Shader.ResolveAbi 0.0, Shader.ResolveGraphicsStagesAbi 0.0
title 0.0 (0 %) 0.0 (0 %) 58.2 0.1 Shader.ResolveAbi 0.0, Shader.ResolveGraphicsStagesAbi 0.0
gpu 32.7 (56 %) 0.0 (0 %) 25.5 0.0 batch 32.7

Largest slices (ms per frame, inclusive, all threads): batch 32.7, Graphics.Draw 22.7, Graphics.Draw.draw_and_resource_release 13.4, Driver.Packet 12.8, VideoOut.Flip 11.6, Driver.Present 11.4, VideoOut.Flip.present 11.4, Recorder.WaitSerial 11.3, Driver.Present.render_fence_wait 10.5, Vulkan.Retire 10.5

The lists of longest waits and largest GPU batches are left out of this run to fit the description; tools/trace_digest.py prints them from the attached trace.

Digest of main `f0c9b11f91c`, run 2

seconds 200:15 from present 5096: 255 presents, frame p50 58.4 / p90 61.9 / p99 67.2 / max 69.8 ms, GPU busy 33.5 ms per present
NVIDIA GeForce RTX 2080 Ti, NVIDIA 617.14, Windows 10.0.26300, 3840x2160, commit f0c9b11, dropped: yes

{"commit":"f0c9b11f91cc","dirty":false,"env":{"APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"200:15"},"gpu":"NVIDIA GeForce RTX 2080 Ti","driver":"NVIDIA 617.14","os":"Windows 10.0.26300","cpu":"Intel(R) Core(TM) i9-9900K CPU @ 3.60GHz","cpu_threads":16,"memory_mib":32700,"title_id":"PPSA05324","title":"Sonic Origins","content_version":"02.002.000","resolution":"3840x2160","window":{"spec":"seconds 200:15","first_present":5096,"ms":15033.404},"presents":255,"frame_ms":{"p50":58.431,"p90":61.851,"p99":67.167,"max":69.833},"gpu_busy_ms_per_present":33.522,"worker_busy_pct":{"queue worker 0x0":96.68},"phase_totals_ms":{"Driver.Completion":1.653,"Driver.Dispatch":669.186,"Driver.Dispatch.capture_resources":16.079,"Driver.Dispatch.decode_key_device_setup":10.131,"Driver.Dispatch.lookup_cache":11.631,"Driver.Dispatch.materialize":2.824,"Driver.Dispatch.prepared_invocation":2.47,"Driver.Draw":10178.974,"Driver.Draw.device_setup":776.476,"Driver.Draw.draw_enqueued":2224.6,"Driver.Draw.post_compile_prepare":124.366,"Driver.Draw.prepare":1219.351,"Driver.Draw.shader_compile_and_link":5581.635,"Driver.EndSubmission":11.837,"Driver.Packet":14520.716,"Driver.Packet.device_lock":166.903,"Driver.Packet.dispatch":1789.996,"Driver.Packet.draw":10387.68,"Driver.Packet.execute":378.141,"Driver.Packet.flip_flush":8.27,"Driver.Packet.flush_between_packets":485.351,"Driver.Packet.memory_wait":0.005,"Driver.Packet.pipeline_drain":361.233,"Driver.Packet.pipeline_prepare":278.494,"Driver.Packet.prepare_memory":267.891,"Driver.Packet.rendering_wait":0.294,"Driver.Present":3033.491,"Driver.Present.acquire_image":3.174,"Driver.Present.device_setup":0.222,"Driver.Present.gpu_mutex_wait":70.139,"Driver.Present.inflight_wait":0.684,"Driver.Present.present_display_buffer":44.458,"Driver.Present.queue_present":106.133,"Driver.Present.release_and_callback":0.795,"Driver.Present.render_fence_wait":2807.044,"Driver.Present.resize":0.528,"Driver.Present.validate":0.068,"Driver.Suspend":0.051,"GpuMutex.wait.dispatch":0.114,"GpuMutex.wait.draw":33.896,"GpuMutex.wait.end":1.194,"GpuMutex.wait.fill":20.413,"GpuMutex.wait.flush":2.772,"GpuMutex.wait.hook":0.014,"GpuMutex.wait.label":4.236,"GpuMutex.wait.other":5.172,"GpuMutex.wait.present":69.421,"GpuMutex.wait.wait":1.877,"Graphics.Draw":9753.406,"Graphics.Draw.draw_and_resource_release":7556.125,"Graphics.Draw.index_upload":596.761,"Graphics.Draw.validate":761.118,"Graphics.Draw.vertex_upload":664.291,"Graphics.DrawWithRecipe":97.379,"Graphics.DrawWithRecipe.draw_and_resource_release":93.266,"Graphics.DrawWithRecipe.index_upload":0.271,"Graphics.DrawWithRecipe.validate":1.482,"Graphics.DrawWithRecipe.vertex_upload":0.704,"Recorder.Reap":118.637,"Recorder.Submit":310.389,"Recorder.WaitSerial":2997.027,"Resources.Complete":71.363,"Resources.Prepare":117.664,"Shader.DrawStage":3577.406,"Shader.DrawStage.capture_resources":1676.972,"Shader.DrawStage.materialize":911.674,"Shader.DrawStage.prepared_invocation":900.522,"Shader.ResolveAbi":151.952,"Shader.ResolveGraphicsAbi":55.581,"Shader.ResolveGraphicsStagesAbi":147.385,"VideoOut.Flip":3060.807,"VideoOut.Flip.completion_mutex_wait":0.664,"VideoOut.Flip.config_mutex_wait":0.048,"VideoOut.Flip.frame_limit":0.174,"VideoOut.Flip.notify_game":12.654,"VideoOut.Flip.present":3024.935,"VideoOut.Flip.validate":0.331,"VideoOut.Flip.vblank_wait":0.291,"VideoOut.Flip.window_prepare":0.498,"VideoOut.Flip.window_title":20.877,"VideoOut.Readiness":1.115,"VideoOut.Readiness.locks_validate":0.534,"Vulkan.Acquire":2.877,"Vulkan.Acquire.acquire_fence_wait":0.506,"Vulkan.Acquire.acquire_image":1.508,"Vulkan.Acquire.fence_reset":0.634,"Vulkan.Acquire.retired_swapchains":0.129,"Vulkan.Dispatch":222.592,"Vulkan.Dispatch.command_record":95.516,"Vulkan.Dispatch.shader_resources":125.871,"Vulkan.DispatchRecipe":1.291,"Vulkan.DispatchRecipe.command_record":1.285,"Vulkan.DrawFromRecipe":99.076,"Vulkan.Present":23.847,"Vulkan.Present.command_record_scale":8.157,"Vulkan.Present.pixel_upload":5.91,"Vulkan.Present.queue_submit":9.406,"Vulkan.QueuePresent":104.698,"Vulkan.QueuePresent.queue_present":103.928,"Vulkan.Retire":2806.778,"Vulkan.Retire.wait":2801.758},"top_phases_ms_per_frame":{"Driver.Packet":56.944,"Driver.Packet.draw":40.736,"Driver.Draw":39.918,"Graphics.Draw":38.249,"Graphics.Draw.draw_and_resource_release":29.632,"Driver.Draw.shader_compile_and_link":21.889,"Shader.DrawStage":14.029,"VideoOut.Flip":12.003},"owned_draw_counts":{"OwnedDraw.evicted_other":24234},"graphics_track":{"Graphics.Barrier.copy":2550,"Graphics.Barrier.dispatch-lead":1276,"Graphics.Barrier.dispatch-trail":2808,"Graphics.Barrier.draw":39334,"Graphics.Barrier.fill-clear":2550,"Graphics.Barrier.label-run":18804,"Graphics.Barrier.present-blit":510,"Graphics.Barrier.shadow-publish":512,"Graphics.Barrier.staging-in":3081,"Graphics.Barrier.staging-out":510,"Graphics.Barrier.storage-upload":30100,"Graphics.Barrier.storage-writeback":3342,"Graphics.BarrierMerged.dispatch-lead":1532,"Graphics.BarrierMerged.label-run":16,"Graphics.BarrierMerged.shadow-publish":512,"Graphics.BarrierMerged.staging-in":901,"Graphics.BarrierMerged.staging-out":510,"Graphics.BarrierMerged.storage-writeback":752,"Graphics.Copy":2488,"Graphics.Copy.bytes":16376192,"Graphics.RenderPass":19060,"Graphics.RenderPass.Close.command":11903,"Graphics.RenderPass.Close.image":505,"Graphics.RenderPass.Close.key":1318,"Graphics.RenderPass.Close.label":16,"Graphics.RenderPass.Close.new-batch":5318,"Graphics.RenderPass.Continued":480996},"trace_dropped":true,"trace_dropped_threads":{"queue worker 0x0":{"events_full_after_s":6.057,"events_lost":387461,"totals_full":false}},"trace":"aps5-trace-f0c9b11f91cc-84916.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: 387461 events lost; buffer full at 6057.0 ms

Slowest frames (largest slices inside each, inclusive)

  • present 5178: 69.8 ms at 4813 ms: Driver.Packet (queue worker 0x0) 46.5, Driver.Packet.draw (queue worker 0x0) 35.1, Driver.Draw (queue worker 0x0) 34.1, Graphics.Draw (draw committer) 33.8
  • present 5284: 67.7 ms at 11080 ms: batch (gpu) 36.0, Graphics.Draw (draw committer) 28.9, Graphics.Draw.draw_and_resource_release (draw committer) 22.3, VideoOut.Flip (presenter) 10.4
  • present 5296: 67.2 ms at 11795 ms: batch (gpu) 33.5, Graphics.Draw (draw committer) 30.6, Graphics.Draw.draw_and_resource_release (draw committer) 24.3, VideoOut.Flip (presenter) 11.4
  • present 5149: 66.6 ms at 3105 ms: Driver.Packet (queue worker 0x0) 43.7, batch (gpu) 34.7, Driver.Packet.draw (queue worker 0x0) 33.2, Driver.Draw (queue worker 0x0) 31.9
  • present 5282: 65.7 ms at 10954 ms: batch (gpu) 33.7, Graphics.Draw (draw committer) 29.4, Graphics.Draw.draw_and_resource_release (draw committer) 20.8, VideoOut.Flip (presenter) 11.2

Persistent spikes (frame time above the fastest frame that separates it from a longer frame; one entry per stall, not per frame)

  • present 5178: 69.8 ms at 4813 ms, persistence 13.7 ms
  • present 5284: 67.7 ms at 11080 ms, persistence 11.0 ms
  • present 5149: 66.6 ms at 3105 ms, persistence 10.3 ms
  • present 5296: 67.2 ms at 11795 ms, persistence 10.1 ms
  • present 5335: 65.4 ms at 14091 ms, persistence 9.0 ms
  • present 5217: 64.8 ms at 7112 ms, persistence 8.1 ms
  • present 5098: 64.1 ms at 117 ms, persistence 8.0 ms
  • present 5166: 64.7 ms at 4108 ms, persistence 7.7 ms
  • present 5200: 64.6 ms at 6118 ms, persistence 7.6 ms
  • present 5318: 64.3 ms at 13100 ms, persistence 7.4 ms

Threads (ms per frame)

thread busy wait untraced in slices < 20 us largest
title 0.1 (0 %) 11.8 (20 %) 47.1 0.4 Shader.ResolveGraphicsStagesAbi 0.0, Shader.ResolveAbi 0.0
queue worker 0x0 12.9 (22 %) 0.0 (0 %) 46.0 50.0 Driver.Packet 12.9, Driver.EndSubmission 0.0
draw committer 24.9 (42 %) 0.3 (0 %) 33.8 38.9 Graphics.Draw 23.3, Recorder.Submit 1.0
title 0.0 (0 %) 0.0 (0 %) 58.9 0.0 Shader.ResolveAbi 0.0, Shader.ResolveGraphicsStagesAbi 0.0
title 0.0 (0 %) 0.0 (0 %) 58.9 0.0 Shader.ResolveAbi 0.0, Shader.ResolveGraphicsStagesAbi 0.0
title 0.0 (0 %) 0.0 (0 %) 58.9 0.0 Shader.ResolveAbi 0.0, Shader.ResolveGraphicsStagesAbi 0.0
title 0.0 (0 %) 0.0 (0 %) 58.9 0.0 Shader.ResolveAbi 0.0, Shader.ResolveGraphicsStagesAbi 0.0
presenter 0.8 (1 %) 11.3 (19 %) 46.9 0.0 VideoOut.Flip 12.0, Driver.Present 0.0
title 0.0 (0 %) 0.0 (0 %) 58.9 0.0 Shader.ResolveAbi 0.0, Shader.ResolveGraphicsStagesAbi 0.0
title 0.0 (0 %) 0.0 (0 %) 58.9 0.0 Shader.ResolveAbi 0.0, Shader.ResolveGraphicsStagesAbi 0.0
title 0.0 (0 %) 0.0 (0 %) 58.9 0.1 Shader.ResolveAbi 0.0, Shader.ResolveGraphicsStagesAbi 0.0
title 0.0 (0 %) 0.0 (0 %) 58.9 0.0 Shader.ResolveAbi 0.0, Shader.ResolveGraphicsStagesAbi 0.0
title 0.0 (0 %) 0.0 (0 %) 58.9 0.0 Shader.ResolveAbi 0.0, Shader.ResolveGraphicsStagesAbi 0.0
title 0.0 (0 %) 0.0 (0 %) 58.9 0.1 Shader.ResolveAbi 0.0, Shader.ResolveGraphicsStagesAbi 0.0
title 0.0 (0 %) 0.0 (0 %) 58.9 0.1 Shader.ResolveAbi 0.0, Shader.ResolveGraphicsStagesAbi 0.0
title 0.0 (0 %) 0.0 (0 %) 58.9 0.0 Shader.ResolveAbi 0.0, Shader.ResolveGraphicsStagesAbi 0.0
gpu 33.5 (57 %) 0.0 (0 %) 25.5 0.0 batch 33.5

Largest slices (ms per frame, inclusive, all threads): batch 33.5, Graphics.Draw 23.3, Graphics.Draw.draw_and_resource_release 13.5, Driver.Packet 12.9, VideoOut.Flip 12.0, Driver.Present 11.9, VideoOut.Flip.present 11.9, Recorder.WaitSerial 11.8, Driver.Present.render_fence_wait 11.0, Vulkan.Retire 11.0

The lists of longest waits and largest GPU batches are left out of this run to fit the description; tools/trace_digest.py prints them from the attached trace.

tools/pr_overlap.py fails closed (exit 2): of the 1,534 open PRs, 132 share a file with this branch, and 84 of those conflict with main so it cannot compare them (30 of the 84 touch Recorder.cpp or Recorder.hpp, the rest only ENVIRONMENT.md). It does report three line conflicts: #17943 and #18029 (Recorder.cpp lines 2160-2166 in ensureOpen, where the batch's fence is made and their encoder thread allocates command buffers) and #17738 (the ENVIRONMENT.md row next to ours). So I scanned the diffs of the open PRs that touch Recorder.cpp, Recorder.hpp, VulkanDevice.cpp, VulkanDevice.hpp, DeferredLabels.cpp, PacketMemory.cpp, PacketFlush.cpp, WaitMemory.cpp, Submission.cpp, QueueWorker.cpp, PacketExecution.cpp or ENVIRONMENT.md (193 of 1,533 open) for fence, timeline, Reap, WaitSerial, FinishUpTo, signaled, unsignaled and counter-read lines. No open PR drops batch fences, adds APS5_BATCH_FENCES or changes Reap's poll. Three diffs were too big for gh pr diff (#12315, #9508, #7642); they were read through the files API at the first scan on 2026-11-13, with no fence, timeline or Reap line in their Recorder or VulkanDevice patches, and not re-read today.

Overlaps to declare (this PR depends on none of them; whichever merges second rebases):

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: NVIDIA GeForce RTX 2080 Ti, driver 617.14, Windows 11 (10.0.26300)
  • AI-assisted: yes

@github-actions github-actions Bot added perf Performance change build docs agc libSceAgc* labels Nov 14, 2026
@github-actions

github-actions Bot commented Nov 14, 2026 •

Copy link
Copy Markdown

Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.

Pull request Conflicting files (lines on main) Same exports Same new files
PR 13863 core/libs/prx/libSceAgcDriver/Graphics/include/Recorder.hpp L1035-1037
core/libs/prx/libSceAgcDriver/Graphics/src/Recorder.cpp L1421-1422, L2214-2228, L5176-5182
PR 17943 core/libs/prx/libSceAgcDriver/Graphics/src/Recorder.cpp L2222-2228
PR 18029 core/libs/prx/libSceAgcDriver/Graphics/src/Recorder.cpp L2222-2228
PR 18185 core/libs/prx/libSceAgcDriver/Graphics/src/Recorder.cpp L5176
PR 22697 core/libs/prx/libSceAgcDriver/Graphics/src/Recorder.cpp L2218-2228, L5270-5271
PR 22787 core/libs/prx/libSceAgcDriver/Graphics/src/Recorder.cpp L1421-1422, L5176-5178
PR 22944 docs/dev/ENVIRONMENT.md L119
PR 23058 core/libs/prx/libSceAgcDriver/Graphics/src/Recorder.cpp L4426-4428

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 1896 docs/dev/ENVIRONMENT.md
PR 4472 docs/dev/ENVIRONMENT.md
PR 5609 core/libs/prx/libSceAgcDriver/Graphics/include/Recorder.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Recorder.cpp
PR 6186 core/libs/prx/libSceAgcDriver/Graphics/include/Recorder.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Recorder.cpp
docs/dev/ENVIRONMENT.md
PR 6924 docs/dev/ENVIRONMENT.md
PR 7275 docs/dev/ENVIRONMENT.md
PR 7642 core/libs/prx/libSceAgcDriver/Graphics/include/Recorder.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Recorder.cpp
docs/dev/ENVIRONMENT.md
PR 7643 docs/dev/ENVIRONMENT.md
PR 8246 docs/dev/ENVIRONMENT.md
PR 9345 docs/dev/ENVIRONMENT.md
PR 9356 core/libs/prx/libSceAgcDriver/Graphics/src/Recorder.cpp
docs/dev/ENVIRONMENT.md
PR 9387 core/libs/prx/libSceAgcDriver/Graphics/src/Recorder.cpp
docs/dev/ENVIRONMENT.md
PR 9508 core/libs/prx/libSceAgcDriver/Graphics/include/Recorder.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Recorder.cpp
docs/dev/ENVIRONMENT.md
PR 9712 core/libs/prx/libSceAgcDriver/Graphics/include/Recorder.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Recorder.cpp
docs/dev/ENVIRONMENT.md
PR 9852 docs/dev/ENVIRONMENT.md
PR 10193 core/libs/prx/libSceAgcDriver/Graphics/include/Recorder.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Recorder.cpp
docs/dev/ENVIRONMENT.md
PR 10249 core/libs/prx/libSceAgcDriver/Graphics/src/Recorder.cpp
PR 10442 core/libs/prx/libSceAgcDriver/Graphics/include/Recorder.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Recorder.cpp
docs/dev/ENVIRONMENT.md
PR 10443 docs/dev/ENVIRONMENT.md
PR 11435 docs/dev/ENVIRONMENT.md
PR 11436 docs/dev/ENVIRONMENT.md
PR 11444 core/libs/prx/libSceAgcDriver/Graphics/include/Recorder.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Recorder.cpp
PR 12746 docs/dev/ENVIRONMENT.md
PR 12849 docs/dev/ENVIRONMENT.md
PR 13920 core/libs/prx/libSceAgcDriver/Graphics/include/Recorder.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Recorder.cpp
docs/dev/ENVIRONMENT.md
PR 13928 core/libs/prx/libSceAgcDriver/Graphics/include/Recorder.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Recorder.cpp
docs/dev/ENVIRONMENT.md
PR 13929 core/libs/prx/libSceAgcDriver/Graphics/include/Recorder.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Recorder.cpp
docs/dev/ENVIRONMENT.md
PR 14262 docs/dev/ENVIRONMENT.md
PR 15136 core/libs/prx/libSceAgcDriver/Graphics/src/Recorder.cpp
PR 15529 docs/dev/ENVIRONMENT.md
PR 15548 core/libs/prx/libSceAgcDriver/Graphics/include/Recorder.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Recorder.cpp
docs/dev/ENVIRONMENT.md
PR 15570 core/libs/prx/libSceAgcDriver/Graphics/include/Recorder.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Recorder.cpp
docs/dev/ENVIRONMENT.md
PR 16793 docs/dev/ENVIRONMENT.md
PR 16831 docs/dev/ENVIRONMENT.md
PR 17347 docs/dev/ENVIRONMENT.md
PR 17611 core/libs/prx/libSceAgcDriver/Graphics/include/Recorder.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Recorder.cpp
docs/dev/ENVIRONMENT.md
PR 17719 docs/dev/ENVIRONMENT.md
PR 17729 docs/dev/ENVIRONMENT.md
PR 17749 docs/dev/ENVIRONMENT.md
PR 18173 core/libs/prx/libSceAgcDriver/Graphics/include/Recorder.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Recorder.cpp
docs/dev/ENVIRONMENT.md
PR 18226 docs/dev/ENVIRONMENT.md
PR 19445 docs/dev/ENVIRONMENT.md
PR 20041 core/libs/prx/libSceAgcDriver/Graphics/src/Recorder.cpp
docs/dev/ENVIRONMENT.md
PR 20187 docs/dev/ENVIRONMENT.md
PR 20315 core/libs/prx/libSceAgcDriver/Graphics/include/Recorder.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Recorder.cpp
docs/dev/ENVIRONMENT.md
PR 20519 core/libs/prx/libSceAgcDriver/Graphics/include/Recorder.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Recorder.cpp
docs/dev/ENVIRONMENT.md
PR 21708 docs/dev/ENVIRONMENT.md
PR 22190 core/libs/prx/libSceAgcDriver/Graphics/include/Recorder.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Recorder.cpp
docs/dev/ENVIRONMENT.md
PR 22359 docs/dev/ENVIRONMENT.md
PR 22424 core/libs/prx/libSceAgcDriver/Graphics/include/Recorder.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Recorder.cpp
docs/dev/ENVIRONMENT.md
PR 22692 docs/dev/ENVIRONMENT.md
PR 23229 core/libs/prx/libSceAgcDriver/Graphics/include/Recorder.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Recorder.cpp
docs/dev/ENVIRONMENT.md
PR 23242 docs/dev/ENVIRONMENT.md
PR 23243 docs/dev/ENVIRONMENT.md

@JJenkx

JJenkx commented Nov 14, 2026

Copy link
Copy Markdown
Contributor

Windows check of head 4a2c126ca7. Setup: Windows 11 Enterprise 22621, AMD RX 6700 XT, AMD driver 26.10.1, MinGW-w64 GCC 15.2 UCRT, Release.

agc_recorder_batch_fences:

  • GPU, through the shared Windows GPU FIFO with ANYPS5_REQUIRE_VULKAN=1, merged onto main 033d5eb231 (merge 593eb654f1): passed in 3 of 3 runs. The binary matched the hash recorded at preparation, and the receipt shows exit 0 and app_count=0.
  • CPU, Vulkan hidden, merged onto main f37b071b51 (merge 70b87f77d8): passed in 3 of 3 runs.

This is a correctness check only; I did not measure the performance effect.

AI-assisted: yes.

@hamdanpor-ctrl

Copy link
Copy Markdown
Contributor

Test report, NVIDIA on Windows: no regressions; the new agc_recorder_batch_fences passes.

  • GPU: NVIDIA GeForce RTX 3050 Laptop GPU, driver 617.42, Windows 11 Pro (10.0.26300)
  • Build: WinLibs GCC 15.2.0 r7 UCRT, Release, all AGC execution tests built
  • Compared: main at 6d41595 with fix(tests): set the upload cache test's environment with _putenv_s on Windows #19899 merged (current main does not build on MinGW: UploadCacheReadOnlyFlush.cpp:177: 'setenv' was not declared), and the same tree with 4a2c126 merged (git merge --no-ff, clean)
  • Environment: ANYPS5_GPU=NVIDIA, ANYPS5_REQUIRE_VULKAN=1, ANYPS5_NO_SHADER_CACHE=1, VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation (Vulkan SDK 1.4.363.0)
  • Command: ctest --test-dir build -V --parallel 4 -R "^agc_|^request_serializer|shader"
main main + this PR
Passed 1763 1764
Failed 0 0
Skipped 18 18
VUID- lines 0 0
Validation messages 61 61, same IDs
  • agc_recorder_batch_fences (new) passes.
  • Every other test has the same result on both sides. The layer loads in both logs and neither reports it missing.
  • No title or trace run, so this says nothing about the Recorder::Reap cost on NVIDIA; it only shows the fence removal breaks nothing in the suite on this driver.

Single run each. AI-assisted (Claude Code).

@klosixgaming-arch

Copy link
Copy Markdown
Contributor

Tested on Cyberpunk 2077 (PPSA03974) 02.120.000, the intro movie at 3200x1800, Windows 11 (10.0.26200), RTX 5090 (NVIDIA 617.42), Ryzen 9 9950X3D, WinLibs GCC 15.2 Release. Base: current main e04bd77e7f + #19071 (736364e8d5), which this title needs to run the intro at full speed. This PR's head 4a2c126ca7 is merged on top (912bb0d31c, clean merge). One boot each, presents per 10 s from the 10 s summary windows; the median is over the windows after the first two (loading).

build windows median
base, run 1 113 114 114 112 112 111 110 108 118 113 116 113
base, run 2 96 98 114 106 117 114 110 112 113 121 112.5
this PR 106 121 111 115 99 111 115 117 122 120 123 115
this PR, APS5_BATCH_FENCES=1 106 122 106 95 107 94 103 90 101 111 96 103

Separate boots of one build on this PC differ by up to about 8%, so against the base this is no measurable change (+2%). On the same build, APS5_BATCH_FENCES=1 was 11% slower than the default, but that is two separate boots, so it needs repeating before it means anything. No errors or aborts.

@github-actions github-actions Bot added the needs rebase Conflicts with main, rebase needed label Nov 17, 2026
# Conflicts:
#	docs/dev/ENVIRONMENT.md
@github-actions github-actions Bot removed the needs rebase Conflicts with main, rebase needed label Nov 17, 2026
@domx4q

domx4q commented Nov 17, 2026

Copy link
Copy Markdown
Contributor

Ran the Recorder set from the validation protocol with the Khronos validation layer on NVIDIA's proprietary Linux driver and a real display, since the PR was tested on Windows and video_out_flip_labels* skipped there.

Setup: Arch Linux (kernel 7.3.4), GCC 16.2.1, Release, NVIDIA GeForce RTX 4090 (vendor 0x10de, device 0x2684, Ada), proprietary driver 620.70.06, Vulkan 1.4.357, Khronos validation layer 1.4.363.1. Head 8d0508a319 merged onto main 89b0eef7ab with --no-ff, clean merge. Main baseline is a Release build of 89b0eef7ab on the same machine, both configured with -DANYPS5_VIDEO_OUT_TEST_DRIVER=wayland. Both sides ran under a Wayland session (Hyprland) with ANYPS5_REQUIRE_DISPLAY=1, so video_out_flip_labels and video_out_flip_labels_main run instead of skipping. Default environment, so the timeline (fenceless) path; not run with APS5_BATCH_FENCES=1.

WAYLAND_DISPLAY=wayland-1 XDG_RUNTIME_DIR=/run/user/1000 DISPLAY=:0 ANYPS5_REQUIRE_DISPLAY=1 \
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_.*(label|completion|write_back|submit_progress|shutdown|kept_bytes|batch_cap|command_batch|pipelined_wait)|agc_recorder_.*|video_out_flip_labels.*)' -V
main 89b0eef7ab this PR
Result 87 passed, 1 skipped (88) 88 passed, 1 skipped (89)
Insert instance layer "VK_LAYER_KHRONOS_validation" 94 94
was not found but was requested by env var VK_INSTANCE_LAYERS 0 0
VUID- none none

New on the PR side and absent on main: agc_recorder_batch_fences (mock device, no Vulkan instance); it passes. video_out_flip_labels and video_out_flip_labels_main pass on both sides. agc_unit_shadow_completion_store skips itself on both sides (the device reports watched host memory written when it imports or reads it). Every device selection picked the RTX 4090.

No new VUID- errors; all focused tests pass on Ada, including the two display tests.

AI-assisted: yes (Claude Code)

@AlexFigas

Copy link
Copy Markdown
Contributor

Test of head 8d0508a319 on the slowest level of PPSA21564 (ASTRO BOT), where the draw committer records more occlusion counter dumps than draws.

Finding: on this level this PR cuts Recorder.Reap from 8.6 to 3.3 ms per frame and shortens the frame by about 2%.

  • Frame: in five 150 s runs per build, the mean frame went from 227.4 ms on main to 222.9 ms. Every run of this PR (222.2 to 223.4 ms) was faster than every run of main (226.1 to 228.3 ms). Three rounds ran main first and two ran this PR first. This PR was faster in every run either way: by 5.0 ms on average in the main-first rounds and 3.8 ms in the PR-first rounds.
  • Recorder.Reap: 8.55 to 8.60 ms per frame on main, 3.25 to 3.30 ms with this PR, in every run. That also shows the runs took the fenceless path.
  • GPU busy: about 117 ms per present on both.

Setup

  • Machine: Windows 10.0.26300, AMD Ryzen 5 9600X, NVIDIA GeForce RTX 5070 Ti, driver 621.14 (Selected GPU name=NVIDIA GeForce RTX 5070 Ti vendor=0x10de device=0x2c05 subgroup=32), display 2560x1440 at 164 Hz, AC power. Run on 2026-11-18.
  • Builds: Release, WinLibs GCC 15.2.0 r7. main a37edff43c, and this head merged onto it with git merge --no-ff (06e7493398, clean), built in one tree. The title was relinked once; each build ran from its own folder with that executable and its own libs/. main has since moved to 33b699882b; none of those 99 commits touch core/libs/prx/libSceAgcDriver or core/shader.
  • Scene: PPSA21564 01.007.000, app.exe -lvl shuriken_ninja_castle, default settings, 3840x2160 output. Each folder had a copy of one warm shader cache and at least one earlier run of this level before the series.
  • Environment: ANYPS5_GPU=NVIDIA, ANYPS5_DISPLAY_INDEX=0, ANYPS5_VOLUME=0, APS5_PAD_INPUT_FILE (pointing at a file nothing writes, so no input), APS5_TRACE_DIR, and APS5_TRACE_SUMMARY_EVERY=10 or APS5_TRACE_SECONDS=60:8. Nothing else, so APS5_BATCH_FENCES was unset.
  • Third arm: d36706e188, a narrower change of mine on the same main. It keeps the fences, and its Reap polls the oldest fence only once the timeline value has reached that batch's serial.

Why this level. It was the slowest in a one-run sweep of 84 levels on main eb20410673, and again when I ran the slowest ones twice more; big_hand_pirate_island was close behind (level-sweep.txt in the gist). On that main, one 10 s APS5_PROFILE_DRAW=1 report counts 609,977 draws, 838,146 occlusion counter dumps and 470,818 end-of-pipe labels on the committer. The committer calls Reap before each counter dump and each label it writes on the GPU for queue 0.

Summary series (APS5_TRACE_SUMMARY_EVERY=10, no trace; mean frame over the last six 10 s intervals of each run):

round order main this PR mine
1 main, mine, PR 228.1 ms 222.2 ms 223.3 ms
2 main, mine, PR 228.3 ms 223.4 ms 220.3 ms
3 main, mine, PR 226.9 ms 222.6 ms 223.3 ms
4 PR, mine, main 226.1 ms 223.0 ms 222.7 ms
5 PR, mine, main 227.6 ms 223.2 ms 224.2 ms
mean 227.4 ms 222.9 ms 222.8 ms
Recorder.Reap per frame 8.55 to 8.60 ms 3.25 to 3.30 ms 3.50 to 3.61 ms
Recorder.Submit per frame 11.45 to 11.63 ms 10.70 to 10.96 ms 11.25 to 11.40 ms

Window captures (APS5_TRACE_SECONDS=60:8, four rounds in the order main, mine, PR, no dropped events). An 8 s window holds only about 35 presents, so one present is about 3% of it: too coarse for a 2% change. Every run of this PR still had a shorter mean frame than every run of main (221.5 to 230.9 ms against 232.0 to 234.6 ms), but the p50 values overlap. Recorder.Reap was 8.35 to 8.43 ms per frame on main and 3.21 to 3.37 ms with this PR.

Summary lines of window round 4, main then this PR
{"commit":"a37edff43cfa","dirty":false,"env":{"APS5_PAD_INPUT_FILE":"<path>","APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"60:8"},"gpu":"NVIDIA GeForce RTX 5070 Ti","driver":"NVIDIA 621.14","os":"Windows 10.0.26300","cpu":"AMD Ryzen 5 9600X 6-Core Processor","cpu_threads":12,"memory_mib":31861,"title_id":"PPSA21564","title":"ASTRO BOT","content_version":"01.007.000","resolution":"3840x2160","window":{"spec":"seconds 60:8","first_present":722,"ms":8128.956},"presents":35,"frame_ms":{"p50":224.847,"p90":240.194,"p99":474.926,"max":474.926},"gpu_busy_ms_per_present":116.611,"worker_busy_pct":{"queue worker 0x0":95.761,"queue worker 0x40":97.522,"queue worker 0x48":96.487,"queue worker 0x46":0.613},"phase_totals_ms":{"Driver.Completion":3.928,"Driver.Dispatch":1290.145,"Driver.Dispatch.capture_resources":89.339,"Driver.Dispatch.decode_key_device_setup":178.519,"Driver.Dispatch.lookup_cache":12.875,"Driver.Dispatch.materialize":258.997,"Driver.Dispatch.prepared_invocation":10.889,"Driver.Draw":4337.785,"Driver.Draw.device_setup":288.759,"Driver.Draw.draw_enqueued":1133.869,"Driver.Draw.post_compile_prepare":43.231,"Driver.Draw.prepare":681.274,"Driver.Draw.shader_compile_and_link":2021.589,"Driver.EndSubmission":32.439,"Driver.Packet":23567.552,"Driver.Packet.device_lock":72.787,"Driver.Packet.dispatch":1297.582,"Driver.Packet.draw":4410.642,"Driver.Packet.execute":311.688,"Driver.Packet.flip_flush":1.361,"Driver.Packet.flush_between_packets":175.520,"Driver.Packet.memory_wait":15117.961,"Driver.Packet.pipeline_drain":108.375,"Driver.Packet.pipeline_prepare":92.843,"Driver.Packet.prepare_memory":576.677,"Driver.Packet.rendering_wait":0.056,"Driver.Present":39.604,"Driver.Present.acquire_image":0.481,"Driver.Present.device_setup":0.014,"Driver.Present.gpu_mutex_wait":0.137,"Driver.Present.inflight_wait":0.086,"Driver.Present.present_display_buffer":5.106,"Driver.Present.queue_present":23.721,"Driver.Present.release_and_callback":0.031,"Driver.Present.render_fence_wait":9.937,"Driver.Present.resize":0.064,"Driver.Present.validate":0.012,"Driver.Suspend":1.197,"GpuMutex.wait.dispatch":38.489,"GpuMutex.wait.draw":128.304,"GpuMutex.wait.end":6.706,"GpuMutex.wait.fill":0.323,"GpuMutex.wait.flush":1.538,"GpuMutex.wait.hook":11.402,"GpuMutex.wait.indirect":0.674,"GpuMutex.wait.label":22.420,"GpuMutex.wait.present":0.077,"GpuMutex.wait.wait":1.993,"Graphics.Draw":2300.508,"Graphics.Draw.draw_and_resource_release":1540.562,"Graphics.Draw.index_upload":176.085,"Graphics.Draw.validate":142.759,"Graphics.Draw.vertex_upload":180.995,"Graphics.DrawWithRecipe":1281.860,"Graphics.DrawWithRecipe.draw_and_resource_release":1192.996,"Graphics.DrawWithRecipe.index_upload":10.652,"Graphics.DrawWithRecipe.validate":44.769,"Graphics.DrawWithRecipe.vertex_upload":16.332,"Recorder.Reap":292.082,"Recorder.Submit":391.166,"Recorder.WaitSerial":204.634,"Resources.Complete":49.105,"Resources.Prepare":40.550,"Shader.DrawStage":1349.562,"Shader.DrawStage.capture_resources":878.342,"Shader.DrawStage.materialize":320.043,"Shader.DrawStage.prepared_invocation":135.466,"Shader.PrepareArtifact":3.414,"Shader.ResolveAbi":7.414,"Shader.ResolveGraphicsAbi":2.709,"Shader.ResolveGraphicsStagesAbi":74.317,"VideoOut.Flip":40.803,"VideoOut.Flip.completion_mutex_wait":0.032,"VideoOut.Flip.config_mutex_wait":0.003,"VideoOut.Flip.frame_limit":0.019,"VideoOut.Flip.notify_game":1.032,"VideoOut.Flip.present":37.936,"VideoOut.Flip.validate":0.035,"VideoOut.Flip.vblank_wait":0.021,"VideoOut.Flip.window_prepare":0.055,"VideoOut.Flip.window_title":1.650,"VideoOut.Readiness":0.082,"VideoOut.Readiness.locks_validate":0.034,"Vulkan.Acquire":0.445,"Vulkan.Acquire.acquire_fence_wait":0.059,"Vulkan.Acquire.acquire_image":0.303,"Vulkan.Acquire.fence_reset":0.060,"Vulkan.Acquire.retired_swapchains":0.013,"Vulkan.Dispatch":470.896,"Vulkan.Dispatch.command_record":138.610,"Vulkan.Dispatch.shader_resources":330.690,"Vulkan.DispatchRecipe":18.184,"Vulkan.DispatchRecipe.command_record":18.088,"Vulkan.DrawFromRecipe":1337.337,"Vulkan.GraphicsPipeline":6.415,"Vulkan.GraphicsPipeline.create":3.130,"Vulkan.GraphicsPipeline.modules_and_state":3.274,"Vulkan.GraphicsPipelineLibrary":2.818,"Vulkan.GraphicsPipelineLink":0.137,"Vulkan.Present":3.584,"Vulkan.Present.command_record_scale":1.542,"Vulkan.Present.pixel_upload":0.101,"Vulkan.Present.queue_submit":1.917,"Vulkan.QueuePresent":23.675,"Vulkan.QueuePresent.queue_present":23.635,"Vulkan.Retire":9.934,"Vulkan.Retire.wait":9.206},"top_phases_ms_per_frame":{"Driver.Packet":673.359,"Driver.Packet.memory_wait":431.942,"Driver.Packet.draw":126.018,"Driver.Draw":123.937,"Graphics.Draw":65.729,"Driver.Draw.shader_compile_and_link":57.760,"Graphics.Draw.draw_and_resource_release":44.016,"Shader.DrawStage":38.559},"owned_draw_counts":{},"graphics_track":{"Graphics.Barrier.copy":721,"Graphics.Barrier.dcc-clear":366,"Graphics.Barrier.dcc-keys":366,"Graphics.Barrier.dispatch-lead":8419,"Graphics.Barrier.dispatch-trail":14137,"Graphics.Barrier.draw":48695,"Graphics.Barrier.fill":1685,"Graphics.Barrier.fill-clear":686,"Graphics.Barrier.indirect-args":315,"Graphics.Barrier.input-mirror":2807,"Graphics.Barrier.label-run":412387,"Graphics.Barrier.present-blit":70,"Graphics.Barrier.shadow-publish":366,"Graphics.Barrier.staging-in":34501,"Graphics.Barrier.staging-out":14289,"Graphics.Barrier.storage-upload":2072,"Graphics.Barrier.storage-writeback":6248,"Graphics.BarrierMerged.dispatch-lead":6348,"Graphics.BarrierMerged.fill":359,"Graphics.BarrierMerged.label-run":43,"Graphics.BarrierMerged.shadow-publish":248,"Graphics.BarrierMerged.staging-in":11059,"Graphics.BarrierMerged.staging-out":14289,"Graphics.BarrierMerged.storage-writeback":909,"Graphics.Copy":37088,"Graphics.Copy.bytes":4543741856,"Graphics.RenderPass":17001,"Graphics.RenderPass.Close.command":11235,"Graphics.RenderPass.Close.image":216,"Graphics.RenderPass.Close.key":137,"Graphics.RenderPass.Close.label":43,"Graphics.RenderPass.Close.new-batch":5370,"Graphics.RenderPass.Continued":500649},"trace_dropped":false,"trace":"aps5-trace-a37edff43cfa-11848.json.gz"}
{"commit":"06e749339874","dirty":false,"env":{"APS5_PAD_INPUT_FILE":"<path>","APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"60:8"},"gpu":"NVIDIA GeForce RTX 5070 Ti","driver":"NVIDIA 621.14","os":"Windows 10.0.26300","cpu":"AMD Ryzen 5 9600X 6-Core Processor","cpu_threads":12,"memory_mib":31861,"title_id":"PPSA21564","title":"ASTRO BOT","content_version":"01.007.000","resolution":"3840x2160","window":{"spec":"seconds 60:8","first_present":728,"ms":8042.882},"presents":35,"frame_ms":{"p50":223.180,"p90":235.022,"p99":464.340,"max":464.340},"gpu_busy_ms_per_present":117.819,"worker_busy_pct":{"queue worker 0x0":95.718,"queue worker 0x40":97.565,"queue worker 0x48":96.309,"queue worker 0x46":0.580},"phase_totals_ms":{"Driver.Completion":4.068,"Driver.Dispatch":1256.218,"Driver.Dispatch.capture_resources":93.681,"Driver.Dispatch.decode_key_device_setup":169.215,"Driver.Dispatch.lookup_cache":12.566,"Driver.Dispatch.materialize":250.621,"Driver.Dispatch.prepared_invocation":10.714,"Driver.Draw":4366.383,"Driver.Draw.device_setup":289.896,"Driver.Draw.draw_enqueued":1142.991,"Driver.Draw.post_compile_prepare":43.434,"Driver.Draw.prepare":677.497,"Driver.Draw.shader_compile_and_link":2040.100,"Driver.EndSubmission":37.197,"Driver.Packet":23296.208,"Driver.Packet.device_lock":73.065,"Driver.Packet.dispatch":1263.754,"Driver.Packet.draw":4437.004,"Driver.Packet.execute":304.534,"Driver.Packet.flip_flush":1.233,"Driver.Packet.flush_between_packets":185.820,"Driver.Packet.memory_wait":14932.024,"Driver.Packet.pipeline_drain":108.324,"Driver.Packet.pipeline_prepare":97.121,"Driver.Packet.prepare_memory":587.440,"Driver.Packet.rendering_wait":0.048,"Driver.Present":41.220,"Driver.Present.acquire_image":0.493,"Driver.Present.device_setup":0.017,"Driver.Present.gpu_mutex_wait":0.132,"Driver.Present.inflight_wait":0.090,"Driver.Present.present_display_buffer":4.905,"Driver.Present.queue_present":22.302,"Driver.Present.release_and_callback":0.035,"Driver.Present.render_fence_wait":13.152,"Driver.Present.resize":0.068,"Driver.Present.validate":0.011,"Driver.Suspend":0.685,"GpuMutex.wait.dispatch":36.363,"GpuMutex.wait.draw":123.308,"GpuMutex.wait.end":9.186,"GpuMutex.wait.fill":0.203,"GpuMutex.wait.flush":1.883,"GpuMutex.wait.hook":13.973,"GpuMutex.wait.indirect":0.733,"GpuMutex.wait.label":23.821,"GpuMutex.wait.present":0.071,"GpuMutex.wait.wait":3.325,"Graphics.Draw":2304.819,"Graphics.Draw.draw_and_resource_release":1544.603,"Graphics.Draw.index_upload":177.893,"Graphics.Draw.validate":142.855,"Graphics.Draw.vertex_upload":181.959,"Graphics.DrawWithRecipe":1312.113,"Graphics.DrawWithRecipe.draw_and_resource_release":1222.917,"Graphics.DrawWithRecipe.index_upload":10.755,"Graphics.DrawWithRecipe.validate":45.227,"Graphics.DrawWithRecipe.vertex_upload":16.717,"Recorder.Reap":118.027,"Recorder.Submit":371.529,"Recorder.WaitSerial":215.381,"Resources.Complete":60.784,"Resources.Prepare":50.016,"Shader.DrawStage":1375.986,"Shader.DrawStage.capture_resources":882.797,"Shader.DrawStage.materialize":333.563,"Shader.DrawStage.prepared_invocation":144.494,"Shader.PrepareArtifact":15.814,"Shader.ResolveAbi":6.874,"Shader.ResolveGraphicsAbi":9.226,"Shader.ResolveGraphicsStagesAbi":93.532,"VideoOut.Flip":43.922,"VideoOut.Flip.completion_mutex_wait":0.033,"VideoOut.Flip.config_mutex_wait":0.002,"VideoOut.Flip.frame_limit":0.019,"VideoOut.Flip.notify_game":2.378,"VideoOut.Flip.present":39.684,"VideoOut.Flip.validate":0.037,"VideoOut.Flip.vblank_wait":0.021,"VideoOut.Flip.window_prepare":0.054,"VideoOut.Flip.window_title":1.666,"VideoOut.Readiness":0.086,"VideoOut.Readiness.locks_validate":0.038,"Vulkan.Acquire":0.457,"Vulkan.Acquire.acquire_fence_wait":0.059,"Vulkan.Acquire.acquire_image":0.308,"Vulkan.Acquire.fence_reset":0.065,"Vulkan.Acquire.retired_swapchains":0.013,"Vulkan.Dispatch":461.216,"Vulkan.Dispatch.command_record":126.900,"Vulkan.Dispatch.shader_resources":332.708,"Vulkan.DispatchRecipe":16.836,"Vulkan.DispatchRecipe.command_record":16.740,"Vulkan.DrawFromRecipe":1367.173,"Vulkan.GraphicsPipeline":6.736,"Vulkan.GraphicsPipeline.create":3.115,"Vulkan.GraphicsPipeline.modules_and_state":3.610,"Vulkan.GraphicsPipelineLibrary":2.752,"Vulkan.GraphicsPipelineLink":0.165,"Vulkan.Present":3.411,"Vulkan.Present.command_record_scale":1.536,"Vulkan.Present.pixel_upload":0.080,"Vulkan.Present.queue_submit":1.772,"Vulkan.QueuePresent":22.258,"Vulkan.QueuePresent.queue_present":22.220,"Vulkan.Retire":13.147,"Vulkan.Retire.wait":12.390},"top_phases_ms_per_frame":{"Driver.Packet":665.606,"Driver.Packet.memory_wait":426.629,"Driver.Packet.draw":126.772,"Driver.Draw":124.754,"Graphics.Draw":65.852,"Driver.Draw.shader_compile_and_link":58.289,"Graphics.Draw.draw_and_resource_release":44.132,"Shader.DrawStage":39.314},"owned_draw_counts":{},"graphics_track":{"Graphics.Barrier.copy":706,"Graphics.Barrier.dcc-clear":374,"Graphics.Barrier.dcc-keys":374,"Graphics.Barrier.dispatch-lead":8484,"Graphics.Barrier.dispatch-trail":14161,"Graphics.Barrier.draw":48060,"Graphics.Barrier.fill":1696,"Graphics.Barrier.fill-clear":686,"Graphics.Barrier.indirect-args":315,"Graphics.Barrier.input-mirror":2805,"Graphics.Barrier.label-run":415972,"Graphics.Barrier.present-blit":70,"Graphics.Barrier.shadow-publish":370,"Graphics.Barrier.staging-in":34648,"Graphics.Barrier.staging-out":14286,"Graphics.Barrier.storage-upload":2130,"Graphics.Barrier.storage-writeback":6343,"Graphics.BarrierMerged.dispatch-lead":6307,"Graphics.BarrierMerged.fill":356,"Graphics.BarrierMerged.label-run":45,"Graphics.BarrierMerged.shadow-publish":260,"Graphics.BarrierMerged.staging-in":11041,"Graphics.BarrierMerged.staging-out":14286,"Graphics.BarrierMerged.storage-writeback":900,"Graphics.Copy":36969,"Graphics.Copy.bytes":4523727158,"Graphics.RenderPass":17024,"Graphics.RenderPass.Close.command":11401,"Graphics.RenderPass.Close.image":190,"Graphics.RenderPass.Close.key":128,"Graphics.RenderPass.Close.label":45,"Graphics.RenderPass.Close.new-batch":5260,"Graphics.RenderPass.Continued":503971},"trace_dropped":false,"trace":"aps5-trace-06e749339874-4920.json.gz"}

Analysis. With the fences kept and the timeline read first (mine), Reap was 3.50 to 3.61 ms per frame, so most of the saving comes from not polling fences. On this driver a standalone loop timed vkGetFenceStatus at 214 to 217 ns per call and vkGetSemaphoreCounterValue at 23 ns. Dropping the fences altogether also lowered Recorder.Submit, which the frame times here cannot separate from the rest.

Every measured run, the 12 window and 195 interval summary lines, the two traces of window round 4 with their trace_digest.py output, performance_compare.py --require-matching-context for that round and the fence loop are in this gist.

Not covered: one GPU, driver and OS (not the AMD iGPU, not Linux); one level; the S3K page; no test suite on this merge; and APS5_BATCH_FENCES=1, which klosixgaming-arch found slower in two boots.

AI-assisted: yes.

@oneandonlydean
oneandonlydean merged commit 11160b5 into boykopovar:main Nov 19, 2026
14 checks passed
chitters2004 added a commit to chitters2004/AnyPS5 that referenced this pull request Nov 19, 2026
Recorder ensureOpen: keep the encoder pool lock and the lifetime command slot, and create or reuse the batch fence only when main's batches are not fenceless (boykopovar#20066). RuntimeSwitches: main's entry, then this branch's three.
chitters2004 added a commit to chitters2004/AnyPS5 that referenced this pull request Nov 19, 2026
…xpects

80d642c made Sync finish every batch after one wait failed. That
broke agc_recorder_batch_fences FailedWait, which checks main's contract:
the batch the failed wait did not reach stays in flight and unsettled,
and the device is idled once (not at all on device loss). Sync now stops
at the first failed wait again; it still reports a saved submission
failure first.

80d642c's reason was teardown: the destructor's one Sync then left
batches in flight, and a sealed batch aborted when destroyed. The
destructor now repeats Sync until nothing is in flight. Every failed
wait releases its batch, so each pass finishes at least one.

A new test fails the first wait inside teardown and checks the second
batch's completion ran and no command buffer leaked. Without the loop
it aborts with "a sealed batch was destroyed before the GPU released
it". Without the stop, FailedWait fails in all three modes.
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