perf(agc): learn a draw's relocation when its entry is inserted #18757

Open
virgit-1 wants to merge 1 commit from upstream-pr/18757 into main
virgit-1 commented 2026-11-12 05:15:28 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by virgit-1 on 2026-11-12T05:15:28Z.


What

With the draw finisher (APS5_DRAW_PIPELINE, #6946), a title whose draws move their user-data pointers every frame finishes almost every draw on the worker anyway, and runs slower than without the finisher.

The relocation of #4943 learns which user words of a shader set are relocatable from the entry a missed draw inserts. A miss left one pending relocation (drawRelocationPending), and the next draw's lookup learned it from the inserted entry. With the finisher, the insert happens on the finisher thread, so the worker drained the finisher before every lookup that followed such a miss (Draw.cpp, if (DrawFinisher::Busy() && drawRelocationPending.key != 0) DrawFinisher::Get().Drain();). In Expeditions: A MudRunner Game (PPSA17423), on an earlier local base, 316,470 of 350,000 draws drained the finisher there, and the queue worker spent 61% of its samples in DrawFinisher::Drain.

  • The pending relocations are kept per draw key (drawRelocationsPending, bounded at 1024 entries and cleared past that).
  • insertDrawEntry learns the pending relocation of the key it inserts, under the draw cache mutex, on whichever thread inserts.
  • admitDrawKey reads the pending relocation of its own key instead of the single slot, which another miss could have overwritten in the meantime.
  • The worker no longer drains the finisher before a lookup, and no longer learns at lookup time.

Without the finisher nothing changes in what is learned. The learning only moves from the next draw's lookup to the insert itself, which happens earlier.

agc_driver_draw_cache_relocation_finisher teaches a relocation with four draws, then submits one packet: a draw whose data differs, so it misses and leaves a pending relocation, followed by two draws whose data moved. A capture-check hook holds the finisher on the first draw until the worker has looked up the next one, for at most 2 s. On main, the worker drains the finisher first and the test fails with "the worker waited for the draw finisher to finish a missed draw before it looked up the next draw of the packet". With this change, both moved draws are looked up behind the held draw and hit the cache through the relocation.

  • #6946 (merged): introduced the draw finisher and this drain. The relocation is still learned under the draw cache mutex, from the entry that was inserted. The worker only stops waiting for that insert.
  • #4943 (merged): the relocation and its learn-at-next-lookup step. What is learned (learnPendingRelocation) is unchanged; only its trigger moves.
  • #15456 (open): turns the finisher on by default. On a title that relocates heavily the default regresses without this change. Independent, no shared line; this PR should land before or together with it.
  • #15455, #17024 (open): other finisher fixes in Draw.cpp, on different lines (finish job, recapture).
  • #10678 (open): builds the resource-cache key on the finisher. It only helps when draws reach the finisher, so it complements this PR.
  • #17225 (open): backs off the draw cache when it does not pay off. Independent.
  • #18515 (open draft, "not for merge"): a profiling tracking branch that removes the same drain by passing the pending relocation to admitDrawKey. It is not proposed for merge; if it is split into PRs, that part and this PR implement the same thing.
  • #9508 (open): tools/pr_overlap.py reports one shared line, Draw.cpp L41, where both add a declaration at the top of the anonymous namespace. No shared function.
  • tools/pr_overlap.py could not compare #5609, #5925, #6188, #6804, #7508, #7642, #9387, #10193, #10359, #11435, #11436, #13928, #13929, #15136 because they conflict with main. Their diffs were read by hand: #5609 and #6188 touch drawRelocationPending as it is on their old base (the code #4943 merged since); none of the others touches the pending relocation or the drain.

Tested

Windows 11 Pro 10.0.26300, MinGW-w64 GCC 15.2.0 (WinLibs), Release, NVIDIA GeForce RTX 2080 SUPER, driver 621.14, Intel i7-9700K.

Tests, on main c85dcfd005 and on this branch, same machine and GPU, with VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation, ANYPS5_NO_SHADER_CACHE=1, ANYPS5_REQUIRE_VULKAN=1, ctest -V -R agc_driver_draw_cache_relocation:

tests was not found but was requested VUID-
main 6 of 6 pass 0 0
this PR 7 of 7 pass (the 6 above and the new _finisher) 0 0

The new test fails without the source change, with the message quoted above. tools/check_conventions.py reports no finding on the branch.

Performance: PPSA17423 01.026.000, title screen, 3840x2160, APS5_DRAW_PIPELINE=1, ANYPS5_PRESENT_MODE=mailbox, APS5_TRACE_SECONDS=150:30. Each set was run in the order main, PR, PR, main, with one discarded 80 s launch before each change of build.

Set 1, the head of this PR (707a76b12028) against its base (main c85dcfd005):

presents in 30 s frame p50 (ms) frame p99 (ms) trace
main, first run 91 330.3 342.1 c85dcfd0056e-11788
this PR, first run 151 198.3 221.1 707a76b12028-25572
this PR, second run 143 210.4 225.1 707a76b12028-30668
main, second run 92 328.6 376.2 c85dcfd0056e-32228

tools/performance_compare.py on the first pair: Driver.Packet.draw 289.4 to 125.0 ms per frame; Driver.Draw.prepare is 227.1 ms per frame on main and is not among the reported phases with the change.

Summary lines of set 1:

{"commit":"c85dcfd0056e","dirty":false,"env":{"APS5_DRAW_PIPELINE":"1","APS5_TRACE_DIR":"<path>","APS5_TRACE_EVENTS":"4194304","APS5_TRACE_SECONDS":"150:30"},"gpu":"NVIDIA GeForce RTX 2080 SUPER","driver":"NVIDIA 621.14","os":"Windows 10.0.26300","cpu":"Intel(R) Core(TM) i7-9700K CPU @ 3.60GHz","cpu_threads":8,"memory_mib":16318,"title_id":"PPSA17423","title":"Expeditions: A Mudrunner Game","content_version":"01.026.000","resolution":"3840x2160","window":{"spec":"seconds 150:30","first_present":2219,"ms":30153.536},"presents":91,"frame_ms":{"p50":330.295,"p90":335.358,"p99":342.062,"max":342.062},"gpu_busy_ms_per_present":35.171,"worker_busy_pct":{"queue worker 0x0":97.740},"top_phases_ms_per_frame":{"Driver.Packet":323.469,"Driver.Packet.draw":289.422,"Driver.Draw":286.565,"Driver.Draw.prepare":227.072,"Graphics.Draw":213.445,"Driver.DrawFinish":170.187,"Graphics.Draw.draw_and_resource_release":164.541,"Driver.DrawFinish.shader_compile_and_link":118.042},"owned_draw_counts":{},"trace_dropped":false,"trace":"aps5-trace-c85dcfd0056e-11788.json.gz"}
{"commit":"707a76b12028","dirty":false,"env":{"APS5_DRAW_PIPELINE":"1","APS5_TRACE_DIR":"<path>","APS5_TRACE_EVENTS":"4194304","APS5_TRACE_SECONDS":"150:30"},"gpu":"NVIDIA GeForce RTX 2080 SUPER","driver":"NVIDIA 621.14","os":"Windows 10.0.26300","cpu":"Intel(R) Core(TM) i7-9700K CPU @ 3.60GHz","cpu_threads":8,"memory_mib":16318,"title_id":"PPSA17423","title":"Expeditions: A Mudrunner Game","content_version":"01.026.000","resolution":"3840x2160","window":{"spec":"seconds 150:30","first_present":2480,"ms":30017.170},"presents":151,"frame_ms":{"p50":198.252,"p90":203.326,"p99":221.050,"max":231.374},"gpu_busy_ms_per_present":35.167,"worker_busy_pct":{"queue worker 0x0":95.936},"top_phases_ms_per_frame":{"Driver.Packet":189.787,"Graphics.Draw":169.240,"Driver.DrawFinish":165.539,"Graphics.Draw.draw_and_resource_release":134.358,"Driver.Packet.draw":125.031,"Driver.Draw":122.575,"Driver.Draw.draw_handed_off":94.444,"Driver.DrawFinish.shader_compile_and_link":94.000},"owned_draw_counts":{},"trace_dropped":false,"trace":"aps5-trace-707a76b12028-25572.json.gz"}
{"commit":"707a76b12028","dirty":false,"env":{"APS5_DRAW_PIPELINE":"1","APS5_TRACE_DIR":"<path>","APS5_TRACE_EVENTS":"4194304","APS5_TRACE_SECONDS":"150:30"},"gpu":"NVIDIA GeForce RTX 2080 SUPER","driver":"NVIDIA 621.14","os":"Windows 10.0.26300","cpu":"Intel(R) Core(TM) i7-9700K CPU @ 3.60GHz","cpu_threads":8,"memory_mib":16318,"title_id":"PPSA17423","title":"Expeditions: A Mudrunner Game","content_version":"01.026.000","resolution":"3840x2160","window":{"spec":"seconds 150:30","first_present":2392,"ms":30195.071},"presents":143,"frame_ms":{"p50":210.426,"p90":216.949,"p99":225.128,"max":226.676},"gpu_busy_ms_per_present":58.657,"worker_busy_pct":{"queue worker 0x0":96.190},"top_phases_ms_per_frame":{"Driver.Packet":202.135,"Graphics.Draw":180.700,"Driver.DrawFinish":178.005,"Graphics.Draw.draw_and_resource_release":145.022,"Driver.Packet.draw":133.824,"Driver.Draw":131.457,"Driver.Draw.draw_handed_off":103.158,"Driver.DrawFinish.shader_compile_and_link":94.586},"owned_draw_counts":{},"trace_dropped":false,"trace":"aps5-trace-707a76b12028-30668.json.gz"}
{"commit":"c85dcfd0056e","dirty":false,"env":{"APS5_DRAW_PIPELINE":"1","APS5_TRACE_DIR":"<path>","APS5_TRACE_EVENTS":"4194304","APS5_TRACE_SECONDS":"150:30"},"gpu":"NVIDIA GeForce RTX 2080 SUPER","driver":"NVIDIA 621.14","os":"Windows 10.0.26300","cpu":"Intel(R) Core(TM) i7-9700K CPU @ 3.60GHz","cpu_threads":8,"memory_mib":16318,"title_id":"PPSA17423","title":"Expeditions: A Mudrunner Game","content_version":"01.026.000","resolution":"3840x2160","window":{"spec":"seconds 150:30","first_present":2279,"ms":30309.798},"presents":92,"frame_ms":{"p50":328.579,"p90":333.612,"p99":376.204,"max":376.204},"gpu_busy_ms_per_present":35.226,"worker_busy_pct":{"queue worker 0x0":97.717},"top_phases_ms_per_frame":{"Driver.Packet":321.512,"Driver.Packet.draw":287.553,"Driver.Draw":284.666,"Driver.Draw.prepare":225.620,"Graphics.Draw":212.919,"Driver.DrawFinish":169.290,"Graphics.Draw.draw_and_resource_release":164.079,"Driver.DrawFinish.shader_compile_and_link":117.173},"owned_draw_counts":{},"trace_dropped":false,"trace":"aps5-trace-c85dcfd0056e-32228.json.gz"}
`tools/trace_digest.py`: `main` c85dcfd005, first run

seconds 150:30 from present 2219: 91 presents, frame p50 330.3 / p90 335.4 / p99 342.1 / max 342.1 ms, GPU busy 35.2 ms per present
NVIDIA GeForce RTX 2080 SUPER, NVIDIA 621.14, Windows 10.0.26300, 3840x2160, commit c85dcfd005, dropped: no

{"commit":"c85dcfd0056e","dirty":false,"env":{"APS5_DRAW_PIPELINE":"1","APS5_TRACE_DIR":"<path>","APS5_TRACE_EVENTS":"4194304","APS5_TRACE_SECONDS":"150:30"},"gpu":"NVIDIA GeForce RTX 2080 SUPER","driver":"NVIDIA 621.14","os":"Windows 10.0.26300","cpu":"Intel(R) Core(TM) i7-9700K CPU @ 3.60GHz","cpu_threads":8,"memory_mib":16318,"title_id":"PPSA17423","title":"Expeditions: A Mudrunner Game","content_version":"01.026.000","resolution":"3840x2160","window":{"spec":"seconds 150:30","first_present":2219,"ms":30153.536},"presents":91,"frame_ms":{"p50":330.295,"p90":335.358,"p99":342.062,"max":342.062},"gpu_busy_ms_per_present":35.171,"worker_busy_pct":{"queue worker 0x0":97.74},"top_phases_ms_per_frame":{"Driver.Packet":323.469,"Driver.Packet.draw":289.422,"Driver.Draw":286.565,"Driver.Draw.prepare":227.072,"Graphics.Draw":213.445,"Driver.DrawFinish":170.187,"Graphics.Draw.draw_and_resource_release":164.541,"Driver.DrawFinish.shader_compile_and_link":118.042},"owned_draw_counts":{},"trace_dropped":false,"trace":"aps5-trace-c85dcfd0056e-11788.json.gz"}

Slowest frames (largest slices inside each, inclusive)

  • present 2287: 342.1 ms at 22517 ms: Driver.Packet (queue worker 0x0) 312.8, Driver.Packet.draw (queue worker 0x0) 297.4, Driver.Draw (queue worker 0x0) 294.5, Driver.Draw.prepare (queue worker 0x0) 234.3
  • present 2240: 339.6 ms at 6934 ms: Driver.Packet (queue worker 0x0) 310.9, Driver.Packet.draw (queue worker 0x0) 295.9, Driver.Draw (queue worker 0x0) 293.0, Driver.Draw.prepare (queue worker 0x0) 232.9
  • present 2241: 339.3 ms at 7274 ms: Driver.Packet (queue worker 0x0) 310.3, Driver.Packet.draw (queue worker 0x0) 294.8, Driver.Draw (queue worker 0x0) 291.9, Driver.Draw.prepare (queue worker 0x0) 231.9
  • present 2266: 339.3 ms at 15565 ms: Driver.Packet (queue worker 0x0) 310.5, Driver.Packet.draw (queue worker 0x0) 296.5, Driver.Draw (queue worker 0x0) 293.6, Driver.Draw.prepare (queue worker 0x0) 234.4
  • present 2267: 338.0 ms at 15904 ms: Driver.Packet (queue worker 0x0) 309.0, Driver.Packet.draw (queue worker 0x0) 294.5, Driver.Draw (queue worker 0x0) 291.6, Driver.Draw.prepare (queue worker 0x0) 231.9

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

  • present 2287: 342.1 ms at 22517 ms, persistence 15.4 ms
  • present 2240: 339.6 ms at 6934 ms, persistence 13.0 ms
  • present 2266: 339.3 ms at 15565 ms, persistence 11.2 ms
  • present 2254: 337.8 ms at 11583 ms, persistence 9.2 ms
  • present 2274: 336.0 ms at 18223 ms, persistence 8.3 ms
  • present 2280: 335.4 ms at 20204 ms, persistence 7.4 ms
  • present 2299: 336.6 ms at 26512 ms, persistence 7.0 ms
  • present 2292: 336.8 ms at 24185 ms, persistence 6.7 ms
  • present 2221: 333.6 ms at 661 ms, persistence 6.4 ms
  • present 2260: 335.3 ms at 13577 ms, persistence 5.9 ms

Threads (ms per frame)

thread busy wait untraced in slices < 20 us largest
title 0.1 (0 %) 2.0 (1 %) 329.2 1.3 Shader.ResolveGraphicsStagesAbi 0.1, Shader.ResolveAbi 0.0
queue worker 0x0 302.8 (91 %) 0.0 (0 %) 28.5 102.1 Driver.Packet 302.5, Driver.EndSubmission 0.4
draw committer 218.2 (66 %) 0.2 (0 %) 113.0 83.4 Graphics.Draw 211.4, Recorder.Submit 5.6
draw finisher 159.7 (48 %) 0.0 (0 %) 171.6 259.6 Driver.DrawFinish 159.7
presenter 0.7 (0 %) 1.6 (0 %) 329.1 0.1 VideoOut.Flip 2.2, Driver.Present 0.0
title 0.1 (0 %) 0.0 (0 %) 331.3 0.5 Shader.ResolveGraphicsStagesAbi 0.0, Shader.ResolveAbi 0.0
title 0.1 (0 %) 0.0 (0 %) 331.3 0.5 Shader.ResolveGraphicsStagesAbi 0.0, Shader.ResolveGraphicsAbi 0.0
title 0.1 (0 %) 0.0 (0 %) 331.3 0.5 Shader.ResolveGraphicsStagesAbi 0.0, Shader.ResolveGraphicsAbi 0.0
title 0.1 (0 %) 0.0 (0 %) 331.3 0.5 Shader.ResolveGraphicsStagesAbi 0.0, Shader.ResolveAbi 0.0
title 0.1 (0 %) 0.0 (0 %) 331.2 0.4 Shader.ResolveGraphicsStagesAbi 0.1, Shader.ResolveAbi 0.0
gpu 35.1 (11 %) 0.0 (0 %) 296.2 0.0 batch 35.1

Largest slices (ms per frame, inclusive, all threads): Driver.Packet 302.5, Driver.Packet.draw 288.0, Driver.Draw 285.1, Driver.Draw.prepare 225.7, Graphics.Draw 211.4, Driver.DrawFinish 159.7, Graphics.Draw.draw_and_resource_release 129.7, Driver.DrawFinish.shader_compile_and_link 103.4, batch 35.1, Shader.DrawStage 18.6

Longest waits

  • Recorder.WaitSerial (title) 2.1 ms at 1325 ms, present 2223
  • Recorder.WaitSerial (title) 2.1 ms at 12581 ms, present 2257
  • Recorder.WaitSerial (title) 2.1 ms at 21530 ms, present 2284
  • Recorder.WaitSerial (title) 2.1 ms at 15234 ms, present 2265
  • Recorder.WaitSerial (title) 2.1 ms at 25847 ms, present 2297
  • Recorder.WaitSerial (title) 2.1 ms at 15904 ms, present 2267
  • Recorder.WaitSerial (title) 2.1 ms at 331 ms, present 2220
  • Recorder.WaitSerial (title) 2.1 ms at 17560 ms, present 2272
  • Recorder.WaitSerial (title) 2.1 ms at 22188 ms, present 2286
  • Recorder.WaitSerial (title) 2.1 ms at 21858 ms, present 2285

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

  • batch 5387: 5.7 ms at 12435 ms, present 2256: GPU no ranges; recorded by Graphics.Draw (draw committer) 2.6, Graphics.Draw.draw_and_resource_release (draw committer) 2.2, Recorder.Submit (draw committer) 0.0
  • batch 5245: 5.7 ms at 12105 ms, present 2255: GPU no ranges; recorded by Graphics.Draw (draw committer) 2.5, Graphics.Draw.draw_and_resource_release (draw committer) 2.1, Recorder.Submit (draw committer) 0.0
  • batch 2092: 5.7 ms at 4817 ms, present 2233: GPU no ranges; recorded by Graphics.Draw (draw committer) 2.5, Graphics.Draw.draw_and_resource_release (draw committer) 2.1, Recorder.Submit (draw committer) 0.0
  • batch 6388: 5.7 ms at 14761 ms, present 2263: GPU no ranges; recorded by Graphics.Draw (draw committer) 2.6, Graphics.Draw.draw_and_resource_release (draw committer) 2.2, Recorder.Submit (draw committer) 0.0
  • batch 9691: 5.7 ms at 22373 ms, present 2286: GPU no ranges; recorded by Graphics.Draw (draw committer) 2.7, Graphics.Draw.draw_and_resource_release (draw committer) 2.2, Recorder.Submit (draw committer) 0.0
`tools/trace_digest.py`: this PR 707a76b12028, first run

seconds 150:30 from present 2480: 151 presents, frame p50 198.3 / p90 203.3 / p99 221.1 / max 231.4 ms, GPU busy 35.2 ms per present
NVIDIA GeForce RTX 2080 SUPER, NVIDIA 621.14, Windows 10.0.26300, 3840x2160, commit 707a76b12028, dropped: no

{"commit":"707a76b12028","dirty":false,"env":{"APS5_DRAW_PIPELINE":"1","APS5_TRACE_DIR":"<path>","APS5_TRACE_EVENTS":"4194304","APS5_TRACE_SECONDS":"150:30"},"gpu":"NVIDIA GeForce RTX 2080 SUPER","driver":"NVIDIA 621.14","os":"Windows 10.0.26300","cpu":"Intel(R) Core(TM) i7-9700K CPU @ 3.60GHz","cpu_threads":8,"memory_mib":16318,"title_id":"PPSA17423","title":"Expeditions: A Mudrunner Game","content_version":"01.026.000","resolution":"3840x2160","window":{"spec":"seconds 150:30","first_present":2480,"ms":30017.17},"presents":151,"frame_ms":{"p50":198.252,"p90":203.326,"p99":221.05,"max":231.374},"gpu_busy_ms_per_present":35.167,"worker_busy_pct":{"queue worker 0x0":95.936},"top_phases_ms_per_frame":{"Driver.Packet":189.787,"Graphics.Draw":169.24,"Driver.DrawFinish":165.539,"Graphics.Draw.draw_and_resource_release":134.358,"Driver.Packet.draw":125.031,"Driver.Draw":122.575,"Driver.Draw.draw_handed_off":94.444,"Driver.DrawFinish.shader_compile_and_link":94.0},"owned_draw_counts":{},"trace_dropped":false,"trace":"aps5-trace-707a76b12028-25572.json.gz"}

Slowest frames (largest slices inside each, inclusive)

  • present 2556: 231.4 ms at 15040 ms: Driver.Packet (queue worker 0x0) 175.7, Graphics.Draw (draw committer) 157.9, Driver.DrawFinish (draw finisher) 156.0, Graphics.Draw.draw_and_resource_release (draw committer) 121.3
  • present 2601: 221.0 ms at 24003 ms: Driver.Packet (queue worker 0x0) 167.2, Graphics.Draw (draw committer) 163.6, Driver.DrawFinish (draw finisher) 160.1, Driver.Packet.draw (queue worker 0x0) 120.7
  • present 2578: 207.5 ms at 19449 ms: Driver.Packet (queue worker 0x0) 152.9, Graphics.Draw (draw committer) 148.4, Driver.DrawFinish (draw finisher) 144.7, Graphics.Draw.draw_and_resource_release (draw committer) 118.8
  • present 2522: 207.0 ms at 8289 ms: Driver.Packet (queue worker 0x0) 152.8, Graphics.Draw (draw committer) 147.8, Driver.DrawFinish (draw finisher) 144.6, Graphics.Draw.draw_and_resource_release (draw committer) 117.6
  • present 2481: 205.3 ms at 198 ms: Driver.Packet (queue worker 0x0) 151.2, Graphics.Draw (draw committer) 147.5, Driver.DrawFinish (draw finisher) 143.6, Graphics.Draw.draw_and_resource_release (draw committer) 117.9

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

  • present 2556: 231.4 ms at 15040 ms, persistence 39.9 ms
  • present 2601: 221.0 ms at 24003 ms, persistence 28.2 ms
  • present 2522: 207.0 ms at 8289 ms, persistence 15.6 ms
  • present 2578: 207.5 ms at 19449 ms, persistence 14.6 ms
  • present 2481: 205.3 ms at 198 ms, persistence 13.2 ms
  • present 2623: 204.9 ms at 28401 ms, persistence 10.4 ms
  • present 2538: 202.6 ms at 11470 ms, persistence 9.5 ms
  • present 2582: 201.9 ms at 20242 ms, persistence 8.8 ms
  • present 2504: 202.5 ms at 4712 ms, persistence 8.7 ms
  • present 2619: 203.4 ms at 27598 ms, persistence 8.6 ms

Threads (ms per frame)

thread busy wait untraced in slices < 20 us largest
title 0.2 (0 %) 2.4 (1 %) 196.2 1.3 Shader.ResolveGraphicsStagesAbi 0.1, Shader.ResolveAbi 0.1
queue worker 0x0 144.6 (73 %) 0.0 (0 %) 54.2 163.3 Driver.Packet 143.8, Driver.EndSubmission 0.8
draw committer 147.3 (74 %) 0.2 (0 %) 51.3 83.6 Graphics.Draw 141.0, Recorder.Submit 5.1
draw finisher 138.0 (69 %) 0.0 (0 %) 60.8 239.0 Driver.DrawFinish 138.0
presenter 0.7 (0 %) 1.8 (1 %) 196.3 0.1 VideoOut.Flip 2.4, Driver.Present 0.0
title 0.1 (0 %) 0.0 (0 %) 198.7 0.5 Shader.ResolveGraphicsStagesAbi 0.1, Shader.ResolveAbi 0.0
title 0.1 (0 %) 0.0 (0 %) 198.7 0.5 Shader.ResolveGraphicsStagesAbi 0.1, Shader.ResolveAbi 0.0
title 0.1 (0 %) 0.0 (0 %) 198.7 0.5 Shader.ResolveGraphicsStagesAbi 0.1, Shader.ResolveAbi 0.0
title 0.1 (0 %) 0.0 (0 %) 198.7 0.5 Shader.ResolveGraphicsStagesAbi 0.1, Shader.ResolveAbi 0.0
title 0.1 (0 %) 0.0 (0 %) 198.7 0.5 Shader.ResolveGraphicsStagesAbi 0.1, Shader.ResolveAbi 0.0
gpu 34.9 (18 %) 0.0 (0 %) 163.9 0.0 batch 34.9

Largest slices (ms per frame, inclusive, all threads): Driver.Packet 143.8, Graphics.Draw 141.0, Driver.DrawFinish 138.0, Graphics.Draw.draw_and_resource_release 112.1, Driver.Packet.draw 97.8, Driver.Draw 95.7, Driver.Draw.draw_handed_off 74.2, Driver.DrawFinish.shader_compile_and_link 64.4, Driver.DrawFinish.draw_enqueued 44.8, Driver.Packet.execute 37.1

Longest waits

  • Recorder.WaitSerial (title) 2.3 ms at 29612 ms, present 2629
  • Recorder.WaitSerial (title) 2.3 ms at 8289 ms, present 2522
  • Recorder.WaitSerial (title) 2.3 ms at 403 ms, present 2482
  • Recorder.WaitSerial (title) 2.3 ms at 6101 ms, present 2511
  • Recorder.WaitSerial (title) 2.3 ms at 27801 ms, present 2620
  • Recorder.WaitSerial (title) 2.3 ms at 29009 ms, present 2626
  • Recorder.WaitSerial (title) 2.3 ms at 14638 ms, present 2554
  • Recorder.WaitSerial (title) 2.3 ms at 24003 ms, present 2601
  • Recorder.WaitSerial (title) 2.3 ms at 27202 ms, present 2617
  • Recorder.WaitSerial (title) 2.3 ms at 11071 ms, present 2536

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

  • batch 17441: 5.0 ms at 26102 ms, present 2611: GPU no ranges; recorded by Graphics.Draw (draw committer) 3.9, Graphics.Draw.draw_and_resource_release (draw committer) 3.2, Recorder.Submit (draw committer) 0.1
  • batch 14269: 4.9 ms at 21330 ms, present 2587: GPU no ranges; recorded by Graphics.Draw (draw committer) 3.8, Graphics.Draw.draw_and_resource_release (draw committer) 3.1, Recorder.Submit (draw committer) 0.1
  • batch 17707: 4.9 ms at 26500 ms, present 2613: GPU no ranges; recorded by Graphics.Draw (draw committer) 4.1, Graphics.Draw.draw_and_resource_release (draw committer) 3.4, Recorder.Submit (draw committer) 0.1
  • batch 15454: 4.8 ms at 23103 ms, present 2596: GPU no ranges; recorded by Graphics.Draw (draw committer) 3.7, Graphics.Draw.draw_and_resource_release (draw committer) 3.0, Recorder.Submit (draw committer) 0.1
  • batch 6707: 4.8 ms at 9974 ms, present 2530: GPU no ranges; recorded by Graphics.Draw (draw committer) 4.0, Graphics.Draw.draw_and_resource_release (draw committer) 3.3, Recorder.Submit (draw committer) 0.1
`tools/trace_digest.py`: this PR 707a76b12028, second run

seconds 150:30 from present 2392: 143 presents, frame p50 210.4 / p90 216.9 / p99 225.1 / max 226.7 ms, GPU busy 58.7 ms per present
NVIDIA GeForce RTX 2080 SUPER, NVIDIA 621.14, Windows 10.0.26300, 3840x2160, commit 707a76b12028, dropped: no

{"commit":"707a76b12028","dirty":false,"env":{"APS5_DRAW_PIPELINE":"1","APS5_TRACE_DIR":"<path>","APS5_TRACE_EVENTS":"4194304","APS5_TRACE_SECONDS":"150:30"},"gpu":"NVIDIA GeForce RTX 2080 SUPER","driver":"NVIDIA 621.14","os":"Windows 10.0.26300","cpu":"Intel(R) Core(TM) i7-9700K CPU @ 3.60GHz","cpu_threads":8,"memory_mib":16318,"title_id":"PPSA17423","title":"Expeditions: A Mudrunner Game","content_version":"01.026.000","resolution":"3840x2160","window":{"spec":"seconds 150:30","first_present":2392,"ms":30195.071},"presents":143,"frame_ms":{"p50":210.426,"p90":216.949,"p99":225.128,"max":226.676},"gpu_busy_ms_per_present":58.657,"worker_busy_pct":{"queue worker 0x0":96.19},"top_phases_ms_per_frame":{"Driver.Packet":202.135,"Graphics.Draw":180.7,"Driver.DrawFinish":178.005,"Graphics.Draw.draw_and_resource_release":145.022,"Driver.Packet.draw":133.824,"Driver.Draw":131.457,"Driver.Draw.draw_handed_off":103.158,"Driver.DrawFinish.shader_compile_and_link":94.586},"owned_draw_counts":{},"trace_dropped":false,"trace":"aps5-trace-707a76b12028-30668.json.gz"}

Slowest frames (largest slices inside each, inclusive)

  • present 2530: 226.7 ms at 29133 ms: Driver.Packet (queue worker 0x0) 171.9, Graphics.Draw (draw committer) 166.0, Driver.DrawFinish (draw finisher) 164.6, Graphics.Draw.draw_and_resource_release (draw committer) 133.9
  • present 2485: 225.1 ms at 19609 ms: Driver.Packet (queue worker 0x0) 169.7, Driver.DrawFinish (draw finisher) 163.2, Graphics.Draw (draw committer) 152.6, Graphics.Draw.draw_and_resource_release (draw committer) 123.3
  • present 2416: 224.3 ms at 5030 ms: Driver.Packet (queue worker 0x0) 168.6, Graphics.Draw (draw committer) 161.7, Driver.DrawFinish (draw finisher) 159.2, Graphics.Draw.draw_and_resource_release (draw committer) 131.4
  • present 2491: 223.1 ms at 20889 ms: Driver.Packet (queue worker 0x0) 168.3, Driver.DrawFinish (draw finisher) 160.8, Graphics.Draw (draw committer) 152.1, Graphics.Draw.draw_and_resource_release (draw committer) 123.1
  • present 2445: 222.5 ms at 11177 ms: Driver.Packet (queue worker 0x0) 166.2, Graphics.Draw (draw committer) 160.7, Driver.DrawFinish (draw finisher) 159.8, Graphics.Draw.draw_and_resource_release (draw committer) 129.9

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

  • present 2530: 226.7 ms at 29133 ms, persistence 22.8 ms
  • present 2416: 224.3 ms at 5030 ms, persistence 20.4 ms
  • present 2485: 225.1 ms at 19609 ms, persistence 19.5 ms
  • present 2491: 223.1 ms at 20889 ms, persistence 17.3 ms
  • present 2445: 222.5 ms at 11177 ms, persistence 16.8 ms
  • present 2509: 220.7 ms at 24694 ms, persistence 14.3 ms
  • present 2459: 217.8 ms at 14125 ms, persistence 11.9 ms
  • present 2411: 218.7 ms at 3977 ms, persistence 11.6 ms
  • present 2472: 216.9 ms at 16868 ms, persistence 10.9 ms
  • present 2431: 215.9 ms at 8207 ms, persistence 10.9 ms

Threads (ms per frame)

thread busy wait untraced in slices < 20 us largest
title 0.2 (0 %) 2.3 (1 %) 208.7 1.3 Shader.ResolveGraphicsStagesAbi 0.1, Shader.ResolveAbi 0.1
queue worker 0x0 156.7 (74 %) 0.0 (0 %) 54.4 164.4 Driver.Packet 155.8, Driver.EndSubmission 0.9
draw committer 159.7 (76 %) 0.2 (0 %) 51.2 85.6 Graphics.Draw 152.2, Recorder.Submit 6.0
draw finisher 149.6 (71 %) 0.0 (0 %) 61.6 238.5 Driver.DrawFinish 149.6
presenter 0.7 (0 %) 1.7 (1 %) 208.8 0.1 VideoOut.Flip 2.4, Driver.Present 0.0
title 0.1 (0 %) 0.0 (0 %) 211.0 0.5 Shader.ResolveGraphicsStagesAbi 0.1, Shader.ResolveAbi 0.0
title 0.1 (0 %) 0.0 (0 %) 211.0 0.5 Shader.ResolveGraphicsStagesAbi 0.1, Shader.ResolveAbi 0.0
title 0.1 (0 %) 0.0 (0 %) 211.1 0.5 Shader.ResolveGraphicsStagesAbi 0.1, Shader.ResolveAbi 0.0
title 0.1 (0 %) 0.0 (0 %) 211.0 0.5 Shader.ResolveGraphicsStagesAbi 0.1, Shader.ResolveAbi 0.0
title 0.1 (0 %) 0.0 (0 %) 211.0 0.5 Shader.ResolveGraphicsStagesAbi 0.1, Shader.ResolveAbi 0.0
gpu 58.6 (28 %) 0.0 (0 %) 152.5 0.0 batch 58.6

Largest slices (ms per frame, inclusive, all threads): Driver.Packet 155.8, Graphics.Draw 152.2, Driver.DrawFinish 149.6, Graphics.Draw.draw_and_resource_release 123.0, Driver.Packet.draw 106.4, Driver.Draw 104.3, Driver.Draw.draw_handed_off 82.6, Driver.DrawFinish.shader_compile_and_link 65.1, batch 58.6, Driver.DrawFinish.draw_enqueued 57.6

Longest waits

  • Recorder.WaitSerial (title) 2.4 ms at 19834 ms, present 2486
  • Recorder.WaitSerial (title) 2.4 ms at 17713 ms, present 2476
  • Recorder.WaitSerial (title) 2.3 ms at 839 ms, present 2396
  • Recorder.WaitSerial (title) 2.3 ms at 29990 ms, present 2534
  • Recorder.WaitSerial (title) 2.3 ms at 1260 ms, present 2398
  • Recorder.WaitSerial (title) 2.3 ms at 18972 ms, present 2482
  • Recorder.WaitSerial (title) 2.3 ms at 13495 ms, present 2456
  • Recorder.WaitSerial (title) 2.2 ms at 14125 ms, present 2459
  • Recorder.WaitSerial (title) 2.2 ms at 17291 ms, present 2474
  • Recorder.WaitSerial (title) 2.2 ms at 7153 ms, present 2426

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

  • batch 12833: 17.9 ms at 19718 ms, present 2485: GPU no ranges; recorded by Graphics.Draw (draw committer) 5.9, Graphics.Draw.draw_and_resource_release (draw committer) 5.1, Resources.Prepare (draw committer) 1.4, Resources.Complete (draw committer) 0.2
  • batch 3921: 17.7 ms at 5992 ms, present 2420: GPU no ranges; recorded by Graphics.Draw (draw committer) 5.9, Graphics.Draw.draw_and_resource_release (draw committer) 5.1, Resources.Prepare (draw committer) 1.4, Resources.Complete (draw committer) 0.3
  • batch 6246: 17.7 ms at 9564 ms, present 2437: GPU no ranges; recorded by Graphics.Draw (draw committer) 5.9, Graphics.Draw.draw_and_resource_release (draw committer) 5.1, Resources.Prepare (draw committer) 1.4, Resources.Complete (draw committer) 0.3
  • batch 8583: 17.6 ms at 13167 ms, present 2454: GPU no ranges; recorded by Graphics.Draw (draw committer) 5.4, Graphics.Draw.draw_and_resource_release (draw committer) 4.7, Resources.Prepare (draw committer) 1.3, Resources.Complete (draw committer) 0.2
  • batch 9818: 17.6 ms at 15060 ms, present 2463: GPU no ranges; recorded by Graphics.Draw (draw committer) 5.4, Graphics.Draw.draw_and_resource_release (draw committer) 4.7, Resources.Prepare (draw committer) 1.3, Resources.Complete (draw committer) 0.2
`tools/trace_digest.py`: `main` c85dcfd005, second run

seconds 150:30 from present 2279: 92 presents, frame p50 328.6 / p90 333.6 / p99 376.2 / max 376.2 ms, GPU busy 35.2 ms per present
NVIDIA GeForce RTX 2080 SUPER, NVIDIA 621.14, Windows 10.0.26300, 3840x2160, commit c85dcfd005, dropped: no

{"commit":"c85dcfd0056e","dirty":false,"env":{"APS5_DRAW_PIPELINE":"1","APS5_TRACE_DIR":"<path>","APS5_TRACE_EVENTS":"4194304","APS5_TRACE_SECONDS":"150:30"},"gpu":"NVIDIA GeForce RTX 2080 SUPER","driver":"NVIDIA 621.14","os":"Windows 10.0.26300","cpu":"Intel(R) Core(TM) i7-9700K CPU @ 3.60GHz","cpu_threads":8,"memory_mib":16318,"title_id":"PPSA17423","title":"Expeditions: A Mudrunner Game","content_version":"01.026.000","resolution":"3840x2160","window":{"spec":"seconds 150:30","first_present":2279,"ms":30309.798},"presents":92,"frame_ms":{"p50":328.579,"p90":333.612,"p99":376.204,"max":376.204},"gpu_busy_ms_per_present":35.226,"worker_busy_pct":{"queue worker 0x0":97.717},"top_phases_ms_per_frame":{"Driver.Packet":321.512,"Driver.Packet.draw":287.553,"Driver.Draw":284.666,"Driver.Draw.prepare":225.62,"Graphics.Draw":212.919,"Driver.DrawFinish":169.29,"Graphics.Draw.draw_and_resource_release":164.079,"Driver.DrawFinish.shader_compile_and_link":117.173},"owned_draw_counts":{},"trace_dropped":false,"trace":"aps5-trace-c85dcfd0056e-32228.json.gz"}

Slowest frames (largest slices inside each, inclusive)

  • present 2289: 376.2 ms at 3274 ms: Driver.Packet (queue worker 0x0) 346.9, Driver.Packet.draw (queue worker 0x0) 332.0, Driver.Draw (queue worker 0x0) 328.9, Driver.Draw.prepare (queue worker 0x0) 270.4
  • present 2366: 346.7 ms at 28655 ms: Driver.Packet (queue worker 0x0) 317.8, Driver.Packet.draw (queue worker 0x0) 287.3, Driver.Draw (queue worker 0x0) 284.4, Graphics.Draw (draw committer) 232.7
  • present 2312: 341.2 ms at 10855 ms: Driver.Packet (queue worker 0x0) 312.3, Driver.Packet.draw (queue worker 0x0) 297.2, Driver.Draw (queue worker 0x0) 294.2, Driver.Draw.prepare (queue worker 0x0) 224.4
  • present 2362: 337.8 ms at 27334 ms: Driver.Packet (queue worker 0x0) 308.6, Driver.Packet.draw (queue worker 0x0) 293.0, Driver.Draw (queue worker 0x0) 290.0, Driver.Draw.prepare (queue worker 0x0) 230.0
  • present 2319: 336.6 ms at 13173 ms: Driver.Packet (queue worker 0x0) 307.6, Driver.Packet.draw (queue worker 0x0) 293.8, Driver.Draw (queue worker 0x0) 290.9, Driver.Draw.prepare (queue worker 0x0) 232.6

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

  • present 2289: 376.2 ms at 3274 ms, persistence 54.0 ms
  • present 2366: 346.7 ms at 28655 ms, persistence 24.5 ms
  • present 2312: 341.2 ms at 10855 ms, persistence 16.3 ms
  • present 2362: 337.8 ms at 27334 ms, persistence 11.9 ms
  • present 2345: 336.1 ms at 21734 ms, persistence 11.0 ms
  • present 2319: 336.6 ms at 13173 ms, persistence 10.6 ms
  • present 2293: 333.1 ms at 4623 ms, persistence 9.4 ms
  • present 2328: 334.9 ms at 16136 ms, persistence 9.1 ms
  • present 2334: 333.7 ms at 18112 ms, persistence 7.6 ms
  • present 2279: 331.6 ms at 0 ms, persistence 6.8 ms

Threads (ms per frame)

thread busy wait untraced in slices < 20 us largest
title 0.1 (0 %) 2.0 (1 %) 327.3 1.3 Shader.ResolveGraphicsStagesAbi 0.1, Shader.ResolveGraphicsAbi 0.0
queue worker 0x0 300.8 (91 %) 0.0 (0 %) 28.6 102.0 Driver.Packet 300.4, Driver.EndSubmission 0.4
draw committer 218.3 (66 %) 0.2 (0 %) 110.9 83.5 Graphics.Draw 210.8, Recorder.Submit 6.3
draw finisher 158.8 (48 %) 0.0 (0 %) 170.7 259.9 Driver.DrawFinish 158.8
presenter 0.7 (0 %) 1.6 (0 %) 327.2 0.1 VideoOut.Flip 2.3, Driver.Present 0.0
title 0.1 (0 %) 0.0 (0 %) 329.4 0.5 Shader.ResolveGraphicsStagesAbi 0.0, Shader.ResolveGraphicsAbi 0.0
title 0.1 (0 %) 0.0 (0 %) 329.4 0.5 Shader.ResolveGraphicsStagesAbi 0.0, Shader.ResolveAbi 0.0
title 0.1 (0 %) 0.0 (0 %) 329.3 0.5 Shader.ResolveGraphicsStagesAbi 0.1, Shader.ResolveAbi 0.0
title 0.1 (0 %) 0.0 (0 %) 329.4 0.5 Shader.ResolveGraphicsStagesAbi 0.0, Shader.ResolveAbi 0.0
title 0.1 (0 %) 0.0 (0 %) 329.3 0.5 Shader.ResolveGraphicsStagesAbi 0.0, Shader.ResolveGraphicsAbi 0.0
gpu 35.2 (11 %) 0.0 (0 %) 294.3 0.0 batch 35.2

Largest slices (ms per frame, inclusive, all threads): Driver.Packet 300.4, Driver.Packet.draw 286.0, Driver.Draw 283.0, Driver.Draw.prepare 224.2, Graphics.Draw 210.8, Driver.DrawFinish 158.8, Graphics.Draw.draw_and_resource_release 129.0, Driver.DrawFinish.shader_compile_and_link 101.4, batch 35.2, Shader.DrawStage 17.8

Longest waits

  • Recorder.WaitSerial (title) 2.2 ms at 25035 ms, present 2355
  • Recorder.WaitSerial (title) 2.1 ms at 6259 ms, present 2298
  • Recorder.WaitSerial (title) 2.1 ms at 20746 ms, present 2342
  • Recorder.WaitSerial (title) 2.1 ms at 20416 ms, present 2341
  • Recorder.WaitSerial (title) 2.1 ms at 18774 ms, present 2336
  • Recorder.WaitSerial (title) 2.1 ms at 13510 ms, present 2320
  • Recorder.WaitSerial (title) 2.1 ms at 23387 ms, present 2350
  • Recorder.WaitSerial (title) 2.1 ms at 23717 ms, present 2351
  • Recorder.WaitSerial (title) 2.1 ms at 17781 ms, present 2333
  • Recorder.WaitSerial (title) 2.1 ms at 1969 ms, present 2285

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

  • batch 2867: 5.6 ms at 6440 ms, present 2298: GPU no ranges; recorded by Graphics.Draw (draw committer) 3.0, Graphics.Draw.draw_and_resource_release (draw committer) 2.5, Recorder.Submit (draw committer) 0.1
  • batch 5773: 5.5 ms at 13026 ms, present 2318: GPU no ranges; recorded by Graphics.Draw (draw committer) 3.0, Graphics.Draw.draw_and_resource_release (draw committer) 2.5, Recorder.Submit (draw committer) 0.1
  • batch 12593: 5.4 ms at 28510 ms, present 2365: GPU no ranges; recorded by Graphics.Draw (draw committer) 3.1, Graphics.Draw.draw_and_resource_release (draw committer) 2.5, Recorder.Submit (draw committer) 0.1
  • batch 954: 5.4 ms at 2149 ms, present 2285: GPU no ranges; recorded by Graphics.Draw (draw committer) 2.9, Graphics.Draw.draw_and_resource_release (draw committer) 2.4, Recorder.Submit (draw committer) 0.1
  • batch 3299: 5.4 ms at 7418 ms, present 2301: GPU no ranges; recorded by Graphics.Draw (draw committer) 3.0, Graphics.Draw.draw_and_resource_release (draw committer) 2.5, Recorder.Submit (draw committer) 0.0

Set 2, taken a day earlier on main 7a245b32c7. Commit 7d9a9d042264 is this same commit on that base: git range-diff 7a245b32c7b0..7d9a9d042264 c85dcfd0056e..707a76b12028 reports the patch as unchanged, apart from the commit message trailer.

presents in 30 s frame p50 (ms) frame p99 (ms) trace
main, first run 92 326.1 335.9 7a245b32c7b0-24808
the change, first run 160 187.5 200.3 7d9a9d042264-29040
the change, second run 161 186.1 197.6 7d9a9d042264-32548
main, second run 90 332.1 371.0 7a245b32c7b0-30448

Summary lines of set 2:

{"commit":"7a245b32c7b0","dirty":false,"env":{"APS5_DRAW_PIPELINE":"1","APS5_TRACE_DIR":"<path>","APS5_TRACE_EVENTS":"4194304","APS5_TRACE_SECONDS":"150:30"},"gpu":"NVIDIA GeForce RTX 2080 SUPER","driver":"NVIDIA 621.14","os":"Windows 10.0.26300","cpu":"Intel(R) Core(TM) i7-9700K CPU @ 3.60GHz","cpu_threads":8,"memory_mib":16318,"title_id":"PPSA17423","title":"Expeditions: A Mudrunner Game","content_version":"01.026.000","resolution":"3840x2160","window":{"spec":"seconds 150:30","first_present":2610,"ms":30036.757},"presents":92,"frame_ms":{"p50":326.066,"p90":329.558,"p99":335.904,"max":335.904},"gpu_busy_ms_per_present":57.451,"worker_busy_pct":{"queue worker 0x0":97.496},"top_phases_ms_per_frame":{"Driver.Packet":317.903,"Driver.Packet.draw":282.368,"Driver.Draw":279.313,"Driver.Draw.prepare":220.539,"Graphics.Draw":176.518,"Driver.DrawFinish":171.047,"Graphics.Draw.draw_and_resource_release":126.612,"Driver.DrawFinish.shader_compile_and_link":117.085},"owned_draw_counts":{},"trace_dropped":false,"trace":"aps5-trace-7a245b32c7b0-24808.json.gz"}
{"commit":"7d9a9d042264","dirty":false,"env":{"APS5_DRAW_PIPELINE":"1","APS5_TRACE_DIR":"<path>","APS5_TRACE_EVENTS":"4194304","APS5_TRACE_SECONDS":"150:30"},"gpu":"NVIDIA GeForce RTX 2080 SUPER","driver":"NVIDIA 621.14","os":"Windows 10.0.26300","cpu":"Intel(R) Core(TM) i7-9700K CPU @ 3.60GHz","cpu_threads":8,"memory_mib":16318,"title_id":"PPSA17423","title":"Expeditions: A Mudrunner Game","content_version":"01.026.000","resolution":"3840x2160","window":{"spec":"seconds 150:30","first_present":2487,"ms":30114.163},"presents":160,"frame_ms":{"p50":187.504,"p90":191.526,"p99":200.310,"max":219.659},"gpu_busy_ms_per_present":35.245,"worker_busy_pct":{"queue worker 0x0":95.854},"top_phases_ms_per_frame":{"Driver.Packet":179.628,"Graphics.Draw":160.630,"Driver.DrawFinish":154.185,"Graphics.Draw.draw_and_resource_release":125.691,"Driver.Packet.draw":111.122,"Driver.Draw":108.780,"Driver.DrawFinish.shader_compile_and_link":88.680,"Shader.DrawStage":81.873},"owned_draw_counts":{},"trace_dropped":false,"trace":"aps5-trace-7d9a9d042264-29040.json.gz"}
{"commit":"7d9a9d042264","dirty":false,"env":{"APS5_DRAW_PIPELINE":"1","APS5_TRACE_DIR":"<path>","APS5_TRACE_EVENTS":"4194304","APS5_TRACE_SECONDS":"150:30"},"gpu":"NVIDIA GeForce RTX 2080 SUPER","driver":"NVIDIA 621.14","os":"Windows 10.0.26300","cpu":"Intel(R) Core(TM) i7-9700K CPU @ 3.60GHz","cpu_threads":8,"memory_mib":16318,"title_id":"PPSA17423","title":"Expeditions: A Mudrunner Game","content_version":"01.026.000","resolution":"3840x2160","window":{"spec":"seconds 150:30","first_present":2472,"ms":30131.850},"presents":161,"frame_ms":{"p50":186.103,"p90":192.178,"p99":197.594,"max":212.211},"gpu_busy_ms_per_present":35.466,"worker_busy_pct":{"queue worker 0x0":95.773},"top_phases_ms_per_frame":{"Driver.Packet":178.463,"Graphics.Draw":159.914,"Driver.DrawFinish":152.933,"Graphics.Draw.draw_and_resource_release":125.111,"Driver.Packet.draw":112.109,"Driver.Draw":109.742,"Driver.DrawFinish.shader_compile_and_link":88.159,"Driver.Draw.draw_handed_off":82.526},"owned_draw_counts":{},"trace_dropped":false,"trace":"aps5-trace-7d9a9d042264-32548.json.gz"}
{"commit":"7a245b32c7b0","dirty":false,"env":{"APS5_DRAW_PIPELINE":"1","APS5_TRACE_DIR":"<path>","APS5_TRACE_EVENTS":"4194304","APS5_TRACE_SECONDS":"150:30"},"gpu":"NVIDIA GeForce RTX 2080 SUPER","driver":"NVIDIA 621.14","os":"Windows 10.0.26300","cpu":"Intel(R) Core(TM) i7-9700K CPU @ 3.60GHz","cpu_threads":8,"memory_mib":16318,"title_id":"PPSA17423","title":"Expeditions: A Mudrunner Game","content_version":"01.026.000","resolution":"3840x2160","window":{"spec":"seconds 150:30","first_present":2210,"ms":30122.864},"presents":90,"frame_ms":{"p50":332.058,"p90":342.253,"p99":371.022,"max":371.022},"gpu_busy_ms_per_present":35.946,"worker_busy_pct":{"queue worker 0x0":97.548},"top_phases_ms_per_frame":{"Driver.Packet":326.075,"Driver.Packet.draw":290.731,"Driver.Draw":287.734,"Driver.Draw.prepare":226.961,"Graphics.Draw":195.288,"Driver.DrawFinish":174.554,"Graphics.Draw.draw_and_resource_release":144.691,"Driver.DrawFinish.shader_compile_and_link":118.549},"owned_draw_counts":{},"trace_dropped":false,"trace":"aps5-trace-7a245b32c7b0-30448.json.gz"}

The digests of set 2 are in the reply to the review below.

After this change the queue worker and the committer limit this title, not the finisher drain.

Checklist

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

🤖 Generated with Claude Code

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5271962806 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/18757). Originally posted by [virgit-1](https://github.com/virgit-1) on 2026-11-12T05:15:28Z. --- ### What With the draw finisher (`APS5_DRAW_PIPELINE`, #6946), a title whose draws move their user-data pointers every frame finishes almost every draw on the worker anyway, and runs slower than without the finisher. The relocation of #4943 learns which user words of a shader set are relocatable from the entry a missed draw inserts. A miss left one pending relocation (`drawRelocationPending`), and the next draw's lookup learned it from the inserted entry. With the finisher, the insert happens on the finisher thread, so the worker drained the finisher before every lookup that followed such a miss (`Draw.cpp`, `if (DrawFinisher::Busy() && drawRelocationPending.key != 0) DrawFinisher::Get().Drain();`). In Expeditions: A MudRunner Game (PPSA17423), on an earlier local base, 316,470 of 350,000 draws drained the finisher there, and the queue worker spent 61% of its samples in `DrawFinisher::Drain`. - The pending relocations are kept per draw key (`drawRelocationsPending`, bounded at 1024 entries and cleared past that). - `insertDrawEntry` learns the pending relocation of the key it inserts, under the draw cache mutex, on whichever thread inserts. - `admitDrawKey` reads the pending relocation of its own key instead of the single slot, which another miss could have overwritten in the meantime. - The worker no longer drains the finisher before a lookup, and no longer learns at lookup time. Without the finisher nothing changes in what is learned. The learning only moves from the next draw's lookup to the insert itself, which happens earlier. `agc_driver_draw_cache_relocation_finisher` teaches a relocation with four draws, then submits one packet: a draw whose data differs, so it misses and leaves a pending relocation, followed by two draws whose data moved. A capture-check hook holds the finisher on the first draw until the worker has looked up the next one, for at most 2 s. On `main`, the worker drains the finisher first and the test fails with "the worker waited for the draw finisher to finish a missed draw before it looked up the next draw of the packet". With this change, both moved draws are looked up behind the held draw and hit the cache through the relocation. ### Related - #6946 (merged): introduced the draw finisher and this drain. The relocation is still learned under the draw cache mutex, from the entry that was inserted. The worker only stops waiting for that insert. - #4943 (merged): the relocation and its learn-at-next-lookup step. What is learned (`learnPendingRelocation`) is unchanged; only its trigger moves. - #15456 (open): turns the finisher on by default. On a title that relocates heavily the default regresses without this change. Independent, no shared line; this PR should land before or together with it. - #15455, #17024 (open): other finisher fixes in `Draw.cpp`, on different lines (finish job, recapture). - #10678 (open): builds the resource-cache key on the finisher. It only helps when draws reach the finisher, so it complements this PR. - #17225 (open): backs off the draw cache when it does not pay off. Independent. - #18515 (open draft, "not for merge"): a profiling tracking branch that removes the same drain by passing the pending relocation to `admitDrawKey`. It is not proposed for merge; if it is split into PRs, that part and this PR implement the same thing. - #9508 (open): `tools/pr_overlap.py` reports one shared line, `Draw.cpp` L41, where both add a declaration at the top of the anonymous namespace. No shared function. - `tools/pr_overlap.py` could not compare #5609, #5925, #6188, #6804, #7508, #7642, #9387, #10193, #10359, #11435, #11436, #13928, #13929, #15136 because they conflict with `main`. Their diffs were read by hand: #5609 and #6188 touch `drawRelocationPending` as it is on their old base (the code #4943 merged since); none of the others touches the pending relocation or the drain. ### Tested Windows 11 Pro 10.0.26300, MinGW-w64 GCC 15.2.0 (WinLibs), Release, NVIDIA GeForce RTX 2080 SUPER, driver 621.14, Intel i7-9700K. Tests, on `main` c85dcfd0056e and on this branch, same machine and GPU, with `VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation`, `ANYPS5_NO_SHADER_CACHE=1`, `ANYPS5_REQUIRE_VULKAN=1`, `ctest -V -R agc_driver_draw_cache_relocation`: | | tests | `was not found but was requested` | `VUID-` | |---|---|---|---| | `main` | 6 of 6 pass | 0 | 0 | | this PR | 7 of 7 pass (the 6 above and the new `_finisher`) | 0 | 0 | The new test fails without the source change, with the message quoted above. `tools/check_conventions.py` reports no finding on the branch. Performance: PPSA17423 01.026.000, title screen, 3840x2160, `APS5_DRAW_PIPELINE=1`, `ANYPS5_PRESENT_MODE=mailbox`, `APS5_TRACE_SECONDS=150:30`. Each set was run in the order `main`, PR, PR, `main`, with one discarded 80 s launch before each change of build. Set 1, the head of this PR (707a76b12028) against its base (`main` c85dcfd0056e): | | presents in 30 s | frame p50 (ms) | frame p99 (ms) | trace | |---|---|---|---|---| | `main`, first run | 91 | 330.3 | 342.1 | [c85dcfd0056e-11788](https://github.com/user-attachments/files/34731460/aps5-trace-c85dcfd0056e-11788.json.gz) | | this PR, first run | 151 | 198.3 | 221.1 | [707a76b12028-25572](https://github.com/user-attachments/files/34731462/aps5-trace-707a76b12028-25572.json.gz) | | this PR, second run | 143 | 210.4 | 225.1 | [707a76b12028-30668](https://github.com/user-attachments/files/34731459/aps5-trace-707a76b12028-30668.json.gz) | | `main`, second run | 92 | 328.6 | 376.2 | [c85dcfd0056e-32228](https://github.com/user-attachments/files/34731461/aps5-trace-c85dcfd0056e-32228.json.gz) | `tools/performance_compare.py` on the first pair: `Driver.Packet.draw` 289.4 to 125.0 ms per frame; `Driver.Draw.prepare` is 227.1 ms per frame on `main` and is not among the reported phases with the change. Summary lines of set 1: ```json {"commit":"c85dcfd0056e","dirty":false,"env":{"APS5_DRAW_PIPELINE":"1","APS5_TRACE_DIR":"<path>","APS5_TRACE_EVENTS":"4194304","APS5_TRACE_SECONDS":"150:30"},"gpu":"NVIDIA GeForce RTX 2080 SUPER","driver":"NVIDIA 621.14","os":"Windows 10.0.26300","cpu":"Intel(R) Core(TM) i7-9700K CPU @ 3.60GHz","cpu_threads":8,"memory_mib":16318,"title_id":"PPSA17423","title":"Expeditions: A Mudrunner Game","content_version":"01.026.000","resolution":"3840x2160","window":{"spec":"seconds 150:30","first_present":2219,"ms":30153.536},"presents":91,"frame_ms":{"p50":330.295,"p90":335.358,"p99":342.062,"max":342.062},"gpu_busy_ms_per_present":35.171,"worker_busy_pct":{"queue worker 0x0":97.740},"top_phases_ms_per_frame":{"Driver.Packet":323.469,"Driver.Packet.draw":289.422,"Driver.Draw":286.565,"Driver.Draw.prepare":227.072,"Graphics.Draw":213.445,"Driver.DrawFinish":170.187,"Graphics.Draw.draw_and_resource_release":164.541,"Driver.DrawFinish.shader_compile_and_link":118.042},"owned_draw_counts":{},"trace_dropped":false,"trace":"aps5-trace-c85dcfd0056e-11788.json.gz"} {"commit":"707a76b12028","dirty":false,"env":{"APS5_DRAW_PIPELINE":"1","APS5_TRACE_DIR":"<path>","APS5_TRACE_EVENTS":"4194304","APS5_TRACE_SECONDS":"150:30"},"gpu":"NVIDIA GeForce RTX 2080 SUPER","driver":"NVIDIA 621.14","os":"Windows 10.0.26300","cpu":"Intel(R) Core(TM) i7-9700K CPU @ 3.60GHz","cpu_threads":8,"memory_mib":16318,"title_id":"PPSA17423","title":"Expeditions: A Mudrunner Game","content_version":"01.026.000","resolution":"3840x2160","window":{"spec":"seconds 150:30","first_present":2480,"ms":30017.170},"presents":151,"frame_ms":{"p50":198.252,"p90":203.326,"p99":221.050,"max":231.374},"gpu_busy_ms_per_present":35.167,"worker_busy_pct":{"queue worker 0x0":95.936},"top_phases_ms_per_frame":{"Driver.Packet":189.787,"Graphics.Draw":169.240,"Driver.DrawFinish":165.539,"Graphics.Draw.draw_and_resource_release":134.358,"Driver.Packet.draw":125.031,"Driver.Draw":122.575,"Driver.Draw.draw_handed_off":94.444,"Driver.DrawFinish.shader_compile_and_link":94.000},"owned_draw_counts":{},"trace_dropped":false,"trace":"aps5-trace-707a76b12028-25572.json.gz"} {"commit":"707a76b12028","dirty":false,"env":{"APS5_DRAW_PIPELINE":"1","APS5_TRACE_DIR":"<path>","APS5_TRACE_EVENTS":"4194304","APS5_TRACE_SECONDS":"150:30"},"gpu":"NVIDIA GeForce RTX 2080 SUPER","driver":"NVIDIA 621.14","os":"Windows 10.0.26300","cpu":"Intel(R) Core(TM) i7-9700K CPU @ 3.60GHz","cpu_threads":8,"memory_mib":16318,"title_id":"PPSA17423","title":"Expeditions: A Mudrunner Game","content_version":"01.026.000","resolution":"3840x2160","window":{"spec":"seconds 150:30","first_present":2392,"ms":30195.071},"presents":143,"frame_ms":{"p50":210.426,"p90":216.949,"p99":225.128,"max":226.676},"gpu_busy_ms_per_present":58.657,"worker_busy_pct":{"queue worker 0x0":96.190},"top_phases_ms_per_frame":{"Driver.Packet":202.135,"Graphics.Draw":180.700,"Driver.DrawFinish":178.005,"Graphics.Draw.draw_and_resource_release":145.022,"Driver.Packet.draw":133.824,"Driver.Draw":131.457,"Driver.Draw.draw_handed_off":103.158,"Driver.DrawFinish.shader_compile_and_link":94.586},"owned_draw_counts":{},"trace_dropped":false,"trace":"aps5-trace-707a76b12028-30668.json.gz"} {"commit":"c85dcfd0056e","dirty":false,"env":{"APS5_DRAW_PIPELINE":"1","APS5_TRACE_DIR":"<path>","APS5_TRACE_EVENTS":"4194304","APS5_TRACE_SECONDS":"150:30"},"gpu":"NVIDIA GeForce RTX 2080 SUPER","driver":"NVIDIA 621.14","os":"Windows 10.0.26300","cpu":"Intel(R) Core(TM) i7-9700K CPU @ 3.60GHz","cpu_threads":8,"memory_mib":16318,"title_id":"PPSA17423","title":"Expeditions: A Mudrunner Game","content_version":"01.026.000","resolution":"3840x2160","window":{"spec":"seconds 150:30","first_present":2279,"ms":30309.798},"presents":92,"frame_ms":{"p50":328.579,"p90":333.612,"p99":376.204,"max":376.204},"gpu_busy_ms_per_present":35.226,"worker_busy_pct":{"queue worker 0x0":97.717},"top_phases_ms_per_frame":{"Driver.Packet":321.512,"Driver.Packet.draw":287.553,"Driver.Draw":284.666,"Driver.Draw.prepare":225.620,"Graphics.Draw":212.919,"Driver.DrawFinish":169.290,"Graphics.Draw.draw_and_resource_release":164.079,"Driver.DrawFinish.shader_compile_and_link":117.173},"owned_draw_counts":{},"trace_dropped":false,"trace":"aps5-trace-c85dcfd0056e-32228.json.gz"} ``` <details> <summary>`tools/trace_digest.py`: `main` c85dcfd0056e, first run</summary> **seconds 150:30** from present 2219: 91 presents, frame p50 330.3 / p90 335.4 / p99 342.1 / max 342.1 ms, GPU busy 35.2 ms per present NVIDIA GeForce RTX 2080 SUPER, NVIDIA 621.14, Windows 10.0.26300, 3840x2160, commit c85dcfd0056e, dropped: no ```json {"commit":"c85dcfd0056e","dirty":false,"env":{"APS5_DRAW_PIPELINE":"1","APS5_TRACE_DIR":"<path>","APS5_TRACE_EVENTS":"4194304","APS5_TRACE_SECONDS":"150:30"},"gpu":"NVIDIA GeForce RTX 2080 SUPER","driver":"NVIDIA 621.14","os":"Windows 10.0.26300","cpu":"Intel(R) Core(TM) i7-9700K CPU @ 3.60GHz","cpu_threads":8,"memory_mib":16318,"title_id":"PPSA17423","title":"Expeditions: A Mudrunner Game","content_version":"01.026.000","resolution":"3840x2160","window":{"spec":"seconds 150:30","first_present":2219,"ms":30153.536},"presents":91,"frame_ms":{"p50":330.295,"p90":335.358,"p99":342.062,"max":342.062},"gpu_busy_ms_per_present":35.171,"worker_busy_pct":{"queue worker 0x0":97.74},"top_phases_ms_per_frame":{"Driver.Packet":323.469,"Driver.Packet.draw":289.422,"Driver.Draw":286.565,"Driver.Draw.prepare":227.072,"Graphics.Draw":213.445,"Driver.DrawFinish":170.187,"Graphics.Draw.draw_and_resource_release":164.541,"Driver.DrawFinish.shader_compile_and_link":118.042},"owned_draw_counts":{},"trace_dropped":false,"trace":"aps5-trace-c85dcfd0056e-11788.json.gz"} ``` **Slowest frames** (largest slices inside each, inclusive) - present 2287: 342.1 ms at 22517 ms: Driver.Packet (queue worker 0x0) 312.8, Driver.Packet.draw (queue worker 0x0) 297.4, Driver.Draw (queue worker 0x0) 294.5, Driver.Draw.prepare (queue worker 0x0) 234.3 - present 2240: 339.6 ms at 6934 ms: Driver.Packet (queue worker 0x0) 310.9, Driver.Packet.draw (queue worker 0x0) 295.9, Driver.Draw (queue worker 0x0) 293.0, Driver.Draw.prepare (queue worker 0x0) 232.9 - present 2241: 339.3 ms at 7274 ms: Driver.Packet (queue worker 0x0) 310.3, Driver.Packet.draw (queue worker 0x0) 294.8, Driver.Draw (queue worker 0x0) 291.9, Driver.Draw.prepare (queue worker 0x0) 231.9 - present 2266: 339.3 ms at 15565 ms: Driver.Packet (queue worker 0x0) 310.5, Driver.Packet.draw (queue worker 0x0) 296.5, Driver.Draw (queue worker 0x0) 293.6, Driver.Draw.prepare (queue worker 0x0) 234.4 - present 2267: 338.0 ms at 15904 ms: Driver.Packet (queue worker 0x0) 309.0, Driver.Packet.draw (queue worker 0x0) 294.5, Driver.Draw (queue worker 0x0) 291.6, Driver.Draw.prepare (queue worker 0x0) 231.9 **Persistent spikes** (frame time above the fastest frame that separates it from a longer frame; one entry per stall, not per frame) - present 2287: 342.1 ms at 22517 ms, persistence 15.4 ms - present 2240: 339.6 ms at 6934 ms, persistence 13.0 ms - present 2266: 339.3 ms at 15565 ms, persistence 11.2 ms - present 2254: 337.8 ms at 11583 ms, persistence 9.2 ms - present 2274: 336.0 ms at 18223 ms, persistence 8.3 ms - present 2280: 335.4 ms at 20204 ms, persistence 7.4 ms - present 2299: 336.6 ms at 26512 ms, persistence 7.0 ms - present 2292: 336.8 ms at 24185 ms, persistence 6.7 ms - present 2221: 333.6 ms at 661 ms, persistence 6.4 ms - present 2260: 335.3 ms at 13577 ms, persistence 5.9 ms **Threads** (ms per frame) | thread | busy | wait | untraced | in slices < 20 us | largest | |---|---|---|---|---|---| | title | 0.1 (0 %) | 2.0 (1 %) | 329.2 | 1.3 | Shader.ResolveGraphicsStagesAbi 0.1, Shader.ResolveAbi 0.0 | | queue worker 0x0 | 302.8 (91 %) | 0.0 (0 %) | 28.5 | 102.1 | Driver.Packet 302.5, Driver.EndSubmission 0.4 | | draw committer | 218.2 (66 %) | 0.2 (0 %) | 113.0 | 83.4 | Graphics.Draw 211.4, Recorder.Submit 5.6 | | draw finisher | 159.7 (48 %) | 0.0 (0 %) | 171.6 | 259.6 | Driver.DrawFinish 159.7 | | presenter | 0.7 (0 %) | 1.6 (0 %) | 329.1 | 0.1 | VideoOut.Flip 2.2, Driver.Present 0.0 | | title | 0.1 (0 %) | 0.0 (0 %) | 331.3 | 0.5 | Shader.ResolveGraphicsStagesAbi 0.0, Shader.ResolveAbi 0.0 | | title | 0.1 (0 %) | 0.0 (0 %) | 331.3 | 0.5 | Shader.ResolveGraphicsStagesAbi 0.0, Shader.ResolveGraphicsAbi 0.0 | | title | 0.1 (0 %) | 0.0 (0 %) | 331.3 | 0.5 | Shader.ResolveGraphicsStagesAbi 0.0, Shader.ResolveGraphicsAbi 0.0 | | title | 0.1 (0 %) | 0.0 (0 %) | 331.3 | 0.5 | Shader.ResolveGraphicsStagesAbi 0.0, Shader.ResolveAbi 0.0 | | title | 0.1 (0 %) | 0.0 (0 %) | 331.2 | 0.4 | Shader.ResolveGraphicsStagesAbi 0.1, Shader.ResolveAbi 0.0 | | gpu | 35.1 (11 %) | 0.0 (0 %) | 296.2 | 0.0 | batch 35.1 | **Largest slices** (ms per frame, inclusive, all threads): Driver.Packet 302.5, Driver.Packet.draw 288.0, Driver.Draw 285.1, Driver.Draw.prepare 225.7, Graphics.Draw 211.4, Driver.DrawFinish 159.7, Graphics.Draw.draw_and_resource_release 129.7, Driver.DrawFinish.shader_compile_and_link 103.4, batch 35.1, Shader.DrawStage 18.6 **Longest waits** - Recorder.WaitSerial (title) 2.1 ms at 1325 ms, present 2223 - Recorder.WaitSerial (title) 2.1 ms at 12581 ms, present 2257 - Recorder.WaitSerial (title) 2.1 ms at 21530 ms, present 2284 - Recorder.WaitSerial (title) 2.1 ms at 15234 ms, present 2265 - Recorder.WaitSerial (title) 2.1 ms at 25847 ms, present 2297 - Recorder.WaitSerial (title) 2.1 ms at 15904 ms, present 2267 - Recorder.WaitSerial (title) 2.1 ms at 331 ms, present 2220 - Recorder.WaitSerial (title) 2.1 ms at 17560 ms, present 2272 - Recorder.WaitSerial (title) 2.1 ms at 22188 ms, present 2286 - Recorder.WaitSerial (title) 2.1 ms at 21858 ms, present 2285 **Largest GPU batches** (GPU ranges inside, and the CPU slices that recorded each, inclusive) - batch 5387: 5.7 ms at 12435 ms, present 2256: GPU no ranges; recorded by Graphics.Draw (draw committer) 2.6, Graphics.Draw.draw_and_resource_release (draw committer) 2.2, Recorder.Submit (draw committer) 0.0 - batch 5245: 5.7 ms at 12105 ms, present 2255: GPU no ranges; recorded by Graphics.Draw (draw committer) 2.5, Graphics.Draw.draw_and_resource_release (draw committer) 2.1, Recorder.Submit (draw committer) 0.0 - batch 2092: 5.7 ms at 4817 ms, present 2233: GPU no ranges; recorded by Graphics.Draw (draw committer) 2.5, Graphics.Draw.draw_and_resource_release (draw committer) 2.1, Recorder.Submit (draw committer) 0.0 - batch 6388: 5.7 ms at 14761 ms, present 2263: GPU no ranges; recorded by Graphics.Draw (draw committer) 2.6, Graphics.Draw.draw_and_resource_release (draw committer) 2.2, Recorder.Submit (draw committer) 0.0 - batch 9691: 5.7 ms at 22373 ms, present 2286: GPU no ranges; recorded by Graphics.Draw (draw committer) 2.7, Graphics.Draw.draw_and_resource_release (draw committer) 2.2, Recorder.Submit (draw committer) 0.0 </details> <details> <summary>`tools/trace_digest.py`: this PR 707a76b12028, first run</summary> **seconds 150:30** from present 2480: 151 presents, frame p50 198.3 / p90 203.3 / p99 221.1 / max 231.4 ms, GPU busy 35.2 ms per present NVIDIA GeForce RTX 2080 SUPER, NVIDIA 621.14, Windows 10.0.26300, 3840x2160, commit 707a76b12028, dropped: no ```json {"commit":"707a76b12028","dirty":false,"env":{"APS5_DRAW_PIPELINE":"1","APS5_TRACE_DIR":"<path>","APS5_TRACE_EVENTS":"4194304","APS5_TRACE_SECONDS":"150:30"},"gpu":"NVIDIA GeForce RTX 2080 SUPER","driver":"NVIDIA 621.14","os":"Windows 10.0.26300","cpu":"Intel(R) Core(TM) i7-9700K CPU @ 3.60GHz","cpu_threads":8,"memory_mib":16318,"title_id":"PPSA17423","title":"Expeditions: A Mudrunner Game","content_version":"01.026.000","resolution":"3840x2160","window":{"spec":"seconds 150:30","first_present":2480,"ms":30017.17},"presents":151,"frame_ms":{"p50":198.252,"p90":203.326,"p99":221.05,"max":231.374},"gpu_busy_ms_per_present":35.167,"worker_busy_pct":{"queue worker 0x0":95.936},"top_phases_ms_per_frame":{"Driver.Packet":189.787,"Graphics.Draw":169.24,"Driver.DrawFinish":165.539,"Graphics.Draw.draw_and_resource_release":134.358,"Driver.Packet.draw":125.031,"Driver.Draw":122.575,"Driver.Draw.draw_handed_off":94.444,"Driver.DrawFinish.shader_compile_and_link":94.0},"owned_draw_counts":{},"trace_dropped":false,"trace":"aps5-trace-707a76b12028-25572.json.gz"} ``` **Slowest frames** (largest slices inside each, inclusive) - present 2556: 231.4 ms at 15040 ms: Driver.Packet (queue worker 0x0) 175.7, Graphics.Draw (draw committer) 157.9, Driver.DrawFinish (draw finisher) 156.0, Graphics.Draw.draw_and_resource_release (draw committer) 121.3 - present 2601: 221.0 ms at 24003 ms: Driver.Packet (queue worker 0x0) 167.2, Graphics.Draw (draw committer) 163.6, Driver.DrawFinish (draw finisher) 160.1, Driver.Packet.draw (queue worker 0x0) 120.7 - present 2578: 207.5 ms at 19449 ms: Driver.Packet (queue worker 0x0) 152.9, Graphics.Draw (draw committer) 148.4, Driver.DrawFinish (draw finisher) 144.7, Graphics.Draw.draw_and_resource_release (draw committer) 118.8 - present 2522: 207.0 ms at 8289 ms: Driver.Packet (queue worker 0x0) 152.8, Graphics.Draw (draw committer) 147.8, Driver.DrawFinish (draw finisher) 144.6, Graphics.Draw.draw_and_resource_release (draw committer) 117.6 - present 2481: 205.3 ms at 198 ms: Driver.Packet (queue worker 0x0) 151.2, Graphics.Draw (draw committer) 147.5, Driver.DrawFinish (draw finisher) 143.6, Graphics.Draw.draw_and_resource_release (draw committer) 117.9 **Persistent spikes** (frame time above the fastest frame that separates it from a longer frame; one entry per stall, not per frame) - present 2556: 231.4 ms at 15040 ms, persistence 39.9 ms - present 2601: 221.0 ms at 24003 ms, persistence 28.2 ms - present 2522: 207.0 ms at 8289 ms, persistence 15.6 ms - present 2578: 207.5 ms at 19449 ms, persistence 14.6 ms - present 2481: 205.3 ms at 198 ms, persistence 13.2 ms - present 2623: 204.9 ms at 28401 ms, persistence 10.4 ms - present 2538: 202.6 ms at 11470 ms, persistence 9.5 ms - present 2582: 201.9 ms at 20242 ms, persistence 8.8 ms - present 2504: 202.5 ms at 4712 ms, persistence 8.7 ms - present 2619: 203.4 ms at 27598 ms, persistence 8.6 ms **Threads** (ms per frame) | thread | busy | wait | untraced | in slices < 20 us | largest | |---|---|---|---|---|---| | title | 0.2 (0 %) | 2.4 (1 %) | 196.2 | 1.3 | Shader.ResolveGraphicsStagesAbi 0.1, Shader.ResolveAbi 0.1 | | queue worker 0x0 | 144.6 (73 %) | 0.0 (0 %) | 54.2 | 163.3 | Driver.Packet 143.8, Driver.EndSubmission 0.8 | | draw committer | 147.3 (74 %) | 0.2 (0 %) | 51.3 | 83.6 | Graphics.Draw 141.0, Recorder.Submit 5.1 | | draw finisher | 138.0 (69 %) | 0.0 (0 %) | 60.8 | 239.0 | Driver.DrawFinish 138.0 | | presenter | 0.7 (0 %) | 1.8 (1 %) | 196.3 | 0.1 | VideoOut.Flip 2.4, Driver.Present 0.0 | | title | 0.1 (0 %) | 0.0 (0 %) | 198.7 | 0.5 | Shader.ResolveGraphicsStagesAbi 0.1, Shader.ResolveAbi 0.0 | | title | 0.1 (0 %) | 0.0 (0 %) | 198.7 | 0.5 | Shader.ResolveGraphicsStagesAbi 0.1, Shader.ResolveAbi 0.0 | | title | 0.1 (0 %) | 0.0 (0 %) | 198.7 | 0.5 | Shader.ResolveGraphicsStagesAbi 0.1, Shader.ResolveAbi 0.0 | | title | 0.1 (0 %) | 0.0 (0 %) | 198.7 | 0.5 | Shader.ResolveGraphicsStagesAbi 0.1, Shader.ResolveAbi 0.0 | | title | 0.1 (0 %) | 0.0 (0 %) | 198.7 | 0.5 | Shader.ResolveGraphicsStagesAbi 0.1, Shader.ResolveAbi 0.0 | | gpu | 34.9 (18 %) | 0.0 (0 %) | 163.9 | 0.0 | batch 34.9 | **Largest slices** (ms per frame, inclusive, all threads): Driver.Packet 143.8, Graphics.Draw 141.0, Driver.DrawFinish 138.0, Graphics.Draw.draw_and_resource_release 112.1, Driver.Packet.draw 97.8, Driver.Draw 95.7, Driver.Draw.draw_handed_off 74.2, Driver.DrawFinish.shader_compile_and_link 64.4, Driver.DrawFinish.draw_enqueued 44.8, Driver.Packet.execute 37.1 **Longest waits** - Recorder.WaitSerial (title) 2.3 ms at 29612 ms, present 2629 - Recorder.WaitSerial (title) 2.3 ms at 8289 ms, present 2522 - Recorder.WaitSerial (title) 2.3 ms at 403 ms, present 2482 - Recorder.WaitSerial (title) 2.3 ms at 6101 ms, present 2511 - Recorder.WaitSerial (title) 2.3 ms at 27801 ms, present 2620 - Recorder.WaitSerial (title) 2.3 ms at 29009 ms, present 2626 - Recorder.WaitSerial (title) 2.3 ms at 14638 ms, present 2554 - Recorder.WaitSerial (title) 2.3 ms at 24003 ms, present 2601 - Recorder.WaitSerial (title) 2.3 ms at 27202 ms, present 2617 - Recorder.WaitSerial (title) 2.3 ms at 11071 ms, present 2536 **Largest GPU batches** (GPU ranges inside, and the CPU slices that recorded each, inclusive) - batch 17441: 5.0 ms at 26102 ms, present 2611: GPU no ranges; recorded by Graphics.Draw (draw committer) 3.9, Graphics.Draw.draw_and_resource_release (draw committer) 3.2, Recorder.Submit (draw committer) 0.1 - batch 14269: 4.9 ms at 21330 ms, present 2587: GPU no ranges; recorded by Graphics.Draw (draw committer) 3.8, Graphics.Draw.draw_and_resource_release (draw committer) 3.1, Recorder.Submit (draw committer) 0.1 - batch 17707: 4.9 ms at 26500 ms, present 2613: GPU no ranges; recorded by Graphics.Draw (draw committer) 4.1, Graphics.Draw.draw_and_resource_release (draw committer) 3.4, Recorder.Submit (draw committer) 0.1 - batch 15454: 4.8 ms at 23103 ms, present 2596: GPU no ranges; recorded by Graphics.Draw (draw committer) 3.7, Graphics.Draw.draw_and_resource_release (draw committer) 3.0, Recorder.Submit (draw committer) 0.1 - batch 6707: 4.8 ms at 9974 ms, present 2530: GPU no ranges; recorded by Graphics.Draw (draw committer) 4.0, Graphics.Draw.draw_and_resource_release (draw committer) 3.3, Recorder.Submit (draw committer) 0.1 </details> <details> <summary>`tools/trace_digest.py`: this PR 707a76b12028, second run</summary> **seconds 150:30** from present 2392: 143 presents, frame p50 210.4 / p90 216.9 / p99 225.1 / max 226.7 ms, GPU busy 58.7 ms per present NVIDIA GeForce RTX 2080 SUPER, NVIDIA 621.14, Windows 10.0.26300, 3840x2160, commit 707a76b12028, dropped: no ```json {"commit":"707a76b12028","dirty":false,"env":{"APS5_DRAW_PIPELINE":"1","APS5_TRACE_DIR":"<path>","APS5_TRACE_EVENTS":"4194304","APS5_TRACE_SECONDS":"150:30"},"gpu":"NVIDIA GeForce RTX 2080 SUPER","driver":"NVIDIA 621.14","os":"Windows 10.0.26300","cpu":"Intel(R) Core(TM) i7-9700K CPU @ 3.60GHz","cpu_threads":8,"memory_mib":16318,"title_id":"PPSA17423","title":"Expeditions: A Mudrunner Game","content_version":"01.026.000","resolution":"3840x2160","window":{"spec":"seconds 150:30","first_present":2392,"ms":30195.071},"presents":143,"frame_ms":{"p50":210.426,"p90":216.949,"p99":225.128,"max":226.676},"gpu_busy_ms_per_present":58.657,"worker_busy_pct":{"queue worker 0x0":96.19},"top_phases_ms_per_frame":{"Driver.Packet":202.135,"Graphics.Draw":180.7,"Driver.DrawFinish":178.005,"Graphics.Draw.draw_and_resource_release":145.022,"Driver.Packet.draw":133.824,"Driver.Draw":131.457,"Driver.Draw.draw_handed_off":103.158,"Driver.DrawFinish.shader_compile_and_link":94.586},"owned_draw_counts":{},"trace_dropped":false,"trace":"aps5-trace-707a76b12028-30668.json.gz"} ``` **Slowest frames** (largest slices inside each, inclusive) - present 2530: 226.7 ms at 29133 ms: Driver.Packet (queue worker 0x0) 171.9, Graphics.Draw (draw committer) 166.0, Driver.DrawFinish (draw finisher) 164.6, Graphics.Draw.draw_and_resource_release (draw committer) 133.9 - present 2485: 225.1 ms at 19609 ms: Driver.Packet (queue worker 0x0) 169.7, Driver.DrawFinish (draw finisher) 163.2, Graphics.Draw (draw committer) 152.6, Graphics.Draw.draw_and_resource_release (draw committer) 123.3 - present 2416: 224.3 ms at 5030 ms: Driver.Packet (queue worker 0x0) 168.6, Graphics.Draw (draw committer) 161.7, Driver.DrawFinish (draw finisher) 159.2, Graphics.Draw.draw_and_resource_release (draw committer) 131.4 - present 2491: 223.1 ms at 20889 ms: Driver.Packet (queue worker 0x0) 168.3, Driver.DrawFinish (draw finisher) 160.8, Graphics.Draw (draw committer) 152.1, Graphics.Draw.draw_and_resource_release (draw committer) 123.1 - present 2445: 222.5 ms at 11177 ms: Driver.Packet (queue worker 0x0) 166.2, Graphics.Draw (draw committer) 160.7, Driver.DrawFinish (draw finisher) 159.8, Graphics.Draw.draw_and_resource_release (draw committer) 129.9 **Persistent spikes** (frame time above the fastest frame that separates it from a longer frame; one entry per stall, not per frame) - present 2530: 226.7 ms at 29133 ms, persistence 22.8 ms - present 2416: 224.3 ms at 5030 ms, persistence 20.4 ms - present 2485: 225.1 ms at 19609 ms, persistence 19.5 ms - present 2491: 223.1 ms at 20889 ms, persistence 17.3 ms - present 2445: 222.5 ms at 11177 ms, persistence 16.8 ms - present 2509: 220.7 ms at 24694 ms, persistence 14.3 ms - present 2459: 217.8 ms at 14125 ms, persistence 11.9 ms - present 2411: 218.7 ms at 3977 ms, persistence 11.6 ms - present 2472: 216.9 ms at 16868 ms, persistence 10.9 ms - present 2431: 215.9 ms at 8207 ms, persistence 10.9 ms **Threads** (ms per frame) | thread | busy | wait | untraced | in slices < 20 us | largest | |---|---|---|---|---|---| | title | 0.2 (0 %) | 2.3 (1 %) | 208.7 | 1.3 | Shader.ResolveGraphicsStagesAbi 0.1, Shader.ResolveAbi 0.1 | | queue worker 0x0 | 156.7 (74 %) | 0.0 (0 %) | 54.4 | 164.4 | Driver.Packet 155.8, Driver.EndSubmission 0.9 | | draw committer | 159.7 (76 %) | 0.2 (0 %) | 51.2 | 85.6 | Graphics.Draw 152.2, Recorder.Submit 6.0 | | draw finisher | 149.6 (71 %) | 0.0 (0 %) | 61.6 | 238.5 | Driver.DrawFinish 149.6 | | presenter | 0.7 (0 %) | 1.7 (1 %) | 208.8 | 0.1 | VideoOut.Flip 2.4, Driver.Present 0.0 | | title | 0.1 (0 %) | 0.0 (0 %) | 211.0 | 0.5 | Shader.ResolveGraphicsStagesAbi 0.1, Shader.ResolveAbi 0.0 | | title | 0.1 (0 %) | 0.0 (0 %) | 211.0 | 0.5 | Shader.ResolveGraphicsStagesAbi 0.1, Shader.ResolveAbi 0.0 | | title | 0.1 (0 %) | 0.0 (0 %) | 211.1 | 0.5 | Shader.ResolveGraphicsStagesAbi 0.1, Shader.ResolveAbi 0.0 | | title | 0.1 (0 %) | 0.0 (0 %) | 211.0 | 0.5 | Shader.ResolveGraphicsStagesAbi 0.1, Shader.ResolveAbi 0.0 | | title | 0.1 (0 %) | 0.0 (0 %) | 211.0 | 0.5 | Shader.ResolveGraphicsStagesAbi 0.1, Shader.ResolveAbi 0.0 | | gpu | 58.6 (28 %) | 0.0 (0 %) | 152.5 | 0.0 | batch 58.6 | **Largest slices** (ms per frame, inclusive, all threads): Driver.Packet 155.8, Graphics.Draw 152.2, Driver.DrawFinish 149.6, Graphics.Draw.draw_and_resource_release 123.0, Driver.Packet.draw 106.4, Driver.Draw 104.3, Driver.Draw.draw_handed_off 82.6, Driver.DrawFinish.shader_compile_and_link 65.1, batch 58.6, Driver.DrawFinish.draw_enqueued 57.6 **Longest waits** - Recorder.WaitSerial (title) 2.4 ms at 19834 ms, present 2486 - Recorder.WaitSerial (title) 2.4 ms at 17713 ms, present 2476 - Recorder.WaitSerial (title) 2.3 ms at 839 ms, present 2396 - Recorder.WaitSerial (title) 2.3 ms at 29990 ms, present 2534 - Recorder.WaitSerial (title) 2.3 ms at 1260 ms, present 2398 - Recorder.WaitSerial (title) 2.3 ms at 18972 ms, present 2482 - Recorder.WaitSerial (title) 2.3 ms at 13495 ms, present 2456 - Recorder.WaitSerial (title) 2.2 ms at 14125 ms, present 2459 - Recorder.WaitSerial (title) 2.2 ms at 17291 ms, present 2474 - Recorder.WaitSerial (title) 2.2 ms at 7153 ms, present 2426 **Largest GPU batches** (GPU ranges inside, and the CPU slices that recorded each, inclusive) - batch 12833: 17.9 ms at 19718 ms, present 2485: GPU no ranges; recorded by Graphics.Draw (draw committer) 5.9, Graphics.Draw.draw_and_resource_release (draw committer) 5.1, Resources.Prepare (draw committer) 1.4, Resources.Complete (draw committer) 0.2 - batch 3921: 17.7 ms at 5992 ms, present 2420: GPU no ranges; recorded by Graphics.Draw (draw committer) 5.9, Graphics.Draw.draw_and_resource_release (draw committer) 5.1, Resources.Prepare (draw committer) 1.4, Resources.Complete (draw committer) 0.3 - batch 6246: 17.7 ms at 9564 ms, present 2437: GPU no ranges; recorded by Graphics.Draw (draw committer) 5.9, Graphics.Draw.draw_and_resource_release (draw committer) 5.1, Resources.Prepare (draw committer) 1.4, Resources.Complete (draw committer) 0.3 - batch 8583: 17.6 ms at 13167 ms, present 2454: GPU no ranges; recorded by Graphics.Draw (draw committer) 5.4, Graphics.Draw.draw_and_resource_release (draw committer) 4.7, Resources.Prepare (draw committer) 1.3, Resources.Complete (draw committer) 0.2 - batch 9818: 17.6 ms at 15060 ms, present 2463: GPU no ranges; recorded by Graphics.Draw (draw committer) 5.4, Graphics.Draw.draw_and_resource_release (draw committer) 4.7, Resources.Prepare (draw committer) 1.3, Resources.Complete (draw committer) 0.2 </details> <details> <summary>`tools/trace_digest.py`: `main` c85dcfd0056e, second run</summary> **seconds 150:30** from present 2279: 92 presents, frame p50 328.6 / p90 333.6 / p99 376.2 / max 376.2 ms, GPU busy 35.2 ms per present NVIDIA GeForce RTX 2080 SUPER, NVIDIA 621.14, Windows 10.0.26300, 3840x2160, commit c85dcfd0056e, dropped: no ```json {"commit":"c85dcfd0056e","dirty":false,"env":{"APS5_DRAW_PIPELINE":"1","APS5_TRACE_DIR":"<path>","APS5_TRACE_EVENTS":"4194304","APS5_TRACE_SECONDS":"150:30"},"gpu":"NVIDIA GeForce RTX 2080 SUPER","driver":"NVIDIA 621.14","os":"Windows 10.0.26300","cpu":"Intel(R) Core(TM) i7-9700K CPU @ 3.60GHz","cpu_threads":8,"memory_mib":16318,"title_id":"PPSA17423","title":"Expeditions: A Mudrunner Game","content_version":"01.026.000","resolution":"3840x2160","window":{"spec":"seconds 150:30","first_present":2279,"ms":30309.798},"presents":92,"frame_ms":{"p50":328.579,"p90":333.612,"p99":376.204,"max":376.204},"gpu_busy_ms_per_present":35.226,"worker_busy_pct":{"queue worker 0x0":97.717},"top_phases_ms_per_frame":{"Driver.Packet":321.512,"Driver.Packet.draw":287.553,"Driver.Draw":284.666,"Driver.Draw.prepare":225.62,"Graphics.Draw":212.919,"Driver.DrawFinish":169.29,"Graphics.Draw.draw_and_resource_release":164.079,"Driver.DrawFinish.shader_compile_and_link":117.173},"owned_draw_counts":{},"trace_dropped":false,"trace":"aps5-trace-c85dcfd0056e-32228.json.gz"} ``` **Slowest frames** (largest slices inside each, inclusive) - present 2289: 376.2 ms at 3274 ms: Driver.Packet (queue worker 0x0) 346.9, Driver.Packet.draw (queue worker 0x0) 332.0, Driver.Draw (queue worker 0x0) 328.9, Driver.Draw.prepare (queue worker 0x0) 270.4 - present 2366: 346.7 ms at 28655 ms: Driver.Packet (queue worker 0x0) 317.8, Driver.Packet.draw (queue worker 0x0) 287.3, Driver.Draw (queue worker 0x0) 284.4, Graphics.Draw (draw committer) 232.7 - present 2312: 341.2 ms at 10855 ms: Driver.Packet (queue worker 0x0) 312.3, Driver.Packet.draw (queue worker 0x0) 297.2, Driver.Draw (queue worker 0x0) 294.2, Driver.Draw.prepare (queue worker 0x0) 224.4 - present 2362: 337.8 ms at 27334 ms: Driver.Packet (queue worker 0x0) 308.6, Driver.Packet.draw (queue worker 0x0) 293.0, Driver.Draw (queue worker 0x0) 290.0, Driver.Draw.prepare (queue worker 0x0) 230.0 - present 2319: 336.6 ms at 13173 ms: Driver.Packet (queue worker 0x0) 307.6, Driver.Packet.draw (queue worker 0x0) 293.8, Driver.Draw (queue worker 0x0) 290.9, Driver.Draw.prepare (queue worker 0x0) 232.6 **Persistent spikes** (frame time above the fastest frame that separates it from a longer frame; one entry per stall, not per frame) - present 2289: 376.2 ms at 3274 ms, persistence 54.0 ms - present 2366: 346.7 ms at 28655 ms, persistence 24.5 ms - present 2312: 341.2 ms at 10855 ms, persistence 16.3 ms - present 2362: 337.8 ms at 27334 ms, persistence 11.9 ms - present 2345: 336.1 ms at 21734 ms, persistence 11.0 ms - present 2319: 336.6 ms at 13173 ms, persistence 10.6 ms - present 2293: 333.1 ms at 4623 ms, persistence 9.4 ms - present 2328: 334.9 ms at 16136 ms, persistence 9.1 ms - present 2334: 333.7 ms at 18112 ms, persistence 7.6 ms - present 2279: 331.6 ms at 0 ms, persistence 6.8 ms **Threads** (ms per frame) | thread | busy | wait | untraced | in slices < 20 us | largest | |---|---|---|---|---|---| | title | 0.1 (0 %) | 2.0 (1 %) | 327.3 | 1.3 | Shader.ResolveGraphicsStagesAbi 0.1, Shader.ResolveGraphicsAbi 0.0 | | queue worker 0x0 | 300.8 (91 %) | 0.0 (0 %) | 28.6 | 102.0 | Driver.Packet 300.4, Driver.EndSubmission 0.4 | | draw committer | 218.3 (66 %) | 0.2 (0 %) | 110.9 | 83.5 | Graphics.Draw 210.8, Recorder.Submit 6.3 | | draw finisher | 158.8 (48 %) | 0.0 (0 %) | 170.7 | 259.9 | Driver.DrawFinish 158.8 | | presenter | 0.7 (0 %) | 1.6 (0 %) | 327.2 | 0.1 | VideoOut.Flip 2.3, Driver.Present 0.0 | | title | 0.1 (0 %) | 0.0 (0 %) | 329.4 | 0.5 | Shader.ResolveGraphicsStagesAbi 0.0, Shader.ResolveGraphicsAbi 0.0 | | title | 0.1 (0 %) | 0.0 (0 %) | 329.4 | 0.5 | Shader.ResolveGraphicsStagesAbi 0.0, Shader.ResolveAbi 0.0 | | title | 0.1 (0 %) | 0.0 (0 %) | 329.3 | 0.5 | Shader.ResolveGraphicsStagesAbi 0.1, Shader.ResolveAbi 0.0 | | title | 0.1 (0 %) | 0.0 (0 %) | 329.4 | 0.5 | Shader.ResolveGraphicsStagesAbi 0.0, Shader.ResolveAbi 0.0 | | title | 0.1 (0 %) | 0.0 (0 %) | 329.3 | 0.5 | Shader.ResolveGraphicsStagesAbi 0.0, Shader.ResolveGraphicsAbi 0.0 | | gpu | 35.2 (11 %) | 0.0 (0 %) | 294.3 | 0.0 | batch 35.2 | **Largest slices** (ms per frame, inclusive, all threads): Driver.Packet 300.4, Driver.Packet.draw 286.0, Driver.Draw 283.0, Driver.Draw.prepare 224.2, Graphics.Draw 210.8, Driver.DrawFinish 158.8, Graphics.Draw.draw_and_resource_release 129.0, Driver.DrawFinish.shader_compile_and_link 101.4, batch 35.2, Shader.DrawStage 17.8 **Longest waits** - Recorder.WaitSerial (title) 2.2 ms at 25035 ms, present 2355 - Recorder.WaitSerial (title) 2.1 ms at 6259 ms, present 2298 - Recorder.WaitSerial (title) 2.1 ms at 20746 ms, present 2342 - Recorder.WaitSerial (title) 2.1 ms at 20416 ms, present 2341 - Recorder.WaitSerial (title) 2.1 ms at 18774 ms, present 2336 - Recorder.WaitSerial (title) 2.1 ms at 13510 ms, present 2320 - Recorder.WaitSerial (title) 2.1 ms at 23387 ms, present 2350 - Recorder.WaitSerial (title) 2.1 ms at 23717 ms, present 2351 - Recorder.WaitSerial (title) 2.1 ms at 17781 ms, present 2333 - Recorder.WaitSerial (title) 2.1 ms at 1969 ms, present 2285 **Largest GPU batches** (GPU ranges inside, and the CPU slices that recorded each, inclusive) - batch 2867: 5.6 ms at 6440 ms, present 2298: GPU no ranges; recorded by Graphics.Draw (draw committer) 3.0, Graphics.Draw.draw_and_resource_release (draw committer) 2.5, Recorder.Submit (draw committer) 0.1 - batch 5773: 5.5 ms at 13026 ms, present 2318: GPU no ranges; recorded by Graphics.Draw (draw committer) 3.0, Graphics.Draw.draw_and_resource_release (draw committer) 2.5, Recorder.Submit (draw committer) 0.1 - batch 12593: 5.4 ms at 28510 ms, present 2365: GPU no ranges; recorded by Graphics.Draw (draw committer) 3.1, Graphics.Draw.draw_and_resource_release (draw committer) 2.5, Recorder.Submit (draw committer) 0.1 - batch 954: 5.4 ms at 2149 ms, present 2285: GPU no ranges; recorded by Graphics.Draw (draw committer) 2.9, Graphics.Draw.draw_and_resource_release (draw committer) 2.4, Recorder.Submit (draw committer) 0.1 - batch 3299: 5.4 ms at 7418 ms, present 2301: GPU no ranges; recorded by Graphics.Draw (draw committer) 3.0, Graphics.Draw.draw_and_resource_release (draw committer) 2.5, Recorder.Submit (draw committer) 0.0 </details> Set 2, taken a day earlier on `main` 7a245b32c7b0. Commit 7d9a9d042264 is this same commit on that base: `git range-diff 7a245b32c7b0..7d9a9d042264 c85dcfd0056e..707a76b12028` reports the patch as unchanged, apart from the commit message trailer. | | presents in 30 s | frame p50 (ms) | frame p99 (ms) | trace | |---|---|---|---|---| | `main`, first run | 92 | 326.1 | 335.9 | [7a245b32c7b0-24808](https://github.com/user-attachments/files/34730291/aps5-trace-7a245b32c7b0-24808.json.gz) | | the change, first run | 160 | 187.5 | 200.3 | [7d9a9d042264-29040](https://github.com/user-attachments/files/34730323/aps5-trace-7d9a9d042264-29040.json.gz) | | the change, second run | 161 | 186.1 | 197.6 | [7d9a9d042264-32548](https://github.com/user-attachments/files/34730345/aps5-trace-7d9a9d042264-32548.json.gz) | | `main`, second run | 90 | 332.1 | 371.0 | [7a245b32c7b0-30448](https://github.com/user-attachments/files/34730308/aps5-trace-7a245b32c7b0-30448.json.gz) | Summary lines of set 2: ```json {"commit":"7a245b32c7b0","dirty":false,"env":{"APS5_DRAW_PIPELINE":"1","APS5_TRACE_DIR":"<path>","APS5_TRACE_EVENTS":"4194304","APS5_TRACE_SECONDS":"150:30"},"gpu":"NVIDIA GeForce RTX 2080 SUPER","driver":"NVIDIA 621.14","os":"Windows 10.0.26300","cpu":"Intel(R) Core(TM) i7-9700K CPU @ 3.60GHz","cpu_threads":8,"memory_mib":16318,"title_id":"PPSA17423","title":"Expeditions: A Mudrunner Game","content_version":"01.026.000","resolution":"3840x2160","window":{"spec":"seconds 150:30","first_present":2610,"ms":30036.757},"presents":92,"frame_ms":{"p50":326.066,"p90":329.558,"p99":335.904,"max":335.904},"gpu_busy_ms_per_present":57.451,"worker_busy_pct":{"queue worker 0x0":97.496},"top_phases_ms_per_frame":{"Driver.Packet":317.903,"Driver.Packet.draw":282.368,"Driver.Draw":279.313,"Driver.Draw.prepare":220.539,"Graphics.Draw":176.518,"Driver.DrawFinish":171.047,"Graphics.Draw.draw_and_resource_release":126.612,"Driver.DrawFinish.shader_compile_and_link":117.085},"owned_draw_counts":{},"trace_dropped":false,"trace":"aps5-trace-7a245b32c7b0-24808.json.gz"} {"commit":"7d9a9d042264","dirty":false,"env":{"APS5_DRAW_PIPELINE":"1","APS5_TRACE_DIR":"<path>","APS5_TRACE_EVENTS":"4194304","APS5_TRACE_SECONDS":"150:30"},"gpu":"NVIDIA GeForce RTX 2080 SUPER","driver":"NVIDIA 621.14","os":"Windows 10.0.26300","cpu":"Intel(R) Core(TM) i7-9700K CPU @ 3.60GHz","cpu_threads":8,"memory_mib":16318,"title_id":"PPSA17423","title":"Expeditions: A Mudrunner Game","content_version":"01.026.000","resolution":"3840x2160","window":{"spec":"seconds 150:30","first_present":2487,"ms":30114.163},"presents":160,"frame_ms":{"p50":187.504,"p90":191.526,"p99":200.310,"max":219.659},"gpu_busy_ms_per_present":35.245,"worker_busy_pct":{"queue worker 0x0":95.854},"top_phases_ms_per_frame":{"Driver.Packet":179.628,"Graphics.Draw":160.630,"Driver.DrawFinish":154.185,"Graphics.Draw.draw_and_resource_release":125.691,"Driver.Packet.draw":111.122,"Driver.Draw":108.780,"Driver.DrawFinish.shader_compile_and_link":88.680,"Shader.DrawStage":81.873},"owned_draw_counts":{},"trace_dropped":false,"trace":"aps5-trace-7d9a9d042264-29040.json.gz"} {"commit":"7d9a9d042264","dirty":false,"env":{"APS5_DRAW_PIPELINE":"1","APS5_TRACE_DIR":"<path>","APS5_TRACE_EVENTS":"4194304","APS5_TRACE_SECONDS":"150:30"},"gpu":"NVIDIA GeForce RTX 2080 SUPER","driver":"NVIDIA 621.14","os":"Windows 10.0.26300","cpu":"Intel(R) Core(TM) i7-9700K CPU @ 3.60GHz","cpu_threads":8,"memory_mib":16318,"title_id":"PPSA17423","title":"Expeditions: A Mudrunner Game","content_version":"01.026.000","resolution":"3840x2160","window":{"spec":"seconds 150:30","first_present":2472,"ms":30131.850},"presents":161,"frame_ms":{"p50":186.103,"p90":192.178,"p99":197.594,"max":212.211},"gpu_busy_ms_per_present":35.466,"worker_busy_pct":{"queue worker 0x0":95.773},"top_phases_ms_per_frame":{"Driver.Packet":178.463,"Graphics.Draw":159.914,"Driver.DrawFinish":152.933,"Graphics.Draw.draw_and_resource_release":125.111,"Driver.Packet.draw":112.109,"Driver.Draw":109.742,"Driver.DrawFinish.shader_compile_and_link":88.159,"Driver.Draw.draw_handed_off":82.526},"owned_draw_counts":{},"trace_dropped":false,"trace":"aps5-trace-7d9a9d042264-32548.json.gz"} {"commit":"7a245b32c7b0","dirty":false,"env":{"APS5_DRAW_PIPELINE":"1","APS5_TRACE_DIR":"<path>","APS5_TRACE_EVENTS":"4194304","APS5_TRACE_SECONDS":"150:30"},"gpu":"NVIDIA GeForce RTX 2080 SUPER","driver":"NVIDIA 621.14","os":"Windows 10.0.26300","cpu":"Intel(R) Core(TM) i7-9700K CPU @ 3.60GHz","cpu_threads":8,"memory_mib":16318,"title_id":"PPSA17423","title":"Expeditions: A Mudrunner Game","content_version":"01.026.000","resolution":"3840x2160","window":{"spec":"seconds 150:30","first_present":2210,"ms":30122.864},"presents":90,"frame_ms":{"p50":332.058,"p90":342.253,"p99":371.022,"max":371.022},"gpu_busy_ms_per_present":35.946,"worker_busy_pct":{"queue worker 0x0":97.548},"top_phases_ms_per_frame":{"Driver.Packet":326.075,"Driver.Packet.draw":290.731,"Driver.Draw":287.734,"Driver.Draw.prepare":226.961,"Graphics.Draw":195.288,"Driver.DrawFinish":174.554,"Graphics.Draw.draw_and_resource_release":144.691,"Driver.DrawFinish.shader_compile_and_link":118.549},"owned_draw_counts":{},"trace_dropped":false,"trace":"aps5-trace-7a245b32c7b0-30448.json.gz"} ``` The digests of set 2 are in the reply to the review below. After this change the queue worker and the committer limit this title, not the finisher drain. ### Checklist - [x] Based on current `main`; no other open PR implements the same functions (see #18515 under Related, a draft not proposed for merge) - [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 2080 SUPER, driver 621.14, Windows 11 Pro 10.0.26300 - [x] AI-assisted: yes 🤖 Generated with [Claude Code](https://claude.com/claude-code)
MarcZX10 commented 2026-11-12 05:25:20 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-12T05:25:20Z.

Review: DISMISSED


Reviewed — changes requested

The source change appears internally consistent, but this perf pull request is missing required, inspectable trace evidence for its performance claim.

What I ran

Reviewed head 707a76b12028a7d9f697568ea759e64cc2696a8c against current main tip 145e689adab572c44a99369516565d28e85f6c12; the no-build precheck reported the head and base unchanged and its mergeability check passed. Environment: Linux 6.1, Python 3.11.2, GCC C++ 12.2.0. I did not compile or run Vulkan tests.

python3 tools/pr_precheck.py --repo boykopovar/AnyPS5 --pr 18757 --output-dir /tmp/pr18757-precheck
git fetch https://github.com/boykopovar/AnyPS5.git refs/pull/18757/head:refs/review/18757/20261112-head
git fetch https://github.com/boykopovar/AnyPS5.git refs/heads/main:refs/review/18757/20261112-main

I also read the complete diff and relevant draw-cache, relocation, capture, test-registration, and performance-report context. The PR description's test and performance measurements are author-reported; I did not reproduce them.

Results

Check Result Note
Diff and conventions passed Exact head and base precheck passed.
Dependency and mergeability passed No blocking stack issue reported.
Test-registration heuristic passed Its warning is a false positive; the changed CMake fragment registers the test.
AGC/Vulkan tests not run No exact-head build or Vulkan run was performed here.
Performance evidence failed Required trace files and trace_digest.py output are not available on the PR.
Hosted CI not run Six required status checks were queued when refreshed.
Complete no-build precheck table and relevant raw output
Check Status Why / command
build_and_compile not_run Builds are intentionally excluded from this fast, no-build check pass.
diff_check passed git diff --check 145e689adab572c44a99369516565d28e85f6c12...707a76b12028a7d9f697568ea759e64cc2696a8c
conventions_and_pr_template passed /usr/bin/python3 tools/check_conventions.py --base 145e689adab572c44a99369516565d28e85f6c12 --head 707a76b12028a7d9f697568ea759e64cc2696a8c --title perf(agc): learn a draw's relocation when its entry is inserted --body /tmp/pr18757-precheck/pr-body.md
changed_export_abi_audit passed /usr/bin/python3 /marc/AnyPS5/tools/pr_abi_audit.py --base 145e689adab572c44a99369516565d28e85f6c12 --head 707a76b12028a7d9f697568ea759e64cc2696a8c --json
python_syntax not_applicable No changed Python implementation files.
related_python_unit_tests not_applicable No changed Python tool module has a related tools/tests/test_.py suite.
python_test_registration not_applicable No changed Python test files need registration.
live_dependency_and_mergeability_check passed /usr/bin/python3 /marc/AnyPS5/tools/pr_stack_check.py 18757 --repo boykopovar/AnyPS5 --output-dir /tmp/pr18757-precheck/stack
build_dependent_cpp_tests not_run Changed C/C++ source or test files need exact-head binaries; this fast pass does not build.
test_quality_heuristics passed /usr/bin/python3 /marc/AnyPS5/tools/pr_test_quality.py --root /tmp/pr18757-precheck/head-707a76b12028-696370ac --json core/libs/prx/libSceAgcDriver/Execution/include/Driver/Driver.hpp core/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/Draw.cpp core/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/DrawCache.cpp core/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/DrawRelocate.cpp core/libs/prx/libSceAgcDriver/tests/cmake/agc_driver_draw_cache_relocation_tests.cmake core/libs/prx/libSceAgcDriver/tests/execution/DrawCacheRelocation.cpp
negative_controls not_applicable No changed tools/ Python test module is eligible for a base-source negative control.

Unedited output from the convention check:

All conventions checks passed.

Unedited output from the stack check:

/tmp/pr18757-precheck/stack/stack-report.md
/tmp/pr18757-precheck/stack/stack-report.json

Unedited output from the test-quality heuristic:

{
  "findings": [
    {
      "path": "core/libs/prx/libSceAgcDriver/tests/execution/DrawCacheRelocation.cpp",
      "line": 1,
      "kind": "possible-unregistered-cpp-test",
      "message": "Changed C++ test source path was not found literally in CMake files; inspect registration, generated source lists, and workflow coverage."
    }
  ],
  "negative_control_candidates": [],
  "limits": [
    "Heuristics can miss weak assertions and can flag valid tests; inspect every finding.",
    "A test that passes against base is not by itself proof that the PR test is inadequate.",
    "Negative controls are only candidates until the test actually runs against base and fails by assertion rather than import/setup error."
  ]
}

The test-quality warning was manually checked against the changed CMake fragment, which registers this test.

Negative control

Not run: the new Vulkan test requires an exact-head build and Vulkan runtime. The PR description reports that the test fails on main; I did not reproduce that result.

Findings

Blocking

The PR body includes summary JSON lines and says four trace files are attached in a comment, but the PR has no issue comments or trace attachments. It also does not include the required tools/trace_digest.py output for the captures. The measured change line names commit 7d9a9d042264, while the reviewed head is 707a76b12028; the description says it was rebased, but the available evidence does not let a reviewer inspect the captures or verify that the measured tree corresponds to this change. Please attach the baseline and change traces, include each digest output, and identify the measured change tree relative to this head (or provide matched captures for the current head).

Non-blocking

No additional blocking source issue was identified in the reviewed diff. This does not verify the reported performance improvement or GPU behavior.

Sources

Not verified

  • The reported AGC/Vulkan test results, GPU validation logs, benchmark captures and speedup were not reproduced here.
  • Full build and CTest were not run. Linux/Vulkan, Windows and physical-console behavior are not independently verified.
  • Hosted checks were queued at the last check snapshot; their later results are not included.

To get this to a good state

Attach the four captures and their trace_digest.py outputs, and establish that the measured change matches the reviewed change. I will refresh the head and base, then reassess the performance evidence and any newly completed hosted checks.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5869560500 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/18757#pullrequestreview-5869560500). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-12T05:25:20Z. **Review:** DISMISSED --- # Reviewed — changes requested The source change appears internally consistent, but this `perf` pull request is missing required, inspectable trace evidence for its performance claim. ## What I ran Reviewed head `707a76b12028a7d9f697568ea759e64cc2696a8c` against current `main` tip `145e689adab572c44a99369516565d28e85f6c12`; the no-build precheck reported the head and base unchanged and its mergeability check passed. Environment: Linux 6.1, Python 3.11.2, GCC C++ 12.2.0. I did not compile or run Vulkan tests. ```sh python3 tools/pr_precheck.py --repo boykopovar/AnyPS5 --pr 18757 --output-dir /tmp/pr18757-precheck git fetch https://github.com/boykopovar/AnyPS5.git refs/pull/18757/head:refs/review/18757/20261112-head git fetch https://github.com/boykopovar/AnyPS5.git refs/heads/main:refs/review/18757/20261112-main ``` I also read the complete diff and relevant draw-cache, relocation, capture, test-registration, and performance-report context. The PR description's test and performance measurements are author-reported; I did not reproduce them. ## Results | Check | Result | Note | |---|---|---| | Diff and conventions | passed | Exact head and base precheck passed. | | Dependency and mergeability | passed | No blocking stack issue reported. | | Test-registration heuristic | passed | Its warning is a false positive; the changed CMake fragment registers the test. | | AGC/Vulkan tests | not run | No exact-head build or Vulkan run was performed here. | | Performance evidence | failed | Required trace files and `trace_digest.py` output are not available on the PR. | | Hosted CI | not run | Six required status checks were queued when refreshed. | <details> <summary>Complete no-build precheck table and relevant raw output</summary> | Check | Status | Why / command | |---|---|---| | build_and_compile | not_run | Builds are intentionally excluded from this fast, no-build check pass. | | diff_check | passed | `git diff --check 145e689adab572c44a99369516565d28e85f6c12...707a76b12028a7d9f697568ea759e64cc2696a8c` | | conventions_and_pr_template | passed | `/usr/bin/python3 tools/check_conventions.py --base 145e689adab572c44a99369516565d28e85f6c12 --head 707a76b12028a7d9f697568ea759e64cc2696a8c --title perf(agc): learn a draw's relocation when its entry is inserted --body /tmp/pr18757-precheck/pr-body.md` | | changed_export_abi_audit | passed | `/usr/bin/python3 /marc/AnyPS5/tools/pr_abi_audit.py --base 145e689adab572c44a99369516565d28e85f6c12 --head 707a76b12028a7d9f697568ea759e64cc2696a8c --json` | | python_syntax | not_applicable | No changed Python implementation files. | | related_python_unit_tests | not_applicable | No changed Python tool module has a related tools/tests/test_<module>.py suite. | | python_test_registration | not_applicable | No changed Python test files need registration. | | live_dependency_and_mergeability_check | passed | `/usr/bin/python3 /marc/AnyPS5/tools/pr_stack_check.py 18757 --repo boykopovar/AnyPS5 --output-dir /tmp/pr18757-precheck/stack` | | build_dependent_cpp_tests | not_run | Changed C/C++ source or test files need exact-head binaries; this fast pass does not build. | | test_quality_heuristics | passed | `/usr/bin/python3 /marc/AnyPS5/tools/pr_test_quality.py --root /tmp/pr18757-precheck/head-707a76b12028-696370ac --json core/libs/prx/libSceAgcDriver/Execution/include/Driver/Driver.hpp core/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/Draw.cpp core/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/DrawCache.cpp core/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/DrawRelocate.cpp core/libs/prx/libSceAgcDriver/tests/cmake/agc_driver_draw_cache_relocation_tests.cmake core/libs/prx/libSceAgcDriver/tests/execution/DrawCacheRelocation.cpp` | | negative_controls | not_applicable | No changed tools/ Python test module is eligible for a base-source negative control. | Unedited output from the convention check: ```text All conventions checks passed. ``` Unedited output from the stack check: ```text /tmp/pr18757-precheck/stack/stack-report.md /tmp/pr18757-precheck/stack/stack-report.json ``` Unedited output from the test-quality heuristic: ```json { "findings": [ { "path": "core/libs/prx/libSceAgcDriver/tests/execution/DrawCacheRelocation.cpp", "line": 1, "kind": "possible-unregistered-cpp-test", "message": "Changed C++ test source path was not found literally in CMake files; inspect registration, generated source lists, and workflow coverage." } ], "negative_control_candidates": [], "limits": [ "Heuristics can miss weak assertions and can flag valid tests; inspect every finding.", "A test that passes against base is not by itself proof that the PR test is inadequate.", "Negative controls are only candidates until the test actually runs against base and fails by assertion rather than import/setup error." ] } ``` The test-quality warning was manually checked against the changed CMake fragment, which registers this test. </details> ## Negative control Not run: the new Vulkan test requires an exact-head build and Vulkan runtime. The PR description reports that the test fails on `main`; I did not reproduce that result. ## Findings ### Blocking The PR body includes summary JSON lines and says four trace files are attached in a comment, but the PR has no issue comments or trace attachments. It also does not include the required `tools/trace_digest.py` output for the captures. The measured change line names commit `7d9a9d042264`, while the reviewed head is `707a76b12028`; the description says it was rebased, but the available evidence does not let a reviewer inspect the captures or verify that the measured tree corresponds to this change. Please attach the baseline and change traces, include each digest output, and identify the measured change tree relative to this head (or provide matched captures for the current head). ### Non-blocking No additional blocking source issue was identified in the reviewed diff. This does not verify the reported performance improvement or GPU behavior. ## Sources - [Repository PR checklist at the reviewed head](https://github.com/boykopovar/AnyPS5/blob/707a76b12028a7d9f697568ea759e64cc2696a8c/.github/pull_request_template.md) requires matched `main`/PR summaries and attached traces. - [Performance report form at the reviewed head](https://github.com/boykopovar/AnyPS5/blob/707a76b12028a7d9f697568ea759e64cc2696a8c/.github/ISSUE_TEMPLATE/performance.yml) specifies attaching each trace. - [AGENTS.md at the reviewed head](https://github.com/boykopovar/AnyPS5/blob/707a76b12028a7d9f697568ea759e64cc2696a8c/AGENTS.md) requires `tools/trace_digest.py` summaries for speed claims. - [Changed test registration at the reviewed head](https://github.com/boykopovar/AnyPS5/blob/707a76b12028a7d9f697568ea759e64cc2696a8c/core/libs/prx/libSceAgcDriver/tests/cmake/agc_driver_draw_cache_relocation_tests.cmake) registers the new finisher test. ## Not verified - The reported AGC/Vulkan test results, GPU validation logs, benchmark captures and speedup were not reproduced here. - Full build and CTest were not run. Linux/Vulkan, Windows and physical-console behavior are not independently verified. - Hosted checks were queued at the last check snapshot; their later results are not included. ## To get this to a good state Attach the four captures and their `trace_digest.py` outputs, and establish that the measured change matches the reviewed change. I will refresh the head and base, then reassess the performance evidence and any newly completed hosted checks.
MarcZX10 commented 2026-11-17 08:45:20 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-17T08:45:20Z.

Review: COMMENTED


Reviewed — no blocking findings

Nothing blocks this; the points below are optional.

What I ran

Head dcf7e04c7eca0c9fd3bb8f5b76f49e0f61c1a9af, base main. Read the prepared diff for all six changed files, then checked the head with the repository reader:

python3 repo_read.py search insertDrawEntry
python3 repo_read.py search drawRelocationPending
python3 repo_read.py search learnPendingRelocation
python3 repo_read.py search SetCaptureCheckHook
python3 repo_read.py search captureCheckHook
python3 repo_read.py search DrawCacheCounters
python3 repo_read.py cat core/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/DrawCache.cpp 165 275
python3 repo_read.py cat core/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/Draw.cpp 455 480
python3 repo_read.py cat core/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/Draw.cpp 1385 1430
python3 repo_read.py cat core/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/DrawRelocate.cpp 205 245
python3 repo_read.py cat core/libs/prx/libSceAgcDriver/Execution/src/Driver/Synchronization/DeferredLabels.cpp 192 212

Nothing was built or run here. The author's Windows test results are in the description and are not reproduced.

Results

Check Result Note
Six changed files read in the diff passed Full files not read; context read at head as listed above
No leftover uses of the removed single slot passed drawRelocationPending has no uses at head
Build and agc_driver_draw_cache_relocation tests not run Needs the Windows toolchain; author reports 7 of 7
New _finisher test fails on main not run Author reports it fails with the quoted message
Hosted checks for this head not run Status not checked

Findings

Blocking

None.

Non-blocking

  • core/libs/prx/libSceAgcDriver/tests/execution/DrawCacheRelocation.cpp:135 adds #include <thread> above #include <string>. The list is alphabetical, so <thread> belongs after <string>.
  • core/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/Draw.cpp:474 removes the drain. A second draw with the same key that looks up before the first insert commits now misses and captures again, where the worker used to drain and hit. The description's numbers are for moved-pointer draws; this case is not measured.
  • core/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/Draw.cpp:475 keeps a pending entry per key until that key is inserted, a later miss on the key replaces it, or the map reaches 1024 entries and is cleared. The old single slot was consumed on the next lookup. I found no path that learns a stale entry, but I did not check every caller of the miss path.

Sources

Commit dcf7e04c7eca0c9fd3bb8f5b76f49e0f61c1a9af:

Not verified

  • Build and run of the relocation tests, including the new _finisher test and its negative control. Not run here.
  • The author's performance traces and numbers. Not reproduced.
  • Whether the hold in the new test releases exactly as the test expects. I read the logic and did not run it.
  • The repository's hosted checks for this head.
  • Callers of the miss path other than the ones named above.

To get this to a good state

Nothing is required.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5935371391 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/18757#pullrequestreview-5935371391). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-17T08:45:20Z. **Review:** COMMENTED --- # Reviewed — no blocking findings Nothing blocks this; the points below are optional. ## What I ran Head `dcf7e04c7eca0c9fd3bb8f5b76f49e0f61c1a9af`, base `main`. Read the prepared diff for all six changed files, then checked the head with the repository reader: ``` python3 repo_read.py search insertDrawEntry python3 repo_read.py search drawRelocationPending python3 repo_read.py search learnPendingRelocation python3 repo_read.py search SetCaptureCheckHook python3 repo_read.py search captureCheckHook python3 repo_read.py search DrawCacheCounters python3 repo_read.py cat core/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/DrawCache.cpp 165 275 python3 repo_read.py cat core/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/Draw.cpp 455 480 python3 repo_read.py cat core/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/Draw.cpp 1385 1430 python3 repo_read.py cat core/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/DrawRelocate.cpp 205 245 python3 repo_read.py cat core/libs/prx/libSceAgcDriver/Execution/src/Driver/Synchronization/DeferredLabels.cpp 192 212 ``` Nothing was built or run here. The author's Windows test results are in the description and are not reproduced. ## Results | Check | Result | Note | |---|---|---| | Six changed files read in the diff | passed | Full files not read; context read at head as listed above | | No leftover uses of the removed single slot | passed | `drawRelocationPending` has no uses at head | | Build and `agc_driver_draw_cache_relocation` tests | not run | Needs the Windows toolchain; author reports 7 of 7 | | New `_finisher` test fails on `main` | not run | Author reports it fails with the quoted message | | Hosted checks for this head | not run | Status not checked | ## Findings ### Blocking None. ### Non-blocking - `core/libs/prx/libSceAgcDriver/tests/execution/DrawCacheRelocation.cpp:135` adds `#include <thread>` above `#include <string>`. The list is alphabetical, so `<thread>` belongs after `<string>`. - `core/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/Draw.cpp:474` removes the drain. A second draw with the same key that looks up before the first insert commits now misses and captures again, where the worker used to drain and hit. The description's numbers are for moved-pointer draws; this case is not measured. - `core/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/Draw.cpp:475` keeps a pending entry per key until that key is inserted, a later miss on the key replaces it, or the map reaches 1024 entries and is cleared. The old single slot was consumed on the next lookup. I found no path that learns a stale entry, but I did not check every caller of the miss path. ## Sources Commit `dcf7e04c7eca0c9fd3bb8f5b76f49e0f61c1a9af`: - [Pending relocation learned on insert, under the cache mutex](https://github.com/boykopovar/AnyPS5/blob/dcf7e04c7eca0c9fd3bb8f5b76f49e0f61c1a9af/core/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/DrawCache.cpp#L250-L254) - [Pending entry recorded per key on the miss path](https://github.com/boykopovar/AnyPS5/blob/dcf7e04c7eca0c9fd3bb8f5b76f49e0f61c1a9af/core/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/Draw.cpp#L473-L476) - [Commit path calls the insert](https://github.com/boykopovar/AnyPS5/blob/dcf7e04c7eca0c9fd3bb8f5b76f49e0f61c1a9af/core/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/DrawCapture.cpp#L416) - [Capture check hook runs on the finisher path before the commit is queued](https://github.com/boykopovar/AnyPS5/blob/dcf7e04c7eca0c9fd3bb8f5b76f49e0f61c1a9af/core/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/Draw.cpp#L1397) ## Not verified - Build and run of the relocation tests, including the new `_finisher` test and its negative control. Not run here. - The author's performance traces and numbers. Not reproduced. - Whether the hold in the new test releases exactly as the test expects. I read the logic and did not run it. - The repository's hosted checks for this head. - Callers of the miss path other than the ones named above. ## To get this to a good state Nothing is required.
MarcZX10 commented 2026-11-26 03:51:53 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-26T03:51:53Z.

Review: APPROVED


Reviewed — looks good

The change moves relocation learning to the matching cache insertion and removes a finisher drain; the inspected implementation and added regression test support the stated behavior.

What I ran

Reviewed head 88ad6f983d3e05c6de7bb4d000e21ee0f61e37cf against main. No tests or builds were run; the test and performance results in the PR description are author-reported.

Results

Check Result Note
Changed code review passed Six changed files inspected
Tests and build not run Reported results were not independently run

Findings

Blocking

None.

Non-blocking

None.

Not verified

I read all six files listed in review/manifest.json; none were excluded. I did not run the regression tests, build, convention checks, or performance measurements, and did not independently verify the author-reported results or console behavior.

To get this to a good state

Nothing is required.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:6068312187 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/18757#pullrequestreview-6068312187). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-26T03:51:53Z. **Review:** APPROVED --- # Reviewed — looks good The change moves relocation learning to the matching cache insertion and removes a finisher drain; the inspected implementation and added regression test support the stated behavior. ## What I ran Reviewed head `88ad6f983d3e05c6de7bb4d000e21ee0f61e37cf` against `main`. No tests or builds were run; the test and performance results in the PR description are author-reported. ## Results | Check | Result | Note | |---|---|---| | Changed code review | passed | Six changed files inspected | | Tests and build | not run | Reported results were not independently run | ## Findings ### Blocking None. ### Non-blocking None. ## Not verified I read all six files listed in `review/manifest.json`; none were excluded. I did not run the regression tests, build, convention checks, or performance measurements, and did not independently verify the author-reported results or console behavior. ## To get this to a good state Nothing is required.
ligmaSec commented 2026-12-03 22:17:22 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by ligmaSec on 2026-12-03T22:17:22Z.

Review: COMMENTED


The trial merge onto a1b75b0947 was clean. I checked that admission and entry insertion read the same per-key pending relocation map under the draw-cache mutex. The held-finisher case gives a distinct control for the removed worker drain. Keep it with the recipe-verify draw-pipeline case so the test still catches a stall as well as a bad relocated cache hit. Paired validation is pending.

AI-assisted: yes.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:6179575655 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/18757#pullrequestreview-6179575655). Originally posted by [ligmaSec](https://github.com/ligmaSec) on 2026-12-03T22:17:22Z. **Review:** COMMENTED --- The trial merge onto `a1b75b0947` was clean. I checked that admission and entry insertion read the same per-key pending relocation map under the draw-cache mutex. The held-finisher case gives a distinct control for the removed worker drain. Keep it with the recipe-verify draw-pipeline case so the test still catches a stall as well as a bad relocated cache hit. Paired validation is pending. AI-assisted: yes.
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/18757:upstream-pr/18757'
git switch 'upstream-pr/18757'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'upstream-pr/18757'
git switch 'upstream-pr/18757'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/18757'
git switch 'upstream-pr/18757'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/18757'
git switch 'main'
git merge --squash 'upstream-pr/18757'
git switch 'main'
git merge --ff-only 'upstream-pr/18757'
git switch 'main'
git merge 'upstream-pr/18757'
git push origin 'main'
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!18757
No description provided.