perf(agc): suppress redundant graphics pipeline and dynamic state commands #16752

Merged
chitters2004 merged 15 commits from upstream-pr/16752 into main 2026-11-14 03:59:30 +00:00
chitters2004 commented 2026-11-07 15:13:49 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by chitters2004 on 2026-11-07T15:13:49Z.


What

Every recorded graphics draw binds its pipeline and records every dynamic state command it uses, even when its command buffer already holds that pipeline and those values. In the GTA V (PPSA04263) standing scene measured below, main issues 18.6 dynamic state commands and 0.98 graphics pipeline binds per draw.

Each recorder batch now owns a CommandState (Recorder::GraphicsState()) that remembers the graphics pipeline bound in its command buffer and the value of each of the 19 dynamic state slots the draw path sets (viewport, scissor, depth bias, depth bounds, cull mode, front face, depth test, write and compare, depth bounds test, stencil test, and per face the stencil op, compare mask, write mask and reference). A bind or setter whose value the command buffer already holds is skipped.

  • Pipeline::Begin, Continue, the back-face and second-channel binds, the stencil replay reference, the sample order depth reorder and the first-sample copy in Recorder::RecordUncounted record through the batch's CommandState, so the draw after one of those passes records only what differs.
  • Nothing is known after vkBeginCommandBuffer, and a pipeline bind forgets every slot the new pipeline fixes statically. The state belongs to the batch, so a recycled command buffer handle and a batch reopened after a failed submit start with nothing known.
  • Context::Function, Context::Resolved and the device setup lookup take a consteval FunctionName that rejects a graphics pipeline bind, a tracked dynamic state command, vkCmdBindShadersEXT or vkCmdExecuteCommands at compile time. The device table holds those entry points as write-only TrackedFunction members that only CommandState and the new Context::BindComputePipeline read. Presentation, the performance overlay and tests, which record their own command buffers, use a local untracked CommandState. CommandState cannot be copied or moved.
  • Two routes stay open because the type system cannot see them, recorded in docs/dev/debt/libSceAgcDriver.md: a raw deviceProc lookup cast to the function type, and a second CommandState begun on a recorder batch's command buffer.
  • APS5_NO_STATE_SUPPRESSION records every bind and setter, as before (docs/dev/ENVIRONMENT.md).

Overlap, checked on 2026-11-07 against main 46552cb461 with tools/pr_overlap.py and by hand: the tool reports 13 open pull requests that change lines this branch changes and 98 more that conflict with main and share files with it (78 of the 111 have a commit since 2026-10-24; I read the hunks of 29 of them). None implements the same thing. #9503, #10351, #11551, #12840 and #12944 change the same functions (SampleOrders::Depth, recordPreparedDraw, recordStencilReplay, pushDrawConstants, VulkanDevice::recordDispatch), so whichever lands second needs a manual rebase; the others share only test, debt or ENVIRONMENT.md lines in other hunks. #10049, #12863, #15670, #15845 and #16286 are disjoint. Rechecked against 4977f64052: the tool now confirms #9503, #9712, #9897, #10141, #10351, #12944, #14032, #15570, #16373 and #16572. #16572 (set color write masks per draw through dynamic state) adds a dynamic state that this change's tracker must own: with this change, recording vkCmdSetColorWriteMaskEXT outside the tracker does not compile. If #16572 lands first, a rebase of this branch onto it that tracks the masks like the other dynamic states is ready (fork branch draft/src/refresh/r1-on-16572); it suppresses an identical mask set and records a changed or wider one, with a unit test that a mutant ignoring mask values turns red.

Open pull requests that record a graphics pipeline bind or a tracked dynamic state command must go through CommandState (or Context::BindComputePipeline for a compute bind) once both are in main, because a direct call through Context::Function or Context::Resolved no longer compiles; none is a prerequisite, so Depends on is none:

  • #9503 binds the sample order depth set after its pipeline (SampleOrders::Depth): its pipeline bind goes through CommandState::BindPipeline on Recorder::GraphicsState().
  • #10351 exports stencil operation values through an attachment (recordPreparedDraw): stencil state goes through CommandState::SetStencilOp, SetStencilCompareMask, SetStencilWriteMask and SetStencilReference.
  • #11551 tests depth bounds in the pixel program when the device lacks depthBounds (recordStencilReplay, pushDrawConstants): its fallback sets SetDepthBoundsTestEnable and SetDepthBounds through CommandState.
  • #9508 (heap pipeline binds in PresentationPass::draw, FirstSampleCopy::Record, GpuColorTransfer::dispatch and the TextureDetiler dispatches), #10043 (pipeline bind, viewport and scissor in the new PresentationUpscaler.cpp), #12840 (VulkanDevice::recordDispatch and a store-page gather in Recorder.cpp) and #15792 (Recorder::RecordChangedCopy) add such calls; their text merges, but each call has to move to CommandState or Context::BindComputePipeline.

Tested

Head 1781488bcb on main 4977f64052.

Refreshed onto main 4977f64052. Head 1781488bcb; git range-diff against b0fe73c6dd shows the same code patches in all 8 commits; only the debt entry of commits 3 to 6 and 8 changed context, because main added two entries above it. Local RTX 3080 gate on both, same environment as below (ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation), built one after the other in one build tree, with the focused AGC set of all five pull requests of this series (242 tests on this head, 232 on main): both 100 % passed, no VUID- line in either log or in replay subprocess logs, and neither log contains was not found but was requested by env var VK_INSTANCE_LAYERS. Fork CI on the rebased head against 4977f64052: run 42375092958: Linux 46 of 53 passed, 7 skipped; Windows 45 of 55 passed, 9 skipped, and agc_driver_recorder failed, as it does on main. The skips include the new agc_driver_pipeline_optimized_readback_color32_unsuppressed and _color64_unsuppressed, skipped on lavapipe like their existing forms; the RTX 3080 gate runs and passes them. No VUID- line on either side, conventions check passed. The measurements and full runs below were on the previous base 46552cb461; the code they measured is unchanged.

Vulkan validation. RTX 3080, ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation, ctest --test-dir build -R 'agc|write_tracking|guest|indirect_draw|draw_finisher|depth_bias|draw_pipeline' -V on b0fe73c6dd (3209 tests) and on main 46552cb461 (3199 tests). Every test failing in either full run was then rerun alone on both builds, one build at a time with nothing else on the GPU, using ctest -R with the union of the 16 names and the same environment: on both, 15 of 16 passed and only agc_driver_direct_write_completion failed, which fails on main too (#15547); the other failures of the full runs were timeouts and 0xc0000409 exits under load from concurrent gates and did not reproduce alone. Both full logs hold the same 18 VUID-VkPipelineColorBlendStateCreateInfo-pAttachments-00605 lines and no other VUID-; neither contains was not found but was requested by env var VK_INSTANCE_LAYERS. The change adds no validation error.

Fork CI (GitHub runners, Mesa lavapipe with the Khronos validation layer, head against main): run 42329061255, rebased there onto 46552cb461. Linux and Windows each ran 39 tests: 31 passed, 0 failed, 8 skipped, no VUID- line on either side, conventions check passed. The eight skips are the same on main except for the two new _unsuppressed color readback variants, and all have the same lavapipe reasons: the masked pixel shader needs at least 32 subgroup lanes (the four color32/color64 readback tests and their two new variants), and the device has no 2x color and depth targets (two sample order tests); the RTX 3080 gate above runs them.

Tests.

  • agc_command_state drives the tracker through real objects: a pipeline bind, every tracked dynamic state, a D16 stencil target stored as D24 that caches and emits the converted depth bias for both faces with and without graphics pipeline libraries, Pipeline::Continue swapping from the fast-linked to the optimized handle within one tracker and suppressing afterwards, DynamicSlots rejecting a dynamic state the tracker does not follow, and a second render pass of a batch that records nothing for an identical draw.
  • agc_graphics_state_recorder (and _unsuppressed): a real Recorder reopened over a reused command buffer handle, and a batch reopened on a recycled handle after a failed submit, record the pipeline bind and every setter again; two interleaved recorders never suppress each other; a draw after RecordUncounted, also when it throws, or after RecordSampleOrder records only what differs.
  • agc_driver_depth_bias_per_face checks the recorded per-face pixels; recorded per-face draws set the viewport and scissor once and the synchronous path twice. The optimized readback, stencil replay and per-face depth bias tests also run with APS5_NO_STATE_SUPPRESSION (_unsuppressed) and the per-face test with APS5_DRAW_TRANSITIONS (_transitions).
  • Red proof, from the branch history on an earlier head (bf99218c1b, same tests): a diagnostic build that carries the previous batch's tracker state into the batch opened after an injected failed submit turns agc_graphics_state_recorder red at "the first draw after a failed submit on a recycled command buffer handle" (the draw is suppressed instead of recording all 16 commands); without the mutant it passes. The compile-time check is its own negative control: recording vkCmdSetViewport through Context::Function does not compile. agc_command_state first failed 8 of 40 runs because the sample-location mock ignored blockOptimizedLink; after that test fix it passed 150 of 150 runs and 100 of 100 on the then frozen commit.

Per-draw cost, replay. Identical frames, so the change is the only difference. A 3-frame capture of the scene below (APS5_FRAME_CAPTURE, 9,364 draws) is replayed with agc_frame_replay --repeat 5 through the real submit path, with the same pipelined-draw settings as the boots; passes 2 to 5 count. Base 46552cb461 and each build alternate run by run. Every pass of every run drew exactly 9,364 draws and every run matched the base pixels exactly (pixels_identical 1.0). The metric is committer wall time per commit, per draw; base is about 53.2 µs per draw. The replay tool is main's tools/FrameReplay.cpp with #12565, #12567, #12568, #11435 and #13984 merged and a local retire of resident images before each memory restore so --repeat works; it is local and not part of this pull request (per-build summaries and binary provenance attached).

build pairs commit µs per draw, change (95 % CI) relative timed ms per pass, change (95 % CI)
this change, b0fe73c6dd 5 -1.35 ± 1.04 -2.5 % -12.0 ± 9.4
all three merged on 46552cb461 5 -2.99 ± 0.44 -5.6 % -25.5 ± 7.7
calibration: +1.0 µs spin per draw 5 +0.92 ± 0.68 +1.7 % +6.3 ± 11.4
null control: import validity f62ea7bd08 5 -0.19 ± 0.64 -0.4 % -0.1 ± 11.1
null control: pushless offset 0e323b1bdc 5 -0.56 ± 1.00 -1.1 % -4.9 ± 9.5

The calibration build reads its injected 1.0 µs, so the replay resolves per-draw costs below 1 µs; base against base reads +0.10 ± 0.37. The two null controls stay within noise. The three changes add up: -1.35, -0.81 and -0.44 sum to -2.60, inside the merged build's -2.99 ± 0.44. Thread CPU columns are attached but not used: Windows thread times tick in 15.6 ms steps, too coarse for 1 µs per draw. The replay cannot show contention with the title's own threads, frame pacing, or GPU-bound time.

Frame time, stacked boots. main 46552cb461 against the three changes merged on it, one warm-up boot each, then two ABBA pairs in the scene below on the current host: mean ms/frame 147.0 to 136.0 (-7.5 %) and 136.7 to 131.3 (-4.0 %); p99 168.8 to 181.9 and 192.6 to 188.7. These are not attributed to the change: the merged build drew 13 % fewer draws per present in those boots (1,497 and 1,611 against 1,783 and 1,801), and draw count varies from boot to boot with the scene, which is why the per-draw figure above comes from the replay. The older per-pull-request pairs below were taken on this branch before its rebase and on the host state before the changes listed under Host; the counts are per pull request and stay.

Performance, older per-PR pairs. GTA V (PPSA04263, content 01.011.001), standing scene, 3840x2160, default in-game settings. Two interleaved pairs, main then this change, twice, after one warm-up boot of each build that is not a sample. Each capture is the 30 s trace window from 235 s after launch, about 30 s after the player stands still (202 to 206 s in every capture), with pipelined draws (APS5_DRAW_PIPELINE=1, APS5_PIPELINED_DRAWS=32, APS5_PIPELINE_DISPATCH=1). main was 7383be1a19; the change was 86104970d7, this branch before its rebase onto 46552cb461 (git range-diff shows the same patches; only the context lines of the debt entry differ).

capture commit presents in 30 s mean ms/frame p50 p90 p99 max GPU busy ms/present queue worker busy
main, pair 1 7383be1a19c7 224 134.3 133.0 138.4 158.0 202.1 33.8 94.8 %
change, pair 1 86104970d79d 220 136.8 133.6 145.4 200.9 238.8 34.0 95.2 %
main, pair 2 7383be1a19c7 216 138.9 138.5 145.6 162.1 194.2 33.8 95.2 %
change, pair 2 86104970d79d 227 132.6 131.0 137.3 168.8 195.5 34.1 94.8 %

Change minus main, mean ms/frame: pair 1 +2.50, pair 2 -6.31, mean -1.90 (-1.4 %); p50 +0.6 and -7.5; p99 +42.9 and +6.7.

Frame time is within noise. Twelve main captures of this scene across six blocks give a mean of 137.6 ms per frame with a standard deviation of 1.85 ms (1.35 %), and the two pair deltas have opposite signs; two pairs resolve about 3 % at best. The p99 rose in both pairs (+42.9 and +6.7 ms); in a 30 s capture of about 220 frames the p99 is set by the two or three longest frames, so a single pair's p99 moves with single long frames; in the stacked boots below it moved both ways (+13.1 and -3.9 ms).

Why frame time barely moves: the scene is CPU-bound and the draw committer is its critical path. In a 60 s stack sample of main in this scene (1 ms sampling, 3,843 samples per thread, digests attached), finishDraw/commitDraw is 79.8 % of the committer's samples inclusive, Graphics::Draw 76.1 %, prepareDraw 53.4 %, recordPreparedDraw 21.8 % and collectWrites 12.2 %; about half the sampled stacks are cut at 64 frames, so inclusive shares are lower bounds. The queue worker shows 95 % busy in every capture, but 53 % of its samples are DrawFinisher::Drain reading steady_clock::now while it waits, so that figure overstates its load. GPU busy is 33.8 ms of a 137 ms frame.

The work this change removes, counted in separate boots of the same scene (75 s after the player stands still, APS5_PROFILE_DRAW=1, so counts only, never timing) with a local counter patch that counts the vkCmdBindPipeline (graphics) and vkCmd Set* calls the draw code requests and those actually recorded; the patch is applied identically to both sides and is not part of this PR (diag-base.patch, diag-r1.patch):

per draw main boot 1 main boot 2 spread this change change
graphics pipeline binds recorded 0.98 0.98 0.5 % 0.42 -57.6 %
dynamic state commands recorded 18.63 18.54 0.5 % 0.63 -96.6 %
graphics pipeline binds requested 0.98 0.98 0.5 % 1.00 +1.9 %
dynamic state commands requested 18.63 18.54 0.5 % 14.96 -19.5 %

Per frame that is about 51,000 fewer dynamic state commands (52,794 to 1,785) and 1,600 fewer pipeline binds (2,783 to 1,175). The boots drew 2,827 to 2,853 draws per present; the per-draw rows carry the comparison. Requests fall too because the draw path no longer asks for state a recorded pass already set.

The same boots print the draw committer's cost per commit ([draw] pipelined (10 s, depth 32): N commits at X us each, one line per 10 s; a commit is one draw or other operation the committer runs from its queue). Over the seven 10 s blocks of the window, main averaged 35.4 and 34.4 us per commit (blocks 34.2 to 36.6 us) and this change 33.6 us (blocks 33.2 to 34.2 us), about 1.3 us (3.8 %) less. At about 3,660 commits per present in these boots that is about 4.9 ms per present on the committer, the thread on the critical path (see above). APS5_PROFILE_DRAW adds its own clock reads and turns off the draw finisher handoff, so these are a comparison between builds, not a timing.

Summary lines (tools/trace_digest.py JSON summary, one per capture, in the order of the table):

{"commit":"7383be1a19c7","dirty":false,"env":{"APS5_ADDRESS_COPY_MAX_MIB":"512","APS5_DRAW_PIPELINE":"1","APS5_DUMP_FRAMES":"80","APS5_DUMP_FRAMES_EVERY":"300","APS5_LOG_TIMESTAMPS":"1","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":"235:30","APS5_TRACE_SUMMARY_EVERY":"10","APS5_VIDEOOUT_TELEMETRY_DIR":"<path>"},"gpu":"NVIDIA GeForce RTX 3080","driver":"NVIDIA 621.14","os":"Windows 10.0.26220","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 235:30","first_present":4119,"ms":30086.636},"presents":224,"frame_ms":{"p50":133.016,"p90":138.351,"p99":158.013,"max":202.100},"gpu_busy_ms_per_present":33.796,"worker_busy_pct":{"queue worker 0x0":94.800},"top_phases_ms_per_frame":{"Driver.Packet":120.795,"Graphics.Draw":102.866,"Driver.Packet.draw":91.530,"Driver.Draw":90.928,"Graphics.Draw.draw_and_resource_release":81.126,"Driver.DrawFinish":78.517,"Driver.Draw.prepare":71.069,"Driver.DrawFinish.shader_compile_and_link":43.331},"trace_dropped":true,"trace_dropped_threads":{"queue worker 0x0":{"events_full_after_s":5.091,"events_lost":1299839,"totals_full":false},"draw committer":{"events_full_after_s":10.820,"events_lost":467099,"totals_full":false},"draw finisher":{"events_full_after_s":12.816,"events_lost":349882,"totals_full":false}},"trace":"aps5-trace-7383be1a19c7-24960.json.gz"}
{"commit":"86104970d79d","dirty":false,"env":{"APS5_ADDRESS_COPY_MAX_MIB":"512","APS5_DRAW_PIPELINE":"1","APS5_DUMP_FRAMES":"80","APS5_DUMP_FRAMES_EVERY":"300","APS5_LOG_TIMESTAMPS":"1","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":"235:30","APS5_TRACE_SUMMARY_EVERY":"10","APS5_VIDEOOUT_TELEMETRY_DIR":"<path>"},"gpu":"NVIDIA GeForce RTX 3080","driver":"NVIDIA 621.14","os":"Windows 10.0.26220","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 235:30","first_present":4130,"ms":30099.117},"presents":220,"frame_ms":{"p50":133.579,"p90":145.444,"p99":200.923,"max":238.815},"gpu_busy_ms_per_present":34.000,"worker_busy_pct":{"queue worker 0x0":95.234},"top_phases_ms_per_frame":{"Driver.Packet":123.564,"Graphics.Draw":104.735,"Driver.Packet.draw":92.702,"Driver.Draw":92.113,"Graphics.Draw.draw_and_resource_release":82.199,"Driver.DrawFinish":79.021,"Driver.Draw.prepare":71.963,"Driver.DrawFinish.shader_compile_and_link":44.731},"trace_dropped":true,"trace_dropped_threads":{"queue worker 0x0":{"events_full_after_s":5.137,"events_lost":1250287,"totals_full":false},"draw committer":{"events_full_after_s":11.251,"events_lost":432802,"totals_full":false},"draw finisher":{"events_full_after_s":13.065,"events_lost":339709,"totals_full":false}},"trace":"aps5-trace-86104970d79d-10600.json.gz"}
{"commit":"7383be1a19c7","dirty":false,"env":{"APS5_ADDRESS_COPY_MAX_MIB":"512","APS5_DRAW_PIPELINE":"1","APS5_DUMP_FRAMES":"80","APS5_DUMP_FRAMES_EVERY":"300","APS5_LOG_TIMESTAMPS":"1","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":"235:30","APS5_TRACE_SUMMARY_EVERY":"10","APS5_VIDEOOUT_TELEMETRY_DIR":"<path>"},"gpu":"NVIDIA GeForce RTX 3080","driver":"NVIDIA 621.14","os":"Windows 10.0.26220","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 235:30","first_present":4079,"ms":30007.194},"presents":216,"frame_ms":{"p50":138.524,"p90":145.591,"p99":162.078,"max":194.210},"gpu_busy_ms_per_present":33.771,"worker_busy_pct":{"queue worker 0x0":95.238},"top_phases_ms_per_frame":{"Driver.Packet":124.735,"Graphics.Draw":107.107,"Driver.Packet.draw":94.222,"Driver.Draw":93.599,"Graphics.Draw.draw_and_resource_release":84.117,"Driver.DrawFinish":79.620,"Driver.Draw.prepare":72.851,"Driver.DrawFinish.shader_compile_and_link":45.859},"trace_dropped":true,"trace_dropped_threads":{"queue worker 0x0":{"events_full_after_s":4.923,"events_lost":1302401,"totals_full":false},"draw committer":{"events_full_after_s":10.599,"events_lost":475399,"totals_full":false},"draw finisher":{"events_full_after_s":11.773,"events_lost":393890,"totals_full":false}},"trace":"aps5-trace-7383be1a19c7-13360.json.gz"}
{"commit":"86104970d79d","dirty":false,"env":{"APS5_ADDRESS_COPY_MAX_MIB":"512","APS5_DRAW_PIPELINE":"1","APS5_DUMP_FRAMES":"80","APS5_DUMP_FRAMES_EVERY":"300","APS5_LOG_TIMESTAMPS":"1","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":"235:30","APS5_TRACE_SUMMARY_EVERY":"10","APS5_VIDEOOUT_TELEMETRY_DIR":"<path>"},"gpu":"NVIDIA GeForce RTX 3080","driver":"NVIDIA 621.14","os":"Windows 10.0.26220","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 235:30","first_present":4124,"ms":30103.471},"presents":227,"frame_ms":{"p50":131.048,"p90":137.280,"p99":168.750,"max":195.476},"gpu_busy_ms_per_present":34.068,"worker_busy_pct":{"queue worker 0x0":94.820},"top_phases_ms_per_frame":{"Driver.Packet":119.044,"Graphics.Draw":101.151,"Driver.Packet.draw":89.227,"Driver.Draw":88.637,"Graphics.Draw.draw_and_resource_release":79.489,"Driver.DrawFinish":76.272,"Driver.Draw.prepare":68.730,"Driver.DrawFinish.shader_compile_and_link":43.289},"trace_dropped":true,"trace_dropped_threads":{"queue worker 0x0":{"events_full_after_s":5.191,"events_lost":1248477,"totals_full":false},"draw committer":{"events_full_after_s":11.307,"events_lost":435802,"totals_full":false},"draw finisher":{"events_full_after_s":13.274,"events_lost":332110,"totals_full":false}},"trace":"aps5-trace-86104970d79d-19600.json.gz"}

Traces: main, pair 1 aps5-trace-7383be1a19c7-24960.json.gz, change, pair 1 aps5-trace-86104970d79d-10600.json.gz, main, pair 2 aps5-trace-7383be1a19c7-13360.json.gz, change, pair 2 aps5-trace-86104970d79d-19600.json.gz. Counter lines: counters-base.txt, counters-base2.txt, counters-cand.txt.

tools/performance_compare.py output per pair: pair 1, pair 2. tools/trace_digest.py output per capture: main, pair 1, change, pair 1, main, pair 2, change, pair 2.

Deviations from the Performance report form, the same in every capture (deviations.txt, environment per capture in the *-env.txt files):

  • The pipelined draw variables above, APS5_ADDRESS_COPY_MAX_MIB=512, APS5_NO_PAD_INPUT=1, APS5_LOG_TIMESTAMPS=1 and APS5_TRACE_SUMMARY_EVERY=10.
  • Scripted pad input from one saved game reaches the scene, and frame dumps (APS5_DUMP_FRAMES=80, APS5_DUMP_FRAMES_EVERY=300) let the script see the menus and check the view; the log is redirected to a file the script reads.
  • All builds share one warm shader cache directory (ANYPS5_SHADER_CACHE_DIR, __GL_SHADER_DISK_CACHE_PATH).
  • The trace buffers fill in every capture (trace_dropped), so slice counts are partial; the summary totals are complete.
  • This block only: the first main capture ran at 21:09 and the other three at 21:16 to 21:31, with one killed boot between them that was not kept.

Host: AMD Ryzen 7 5800X (16 threads), 32 GB, NVIDIA GeForce RTX 3080 (driver 621.14, Vulkan 1.4.357), Windows 10.0.26220, desktop on AC power with the High performance scheme, display 2560x1440 at 179 Hz; the title renders 3840x2160 (host-report.txt). That is the host of the older pairs and the counter boots above. Since then Resizable BAR is on (BAR1 16384 MiB, VBIOS 94.02.27.00.09), Windows is build 26320 and Defender excludes the build, tool and capture folders; the driver is still 621.14. The replay measurement and the stacked boots ran on that host.

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Fixes: none
  • Unblocks: none
  • GPUs tested: NVIDIA GeForce RTX 3080 (driver 621.14, Windows 10.0.26220); Mesa lavapipe on the fork's GitHub runners (Linux and Windows)
  • AI-assisted: yes

🤖 Generated with Claude Code

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5202968963 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/16752). Originally posted by [chitters2004](https://github.com/chitters2004) on 2026-11-07T15:13:49Z. --- ### What Every recorded graphics draw binds its pipeline and records every dynamic state command it uses, even when its command buffer already holds that pipeline and those values. In the GTA V (PPSA04263) standing scene measured below, `main` issues 18.6 dynamic state commands and 0.98 graphics pipeline binds per draw. Each recorder batch now owns a `CommandState` (`Recorder::GraphicsState()`) that remembers the graphics pipeline bound in its command buffer and the value of each of the 19 dynamic state slots the draw path sets (viewport, scissor, depth bias, depth bounds, cull mode, front face, depth test, write and compare, depth bounds test, stencil test, and per face the stencil op, compare mask, write mask and reference). A bind or setter whose value the command buffer already holds is skipped. - `Pipeline::Begin`, `Continue`, the back-face and second-channel binds, the stencil replay reference, the sample order depth reorder and the first-sample copy in `Recorder::RecordUncounted` record through the batch's `CommandState`, so the draw after one of those passes records only what differs. - Nothing is known after `vkBeginCommandBuffer`, and a pipeline bind forgets every slot the new pipeline fixes statically. The state belongs to the batch, so a recycled command buffer handle and a batch reopened after a failed submit start with nothing known. - `Context::Function`, `Context::Resolved` and the device setup lookup take a consteval `FunctionName` that rejects a graphics pipeline bind, a tracked dynamic state command, `vkCmdBindShadersEXT` or `vkCmdExecuteCommands` at compile time. The device table holds those entry points as write-only `TrackedFunction` members that only `CommandState` and the new `Context::BindComputePipeline` read. Presentation, the performance overlay and tests, which record their own command buffers, use a local untracked `CommandState`. `CommandState` cannot be copied or moved. - Two routes stay open because the type system cannot see them, recorded in `docs/dev/debt/libSceAgcDriver.md`: a raw `deviceProc` lookup cast to the function type, and a second `CommandState` begun on a recorder batch's command buffer. - `APS5_NO_STATE_SUPPRESSION` records every bind and setter, as before (`docs/dev/ENVIRONMENT.md`). Overlap, checked on 2026-11-07 against `main` `46552cb461` with `tools/pr_overlap.py` and by hand: the tool reports 13 open pull requests that change lines this branch changes and 98 more that conflict with `main` and share files with it (78 of the 111 have a commit since 2026-10-24; I read the hunks of 29 of them). None implements the same thing. #9503, #10351, #11551, #12840 and #12944 change the same functions (`SampleOrders::Depth`, `recordPreparedDraw`, `recordStencilReplay`, `pushDrawConstants`, `VulkanDevice::recordDispatch`), so whichever lands second needs a manual rebase; the others share only test, debt or `ENVIRONMENT.md` lines in other hunks. #10049, #12863, #15670, #15845 and #16286 are disjoint. Rechecked against `4977f64052`: the tool now confirms #9503, #9712, #9897, #10141, #10351, #12944, #14032, #15570, #16373 and #16572. #16572 (set color write masks per draw through dynamic state) adds a dynamic state that this change's tracker must own: with this change, recording `vkCmdSetColorWriteMaskEXT` outside the tracker does not compile. If #16572 lands first, a rebase of this branch onto it that tracks the masks like the other dynamic states is ready (fork branch `draft/src/refresh/r1-on-16572`); it suppresses an identical mask set and records a changed or wider one, with a unit test that a mutant ignoring mask values turns red. Open pull requests that record a graphics pipeline bind or a tracked dynamic state command must go through `CommandState` (or `Context::BindComputePipeline` for a compute bind) once both are in `main`, because a direct call through `Context::Function` or `Context::Resolved` no longer compiles; none is a prerequisite, so `Depends on` is none: - #9503 binds the sample order depth set after its pipeline (`SampleOrders::Depth`): its pipeline bind goes through `CommandState::BindPipeline` on `Recorder::GraphicsState()`. - #10351 exports stencil operation values through an attachment (`recordPreparedDraw`): stencil state goes through `CommandState::SetStencilOp`, `SetStencilCompareMask`, `SetStencilWriteMask` and `SetStencilReference`. - #11551 tests depth bounds in the pixel program when the device lacks `depthBounds` (`recordStencilReplay`, `pushDrawConstants`): its fallback sets `SetDepthBoundsTestEnable` and `SetDepthBounds` through `CommandState`. - #9508 (heap pipeline binds in `PresentationPass::draw`, `FirstSampleCopy::Record`, `GpuColorTransfer::dispatch` and the `TextureDetiler` dispatches), #10043 (pipeline bind, viewport and scissor in the new `PresentationUpscaler.cpp`), #12840 (`VulkanDevice::recordDispatch` and a store-page gather in `Recorder.cpp`) and #15792 (`Recorder::RecordChangedCopy`) add such calls; their text merges, but each call has to move to `CommandState` or `Context::BindComputePipeline`. ### Tested <!-- OS, title or homebrew, what was checked. "Not tested" is a valid answer. A performance change: the summary lines of main and of this PR from the same machine and scene, with the traces attached, captured as the Performance report issue form describes. --> Head `1781488bcb` on `main` `4977f64052`. **Refreshed onto `main` `4977f64052`.** Head `1781488bcb`; `git range-diff` against `b0fe73c6dd` shows the same code patches in all 8 commits; only the debt entry of commits 3 to 6 and 8 changed context, because `main` added two entries above it. Local RTX 3080 gate on both, same environment as below (`ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation`), built one after the other in one build tree, with the focused AGC set of all five pull requests of this series (242 tests on this head, 232 on `main`): both 100 % passed, no `VUID-` line in either log or in replay subprocess logs, and neither log contains `was not found but was requested by env var VK_INSTANCE_LAYERS`. Fork CI on the rebased head against `4977f64052`: [run 42375092958](https://github.com/chitters2004/AnyPS5/actions/runs/42375092958): Linux 46 of 53 passed, 7 skipped; Windows 45 of 55 passed, 9 skipped, and `agc_driver_recorder` failed, as it does on `main`. The skips include the new `agc_driver_pipeline_optimized_readback_color32_unsuppressed` and `_color64_unsuppressed`, skipped on lavapipe like their existing forms; the RTX 3080 gate runs and passes them. No `VUID-` line on either side, conventions check passed. The measurements and full runs below were on the previous base `46552cb461`; the code they measured is unchanged. **Vulkan validation.** RTX 3080, `ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation`, `ctest --test-dir build -R 'agc|write_tracking|guest|indirect_draw|draw_finisher|depth_bias|draw_pipeline' -V` on `b0fe73c6dd` (3209 tests) and on `main` `46552cb461` (3199 tests). Every test failing in either full run was then rerun alone on both builds, one build at a time with nothing else on the GPU, using `ctest -R` with the union of the 16 names and the same environment: on both, 15 of 16 passed and only `agc_driver_direct_write_completion` failed, which fails on `main` too (#15547); the other failures of the full runs were timeouts and `0xc0000409` exits under load from concurrent gates and did not reproduce alone. Both full logs hold the same 18 `VUID-VkPipelineColorBlendStateCreateInfo-pAttachments-00605` lines and no other `VUID-`; neither contains `was not found but was requested by env var VK_INSTANCE_LAYERS`. The change adds no validation error. **Fork CI** (GitHub runners, Mesa lavapipe with the Khronos validation layer, head against `main`): [run 42329061255](https://github.com/chitters2004/AnyPS5/actions/runs/42329061255), rebased there onto `46552cb461`. Linux and Windows each ran 39 tests: 31 passed, 0 failed, 8 skipped, no `VUID-` line on either side, conventions check passed. The eight skips are the same on `main` except for the two new `_unsuppressed` color readback variants, and all have the same lavapipe reasons: the masked pixel shader needs at least 32 subgroup lanes (the four `color32`/`color64` readback tests and their two new variants), and the device has no 2x color and depth targets (two sample order tests); the RTX 3080 gate above runs them. **Tests.** - `agc_command_state` drives the tracker through real objects: a pipeline bind, every tracked dynamic state, a D16 stencil target stored as D24 that caches and emits the converted depth bias for both faces with and without graphics pipeline libraries, `Pipeline::Continue` swapping from the fast-linked to the optimized handle within one tracker and suppressing afterwards, `DynamicSlots` rejecting a dynamic state the tracker does not follow, and a second render pass of a batch that records nothing for an identical draw. - `agc_graphics_state_recorder` (and `_unsuppressed`): a real `Recorder` reopened over a reused command buffer handle, and a batch reopened on a recycled handle after a failed submit, record the pipeline bind and every setter again; two interleaved recorders never suppress each other; a draw after `RecordUncounted`, also when it throws, or after `RecordSampleOrder` records only what differs. - `agc_driver_depth_bias_per_face` checks the recorded per-face pixels; recorded per-face draws set the viewport and scissor once and the synchronous path twice. The optimized readback, stencil replay and per-face depth bias tests also run with `APS5_NO_STATE_SUPPRESSION` (`_unsuppressed`) and the per-face test with `APS5_DRAW_TRANSITIONS` (`_transitions`). - Red proof, from the branch history on an earlier head (`bf99218c1b`, same tests): a diagnostic build that carries the previous batch's tracker state into the batch opened after an injected failed submit turns `agc_graphics_state_recorder` red at "the first draw after a failed submit on a recycled command buffer handle" (the draw is suppressed instead of recording all 16 commands); without the mutant it passes. The compile-time check is its own negative control: recording `vkCmdSetViewport` through `Context::Function` does not compile. `agc_command_state` first failed 8 of 40 runs because the sample-location mock ignored `blockOptimizedLink`; after that test fix it passed 150 of 150 runs and 100 of 100 on the then frozen commit. **Per-draw cost, replay.** Identical frames, so the change is the only difference. A 3-frame capture of the scene below (`APS5_FRAME_CAPTURE`, 9,364 draws) is replayed with `agc_frame_replay --repeat 5` through the real submit path, with the same pipelined-draw settings as the boots; passes 2 to 5 count. Base `46552cb461` and each build alternate run by run. Every pass of every run drew exactly 9,364 draws and every run matched the base pixels exactly (`pixels_identical` 1.0). The metric is committer wall time per commit, per draw; base is about 53.2 µs per draw. The replay tool is `main`'s `tools/FrameReplay.cpp` with #12565, #12567, #12568, #11435 and #13984 merged and a local retire of resident images before each memory restore so `--repeat` works; it is local and not part of this pull request (per-build summaries and binary provenance attached). | build | pairs | commit µs per draw, change (95 % CI) | relative | timed ms per pass, change (95 % CI) | |---|---|---|---|---| | this change, `b0fe73c6dd` | 5 | -1.35 ± 1.04 | -2.5 % | -12.0 ± 9.4 | | all three merged on `46552cb461` | 5 | -2.99 ± 0.44 | -5.6 % | -25.5 ± 7.7 | | calibration: +1.0 µs spin per draw | 5 | +0.92 ± 0.68 | +1.7 % | +6.3 ± 11.4 | | null control: import validity `f62ea7bd08` | 5 | -0.19 ± 0.64 | -0.4 % | -0.1 ± 11.1 | | null control: pushless offset `0e323b1bdc` | 5 | -0.56 ± 1.00 | -1.1 % | -4.9 ± 9.5 | The calibration build reads its injected 1.0 µs, so the replay resolves per-draw costs below 1 µs; base against base reads +0.10 ± 0.37. The two null controls stay within noise. The three changes add up: -1.35, -0.81 and -0.44 sum to -2.60, inside the merged build's -2.99 ± 0.44. Thread CPU columns are attached but not used: Windows thread times tick in 15.6 ms steps, too coarse for 1 µs per draw. The replay cannot show contention with the title's own threads, frame pacing, or GPU-bound time. **Frame time, stacked boots.** `main` `46552cb461` against the three changes merged on it, one warm-up boot each, then two ABBA pairs in the scene below on the current host: mean ms/frame 147.0 to 136.0 (-7.5 %) and 136.7 to 131.3 (-4.0 %); p99 168.8 to 181.9 and 192.6 to 188.7. These are not attributed to the change: the merged build drew 13 % fewer draws per present in those boots (1,497 and 1,611 against 1,783 and 1,801), and draw count varies from boot to boot with the scene, which is why the per-draw figure above comes from the replay. The older per-pull-request pairs below were taken on this branch before its rebase and on the host state before the changes listed under Host; the counts are per pull request and stay. **Performance, older per-PR pairs.** GTA V (PPSA04263, content 01.011.001), standing scene, 3840x2160, default in-game settings. Two interleaved pairs, `main` then this change, twice, after one warm-up boot of each build that is not a sample. Each capture is the 30 s trace window from 235 s after launch, about 30 s after the player stands still (202 to 206 s in every capture), with pipelined draws (`APS5_DRAW_PIPELINE=1`, `APS5_PIPELINED_DRAWS=32`, `APS5_PIPELINE_DISPATCH=1`). `main` was `7383be1a19`; the change was `86104970d7`, this branch before its rebase onto `46552cb461` (`git range-diff` shows the same patches; only the context lines of the debt entry differ). | capture | commit | presents in 30 s | mean ms/frame | p50 | p90 | p99 | max | GPU busy ms/present | queue worker busy | |---|---|---|---|---|---|---|---|---|---| | main, pair 1 | `7383be1a19c7` | 224 | 134.3 | 133.0 | 138.4 | 158.0 | 202.1 | 33.8 | 94.8 % | | change, pair 1 | `86104970d79d` | 220 | 136.8 | 133.6 | 145.4 | 200.9 | 238.8 | 34.0 | 95.2 % | | main, pair 2 | `7383be1a19c7` | 216 | 138.9 | 138.5 | 145.6 | 162.1 | 194.2 | 33.8 | 95.2 % | | change, pair 2 | `86104970d79d` | 227 | 132.6 | 131.0 | 137.3 | 168.8 | 195.5 | 34.1 | 94.8 % | Change minus main, mean ms/frame: pair 1 +2.50, pair 2 -6.31, mean -1.90 (-1.4 %); p50 +0.6 and -7.5; p99 +42.9 and +6.7. Frame time is within noise. Twelve `main` captures of this scene across six blocks give a mean of 137.6 ms per frame with a standard deviation of 1.85 ms (1.35 %), and the two pair deltas have opposite signs; two pairs resolve about 3 % at best. The p99 rose in both pairs (+42.9 and +6.7 ms); in a 30 s capture of about 220 frames the p99 is set by the two or three longest frames, so a single pair's p99 moves with single long frames; in the stacked boots below it moved both ways (+13.1 and -3.9 ms). Why frame time barely moves: the scene is CPU-bound and the draw committer is its critical path. In a 60 s stack sample of `main` in this scene (1 ms sampling, 3,843 samples per thread, digests attached), `finishDraw`/`commitDraw` is 79.8 % of the committer's samples inclusive, `Graphics::Draw` 76.1 %, `prepareDraw` 53.4 %, `recordPreparedDraw` 21.8 % and `collectWrites` 12.2 %; about half the sampled stacks are cut at 64 frames, so inclusive shares are lower bounds. The queue worker shows 95 % busy in every capture, but 53 % of its samples are `DrawFinisher::Drain` reading `steady_clock::now` while it waits, so that figure overstates its load. GPU busy is 33.8 ms of a 137 ms frame. The work this change removes, counted in separate boots of the same scene (75 s after the player stands still, `APS5_PROFILE_DRAW=1`, so counts only, never timing) with a local counter patch that counts the `vkCmdBindPipeline` (graphics) and `vkCmd Set*` calls the draw code requests and those actually recorded; the patch is applied identically to both sides and is not part of this PR ([diag-base.patch](https://github.com/chitters2004/AnyPS5/releases/download/pr-r1-traces/diag-base.patch), [diag-r1.patch](https://github.com/chitters2004/AnyPS5/releases/download/pr-r1-traces/diag-r1.patch)): | per draw | `main` boot 1 | `main` boot 2 | spread | this change | change | |---|---|---|---|---|---| | graphics pipeline binds recorded | 0.98 | 0.98 | 0.5 % | 0.42 | -57.6 % | | dynamic state commands recorded | 18.63 | 18.54 | 0.5 % | 0.63 | -96.6 % | | graphics pipeline binds requested | 0.98 | 0.98 | 0.5 % | 1.00 | +1.9 % | | dynamic state commands requested | 18.63 | 18.54 | 0.5 % | 14.96 | -19.5 % | Per frame that is about 51,000 fewer dynamic state commands (52,794 to 1,785) and 1,600 fewer pipeline binds (2,783 to 1,175). The boots drew 2,827 to 2,853 draws per present; the per-draw rows carry the comparison. Requests fall too because the draw path no longer asks for state a recorded pass already set. The same boots print the draw committer's cost per commit (`[draw] pipelined (10 s, depth 32): N commits at X us each`, one line per 10 s; a commit is one draw or other operation the committer runs from its queue). Over the seven 10 s blocks of the window, `main` averaged 35.4 and 34.4 us per commit (blocks 34.2 to 36.6 us) and this change 33.6 us (blocks 33.2 to 34.2 us), about 1.3 us (3.8 %) less. At about 3,660 commits per present in these boots that is about 4.9 ms per present on the committer, the thread on the critical path (see above). `APS5_PROFILE_DRAW` adds its own clock reads and turns off the draw finisher handoff, so these are a comparison between builds, not a timing. Summary lines (`tools/trace_digest.py` JSON summary, one per capture, in the order of the table): ```json {"commit":"7383be1a19c7","dirty":false,"env":{"APS5_ADDRESS_COPY_MAX_MIB":"512","APS5_DRAW_PIPELINE":"1","APS5_DUMP_FRAMES":"80","APS5_DUMP_FRAMES_EVERY":"300","APS5_LOG_TIMESTAMPS":"1","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":"235:30","APS5_TRACE_SUMMARY_EVERY":"10","APS5_VIDEOOUT_TELEMETRY_DIR":"<path>"},"gpu":"NVIDIA GeForce RTX 3080","driver":"NVIDIA 621.14","os":"Windows 10.0.26220","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 235:30","first_present":4119,"ms":30086.636},"presents":224,"frame_ms":{"p50":133.016,"p90":138.351,"p99":158.013,"max":202.100},"gpu_busy_ms_per_present":33.796,"worker_busy_pct":{"queue worker 0x0":94.800},"top_phases_ms_per_frame":{"Driver.Packet":120.795,"Graphics.Draw":102.866,"Driver.Packet.draw":91.530,"Driver.Draw":90.928,"Graphics.Draw.draw_and_resource_release":81.126,"Driver.DrawFinish":78.517,"Driver.Draw.prepare":71.069,"Driver.DrawFinish.shader_compile_and_link":43.331},"trace_dropped":true,"trace_dropped_threads":{"queue worker 0x0":{"events_full_after_s":5.091,"events_lost":1299839,"totals_full":false},"draw committer":{"events_full_after_s":10.820,"events_lost":467099,"totals_full":false},"draw finisher":{"events_full_after_s":12.816,"events_lost":349882,"totals_full":false}},"trace":"aps5-trace-7383be1a19c7-24960.json.gz"} {"commit":"86104970d79d","dirty":false,"env":{"APS5_ADDRESS_COPY_MAX_MIB":"512","APS5_DRAW_PIPELINE":"1","APS5_DUMP_FRAMES":"80","APS5_DUMP_FRAMES_EVERY":"300","APS5_LOG_TIMESTAMPS":"1","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":"235:30","APS5_TRACE_SUMMARY_EVERY":"10","APS5_VIDEOOUT_TELEMETRY_DIR":"<path>"},"gpu":"NVIDIA GeForce RTX 3080","driver":"NVIDIA 621.14","os":"Windows 10.0.26220","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 235:30","first_present":4130,"ms":30099.117},"presents":220,"frame_ms":{"p50":133.579,"p90":145.444,"p99":200.923,"max":238.815},"gpu_busy_ms_per_present":34.000,"worker_busy_pct":{"queue worker 0x0":95.234},"top_phases_ms_per_frame":{"Driver.Packet":123.564,"Graphics.Draw":104.735,"Driver.Packet.draw":92.702,"Driver.Draw":92.113,"Graphics.Draw.draw_and_resource_release":82.199,"Driver.DrawFinish":79.021,"Driver.Draw.prepare":71.963,"Driver.DrawFinish.shader_compile_and_link":44.731},"trace_dropped":true,"trace_dropped_threads":{"queue worker 0x0":{"events_full_after_s":5.137,"events_lost":1250287,"totals_full":false},"draw committer":{"events_full_after_s":11.251,"events_lost":432802,"totals_full":false},"draw finisher":{"events_full_after_s":13.065,"events_lost":339709,"totals_full":false}},"trace":"aps5-trace-86104970d79d-10600.json.gz"} {"commit":"7383be1a19c7","dirty":false,"env":{"APS5_ADDRESS_COPY_MAX_MIB":"512","APS5_DRAW_PIPELINE":"1","APS5_DUMP_FRAMES":"80","APS5_DUMP_FRAMES_EVERY":"300","APS5_LOG_TIMESTAMPS":"1","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":"235:30","APS5_TRACE_SUMMARY_EVERY":"10","APS5_VIDEOOUT_TELEMETRY_DIR":"<path>"},"gpu":"NVIDIA GeForce RTX 3080","driver":"NVIDIA 621.14","os":"Windows 10.0.26220","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 235:30","first_present":4079,"ms":30007.194},"presents":216,"frame_ms":{"p50":138.524,"p90":145.591,"p99":162.078,"max":194.210},"gpu_busy_ms_per_present":33.771,"worker_busy_pct":{"queue worker 0x0":95.238},"top_phases_ms_per_frame":{"Driver.Packet":124.735,"Graphics.Draw":107.107,"Driver.Packet.draw":94.222,"Driver.Draw":93.599,"Graphics.Draw.draw_and_resource_release":84.117,"Driver.DrawFinish":79.620,"Driver.Draw.prepare":72.851,"Driver.DrawFinish.shader_compile_and_link":45.859},"trace_dropped":true,"trace_dropped_threads":{"queue worker 0x0":{"events_full_after_s":4.923,"events_lost":1302401,"totals_full":false},"draw committer":{"events_full_after_s":10.599,"events_lost":475399,"totals_full":false},"draw finisher":{"events_full_after_s":11.773,"events_lost":393890,"totals_full":false}},"trace":"aps5-trace-7383be1a19c7-13360.json.gz"} {"commit":"86104970d79d","dirty":false,"env":{"APS5_ADDRESS_COPY_MAX_MIB":"512","APS5_DRAW_PIPELINE":"1","APS5_DUMP_FRAMES":"80","APS5_DUMP_FRAMES_EVERY":"300","APS5_LOG_TIMESTAMPS":"1","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":"235:30","APS5_TRACE_SUMMARY_EVERY":"10","APS5_VIDEOOUT_TELEMETRY_DIR":"<path>"},"gpu":"NVIDIA GeForce RTX 3080","driver":"NVIDIA 621.14","os":"Windows 10.0.26220","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 235:30","first_present":4124,"ms":30103.471},"presents":227,"frame_ms":{"p50":131.048,"p90":137.280,"p99":168.750,"max":195.476},"gpu_busy_ms_per_present":34.068,"worker_busy_pct":{"queue worker 0x0":94.820},"top_phases_ms_per_frame":{"Driver.Packet":119.044,"Graphics.Draw":101.151,"Driver.Packet.draw":89.227,"Driver.Draw":88.637,"Graphics.Draw.draw_and_resource_release":79.489,"Driver.DrawFinish":76.272,"Driver.Draw.prepare":68.730,"Driver.DrawFinish.shader_compile_and_link":43.289},"trace_dropped":true,"trace_dropped_threads":{"queue worker 0x0":{"events_full_after_s":5.191,"events_lost":1248477,"totals_full":false},"draw committer":{"events_full_after_s":11.307,"events_lost":435802,"totals_full":false},"draw finisher":{"events_full_after_s":13.274,"events_lost":332110,"totals_full":false}},"trace":"aps5-trace-86104970d79d-19600.json.gz"} ``` Traces: main, pair 1 [aps5-trace-7383be1a19c7-24960.json.gz](https://github.com/chitters2004/AnyPS5/releases/download/pr-r1-traces/aps5-trace-7383be1a19c7-24960.json.gz), change, pair 1 [aps5-trace-86104970d79d-10600.json.gz](https://github.com/chitters2004/AnyPS5/releases/download/pr-r1-traces/aps5-trace-86104970d79d-10600.json.gz), main, pair 2 [aps5-trace-7383be1a19c7-13360.json.gz](https://github.com/chitters2004/AnyPS5/releases/download/pr-r1-traces/aps5-trace-7383be1a19c7-13360.json.gz), change, pair 2 [aps5-trace-86104970d79d-19600.json.gz](https://github.com/chitters2004/AnyPS5/releases/download/pr-r1-traces/aps5-trace-86104970d79d-19600.json.gz). Counter lines: [counters-base.txt](https://github.com/chitters2004/AnyPS5/releases/download/pr-r1-traces/counters-base.txt), [counters-base2.txt](https://github.com/chitters2004/AnyPS5/releases/download/pr-r1-traces/counters-base2.txt), [counters-cand.txt](https://github.com/chitters2004/AnyPS5/releases/download/pr-r1-traces/counters-cand.txt). `tools/performance_compare.py` output per pair: [pair 1](https://github.com/chitters2004/AnyPS5/releases/download/pr-r1-traces/compare-s1.md), [pair 2](https://github.com/chitters2004/AnyPS5/releases/download/pr-r1-traces/compare-s2.md). `tools/trace_digest.py` output per capture: [main, pair 1](https://github.com/chitters2004/AnyPS5/releases/download/pr-r1-traces/base-s1.digest.txt), [change, pair 1](https://github.com/chitters2004/AnyPS5/releases/download/pr-r1-traces/cand-s1.digest.txt), [main, pair 2](https://github.com/chitters2004/AnyPS5/releases/download/pr-r1-traces/base-s2.digest.txt), [change, pair 2](https://github.com/chitters2004/AnyPS5/releases/download/pr-r1-traces/cand-s2.digest.txt). Deviations from the Performance report form, the same in every capture ([deviations.txt](https://github.com/chitters2004/AnyPS5/releases/download/pr-r1-traces/deviations.txt), environment per capture in the `*-env.txt` files): - The pipelined draw variables above, `APS5_ADDRESS_COPY_MAX_MIB=512`, `APS5_NO_PAD_INPUT=1`, `APS5_LOG_TIMESTAMPS=1` and `APS5_TRACE_SUMMARY_EVERY=10`. - Scripted pad input from one saved game reaches the scene, and frame dumps (`APS5_DUMP_FRAMES=80`, `APS5_DUMP_FRAMES_EVERY=300`) let the script see the menus and check the view; the log is redirected to a file the script reads. - All builds share one warm shader cache directory (`ANYPS5_SHADER_CACHE_DIR`, `__GL_SHADER_DISK_CACHE_PATH`). - The trace buffers fill in every capture (`trace_dropped`), so slice counts are partial; the summary totals are complete. - This block only: the first `main` capture ran at 21:09 and the other three at 21:16 to 21:31, with one killed boot between them that was not kept. Host: AMD Ryzen 7 5800X (16 threads), 32 GB, NVIDIA GeForce RTX 3080 (driver 621.14, Vulkan 1.4.357), Windows 10.0.26220, desktop on AC power with the High performance scheme, display 2560x1440 at 179 Hz; the title renders 3840x2160 ([host-report.txt](https://github.com/chitters2004/AnyPS5/releases/download/pr-r1-traces/host-report.txt)). That is the host of the older pairs and the counter boots above. Since then Resizable BAR is on (BAR1 16384 MiB, VBIOS 94.02.27.00.09), Windows is build 26320 and Defender excludes the build, tool and capture folders; the driver is still 621.14. The replay measurement and the stacked boots ran on that host. ### Checklist <!-- Rules behind each item: https://github.com/boykopovar/AnyPS5/blob/main/CONTRIBUTING.md --> - [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](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed under Silent stubs in their library's [technical debt](https://github.com/boykopovar/AnyPS5/tree/main/docs/dev/debt) file - [x] No notes, investigation `.md` files or images added to the repository (attach them to this PR) - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: none - [x] Fixes: none - [x] Unblocks: none - [x] GPUs tested: NVIDIA GeForce RTX 3080 (driver 621.14, Windows 10.0.26220); Mesa lavapipe on the fork's GitHub runners (Linux and Windows) - [x] AI-assisted: yes 🤖 Generated with [Claude Code](https://claude.com/claude-code)
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!16752
No description provided.