perf(shader): speculate NaN repair per vector region (opt-in APS5_NAN_SPECULATION) #23344

Merged
chitters2004 merged 21 commits from upstream-pr/23344 into main 2026-11-27 07:38:51 +00:00
chitters2004 commented 2026-11-18 22:08:36 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by chitters2004 on 2026-11-18T22:08:36Z.


What

Every f32/f16 vector ALU result is repaired to match RDNA's NaN sources and default NaN. This is the largest single cost in GTA's heavy shaders: the no-repair bound (APS5_FAST_F32-style, not exact) saves 7.18 ms GPU busy per present, so repair is worth attacking while staying exact.

With APS5_NAN_SPECULATION=1, a run of pure vector instructions (at least APS5_NAN_SPECULATION_MIN, at most APS5_NAN_SPECULATION_MAX) is translated twice: a fast copy without the repair that records whether any operand or result was a NaN, and the exact copy. The wave branches to the exact copy, from the register and exec state saved before the run, whenever a NaN was seen. Results are unchanged by construction; only a NaN-carrying wave pays for both copies.

  • Checks implied by a later check in the same region are pruned (NanFlagPruner).
  • Regions that write state that cannot be restored, and tessellation stages, are not speculated.
  • Pixel regions branch on the lane's own NaN flag and are declined when they hold a cross-lane or lane-mask instruction.
  • The defaults are the measured configuration, so APS5_NAN_SPECULATION=1 alone reproduces it: APS5_NAN_SPECULATION_STAGES=compute,vertex,pixel, APS5_NAN_SPECULATION_MIN=compute:32,pixel:8,vertex:8 (32 for the other stages) and APS5_NAN_SPECULATION_MIN_OPS=32. Each variable overrides its default; APS5_NAN_SPECULATION_MIN takes a number for every stage or a per-stage list that overrides only the stages it names.
  • The compile-side [nan-spec-compile] lines (programs, speculated, declined, fell back by stage) print every 10 s in a boot with APS5_PROFILE_DRAW and at the end of agc_frame_replay. There are no run-time counters: speculation writes no guest-visible memory, and agc_nan_speculation_pixel checks that no speculated program gets a GDS entry. How often a wave takes the exact copy in game is therefore not measured.
    All switches are startup-only and every setting (each stage's minimum, bounds, stages, fast-op and density limits) is mixed into the shader disk cache key.

Default and cost. Off by default (APS5_NAN_SPECULATION=1 to enable); this PR does not change the default. Apart from the disk-cache invalidation, nothing changes unless the switch is on: the SRT walker and ConstantFolder::Fold fixes that run for every shader are in the PR this one depends on. The only code here that runs with the switch off is a small ResourceTracker hardening (an invariant phi is used only where it is available, and lane selectors respect phi order); the agc_shader_replay --spv output with the switch off is byte-identical between the head before this PR's defaults change and this head, on the 319 replay requests (316 compile). Every disk-cache entry from before this change is invalidated, as for any recompiler source change.

  • Cold cost, agc_shader_replay --spv over GTA's 319 requests (shader disk cache off, this head), summed emitted SPIR-V words: off 4,632,513 (316 produce SPIR-V); APS5_NAN_SPECULATION=1 alone 4,696,921 (+1.4%, 317 produce SPIR-V). Setting APS5_NAN_SPECULATION_STAGES=compute,vertex,pixel, APS5_NAN_SPECULATION_MIN=compute:32,pixel:8,vertex:8 and APS5_NAN_SPECULATION_MIN_OPS=32 as well gives the same totals and byte-identical SPIR-V for every request, and the same SPIR-V as the previous head fd140217a4 with those three set (317 of 317); the switch off is byte-identical to fd140217a4 (316 of 316). Earlier measurement of the same switch on a previous base: MIN_OPS=64 +0.7%, no MIN_OPS +12.3%. The three requests that fail with speculation off (25a5d4600, 25a9a0c00, 25a9e2600) fail on main since #12458 (bb00000fda), not here; with speculation on, 25a5d4600 compiles.
  • No request needs the fallback: 0 [recompile] nan speculation failed lines over the 319. A compile or capture that still fails turns speculation off for that program, logs that line, and recompiles or prepares it again without speculation (NanSpeculationRetry on the prepared path).
  • [nan-spec-compile] lines (every 10 s in a boot with APS5_PROFILE_DRAW, and at the end of agc_frame_replay) give programs, speculated, declined and fell back by stage. Each compiled program also logs one [recompile] nan speculation line with its candidates, speculated, declined and pruned counts.
  • A cold compile of the speculation variants is real: in the in-game run below, the first speculation-on boot compiled 5,966 speculation lines over 4,769 shaders because the warm-up ran with speculation off. Warm boots compiled 79 over 15.
  • Bit-exactness is argued from the construction (the exact copy recomputes from the same inputs) and checked on synthetic programs, replay and in game pictures (below); it has not been shown for every title.

Tested

  • Linux (lavapipe, subgroup 8): agc_driver_nan_speculation_region, agc_driver_pixel_nan_speculation (compile only below subgroup 32), agc_nan_speculation_pixel, agc_nan_speculation_stages, agc_nan_flag_pruning, agc_driver_f32_arithmetic_nan{,_fast}, agc_f32_nan_result_selects, agc_driver_nan_quieting, agc_driver_f16_fma_invalid_nan pass. agc_nan_speculation_defaults and agc_nan_speculation_overrides pin the defaults and the overrides. agc_driver_nan_speculation_region forces a NaN in one lane and checks the result against the exact program and the lane model; for v_fma_mixlo_f16 it requires only a NaN when an operand is a NaN, because that instruction's NaN payload is the host's. Mutants on the fallback branches are killed.
  • Fork CI (linux-gate and windows) on 10a0263300 (r4, before the audit fixes): run 44088501878, green. On this head bcbd2deecf: run 44402064158, green: 21 tests on Linux and 23 on Windows passed, 0 validation-layer VUIDs, nothing failing that passes on main. The tests are the NaN tests above, agc_nan_speculation_defaults and _overrides, the shader disk-cache tests, and the first PR's agc_constant_phi and agc_shader_memory*. An earlier run on bff39ce9ea (44191195433) had agc_driver_nan_speculation_region red on Linux, where the host LLVM orders the operands of v_fma_mixlo_f16 differently and so returns another NaN payload; fd140217a4 fixes the test only, and its code outside tests is unchanged from 08a5b80467.
  • GTA, main against this PR, run 1 (ns5, on 10a0263300) (RTX 3080, NVIDIA 621.24, Windows 11 26320, PCIe Gen4 x16, 3840x2160, Defender on; content 01.011.001; city scene, scripted walk, APS5_TRACE_SECONDS=108:30: a 30 s window from 108 s, which is 31 to 38 s after the player stands still (70.1 to 76.9 s in these boots), the same window in both arms; warm caches, one warm-up boot per build that is not a sample; order M S S M S M M S, 4 + 4 boots, all clean on the quiet check). Main is 0859a63ae9, the PR is 10a0263300; both carry #20845 and #14561, which GTA needs to boot, and nothing else. Both arms run the same environment, so the summary lines carry no configuration difference: APS5_DRAW_PIPELINE=1 APS5_PIPELINED_DRAWS=32 APS5_PIPELINE_DISPATCH=1 APS5_NAN_SPECULATION=1 APS5_NAN_SPECULATION_STAGES=compute,vertex,pixel APS5_NAN_SPECULATION_MIN=compute:32,pixel:8,vertex:8 APS5_NAN_SPECULATION_MIN_OPS=32 (main has no reader of the speculation switches).
    • GPU busy per present: main 27.53 / 26.98 / 28.06 / 26.59 ms, PR 25.28 / 24.70 / 24.82 / 25.55 ms: -2.20 ± 0.38 ms (-8.1%); every PR boot is below every main boot.
    • Frame p50: main 120.8 / 113.8 / 122.0 / 117.4 ms, PR 115.4 / 113.5 / 119.7 / 117.2 ms (-2.0 ± 2.3 ms, within noise): the scene is CPU-bound, so the GPU saving does not reach frame time here.
    • Speculation ran: the PR build's warm-up logged 5,953 [recompile] nan speculation lines (309 programs speculated); each timed PR boot logged 57 to 88 (variants come from the warm cache); every main boot logged none.
    • The aps5-summary.jsonl window line of the first main boot and of the first PR boot are below; all eight lines and the eight tools/trace_digest.py summaries are attached.
  • GTA, main against this PR, run 2 (ns7, on this head 08a5b80467): same method, hardware and environment as run 1, except APS5_TRACE_SECONDS=92:30 (a 30 s window from 92 s, younger game state) and Windows Defender real-time protection off (on in run 1); 4 + 4 boots, all clean, order M S S M S M M S, main 0859a63ae9 with #20845 and #14561 against the same plus this PR.
    • GPU busy per present: main 27.22 / 27.75 / 27.08 / 27.32 ms, PR 25.55 / 25.85 / 25.47 / 26.51 ms: -1.50 ± 0.28 ms (-5.5%); every PR boot is below every main boot. Run 1 measured -2.20 ± 0.38 ms on 10a0263300. Main is the same in both runs (27.29 against 27.34 ms); the PR boots moved from 25.09 to 25.84 ms. Between the two heads nothing changes what the GPU runs: replaying GTA's 319 requests with and without the EXEC-pruning fix gives the same 978 pruned checks and 317 of 317 byte-identical SPIR-V, and no program falls back. What differs between the runs is the window (108:30 against 92:30) and Defender (on against off); the PR boots span 25.47 to 26.51 ms.
    • Frame p50: main 114.8 / 120.5 / 119.9 / 115.1 ms, PR 132.5 / 124.7 / 120.9 / 117.2 ms (+6.25 ± 3.62 ms; run 1 was -2.0 ± 2.3 ms). The two slowest PR boots created pipelines inside the window (Vulkan.GraphicsPipeline.create 1887 and 842 ms, against 0 to 230 ms in main and 59 to 169 ms in the other two PR boots); across the eight boots p50 follows that creation time (correlation 0.90), and with it removed the difference is +0.9 ms. I read it as a cold pipeline-cache transient of the first PR boots plus noise, not a CPU cost of speculation: shader compile-and-link, capture and materialize time in the window are not higher in the PR boots.
    • 0 [recompile] nan speculation failed lines in the four PR boots: no program fell back.
  • ASTRO BOT (PPSA21567 EU, content 01.019.000, standing in the intro, RTX 3080, PCIe Gen4 x16, 3840x2160), one binary built from 08a5b80467 with the switch off against on (compute,vertex,pixel, MIN compute:32,pixel:8,vertex:8, MIN_OPS=32), order off on on off, all four boots clean: GPU busy per present 39.7 / 39.8 ms off against 39.7 / 39.7 ms on, fps 17.24 / 17.55 off against 16.53 / 17.37 on, frame p50 57.0 / 56.5 ms off against 57.5 / 57.3 ms on (+0.6 ms, within noise). Speculation ran: 52 [recompile] nan speculation lines in each on boot, none in the off boots. The switch is neutral on this title: its GPU-heavy shaders gain nothing and nothing regresses. The GPU code is the same as in 08a5b80467 (fd140217a4 changes only a test, and this head only the defaults, which equal the measured settings, and comments).
  • The GTA runs above set the three variables explicitly; the defaults now equal those settings, and the replay line above shows the same SPIR-V for both.
  • GTA, earlier on/off run of the switch on one build (RTX 3080, 4K, play1 standing, A B B A, APS5_NAN_SPECULATION=1 APS5_NAN_SPECULATION_STAGES=compute,vertex,pixel APS5_NAN_SPECULATION_MIN=compute:32,pixel:8,vertex:8, no COUNT): GPU busy per present 26.05 / 26.14 ms off against 24.35 / 24.42 ms on (-1.71 ms, -6.6%); 0 fatal errors, 0 misspeculation lines. Frame p50 is unchanged (the scene is CPU-bound): 91.3 / 91.7 ms off, 90.4 ms on. Results: lab-notes results/ns3-1116. Picture equality: frame 268 is pixel-identical across the two off boots and one on boot (1A, 4A, 3B), and frame 206 across 1A and 3B. The per-program GPU split follows as a comment.
  • GTA replay (rk4, 3 frames): pixels identical in every arm. In-game picture equality A vs B: see the GTA in-game line above.
  • Split-state save points (main's split-state ABI, merged in c76fd68c56e): the split-point calls run inside the per-instruction translation, so a save point inside a speculation region is translated with it. agc_nan_speculation_stages now translates a save before and after each of two f32 adds and requires exactly one StoreSplitState for every placement, a declined region when the save falls inside it, and a kept region for the save after the last add. The test is @JJenkx's (commit 0c2e20d4be9, authored by them), from their AMD integration run in the comments; thank you. Windows, this head: passes; with the split call before each instruction removed it fails (stores=0, region kept).
  • Not tested: titles other than GTA V and ASTRO BOT (neutral on ASTRO BOT); the exact-copy rate in game (there is no run-time counter); AMD/Intel GPUs.
ns5 aps5-summary.jsonl window lines: main (boot 1) and this PR (boot 2)

main 0859a63ae9 + #20845 + #14561:

{"commit":"42f959fb451a","dirty":false,"env":{"APS5_ADDRESS_COPY_MAX_MIB":"512","APS5_DRAW_PIPELINE":"1","APS5_LOG_TIMESTAMPS":"1","APS5_NAN_SPECULATION":"1","APS5_NAN_SPECULATION_MIN":"compute:32,pixel:8,vertex:8","APS5_NAN_SPECULATION_MIN_OPS":"32","APS5_NAN_SPECULATION_STAGES":"compute,vertex,pixel","APS5_NO_PAD_INPUT":"1","APS5_PAD_INPUT_FILE":"<path>","APS5_PIPELINED_DRAWS":"32","APS5_PIPELINE_DISPATCH":"1","APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"108:30","APS5_TRACE_SUMMARY_EVERY":"10","APS5_VIDEOOUT_TELEMETRY_DIR":"<path>"},"gpu":"NVIDIA GeForce RTX 3080","driver":"NVIDIA 621.24","os":"Windows 10.0.26320","cpu":"AMD Ryzen 7 5800X 8-Core Processor","cpu_threads":16,"memory_mib":32676,"title_id":"PPSA04263","title":"Grand Theft Auto V","content_version":"01.011.001","resolution":"3840x2160","window":{"spec":"seconds 108:30","first_present":1830,"ms":30012.500},"presents":235,"frame_ms":{"p50":120.777,"p90":147.903,"p99":203.274,"max":249.065},"gpu_busy_ms_per_present":27.526,"worker_busy_pct":{"queue worker 0x0":93.803},"phase_totals_ms":{"Driver.Completion":0.146,"Driver.Dispatch":1914.056,"Driver.Dispatch.capture_resources":11.928,"Driver.Dispatch.decode_key_device_setup":25.321,"Driver.Dispatch.lookup_cache":250.731,"Driver.Dispatch.materialize":1.798,"Driver.Dispatch.prepared_invocation":57.018,"Driver.Draw":20381.891,"Driver.Draw.device_setup":696.389,"Driver.Draw.draw_handed_off":3127.792,"Driver.Draw.prepare":16479.519,"Driver.DrawFinish":18758.584,"Driver.DrawFinish.draw_enqueued":8887.611,"Driver.DrawFinish.post_compile_prepare":256.615,"Driver.DrawFinish.shader_compile_and_link":9478.678,"Driver.EndSubmission":374.245,"Driver.Packet":26703.906,"Driver.Packet.device_lock":198.231,"Driver.Packet.dispatch":1922.453,"Driver.Packet.draw":20543.305,"Driver.Packet.execute":1631.469,"Driver.Packet.flip_flush":8.549,"Driver.Packet.flush_between_packets":493.151,"Driver.Packet.memory_wait":4.782,"Driver.Packet.pipeline_drain":442.028,"Driver.Packet.pipeline_prepare":283.124,"Driver.Packet.prepare_memory":252.137,"Driver.Packet.rendering_wait":0.175,"Driver.Present":1420.230,"Driver.Present.acquire_image":3.453,"Driver.Present.device_setup":0.119,"Driver.Present.gpu_mutex_wait":2.094,"Driver.Present.inflight_wait":0.607,"Driver.Present.present_display_buffer":29.178,"Driver.Present.queue_present":102.741,"Driver.Present.release_and_callback":0.421,"Driver.Present.render_fence_wait":1280.970,"Driver.Present.resize":0.411,"Driver.Present.validate":0.083,"Driver.Rewind":1074.193,"Driver.Suspend":0.055,"GpuMutex.wait.dispatch":0.019,"GpuMutex.wait.draw":36.598,"GpuMutex.wait.end":3.743,"GpuMutex.wait.fill":0.088,"GpuMutex.wait.flush":0.218,"GpuMutex.wait.hook":1.207,"GpuMutex.wait.label":1.406,"GpuMutex.wait.other":0.035,"GpuMutex.wait.present":1.598,"Graphics.Draw":23525.972,"Graphics.Draw.draw_and_resource_release":18453.658,"Graphics.Draw.index_upload":1179.771,"Graphics.Draw.validate":869.422,"Graphics.Draw.vertex_upload":2730.707,"Graphics.DrawWithRecipe":589.837,"Graphics.DrawWithRecipe.draw_and_resource_release":460.946,"Graphics.DrawWithRecipe.index_upload":37.978,"Graphics.DrawWithRecipe.validate":10.838,"Graphics.DrawWithRecipe.vertex_upload":75.332,"Recorder.Reap":285.365,"Recorder.Submit":874.832,"Recorder.Sync":537.922,"Recorder.WaitSerial":242.609,"Resources.Complete":56.421,"Resources.Prepare":101.006,"Shader.DrawStage":8694.697,"Shader.DrawStage.capture_resources":4377.729,"Shader.DrawStage.materialize":2796.195,"Shader.DrawStage.prepared_invocation":1409.929,"Shader.ResolveGraphicsStagesAbi":5.386,"VideoOut.Flip":1448.843,"VideoOut.Flip.completion_mutex_wait":0.455,"VideoOut.Flip.config_mutex_wait":0.026,"VideoOut.Flip.frame_limit":0.139,"VideoOut.Flip.notify_game":4.583,"VideoOut.Flip.present":1421.823,"VideoOut.Flip.validate":0.278,"VideoOut.Flip.vblank_wait":0.165,"VideoOut.Flip.window_prepare":0.398,"VideoOut.Flip.window_title":20.783,"VideoOut.Readiness":0.500,"VideoOut.Readiness.locks_validate":0.201,"Vulkan.Acquire":3.201,"Vulkan.Acquire.acquire_fence_wait":0.467,"Vulkan.Acquire.acquire_image":2.057,"Vulkan.Acquire.fence_reset":0.482,"Vulkan.Acquire.retired_swapchains":0.112,"Vulkan.Dispatch":161.405,"Vulkan.Dispatch.command_record":66.174,"Vulkan.Dispatch.shader_resources":92.998,"Vulkan.DispatchRecipe":162.351,"Vulkan.DispatchRecipe.command_record":161.092,"Vulkan.DrawFromRecipe":596.304,"Vulkan.GraphicsPipeline":347.096,"Vulkan.GraphicsPipeline.create":343.729,"Vulkan.GraphicsPipeline.modules_and_state":3.341,"Vulkan.GraphicsPipelineLibrary":343.324,"Vulkan.GraphicsPipelineLink":0.156,"Vulkan.Present":12.519,"Vulkan.Present.command_record_scale":5.478,"Vulkan.Present.pixel_upload":1.359,"Vulkan.Present.queue_submit":5.511,"Vulkan.QueuePresent":102.379,"Vulkan.QueuePresent.queue_present":101.948,"Vulkan.Retire":1280.892,"Vulkan.Retire.wait":1277.976},"top_phases_ms_per_frame":{"Driver.Packet":113.634,"Graphics.Draw":100.111,"Driver.Packet.draw":87.418,"Driver.Draw":86.731,"Driver.DrawFinish":79.824,"Graphics.Draw.draw_and_resource_release":78.526,"Driver.Draw.prepare":70.126,"Driver.DrawFinish.shader_compile_and_link":40.335},"owned_draw_counts":{"OwnedDraw.arm_attempt":11045,"OwnedDraw.arm_blocks_requested":11045,"OwnedDraw.arm_refused":11045},"graphics_track":{"Graphics.Barrier.copy":3090,"Graphics.Barrier.dcc-clear":2820,"Graphics.Barrier.dcc-keys":1880,"Graphics.Barrier.dispatch-lead":8766,"Graphics.Barrier.dispatch-trail":10123,"Graphics.Barrier.draw":145058,"Graphics.Barrier.fill":2877,"Graphics.Barrier.fill-clear":470,"Graphics.Barrier.indirect-args":1645,"Graphics.Barrier.input-mirror":29083,"Graphics.Barrier.label-run":95701,"Graphics.Barrier.present-blit":940,"Graphics.Barrier.shadow-publish":475,"Graphics.Barrier.staging-in":9189,"Graphics.Barrier.staging-out":3993,"Graphics.Barrier.storage-upload":8966,"Graphics.Barrier.storage-writeback":26457,"Graphics.BarrierMerged.dispatch-lead":4647,"Graphics.BarrierMerged.fill":1417,"Graphics.BarrierMerged.label-run":456,"Graphics.BarrierMerged.shadow-publish":475,"Graphics.BarrierMerged.staging-in":2790,"Graphics.BarrierMerged.staging-out":3993,"Graphics.BarrierMerged.storage-writeback":4076,"Graphics.Copy":38986,"Graphics.Copy.bytes":6279995832,"Graphics.RenderPass":72578,"Graphics.RenderPass.Close.command":36827,"Graphics.RenderPass.Close.image":20500,"Graphics.RenderPass.Close.key":3482,"Graphics.RenderPass.Close.label":456,"Graphics.RenderPass.Close.new-batch":11308,"Graphics.RenderPass.Continued":756187},"trace_dropped":true,"trace_dropped_threads":{"queue worker 0x0":{"events_full_after_s":7.257,"events_lost":873660,"totals_full":false},"draw committer":{"events_full_after_s":13.853,"events_lost":320255,"totals_full":false},"draw finisher":{"events_full_after_s":18.787,"events_lost":149552,"totals_full":false}},"trace":"aps5-trace-42f959fb451a-26592.json.gz"}

this PR 10a0263300 (run 1) + #20845 + #14561:

{"commit":"561b292e2fa9","dirty":false,"env":{"APS5_ADDRESS_COPY_MAX_MIB":"512","APS5_DRAW_PIPELINE":"1","APS5_LOG_TIMESTAMPS":"1","APS5_NAN_SPECULATION":"1","APS5_NAN_SPECULATION_MIN":"compute:32,pixel:8,vertex:8","APS5_NAN_SPECULATION_MIN_OPS":"32","APS5_NAN_SPECULATION_STAGES":"compute,vertex,pixel","APS5_NO_PAD_INPUT":"1","APS5_PAD_INPUT_FILE":"<path>","APS5_PIPELINED_DRAWS":"32","APS5_PIPELINE_DISPATCH":"1","APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"108:30","APS5_TRACE_SUMMARY_EVERY":"10","APS5_VIDEOOUT_TELEMETRY_DIR":"<path>"},"gpu":"NVIDIA GeForce RTX 3080","driver":"NVIDIA 621.24","os":"Windows 10.0.26320","cpu":"AMD Ryzen 7 5800X 8-Core Processor","cpu_threads":16,"memory_mib":32676,"title_id":"PPSA04263","title":"Grand Theft Auto V","content_version":"01.011.001","resolution":"3840x2160","window":{"spec":"seconds 108:30","first_present":1684,"ms":30072.550},"presents":244,"frame_ms":{"p50":115.401,"p90":132.797,"p99":336.997,"max":428.811},"gpu_busy_ms_per_present":25.282,"worker_busy_pct":{"queue worker 0x0":93.914},"phase_totals_ms":{"Driver.Completion":0.132,"Driver.Dispatch":2291.770,"Driver.Dispatch.capture_resources":7.622,"Driver.Dispatch.decode_key_device_setup":25.060,"Driver.Dispatch.lookup_cache":156.172,"Driver.Dispatch.materialize":1.149,"Driver.Dispatch.prepared_invocation":80.366,"Driver.Draw":20129.901,"Driver.Draw.device_setup":741.372,"Driver.Draw.draw_handed_off":3171.293,"Driver.Draw.prepare":16128.451,"Driver.DrawFinish":18586.589,"Driver.DrawFinish.draw_enqueued":8915.936,"Driver.DrawFinish.post_compile_prepare":249.360,"Driver.DrawFinish.shader_compile_and_link":9278.740,"Driver.EndSubmission":361.067,"Driver.Packet":26794.104,"Driver.Packet.device_lock":204.940,"Driver.Packet.dispatch":2300.588,"Driver.Packet.draw":20291.330,"Driver.Packet.execute":1418.597,"Driver.Packet.flip_flush":8.657,"Driver.Packet.flush_between_packets":501.040,"Driver.Packet.memory_wait":4.742,"Driver.Packet.pipeline_drain":423.551,"Driver.Packet.pipeline_prepare":294.039,"Driver.Packet.prepare_memory":258.641,"Driver.Packet.rendering_wait":0.184,"Driver.Present":1050.805,"Driver.Present.acquire_image":3.521,"Driver.Present.device_setup":0.113,"Driver.Present.gpu_mutex_wait":2.044,"Driver.Present.inflight_wait":0.590,"Driver.Present.present_display_buffer":31.588,"Driver.Present.queue_present":103.175,"Driver.Present.release_and_callback":0.379,"Driver.Present.render_fence_wait":908.776,"Driver.Present.resize":0.410,"Driver.Present.validate":0.054,"Driver.Rewind":1086.925,"Driver.Suspend":0.047,"GpuMutex.wait.dispatch":0.102,"GpuMutex.wait.draw":42.226,"GpuMutex.wait.end":1.068,"GpuMutex.wait.fill":0.041,"GpuMutex.wait.flush":0.113,"GpuMutex.wait.hook":0.003,"GpuMutex.wait.label":0.722,"GpuMutex.wait.other":0.030,"GpuMutex.wait.present":1.510,"Graphics.Draw":23904.126,"Graphics.Draw.draw_and_resource_release":18957.390,"Graphics.Draw.index_upload":1145.057,"Graphics.Draw.validate":883.367,"Graphics.Draw.vertex_upload":2665.314,"Graphics.DrawWithRecipe":730.887,"Graphics.DrawWithRecipe.draw_and_resource_release":569.147,"Graphics.DrawWithRecipe.index_upload":47.942,"Graphics.DrawWithRecipe.validate":13.962,"Graphics.DrawWithRecipe.vertex_upload":94.435,"Recorder.Reap":275.186,"Recorder.Submit":836.083,"Recorder.Sync":444.207,"Recorder.WaitSerial":243.303,"Resources.Complete":54.898,"Resources.Prepare":98.454,"Shader.DrawStage":8530.258,"Shader.DrawStage.capture_resources":4249.524,"Shader.DrawStage.materialize":2743.782,"Shader.DrawStage.prepared_invocation":1423.483,"Shader.ResolveGraphicsStagesAbi":5.199,"VideoOut.Flip":1092.263,"VideoOut.Flip.completion_mutex_wait":0.428,"VideoOut.Flip.config_mutex_wait":0.034,"VideoOut.Flip.frame_limit":0.144,"VideoOut.Flip.notify_game":17.154,"VideoOut.Flip.present":1052.421,"VideoOut.Flip.validate":0.288,"VideoOut.Flip.vblank_wait":0.171,"VideoOut.Flip.window_prepare":0.420,"VideoOut.Flip.window_title":20.954,"VideoOut.Readiness":0.482,"VideoOut.Readiness.locks_validate":0.212,"Vulkan.Acquire":3.270,"Vulkan.Acquire.acquire_fence_wait":0.478,"Vulkan.Acquire.acquire_image":2.095,"Vulkan.Acquire.fence_reset":0.489,"Vulkan.Acquire.retired_swapchains":0.122,"Vulkan.Dispatch":192.501,"Vulkan.Dispatch.command_record":69.190,"Vulkan.Dispatch.shader_resources":121.082,"Vulkan.DispatchRecipe":153.757,"Vulkan.DispatchRecipe.command_record":152.552,"Vulkan.DrawFromRecipe":738.078,"Vulkan.GraphicsPipeline":1222.746,"Vulkan.GraphicsPipeline.create":1216.647,"Vulkan.GraphicsPipeline.modules_and_state":6.059,"Vulkan.GraphicsPipelineLibrary":1216.037,"Vulkan.GraphicsPipelineLink":0.197,"Vulkan.Present":12.286,"Vulkan.Present.command_record_scale":5.774,"Vulkan.Present.pixel_upload":0.643,"Vulkan.Present.queue_submit":5.693,"Vulkan.QueuePresent":102.806,"Vulkan.QueuePresent.queue_present":102.344,"Vulkan.Retire":908.700,"Vulkan.Retire.wait":905.884},"top_phases_ms_per_frame":{"Driver.Packet":109.812,"Graphics.Draw":97.968,"Driver.Packet.draw":83.161,"Driver.Draw":82.500,"Graphics.Draw.draw_and_resource_release":77.694,"Driver.DrawFinish":76.175,"Driver.Draw.prepare":66.100,"Driver.DrawFinish.shader_compile_and_link":38.028},"owned_draw_counts":{"OwnedDraw.arm_attempt":11468,"OwnedDraw.arm_blocks_requested":11468,"OwnedDraw.arm_refused":11468},"graphics_track":{"Graphics.Barrier.copy":3240,"Graphics.Barrier.dcc-clear":2928,"Graphics.Barrier.dcc-keys":1952,"Graphics.Barrier.dispatch-lead":9101,"Graphics.Barrier.dispatch-trail":10218,"Graphics.Barrier.draw":147692,"Graphics.Barrier.fill":2977,"Graphics.Barrier.fill-clear":488,"Graphics.Barrier.indirect-args":1708,"Graphics.Barrier.input-mirror":28303,"Graphics.Barrier.label-run":98616,"Graphics.Barrier.present-blit":976,"Graphics.Barrier.shadow-publish":488,"Graphics.Barrier.staging-in":9026,"Graphics.Barrier.staging-out":3860,"Graphics.Barrier.storage-upload":9296,"Graphics.Barrier.storage-writeback":27469,"Graphics.BarrierMerged.dispatch-lead":4533,"Graphics.BarrierMerged.fill":1471,"Graphics.BarrierMerged.label-run":443,"Graphics.BarrierMerged.shadow-publish":488,"Graphics.BarrierMerged.staging-in":2554,"Graphics.BarrierMerged.staging-out":3860,"Graphics.BarrierMerged.storage-writeback":4182,"Graphics.Copy":38025,"Graphics.Copy.bytes":6313675764,"Graphics.RenderPass":73922,"Graphics.RenderPass.Close.command":36779,"Graphics.RenderPass.Close.image":21458,"Graphics.RenderPass.Close.key":3633,"Graphics.RenderPass.Close.label":443,"Graphics.RenderPass.Close.new-batch":11601,"Graphics.RenderPass.Continued":784603},"trace_dropped":true,"trace_dropped_threads":{"queue worker 0x0":{"events_full_after_s":7.548,"events_lost":807017,"totals_full":false},"draw committer":{"events_full_after_s":13.893,"events_lost":305473,"totals_full":false},"draw finisher":{"events_full_after_s":20.456,"events_lost":121219,"totals_full":false}},"trace":"aps5-trace-561b292e2fa9-11316.json.gz"}
ns7 aps5-summary.jsonl window lines: main (boot 1) and this PR (boot 2)

main 0859a63ae9 + #20845 + #14561:

{"commit":"42f959fb451a","dirty":false,"env":{"APS5_ADDRESS_COPY_MAX_MIB":"512","APS5_DRAW_PIPELINE":"1","APS5_LOG_TIMESTAMPS":"1","APS5_NAN_SPECULATION":"1","APS5_NAN_SPECULATION_MIN":"compute:32,pixel:8,vertex:8","APS5_NAN_SPECULATION_MIN_OPS":"32","APS5_NAN_SPECULATION_STAGES":"compute,vertex,pixel","APS5_NO_PAD_INPUT":"1","APS5_PAD_INPUT_FILE":"<path>","APS5_PIPELINED_DRAWS":"32","APS5_PIPELINE_DISPATCH":"1","APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"92:30","APS5_TRACE_SUMMARY_EVERY":"10","APS5_VIDEOOUT_TELEMETRY_DIR":"<path>"},"gpu":"NVIDIA GeForce RTX 3080","driver":"NVIDIA 621.24","os":"Windows 10.0.26320","cpu":"AMD Ryzen 7 5800X 8-Core Processor","cpu_threads":16,"memory_mib":32676,"title_id":"PPSA04263","title":"Grand Theft Auto V","content_version":"01.011.001","resolution":"3840x2160","window":{"spec":"seconds 92:30","first_present":1741,"ms":30073.185},"presents":253,"frame_ms":{"p50":114.802,"p90":127.119,"p99":158.256,"max":383.749},"gpu_busy_ms_per_present":27.218,"worker_busy_pct":{"queue worker 0x0":93.982},"phase_totals_ms":{"Driver.Completion":0.143,"Driver.Dispatch":2400.318,"Driver.Dispatch.capture_resources":15.459,"Driver.Dispatch.decode_key_device_setup":25.813,"Driver.Dispatch.lookup_cache":286.132,"Driver.Dispatch.materialize":2.260,"Driver.Dispatch.prepared_invocation":81.873,"Driver.Draw":20211.295,"Driver.Draw.device_setup":716.969,"Driver.Draw.draw_handed_off":3196.833,"Driver.Draw.prepare":16220.893,"Driver.DrawFinish":18692.200,"Driver.DrawFinish.draw_enqueued":8562.815,"Driver.DrawFinish.post_compile_prepare":269.538,"Driver.DrawFinish.shader_compile_and_link":9719.749,"Driver.EndSubmission":339.118,"Driver.Packet":26844.735,"Driver.Packet.device_lock":211.663,"Driver.Packet.dispatch":2408.992,"Driver.Packet.draw":20366.027,"Driver.Packet.execute":1478.837,"Driver.Packet.flip_flush":8.850,"Driver.Packet.flush_between_packets":511.393,"Driver.Packet.memory_wait":4.896,"Driver.Packet.pipeline_drain":441.544,"Driver.Packet.pipeline_prepare":299.613,"Driver.Packet.prepare_memory":266.775,"Driver.Packet.rendering_wait":0.174,"Driver.Present":1545.849,"Driver.Present.acquire_image":3.794,"Driver.Present.device_setup":0.132,"Driver.Present.gpu_mutex_wait":2.417,"Driver.Present.inflight_wait":0.612,"Driver.Present.present_display_buffer":31.075,"Driver.Present.queue_present":107.420,"Driver.Present.release_and_callback":0.417,"Driver.Present.render_fence_wait":1399.310,"Driver.Present.resize":0.433,"Driver.Present.validate":0.077,"Driver.Rewind":1079.431,"Driver.Suspend":0.053,"GpuMutex.wait.dispatch":0.025,"GpuMutex.wait.draw":32.405,"GpuMutex.wait.end":1.520,"GpuMutex.wait.fill":0.137,"GpuMutex.wait.flush":0.146,"GpuMutex.wait.hook":0.085,"GpuMutex.wait.label":0.982,"GpuMutex.wait.other":0.051,"GpuMutex.wait.present":1.882,"Graphics.Draw":24053.262,"Graphics.Draw.draw_and_resource_release":18801.952,"Graphics.Draw.index_upload":1215.748,"Graphics.Draw.validate":906.032,"Graphics.Draw.vertex_upload":2853.670,"Graphics.DrawWithRecipe":591.880,"Graphics.DrawWithRecipe.draw_and_resource_release":461.671,"Graphics.DrawWithRecipe.index_upload":37.757,"Graphics.DrawWithRecipe.validate":10.782,"Graphics.DrawWithRecipe.vertex_upload":76.923,"Recorder.Reap":273.593,"Recorder.Submit":843.706,"Recorder.Sync":467.323,"Recorder.WaitSerial":249.075,"Resources.Complete":56.541,"Resources.Prepare":97.909,"Shader.DrawStage":8960.342,"Shader.DrawStage.capture_resources":4460.358,"Shader.DrawStage.materialize":2904.011,"Shader.DrawStage.prepared_invocation":1473.908,"Shader.ResolveGraphicsStagesAbi":5.450,"VideoOut.Flip":1579.713,"VideoOut.Flip.completion_mutex_wait":0.455,"VideoOut.Flip.config_mutex_wait":0.026,"VideoOut.Flip.frame_limit":0.104,"VideoOut.Flip.notify_game":8.301,"VideoOut.Flip.present":1547.451,"VideoOut.Flip.validate":0.310,"VideoOut.Flip.vblank_wait":0.209,"VideoOut.Flip.window_prepare":0.403,"VideoOut.Flip.window_title":22.207,"VideoOut.Readiness":0.454,"VideoOut.Readiness.locks_validate":0.197,"Vulkan.Acquire":3.528,"Vulkan.Acquire.acquire_fence_wait":0.557,"Vulkan.Acquire.acquire_image":2.196,"Vulkan.Acquire.fence_reset":0.571,"Vulkan.Acquire.retired_swapchains":0.117,"Vulkan.Dispatch":174.988,"Vulkan.Dispatch.command_record":71.541,"Vulkan.Dispatch.shader_resources":101.072,"Vulkan.DispatchRecipe":160.292,"Vulkan.DispatchRecipe.command_record":159.073,"Vulkan.DrawFromRecipe":597.983,"Vulkan.GraphicsPipeline":230.237,"Vulkan.GraphicsPipeline.create":229.984,"Vulkan.GraphicsPipeline.modules_and_state":0.250,"Vulkan.GraphicsPipelineLibrary":229.949,"Vulkan.GraphicsPipelineLink":0.013,"Vulkan.Present":13.228,"Vulkan.Present.command_record_scale":5.877,"Vulkan.Present.pixel_upload":0.801,"Vulkan.Present.queue_submit":6.376,"Vulkan.QueuePresent":107.052,"Vulkan.QueuePresent.queue_present":106.582,"Vulkan.Retire":1399.217,"Vulkan.Retire.wait":1396.248},"top_phases_ms_per_frame":{"Driver.Packet":106.106,"Graphics.Draw":95.072,"Driver.Packet.draw":80.498,"Driver.Draw":79.887,"Graphics.Draw.draw_and_resource_release":74.316,"Driver.DrawFinish":73.882,"Driver.Draw.prepare":64.114,"Driver.DrawFinish.shader_compile_and_link":38.418},"owned_draw_counts":{"OwnedDraw.arm_attempt":11891,"OwnedDraw.arm_blocks_requested":11891,"OwnedDraw.arm_refused":11891},"graphics_track":{"Graphics.Barrier.copy":3417,"Graphics.Barrier.dcc-clear":3036,"Graphics.Barrier.dcc-keys":2024,"Graphics.Barrier.dispatch-lead":9393,"Graphics.Barrier.dispatch-trail":10930,"Graphics.Barrier.draw":157110,"Graphics.Barrier.fill":3110,"Graphics.Barrier.fill-clear":506,"Graphics.Barrier.indirect-args":1771,"Graphics.Barrier.input-mirror":32424,"Graphics.Barrier.label-run":102852,"Graphics.Barrier.present-blit":1012,"Graphics.Barrier.shadow-publish":511,"Graphics.Barrier.staging-in":10239,"Graphics.Barrier.staging-out":4336,"Graphics.Barrier.storage-upload":9636,"Graphics.Barrier.storage-writeback":28442,"Graphics.BarrierMerged.dispatch-lead":5079,"Graphics.BarrierMerged.fill":1540,"Graphics.BarrierMerged.label-run":760,"Graphics.BarrierMerged.shadow-publish":511,"Graphics.BarrierMerged.staging-in":2769,"Graphics.BarrierMerged.staging-out":4336,"Graphics.BarrierMerged.storage-writeback":4408,"Graphics.Copy":43156,"Graphics.Copy.bytes":6768778734,"Graphics.RenderPass":78679,"Graphics.RenderPass.Close.command":40457,"Graphics.RenderPass.Close.image":21964,"Graphics.RenderPass.Close.key":3779,"Graphics.RenderPass.Close.label":760,"Graphics.RenderPass.Close.new-batch":11717,"Graphics.RenderPass.Continued":816974},"trace_dropped":true,"trace_dropped_threads":{"queue worker 0x0":{"events_full_after_s":6.840,"events_lost":869495,"totals_full":false},"draw committer":{"events_full_after_s":13.324,"events_lost":330331,"totals_full":false},"draw finisher":{"events_full_after_s":19.652,"events_lost":139474,"totals_full":false}},"trace":"aps5-trace-42f959fb451a-6212.json.gz"}

this PR 08a5b80467 + #20845 + #14561:

{"commit":"0f488907d7b6","dirty":false,"env":{"APS5_ADDRESS_COPY_MAX_MIB":"512","APS5_DRAW_PIPELINE":"1","APS5_LOG_TIMESTAMPS":"1","APS5_NAN_SPECULATION":"1","APS5_NAN_SPECULATION_MIN":"compute:32,pixel:8,vertex:8","APS5_NAN_SPECULATION_MIN_OPS":"32","APS5_NAN_SPECULATION_STAGES":"compute,vertex,pixel","APS5_NO_PAD_INPUT":"1","APS5_PAD_INPUT_FILE":"<path>","APS5_PIPELINED_DRAWS":"32","APS5_PIPELINE_DISPATCH":"1","APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"92:30","APS5_TRACE_SUMMARY_EVERY":"10","APS5_VIDEOOUT_TELEMETRY_DIR":"<path>"},"gpu":"NVIDIA GeForce RTX 3080","driver":"NVIDIA 621.24","os":"Windows 10.0.26320","cpu":"AMD Ryzen 7 5800X 8-Core Processor","cpu_threads":16,"memory_mib":32676,"title_id":"PPSA04263","title":"Grand Theft Auto V","content_version":"01.011.001","resolution":"3840x2160","window":{"spec":"seconds 92:30","first_present":1706,"ms":30052.716},"presents":208,"frame_ms":{"p50":132.538,"p90":167.162,"p99":403.673,"max":467.028},"gpu_busy_ms_per_present":25.549,"worker_busy_pct":{"queue worker 0x0":94.129},"phase_totals_ms":{"Driver.Completion":0.125,"Driver.Dispatch":1825.869,"Driver.Dispatch.capture_resources":11.747,"Driver.Dispatch.decode_key_device_setup":23.337,"Driver.Dispatch.lookup_cache":258.990,"Driver.Dispatch.materialize":1.714,"Driver.Dispatch.prepared_invocation":64.001,"Driver.Draw":20678.574,"Driver.Draw.device_setup":639.154,"Driver.Draw.draw_handed_off":2808.801,"Driver.Draw.prepare":17158.985,"Driver.DrawFinish":19246.438,"Driver.DrawFinish.draw_enqueued":10326.132,"Driver.DrawFinish.post_compile_prepare":229.735,"Driver.DrawFinish.shader_compile_and_link":8571.202,"Driver.EndSubmission":296.702,"Driver.Packet":27051.679,"Driver.Packet.device_lock":173.191,"Driver.Packet.dispatch":1833.510,"Driver.Packet.draw":20817.437,"Driver.Packet.execute":1999.041,"Driver.Packet.flip_flush":7.594,"Driver.Packet.flush_between_packets":429.623,"Driver.Packet.memory_wait":4.698,"Driver.Packet.pipeline_drain":418.496,"Driver.Packet.pipeline_prepare":254.262,"Driver.Packet.prepare_memory":225.473,"Driver.Packet.rendering_wait":0.202,"Driver.Present":869.105,"Driver.Present.acquire_image":3.114,"Driver.Present.device_setup":0.107,"Driver.Present.gpu_mutex_wait":2.132,"Driver.Present.inflight_wait":0.520,"Driver.Present.present_display_buffer":25.473,"Driver.Present.queue_present":88.281,"Driver.Present.release_and_callback":0.366,"Driver.Present.render_fence_wait":748.556,"Driver.Present.resize":0.364,"Driver.Present.validate":0.061,"Driver.Rewind":939.882,"Driver.Suspend":0.047,"GpuMutex.wait.dispatch":0.040,"GpuMutex.wait.draw":34.814,"GpuMutex.wait.end":3.841,"GpuMutex.wait.fill":0.079,"GpuMutex.wait.flush":0.089,"GpuMutex.wait.hook":0.002,"GpuMutex.wait.label":0.923,"GpuMutex.wait.other":0.019,"GpuMutex.wait.present":1.683,"Graphics.Draw":22794.208,"Graphics.Draw.draw_and_resource_release":18190.475,"Graphics.Draw.index_upload":1076.643,"Graphics.Draw.validate":801.948,"Graphics.Draw.vertex_upload":2478.622,"Graphics.DrawWithRecipe":564.149,"Graphics.DrawWithRecipe.draw_and_resource_release":438.796,"Graphics.DrawWithRecipe.index_upload":37.793,"Graphics.DrawWithRecipe.validate":10.536,"Graphics.DrawWithRecipe.vertex_upload":72.573,"Recorder.Reap":252.817,"Recorder.Submit":826.141,"Recorder.Sync":517.802,"Recorder.WaitSerial":227.793,"Resources.Complete":55.396,"Resources.Prepare":96.749,"Shader.DrawStage":7925.028,"Shader.DrawStage.capture_resources":3894.407,"Shader.DrawStage.materialize":2596.673,"Shader.DrawStage.prepared_invocation":1331.992,"Shader.ResolveGraphicsStagesAbi":4.848,"VideoOut.Flip":899.099,"VideoOut.Flip.completion_mutex_wait":0.349,"VideoOut.Flip.config_mutex_wait":0.027,"VideoOut.Flip.frame_limit":0.105,"VideoOut.Flip.notify_game":8.716,"VideoOut.Flip.present":871.121,"VideoOut.Flip.validate":0.238,"VideoOut.Flip.vblank_wait":0.149,"VideoOut.Flip.window_prepare":0.357,"VideoOut.Flip.window_title":17.832,"VideoOut.Readiness":0.424,"VideoOut.Readiness.locks_validate":0.181,"Vulkan.Acquire":2.893,"Vulkan.Acquire.acquire_fence_wait":0.424,"Vulkan.Acquire.acquire_image":1.847,"Vulkan.Acquire.fence_reset":0.429,"Vulkan.Acquire.retired_swapchains":0.123,"Vulkan.Dispatch":166.710,"Vulkan.Dispatch.command_record":58.857,"Vulkan.Dispatch.shader_resources":105.861,"Vulkan.DispatchRecipe":149.057,"Vulkan.DispatchRecipe.command_record":147.852,"Vulkan.DrawFromRecipe":570.100,"Vulkan.GraphicsPipeline":1895.640,"Vulkan.GraphicsPipeline.create":1887.204,"Vulkan.GraphicsPipeline.modules_and_state":8.389,"Vulkan.GraphicsPipelineLibrary":1886.382,"Vulkan.GraphicsPipelineLink":0.286,"Vulkan.Present":11.258,"Vulkan.Present.command_record_scale":4.908,"Vulkan.Present.pixel_upload":1.172,"Vulkan.Present.queue_submit":5.028,"Vulkan.QueuePresent":87.943,"Vulkan.QueuePresent.queue_present":87.568,"Vulkan.Retire":748.472,"Vulkan.Retire.wait":746.074},"top_phases_ms_per_frame":{"Driver.Packet":130.056,"Graphics.Draw":109.588,"Driver.Packet.draw":100.084,"Driver.Draw":99.416,"Driver.DrawFinish":92.531,"Graphics.Draw.draw_and_resource_release":87.454,"Driver.Draw.prepare":82.495,"Driver.DrawFinish.draw_enqueued":49.645},"owned_draw_counts":{"OwnedDraw.arm_attempt":9776,"OwnedDraw.arm_blocks_requested":9776,"OwnedDraw.arm_refused":9776},"graphics_track":{"Graphics.Barrier.copy":2757,"Graphics.Barrier.dcc-clear":2496,"Graphics.Barrier.dcc-keys":1664,"Graphics.Barrier.dispatch-lead":7782,"Graphics.Barrier.dispatch-trail":9018,"Graphics.Barrier.draw":126805,"Graphics.Barrier.fill":2567,"Graphics.Barrier.fill-clear":416,"Graphics.Barrier.indirect-args":1456,"Graphics.Barrier.input-mirror":24827,"Graphics.Barrier.label-run":85034,"Graphics.Barrier.present-blit":832,"Graphics.Barrier.shadow-publish":416,"Graphics.Barrier.staging-in":8268,"Graphics.Barrier.staging-out":3598,"Graphics.Barrier.storage-upload":7936,"Graphics.Barrier.storage-writeback":23380,"Graphics.BarrierMerged.dispatch-lead":4148,"Graphics.BarrierMerged.fill":1233,"Graphics.BarrierMerged.label-run":582,"Graphics.BarrierMerged.shadow-publish":416,"Graphics.BarrierMerged.staging-in":2526,"Graphics.BarrierMerged.staging-out":3598,"Graphics.BarrierMerged.storage-writeback":3602,"Graphics.Copy":33746,"Graphics.Copy.bytes":5606150740,"Graphics.RenderPass":63426,"Graphics.RenderPass.Close.command":31976,"Graphics.RenderPass.Close.image":17702,"Graphics.RenderPass.Close.key":3071,"Graphics.RenderPass.Close.label":582,"Graphics.RenderPass.Close.new-batch":10088,"Graphics.RenderPass.Continued":664360},"trace_dropped":true,"trace_dropped_threads":{"queue worker 0x0":{"events_full_after_s":8.407,"events_lost":752985,"totals_full":false},"draw committer":{"events_full_after_s":15.523,"events_lost":262132,"totals_full":false},"draw finisher":{"events_full_after_s":21.576,"events_lost":110795,"totals_full":false}},"trace":"aps5-trace-0f488907d7b6-14376.json.gz"}

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; no silent stubs
  • No notes, investigation .md files or images added to the repository
  • New third-party code is a submodule built from source: none
  • Generic behaviour, not specific to one title
  • Depends on: #23343 (SRT walker and control-flow identity fixes). Merge it first; this PR's commits sit on top of it.
  • Fixes: none
  • Unblocks: none
  • GPUs tested: lavapipe (Mesa, Linux) for the unit tests; NVIDIA GeForce RTX 3080, driver 621.24, Windows, for the pixel execution test, the in-game on/off run (ns3) and the main-vs-change run (ns5 on 10a0263300 and ns7 on 08a5b80467)
  • AI-assisted: yes

🤖 Generated with Claude Code

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5384922068 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/23344). Originally posted by [chitters2004](https://github.com/chitters2004) on 2026-11-18T22:08:36Z. --- ### What Every f32/f16 vector ALU result is repaired to match RDNA's NaN sources and default NaN. This is the largest single cost in GTA's heavy shaders: the no-repair bound (`APS5_FAST_F32`-style, not exact) saves 7.18 ms GPU busy per present, so repair is worth attacking while staying exact. With `APS5_NAN_SPECULATION=1`, a run of pure vector instructions (at least `APS5_NAN_SPECULATION_MIN`, at most `APS5_NAN_SPECULATION_MAX`) is translated twice: a fast copy without the repair that records whether any operand or result was a NaN, and the exact copy. The wave branches to the exact copy, from the register and exec state saved before the run, whenever a NaN was seen. Results are unchanged by construction; only a NaN-carrying wave pays for both copies. - Checks implied by a later check in the same region are pruned (`NanFlagPruner`). - Regions that write state that cannot be restored, and tessellation stages, are not speculated. - Pixel regions branch on the lane's own NaN flag and are declined when they hold a cross-lane or lane-mask instruction. - The defaults are the measured configuration, so `APS5_NAN_SPECULATION=1` alone reproduces it: `APS5_NAN_SPECULATION_STAGES=compute,vertex,pixel`, `APS5_NAN_SPECULATION_MIN=compute:32,pixel:8,vertex:8` (32 for the other stages) and `APS5_NAN_SPECULATION_MIN_OPS=32`. Each variable overrides its default; `APS5_NAN_SPECULATION_MIN` takes a number for every stage or a per-stage list that overrides only the stages it names. - The compile-side `[nan-spec-compile]` lines (programs, speculated, declined, fell back by stage) print every 10 s in a boot with `APS5_PROFILE_DRAW` and at the end of `agc_frame_replay`. There are no run-time counters: speculation writes no guest-visible memory, and `agc_nan_speculation_pixel` checks that no speculated program gets a GDS entry. How often a wave takes the exact copy in game is therefore not measured. All switches are startup-only and every setting (each stage's minimum, bounds, stages, fast-op and density limits) is mixed into the shader disk cache key. **Default and cost.** Off by default (`APS5_NAN_SPECULATION=1` to enable); this PR does not change the default. Apart from the disk-cache invalidation, nothing changes unless the switch is on: the SRT walker and `ConstantFolder::Fold` fixes that run for every shader are in the PR this one depends on. The only code here that runs with the switch off is a small `ResourceTracker` hardening (an invariant phi is used only where it is available, and lane selectors respect phi order); the `agc_shader_replay --spv` output with the switch off is byte-identical between the head before this PR's defaults change and this head, on the 319 replay requests (316 compile). Every disk-cache entry from before this change is invalidated, as for any recompiler source change. - Cold cost, `agc_shader_replay --spv` over GTA's 319 requests (shader disk cache off, this head), summed emitted SPIR-V words: off 4,632,513 (316 produce SPIR-V); `APS5_NAN_SPECULATION=1` alone 4,696,921 (+1.4%, 317 produce SPIR-V). Setting `APS5_NAN_SPECULATION_STAGES=compute,vertex,pixel`, `APS5_NAN_SPECULATION_MIN=compute:32,pixel:8,vertex:8` and `APS5_NAN_SPECULATION_MIN_OPS=32` as well gives the same totals and byte-identical SPIR-V for every request, and the same SPIR-V as the previous head `fd140217a4` with those three set (317 of 317); the switch off is byte-identical to `fd140217a4` (316 of 316). Earlier measurement of the same switch on a previous base: `MIN_OPS=64` +0.7%, no `MIN_OPS` +12.3%. The three requests that fail with speculation off (25a5d4600, 25a9a0c00, 25a9e2600) fail on main since #12458 (`bb00000fda`), not here; with speculation on, 25a5d4600 compiles. - No request needs the fallback: 0 `[recompile] nan speculation failed` lines over the 319. A compile or capture that still fails turns speculation off for that program, logs that line, and recompiles or prepares it again without speculation (`NanSpeculationRetry` on the prepared path). - `[nan-spec-compile]` lines (every 10 s in a boot with `APS5_PROFILE_DRAW`, and at the end of `agc_frame_replay`) give programs, speculated, declined and fell back by stage. Each compiled program also logs one `[recompile] nan speculation` line with its candidates, speculated, declined and pruned counts. - A cold compile of the speculation variants is real: in the in-game run below, the first speculation-on boot compiled 5,966 speculation lines over 4,769 shaders because the warm-up ran with speculation off. Warm boots compiled 79 over 15. - Bit-exactness is argued from the construction (the exact copy recomputes from the same inputs) and checked on synthetic programs, replay and in game pictures (below); it has not been shown for every title. ### Tested - Linux (lavapipe, subgroup 8): `agc_driver_nan_speculation_region`, `agc_driver_pixel_nan_speculation` (compile only below subgroup 32), `agc_nan_speculation_pixel`, `agc_nan_speculation_stages`, `agc_nan_flag_pruning`, `agc_driver_f32_arithmetic_nan{,_fast}`, `agc_f32_nan_result_selects`, `agc_driver_nan_quieting`, `agc_driver_f16_fma_invalid_nan` pass. `agc_nan_speculation_defaults` and `agc_nan_speculation_overrides` pin the defaults and the overrides. `agc_driver_nan_speculation_region` forces a NaN in one lane and checks the result against the exact program and the lane model; for `v_fma_mixlo_f16` it requires only a NaN when an operand is a NaN, because that instruction's NaN payload is the host's. Mutants on the fallback branches are killed. - Fork CI (linux-gate and windows) on `10a0263300` (r4, before the audit fixes): run 44088501878, green. On this head `bcbd2deecf`: run 44402064158, green: 21 tests on Linux and 23 on Windows passed, 0 validation-layer VUIDs, nothing failing that passes on main. The tests are the NaN tests above, `agc_nan_speculation_defaults` and `_overrides`, the shader disk-cache tests, and the first PR's `agc_constant_phi` and `agc_shader_memory*`. An earlier run on `bff39ce9ea` (44191195433) had `agc_driver_nan_speculation_region` red on Linux, where the host LLVM orders the operands of `v_fma_mixlo_f16` differently and so returns another NaN payload; `fd140217a4` fixes the test only, and its code outside tests is unchanged from `08a5b80467`. - **GTA, main against this PR, run 1 (ns5, on `10a0263300`)** (RTX 3080, NVIDIA 621.24, Windows 11 26320, PCIe Gen4 x16, 3840x2160, Defender on; content 01.011.001; city scene, scripted walk, `APS5_TRACE_SECONDS=108:30`: a 30 s window from 108 s, which is 31 to 38 s after the player stands still (70.1 to 76.9 s in these boots), the same window in both arms; warm caches, one warm-up boot per build that is not a sample; order M S S M S M M S, 4 + 4 boots, all clean on the quiet check). Main is `0859a63ae9`, the PR is `10a0263300`; both carry #20845 and #14561, which GTA needs to boot, and nothing else. Both arms run the same environment, so the summary lines carry no configuration difference: `APS5_DRAW_PIPELINE=1 APS5_PIPELINED_DRAWS=32 APS5_PIPELINE_DISPATCH=1 APS5_NAN_SPECULATION=1 APS5_NAN_SPECULATION_STAGES=compute,vertex,pixel APS5_NAN_SPECULATION_MIN=compute:32,pixel:8,vertex:8 APS5_NAN_SPECULATION_MIN_OPS=32` (main has no reader of the speculation switches). - GPU busy per present: main 27.53 / 26.98 / 28.06 / 26.59 ms, PR 25.28 / 24.70 / 24.82 / 25.55 ms: **-2.20 ± 0.38 ms (-8.1%)**; every PR boot is below every main boot. - Frame p50: main 120.8 / 113.8 / 122.0 / 117.4 ms, PR 115.4 / 113.5 / 119.7 / 117.2 ms (-2.0 ± 2.3 ms, within noise): the scene is CPU-bound, so the GPU saving does not reach frame time here. - Speculation ran: the PR build's warm-up logged 5,953 `[recompile] nan speculation` lines (309 programs speculated); each timed PR boot logged 57 to 88 (variants come from the warm cache); every main boot logged none. - The `aps5-summary.jsonl` window line of the first main boot and of the first PR boot are below; all eight lines and the eight `tools/trace_digest.py` summaries are attached. - **GTA, main against this PR, run 2 (ns7, on this head `08a5b80467`)**: same method, hardware and environment as run 1, except `APS5_TRACE_SECONDS=92:30` (a 30 s window from 92 s, younger game state) and Windows Defender real-time protection off (on in run 1); 4 + 4 boots, all clean, order M S S M S M M S, main `0859a63ae9` with #20845 and #14561 against the same plus this PR. - GPU busy per present: main 27.22 / 27.75 / 27.08 / 27.32 ms, PR 25.55 / 25.85 / 25.47 / 26.51 ms: **-1.50 ± 0.28 ms (-5.5%)**; every PR boot is below every main boot. Run 1 measured -2.20 ± 0.38 ms on `10a0263300`. Main is the same in both runs (27.29 against 27.34 ms); the PR boots moved from 25.09 to 25.84 ms. Between the two heads nothing changes what the GPU runs: replaying GTA's 319 requests with and without the EXEC-pruning fix gives the same 978 pruned checks and 317 of 317 byte-identical SPIR-V, and no program falls back. What differs between the runs is the window (108:30 against 92:30) and Defender (on against off); the PR boots span 25.47 to 26.51 ms. - Frame p50: main 114.8 / 120.5 / 119.9 / 115.1 ms, PR 132.5 / 124.7 / 120.9 / 117.2 ms (+6.25 ± 3.62 ms; run 1 was -2.0 ± 2.3 ms). The two slowest PR boots created pipelines inside the window (`Vulkan.GraphicsPipeline.create` 1887 and 842 ms, against 0 to 230 ms in main and 59 to 169 ms in the other two PR boots); across the eight boots p50 follows that creation time (correlation 0.90), and with it removed the difference is +0.9 ms. I read it as a cold pipeline-cache transient of the first PR boots plus noise, not a CPU cost of speculation: shader compile-and-link, capture and materialize time in the window are not higher in the PR boots. - 0 `[recompile] nan speculation failed` lines in the four PR boots: no program fell back. - ASTRO BOT (PPSA21567 EU, content 01.019.000, standing in the intro, RTX 3080, PCIe Gen4 x16, 3840x2160), one binary built from `08a5b80467` with the switch off against on (compute,vertex,pixel, `MIN compute:32,pixel:8,vertex:8`, `MIN_OPS=32`), order off on on off, all four boots clean: GPU busy per present 39.7 / 39.8 ms off against 39.7 / 39.7 ms on, fps 17.24 / 17.55 off against 16.53 / 17.37 on, frame p50 57.0 / 56.5 ms off against 57.5 / 57.3 ms on (+0.6 ms, within noise). Speculation ran: 52 `[recompile] nan speculation` lines in each on boot, none in the off boots. The switch is neutral on this title: its GPU-heavy shaders gain nothing and nothing regresses. The GPU code is the same as in `08a5b80467` (`fd140217a4` changes only a test, and this head only the defaults, which equal the measured settings, and comments). - The GTA runs above set the three variables explicitly; the defaults now equal those settings, and the replay line above shows the same SPIR-V for both. - GTA, earlier on/off run of the switch on one build (RTX 3080, 4K, play1 standing, A B B A, `APS5_NAN_SPECULATION=1 APS5_NAN_SPECULATION_STAGES=compute,vertex,pixel APS5_NAN_SPECULATION_MIN=compute:32,pixel:8,vertex:8`, no `COUNT`): GPU busy per present 26.05 / 26.14 ms off against 24.35 / 24.42 ms on (-1.71 ms, -6.6%); 0 fatal errors, 0 misspeculation lines. Frame p50 is unchanged (the scene is CPU-bound): 91.3 / 91.7 ms off, 90.4 ms on. Results: lab-notes results/ns3-1116. Picture equality: frame 268 is pixel-identical across the two off boots and one on boot (1A, 4A, 3B), and frame 206 across 1A and 3B. The per-program GPU split follows as a comment. - GTA replay (rk4, 3 frames): pixels identical in every arm. In-game picture equality A vs B: see the GTA in-game line above. - Split-state save points (main's split-state ABI, merged in `c76fd68c56e`): the split-point calls run inside the per-instruction translation, so a save point inside a speculation region is translated with it. `agc_nan_speculation_stages` now translates a save before and after each of two f32 adds and requires exactly one `StoreSplitState` for every placement, a declined region when the save falls inside it, and a kept region for the save after the last add. The test is @JJenkx's (commit `0c2e20d4be9`, authored by them), from their AMD integration run in the comments; thank you. Windows, this head: passes; with the split call before each instruction removed it fails (`stores=0`, region kept). - Not tested: titles other than GTA V and ASTRO BOT (neutral on ASTRO BOT); the exact-copy rate in game (there is no run-time counter); AMD/Intel GPUs. <details><summary>ns5 aps5-summary.jsonl window lines: main (boot 1) and this PR (boot 2)</summary> main `0859a63ae9` + #20845 + #14561: ```json {"commit":"42f959fb451a","dirty":false,"env":{"APS5_ADDRESS_COPY_MAX_MIB":"512","APS5_DRAW_PIPELINE":"1","APS5_LOG_TIMESTAMPS":"1","APS5_NAN_SPECULATION":"1","APS5_NAN_SPECULATION_MIN":"compute:32,pixel:8,vertex:8","APS5_NAN_SPECULATION_MIN_OPS":"32","APS5_NAN_SPECULATION_STAGES":"compute,vertex,pixel","APS5_NO_PAD_INPUT":"1","APS5_PAD_INPUT_FILE":"<path>","APS5_PIPELINED_DRAWS":"32","APS5_PIPELINE_DISPATCH":"1","APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"108:30","APS5_TRACE_SUMMARY_EVERY":"10","APS5_VIDEOOUT_TELEMETRY_DIR":"<path>"},"gpu":"NVIDIA GeForce RTX 3080","driver":"NVIDIA 621.24","os":"Windows 10.0.26320","cpu":"AMD Ryzen 7 5800X 8-Core Processor","cpu_threads":16,"memory_mib":32676,"title_id":"PPSA04263","title":"Grand Theft Auto V","content_version":"01.011.001","resolution":"3840x2160","window":{"spec":"seconds 108:30","first_present":1830,"ms":30012.500},"presents":235,"frame_ms":{"p50":120.777,"p90":147.903,"p99":203.274,"max":249.065},"gpu_busy_ms_per_present":27.526,"worker_busy_pct":{"queue worker 0x0":93.803},"phase_totals_ms":{"Driver.Completion":0.146,"Driver.Dispatch":1914.056,"Driver.Dispatch.capture_resources":11.928,"Driver.Dispatch.decode_key_device_setup":25.321,"Driver.Dispatch.lookup_cache":250.731,"Driver.Dispatch.materialize":1.798,"Driver.Dispatch.prepared_invocation":57.018,"Driver.Draw":20381.891,"Driver.Draw.device_setup":696.389,"Driver.Draw.draw_handed_off":3127.792,"Driver.Draw.prepare":16479.519,"Driver.DrawFinish":18758.584,"Driver.DrawFinish.draw_enqueued":8887.611,"Driver.DrawFinish.post_compile_prepare":256.615,"Driver.DrawFinish.shader_compile_and_link":9478.678,"Driver.EndSubmission":374.245,"Driver.Packet":26703.906,"Driver.Packet.device_lock":198.231,"Driver.Packet.dispatch":1922.453,"Driver.Packet.draw":20543.305,"Driver.Packet.execute":1631.469,"Driver.Packet.flip_flush":8.549,"Driver.Packet.flush_between_packets":493.151,"Driver.Packet.memory_wait":4.782,"Driver.Packet.pipeline_drain":442.028,"Driver.Packet.pipeline_prepare":283.124,"Driver.Packet.prepare_memory":252.137,"Driver.Packet.rendering_wait":0.175,"Driver.Present":1420.230,"Driver.Present.acquire_image":3.453,"Driver.Present.device_setup":0.119,"Driver.Present.gpu_mutex_wait":2.094,"Driver.Present.inflight_wait":0.607,"Driver.Present.present_display_buffer":29.178,"Driver.Present.queue_present":102.741,"Driver.Present.release_and_callback":0.421,"Driver.Present.render_fence_wait":1280.970,"Driver.Present.resize":0.411,"Driver.Present.validate":0.083,"Driver.Rewind":1074.193,"Driver.Suspend":0.055,"GpuMutex.wait.dispatch":0.019,"GpuMutex.wait.draw":36.598,"GpuMutex.wait.end":3.743,"GpuMutex.wait.fill":0.088,"GpuMutex.wait.flush":0.218,"GpuMutex.wait.hook":1.207,"GpuMutex.wait.label":1.406,"GpuMutex.wait.other":0.035,"GpuMutex.wait.present":1.598,"Graphics.Draw":23525.972,"Graphics.Draw.draw_and_resource_release":18453.658,"Graphics.Draw.index_upload":1179.771,"Graphics.Draw.validate":869.422,"Graphics.Draw.vertex_upload":2730.707,"Graphics.DrawWithRecipe":589.837,"Graphics.DrawWithRecipe.draw_and_resource_release":460.946,"Graphics.DrawWithRecipe.index_upload":37.978,"Graphics.DrawWithRecipe.validate":10.838,"Graphics.DrawWithRecipe.vertex_upload":75.332,"Recorder.Reap":285.365,"Recorder.Submit":874.832,"Recorder.Sync":537.922,"Recorder.WaitSerial":242.609,"Resources.Complete":56.421,"Resources.Prepare":101.006,"Shader.DrawStage":8694.697,"Shader.DrawStage.capture_resources":4377.729,"Shader.DrawStage.materialize":2796.195,"Shader.DrawStage.prepared_invocation":1409.929,"Shader.ResolveGraphicsStagesAbi":5.386,"VideoOut.Flip":1448.843,"VideoOut.Flip.completion_mutex_wait":0.455,"VideoOut.Flip.config_mutex_wait":0.026,"VideoOut.Flip.frame_limit":0.139,"VideoOut.Flip.notify_game":4.583,"VideoOut.Flip.present":1421.823,"VideoOut.Flip.validate":0.278,"VideoOut.Flip.vblank_wait":0.165,"VideoOut.Flip.window_prepare":0.398,"VideoOut.Flip.window_title":20.783,"VideoOut.Readiness":0.500,"VideoOut.Readiness.locks_validate":0.201,"Vulkan.Acquire":3.201,"Vulkan.Acquire.acquire_fence_wait":0.467,"Vulkan.Acquire.acquire_image":2.057,"Vulkan.Acquire.fence_reset":0.482,"Vulkan.Acquire.retired_swapchains":0.112,"Vulkan.Dispatch":161.405,"Vulkan.Dispatch.command_record":66.174,"Vulkan.Dispatch.shader_resources":92.998,"Vulkan.DispatchRecipe":162.351,"Vulkan.DispatchRecipe.command_record":161.092,"Vulkan.DrawFromRecipe":596.304,"Vulkan.GraphicsPipeline":347.096,"Vulkan.GraphicsPipeline.create":343.729,"Vulkan.GraphicsPipeline.modules_and_state":3.341,"Vulkan.GraphicsPipelineLibrary":343.324,"Vulkan.GraphicsPipelineLink":0.156,"Vulkan.Present":12.519,"Vulkan.Present.command_record_scale":5.478,"Vulkan.Present.pixel_upload":1.359,"Vulkan.Present.queue_submit":5.511,"Vulkan.QueuePresent":102.379,"Vulkan.QueuePresent.queue_present":101.948,"Vulkan.Retire":1280.892,"Vulkan.Retire.wait":1277.976},"top_phases_ms_per_frame":{"Driver.Packet":113.634,"Graphics.Draw":100.111,"Driver.Packet.draw":87.418,"Driver.Draw":86.731,"Driver.DrawFinish":79.824,"Graphics.Draw.draw_and_resource_release":78.526,"Driver.Draw.prepare":70.126,"Driver.DrawFinish.shader_compile_and_link":40.335},"owned_draw_counts":{"OwnedDraw.arm_attempt":11045,"OwnedDraw.arm_blocks_requested":11045,"OwnedDraw.arm_refused":11045},"graphics_track":{"Graphics.Barrier.copy":3090,"Graphics.Barrier.dcc-clear":2820,"Graphics.Barrier.dcc-keys":1880,"Graphics.Barrier.dispatch-lead":8766,"Graphics.Barrier.dispatch-trail":10123,"Graphics.Barrier.draw":145058,"Graphics.Barrier.fill":2877,"Graphics.Barrier.fill-clear":470,"Graphics.Barrier.indirect-args":1645,"Graphics.Barrier.input-mirror":29083,"Graphics.Barrier.label-run":95701,"Graphics.Barrier.present-blit":940,"Graphics.Barrier.shadow-publish":475,"Graphics.Barrier.staging-in":9189,"Graphics.Barrier.staging-out":3993,"Graphics.Barrier.storage-upload":8966,"Graphics.Barrier.storage-writeback":26457,"Graphics.BarrierMerged.dispatch-lead":4647,"Graphics.BarrierMerged.fill":1417,"Graphics.BarrierMerged.label-run":456,"Graphics.BarrierMerged.shadow-publish":475,"Graphics.BarrierMerged.staging-in":2790,"Graphics.BarrierMerged.staging-out":3993,"Graphics.BarrierMerged.storage-writeback":4076,"Graphics.Copy":38986,"Graphics.Copy.bytes":6279995832,"Graphics.RenderPass":72578,"Graphics.RenderPass.Close.command":36827,"Graphics.RenderPass.Close.image":20500,"Graphics.RenderPass.Close.key":3482,"Graphics.RenderPass.Close.label":456,"Graphics.RenderPass.Close.new-batch":11308,"Graphics.RenderPass.Continued":756187},"trace_dropped":true,"trace_dropped_threads":{"queue worker 0x0":{"events_full_after_s":7.257,"events_lost":873660,"totals_full":false},"draw committer":{"events_full_after_s":13.853,"events_lost":320255,"totals_full":false},"draw finisher":{"events_full_after_s":18.787,"events_lost":149552,"totals_full":false}},"trace":"aps5-trace-42f959fb451a-26592.json.gz"} ``` this PR `10a0263300` (run 1) + #20845 + #14561: ```json {"commit":"561b292e2fa9","dirty":false,"env":{"APS5_ADDRESS_COPY_MAX_MIB":"512","APS5_DRAW_PIPELINE":"1","APS5_LOG_TIMESTAMPS":"1","APS5_NAN_SPECULATION":"1","APS5_NAN_SPECULATION_MIN":"compute:32,pixel:8,vertex:8","APS5_NAN_SPECULATION_MIN_OPS":"32","APS5_NAN_SPECULATION_STAGES":"compute,vertex,pixel","APS5_NO_PAD_INPUT":"1","APS5_PAD_INPUT_FILE":"<path>","APS5_PIPELINED_DRAWS":"32","APS5_PIPELINE_DISPATCH":"1","APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"108:30","APS5_TRACE_SUMMARY_EVERY":"10","APS5_VIDEOOUT_TELEMETRY_DIR":"<path>"},"gpu":"NVIDIA GeForce RTX 3080","driver":"NVIDIA 621.24","os":"Windows 10.0.26320","cpu":"AMD Ryzen 7 5800X 8-Core Processor","cpu_threads":16,"memory_mib":32676,"title_id":"PPSA04263","title":"Grand Theft Auto V","content_version":"01.011.001","resolution":"3840x2160","window":{"spec":"seconds 108:30","first_present":1684,"ms":30072.550},"presents":244,"frame_ms":{"p50":115.401,"p90":132.797,"p99":336.997,"max":428.811},"gpu_busy_ms_per_present":25.282,"worker_busy_pct":{"queue worker 0x0":93.914},"phase_totals_ms":{"Driver.Completion":0.132,"Driver.Dispatch":2291.770,"Driver.Dispatch.capture_resources":7.622,"Driver.Dispatch.decode_key_device_setup":25.060,"Driver.Dispatch.lookup_cache":156.172,"Driver.Dispatch.materialize":1.149,"Driver.Dispatch.prepared_invocation":80.366,"Driver.Draw":20129.901,"Driver.Draw.device_setup":741.372,"Driver.Draw.draw_handed_off":3171.293,"Driver.Draw.prepare":16128.451,"Driver.DrawFinish":18586.589,"Driver.DrawFinish.draw_enqueued":8915.936,"Driver.DrawFinish.post_compile_prepare":249.360,"Driver.DrawFinish.shader_compile_and_link":9278.740,"Driver.EndSubmission":361.067,"Driver.Packet":26794.104,"Driver.Packet.device_lock":204.940,"Driver.Packet.dispatch":2300.588,"Driver.Packet.draw":20291.330,"Driver.Packet.execute":1418.597,"Driver.Packet.flip_flush":8.657,"Driver.Packet.flush_between_packets":501.040,"Driver.Packet.memory_wait":4.742,"Driver.Packet.pipeline_drain":423.551,"Driver.Packet.pipeline_prepare":294.039,"Driver.Packet.prepare_memory":258.641,"Driver.Packet.rendering_wait":0.184,"Driver.Present":1050.805,"Driver.Present.acquire_image":3.521,"Driver.Present.device_setup":0.113,"Driver.Present.gpu_mutex_wait":2.044,"Driver.Present.inflight_wait":0.590,"Driver.Present.present_display_buffer":31.588,"Driver.Present.queue_present":103.175,"Driver.Present.release_and_callback":0.379,"Driver.Present.render_fence_wait":908.776,"Driver.Present.resize":0.410,"Driver.Present.validate":0.054,"Driver.Rewind":1086.925,"Driver.Suspend":0.047,"GpuMutex.wait.dispatch":0.102,"GpuMutex.wait.draw":42.226,"GpuMutex.wait.end":1.068,"GpuMutex.wait.fill":0.041,"GpuMutex.wait.flush":0.113,"GpuMutex.wait.hook":0.003,"GpuMutex.wait.label":0.722,"GpuMutex.wait.other":0.030,"GpuMutex.wait.present":1.510,"Graphics.Draw":23904.126,"Graphics.Draw.draw_and_resource_release":18957.390,"Graphics.Draw.index_upload":1145.057,"Graphics.Draw.validate":883.367,"Graphics.Draw.vertex_upload":2665.314,"Graphics.DrawWithRecipe":730.887,"Graphics.DrawWithRecipe.draw_and_resource_release":569.147,"Graphics.DrawWithRecipe.index_upload":47.942,"Graphics.DrawWithRecipe.validate":13.962,"Graphics.DrawWithRecipe.vertex_upload":94.435,"Recorder.Reap":275.186,"Recorder.Submit":836.083,"Recorder.Sync":444.207,"Recorder.WaitSerial":243.303,"Resources.Complete":54.898,"Resources.Prepare":98.454,"Shader.DrawStage":8530.258,"Shader.DrawStage.capture_resources":4249.524,"Shader.DrawStage.materialize":2743.782,"Shader.DrawStage.prepared_invocation":1423.483,"Shader.ResolveGraphicsStagesAbi":5.199,"VideoOut.Flip":1092.263,"VideoOut.Flip.completion_mutex_wait":0.428,"VideoOut.Flip.config_mutex_wait":0.034,"VideoOut.Flip.frame_limit":0.144,"VideoOut.Flip.notify_game":17.154,"VideoOut.Flip.present":1052.421,"VideoOut.Flip.validate":0.288,"VideoOut.Flip.vblank_wait":0.171,"VideoOut.Flip.window_prepare":0.420,"VideoOut.Flip.window_title":20.954,"VideoOut.Readiness":0.482,"VideoOut.Readiness.locks_validate":0.212,"Vulkan.Acquire":3.270,"Vulkan.Acquire.acquire_fence_wait":0.478,"Vulkan.Acquire.acquire_image":2.095,"Vulkan.Acquire.fence_reset":0.489,"Vulkan.Acquire.retired_swapchains":0.122,"Vulkan.Dispatch":192.501,"Vulkan.Dispatch.command_record":69.190,"Vulkan.Dispatch.shader_resources":121.082,"Vulkan.DispatchRecipe":153.757,"Vulkan.DispatchRecipe.command_record":152.552,"Vulkan.DrawFromRecipe":738.078,"Vulkan.GraphicsPipeline":1222.746,"Vulkan.GraphicsPipeline.create":1216.647,"Vulkan.GraphicsPipeline.modules_and_state":6.059,"Vulkan.GraphicsPipelineLibrary":1216.037,"Vulkan.GraphicsPipelineLink":0.197,"Vulkan.Present":12.286,"Vulkan.Present.command_record_scale":5.774,"Vulkan.Present.pixel_upload":0.643,"Vulkan.Present.queue_submit":5.693,"Vulkan.QueuePresent":102.806,"Vulkan.QueuePresent.queue_present":102.344,"Vulkan.Retire":908.700,"Vulkan.Retire.wait":905.884},"top_phases_ms_per_frame":{"Driver.Packet":109.812,"Graphics.Draw":97.968,"Driver.Packet.draw":83.161,"Driver.Draw":82.500,"Graphics.Draw.draw_and_resource_release":77.694,"Driver.DrawFinish":76.175,"Driver.Draw.prepare":66.100,"Driver.DrawFinish.shader_compile_and_link":38.028},"owned_draw_counts":{"OwnedDraw.arm_attempt":11468,"OwnedDraw.arm_blocks_requested":11468,"OwnedDraw.arm_refused":11468},"graphics_track":{"Graphics.Barrier.copy":3240,"Graphics.Barrier.dcc-clear":2928,"Graphics.Barrier.dcc-keys":1952,"Graphics.Barrier.dispatch-lead":9101,"Graphics.Barrier.dispatch-trail":10218,"Graphics.Barrier.draw":147692,"Graphics.Barrier.fill":2977,"Graphics.Barrier.fill-clear":488,"Graphics.Barrier.indirect-args":1708,"Graphics.Barrier.input-mirror":28303,"Graphics.Barrier.label-run":98616,"Graphics.Barrier.present-blit":976,"Graphics.Barrier.shadow-publish":488,"Graphics.Barrier.staging-in":9026,"Graphics.Barrier.staging-out":3860,"Graphics.Barrier.storage-upload":9296,"Graphics.Barrier.storage-writeback":27469,"Graphics.BarrierMerged.dispatch-lead":4533,"Graphics.BarrierMerged.fill":1471,"Graphics.BarrierMerged.label-run":443,"Graphics.BarrierMerged.shadow-publish":488,"Graphics.BarrierMerged.staging-in":2554,"Graphics.BarrierMerged.staging-out":3860,"Graphics.BarrierMerged.storage-writeback":4182,"Graphics.Copy":38025,"Graphics.Copy.bytes":6313675764,"Graphics.RenderPass":73922,"Graphics.RenderPass.Close.command":36779,"Graphics.RenderPass.Close.image":21458,"Graphics.RenderPass.Close.key":3633,"Graphics.RenderPass.Close.label":443,"Graphics.RenderPass.Close.new-batch":11601,"Graphics.RenderPass.Continued":784603},"trace_dropped":true,"trace_dropped_threads":{"queue worker 0x0":{"events_full_after_s":7.548,"events_lost":807017,"totals_full":false},"draw committer":{"events_full_after_s":13.893,"events_lost":305473,"totals_full":false},"draw finisher":{"events_full_after_s":20.456,"events_lost":121219,"totals_full":false}},"trace":"aps5-trace-561b292e2fa9-11316.json.gz"} ``` </details> <details><summary>ns7 aps5-summary.jsonl window lines: main (boot 1) and this PR (boot 2)</summary> main `0859a63ae9` + #20845 + #14561: ```json {"commit":"42f959fb451a","dirty":false,"env":{"APS5_ADDRESS_COPY_MAX_MIB":"512","APS5_DRAW_PIPELINE":"1","APS5_LOG_TIMESTAMPS":"1","APS5_NAN_SPECULATION":"1","APS5_NAN_SPECULATION_MIN":"compute:32,pixel:8,vertex:8","APS5_NAN_SPECULATION_MIN_OPS":"32","APS5_NAN_SPECULATION_STAGES":"compute,vertex,pixel","APS5_NO_PAD_INPUT":"1","APS5_PAD_INPUT_FILE":"<path>","APS5_PIPELINED_DRAWS":"32","APS5_PIPELINE_DISPATCH":"1","APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"92:30","APS5_TRACE_SUMMARY_EVERY":"10","APS5_VIDEOOUT_TELEMETRY_DIR":"<path>"},"gpu":"NVIDIA GeForce RTX 3080","driver":"NVIDIA 621.24","os":"Windows 10.0.26320","cpu":"AMD Ryzen 7 5800X 8-Core Processor","cpu_threads":16,"memory_mib":32676,"title_id":"PPSA04263","title":"Grand Theft Auto V","content_version":"01.011.001","resolution":"3840x2160","window":{"spec":"seconds 92:30","first_present":1741,"ms":30073.185},"presents":253,"frame_ms":{"p50":114.802,"p90":127.119,"p99":158.256,"max":383.749},"gpu_busy_ms_per_present":27.218,"worker_busy_pct":{"queue worker 0x0":93.982},"phase_totals_ms":{"Driver.Completion":0.143,"Driver.Dispatch":2400.318,"Driver.Dispatch.capture_resources":15.459,"Driver.Dispatch.decode_key_device_setup":25.813,"Driver.Dispatch.lookup_cache":286.132,"Driver.Dispatch.materialize":2.260,"Driver.Dispatch.prepared_invocation":81.873,"Driver.Draw":20211.295,"Driver.Draw.device_setup":716.969,"Driver.Draw.draw_handed_off":3196.833,"Driver.Draw.prepare":16220.893,"Driver.DrawFinish":18692.200,"Driver.DrawFinish.draw_enqueued":8562.815,"Driver.DrawFinish.post_compile_prepare":269.538,"Driver.DrawFinish.shader_compile_and_link":9719.749,"Driver.EndSubmission":339.118,"Driver.Packet":26844.735,"Driver.Packet.device_lock":211.663,"Driver.Packet.dispatch":2408.992,"Driver.Packet.draw":20366.027,"Driver.Packet.execute":1478.837,"Driver.Packet.flip_flush":8.850,"Driver.Packet.flush_between_packets":511.393,"Driver.Packet.memory_wait":4.896,"Driver.Packet.pipeline_drain":441.544,"Driver.Packet.pipeline_prepare":299.613,"Driver.Packet.prepare_memory":266.775,"Driver.Packet.rendering_wait":0.174,"Driver.Present":1545.849,"Driver.Present.acquire_image":3.794,"Driver.Present.device_setup":0.132,"Driver.Present.gpu_mutex_wait":2.417,"Driver.Present.inflight_wait":0.612,"Driver.Present.present_display_buffer":31.075,"Driver.Present.queue_present":107.420,"Driver.Present.release_and_callback":0.417,"Driver.Present.render_fence_wait":1399.310,"Driver.Present.resize":0.433,"Driver.Present.validate":0.077,"Driver.Rewind":1079.431,"Driver.Suspend":0.053,"GpuMutex.wait.dispatch":0.025,"GpuMutex.wait.draw":32.405,"GpuMutex.wait.end":1.520,"GpuMutex.wait.fill":0.137,"GpuMutex.wait.flush":0.146,"GpuMutex.wait.hook":0.085,"GpuMutex.wait.label":0.982,"GpuMutex.wait.other":0.051,"GpuMutex.wait.present":1.882,"Graphics.Draw":24053.262,"Graphics.Draw.draw_and_resource_release":18801.952,"Graphics.Draw.index_upload":1215.748,"Graphics.Draw.validate":906.032,"Graphics.Draw.vertex_upload":2853.670,"Graphics.DrawWithRecipe":591.880,"Graphics.DrawWithRecipe.draw_and_resource_release":461.671,"Graphics.DrawWithRecipe.index_upload":37.757,"Graphics.DrawWithRecipe.validate":10.782,"Graphics.DrawWithRecipe.vertex_upload":76.923,"Recorder.Reap":273.593,"Recorder.Submit":843.706,"Recorder.Sync":467.323,"Recorder.WaitSerial":249.075,"Resources.Complete":56.541,"Resources.Prepare":97.909,"Shader.DrawStage":8960.342,"Shader.DrawStage.capture_resources":4460.358,"Shader.DrawStage.materialize":2904.011,"Shader.DrawStage.prepared_invocation":1473.908,"Shader.ResolveGraphicsStagesAbi":5.450,"VideoOut.Flip":1579.713,"VideoOut.Flip.completion_mutex_wait":0.455,"VideoOut.Flip.config_mutex_wait":0.026,"VideoOut.Flip.frame_limit":0.104,"VideoOut.Flip.notify_game":8.301,"VideoOut.Flip.present":1547.451,"VideoOut.Flip.validate":0.310,"VideoOut.Flip.vblank_wait":0.209,"VideoOut.Flip.window_prepare":0.403,"VideoOut.Flip.window_title":22.207,"VideoOut.Readiness":0.454,"VideoOut.Readiness.locks_validate":0.197,"Vulkan.Acquire":3.528,"Vulkan.Acquire.acquire_fence_wait":0.557,"Vulkan.Acquire.acquire_image":2.196,"Vulkan.Acquire.fence_reset":0.571,"Vulkan.Acquire.retired_swapchains":0.117,"Vulkan.Dispatch":174.988,"Vulkan.Dispatch.command_record":71.541,"Vulkan.Dispatch.shader_resources":101.072,"Vulkan.DispatchRecipe":160.292,"Vulkan.DispatchRecipe.command_record":159.073,"Vulkan.DrawFromRecipe":597.983,"Vulkan.GraphicsPipeline":230.237,"Vulkan.GraphicsPipeline.create":229.984,"Vulkan.GraphicsPipeline.modules_and_state":0.250,"Vulkan.GraphicsPipelineLibrary":229.949,"Vulkan.GraphicsPipelineLink":0.013,"Vulkan.Present":13.228,"Vulkan.Present.command_record_scale":5.877,"Vulkan.Present.pixel_upload":0.801,"Vulkan.Present.queue_submit":6.376,"Vulkan.QueuePresent":107.052,"Vulkan.QueuePresent.queue_present":106.582,"Vulkan.Retire":1399.217,"Vulkan.Retire.wait":1396.248},"top_phases_ms_per_frame":{"Driver.Packet":106.106,"Graphics.Draw":95.072,"Driver.Packet.draw":80.498,"Driver.Draw":79.887,"Graphics.Draw.draw_and_resource_release":74.316,"Driver.DrawFinish":73.882,"Driver.Draw.prepare":64.114,"Driver.DrawFinish.shader_compile_and_link":38.418},"owned_draw_counts":{"OwnedDraw.arm_attempt":11891,"OwnedDraw.arm_blocks_requested":11891,"OwnedDraw.arm_refused":11891},"graphics_track":{"Graphics.Barrier.copy":3417,"Graphics.Barrier.dcc-clear":3036,"Graphics.Barrier.dcc-keys":2024,"Graphics.Barrier.dispatch-lead":9393,"Graphics.Barrier.dispatch-trail":10930,"Graphics.Barrier.draw":157110,"Graphics.Barrier.fill":3110,"Graphics.Barrier.fill-clear":506,"Graphics.Barrier.indirect-args":1771,"Graphics.Barrier.input-mirror":32424,"Graphics.Barrier.label-run":102852,"Graphics.Barrier.present-blit":1012,"Graphics.Barrier.shadow-publish":511,"Graphics.Barrier.staging-in":10239,"Graphics.Barrier.staging-out":4336,"Graphics.Barrier.storage-upload":9636,"Graphics.Barrier.storage-writeback":28442,"Graphics.BarrierMerged.dispatch-lead":5079,"Graphics.BarrierMerged.fill":1540,"Graphics.BarrierMerged.label-run":760,"Graphics.BarrierMerged.shadow-publish":511,"Graphics.BarrierMerged.staging-in":2769,"Graphics.BarrierMerged.staging-out":4336,"Graphics.BarrierMerged.storage-writeback":4408,"Graphics.Copy":43156,"Graphics.Copy.bytes":6768778734,"Graphics.RenderPass":78679,"Graphics.RenderPass.Close.command":40457,"Graphics.RenderPass.Close.image":21964,"Graphics.RenderPass.Close.key":3779,"Graphics.RenderPass.Close.label":760,"Graphics.RenderPass.Close.new-batch":11717,"Graphics.RenderPass.Continued":816974},"trace_dropped":true,"trace_dropped_threads":{"queue worker 0x0":{"events_full_after_s":6.840,"events_lost":869495,"totals_full":false},"draw committer":{"events_full_after_s":13.324,"events_lost":330331,"totals_full":false},"draw finisher":{"events_full_after_s":19.652,"events_lost":139474,"totals_full":false}},"trace":"aps5-trace-42f959fb451a-6212.json.gz"} ``` this PR `08a5b80467` + #20845 + #14561: ```json {"commit":"0f488907d7b6","dirty":false,"env":{"APS5_ADDRESS_COPY_MAX_MIB":"512","APS5_DRAW_PIPELINE":"1","APS5_LOG_TIMESTAMPS":"1","APS5_NAN_SPECULATION":"1","APS5_NAN_SPECULATION_MIN":"compute:32,pixel:8,vertex:8","APS5_NAN_SPECULATION_MIN_OPS":"32","APS5_NAN_SPECULATION_STAGES":"compute,vertex,pixel","APS5_NO_PAD_INPUT":"1","APS5_PAD_INPUT_FILE":"<path>","APS5_PIPELINED_DRAWS":"32","APS5_PIPELINE_DISPATCH":"1","APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"92:30","APS5_TRACE_SUMMARY_EVERY":"10","APS5_VIDEOOUT_TELEMETRY_DIR":"<path>"},"gpu":"NVIDIA GeForce RTX 3080","driver":"NVIDIA 621.24","os":"Windows 10.0.26320","cpu":"AMD Ryzen 7 5800X 8-Core Processor","cpu_threads":16,"memory_mib":32676,"title_id":"PPSA04263","title":"Grand Theft Auto V","content_version":"01.011.001","resolution":"3840x2160","window":{"spec":"seconds 92:30","first_present":1706,"ms":30052.716},"presents":208,"frame_ms":{"p50":132.538,"p90":167.162,"p99":403.673,"max":467.028},"gpu_busy_ms_per_present":25.549,"worker_busy_pct":{"queue worker 0x0":94.129},"phase_totals_ms":{"Driver.Completion":0.125,"Driver.Dispatch":1825.869,"Driver.Dispatch.capture_resources":11.747,"Driver.Dispatch.decode_key_device_setup":23.337,"Driver.Dispatch.lookup_cache":258.990,"Driver.Dispatch.materialize":1.714,"Driver.Dispatch.prepared_invocation":64.001,"Driver.Draw":20678.574,"Driver.Draw.device_setup":639.154,"Driver.Draw.draw_handed_off":2808.801,"Driver.Draw.prepare":17158.985,"Driver.DrawFinish":19246.438,"Driver.DrawFinish.draw_enqueued":10326.132,"Driver.DrawFinish.post_compile_prepare":229.735,"Driver.DrawFinish.shader_compile_and_link":8571.202,"Driver.EndSubmission":296.702,"Driver.Packet":27051.679,"Driver.Packet.device_lock":173.191,"Driver.Packet.dispatch":1833.510,"Driver.Packet.draw":20817.437,"Driver.Packet.execute":1999.041,"Driver.Packet.flip_flush":7.594,"Driver.Packet.flush_between_packets":429.623,"Driver.Packet.memory_wait":4.698,"Driver.Packet.pipeline_drain":418.496,"Driver.Packet.pipeline_prepare":254.262,"Driver.Packet.prepare_memory":225.473,"Driver.Packet.rendering_wait":0.202,"Driver.Present":869.105,"Driver.Present.acquire_image":3.114,"Driver.Present.device_setup":0.107,"Driver.Present.gpu_mutex_wait":2.132,"Driver.Present.inflight_wait":0.520,"Driver.Present.present_display_buffer":25.473,"Driver.Present.queue_present":88.281,"Driver.Present.release_and_callback":0.366,"Driver.Present.render_fence_wait":748.556,"Driver.Present.resize":0.364,"Driver.Present.validate":0.061,"Driver.Rewind":939.882,"Driver.Suspend":0.047,"GpuMutex.wait.dispatch":0.040,"GpuMutex.wait.draw":34.814,"GpuMutex.wait.end":3.841,"GpuMutex.wait.fill":0.079,"GpuMutex.wait.flush":0.089,"GpuMutex.wait.hook":0.002,"GpuMutex.wait.label":0.923,"GpuMutex.wait.other":0.019,"GpuMutex.wait.present":1.683,"Graphics.Draw":22794.208,"Graphics.Draw.draw_and_resource_release":18190.475,"Graphics.Draw.index_upload":1076.643,"Graphics.Draw.validate":801.948,"Graphics.Draw.vertex_upload":2478.622,"Graphics.DrawWithRecipe":564.149,"Graphics.DrawWithRecipe.draw_and_resource_release":438.796,"Graphics.DrawWithRecipe.index_upload":37.793,"Graphics.DrawWithRecipe.validate":10.536,"Graphics.DrawWithRecipe.vertex_upload":72.573,"Recorder.Reap":252.817,"Recorder.Submit":826.141,"Recorder.Sync":517.802,"Recorder.WaitSerial":227.793,"Resources.Complete":55.396,"Resources.Prepare":96.749,"Shader.DrawStage":7925.028,"Shader.DrawStage.capture_resources":3894.407,"Shader.DrawStage.materialize":2596.673,"Shader.DrawStage.prepared_invocation":1331.992,"Shader.ResolveGraphicsStagesAbi":4.848,"VideoOut.Flip":899.099,"VideoOut.Flip.completion_mutex_wait":0.349,"VideoOut.Flip.config_mutex_wait":0.027,"VideoOut.Flip.frame_limit":0.105,"VideoOut.Flip.notify_game":8.716,"VideoOut.Flip.present":871.121,"VideoOut.Flip.validate":0.238,"VideoOut.Flip.vblank_wait":0.149,"VideoOut.Flip.window_prepare":0.357,"VideoOut.Flip.window_title":17.832,"VideoOut.Readiness":0.424,"VideoOut.Readiness.locks_validate":0.181,"Vulkan.Acquire":2.893,"Vulkan.Acquire.acquire_fence_wait":0.424,"Vulkan.Acquire.acquire_image":1.847,"Vulkan.Acquire.fence_reset":0.429,"Vulkan.Acquire.retired_swapchains":0.123,"Vulkan.Dispatch":166.710,"Vulkan.Dispatch.command_record":58.857,"Vulkan.Dispatch.shader_resources":105.861,"Vulkan.DispatchRecipe":149.057,"Vulkan.DispatchRecipe.command_record":147.852,"Vulkan.DrawFromRecipe":570.100,"Vulkan.GraphicsPipeline":1895.640,"Vulkan.GraphicsPipeline.create":1887.204,"Vulkan.GraphicsPipeline.modules_and_state":8.389,"Vulkan.GraphicsPipelineLibrary":1886.382,"Vulkan.GraphicsPipelineLink":0.286,"Vulkan.Present":11.258,"Vulkan.Present.command_record_scale":4.908,"Vulkan.Present.pixel_upload":1.172,"Vulkan.Present.queue_submit":5.028,"Vulkan.QueuePresent":87.943,"Vulkan.QueuePresent.queue_present":87.568,"Vulkan.Retire":748.472,"Vulkan.Retire.wait":746.074},"top_phases_ms_per_frame":{"Driver.Packet":130.056,"Graphics.Draw":109.588,"Driver.Packet.draw":100.084,"Driver.Draw":99.416,"Driver.DrawFinish":92.531,"Graphics.Draw.draw_and_resource_release":87.454,"Driver.Draw.prepare":82.495,"Driver.DrawFinish.draw_enqueued":49.645},"owned_draw_counts":{"OwnedDraw.arm_attempt":9776,"OwnedDraw.arm_blocks_requested":9776,"OwnedDraw.arm_refused":9776},"graphics_track":{"Graphics.Barrier.copy":2757,"Graphics.Barrier.dcc-clear":2496,"Graphics.Barrier.dcc-keys":1664,"Graphics.Barrier.dispatch-lead":7782,"Graphics.Barrier.dispatch-trail":9018,"Graphics.Barrier.draw":126805,"Graphics.Barrier.fill":2567,"Graphics.Barrier.fill-clear":416,"Graphics.Barrier.indirect-args":1456,"Graphics.Barrier.input-mirror":24827,"Graphics.Barrier.label-run":85034,"Graphics.Barrier.present-blit":832,"Graphics.Barrier.shadow-publish":416,"Graphics.Barrier.staging-in":8268,"Graphics.Barrier.staging-out":3598,"Graphics.Barrier.storage-upload":7936,"Graphics.Barrier.storage-writeback":23380,"Graphics.BarrierMerged.dispatch-lead":4148,"Graphics.BarrierMerged.fill":1233,"Graphics.BarrierMerged.label-run":582,"Graphics.BarrierMerged.shadow-publish":416,"Graphics.BarrierMerged.staging-in":2526,"Graphics.BarrierMerged.staging-out":3598,"Graphics.BarrierMerged.storage-writeback":3602,"Graphics.Copy":33746,"Graphics.Copy.bytes":5606150740,"Graphics.RenderPass":63426,"Graphics.RenderPass.Close.command":31976,"Graphics.RenderPass.Close.image":17702,"Graphics.RenderPass.Close.key":3071,"Graphics.RenderPass.Close.label":582,"Graphics.RenderPass.Close.new-batch":10088,"Graphics.RenderPass.Continued":664360},"trace_dropped":true,"trace_dropped_threads":{"queue worker 0x0":{"events_full_after_s":8.407,"events_lost":752985,"totals_full":false},"draw committer":{"events_full_after_s":15.523,"events_lost":262132,"totals_full":false},"draw finisher":{"events_full_after_s":21.576,"events_lost":110795,"totals_full":false}},"trace":"aps5-trace-0f488907d7b6-14376.json.gz"} ``` </details> ### Checklist - [x] Based on current `main`; no other open PR implements the same functions - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except technical debt - [x] Unimplemented paths throw; no silent stubs - [x] No notes, investigation `.md` files or images added to the repository - [x] New third-party code is a submodule built from source: none - [x] Generic behaviour, not specific to one title - [x] Depends on: #23343 (SRT walker and control-flow identity fixes). Merge it first; this PR's commits sit on top of it. - [x] Fixes: none - [x] Unblocks: none - [x] GPUs tested: lavapipe (Mesa, Linux) for the unit tests; NVIDIA GeForce RTX 3080, driver 621.24, Windows, for the pixel execution test, the in-game on/off run (ns3) and the main-vs-change run (ns5 on `10a0263300` and ns7 on `08a5b80467`) - [x] AI-assisted: yes 🤖 Generated with [Claude Code](https://claude.com/claude-code)
MarcZX10 commented 2026-11-19 05:34:24 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-19T05:34:24Z.

Review: COMMENTED


Reviewed — comments

This review covers the prepared diff at head bcbd2deecfa5414542389dceae58e6b6c3b32416; the broad change set and several key implementation files were inspected, but the review is incomplete.

What I ran

No build or tests were run. I read the prepared description, commits, manifest, diff, file listing, and selected source files through repo_read.py.

Results

Check Result Note
Source review not run Partial review only
Build and tests not run No execution environment used

Findings

Blocking

None verified in the inspected portions.

Non-blocking

No specific non-blocking code issue verified.

Not verified

The review is incomplete, so no conclusion is offered on the full change. The manifest lists 44 changed files; only NanFlagPruner.cpp, Recompiler.cpp (lines 1–180), InstructionTranslator.cpp (lines 1–280), and ResourceTracker.cpp (lines 1–100) were read from repository files. The prepared description, commits, manifest, and first 300 lines of the diff were also read. The remaining changed files and source ranges were not read, including the large excluded files tests/Recorder.cpp and tests/ShaderMemory.cpp; files.json was not available through the reader. No tests, builds, or runtime checks were performed by this review.

To get this to a good state

Complete the review of the remaining changed files and relevant source ranges, then run the applicable checks before reaching a formal decision.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5969822463 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/23344#pullrequestreview-5969822463). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-19T05:34:24Z. **Review:** COMMENTED --- # Reviewed — comments This review covers the prepared diff at head `bcbd2deecfa5414542389dceae58e6b6c3b32416`; the broad change set and several key implementation files were inspected, but the review is incomplete. ## What I ran No build or tests were run. I read the prepared description, commits, manifest, diff, file listing, and selected source files through `repo_read.py`. ## Results | Check | Result | Note | |---|---|---| | Source review | not run | Partial review only | | Build and tests | not run | No execution environment used | ## Findings ### Blocking None verified in the inspected portions. ### Non-blocking No specific non-blocking code issue verified. ## Not verified The review is incomplete, so no conclusion is offered on the full change. The manifest lists 44 changed files; only `NanFlagPruner.cpp`, `Recompiler.cpp` (lines 1–180), `InstructionTranslator.cpp` (lines 1–280), and `ResourceTracker.cpp` (lines 1–100) were read from repository files. The prepared description, commits, manifest, and first 300 lines of the diff were also read. The remaining changed files and source ranges were not read, including the large excluded files `tests/Recorder.cpp` and `tests/ShaderMemory.cpp`; `files.json` was not available through the reader. No tests, builds, or runtime checks were performed by this review. ## To get this to a good state Complete the review of the remaining changed files and relevant source ranges, then run the applicable checks before reaching a formal decision.
MarcZX10 commented 2026-11-19 21:32:43 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-19T21:32:43Z.

Review: APPROVED


Reviewed — looks good

The reviewed changes at aa1fd87ae987c4f52709ca807b48cbb8ed7b9c6f implement opt-in speculative NaN repair with exact recomputation on flagged waves; I found no verified blocking defect in the inspected paths.

What I ran

No build or tests were run. I inspected the prepared diff and read changed implementation and test hunks using repo_read.py at the pinned head. The PR description reports Linux and Windows CI, replay checks, and NVIDIA gameplay measurements; these were not run by me.

Results

Check Result Note
Diff and targeted source review passed Inspected core speculation and fallback paths
Build and tests not run Author-reported results only
Runtime and hardware behavior not run No local execution

Findings

Blocking

None.

Non-blocking

None.

Not verified

I did not run a build, tests, replay, or console/game execution. The two excluded full files, core/libs/prx/libSceAgcDriver/tests/Recorder.cpp and core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp, were read only at their changed hunks. I did not inspect every included test file or every changed implementation line; the review focused on region construction, NaN check pruning, fallback/retry, cache versioning, and excluded test hunks. The author-reported CI and performance figures remain unverified here.

To get this to a good state

Nothing is required.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5983746920 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/23344#pullrequestreview-5983746920). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-19T21:32:43Z. **Review:** APPROVED --- # Reviewed — looks good The reviewed changes at `aa1fd87ae987c4f52709ca807b48cbb8ed7b9c6f` implement opt-in speculative NaN repair with exact recomputation on flagged waves; I found no verified blocking defect in the inspected paths. ## What I ran No build or tests were run. I inspected the prepared diff and read changed implementation and test hunks using `repo_read.py` at the pinned head. The PR description reports Linux and Windows CI, replay checks, and NVIDIA gameplay measurements; these were not run by me. ## Results | Check | Result | Note | |---|---|---| | Diff and targeted source review | passed | Inspected core speculation and fallback paths | | Build and tests | not run | Author-reported results only | | Runtime and hardware behavior | not run | No local execution | ## Findings ### Blocking None. ### Non-blocking None. ## Not verified I did not run a build, tests, replay, or console/game execution. The two excluded full files, `core/libs/prx/libSceAgcDriver/tests/Recorder.cpp` and `core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp`, were read only at their changed hunks. I did not inspect every included test file or every changed implementation line; the review focused on region construction, NaN check pruning, fallback/retry, cache versioning, and excluded test hunks. The author-reported CI and performance figures remain unverified here. ## To get this to a good state Nothing is required.
MarcZX10 commented 2026-11-20 21:38:24 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-20T21:38:24Z.

Review: COMMENTED


Reviewed — no blocking findings

The change at head c76fd68c56e26cd750cdc7b35dd3d3e6c4cf6ea5 adds opt-in NaN-repair speculation; the core translation, pruning, and retry paths inspected support its stated behavior, but review coverage is incomplete.

What I ran

No commands or tests were run. I read the prepared description, commit list, manifest, diff, and targeted repository source through repo_read.py at the pinned head. The author reports CI and runtime measurements in the description; these were not independently run or verified.

Results

Check Result Note
Targeted source review passed Core paths inspected
Tests in this review not run Author-reported results only
Full changed-file review not run Two large changed files were excluded

Findings

Blocking

None identified in the code inspected.

Non-blocking

None.

Not verified

tests/Recorder.cpp and tests/ShaderMemory.cpp were excluded from the review bundle; I read only their changed hunks through repo_read.py. I did not read every changed file listed in the manifest, run checks, verify the author-reported CI or runtime results, or assess hardware and console behavior beyond those reports.

To get this to a good state

Nothing is required. This review is incomplete, so it does not support approval.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5999748341 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/23344#pullrequestreview-5999748341). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-20T21:38:24Z. **Review:** COMMENTED --- # Reviewed — no blocking findings The change at head `c76fd68c56e26cd750cdc7b35dd3d3e6c4cf6ea5` adds opt-in NaN-repair speculation; the core translation, pruning, and retry paths inspected support its stated behavior, but review coverage is incomplete. ## What I ran No commands or tests were run. I read the prepared description, commit list, manifest, diff, and targeted repository source through `repo_read.py` at the pinned head. The author reports CI and runtime measurements in the description; these were not independently run or verified. ## Results | Check | Result | Note | |---|---|---| | Targeted source review | passed | Core paths inspected | | Tests in this review | not run | Author-reported results only | | Full changed-file review | not run | Two large changed files were excluded | ## Findings ### Blocking None identified in the code inspected. ### Non-blocking None. ## Not verified `tests/Recorder.cpp` and `tests/ShaderMemory.cpp` were excluded from the review bundle; I read only their changed hunks through `repo_read.py`. I did not read every changed file listed in the manifest, run checks, verify the author-reported CI or runtime results, or assess hardware and console behavior beyond those reports. ## To get this to a good state Nothing is required. This review is incomplete, so it does not support approval.
MarcZX10 commented 2026-11-20 22:39:34 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-20T22:39:34Z.

Review: COMMENTED


Reviewed — no blocking findings

Nothing blocks this change; the behavior claims are supported by the code inspected, but the review is incomplete because several changed files were not read.

What I ran

Reviewed head 0c2e20d4be99dbc5a86304d9ba2d190a2211e0dd. I inspected the prepared diff and targeted repository files with repo_read.py-backed review tools; I ran no build or tests.

Results

Check Result Note
Diff and description passed Prepared artifacts inspected
Targeted code review passed Translation, pruning, fallback and cache paths
Automated checks not run No commands run

Findings

Blocking

None verified.

Non-blocking

None.

Not verified

Did not read every changed line. In particular, changed lines in core/libs/prx/libSceAgcDriver/tests/Recorder.cpp and core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp were not reviewed; these files are listed as excluded by the review folder size rule. Other changed files were also not inspected line by line. No tests or build were run, and hardware behavior was not independently verified. The author-reported test and performance results in the description were not run by this review.

To get this to a good state

Nothing is required.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:6000327778 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/23344#pullrequestreview-6000327778). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-20T22:39:34Z. **Review:** COMMENTED --- # Reviewed — no blocking findings Nothing blocks this change; the behavior claims are supported by the code inspected, but the review is incomplete because several changed files were not read. ## What I ran Reviewed head `0c2e20d4be99dbc5a86304d9ba2d190a2211e0dd`. I inspected the prepared diff and targeted repository files with `repo_read.py`-backed review tools; I ran no build or tests. ## Results | Check | Result | Note | |---|---|---| | Diff and description | passed | Prepared artifacts inspected | | Targeted code review | passed | Translation, pruning, fallback and cache paths | | Automated checks | not run | No commands run | ## Findings ### Blocking None verified. ### Non-blocking None. ## Not verified Did not read every changed line. In particular, changed lines in `core/libs/prx/libSceAgcDriver/tests/Recorder.cpp` and `core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp` were not reviewed; these files are listed as excluded by the review folder size rule. Other changed files were also not inspected line by line. No tests or build were run, and hardware behavior was not independently verified. The author-reported test and performance results in the description were not run by this review. ## To get this to a good state Nothing is required.
MarcZX10 commented 2026-11-22 14:03:03 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-22T14:03:03Z.

Review: COMMENTED


Reviewed — comments

The reviewed code adds opt-in NaN speculation; one unbounded shader-address registry may add lookup and memory costs over a long session, and the full change was not reviewed.

What I ran

  • Inspected the prepared diff and targeted source ranges with the review reader. No tests or builds were run.

Results

Check Result Note
Targeted source review passed Inspected speculation, pruning, and fallback code
Tests and build not run No commands were run

Findings

Blocking

None.

Non-blocking

  • core/shader/recompiler/Translation/src/InstructionTranslator.cpp:962 records every shader address that successfully speculates. The AppliedAddresses registry in DispatchInstructions.cpp has no success-path removal, so it grows with unique shader addresses; its linear searches also make later checks progressively slower. Consider removing the address after the fallback window ends or using a bounded, lifecycle-scoped registry.

Not verified

  • Read targeted ranges in Recompiler.cpp, Recompiler.hpp, InstructionTranslator.cpp, DispatchInstructions.cpp, and NanFlagPruner.cpp; inspected portions of review/diff.patch and the prepared description, commits, and manifest.
  • The manifest lists 46 changed files. I did not read every changed file or the complete diff. Full text was excluded for tests/Recorder.cpp and tests/ShaderMemory.cpp; other changed files were not all inspected.
  • Build, test, runtime behavior, and reported performance measurements were not independently verified.

To get this to a good state

Nothing is required. Consider bounding the successful-address registry.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:6012616948 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/23344#pullrequestreview-6012616948). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-22T14:03:03Z. **Review:** COMMENTED --- # Reviewed — comments The reviewed code adds opt-in NaN speculation; one unbounded shader-address registry may add lookup and memory costs over a long session, and the full change was not reviewed. ## What I ran - Inspected the prepared diff and targeted source ranges with the review reader. No tests or builds were run. ## Results | Check | Result | Note | |---|---|---| | Targeted source review | passed | Inspected speculation, pruning, and fallback code | | Tests and build | not run | No commands were run | ## Findings ### Blocking None. ### Non-blocking - `core/shader/recompiler/Translation/src/InstructionTranslator.cpp:962` records every shader address that successfully speculates. The `AppliedAddresses` registry in `DispatchInstructions.cpp` has no success-path removal, so it grows with unique shader addresses; its linear searches also make later checks progressively slower. Consider removing the address after the fallback window ends or using a bounded, lifecycle-scoped registry. ## Not verified - Read targeted ranges in `Recompiler.cpp`, `Recompiler.hpp`, `InstructionTranslator.cpp`, `DispatchInstructions.cpp`, and `NanFlagPruner.cpp`; inspected portions of `review/diff.patch` and the prepared description, commits, and manifest. - The manifest lists 46 changed files. I did not read every changed file or the complete diff. Full text was excluded for `tests/Recorder.cpp` and `tests/ShaderMemory.cpp`; other changed files were not all inspected. - Build, test, runtime behavior, and reported performance measurements were not independently verified. ## To get this to a good state Nothing is required. Consider bounding the successful-address registry.
MarcZX10 commented 2026-11-22 22:53:02 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-22T22:53:02Z.

Review: COMMENTED


Reviewed — comments

The change adds opt-in NaN speculation and fallback handling; this review is incomplete because most changed files and the full translation path were not read.

What I ran

Read the prepared description, commit list, manifest, and selected hunks from diff.patch for head cd558bd4690cd606b37abab8a2f7f7f21deac1dc. No commands or tests were run.

Results

Check Result Note
Targeted diff review not run Selected hunks inspected
Tests not run No test commands run

Findings

Blocking

None identified in the portions inspected.

Non-blocking

  • The review could not establish correctness across the complete implementation. In particular, the remainder of InstructionTranslator.cpp, changed recompiler files, and changed tests need review before a formal approval decision.

Not verified

The manifest lists 44 changed files. I read the description, commits, manifest, and selected diff hunks touching Recompiler.cpp, InstructionTranslator.cpp, and NanFlagPruner.cpp; I did not read every changed file or all of those files in full. Recorder.cpp and ShaderMemory.cpp were excluded from the review folder because they were too large. No test or build results were independently verified; performance and gameplay results are author-reported.

To get this to a good state

Nothing is required. Optional: complete the review of the remaining changed files and run the relevant tests before deciding whether to approve.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:6014960559 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/23344#pullrequestreview-6014960559). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-22T22:53:02Z. **Review:** COMMENTED --- # Reviewed — comments The change adds opt-in NaN speculation and fallback handling; this review is incomplete because most changed files and the full translation path were not read. ## What I ran Read the prepared description, commit list, manifest, and selected hunks from `diff.patch` for head `cd558bd4690cd606b37abab8a2f7f7f21deac1dc`. No commands or tests were run. ## Results | Check | Result | Note | |---|---|---| | Targeted diff review | not run | Selected hunks inspected | | Tests | not run | No test commands run | ## Findings ### Blocking None identified in the portions inspected. ### Non-blocking - The review could not establish correctness across the complete implementation. In particular, the remainder of `InstructionTranslator.cpp`, changed recompiler files, and changed tests need review before a formal approval decision. ## Not verified The manifest lists 44 changed files. I read the description, commits, manifest, and selected diff hunks touching `Recompiler.cpp`, `InstructionTranslator.cpp`, and `NanFlagPruner.cpp`; I did not read every changed file or all of those files in full. `Recorder.cpp` and `ShaderMemory.cpp` were excluded from the review folder because they were too large. No test or build results were independently verified; performance and gameplay results are author-reported. ## To get this to a good state Nothing is required. Optional: complete the review of the remaining changed files and run the relevant tests before deciding whether to approve.
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
boykopovar/AnyPS5!23344
No description provided.