perf(agc): move per-draw thread-locals to TEB slots #6615

Merged
meh7an merged 2 commits from upstream-pr/6615 into main 2026-11-05 23:13:56 +00:00
meh7an commented 2026-10-15 23:04:49 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by meh7an on 2026-10-15T23:04:49Z.


What

With MinGW, every thread_local access goes through __emutls_get_address, a winpthreads key lookup. #6292 moved the draw path's locks and its hottest thread-locals to TEB slots (HostThreadSlot). This moves the ones left on the revalidation path, which every draw and dispatch that reuses cached resources takes:

  • ShaderResources::fastRevalidate's five scratch vectors and Revalidate's four (overlapping, refreshed, versions, regions) now go through ThreadScratch<T, Tag>(): the thread's object in a HostThreadSlot, created on first use and destroyed with the thread by ThreadOwned, as before;
  • Texture.cpp's refreshing exemption, read by StorageTexture::FlushPending and two other pending-store scans, is a HostThreadSlot<const StorageTexture*, RefreshingTag>;
  • Driver::sampledRead is a HostThreadSlot<bool, SampledReadTag>, through sampledRead() and setSampledRead().

On the S2 page of Sonic Origins Plus's main menu, the queue worker spent, per frame (APS5 sampler, 15 s):

  • __emutls_get_address: 1.24 to 1.51 in six runs without this change, 0.92 and 1.17 in two runs with it;
  • SampledReadScope: 0.15 to 0.24 without, 0.07 and 0.13 with;
  • fastRevalidate: 0.66 to 0.72 without, 0.56 and 0.63 with.

That is about 1% of the worker's frame (34 to 37 samples), so the frame times below move within run-to-run noise. Thread-locals elsewhere stay as they are.

Tested

Windows 11 (10.0.26300), WinLibs GCC 15.2.0 (UCRT), Release, NVIDIA GeForce RTX 2080 Ti, driver 617.14.

  • Rebased onto #6292's branch on main 53a0a27bb (c4a6636f7) without conflicts.
    • On that branch, with this change, the full ctest suite passes 1836 of 1838.
      • agc_driver_image_array_window_past_layer_limit is not run: MinGW does not build its alignas(65536).
      • agc_driver_pipelined_dispatch failed once under --parallel 4. It passed 8 of 8 runs alone.
  • Rebased onto #6292's branch on main 1d4164552.
    • Driver.hpp keeps main's indirect-source declarations next to sampledRead and setSampledRead, and Texture.cpp keeps main's BufferPool.hpp include.
    • Main's new StorageTexture::WaitForFlushing (5937ef03e) reads the refreshing texture through Refreshing::Get().
    • On that main, with this change, the full ctest suite passes 1740 of 1742.
      • agc_driver_image_array_window_past_layer_limit is not run: main does not compile ImageArrayWindowPastLayerLimit.cpp with MinGW (alignas(65536)).
      • agc_driver_pass_input_hazard (added in ba4571a25) fails on plain main 1d4164552 as well, 0 of 4 runs alone.
  • On #6292's branch, rebased onto main c84249186, with this change the full ctest suite passes 1321 of 1323 tests.
    • agc_driver_gpu_indirect_arguments_misaligned_writer_ahead is not run: main itself does not compile it with MinGW (alignas(65536)).
    • agc_driver_multisample_fill_host_only can fail ("the sentinel fill did not land"): that is main's own race, #6512, which #6522 fixes, and #6292 already depends on #6522 for it. It passed in this run, and with #6522's line added it failed 0 of 200 runs (8 at a time) on main 72c5eed1f.
    • guest_shader_link timed out once. It returns from main with the driver's threads still running, the exit hang of #6791 (#6925 fixes it for agc_shader_helpers): Driver::stop, run at DLL_PROCESS_DETACH, waits on threads that ExitProcess already ended. Run alone 400 times, 8 at a time, it hangs in 55 and 58 runs on plain main c84249186, 74 with #6292 and 97 with this change.
  • Sonic Origins Plus, main menu, S2 page (the 3D background), 1233x694 window.
    • Captured with APS5_TRACE_SECONDS=200:15 on the same machine in one session, caches warm. Traces attached.
    • Baseline 4e46e7eba, this change 99bf270c7 (the summaries name the commits before them, see the note):
Metric Baseline This PR Change
frame_ms.p50 119.277 113.494 -4.8%
frame_ms.p90 133.323 128.928 -3.3%
mean_frame_ms 121.598 115.852 -4.7%
gpu_busy_ms_per_present 84.702 83.305 -1.6%
Driver.Packet (ms per frame) 119.228 113.745 -4.6%
Driver.Draw (ms per frame) 106.006 101.488 -4.3%

The four windows of the moving background I captured in that session read 112.3 to 119.3 ms at the median, so this pair's gap is mostly noise. The FPS shown in the title went from 9.58 to 9.74 (median of six readings), and a sampled pair taken an hour earlier went from 9.07 to 9.21.

Note: measuring base. These numbers come from my fork's dev, on main 0a56aaaf4. The code this change touches is the same on main 5d9dcc42d.

  • The baseline is measure/inputs-2026-10-16 (4e46e7eba).
  • This change is measure/teb-2026-10-16 (99bf270c7).
  • Each build was made before its commit, so the summaries name the commit before it, dirty: a0dd42cf9 for the baseline and 4e46e7eba for this change.

Both carry these commits from my fork:

  • the fixes a71073ce3, c0d875634, e3c68960e, 604f0f373 and 10ff693aa (#5778);
  • make-exe and the stage dumps (522230d62, deee71fde);
  • the crash-report sampler (8d9c3103e..f641e1ec9), which took the profiles;
  • #6037, #6066, #6077, #6067, #6082 (its first version, before #5906), #6095, #6266, #6292, #6312, #6609 and #6611;
  • smaller steps kept in my fork: e83260247, 97b1ff6c9, 84f5bf0ff, 3b47f7743 (covered on main by #5062), ce567bc3d, a79e58a7c, a0a891697, 63f7a8ed0, b04806167, 719fb71dd, a21a3ce81 and e3b8d1c52 (which #6566 covers).

The branch sits on #6292's branch, rebased onto main c84249186. In my fork ThreadScratch came with #6312's port. #6312 itself keeps its buffer in a thread_local slot so that it does not depend on #6292, so this PR adds ThreadScratch.

The comparison tool marks the window's first present as a configuration difference: the window opens 200 s into each run. Both summaries set trace_dropped, because the worker filled its event buffer at about 2,700 draws per frame. The phase totals above stay complete.

Checklist

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

Traces and summary lines (baseline 4e46e7eba, whose summary says a0dd42cf9b44; this change 99bf270c7, whose summary says 4e46e7ebac25):
teb-traces.zip

The two summary lines, with tools/trace_digest.py for each trace:

Baseline (summary commit a0dd42cf9b44)

seconds 200:15 from present 2708: 124 presents, frame p50 119.3 / p90 133.3 / p99 151.6 / max 172.5 ms, GPU busy 84.7 ms per present
NVIDIA GeForce RTX 2080 Ti, NVIDIA 617.14, Windows 10.0.26300, 3840x2160, commit a0dd42cf9b44 (dirty), dropped: yes

{"commit":"a0dd42cf9b44","dirty":true,"env":{"APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"200:15"},"gpu":"NVIDIA GeForce RTX 2080 Ti","driver":"NVIDIA 617.14","os":"Windows 10.0.26300","resolution":"3840x2160","window":{"spec":"seconds 200:15","first_present":2708,"ms":15078.201},"presents":124,"frame_ms":{"p50":119.277,"p90":133.323,"p99":151.553,"max":172.525},"gpu_busy_ms_per_present":84.702,"worker_busy_pct":{"queue worker 0x0":98.081},"top_phases_ms_per_frame":{"Driver.Packet":119.228,"Driver.Packet.draw":107.057,"Driver.Draw":106.006,"Driver.Draw.draw_and_resource_release":50.358,"Graphics.Draw":49.2,"Graphics.Draw.draw_and_resource_release":40.064,"Driver.Draw.shader_compile_and_link":37.71,"Driver.Present":32.538},"trace_dropped":true,"trace":"aps5-trace-a0dd42cf9b44-40532.json.gz"}

Slowest frames (largest slices inside each, inclusive)

  • present 2708: 172.5 ms at 0 ms: Driver.Packet (queue worker 0x0) 159.6, Driver.Packet.draw (queue worker 0x0) 154.8, Driver.Draw (queue worker 0x0) 153.3, batch (gpu) 117.0
  • present 2743: 151.6 ms at 4268 ms: batch (gpu) 88.1, Driver.Present (presenter) 30.9, Driver.Present.render_fence_wait (presenter) 30.2, Vulkan.Retire (presenter) 30.2
  • present 2730: 146.1 ms at 2685 ms: Driver.Packet (queue worker 0x0) 136.3, Driver.Packet.draw (queue worker 0x0) 130.9, Driver.Draw (queue worker 0x0) 129.8, batch (gpu) 89.4
  • present 2789: 142.1 ms at 9922 ms: batch (gpu) 85.1, Driver.Present (presenter) 29.5, Driver.Present.render_fence_wait (presenter) 29.0, Vulkan.Retire (presenter) 29.0
  • present 2802: 140.5 ms at 11540 ms: batch (gpu) 87.0, Driver.Present (presenter) 34.6, Driver.Present.render_fence_wait (presenter) 34.1, Vulkan.Retire (presenter) 34.0

Threads (ms per frame)

thread busy wait untraced in slices < 20 us largest
queue worker 0x0 21.2 (17 %) 0.1 (0 %) 100.3 38.1 Driver.Packet 21.3, Driver.Completion 0.0
presenter 0.5 (0 %) 32.1 (26 %) 89.1 0.1 Driver.Present 32.5
gpu 84.7 (70 %) 0.0 (0 %) 36.9 0.0 batch 84.7

Largest slices (ms per frame, inclusive, all threads): batch 84.7, Driver.Present 32.5, Driver.Present.render_fence_wait 32.0, Vulkan.Retire 32.0, Vulkan.Retire.wait 32.0, Driver.Packet 21.3, Driver.Packet.draw 20.4, Driver.Draw 20.2, Driver.Draw.draw_and_resource_release 5.0, Graphics.Draw 4.9

Longest waits

  • Driver.Present.render_fence_wait (presenter) 38.0 ms at 5652 ms, present 2754
  • Driver.Present.render_fence_wait (presenter) 37.7 ms at 10328 ms, present 2792
  • Driver.Present.render_fence_wait (presenter) 37.0 ms at 2329 ms, present 2727
  • Driver.Present.render_fence_wait (presenter) 36.9 ms at 5416 ms, present 2752
  • Driver.Present.render_fence_wait (presenter) 36.3 ms at 5775 ms, present 2755
  • Driver.Present.render_fence_wait (presenter) 36.1 ms at 6255 ms, present 2759
  • Driver.Present.render_fence_wait (presenter) 36.1 ms at 5295 ms, present 2751
  • Driver.Present.render_fence_wait (presenter) 35.8 ms at 10451 ms, present 2793
  • Driver.Present.render_fence_wait (presenter) 35.6 ms at 5893 ms, present 2756
  • Driver.Present.render_fence_wait (presenter) 35.6 ms at 12254 ms, present 2808
This change (summary commit 4e46e7ebac25)

seconds 200:15 from present 3226: 130 presents, frame p50 113.5 / p90 128.9 / p99 143.9 / max 144.3 ms, GPU busy 83.3 ms per present
NVIDIA GeForce RTX 2080 Ti, NVIDIA 617.14, Windows 10.0.26300, 3840x2160, commit 4e46e7ebac25 (dirty), dropped: yes

{"commit":"4e46e7ebac25","dirty":true,"env":{"APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"200:15"},"gpu":"NVIDIA GeForce RTX 2080 Ti","driver":"NVIDIA 617.14","os":"Windows 10.0.26300","resolution":"3840x2160","window":{"spec":"seconds 200:15","first_present":3226,"ms":15060.793},"presents":130,"frame_ms":{"p50":113.494,"p90":128.928,"p99":143.934,"max":144.322},"gpu_busy_ms_per_present":83.305,"worker_busy_pct":{"queue worker 0x0":98.211},"top_phases_ms_per_frame":{"Driver.Packet":113.745,"Driver.Packet.draw":102.51,"Driver.Draw":101.488,"Driver.Draw.draw_and_resource_release":49.35,"Graphics.Draw":48.323,"Graphics.Draw.draw_and_resource_release":39.351,"Driver.Draw.shader_compile_and_link":35.574,"Driver.Present":32.978},"trace_dropped":true,"trace":"aps5-trace-4e46e7ebac25-37480.json.gz"}

Slowest frames (largest slices inside each, inclusive)

  • present 3257: 144.3 ms at 3533 ms: batch (gpu) 80.9, Driver.Present (presenter) 32.7, Driver.Present.render_fence_wait (presenter) 32.2, Vulkan.Retire (presenter) 32.2
  • present 3331: 143.9 ms at 12191 ms: batch (gpu) 84.7, Driver.Present (presenter) 35.6, Driver.Present.render_fence_wait (presenter) 35.1, Vulkan.Retire (presenter) 35.1
  • present 3341: 143.7 ms at 13365 ms: batch (gpu) 81.6, Driver.Present (presenter) 28.6, Driver.Present.render_fence_wait (presenter) 28.1, Vulkan.Retire (presenter) 28.1
  • present 3258: 134.2 ms at 3678 ms: batch (gpu) 84.2, Driver.Present (presenter) 34.4, Driver.Present.render_fence_wait (presenter) 33.9, Vulkan.Retire (presenter) 33.9
  • present 3264: 131.6 ms at 4387 ms: batch (gpu) 85.5, Driver.Present (presenter) 34.5, Driver.Present.render_fence_wait (presenter) 34.0, Vulkan.Retire (presenter) 34.0

Threads (ms per frame)

thread busy wait untraced in slices < 20 us largest
queue worker 0x0 19.3 (17 %) 0.1 (0 %) 96.5 37.8 Driver.Packet 19.4, Driver.Completion 0.0
presenter 0.5 (0 %) 32.5 (28 %) 82.9 0.1 Driver.Present 33.0
gpu 83.2 (72 %) 0.0 (0 %) 32.6 0.0 batch 83.2

Largest slices (ms per frame, inclusive, all threads): batch 83.2, Driver.Present 33.0, Driver.Present.render_fence_wait 32.5, Vulkan.Retire 32.5, Vulkan.Retire.wait 32.5, Driver.Packet 19.4, Driver.Packet.draw 18.6, Driver.Draw 18.5, Driver.Draw.draw_and_resource_release 4.1, Graphics.Draw 4.0

Longest waits

  • Driver.Present.render_fence_wait (presenter) 36.3 ms at 4855 ms, present 3268
  • Driver.Present.render_fence_wait (presenter) 35.7 ms at 948 ms, present 3234
  • Driver.Present.render_fence_wait (presenter) 35.6 ms at 10798 ms, present 3319
  • Driver.Present.render_fence_wait (presenter) 35.5 ms at 6303 ms, present 3280
  • Driver.Present.render_fence_wait (presenter) 35.4 ms at 5577 ms, present 3274
  • Driver.Present.render_fence_wait (presenter) 35.4 ms at 12569 ms, present 3334
  • Driver.Present.render_fence_wait (presenter) 35.3 ms at 11138 ms, present 3322
  • Driver.Present.render_fence_wait (presenter) 35.2 ms at 2506 ms, present 3248
  • Driver.Present.render_fence_wait (presenter) 35.2 ms at 5953 ms, present 3277
  • Driver.Present.render_fence_wait (presenter) 35.2 ms at 14174 ms, present 3348
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4880982418 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6615). Originally posted by [meh7an](https://github.com/meh7an) on 2026-10-15T23:04:49Z. --- ### What With MinGW, every `thread_local` access goes through `__emutls_get_address`, a winpthreads key lookup. #6292 moved the draw path's locks and its hottest thread-locals to TEB slots (`HostThreadSlot`). This moves the ones left on the revalidation path, which every draw and dispatch that reuses cached resources takes: - `ShaderResources::fastRevalidate`'s five scratch vectors and `Revalidate`'s four (`overlapping`, `refreshed`, `versions`, `regions`) now go through `ThreadScratch<T, Tag>()`: the thread's object in a `HostThreadSlot`, created on first use and destroyed with the thread by `ThreadOwned`, as before; - `Texture.cpp`'s `refreshing` exemption, read by `StorageTexture::FlushPending` and two other pending-store scans, is a `HostThreadSlot<const StorageTexture*, RefreshingTag>`; - `Driver::sampledRead` is a `HostThreadSlot<bool, SampledReadTag>`, through `sampledRead()` and `setSampledRead()`. On the S2 page of Sonic Origins Plus's main menu, the queue worker spent, per frame (APS5 sampler, 15 s): - `__emutls_get_address`: 1.24 to 1.51 in six runs without this change, 0.92 and 1.17 in two runs with it; - `SampledReadScope`: 0.15 to 0.24 without, 0.07 and 0.13 with; - `fastRevalidate`: 0.66 to 0.72 without, 0.56 and 0.63 with. That is about 1% of the worker's frame (34 to 37 samples), so the frame times below move within run-to-run noise. Thread-locals elsewhere stay as they are. ### Tested Windows 11 (10.0.26300), WinLibs GCC 15.2.0 (UCRT), Release, NVIDIA GeForce RTX 2080 Ti, driver 617.14. - Rebased onto #6292's branch on main 53a0a27bb (c4a6636f7) without conflicts. - On that branch, with this change, the full ctest suite passes 1836 of 1838. - `agc_driver_image_array_window_past_layer_limit` is not run: MinGW does not build its `alignas(65536)`. - `agc_driver_pipelined_dispatch` failed once under `--parallel 4`. It passed 8 of 8 runs alone. - Rebased onto #6292's branch on main 1d4164552. - `Driver.hpp` keeps main's indirect-source declarations next to `sampledRead` and `setSampledRead`, and `Texture.cpp` keeps main's `BufferPool.hpp` include. - Main's new `StorageTexture::WaitForFlushing` (5937ef03e) reads the refreshing texture through `Refreshing::Get()`. - On that main, with this change, the full ctest suite passes 1740 of 1742. - `agc_driver_image_array_window_past_layer_limit` is not run: main does not compile `ImageArrayWindowPastLayerLimit.cpp` with MinGW (`alignas(65536)`). - `agc_driver_pass_input_hazard` (added in ba4571a25) fails on plain main 1d4164552 as well, 0 of 4 runs alone. - On #6292's branch, rebased onto main c84249186, with this change the full ctest suite passes 1321 of 1323 tests. - `agc_driver_gpu_indirect_arguments_misaligned_writer_ahead` is not run: main itself does not compile it with MinGW (`alignas(65536)`). - `agc_driver_multisample_fill_host_only` can fail ("the sentinel fill did not land"): that is main's own race, #6512, which #6522 fixes, and #6292 already depends on #6522 for it. It passed in this run, and with #6522's line added it failed 0 of 200 runs (8 at a time) on main 72c5eed1f. - `guest_shader_link` timed out once. It returns from `main` with the driver's threads still running, the exit hang of #6791 (#6925 fixes it for `agc_shader_helpers`): `Driver::stop`, run at `DLL_PROCESS_DETACH`, waits on threads that `ExitProcess` already ended. Run alone 400 times, 8 at a time, it hangs in 55 and 58 runs on plain main c84249186, 74 with #6292 and 97 with this change. - Sonic Origins Plus, main menu, S2 page (the 3D background), 1233x694 window. - Captured with `APS5_TRACE_SECONDS=200:15` on the same machine in one session, caches warm. Traces attached. - Baseline 4e46e7eba, this change 99bf270c7 (the summaries name the commits before them, see the note): | Metric | Baseline | This PR | Change | | --- | ---: | ---: | ---: | | frame_ms.p50 | 119.277 | 113.494 | -4.8% | | frame_ms.p90 | 133.323 | 128.928 | -3.3% | | mean_frame_ms | 121.598 | 115.852 | -4.7% | | gpu_busy_ms_per_present | 84.702 | 83.305 | -1.6% | | Driver.Packet (ms per frame) | 119.228 | 113.745 | -4.6% | | Driver.Draw (ms per frame) | 106.006 | 101.488 | -4.3% | The four windows of the moving background I captured in that session read 112.3 to 119.3 ms at the median, so this pair's gap is mostly noise. The FPS shown in the title went from 9.58 to 9.74 (median of six readings), and a sampled pair taken an hour earlier went from 9.07 to 9.21. > **Note: measuring base.** These numbers come from my fork's dev, on main 0a56aaaf4. The code this change touches is the same on main 5d9dcc42d. > - The baseline is [measure/inputs-2026-10-16](https://github.com/meh7an/AnyPS5/commits/measure/inputs-2026-10-16) (4e46e7eba). > - This change is [measure/teb-2026-10-16](https://github.com/meh7an/AnyPS5/commits/measure/teb-2026-10-16) (99bf270c7). > - Each build was made before its commit, so the summaries name the commit before it, `dirty`: a0dd42cf9 for the baseline and 4e46e7eba for this change. > > Both carry these commits from my fork: > - the fixes a71073ce3, c0d875634, e3c68960e, 604f0f373 and 10ff693aa (#5778); > - make-exe and the stage dumps (522230d62, deee71fde); > - the crash-report sampler (8d9c3103e..f641e1ec9), which took the profiles; > - #6037, #6066, #6077, #6067, #6082 (its first version, before #5906), #6095, #6266, #6292, #6312, #6609 and #6611; > - smaller steps kept in my fork: e83260247, 97b1ff6c9, 84f5bf0ff, 3b47f7743 (covered on main by #5062), ce567bc3d, a79e58a7c, a0a891697, 63f7a8ed0, b04806167, 719fb71dd, a21a3ce81 and e3b8d1c52 (which #6566 covers). > > The branch sits on #6292's branch, rebased onto main c84249186. In my fork `ThreadScratch` came with #6312's port. #6312 itself keeps its buffer in a `thread_local` slot so that it does not depend on #6292, so this PR adds `ThreadScratch`. > > The comparison tool marks the window's first present as a configuration difference: the window opens 200 s into each run. Both summaries set `trace_dropped`, because the worker filled its event buffer at about 2,700 draws per frame. The phase totals above stay complete. ### Checklist - [x] Based on current `main`; no other open PR implements the same functions - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except technical debt - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed under Silent stubs in their library's technical 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: #6292 - [x] Unblocks: none - [x] GPUs tested: NVIDIA GeForce RTX 2080 Ti, driver 617.14, Windows 11 - [x] AI-assisted: yes Traces and summary lines (baseline 4e46e7eba, whose summary says a0dd42cf9b44; this change 99bf270c7, whose summary says 4e46e7ebac25): [teb-traces.zip](https://github.com/user-attachments/files/33518161/teb-traces.zip) The two summary lines, with `tools/trace_digest.py` for each trace: <details><summary>Baseline (summary commit a0dd42cf9b44)</summary> **seconds 200:15** from present 2708: 124 presents, frame p50 119.3 / p90 133.3 / p99 151.6 / max 172.5 ms, GPU busy 84.7 ms per present NVIDIA GeForce RTX 2080 Ti, NVIDIA 617.14, Windows 10.0.26300, 3840x2160, commit a0dd42cf9b44 (dirty), dropped: yes ```json {"commit":"a0dd42cf9b44","dirty":true,"env":{"APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"200:15"},"gpu":"NVIDIA GeForce RTX 2080 Ti","driver":"NVIDIA 617.14","os":"Windows 10.0.26300","resolution":"3840x2160","window":{"spec":"seconds 200:15","first_present":2708,"ms":15078.201},"presents":124,"frame_ms":{"p50":119.277,"p90":133.323,"p99":151.553,"max":172.525},"gpu_busy_ms_per_present":84.702,"worker_busy_pct":{"queue worker 0x0":98.081},"top_phases_ms_per_frame":{"Driver.Packet":119.228,"Driver.Packet.draw":107.057,"Driver.Draw":106.006,"Driver.Draw.draw_and_resource_release":50.358,"Graphics.Draw":49.2,"Graphics.Draw.draw_and_resource_release":40.064,"Driver.Draw.shader_compile_and_link":37.71,"Driver.Present":32.538},"trace_dropped":true,"trace":"aps5-trace-a0dd42cf9b44-40532.json.gz"} ``` **Slowest frames** (largest slices inside each, inclusive) - present 2708: 172.5 ms at 0 ms: Driver.Packet (queue worker 0x0) 159.6, Driver.Packet.draw (queue worker 0x0) 154.8, Driver.Draw (queue worker 0x0) 153.3, batch (gpu) 117.0 - present 2743: 151.6 ms at 4268 ms: batch (gpu) 88.1, Driver.Present (presenter) 30.9, Driver.Present.render_fence_wait (presenter) 30.2, Vulkan.Retire (presenter) 30.2 - present 2730: 146.1 ms at 2685 ms: Driver.Packet (queue worker 0x0) 136.3, Driver.Packet.draw (queue worker 0x0) 130.9, Driver.Draw (queue worker 0x0) 129.8, batch (gpu) 89.4 - present 2789: 142.1 ms at 9922 ms: batch (gpu) 85.1, Driver.Present (presenter) 29.5, Driver.Present.render_fence_wait (presenter) 29.0, Vulkan.Retire (presenter) 29.0 - present 2802: 140.5 ms at 11540 ms: batch (gpu) 87.0, Driver.Present (presenter) 34.6, Driver.Present.render_fence_wait (presenter) 34.1, Vulkan.Retire (presenter) 34.0 **Threads** (ms per frame) | thread | busy | wait | untraced | in slices < 20 us | largest | |---|---|---|---|---|---| | queue worker 0x0 | 21.2 (17 %) | 0.1 (0 %) | 100.3 | 38.1 | Driver.Packet 21.3, Driver.Completion 0.0 | | presenter | 0.5 (0 %) | 32.1 (26 %) | 89.1 | 0.1 | Driver.Present 32.5 | | gpu | 84.7 (70 %) | 0.0 (0 %) | 36.9 | 0.0 | batch 84.7 | **Largest slices** (ms per frame, inclusive, all threads): batch 84.7, Driver.Present 32.5, Driver.Present.render_fence_wait 32.0, Vulkan.Retire 32.0, Vulkan.Retire.wait 32.0, Driver.Packet 21.3, Driver.Packet.draw 20.4, Driver.Draw 20.2, Driver.Draw.draw_and_resource_release 5.0, Graphics.Draw 4.9 **Longest waits** - Driver.Present.render_fence_wait (presenter) 38.0 ms at 5652 ms, present 2754 - Driver.Present.render_fence_wait (presenter) 37.7 ms at 10328 ms, present 2792 - Driver.Present.render_fence_wait (presenter) 37.0 ms at 2329 ms, present 2727 - Driver.Present.render_fence_wait (presenter) 36.9 ms at 5416 ms, present 2752 - Driver.Present.render_fence_wait (presenter) 36.3 ms at 5775 ms, present 2755 - Driver.Present.render_fence_wait (presenter) 36.1 ms at 6255 ms, present 2759 - Driver.Present.render_fence_wait (presenter) 36.1 ms at 5295 ms, present 2751 - Driver.Present.render_fence_wait (presenter) 35.8 ms at 10451 ms, present 2793 - Driver.Present.render_fence_wait (presenter) 35.6 ms at 5893 ms, present 2756 - Driver.Present.render_fence_wait (presenter) 35.6 ms at 12254 ms, present 2808 </details> <details><summary>This change (summary commit 4e46e7ebac25)</summary> **seconds 200:15** from present 3226: 130 presents, frame p50 113.5 / p90 128.9 / p99 143.9 / max 144.3 ms, GPU busy 83.3 ms per present NVIDIA GeForce RTX 2080 Ti, NVIDIA 617.14, Windows 10.0.26300, 3840x2160, commit 4e46e7ebac25 (dirty), dropped: yes ```json {"commit":"4e46e7ebac25","dirty":true,"env":{"APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"200:15"},"gpu":"NVIDIA GeForce RTX 2080 Ti","driver":"NVIDIA 617.14","os":"Windows 10.0.26300","resolution":"3840x2160","window":{"spec":"seconds 200:15","first_present":3226,"ms":15060.793},"presents":130,"frame_ms":{"p50":113.494,"p90":128.928,"p99":143.934,"max":144.322},"gpu_busy_ms_per_present":83.305,"worker_busy_pct":{"queue worker 0x0":98.211},"top_phases_ms_per_frame":{"Driver.Packet":113.745,"Driver.Packet.draw":102.51,"Driver.Draw":101.488,"Driver.Draw.draw_and_resource_release":49.35,"Graphics.Draw":48.323,"Graphics.Draw.draw_and_resource_release":39.351,"Driver.Draw.shader_compile_and_link":35.574,"Driver.Present":32.978},"trace_dropped":true,"trace":"aps5-trace-4e46e7ebac25-37480.json.gz"} ``` **Slowest frames** (largest slices inside each, inclusive) - present 3257: 144.3 ms at 3533 ms: batch (gpu) 80.9, Driver.Present (presenter) 32.7, Driver.Present.render_fence_wait (presenter) 32.2, Vulkan.Retire (presenter) 32.2 - present 3331: 143.9 ms at 12191 ms: batch (gpu) 84.7, Driver.Present (presenter) 35.6, Driver.Present.render_fence_wait (presenter) 35.1, Vulkan.Retire (presenter) 35.1 - present 3341: 143.7 ms at 13365 ms: batch (gpu) 81.6, Driver.Present (presenter) 28.6, Driver.Present.render_fence_wait (presenter) 28.1, Vulkan.Retire (presenter) 28.1 - present 3258: 134.2 ms at 3678 ms: batch (gpu) 84.2, Driver.Present (presenter) 34.4, Driver.Present.render_fence_wait (presenter) 33.9, Vulkan.Retire (presenter) 33.9 - present 3264: 131.6 ms at 4387 ms: batch (gpu) 85.5, Driver.Present (presenter) 34.5, Driver.Present.render_fence_wait (presenter) 34.0, Vulkan.Retire (presenter) 34.0 **Threads** (ms per frame) | thread | busy | wait | untraced | in slices < 20 us | largest | |---|---|---|---|---|---| | queue worker 0x0 | 19.3 (17 %) | 0.1 (0 %) | 96.5 | 37.8 | Driver.Packet 19.4, Driver.Completion 0.0 | | presenter | 0.5 (0 %) | 32.5 (28 %) | 82.9 | 0.1 | Driver.Present 33.0 | | gpu | 83.2 (72 %) | 0.0 (0 %) | 32.6 | 0.0 | batch 83.2 | **Largest slices** (ms per frame, inclusive, all threads): batch 83.2, Driver.Present 33.0, Driver.Present.render_fence_wait 32.5, Vulkan.Retire 32.5, Vulkan.Retire.wait 32.5, Driver.Packet 19.4, Driver.Packet.draw 18.6, Driver.Draw 18.5, Driver.Draw.draw_and_resource_release 4.1, Graphics.Draw 4.0 **Longest waits** - Driver.Present.render_fence_wait (presenter) 36.3 ms at 4855 ms, present 3268 - Driver.Present.render_fence_wait (presenter) 35.7 ms at 948 ms, present 3234 - Driver.Present.render_fence_wait (presenter) 35.6 ms at 10798 ms, present 3319 - Driver.Present.render_fence_wait (presenter) 35.5 ms at 6303 ms, present 3280 - Driver.Present.render_fence_wait (presenter) 35.4 ms at 5577 ms, present 3274 - Driver.Present.render_fence_wait (presenter) 35.4 ms at 12569 ms, present 3334 - Driver.Present.render_fence_wait (presenter) 35.3 ms at 11138 ms, present 3322 - Driver.Present.render_fence_wait (presenter) 35.2 ms at 2506 ms, present 3248 - Driver.Present.render_fence_wait (presenter) 35.2 ms at 5953 ms, present 3277 - Driver.Present.render_fence_wait (presenter) 35.2 ms at 14174 ms, present 3348 </details>
blawesom commented 2026-10-16 17:39:13 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by blawesom on 2026-10-16T17:39:13Z.


Rebase handoff — rebased onto current main (both commits, authorship unchanged). The conflicts were the lock/TLS replacements landing on structures main has since extended: in Driver.hpp and VulkanDevice.cpp the PR's AgcDriver::Mutex swap now applies to main's fuller field sets (draw relocations, journal replay, pipeline counters), and in Pipeline.cpp both includes are kept with the mutex swap plus the PR's scratchKey field.

Verified on Linux (CachyOS, kernel 7.2.9, GCC 16.2.1, Ninja, Release, BUILD_TESTING=ON, AMD RX 9070 XT / RADV):

  • builds; tools/check_conventions.py --base origin/main passes
  • full suite: 1286/1287 — the only failure is the known main regression (agc_driver_tessellation segfault, #4727), not this PR

To pick it up:

git fetch https://github.com/blawesom/AnyPS5 rebase/6615
git checkout <your branch>
git merge --ff-only FETCH_HEAD

Head is 5c61f9f1d.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6221220027 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6615#issuecomment-6221220027). Originally posted by [blawesom](https://github.com/blawesom) on 2026-10-16T17:39:13Z. --- **Rebase handoff** — rebased onto current `main` (both commits, authorship unchanged). The conflicts were the lock/TLS replacements landing on structures `main` has since extended: in `Driver.hpp` and `VulkanDevice.cpp` the PR's `AgcDriver::Mutex` swap now applies to `main`'s fuller field sets (draw relocations, journal replay, pipeline counters), and in `Pipeline.cpp` both includes are kept with the mutex swap plus the PR's `scratchKey` field. Verified on Linux (CachyOS, kernel 7.2.9, GCC 16.2.1, Ninja, Release, `BUILD_TESTING=ON`, AMD RX 9070 XT / RADV): - builds; `tools/check_conventions.py --base origin/main` passes - **full suite: 1286/1287** — the only failure is the known `main` regression (`agc_driver_tessellation` segfault, #4727), not this PR **To pick it up:** ``` git fetch https://github.com/blawesom/AnyPS5 rebase/6615 git checkout <your branch> git merge --ff-only FETCH_HEAD ``` Head is `5c61f9f1d`.
parl0v commented 2026-10-16 22:14:01 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by parl0v on 2026-10-16T22:14:01Z.


Data point from a CPU-bound scene on Windows: RTX 3060 12 GB (NVIDIA 617.42), i5-12400F, Windows 10 19045, MinGW GCC Release. Minecraft Dungeons II (PPSA16064 01.100.100), title screen, no input, 200 s rows, APS5_PROFILE_DRAW=1 APS5_PROFILE_GPU=1; main bc3c0fc13 vs main + this PR, interleaved with five other PRs in one batch, two rounds. FPS is the mean of the last 10 [present] windows, GPU busy and idle gaps per frame over the last 8. This scene is CPU-bound on this machine (45-47 ms of idle gaps per frame).

libs FPS GPU busy idle gaps
main 6.70 / 6.60 105 / 106 ms 45 / 46 ms
+ this PR (2f4643eb4) 6.68 / 6.56 (-0.5 %) 105 / 106 ms 45 / 46 ms

Within the run-to-run spread (about ±1.5 % here), no regression, 0 fatal.

AI-assisted: yes (Claude Code)

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6225713433 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6615#issuecomment-6225713433). Originally posted by [parl0v](https://github.com/parl0v) on 2026-10-16T22:14:01Z. --- Data point from a CPU-bound scene on Windows: RTX 3060 12 GB (NVIDIA 617.42), i5-12400F, Windows 10 19045, MinGW GCC Release. Minecraft Dungeons II (PPSA16064 01.100.100), title screen, no input, 200 s rows, `APS5_PROFILE_DRAW=1 APS5_PROFILE_GPU=1`; `main` bc3c0fc13 vs `main` + this PR, interleaved with five other PRs in one batch, two rounds. FPS is the mean of the last 10 `[present]` windows, GPU busy and idle gaps per frame over the last 8. This scene is CPU-bound on this machine (45-47 ms of idle gaps per frame). | libs | FPS | GPU busy | idle gaps | |---|---|---|---| | `main` | 6.70 / 6.60 | 105 / 106 ms | 45 / 46 ms | | + this PR (2f4643eb4) | 6.68 / 6.56 (-0.5 %) | 105 / 106 ms | 45 / 46 ms | Within the run-to-run spread (about ±1.5 % here), no regression, 0 fatal. AI-assisted: yes (Claude Code)
moong15 commented 2026-10-19 13:16:48 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by moong15 on 2026-10-19T13:16:48Z.


Evidence from Stellar Blade on Windows (MinGW build): this stack gives about +7% presents in gameplay over two pairs.

What was measured. This PR's stack (#6615 including #6292; #6522 was already in our tree) ported onto a downstream perf branch: origin/main 4ffb0cd12 plus local AGC performance changes. The port keeps the PR's mechanism (atomic mutexes, explicit GPU-lock recursion, TEB slots) adapted to our tree. Base is the same tree without the port. It is not a clean main-vs-PR comparison.

  • Base ab1a4186593e, port 1b89c36184a1 (both clean builds, dirty: false)
  • Windows 11 10.0.26300, Ryzen 7 9800X3D, Radeon RX 9070 XT, AMD driver 26.8.1 (LLPC), 3840x2160
  • Same env in every run: APS5_FLAT_3D_COLOR_TARGET=1 APS5_CONTINUE_AFTER_FLIP_FAILURE=1 APS5_PREBUILD_THREADS=16 APS5_PIPELINE_DMA=1 APS5_HOST_IMPORT_MIB=16384 APS5_TRACE_SECONDS=0:150 APS5_TRACE_SUMMARY_EVERY=10 APS5_TRACE_EVENTS=4194304, warm shader cache, no APS5_PROFILE_*
  • The same scripted Cross presses in every run (APS5_PAD_INPUT_FILE, every 5 s from 8 s). Window: 49-150 s after launch, which is in-world gameplay after the first load.
  • Whole traces: trace_dropped is false in every window.

Before the port, a queue-0 sample profile of steady gameplay had about 4.9% of queue-0 time in winpthreads lock and TLS calls (__emutls_get_address 2.1% including its spin lock 1.5%, pthread_mutex_lock/timedlock 1.9%, unlock 0.5%, rwlock 0.4%).

Run Build Presents (49-150 s) fps p50 ms p90 ms p99 ms
1 base 1022 10.12 71.7 151.8 584.3
2 port 1068 10.57 64.9 150.8 491.0
3 base 1029 10.19 70.5 156.1 539.6
4 port 1127 11.16 61.6 148.2 422.0
  • Pair 1 (runs 1/2): +4.5%. Pair 2 (runs 3/4): +9.5%. p50 -9% and -13%, p99 -16% and -22%.
  • Peak commit was 0.75-1.2 GB higher with the port (30.9/31.2 GB vs 30.2/30.0 GB).
  • Queue 0 stays about 99% busy in both builds, so the gain is CPU time removed from the queue-0 path.

Traces and summary files are available on request.

trace_digest, run 1 (base)

1912 frames over 149995.1 ms (no summary line found)

Slowest frames (largest slices inside each, inclusive)

  • present 885: 10814.9 ms at 27970 ms: Driver.WorkerWait (queue worker 0x20) 7657.6, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x20) 7657.6, Driver.WorkerWait (queue worker 0x0) 6350.9, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x0) 6350.8
  • present 0: 3741.2 ms at 0 ms: Driver.Packet (queue worker 0x0) 40.5, Driver.Packet.device_lock (queue worker 0x0) 26.6, Driver.Commit.draw (draw committer) 24.4, GpuMutex.hold.draw (draw committer) 24.4
  • present 887: 3592.2 ms at 41902 ms: Driver.Packet (queue worker 0x0) 3438.3, Driver.Packet (queue worker 0x20) 2772.4, Driver.Packet.memory_wait (queue worker 0x20) 2709.9, Driver.Commit.draw (draw committer) 2409.5
  • present 886: 3116.5 ms at 38785 ms: Driver.Packet (queue worker 0x0) 3089.9, Driver.WorkerWait (queue worker 0x20) 2160.1, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x20) 2160.1, Driver.Commit.draw (draw committer) 2093.8
  • present 888: 2582.3 ms at 45494 ms: Driver.Packet (queue worker 0x20) 2582.0, Driver.Packet.memory_wait (queue worker 0x20) 2542.2, Driver.Packet (queue worker 0x0) 2516.9, Driver.Commit.draw (draw committer) 2021.4

Threads (ms per frame)

thread busy wait untraced in slices < 20 us largest
title 0.0 (0 %) 0.2 (0 %) 78.3 0.0
queue worker 0x0 66.5 (85 %) 6.1 (8 %) 5.9 23.8 Driver.Packet 67.1, Driver.EndSubmission 0.2
draw committer 29.0 (37 %) 0.9 (1 %) 48.5 7.0 Driver.Commit.draw 27.6, Driver.Commit.other 2.3
presenter 0.5 (1 %) 1.4 (2 %) 76.5 0.1 VideoOut.Flip 2.0, Driver.Present 0.0
title 0.1 (0 %) 0.0 (0 %) 78.4 0.0 Shader.ResolveAbi 0.1, Shader.ResolveGraphicsStagesAbi 0.0
title 0.0 (0 %) 0.0 (0 %) 78.4 0.0 Shader.Register 0.0, Shader.ResolveGraphicsStagesAbi 0.0
title 0.0 (0 %) 0.0 (0 %) 78.4 0.0 Shader.Register 0.0
title 0.0 (0 %) 0.0 (0 %) 78.4 0.0 Shader.ResolveAbi 0.0, Shader.ResolveGraphicsStagesAbi 0.0
title 0.0 (0 %) 0.0 (0 %) 78.4 0.0 Shader.ResolveAbi 0.0, Shader.ResolveGraphicsStagesAbi 0.0
title 0.0 (0 %) 0.0 (0 %) 78.4 0.0 Shader.ResolveAbi 0.0, Shader.ResolveGraphicsStagesAbi 0.0
title 0.0 (0 %) 0.0 (0 %) 78.4 0.0 Shader.ResolveAbi 0.0, Shader.ResolveGraphicsStagesAbi 0.0
title 0.0 (0 %) 0.0 (0 %) 78.4 0.0 Shader.ResolveAbi 0.0, Shader.ResolveGraphicsStagesAbi 0.0
title 0.0 (0 %) 0.0 (0 %) 78.4 0.0 Shader.ResolveAbi 0.0, Shader.ResolveGraphicsStagesAbi 0.0
title 0.0 (0 %) 0.0 (0 %) 78.4 0.0 Shader.Register 0.0
title 0.0 (0 %) 0.0 (0 %) 78.4 0.0 Shader.Register 0.0
queue worker 0x20 1.3 (2 %) 74.1 (94 %) 3.0 0.1 Driver.Packet 67.7, Driver.EndSubmission 0.2
title 0.0 (0 %) 0.0 (0 %) 78.4 0.0 Shader.Register 0.0
title 0.0 (0 %) 0.0 (0 %) 78.4 0.0 Shader.Register 0.0
title 0.0 (0 %) 0.0 (0 %) 78.4 0.0 Shader.ResolveGraphicsStagesAbi 0.0
title 0.0 (0 %) 0.0 (0 %) 78.4 0.0 Shader.Register 0.0
gpu 35.4 (45 %) 0.0 (0 %) 43.0 0.0 batch 35.4

Largest slices (ms per frame, inclusive, all threads): Driver.Packet 134.8, Driver.Packet.memory_wait 65.6, batch 35.4, Driver.Packet.dispatch 30.0, Graphics.Draw 27.7, Driver.Commit.draw 27.6, GpuMutex.hold.draw 27.3, Graphics.Draw.draw_and_resource_release 23.4, Driver.Dispatch 20.9, Driver.Packet.draw 15.6

Longest waits

  • Driver.WorkerWait (queue worker 0x20) 6573.5 ms at 27954 ms, present 884
  • Driver.WorkerWait (queue worker 0x0) 5729.2 ms at 27970 ms, present 885
  • Driver.WorkerWait (queue worker 0x20) 2909.6 ms at 39741 ms, present 886
  • Driver.Packet.memory_wait (queue worker 0x20) 2816.9 ms at 44682 ms, present 887
  • Driver.Packet.memory_wait (queue worker 0x20) 1951.9 ms at 37725 ms, present 885
  • Driver.Packet.memory_wait (queue worker 0x20) 1897.9 ms at 42651 ms, present 887
  • Driver.Packet.memory_wait (queue worker 0x20) 1793.1 ms at 35878 ms, present 885
  • Driver.WorkerWait (queue worker 0x20) 1511.1 ms at 88900 ms, present 1163
  • Driver.Packet.memory_wait (queue worker 0x20) 1291.3 ms at 69726 ms, present 985
  • Driver.WorkerWait (queue worker 0x20) 1100.8 ms at 34777 ms, present 885

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

  • batch 27248: 146.6 ms at 89922 ms, present 1164: GPU no ranges; recorded by Driver.WorkerWait (queue worker 0x0) 1036.5, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x0) 1036.5, Driver.Packet (queue worker 0x0) 25.3, Driver.Packet.dispatch (queue worker 0x0) 15.6
  • batch 236: 88.5 ms at 5790 ms, present 93: GPU no ranges; recorded by Driver.Packet (queue worker 0x0) 9.3, Driver.Packet.dispatch (queue worker 0x0) 8.9, Driver.Dispatch (queue worker 0x0) 8.9, Vulkan.Dispatch (queue worker 0x0) 4.0
  • batch 237: 83.9 ms at 5879 ms, present 93: GPU no ranges; recorded by Driver.Packet (queue worker 0x0) 13.2, Driver.Packet.dispatch (queue worker 0x0) 13.2, Driver.Dispatch (queue worker 0x0) 10.3, Vulkan.Dispatch (queue worker 0x0) 9.1
  • batch 11845: 57.3 ms at 28148 ms, present 885: GPU no ranges; recorded by Driver.WorkerWait (queue worker 0x0) 5729.2, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x0) 5729.2, Recorder.Submit (queue worker 0x0) 0.0, Resources.Prepare (queue worker 0x0) 0.0
  • batch 27395: 50.3 ms at 91657 ms, present 1169: GPU no ranges; recorded by Driver.WorkerWait (queue worker 0x0) 892.9, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x0) 892.9, Driver.Packet (queue worker 0x0) 29.6, Driver.Packet.draw (queue worker 0x0) 5.7
trace_digest, run 2 (port)

2103 frames over 149914.4 ms (no summary line found)

Slowest frames (largest slices inside each, inclusive)

  • present 1030: 10892.9 ms at 28234 ms: Driver.WorkerWait (queue worker 0x20) 7382.8, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x20) 7382.8, Driver.WorkerWait (queue worker 0x0) 6083.4, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x0) 6083.4
  • present 1032: 4227.8 ms at 41747 ms: Driver.Packet (queue worker 0x0) 4068.3, Driver.Commit.draw (draw committer) 2694.8, GpuMutex.hold.draw (draw committer) 2688.7, Graphics.Draw (draw committer) 2685.4
  • present 0: 3485.1 ms at 0 ms: Driver.Packet (queue worker 0x0) 39.3, Driver.Packet.device_lock (queue worker 0x0) 25.5, Driver.Commit.draw (draw committer) 23.5, GpuMutex.hold.draw (draw committer) 23.5
  • present 1031: 2620.1 ms at 39127 ms: Driver.Packet (queue worker 0x0) 2581.6, Driver.Commit.draw (draw committer) 1759.1, GpuMutex.hold.draw (draw committer) 1757.7, Graphics.Draw (draw committer) 1755.5
  • present 1033: 1937.7 ms at 45975 ms: Driver.Packet (queue worker 0x20) 1937.6, Driver.Packet (queue worker 0x0) 1907.6, Driver.Packet.memory_wait (queue worker 0x20) 1871.2, Driver.Commit.draw (draw committer) 1467.6

Threads (ms per frame)

thread busy wait untraced in slices < 20 us largest
title 0.0 (0 %) 0.0 (0 %) 71.3 0.0
queue worker 0x0 59.6 (84 %) 6.5 (9 %) 5.2 21.8 Driver.Packet 61.3, Driver.EndSubmission 0.2
draw committer 25.5 (36 %) 0.8 (1 %) 45.1 6.7 Driver.Commit.draw 24.3, Driver.Commit.other 2.0
presenter 0.5 (1 %) 0.9 (1 %) 69.9 0.1 VideoOut.Flip 1.4, Driver.Present 0.0
title 0.2 (0 %) 0.0 (0 %) 71.1 0.0 Shader.ResolveAbi 0.1, Shader.ResolveGraphicsStagesAbi 0.0
title 0.0 (0 %) 0.0 (0 %) 71.3 0.0 Shader.Register 0.0, Shader.ResolveGraphicsStagesAbi 0.0
title 0.0 (0 %) 0.0 (0 %) 71.3 0.0 Shader.Register 0.0
title 0.1 (0 %) 0.0 (0 %) 71.2 0.0 Shader.ResolveAbi 0.1, Shader.ResolveGraphicsStagesAbi 0.0
title 0.1 (0 %) 0.0 (0 %) 71.2 0.0 Shader.ResolveAbi 0.1, Shader.ResolveGraphicsStagesAbi 0.0
title 0.0 (0 %) 0.0 (0 %) 71.3 0.0 Shader.ResolveAbi 0.0, Shader.ResolveGraphicsStagesAbi 0.0
title 0.0 (0 %) 0.0 (0 %) 71.3 0.0 Shader.ResolveAbi 0.0, Shader.ResolveGraphicsStagesAbi 0.0
title 0.0 (0 %) 0.0 (0 %) 71.3 0.0 Shader.ResolveAbi 0.0, Shader.ResolveGraphicsStagesAbi 0.0
title 0.0 (0 %) 0.0 (0 %) 71.3 0.0 Shader.ResolveAbi 0.0, Shader.ResolveGraphicsStagesAbi 0.0
title 0.0 (0 %) 0.0 (0 %) 71.3 0.0 Shader.Register 0.0
title 0.0 (0 %) 0.0 (0 %) 71.3 0.0 Shader.Register 0.0
queue worker 0x20 2.2 (3 %) 66.5 (93 %) 2.5 0.1 Driver.Packet 61.9, Driver.EndSubmission 0.2
title 0.0 (0 %) 0.0 (0 %) 71.3 0.0 Shader.Register 0.0
title 0.0 (0 %) 0.0 (0 %) 71.3 0.0 Shader.Register 0.0
title 0.0 (0 %) 0.0 (0 %) 71.3 0.0 Shader.Register 0.0
title 0.0 (0 %) 0.0 (0 %) 71.3 0.0 Shader.ResolveGraphicsStagesAbi 0.0
title 0.0 (0 %) 0.0 (0 %) 71.3 0.0 Shader.Register 0.0
gpu 33.3 (47 %) 0.0 (0 %) 38.0 0.0 batch 33.3

Largest slices (ms per frame, inclusive, all threads): Driver.Packet 123.2, Driver.Packet.memory_wait 59.8, batch 33.3, Driver.Packet.dispatch 26.8, Graphics.Draw 24.4, Driver.Commit.draw 24.3, GpuMutex.hold.draw 24.1, Graphics.Draw.draw_and_resource_release 20.8, Driver.Dispatch 18.2, Driver.Packet.draw 14.6

Longest waits

  • Driver.WorkerWait (queue worker 0x20) 6324.5 ms at 28218 ms, present 1029
  • Driver.WorkerWait (queue worker 0x0) 5481.4 ms at 28235 ms, present 1030
  • Driver.WorkerWait (queue worker 0x20) 2915.4 ms at 40347 ms, present 1031
  • Driver.Packet.memory_wait (queue worker 0x20) 2619.4 ms at 37648 ms, present 1030
  • Driver.Packet.memory_wait (queue worker 0x20) 2251.8 ms at 45181 ms, present 1032
  • Driver.Packet.memory_wait (queue worker 0x20) 1732.6 ms at 35845 ms, present 1030
  • Driver.Packet.memory_wait (queue worker 0x20) 1712.8 ms at 43263 ms, present 1032
  • Driver.WorkerWait (queue worker 0x20) 1571.6 ms at 89025 ms, present 1383
  • Driver.WorkerWait (queue worker 0x20) 1075.0 ms at 34770 ms, present 1030
  • Driver.WorkerWait (queue worker 0x0) 1014.4 ms at 89581 ms, present 1384

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

  • batch 29483: 146.7 ms at 90172 ms, present 1384: GPU no ranges; recorded by Driver.WorkerWait (queue worker 0x0) 1014.4, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x0) 1014.4, Driver.Packet (queue worker 0x0) 20.1, Driver.Packet.dispatch (queue worker 0x0) 6.2
  • batch 186: 88.6 ms at 5276 ms, present 76: GPU no ranges; recorded by Driver.Packet (queue worker 0x0) 7.5, Driver.Packet.dispatch (queue worker 0x0) 7.5, Driver.Dispatch (queue worker 0x0) 5.4, Vulkan.Dispatch (queue worker 0x0) 4.5
  • batch 187: 85.6 ms at 5375 ms, present 76: GPU no ranges; recorded by Driver.Packet (queue worker 0x0) 94.8, Driver.Packet.dispatch (queue worker 0x0) 94.7, Driver.Dispatch (queue worker 0x0) 94.6, Vulkan.Dispatch (queue worker 0x0) 94.2
  • batch 12699: 54.2 ms at 28404 ms, present 1030: GPU no ranges; recorded by Driver.WorkerWait (queue worker 0x0) 5481.4, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x0) 5481.4, Recorder.Submit (queue worker 0x0) 0.1, Resources.Prepare (queue worker 0x0) 0.0
  • batch 29641: 50.3 ms at 91956 ms, present 1389: GPU no ranges; recorded by Driver.WorkerWait (queue worker 0x0) 880.2, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x0) 880.2, Driver.Packet (queue worker 0x0) 35.4, Driver.Packet.dispatch (queue worker 0x0) 14.6
trace_digest, run 3 (base)

1888 frames over 149975.6 ms (no summary line found)

Slowest frames (largest slices inside each, inclusive)

  • present 853: 10448.1 ms at 27936 ms: Driver.WorkerWait (queue worker 0x20) 7650.9, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x20) 7650.9, Driver.WorkerWait (queue worker 0x0) 6302.8, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x0) 6302.7
  • present 0: 3701.7 ms at 0 ms: Driver.Packet (queue worker 0x0) 42.1, Driver.Packet.device_lock (queue worker 0x0) 28.5, Driver.Commit.draw (draw committer) 26.6, GpuMutex.hold.draw (draw committer) 26.6
  • present 855: 2788.3 ms at 40917 ms: Driver.Packet (queue worker 0x0) 2661.8, Driver.Commit.draw (draw committer) 2027.3, GpuMutex.hold.draw (draw committer) 2025.1, Graphics.Draw (draw committer) 2022.6
  • present 854: 2532.7 ms at 38384 ms: Driver.Packet (queue worker 0x0) 2514.5, Driver.WorkerWait (queue worker 0x20) 1965.2, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x20) 1965.2, Driver.Commit.draw (draw committer) 1688.6
  • present 857: 2403.1 ms at 45872 ms: Driver.Packet (queue worker 0x20) 2399.5, Driver.Packet (queue worker 0x0) 2388.6, Driver.Packet.memory_wait (queue worker 0x20) 2368.5, Driver.Commit.draw (draw committer) 1534.1

Threads (ms per frame)

thread busy wait untraced in slices < 20 us largest
title 0.0 (0 %) 0.2 (0 %) 79.2 0.0
queue worker 0x0 66.8 (84 %) 6.9 (9 %) 5.8 23.4 Driver.Packet 68.1, Driver.EndSubmission 0.2
draw committer 28.5 (36 %) 0.9 (1 %) 50.0 7.1 Driver.Commit.draw 27.2, Driver.Commit.other 2.2
presenter 0.5 (1 %) 1.0 (1 %) 77.9 0.1 VideoOut.Flip 1.5, Driver.Present 0.0
title 0.1 (0 %) 0.0 (0 %) 79.3 0.0 Shader.ResolveAbi 0.1, Shader.ResolveGraphicsStagesAbi 0.0
title 0.0 (0 %) 0.0 (0 %) 79.4 0.0 Shader.Register 0.0, Shader.ResolveGraphicsStagesAbi 0.0
title 0.0 (0 %) 0.0 (0 %) 79.4 0.0 Shader.Register 0.0
title 0.0 (0 %) 0.0 (0 %) 79.4 0.0 Shader.ResolveAbi 0.0, Shader.ResolveGraphicsStagesAbi 0.0
title 0.0 (0 %) 0.0 (0 %) 79.4 0.0 Shader.ResolveAbi 0.0, Shader.ResolveGraphicsStagesAbi 0.0
title 0.0 (0 %) 0.0 (0 %) 79.4 0.0 Shader.ResolveAbi 0.0, Shader.ResolveGraphicsStagesAbi 0.0
title 0.0 (0 %) 0.0 (0 %) 79.4 0.0 Shader.ResolveAbi 0.0, Shader.ResolveGraphicsStagesAbi 0.0
title 0.0 (0 %) 0.0 (0 %) 79.4 0.0 Shader.ResolveAbi 0.0, Shader.ResolveGraphicsStagesAbi 0.0
title 0.0 (0 %) 0.0 (0 %) 79.4 0.0 Shader.ResolveAbi 0.0, Shader.ResolveGraphicsStagesAbi 0.0
title 0.0 (0 %) 0.0 (0 %) 79.4 0.0 Shader.Register 0.0
title 0.0 (0 %) 0.0 (0 %) 79.4 0.0 Shader.Register 0.0
queue worker 0x20 2.2 (3 %) 74.3 (93 %) 3.0 0.1 Driver.Packet 68.6, Driver.EndSubmission 0.2
title 0.0 (0 %) 0.0 (0 %) 79.4 0.0 Shader.Register 0.0
title 0.0 (0 %) 0.0 (0 %) 79.4 0.0 Shader.Register 0.0
title 0.0 (0 %) 0.0 (0 %) 79.4 0.0 Shader.ResolveGraphicsStagesAbi 0.0
gpu 35.6 (45 %) 0.0 (0 %) 43.8 0.0 batch 35.6

Largest slices (ms per frame, inclusive, all threads): Driver.Packet 136.7, Driver.Packet.memory_wait 66.7, batch 35.6, Driver.Packet.dispatch 30.7, Graphics.Draw 27.2, Driver.Commit.draw 27.2, GpuMutex.hold.draw 26.9, Graphics.Draw.draw_and_resource_release 23.5, Driver.Dispatch 21.6, Driver.Packet.draw 15.2

Longest waits

  • Driver.WorkerWait (queue worker 0x20) 6539.4 ms at 27918 ms, present 852
  • Driver.WorkerWait (queue worker 0x0) 5658.0 ms at 27936 ms, present 853
  • Driver.WorkerWait (queue worker 0x20) 2651.8 ms at 38952 ms, present 854
  • Driver.Packet.memory_wait (queue worker 0x20) 1869.1 ms at 44860 ms, present 856
  • Driver.Packet.memory_wait (queue worker 0x20) 1851.8 ms at 46763 ms, present 857
  • Driver.Packet.memory_wait (queue worker 0x20) 1623.7 ms at 35844 ms, present 853
  • Driver.Packet.memory_wait (queue worker 0x20) 1609.1 ms at 43161 ms, present 855
  • Driver.WorkerWait (queue worker 0x20) 1581.6 ms at 88539 ms, present 1183
  • Driver.Packet.memory_wait (queue worker 0x20) 1432.1 ms at 37510 ms, present 853
  • Driver.Packet.memory_wait (queue worker 0x20) 1176.2 ms at 95968 ms, present 1219

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

  • batch 27916: 144.7 ms at 89614 ms, present 1184: GPU no ranges; recorded by Driver.WorkerWait (queue worker 0x0) 1067.4, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x0) 1067.4, Driver.Packet (queue worker 0x0) 49.4, Driver.Packet.dispatch (queue worker 0x0) 34.8
  • batch 210: 89.1 ms at 5693 ms, present 82: GPU no ranges; recorded by Driver.Packet (queue worker 0x0) 11.5, Driver.Packet.dispatch (queue worker 0x0) 11.5, Driver.Dispatch (queue worker 0x0) 6.5, Vulkan.Dispatch (queue worker 0x0) 5.1
  • batch 211: 84.4 ms at 5782 ms, present 82: GPU no ranges; recorded by Driver.Packet (queue worker 0x0) 7.7, Driver.Packet.dispatch (queue worker 0x0) 7.7, Driver.Dispatch (queue worker 0x0) 7.3, Vulkan.Dispatch (queue worker 0x0) 5.1
  • batch 11428: 55.9 ms at 28106 ms, present 853: GPU no ranges; recorded by Driver.WorkerWait (queue worker 0x0) 5658.0, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x0) 5658.0, Recorder.Submit (queue worker 0x0) 0.1, Resources.Prepare (queue worker 0x0) 0.0
  • batch 28048: 48.1 ms at 91438 ms, present 1188: GPU no ranges; recorded by Driver.WorkerWait (queue worker 0x0) 827.9, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x0) 827.9, Driver.Packet (queue worker 0x0) 23.7, Driver.Packet.dispatch (queue worker 0x0) 1.0
trace_digest, run 4 (port)

2059 frames over 149945.3 ms (no summary line found)

Slowest frames (largest slices inside each, inclusive)

  • present 927: 11148.0 ms at 27932 ms: Driver.WorkerWait (queue worker 0x20) 7572.6, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x20) 7572.6, Driver.WorkerWait (queue worker 0x0) 6250.5, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x0) 6250.5
  • present 929: 4298.7 ms at 41770 ms: Driver.Packet (queue worker 0x0) 4141.2, Driver.Commit.draw (draw committer) 3074.7, GpuMutex.hold.draw (draw committer) 3067.9, Graphics.Draw (draw committer) 3063.8
  • present 0: 3692.8 ms at 0 ms: Driver.Packet (queue worker 0x0) 42.4, Driver.Packet.device_lock (queue worker 0x0) 28.5, Driver.Commit.draw (draw committer) 26.4, GpuMutex.hold.draw (draw committer) 26.4
  • present 928: 2690.2 ms at 39080 ms: Driver.Packet (queue worker 0x0) 2635.9, Driver.Commit.draw (draw committer) 1718.0, GpuMutex.hold.draw (draw committer) 1710.6, Graphics.Draw (draw committer) 1707.6
  • present 930: 1848.5 ms at 46069 ms: Driver.Packet (queue worker 0x20) 1848.4, Driver.Packet (queue worker 0x0) 1819.3, Driver.Packet.memory_wait (queue worker 0x20) 1802.6, Driver.Commit.draw (draw committer) 1430.9

Threads (ms per frame)

thread busy wait untraced in slices < 20 us largest
title 0.0 (0 %) 0.0 (0 %) 72.8 0.0
queue worker 0x0 60.5 (83 %) 6.9 (9 %) 5.5 23.1 Driver.Packet 62.0, Driver.EndSubmission 0.2
draw committer 26.9 (37 %) 0.8 (1 %) 45.2 6.9 Driver.Commit.draw 25.8, Driver.Commit.other 1.8
presenter 0.5 (1 %) 1.2 (2 %) 71.2 0.1 VideoOut.Flip 1.6, Driver.Present 0.0
title 0.1 (0 %) 0.0 (0 %) 72.7 0.0 Shader.ResolveAbi 0.1, Shader.ResolveGraphicsStagesAbi 0.0
title 0.0 (0 %) 0.0 (0 %) 72.8 0.0 Shader.Register 0.0, Shader.ResolveGraphicsStagesAbi 0.0
title 0.0 (0 %) 0.0 (0 %) 72.8 0.0 Shader.Register 0.0
title 0.0 (0 %) 0.0 (0 %) 72.8 0.0 Shader.ResolveAbi 0.0, Shader.ResolveGraphicsStagesAbi 0.0
title 0.0 (0 %) 0.0 (0 %) 72.8 0.0 Shader.ResolveAbi 0.0, Shader.ResolveGraphicsStagesAbi 0.0
title 0.0 (0 %) 0.0 (0 %) 72.8 0.0 Shader.ResolveAbi 0.0, Shader.ResolveGraphicsStagesAbi 0.0
title 0.0 (0 %) 0.0 (0 %) 72.8 0.0 Shader.ResolveAbi 0.0, Shader.ResolveGraphicsStagesAbi 0.0
title 0.0 (0 %) 0.0 (0 %) 72.8 0.0 Shader.ResolveAbi 0.0, Shader.ResolveGraphicsStagesAbi 0.0
title 0.0 (0 %) 0.0 (0 %) 72.8 0.0 Shader.ResolveAbi 0.0, Shader.ResolveGraphicsStagesAbi 0.0
title 0.0 (0 %) 0.0 (0 %) 72.8 0.0 Shader.Register 0.0
title 0.0 (0 %) 0.0 (0 %) 72.8 0.0 Shader.Register 0.0
queue worker 0x20 2.1 (3 %) 67.9 (93 %) 2.8 0.1 Driver.Packet 62.8, Driver.EndSubmission 0.2
title 0.0 (0 %) 0.0 (0 %) 72.8 0.0 Shader.Register 0.0
title 0.0 (0 %) 0.0 (0 %) 72.8 0.0 Shader.Register 0.0
title 0.0 (0 %) 0.0 (0 %) 72.8 0.0 Shader.ResolveGraphicsStagesAbi 0.0
gpu 35.0 (48 %) 0.0 (0 %) 37.8 0.0 batch 35.0

Largest slices (ms per frame, inclusive, all threads): Driver.Packet 124.8, Driver.Packet.memory_wait 60.8, batch 35.0, Driver.Packet.dispatch 26.6, Graphics.Draw 25.9, Driver.Commit.draw 25.8, GpuMutex.hold.draw 25.6, Graphics.Draw.draw_and_resource_release 22.1, Driver.Dispatch 17.9, Driver.Packet.draw 14.8

Longest waits

  • Driver.WorkerWait (queue worker 0x20) 6480.1 ms at 27915 ms, present 926
  • Driver.WorkerWait (queue worker 0x0) 5630.7 ms at 27932 ms, present 927
  • Driver.WorkerWait (queue worker 0x20) 3046.3 ms at 40306 ms, present 928
  • Driver.Packet.memory_wait (queue worker 0x20) 2692.4 ms at 37583 ms, present 927
  • Driver.Packet.memory_wait (queue worker 0x20) 2330.1 ms at 45116 ms, present 929
  • Driver.Packet.memory_wait (queue worker 0x20) 1817.9 ms at 35763 ms, present 927
  • Driver.WorkerWait (queue worker 0x20) 1790.7 ms at 88279 ms, present 1253
  • Driver.Packet.memory_wait (queue worker 0x20) 1633.8 ms at 43353 ms, present 929
  • Driver.WorkerWait (queue worker 0x0) 1596.0 ms at 88464 ms, present 1254
  • Driver.WorkerWait (queue worker 0x20) 1109.8 ms at 34653 ms, present 927

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

  • batch 28086: 144.1 ms at 88943 ms, present 1254: GPU no ranges; recorded by Driver.WorkerWait (queue worker 0x0) 1596.0, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x0) 1596.0, Driver.Packet (queue worker 0x0) 30.4, Driver.Packet.dispatch (queue worker 0x0) 2.7
  • batch 212: 88.8 ms at 5656 ms, present 84: GPU no ranges; recorded by Driver.Packet (queue worker 0x0) 11.3, Driver.Packet.dispatch (queue worker 0x0) 11.3, Driver.Dispatch (queue worker 0x0) 11.3, Driver.Dispatch.materialize (queue worker 0x0) 7.5
  • batch 213: 84.3 ms at 5744 ms, present 84: GPU no ranges; recorded by Driver.Packet (queue worker 0x0) 12.8, Driver.Packet.dispatch (queue worker 0x0) 12.8, Driver.Dispatch (queue worker 0x0) 12.8, Driver.Dispatch.materialize (queue worker 0x0) 6.3
  • batch 11798: 52.9 ms at 28125 ms, present 927: GPU no ranges; recorded by Driver.WorkerWait (queue worker 0x0) 5630.7, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x0) 5630.7, Resources.Prepare (queue worker 0x0) 0.2, Recorder.Submit (queue worker 0x0) 0.0
  • batch 28241: 46.9 ms at 91350 ms, present 1259: GPU no ranges; recorded by Driver.WorkerWait (queue worker 0x0) 1002.8, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x0) 1002.8, Driver.Packet (queue worker 0x0) 39.6, Driver.Packet.dispatch (queue worker 0x0) 11.1
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6268138557 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6615#issuecomment-6268138557). Originally posted by [moong15](https://github.com/moong15) on 2026-10-19T13:16:48Z. --- Evidence from Stellar Blade on Windows (MinGW build): this stack gives about **+7% presents** in gameplay over two pairs. **What was measured.** This PR's stack (#6615 including #6292; #6522 was already in our tree) ported onto a downstream perf branch: origin/main 4ffb0cd12 plus local AGC performance changes. The port keeps the PR's mechanism (atomic mutexes, explicit GPU-lock recursion, TEB slots) adapted to our tree. Base is the same tree without the port. It is not a clean main-vs-PR comparison. - Base `ab1a4186593e`, port `1b89c36184a1` (both clean builds, `dirty: false`) - Windows 11 10.0.26300, Ryzen 7 9800X3D, Radeon RX 9070 XT, AMD driver 26.8.1 (LLPC), 3840x2160 - Same env in every run: `APS5_FLAT_3D_COLOR_TARGET=1 APS5_CONTINUE_AFTER_FLIP_FAILURE=1 APS5_PREBUILD_THREADS=16 APS5_PIPELINE_DMA=1 APS5_HOST_IMPORT_MIB=16384 APS5_TRACE_SECONDS=0:150 APS5_TRACE_SUMMARY_EVERY=10 APS5_TRACE_EVENTS=4194304`, warm shader cache, no `APS5_PROFILE_*` - The same scripted Cross presses in every run (`APS5_PAD_INPUT_FILE`, every 5 s from 8 s). Window: 49-150 s after launch, which is in-world gameplay after the first load. - Whole traces: `trace_dropped` is false in every window. Before the port, a queue-0 sample profile of steady gameplay had about 4.9% of queue-0 time in winpthreads lock and TLS calls (`__emutls_get_address` 2.1% including its spin lock 1.5%, `pthread_mutex_lock`/`timedlock` 1.9%, unlock 0.5%, rwlock 0.4%). | Run | Build | Presents (49-150 s) | fps | p50 ms | p90 ms | p99 ms | |---|---|---|---|---|---|---| | 1 | base | 1022 | 10.12 | 71.7 | 151.8 | 584.3 | | 2 | port | 1068 | 10.57 | 64.9 | 150.8 | 491.0 | | 3 | base | 1029 | 10.19 | 70.5 | 156.1 | 539.6 | | 4 | port | 1127 | 11.16 | 61.6 | 148.2 | 422.0 | - Pair 1 (runs 1/2): **+4.5%**. Pair 2 (runs 3/4): **+9.5%**. p50 -9% and -13%, p99 -16% and -22%. - Peak commit was 0.75-1.2 GB higher with the port (30.9/31.2 GB vs 30.2/30.0 GB). - Queue 0 stays about 99% busy in both builds, so the gain is CPU time removed from the queue-0 path. Traces and summary files are available on request. <details><summary>trace_digest, run 1 (base)</summary> 1912 frames over 149995.1 ms (no summary line found) **Slowest frames** (largest slices inside each, inclusive) - present 885: 10814.9 ms at 27970 ms: Driver.WorkerWait (queue worker 0x20) 7657.6, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x20) 7657.6, Driver.WorkerWait (queue worker 0x0) 6350.9, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x0) 6350.8 - present 0: 3741.2 ms at 0 ms: Driver.Packet (queue worker 0x0) 40.5, Driver.Packet.device_lock (queue worker 0x0) 26.6, Driver.Commit.draw (draw committer) 24.4, GpuMutex.hold.draw (draw committer) 24.4 - present 887: 3592.2 ms at 41902 ms: Driver.Packet (queue worker 0x0) 3438.3, Driver.Packet (queue worker 0x20) 2772.4, Driver.Packet.memory_wait (queue worker 0x20) 2709.9, Driver.Commit.draw (draw committer) 2409.5 - present 886: 3116.5 ms at 38785 ms: Driver.Packet (queue worker 0x0) 3089.9, Driver.WorkerWait (queue worker 0x20) 2160.1, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x20) 2160.1, Driver.Commit.draw (draw committer) 2093.8 - present 888: 2582.3 ms at 45494 ms: Driver.Packet (queue worker 0x20) 2582.0, Driver.Packet.memory_wait (queue worker 0x20) 2542.2, Driver.Packet (queue worker 0x0) 2516.9, Driver.Commit.draw (draw committer) 2021.4 **Threads** (ms per frame) | thread | busy | wait | untraced | in slices < 20 us | largest | |---|---|---|---|---|---| | title | 0.0 (0 %) | 0.2 (0 %) | 78.3 | 0.0 | | | queue worker 0x0 | 66.5 (85 %) | 6.1 (8 %) | 5.9 | 23.8 | Driver.Packet 67.1, Driver.EndSubmission 0.2 | | draw committer | 29.0 (37 %) | 0.9 (1 %) | 48.5 | 7.0 | Driver.Commit.draw 27.6, Driver.Commit.other 2.3 | | presenter | 0.5 (1 %) | 1.4 (2 %) | 76.5 | 0.1 | VideoOut.Flip 2.0, Driver.Present 0.0 | | title | 0.1 (0 %) | 0.0 (0 %) | 78.4 | 0.0 | Shader.ResolveAbi 0.1, Shader.ResolveGraphicsStagesAbi 0.0 | | title | 0.0 (0 %) | 0.0 (0 %) | 78.4 | 0.0 | Shader.Register 0.0, Shader.ResolveGraphicsStagesAbi 0.0 | | title | 0.0 (0 %) | 0.0 (0 %) | 78.4 | 0.0 | Shader.Register 0.0 | | title | 0.0 (0 %) | 0.0 (0 %) | 78.4 | 0.0 | Shader.ResolveAbi 0.0, Shader.ResolveGraphicsStagesAbi 0.0 | | title | 0.0 (0 %) | 0.0 (0 %) | 78.4 | 0.0 | Shader.ResolveAbi 0.0, Shader.ResolveGraphicsStagesAbi 0.0 | | title | 0.0 (0 %) | 0.0 (0 %) | 78.4 | 0.0 | Shader.ResolveAbi 0.0, Shader.ResolveGraphicsStagesAbi 0.0 | | title | 0.0 (0 %) | 0.0 (0 %) | 78.4 | 0.0 | Shader.ResolveAbi 0.0, Shader.ResolveGraphicsStagesAbi 0.0 | | title | 0.0 (0 %) | 0.0 (0 %) | 78.4 | 0.0 | Shader.ResolveAbi 0.0, Shader.ResolveGraphicsStagesAbi 0.0 | | title | 0.0 (0 %) | 0.0 (0 %) | 78.4 | 0.0 | Shader.ResolveAbi 0.0, Shader.ResolveGraphicsStagesAbi 0.0 | | title | 0.0 (0 %) | 0.0 (0 %) | 78.4 | 0.0 | Shader.Register 0.0 | | title | 0.0 (0 %) | 0.0 (0 %) | 78.4 | 0.0 | Shader.Register 0.0 | | queue worker 0x20 | 1.3 (2 %) | 74.1 (94 %) | 3.0 | 0.1 | Driver.Packet 67.7, Driver.EndSubmission 0.2 | | title | 0.0 (0 %) | 0.0 (0 %) | 78.4 | 0.0 | Shader.Register 0.0 | | title | 0.0 (0 %) | 0.0 (0 %) | 78.4 | 0.0 | Shader.Register 0.0 | | title | 0.0 (0 %) | 0.0 (0 %) | 78.4 | 0.0 | Shader.ResolveGraphicsStagesAbi 0.0 | | title | 0.0 (0 %) | 0.0 (0 %) | 78.4 | 0.0 | Shader.Register 0.0 | | gpu | 35.4 (45 %) | 0.0 (0 %) | 43.0 | 0.0 | batch 35.4 | **Largest slices** (ms per frame, inclusive, all threads): Driver.Packet 134.8, Driver.Packet.memory_wait 65.6, batch 35.4, Driver.Packet.dispatch 30.0, Graphics.Draw 27.7, Driver.Commit.draw 27.6, GpuMutex.hold.draw 27.3, Graphics.Draw.draw_and_resource_release 23.4, Driver.Dispatch 20.9, Driver.Packet.draw 15.6 **Longest waits** - Driver.WorkerWait (queue worker 0x20) 6573.5 ms at 27954 ms, present 884 - Driver.WorkerWait (queue worker 0x0) 5729.2 ms at 27970 ms, present 885 - Driver.WorkerWait (queue worker 0x20) 2909.6 ms at 39741 ms, present 886 - Driver.Packet.memory_wait (queue worker 0x20) 2816.9 ms at 44682 ms, present 887 - Driver.Packet.memory_wait (queue worker 0x20) 1951.9 ms at 37725 ms, present 885 - Driver.Packet.memory_wait (queue worker 0x20) 1897.9 ms at 42651 ms, present 887 - Driver.Packet.memory_wait (queue worker 0x20) 1793.1 ms at 35878 ms, present 885 - Driver.WorkerWait (queue worker 0x20) 1511.1 ms at 88900 ms, present 1163 - Driver.Packet.memory_wait (queue worker 0x20) 1291.3 ms at 69726 ms, present 985 - Driver.WorkerWait (queue worker 0x20) 1100.8 ms at 34777 ms, present 885 **Largest GPU batches** (GPU ranges inside, and the CPU slices that recorded each, inclusive) - batch 27248: 146.6 ms at 89922 ms, present 1164: GPU no ranges; recorded by Driver.WorkerWait (queue worker 0x0) 1036.5, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x0) 1036.5, Driver.Packet (queue worker 0x0) 25.3, Driver.Packet.dispatch (queue worker 0x0) 15.6 - batch 236: 88.5 ms at 5790 ms, present 93: GPU no ranges; recorded by Driver.Packet (queue worker 0x0) 9.3, Driver.Packet.dispatch (queue worker 0x0) 8.9, Driver.Dispatch (queue worker 0x0) 8.9, Vulkan.Dispatch (queue worker 0x0) 4.0 - batch 237: 83.9 ms at 5879 ms, present 93: GPU no ranges; recorded by Driver.Packet (queue worker 0x0) 13.2, Driver.Packet.dispatch (queue worker 0x0) 13.2, Driver.Dispatch (queue worker 0x0) 10.3, Vulkan.Dispatch (queue worker 0x0) 9.1 - batch 11845: 57.3 ms at 28148 ms, present 885: GPU no ranges; recorded by Driver.WorkerWait (queue worker 0x0) 5729.2, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x0) 5729.2, Recorder.Submit (queue worker 0x0) 0.0, Resources.Prepare (queue worker 0x0) 0.0 - batch 27395: 50.3 ms at 91657 ms, present 1169: GPU no ranges; recorded by Driver.WorkerWait (queue worker 0x0) 892.9, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x0) 892.9, Driver.Packet (queue worker 0x0) 29.6, Driver.Packet.draw (queue worker 0x0) 5.7 </details> <details><summary>trace_digest, run 2 (port)</summary> 2103 frames over 149914.4 ms (no summary line found) **Slowest frames** (largest slices inside each, inclusive) - present 1030: 10892.9 ms at 28234 ms: Driver.WorkerWait (queue worker 0x20) 7382.8, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x20) 7382.8, Driver.WorkerWait (queue worker 0x0) 6083.4, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x0) 6083.4 - present 1032: 4227.8 ms at 41747 ms: Driver.Packet (queue worker 0x0) 4068.3, Driver.Commit.draw (draw committer) 2694.8, GpuMutex.hold.draw (draw committer) 2688.7, Graphics.Draw (draw committer) 2685.4 - present 0: 3485.1 ms at 0 ms: Driver.Packet (queue worker 0x0) 39.3, Driver.Packet.device_lock (queue worker 0x0) 25.5, Driver.Commit.draw (draw committer) 23.5, GpuMutex.hold.draw (draw committer) 23.5 - present 1031: 2620.1 ms at 39127 ms: Driver.Packet (queue worker 0x0) 2581.6, Driver.Commit.draw (draw committer) 1759.1, GpuMutex.hold.draw (draw committer) 1757.7, Graphics.Draw (draw committer) 1755.5 - present 1033: 1937.7 ms at 45975 ms: Driver.Packet (queue worker 0x20) 1937.6, Driver.Packet (queue worker 0x0) 1907.6, Driver.Packet.memory_wait (queue worker 0x20) 1871.2, Driver.Commit.draw (draw committer) 1467.6 **Threads** (ms per frame) | thread | busy | wait | untraced | in slices < 20 us | largest | |---|---|---|---|---|---| | title | 0.0 (0 %) | 0.0 (0 %) | 71.3 | 0.0 | | | queue worker 0x0 | 59.6 (84 %) | 6.5 (9 %) | 5.2 | 21.8 | Driver.Packet 61.3, Driver.EndSubmission 0.2 | | draw committer | 25.5 (36 %) | 0.8 (1 %) | 45.1 | 6.7 | Driver.Commit.draw 24.3, Driver.Commit.other 2.0 | | presenter | 0.5 (1 %) | 0.9 (1 %) | 69.9 | 0.1 | VideoOut.Flip 1.4, Driver.Present 0.0 | | title | 0.2 (0 %) | 0.0 (0 %) | 71.1 | 0.0 | Shader.ResolveAbi 0.1, Shader.ResolveGraphicsStagesAbi 0.0 | | title | 0.0 (0 %) | 0.0 (0 %) | 71.3 | 0.0 | Shader.Register 0.0, Shader.ResolveGraphicsStagesAbi 0.0 | | title | 0.0 (0 %) | 0.0 (0 %) | 71.3 | 0.0 | Shader.Register 0.0 | | title | 0.1 (0 %) | 0.0 (0 %) | 71.2 | 0.0 | Shader.ResolveAbi 0.1, Shader.ResolveGraphicsStagesAbi 0.0 | | title | 0.1 (0 %) | 0.0 (0 %) | 71.2 | 0.0 | Shader.ResolveAbi 0.1, Shader.ResolveGraphicsStagesAbi 0.0 | | title | 0.0 (0 %) | 0.0 (0 %) | 71.3 | 0.0 | Shader.ResolveAbi 0.0, Shader.ResolveGraphicsStagesAbi 0.0 | | title | 0.0 (0 %) | 0.0 (0 %) | 71.3 | 0.0 | Shader.ResolveAbi 0.0, Shader.ResolveGraphicsStagesAbi 0.0 | | title | 0.0 (0 %) | 0.0 (0 %) | 71.3 | 0.0 | Shader.ResolveAbi 0.0, Shader.ResolveGraphicsStagesAbi 0.0 | | title | 0.0 (0 %) | 0.0 (0 %) | 71.3 | 0.0 | Shader.ResolveAbi 0.0, Shader.ResolveGraphicsStagesAbi 0.0 | | title | 0.0 (0 %) | 0.0 (0 %) | 71.3 | 0.0 | Shader.Register 0.0 | | title | 0.0 (0 %) | 0.0 (0 %) | 71.3 | 0.0 | Shader.Register 0.0 | | queue worker 0x20 | 2.2 (3 %) | 66.5 (93 %) | 2.5 | 0.1 | Driver.Packet 61.9, Driver.EndSubmission 0.2 | | title | 0.0 (0 %) | 0.0 (0 %) | 71.3 | 0.0 | Shader.Register 0.0 | | title | 0.0 (0 %) | 0.0 (0 %) | 71.3 | 0.0 | Shader.Register 0.0 | | title | 0.0 (0 %) | 0.0 (0 %) | 71.3 | 0.0 | Shader.Register 0.0 | | title | 0.0 (0 %) | 0.0 (0 %) | 71.3 | 0.0 | Shader.ResolveGraphicsStagesAbi 0.0 | | title | 0.0 (0 %) | 0.0 (0 %) | 71.3 | 0.0 | Shader.Register 0.0 | | gpu | 33.3 (47 %) | 0.0 (0 %) | 38.0 | 0.0 | batch 33.3 | **Largest slices** (ms per frame, inclusive, all threads): Driver.Packet 123.2, Driver.Packet.memory_wait 59.8, batch 33.3, Driver.Packet.dispatch 26.8, Graphics.Draw 24.4, Driver.Commit.draw 24.3, GpuMutex.hold.draw 24.1, Graphics.Draw.draw_and_resource_release 20.8, Driver.Dispatch 18.2, Driver.Packet.draw 14.6 **Longest waits** - Driver.WorkerWait (queue worker 0x20) 6324.5 ms at 28218 ms, present 1029 - Driver.WorkerWait (queue worker 0x0) 5481.4 ms at 28235 ms, present 1030 - Driver.WorkerWait (queue worker 0x20) 2915.4 ms at 40347 ms, present 1031 - Driver.Packet.memory_wait (queue worker 0x20) 2619.4 ms at 37648 ms, present 1030 - Driver.Packet.memory_wait (queue worker 0x20) 2251.8 ms at 45181 ms, present 1032 - Driver.Packet.memory_wait (queue worker 0x20) 1732.6 ms at 35845 ms, present 1030 - Driver.Packet.memory_wait (queue worker 0x20) 1712.8 ms at 43263 ms, present 1032 - Driver.WorkerWait (queue worker 0x20) 1571.6 ms at 89025 ms, present 1383 - Driver.WorkerWait (queue worker 0x20) 1075.0 ms at 34770 ms, present 1030 - Driver.WorkerWait (queue worker 0x0) 1014.4 ms at 89581 ms, present 1384 **Largest GPU batches** (GPU ranges inside, and the CPU slices that recorded each, inclusive) - batch 29483: 146.7 ms at 90172 ms, present 1384: GPU no ranges; recorded by Driver.WorkerWait (queue worker 0x0) 1014.4, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x0) 1014.4, Driver.Packet (queue worker 0x0) 20.1, Driver.Packet.dispatch (queue worker 0x0) 6.2 - batch 186: 88.6 ms at 5276 ms, present 76: GPU no ranges; recorded by Driver.Packet (queue worker 0x0) 7.5, Driver.Packet.dispatch (queue worker 0x0) 7.5, Driver.Dispatch (queue worker 0x0) 5.4, Vulkan.Dispatch (queue worker 0x0) 4.5 - batch 187: 85.6 ms at 5375 ms, present 76: GPU no ranges; recorded by Driver.Packet (queue worker 0x0) 94.8, Driver.Packet.dispatch (queue worker 0x0) 94.7, Driver.Dispatch (queue worker 0x0) 94.6, Vulkan.Dispatch (queue worker 0x0) 94.2 - batch 12699: 54.2 ms at 28404 ms, present 1030: GPU no ranges; recorded by Driver.WorkerWait (queue worker 0x0) 5481.4, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x0) 5481.4, Recorder.Submit (queue worker 0x0) 0.1, Resources.Prepare (queue worker 0x0) 0.0 - batch 29641: 50.3 ms at 91956 ms, present 1389: GPU no ranges; recorded by Driver.WorkerWait (queue worker 0x0) 880.2, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x0) 880.2, Driver.Packet (queue worker 0x0) 35.4, Driver.Packet.dispatch (queue worker 0x0) 14.6 </details> <details><summary>trace_digest, run 3 (base)</summary> 1888 frames over 149975.6 ms (no summary line found) **Slowest frames** (largest slices inside each, inclusive) - present 853: 10448.1 ms at 27936 ms: Driver.WorkerWait (queue worker 0x20) 7650.9, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x20) 7650.9, Driver.WorkerWait (queue worker 0x0) 6302.8, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x0) 6302.7 - present 0: 3701.7 ms at 0 ms: Driver.Packet (queue worker 0x0) 42.1, Driver.Packet.device_lock (queue worker 0x0) 28.5, Driver.Commit.draw (draw committer) 26.6, GpuMutex.hold.draw (draw committer) 26.6 - present 855: 2788.3 ms at 40917 ms: Driver.Packet (queue worker 0x0) 2661.8, Driver.Commit.draw (draw committer) 2027.3, GpuMutex.hold.draw (draw committer) 2025.1, Graphics.Draw (draw committer) 2022.6 - present 854: 2532.7 ms at 38384 ms: Driver.Packet (queue worker 0x0) 2514.5, Driver.WorkerWait (queue worker 0x20) 1965.2, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x20) 1965.2, Driver.Commit.draw (draw committer) 1688.6 - present 857: 2403.1 ms at 45872 ms: Driver.Packet (queue worker 0x20) 2399.5, Driver.Packet (queue worker 0x0) 2388.6, Driver.Packet.memory_wait (queue worker 0x20) 2368.5, Driver.Commit.draw (draw committer) 1534.1 **Threads** (ms per frame) | thread | busy | wait | untraced | in slices < 20 us | largest | |---|---|---|---|---|---| | title | 0.0 (0 %) | 0.2 (0 %) | 79.2 | 0.0 | | | queue worker 0x0 | 66.8 (84 %) | 6.9 (9 %) | 5.8 | 23.4 | Driver.Packet 68.1, Driver.EndSubmission 0.2 | | draw committer | 28.5 (36 %) | 0.9 (1 %) | 50.0 | 7.1 | Driver.Commit.draw 27.2, Driver.Commit.other 2.2 | | presenter | 0.5 (1 %) | 1.0 (1 %) | 77.9 | 0.1 | VideoOut.Flip 1.5, Driver.Present 0.0 | | title | 0.1 (0 %) | 0.0 (0 %) | 79.3 | 0.0 | Shader.ResolveAbi 0.1, Shader.ResolveGraphicsStagesAbi 0.0 | | title | 0.0 (0 %) | 0.0 (0 %) | 79.4 | 0.0 | Shader.Register 0.0, Shader.ResolveGraphicsStagesAbi 0.0 | | title | 0.0 (0 %) | 0.0 (0 %) | 79.4 | 0.0 | Shader.Register 0.0 | | title | 0.0 (0 %) | 0.0 (0 %) | 79.4 | 0.0 | Shader.ResolveAbi 0.0, Shader.ResolveGraphicsStagesAbi 0.0 | | title | 0.0 (0 %) | 0.0 (0 %) | 79.4 | 0.0 | Shader.ResolveAbi 0.0, Shader.ResolveGraphicsStagesAbi 0.0 | | title | 0.0 (0 %) | 0.0 (0 %) | 79.4 | 0.0 | Shader.ResolveAbi 0.0, Shader.ResolveGraphicsStagesAbi 0.0 | | title | 0.0 (0 %) | 0.0 (0 %) | 79.4 | 0.0 | Shader.ResolveAbi 0.0, Shader.ResolveGraphicsStagesAbi 0.0 | | title | 0.0 (0 %) | 0.0 (0 %) | 79.4 | 0.0 | Shader.ResolveAbi 0.0, Shader.ResolveGraphicsStagesAbi 0.0 | | title | 0.0 (0 %) | 0.0 (0 %) | 79.4 | 0.0 | Shader.ResolveAbi 0.0, Shader.ResolveGraphicsStagesAbi 0.0 | | title | 0.0 (0 %) | 0.0 (0 %) | 79.4 | 0.0 | Shader.Register 0.0 | | title | 0.0 (0 %) | 0.0 (0 %) | 79.4 | 0.0 | Shader.Register 0.0 | | queue worker 0x20 | 2.2 (3 %) | 74.3 (93 %) | 3.0 | 0.1 | Driver.Packet 68.6, Driver.EndSubmission 0.2 | | title | 0.0 (0 %) | 0.0 (0 %) | 79.4 | 0.0 | Shader.Register 0.0 | | title | 0.0 (0 %) | 0.0 (0 %) | 79.4 | 0.0 | Shader.Register 0.0 | | title | 0.0 (0 %) | 0.0 (0 %) | 79.4 | 0.0 | Shader.ResolveGraphicsStagesAbi 0.0 | | gpu | 35.6 (45 %) | 0.0 (0 %) | 43.8 | 0.0 | batch 35.6 | **Largest slices** (ms per frame, inclusive, all threads): Driver.Packet 136.7, Driver.Packet.memory_wait 66.7, batch 35.6, Driver.Packet.dispatch 30.7, Graphics.Draw 27.2, Driver.Commit.draw 27.2, GpuMutex.hold.draw 26.9, Graphics.Draw.draw_and_resource_release 23.5, Driver.Dispatch 21.6, Driver.Packet.draw 15.2 **Longest waits** - Driver.WorkerWait (queue worker 0x20) 6539.4 ms at 27918 ms, present 852 - Driver.WorkerWait (queue worker 0x0) 5658.0 ms at 27936 ms, present 853 - Driver.WorkerWait (queue worker 0x20) 2651.8 ms at 38952 ms, present 854 - Driver.Packet.memory_wait (queue worker 0x20) 1869.1 ms at 44860 ms, present 856 - Driver.Packet.memory_wait (queue worker 0x20) 1851.8 ms at 46763 ms, present 857 - Driver.Packet.memory_wait (queue worker 0x20) 1623.7 ms at 35844 ms, present 853 - Driver.Packet.memory_wait (queue worker 0x20) 1609.1 ms at 43161 ms, present 855 - Driver.WorkerWait (queue worker 0x20) 1581.6 ms at 88539 ms, present 1183 - Driver.Packet.memory_wait (queue worker 0x20) 1432.1 ms at 37510 ms, present 853 - Driver.Packet.memory_wait (queue worker 0x20) 1176.2 ms at 95968 ms, present 1219 **Largest GPU batches** (GPU ranges inside, and the CPU slices that recorded each, inclusive) - batch 27916: 144.7 ms at 89614 ms, present 1184: GPU no ranges; recorded by Driver.WorkerWait (queue worker 0x0) 1067.4, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x0) 1067.4, Driver.Packet (queue worker 0x0) 49.4, Driver.Packet.dispatch (queue worker 0x0) 34.8 - batch 210: 89.1 ms at 5693 ms, present 82: GPU no ranges; recorded by Driver.Packet (queue worker 0x0) 11.5, Driver.Packet.dispatch (queue worker 0x0) 11.5, Driver.Dispatch (queue worker 0x0) 6.5, Vulkan.Dispatch (queue worker 0x0) 5.1 - batch 211: 84.4 ms at 5782 ms, present 82: GPU no ranges; recorded by Driver.Packet (queue worker 0x0) 7.7, Driver.Packet.dispatch (queue worker 0x0) 7.7, Driver.Dispatch (queue worker 0x0) 7.3, Vulkan.Dispatch (queue worker 0x0) 5.1 - batch 11428: 55.9 ms at 28106 ms, present 853: GPU no ranges; recorded by Driver.WorkerWait (queue worker 0x0) 5658.0, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x0) 5658.0, Recorder.Submit (queue worker 0x0) 0.1, Resources.Prepare (queue worker 0x0) 0.0 - batch 28048: 48.1 ms at 91438 ms, present 1188: GPU no ranges; recorded by Driver.WorkerWait (queue worker 0x0) 827.9, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x0) 827.9, Driver.Packet (queue worker 0x0) 23.7, Driver.Packet.dispatch (queue worker 0x0) 1.0 </details> <details><summary>trace_digest, run 4 (port)</summary> 2059 frames over 149945.3 ms (no summary line found) **Slowest frames** (largest slices inside each, inclusive) - present 927: 11148.0 ms at 27932 ms: Driver.WorkerWait (queue worker 0x20) 7572.6, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x20) 7572.6, Driver.WorkerWait (queue worker 0x0) 6250.5, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x0) 6250.5 - present 929: 4298.7 ms at 41770 ms: Driver.Packet (queue worker 0x0) 4141.2, Driver.Commit.draw (draw committer) 3074.7, GpuMutex.hold.draw (draw committer) 3067.9, Graphics.Draw (draw committer) 3063.8 - present 0: 3692.8 ms at 0 ms: Driver.Packet (queue worker 0x0) 42.4, Driver.Packet.device_lock (queue worker 0x0) 28.5, Driver.Commit.draw (draw committer) 26.4, GpuMutex.hold.draw (draw committer) 26.4 - present 928: 2690.2 ms at 39080 ms: Driver.Packet (queue worker 0x0) 2635.9, Driver.Commit.draw (draw committer) 1718.0, GpuMutex.hold.draw (draw committer) 1710.6, Graphics.Draw (draw committer) 1707.6 - present 930: 1848.5 ms at 46069 ms: Driver.Packet (queue worker 0x20) 1848.4, Driver.Packet (queue worker 0x0) 1819.3, Driver.Packet.memory_wait (queue worker 0x20) 1802.6, Driver.Commit.draw (draw committer) 1430.9 **Threads** (ms per frame) | thread | busy | wait | untraced | in slices < 20 us | largest | |---|---|---|---|---|---| | title | 0.0 (0 %) | 0.0 (0 %) | 72.8 | 0.0 | | | queue worker 0x0 | 60.5 (83 %) | 6.9 (9 %) | 5.5 | 23.1 | Driver.Packet 62.0, Driver.EndSubmission 0.2 | | draw committer | 26.9 (37 %) | 0.8 (1 %) | 45.2 | 6.9 | Driver.Commit.draw 25.8, Driver.Commit.other 1.8 | | presenter | 0.5 (1 %) | 1.2 (2 %) | 71.2 | 0.1 | VideoOut.Flip 1.6, Driver.Present 0.0 | | title | 0.1 (0 %) | 0.0 (0 %) | 72.7 | 0.0 | Shader.ResolveAbi 0.1, Shader.ResolveGraphicsStagesAbi 0.0 | | title | 0.0 (0 %) | 0.0 (0 %) | 72.8 | 0.0 | Shader.Register 0.0, Shader.ResolveGraphicsStagesAbi 0.0 | | title | 0.0 (0 %) | 0.0 (0 %) | 72.8 | 0.0 | Shader.Register 0.0 | | title | 0.0 (0 %) | 0.0 (0 %) | 72.8 | 0.0 | Shader.ResolveAbi 0.0, Shader.ResolveGraphicsStagesAbi 0.0 | | title | 0.0 (0 %) | 0.0 (0 %) | 72.8 | 0.0 | Shader.ResolveAbi 0.0, Shader.ResolveGraphicsStagesAbi 0.0 | | title | 0.0 (0 %) | 0.0 (0 %) | 72.8 | 0.0 | Shader.ResolveAbi 0.0, Shader.ResolveGraphicsStagesAbi 0.0 | | title | 0.0 (0 %) | 0.0 (0 %) | 72.8 | 0.0 | Shader.ResolveAbi 0.0, Shader.ResolveGraphicsStagesAbi 0.0 | | title | 0.0 (0 %) | 0.0 (0 %) | 72.8 | 0.0 | Shader.ResolveAbi 0.0, Shader.ResolveGraphicsStagesAbi 0.0 | | title | 0.0 (0 %) | 0.0 (0 %) | 72.8 | 0.0 | Shader.ResolveAbi 0.0, Shader.ResolveGraphicsStagesAbi 0.0 | | title | 0.0 (0 %) | 0.0 (0 %) | 72.8 | 0.0 | Shader.Register 0.0 | | title | 0.0 (0 %) | 0.0 (0 %) | 72.8 | 0.0 | Shader.Register 0.0 | | queue worker 0x20 | 2.1 (3 %) | 67.9 (93 %) | 2.8 | 0.1 | Driver.Packet 62.8, Driver.EndSubmission 0.2 | | title | 0.0 (0 %) | 0.0 (0 %) | 72.8 | 0.0 | Shader.Register 0.0 | | title | 0.0 (0 %) | 0.0 (0 %) | 72.8 | 0.0 | Shader.Register 0.0 | | title | 0.0 (0 %) | 0.0 (0 %) | 72.8 | 0.0 | Shader.ResolveGraphicsStagesAbi 0.0 | | gpu | 35.0 (48 %) | 0.0 (0 %) | 37.8 | 0.0 | batch 35.0 | **Largest slices** (ms per frame, inclusive, all threads): Driver.Packet 124.8, Driver.Packet.memory_wait 60.8, batch 35.0, Driver.Packet.dispatch 26.6, Graphics.Draw 25.9, Driver.Commit.draw 25.8, GpuMutex.hold.draw 25.6, Graphics.Draw.draw_and_resource_release 22.1, Driver.Dispatch 17.9, Driver.Packet.draw 14.8 **Longest waits** - Driver.WorkerWait (queue worker 0x20) 6480.1 ms at 27915 ms, present 926 - Driver.WorkerWait (queue worker 0x0) 5630.7 ms at 27932 ms, present 927 - Driver.WorkerWait (queue worker 0x20) 3046.3 ms at 40306 ms, present 928 - Driver.Packet.memory_wait (queue worker 0x20) 2692.4 ms at 37583 ms, present 927 - Driver.Packet.memory_wait (queue worker 0x20) 2330.1 ms at 45116 ms, present 929 - Driver.Packet.memory_wait (queue worker 0x20) 1817.9 ms at 35763 ms, present 927 - Driver.WorkerWait (queue worker 0x20) 1790.7 ms at 88279 ms, present 1253 - Driver.Packet.memory_wait (queue worker 0x20) 1633.8 ms at 43353 ms, present 929 - Driver.WorkerWait (queue worker 0x0) 1596.0 ms at 88464 ms, present 1254 - Driver.WorkerWait (queue worker 0x20) 1109.8 ms at 34653 ms, present 927 **Largest GPU batches** (GPU ranges inside, and the CPU slices that recorded each, inclusive) - batch 28086: 144.1 ms at 88943 ms, present 1254: GPU no ranges; recorded by Driver.WorkerWait (queue worker 0x0) 1596.0, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x0) 1596.0, Driver.Packet (queue worker 0x0) 30.4, Driver.Packet.dispatch (queue worker 0x0) 2.7 - batch 212: 88.8 ms at 5656 ms, present 84: GPU no ranges; recorded by Driver.Packet (queue worker 0x0) 11.3, Driver.Packet.dispatch (queue worker 0x0) 11.3, Driver.Dispatch (queue worker 0x0) 11.3, Driver.Dispatch.materialize (queue worker 0x0) 7.5 - batch 213: 84.3 ms at 5744 ms, present 84: GPU no ranges; recorded by Driver.Packet (queue worker 0x0) 12.8, Driver.Packet.dispatch (queue worker 0x0) 12.8, Driver.Dispatch (queue worker 0x0) 12.8, Driver.Dispatch.materialize (queue worker 0x0) 6.3 - batch 11798: 52.9 ms at 28125 ms, present 927: GPU no ranges; recorded by Driver.WorkerWait (queue worker 0x0) 5630.7, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x0) 5630.7, Resources.Prepare (queue worker 0x0) 0.2, Recorder.Submit (queue worker 0x0) 0.0 - batch 28241: 46.9 ms at 91350 ms, present 1259: GPU no ranges; recorded by Driver.WorkerWait (queue worker 0x0) 1002.8, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x0) 1002.8, Driver.Packet (queue worker 0x0) 39.6, Driver.Packet.dispatch (queue worker 0x0) 11.1 </details>
github-actions[bot] commented 2026-10-20 12:15:59 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-20T12:15:59Z.


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

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6290621845 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6615#issuecomment-6290621845). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-20T12:15:59Z. --- <!-- pr-labels-perf --> This pull request is labeled `perf`, so it needs the summary line of a capture on `main` and one with the change, from the same title, scene and machine, as the Performance report form asks. Please paste both `aps5-summary.jsonl` lines, attach the two traces and add the output of `tools/trace_digest.py`.
CnRJay commented 2026-10-21 18:05:51 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by CnRJay on 2026-10-21T18:05:51Z.

Review: COMMENTED


The profile is honest about the size: __emutls_get_address 1.24-1.51 samples per frame down to 0.92-1.17, fastRevalidate 0.66-0.72 to 0.56-0.63, "about 1% of the work". That is a small gain for 813 lines, stacked on #6292 (708 lines) and rebased onto it repeatedly.

  • The code added is a ThreadScratch<T, Tag> layer plus HostThreadSlot conversions of nine scratch vectors and two thread-locals. Every future thread-local on the revalidation path now has to choose between thread_local and this, and Linux/macOS keep thread_local, so the two behaviors must stay identical. State the rule for new code, and have check_conventions.py flag a new thread_local in the draw path, otherwise this regresses silently.
  • There is no frame-rate number. 1% of the worker's samples on one menu page is within the spread of the titles it was measured on. Post the pair (summary lines of #6292 alone and #6292 + this PR, same scene, no APS5_PROFILE_*) so the 1% can be seen or dropped.
  • If #6292 does not land, this has nothing to attach to. Consider whether the HostThreadSlot conversions can go in with #6292 as the second stage I suggested there, and this PR closes.
<!-- greyfinch-sync:boykopovar/AnyPS5:review:5604096846 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6615#pullrequestreview-5604096846). Originally posted by [CnRJay](https://github.com/CnRJay) on 2026-10-21T18:05:51Z. **Review:** COMMENTED --- The profile is honest about the size: `__emutls_get_address` 1.24-1.51 samples per frame down to 0.92-1.17, `fastRevalidate` 0.66-0.72 to 0.56-0.63, "about 1% of the work". That is a small gain for 813 lines, stacked on #6292 (708 lines) and rebased onto it repeatedly. - The code added is a `ThreadScratch<T, Tag>` layer plus `HostThreadSlot` conversions of nine scratch vectors and two thread-locals. Every future thread-local on the revalidation path now has to choose between `thread_local` and this, and Linux/macOS keep `thread_local`, so the two behaviors must stay identical. State the rule for new code, and have `check_conventions.py` flag a new `thread_local` in the draw path, otherwise this regresses silently. - There is no frame-rate number. 1% of the worker's samples on one menu page is within the spread of the titles it was measured on. Post the pair (summary lines of #6292 alone and #6292 + this PR, same scene, no `APS5_PROFILE_*`) so the 1% can be seen or dropped. - If #6292 does not land, this has nothing to attach to. Consider whether the `HostThreadSlot` conversions can go in with #6292 as the second stage I suggested there, and this PR closes.
jotitadev commented 2026-10-30 18:44:09 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by jotitadev on 2026-10-30T18:44:09Z.

Review: COMMENTED


On the NVIDIA CI build failure at 07bb9f628 ('refreshing' was not declared in this scope, Texture.cpp): this is a merge skew with #8911, not a toolchain issue.

#8911 (68f51b5a0b, merged 25/10, after this head) added a new reader of the old thread_local refreshing in the nothingToStore lambda at the top of StorageTexture::FlushPending. This PR replaces that variable with the Refreshing HostThreadSlot, and git merges the two cleanly, so the new line keeps naming a variable that no longer exists. It is the only error: a -k 0 build of libSceAgcDriver on the merge with main f91137142 reports just this line.

Fix, one line in the merged FlushPending:

             std::lock_guard lock(pending.mutex);
-            const auto* exempt = refreshing;
+            const auto* exempt = Refreshing::Get();

With it, libSceAgcDriver builds (Linux, GCC 15.2, Release, -DANYPS5_ENABLE_SPIRV_TOOLS=ON). On an RTX 3070 (NVIDIA 595.99.02), agc_driver_queued_index_read_order (#8911's test) and the 39 tests in agc_driver_graphics_tests pass, 40/40 in each of 3 runs. I did not run the full suite.

Written with AI assistance (Claude Code). I ran the builds and tests above on my machine.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5717123600 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6615#pullrequestreview-5717123600). Originally posted by [jotitadev](https://github.com/jotitadev) on 2026-10-30T18:44:09Z. **Review:** COMMENTED --- On the NVIDIA CI build failure at `07bb9f628` (`'refreshing' was not declared in this scope`, `Texture.cpp`): this is a merge skew with #8911, not a toolchain issue. #8911 (`68f51b5a0b`, merged 25/10, after this head) added a new reader of the old `thread_local refreshing` in the `nothingToStore` lambda at the top of `StorageTexture::FlushPending`. This PR replaces that variable with the `Refreshing` `HostThreadSlot`, and git merges the two cleanly, so the new line keeps naming a variable that no longer exists. It is the only error: a `-k 0` build of `libSceAgcDriver` on the merge with `main` `f91137142` reports just this line. Fix, one line in the merged `FlushPending`: ```diff std::lock_guard lock(pending.mutex); - const auto* exempt = refreshing; + const auto* exempt = Refreshing::Get(); ``` With it, `libSceAgcDriver` builds (Linux, GCC 15.2, Release, `-DANYPS5_ENABLE_SPIRV_TOOLS=ON`). On an RTX 3070 (NVIDIA 595.99.02), `agc_driver_queued_index_read_order` (#8911's test) and the 39 tests in `agc_driver_graphics_tests` pass, 40/40 in each of 3 runs. I did not run the full suite. Written with AI assistance (Claude Code). I ran the builds and tests above on my machine.
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!6615
No description provided.