perf(agc): keep unimported label stores on the CPU #7464

Merged
Dripl1x merged 17 commits from upstream-pr/7464 into main 2026-11-21 02:06:33 +00:00
Dripl1x commented 2026-10-18 08:46:45 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Dripl1x on 2026-10-18T08:46:45Z.


What

Store a queue-0 label on the CPU after a recorder sync when no host import covers its destination, instead of importing the destination's allocation for the label. VulkanDevice::WriteLabelOnGpu takes that path only for queue 0 and only while no submit is held (Recorder::SubmitHeld()); it returns a new code 7, which every caller (commitLabel in PacketMemory.cpp, recordDeferredLabels in DeferredLabels.cpp) handles like code 1: a CPU store without a device drain. Labels on compute queues, labels behind a held submit and labels whose memory an import already covers keep main's path (import on demand, store recorded on the GPU). The [sync] profile line counts the new path on its own: no covering import (recorder synced) among the fallbacks and on the CPU with no covering import (recorder synced) among the stores (SynchronizationStatistics).

A label the driver stores from the CPU (commitLabel, recordDeferredLabels) also ends short guest sleeps (#6658), as a completed GPU batch or a flip already does.

Why it depends on #7465. On main a small block is imported when the title maps it, so its labels find a covering import and this path does not run. #7465 leaves mappings of 64 KiB or less unimported until their first GPU use. In SuperTuxKart (PPSA69421) that first use is a label, so with #7465 alone each of the blocks the menu maps every frame is imported by its first label instead, and the frame rate stays at main's. With this PR on top, those labels are stored on the CPU after a recorder sync and the blocks are not imported at all:

Build Commit FPS, run 1 / run 2 frame p50 ms
main 94fbb8cea8 9.91 / 10.24 99.8 / 94.3
main + #7465 a1cee90f52 10.29 / 10.19 94.7 / 95.6
main + #7465 + this PR 223f2469f5 25.87 / 25.99 37.7 / 37.9

The cost of the path is visible in the same traces: Recorder.Sync takes 12.0 ms per frame on the draw committer, which #7465 alone does not show, and the frame still drops from 94.7 to 37.7 ms (p50).

Tested

This head is 223f2469f5: current main 94fbb8cea8, #7465's head a1cee90f52, and this PR's five commits on top, picked without conflicts and unchanged from the previous head b31bc845fb. Windows 11 Pro 26300, Ryzen 7 5800H, WinLibs GCC 15.2.0 r7, Release.

  • NVIDIA GeForce RTX 3070 Laptop GPU, NVIDIA 617.42, ANYPS5_NO_SHADER_CACHE=1, three runs each: the 74 tests built from tests/Recorder.cpp, and agc_driver_indirect_arguments_pending_producer, agc_driver_unimported_label_order, agc_driver_cpu_label_wake, agc_driver_same_queue_label_wait, agc_driver_alias_copy_label, agc_driver_pipelined_dma, agc_driver_graphics, agc_driver_host_import_windows, agc_driver_host_import_at_map, agc_driver_host_import_teardown, guest_sleep_wake, guest_sleep_wake_coarse, guest_nanosleep, precise_wait. 88/88 on this head; 87/87 on main and on #7465 (agc_driver_cpu_label_wake is added here).
  • Validation layer, the same set once on main 94fbb8cea8 and on this head (VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation, ANYPS5_NO_SHADER_CACHE=1, ANYPS5_REQUIRE_VULKAN=1, ctest -V, RTX 3070 Laptop GPU, NVIDIA 617.42; DISABLE_LAYER=1 turns off a third-party implicit layer installed here, FPS Monitor, whose vkDestroyInstance hook crashes later instance lookups): 87/87 and 88/88 pass, neither log reports was not found but was requested by env var VK_INSTANCE_LAYERS, and both report the same VUIDs the same number of times (VUID-VkImageViewCreateInfo-usage-02275 4, VUID-vkCmdCopyBuffer-srcBuffer-00118 2). The change adds none.
  • AMD Radeon(TM) Graphics (the Ryzen 7 5800H's integrated GPU, driver 31.0.21925.1001, selected with ANYPS5_GPU=AMD), the same set once and once under the validation layer: 85/88 on this head, 84/87 on main and on #7465. The same three tests fail on all three trees (agc_sample_dumps, agc_driver_vertex_target_range_copied, agc_driver_vertex_target_range_imported), so they are main's; the validation logs report the same VUIDs as on NVIDIA and none new.
  • Linux (WSL Ubuntu 26.04, GCC, lavapipe llvmpipe (LLVM 21.1.8)): libSceAgcDriver builds; agc_driver_unimported_label_order, agc_driver_cpu_label_wake, agc_driver_same_queue_label_wait, agc_driver_indirect_arguments_pending_producer, guest_sleep_wake and agc_driver_host_import_windows pass.
  • Negative controls, on the previous head b31bc845fb with the same source: without the queue-0 gate the compute-queue case fails with reason 7; with SubmitHeld() ignoring a held batch still in flight the held-batch case fails after its 5 s watchdog; without the two wake calls agc_driver_cpu_label_wake fails.
  • tools/check_conventions.py passes for this range.
  • Not run: the whole CTest suite, and titles other than SuperTuxKart.

SuperTuxKart captures. RTX 3070 Laptop GPU, NVIDIA 617.42, same machine and build as above; SuperTuxKart (PPSA69421) tutorial prompt over the main menu, 1920x1080 internal rendering in a maximized 2560x1369 window, warm shader caches, audio muted, no input; APS5_TRACE_SECONDS=20:8 with APS5_TRACE_EVENTS=1048576, console output not redirected, no other APS5_* switch; 2026-10-22, one session, order main, #7465, this PR, this PR, #7465, main; every run kept the window in the foreground, and every summary line reports dirty: false and trace_dropped: false.

Summary lines (main, #7465, this PR, this PR, #7465, main)
{"commit":"94fbb8cea80a","dirty":false,"env":{"APS5_TRACE_EVENTS":"1048576","APS5_TRACE_SECONDS":"20:8"},"gpu":"NVIDIA GeForce RTX 3070 Laptop GPU","driver":"NVIDIA 617.42","os":"Windows 10.0.26300","cpu":"AMD Ryzen 7 5800H with Radeon Graphics","cpu_threads":16,"memory_mib":64863,"title_id":"PPSA69421","title":"SuperTuxKart","content_version":"00.001.000","resolution":"1920x1080","window":{"spec":"seconds 20:8","first_present":38,"ms":8076.426},"presents":80,"frame_ms":{"p50":99.757,"p90":110.517,"p99":128.310,"max":128.310},"gpu_busy_ms_per_present":5.610,"worker_busy_pct":{"queue worker 0x0":2.846},"top_phases_ms_per_frame":{"Graphics.Draw":7.873,"Graphics.Draw.draw_and_resource_release":7.574,"Vulkan.DrawFromRecipe":6.254,"Graphics.DrawWithRecipe":6.229,"Graphics.DrawWithRecipe.draw_and_resource_release":6.216,"Recorder.Submit":2.908,"Driver.Packet":2.834,"Driver.Packet.draw":2.260},"trace_dropped":false,"trace":"aps5-trace-94fbb8cea80a-424.json.gz"}
{"commit":"a1cee90f52cc","dirty":false,"env":{"APS5_TRACE_EVENTS":"1048576","APS5_TRACE_SECONDS":"20:8"},"gpu":"NVIDIA GeForce RTX 3070 Laptop GPU","driver":"NVIDIA 617.42","os":"Windows 10.0.26300","cpu":"AMD Ryzen 7 5800H with Radeon Graphics","cpu_threads":16,"memory_mib":64863,"title_id":"PPSA69421","title":"SuperTuxKart","content_version":"00.001.000","resolution":"1920x1080","window":{"spec":"seconds 20:8","first_present":55,"ms":8065.429},"presents":83,"frame_ms":{"p50":94.730,"p90":106.217,"p99":129.954,"max":129.954},"gpu_busy_ms_per_present":5.650,"worker_busy_pct":{"queue worker 0x0":2.889},"top_phases_ms_per_frame":{"Graphics.Draw":8.166,"Graphics.Draw.draw_and_resource_release":7.877,"Vulkan.DrawFromRecipe":6.616,"Graphics.DrawWithRecipe":6.589,"Graphics.DrawWithRecipe.draw_and_resource_release":6.576,"Recorder.Submit":2.785,"Driver.Packet":2.769,"Driver.Packet.draw":2.207},"trace_dropped":false,"trace":"aps5-trace-a1cee90f52cc-21452.json.gz"}
{"commit":"223f2469f5b7","dirty":false,"env":{"APS5_TRACE_EVENTS":"1048576","APS5_TRACE_SECONDS":"20:8"},"gpu":"NVIDIA GeForce RTX 3070 Laptop GPU","driver":"NVIDIA 617.42","os":"Windows 10.0.26300","cpu":"AMD Ryzen 7 5800H with Radeon Graphics","cpu_threads":16,"memory_mib":64863,"title_id":"PPSA69421","title":"SuperTuxKart","content_version":"00.001.000","resolution":"1920x1080","window":{"spec":"seconds 20:8","first_present":131,"ms":8002.835},"presents":207,"frame_ms":{"p50":37.675,"p90":42.179,"p99":54.788,"max":57.409},"gpu_busy_ms_per_present":4.721,"worker_busy_pct":{"queue worker 0x0":5.801},"top_phases_ms_per_frame":{"Recorder.Sync":11.955,"Graphics.Draw":6.348,"Graphics.Draw.draw_and_resource_release":6.104,"Vulkan.DrawFromRecipe":5.275,"Graphics.DrawWithRecipe":5.255,"Graphics.DrawWithRecipe.draw_and_resource_release":5.243,"Recorder.Submit":2.463,"Driver.Packet":2.212},"trace_dropped":false,"trace":"aps5-trace-223f2469f5b7-7524.json.gz"}
{"commit":"223f2469f5b7","dirty":false,"env":{"APS5_TRACE_EVENTS":"1048576","APS5_TRACE_SECONDS":"20:8"},"gpu":"NVIDIA GeForce RTX 3070 Laptop GPU","driver":"NVIDIA 617.42","os":"Windows 10.0.26300","cpu":"AMD Ryzen 7 5800H with Radeon Graphics","cpu_threads":16,"memory_mib":64863,"title_id":"PPSA69421","title":"SuperTuxKart","content_version":"00.001.000","resolution":"1920x1080","window":{"spec":"seconds 20:8","first_present":136,"ms":8002.542},"presents":208,"frame_ms":{"p50":37.925,"p90":41.354,"p99":46.729,"max":49.249},"gpu_busy_ms_per_present":4.706,"worker_busy_pct":{"queue worker 0x0":5.815},"top_phases_ms_per_frame":{"Recorder.Sync":11.984,"Graphics.Draw":6.381,"Graphics.Draw.draw_and_resource_release":6.138,"Vulkan.DrawFromRecipe":5.259,"Graphics.DrawWithRecipe":5.238,"Graphics.DrawWithRecipe.draw_and_resource_release":5.227,"Recorder.Submit":2.455,"Driver.Packet":2.205},"trace_dropped":false,"trace":"aps5-trace-223f2469f5b7-36088.json.gz"}
{"commit":"a1cee90f52cc","dirty":false,"env":{"APS5_TRACE_EVENTS":"1048576","APS5_TRACE_SECONDS":"20:8"},"gpu":"NVIDIA GeForce RTX 3070 Laptop GPU","driver":"NVIDIA 617.42","os":"Windows 10.0.26300","cpu":"AMD Ryzen 7 5800H with Radeon Graphics","cpu_threads":16,"memory_mib":64863,"title_id":"PPSA69421","title":"SuperTuxKart","content_version":"00.001.000","resolution":"1920x1080","window":{"spec":"seconds 20:8","first_present":60,"ms":8047.206},"presents":82,"frame_ms":{"p50":95.592,"p90":109.603,"p99":121.282,"max":121.282},"gpu_busy_ms_per_present":5.638,"worker_busy_pct":{"queue worker 0x0":2.804},"top_phases_ms_per_frame":{"Graphics.Draw":8.185,"Graphics.Draw.draw_and_resource_release":7.900,"Vulkan.DrawFromRecipe":6.988,"Graphics.DrawWithRecipe":6.962,"Graphics.DrawWithRecipe.draw_and_resource_release":6.949,"Recorder.Submit":2.777,"Driver.Packet":2.710,"Driver.Packet.draw":2.157},"trace_dropped":false,"trace":"aps5-trace-a1cee90f52cc-30808.json.gz"}
{"commit":"94fbb8cea80a","dirty":false,"env":{"APS5_TRACE_EVENTS":"1048576","APS5_TRACE_SECONDS":"20:8"},"gpu":"NVIDIA GeForce RTX 3070 Laptop GPU","driver":"NVIDIA 617.42","os":"Windows 10.0.26300","cpu":"AMD Ryzen 7 5800H with Radeon Graphics","cpu_threads":16,"memory_mib":64863,"title_id":"PPSA69421","title":"SuperTuxKart","content_version":"00.001.000","resolution":"1920x1080","window":{"spec":"seconds 20:8","first_present":60,"ms":8004.322},"presents":82,"frame_ms":{"p50":94.350,"p90":108.262,"p99":142.124,"max":142.124},"gpu_busy_ms_per_present":5.714,"worker_busy_pct":{"queue worker 0x0":2.913},"top_phases_ms_per_frame":{"Graphics.Draw":7.571,"Graphics.Draw.draw_and_resource_release":7.276,"Vulkan.DrawFromRecipe":6.235,"Graphics.DrawWithRecipe":6.207,"Graphics.DrawWithRecipe.draw_and_resource_release":6.194,"Recorder.Submit":2.886,"Driver.Packet":2.803,"Driver.Packet.draw":2.235},"trace_dropped":false,"trace":"aps5-trace-94fbb8cea80a-36604.json.gz"}
tools/performance_compare.py (first capture of #7465 against the first capture of this PR)

**Performance comparison
**

Capture Commit Trace Presents Window (ms)
baseline a1cee90f52 aps5-trace-a1cee90f52cc-21452.json.gz 83 8065.429
candidate 223f2469f5 aps5-trace-223f2469f5b7-7524.json.gz 207 8002.835
  • Compare captures from the same machine, title, content version and scene; matching recorded metadata cannot verify the physical machine or scene.
  • Changes are candidate minus baseline. A negative frame-time change means a shorter frame interval.
  • A missing top phase is unreported, not zero; its change is unavailable.
  • Recorded configuration differs; these measurements do not isolate the code change.

**Configuration differences
**

Setting Baseline Candidate
window.first_present 55 131

**Frame and GPU times (ms)
**

Metric Baseline Candidate Change Change (%)
frame_ms.p50 94.730 37.675 -57.055 -60.229
frame_ms.p90 106.217 42.179 -64.038 -60.290
frame_ms.p99 129.954 54.788 -75.166 -57.840
frame_ms.max 129.954 57.409 -72.545 -55.824
mean_frame_ms 97.174 38.661 -58.513 -60.215
gpu_busy_ms_per_present 5.650 4.721 -0.929 -16.442

**Top phases (ms per frame)
**

Metric Baseline Candidate Change Change (%)
Driver.Packet 2.769 2.212 -0.557 -20.116
Driver.Packet.draw 2.207 n/a n/a n/a
Graphics.Draw 8.166 6.348 -1.818 -22.263
Graphics.Draw.draw_and_resource_release 7.877 6.104 -1.773 -22.509
Graphics.DrawWithRecipe 6.589 5.255 -1.334 -20.246
Graphics.DrawWithRecipe.draw_and_resource_release 6.576 5.243 -1.333 -20.271
Recorder.Submit 2.785 2.463 -0.322 -11.562
Recorder.Sync n/a 11.955 n/a n/a
Vulkan.DrawFromRecipe 6.616 5.275 -1.341 -20.269
tools/trace_digest.py (first capture of #7465, then of this PR; every digest is in the evidence archive)

v23-s02-7465

seconds 20:8 from present 55: 83 presents, frame p50 94.7 / p90 106.2 / p99 130.0 / max 130.0 ms, GPU busy 5.7 ms per present
NVIDIA GeForce RTX 3070 Laptop GPU, NVIDIA 617.42, Windows 10.0.26300, 1920x1080, commit a1cee90f52, dropped: no

{"commit":"a1cee90f52cc","dirty":false,"env":{"APS5_TRACE_EVENTS":"1048576","APS5_TRACE_SECONDS":"20:8"},"gpu":"NVIDIA GeForce RTX 3070 Laptop GPU","driver":"NVIDIA 617.42","os":"Windows 10.0.26300","cpu":"AMD Ryzen 7 5800H with Radeon Graphics","cpu_threads":16,"memory_mib":64863,"title_id":"PPSA69421","title":"SuperTuxKart","content_version":"00.001.000","resolution":"1920x1080","window":{"spec":"seconds 20:8","first_present":55,"ms":8065.429},"presents":83,"frame_ms":{"p50":94.73,"p90":106.217,"p99":129.954,"max":129.954},"gpu_busy_ms_per_present":5.65,"worker_busy_pct":{"queue worker 0x0":2.889},"top_phases_ms_per_frame":{"Graphics.Draw":8.166,"Graphics.Draw.draw_and_resource_release":7.877,"Vulkan.DrawFromRecipe":6.616,"Graphics.DrawWithRecipe":6.589,"Graphics.DrawWithRecipe.draw_and_resource_release":6.576,"Recorder.Submit":2.785,"Driver.Packet":2.769,"Driver.Packet.draw":2.207},"trace_dropped":false,"trace":"aps5-trace-a1cee90f52cc-21452.json.gz"}

Slowest frames (largest slices inside each, inclusive)

  • present 128: 130.0 ms at 7006 ms: Driver.WorkerWait (queue worker 0x0) 125.1, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x0) 125.0, Graphics.Draw (draw committer) 13.4, Graphics.Draw.draw_and_resource_release (draw committer) 13.0
  • present 127: 124.1 ms at 6882 ms: Driver.WorkerWait (queue worker 0x0) 119.4, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x0) 119.3, Graphics.Draw (draw committer) 12.5, Graphics.Draw.draw_and_resource_release (draw committer) 12.1
  • present 129: 122.4 ms at 7136 ms: Driver.WorkerWait (queue worker 0x0) 117.9, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x0) 117.7, Graphics.Draw (draw committer) 12.4, Graphics.Draw.draw_and_resource_release (draw committer) 12.0

Threads (ms per frame)

thread busy wait untraced in slices < 20 us largest
title 0.2 (0 %) 0.0 (0 %) 97.0 0.4 Recorder.Sync 0.2
queue worker 0x0 2.0 (2 %) 94.0 (97 %) 1.1 4.0 Driver.Packet 2.0
draw committer 17.6 (18 %) 0.6 (1 %) 79.0 0.2 Graphics.Draw 8.2, Vulkan.DrawFromRecipe 6.6
presenter 0.9 (1 %) 0.0 (0 %) 96.2 0.1 VideoOut.Flip 0.9, Driver.Present 0.0
gpu 5.7 (6 %) 0.0 (0 %) 91.5 0.0 batch 5.7

Largest slices (ms per frame, inclusive, all threads): Driver.WorkerWait 94.0, Driver.WorkerWait.idle_and_completion_poll 94.0, Graphics.Draw 8.2, Graphics.Draw.draw_and_resource_release 7.9, Vulkan.DrawFromRecipe 6.6, Graphics.DrawWithRecipe 6.6

Longest waits

  • Driver.WorkerWait (queue worker 0x0) 18.2 ms at 7659 ms, present 133
  • Driver.WorkerWait (queue worker 0x0) 8.3 ms at 1529 ms, present 70
  • Driver.WorkerWait (queue worker 0x0) 6.3 ms at 5616 ms, present 114
  • Driver.WorkerWait (queue worker 0x0) 6.1 ms at 5047 ms, present 108
  • Driver.WorkerWait (queue worker 0x0) 5.7 ms at 7120 ms, present 128
  • Driver.WorkerWait (queue worker 0x0) 5.7 ms at 989 ms, present 65

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

  • batch 1637: 2.5 ms at 2655 ms, present 82: GPU no ranges; recorded by Vulkan.DrawFromRecipe (draw committer) 0.2, Graphics.DrawWithRecipe (draw committer) 0.2, Graphics.DrawWithRecipe.draw_and_resource_release (draw committer) 0.2, Recorder.Submit (draw committer) 0.1
  • batch 4174: 1.7 ms at 6737 ms, present 125: GPU no ranges; recorded by Vulkan.DrawFromRecipe (draw committer) 0.2, Graphics.DrawWithRecipe (draw committer) 0.2, Graphics.DrawWithRecipe.draw_and_resource_release (draw committer) 0.2, Recorder.Submit (draw committer) 0.1
  • batch 1991: 1.7 ms at 3218 ms, present 88: GPU no ranges; recorded by Vulkan.DrawFromRecipe (draw committer) 0.2, Graphics.DrawWithRecipe (draw committer) 0.2, Graphics.DrawWithRecipe.draw_and_resource_release (draw committer) 0.2, Recorder.Submit (draw committer) 0.0

v23-s03-pair

seconds 20:8 from present 131: 207 presents, frame p50 37.7 / p90 42.2 / p99 54.8 / max 57.4 ms, GPU busy 4.7 ms per present
NVIDIA GeForce RTX 3070 Laptop GPU, NVIDIA 617.42, Windows 10.0.26300, 1920x1080, commit 223f2469f5, dropped: no

{"commit":"223f2469f5b7","dirty":false,"env":{"APS5_TRACE_EVENTS":"1048576","APS5_TRACE_SECONDS":"20:8"},"gpu":"NVIDIA GeForce RTX 3070 Laptop GPU","driver":"NVIDIA 617.42","os":"Windows 10.0.26300","cpu":"AMD Ryzen 7 5800H with Radeon Graphics","cpu_threads":16,"memory_mib":64863,"title_id":"PPSA69421","title":"SuperTuxKart","content_version":"00.001.000","resolution":"1920x1080","window":{"spec":"seconds 20:8","first_present":131,"ms":8002.835},"presents":207,"frame_ms":{"p50":37.675,"p90":42.179,"p99":54.788,"max":57.409},"gpu_busy_ms_per_present":4.721,"worker_busy_pct":{"queue worker 0x0":5.801},"top_phases_ms_per_frame":{"Recorder.Sync":11.955,"Graphics.Draw":6.348,"Graphics.Draw.draw_and_resource_release":6.104,"Vulkan.DrawFromRecipe":5.275,"Graphics.DrawWithRecipe":5.255,"Graphics.DrawWithRecipe.draw_and_resource_release":5.243,"Recorder.Submit":2.463,"Driver.Packet":2.212},"trace_dropped":false,"trace":"aps5-trace-223f2469f5b7-7524.json.gz"}

Slowest frames (largest slices inside each, inclusive)

  • present 139: 57.4 ms at 399 ms: Driver.WorkerWait (queue worker 0x0) 53.4, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x0) 53.3, Recorder.Sync (draw committer) 16.0, Graphics.Draw (draw committer) 11.6
  • present 131: 57.2 ms at 0 ms: Driver.WorkerWait (queue worker 0x0) 53.5, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x0) 53.4, Recorder.Sync (draw committer) 14.2, Vulkan.DrawFromRecipe (draw committer) 12.0
  • present 136: 54.8 ms at 254 ms: Driver.WorkerWait (queue worker 0x0) 51.2, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x0) 51.1, Recorder.Sync (draw committer) 15.9, Vulkan.DrawFromRecipe (draw committer) 9.8

Threads (ms per frame)

thread busy wait untraced in slices < 20 us largest
queue worker 0x0 1.4 (4 %) 36.1 (93 %) 1.1 3.9 Driver.Packet 1.4, Shader.DrawStage 0.0
draw committer 23.6 (61 %) 0.7 (2 %) 14.4 0.1 Recorder.Sync 12.0, Graphics.Draw 6.3
presenter 0.9 (2 %) 0.0 (0 %) 37.7 0.1 VideoOut.Flip 0.9, Driver.Present 0.0
gpu 4.7 (12 %) 0.0 (0 %) 33.9 0.0 batch 4.7

Largest slices (ms per frame, inclusive, all threads): Driver.WorkerWait 36.1, Driver.WorkerWait.idle_and_completion_poll 36.1, Recorder.Sync 12.0, Graphics.Draw 6.3, Graphics.Draw.draw_and_resource_release 6.1, Vulkan.DrawFromRecipe 5.3

Longest waits

  • Driver.WorkerWait (queue worker 0x0) 3.5 ms at 145 ms, present 133
  • Driver.WorkerWait (queue worker 0x0) 2.9 ms at 897 ms, present 150
  • Driver.WorkerWait (queue worker 0x0) 2.9 ms at 233 ms, present 135
  • Driver.WorkerWait (queue worker 0x0) 2.9 ms at 196 ms, present 134
  • Driver.WorkerWait (queue worker 0x0) 2.8 ms at 4073 ms, present 233
  • Driver.WorkerWait (queue worker 0x0) 2.8 ms at 774 ms, present 147

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

  • batch 1155: 2.5 ms at 897 ms, present 150: GPU no ranges; recorded by Recorder.Sync (draw committer) 2.6, Vulkan.DrawFromRecipe (draw committer) 0.0, Graphics.DrawWithRecipe (draw committer) 0.0, Graphics.DrawWithRecipe.draw_and_resource_release (draw committer) 0.0
  • batch 270: 2.4 ms at 233 ms, present 135: GPU no ranges; recorded by Recorder.Sync (draw committer) 2.5, Vulkan.DrawFromRecipe (draw committer) 0.0, Graphics.DrawWithRecipe (draw committer) 0.0, Graphics.DrawWithRecipe.draw_and_resource_release (draw committer) 0.0
  • batch 978: 2.4 ms at 774 ms, present 147: GPU no ranges; recorded by Recorder.Sync (draw committer) 2.5, Vulkan.DrawFromRecipe (draw committer) 0.0, Graphics.DrawWithRecipe (draw committer) 0.0, Graphics.DrawWithRecipe.draw_and_resource_release (draw committer) 0.0

Evidence: 7464-evidence-20261022.zip (the six traces, summary lines, digests and comparisons, test and validation-layer logs).

Where it helps, and what it costs

Probe counters from 2026-10-21, on main 2185dbf92e with a local counter build that is not part of this PR (APS5_PROFILE_DRAW=1, medians of two runs per flip over the same 8-s window; they carry profiling overhead and are not used for FPS), in the scene above: the menu maps about 48 blocks of 64 KiB per frame and writes about 59 labels into them. main imports each block when it is mapped (48.5 imports per frame, ImportMappedRanges 784 µs per call). In a build of main with the eleven PRs of that series, which include #7465 and this one, no block is imported (0 per frame) and the labels take this path instead: 58.9 recorder syncs per frame, WriteLabelOnGpu 194 µs per call. With this PR reduced to its wake calls in the same build, 47.8 imports per frame come back, every one made by a label (WriteLabelOnGpu 696 µs per call).

@LeandroLP23 measured the same path in a SuperTuxKart race on a Radeon 860M (comment above): it is the largest cost left there (Recorder.Sync 41 ms of a ~96 ms frame), and the two alternatives he tried, importing the label pages and deferring the store to the batch reap, were slower (5.4 and 0.7 FPS against 10.5).

Known limitations.

  • The recorder sync waits for all recorded work under the GPU mutex. Recorded guest GPU work that waits for memory only a later CPU write or submission produces would block that sync; the recorder cannot detect it. The one host-released dependency the recorder itself submits with (a held submit) is excluded, and compute queues, which must never wait, keep main's path.
  • A title that keeps a small block mapped and writes queue-0 labels into it every frame pays one recorder sync per label here, where #7465 alone imports the block once. No such title was measured. In particular Record of Lodoss War (PPSA05347), where #7465 alone reaches the 60 FPS cap (@JJenkx in #7465), was not run with this PR.

Dependencies and overlap

  • Depends on #7465. This branch contains #7465's three commits; merge #7465 first.
  • #7963 (GPU-clock COPY_DATA stores) changes the same } else if (reason == 1) { line of preparePacketMemory in PacketMemory.cpp that this PR extends with code 7, and #9495 inserts lines after the same agc_driver_gpu_map_on_fiber_tests line of libSceAgcDriver/CMakeLists.txt as this PR's test registration. Both conflict with this head textually; neither implements the same thing.
  • #8180 also changes WriteLabelOnGpu (small labels behind copied write-backs) and merges cleanly with this head.
  • No other open PR stores unimported labels on the CPU.

Checklist

  • Based on current main 94fbb8cea8 through #7465 a1cee90f52; 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 (none added)
  • Generic behaviour, not specific to one title
  • Depends on: #7465
  • Fixes: none
  • Unblocks: none
  • GPUs tested: NVIDIA GeForce RTX 3070 Laptop GPU, NVIDIA 617.42, Windows 11 Pro 26300; AMD Radeon(TM) Graphics (Ryzen 7 5800H), 31.0.21925.1001, Windows 11 Pro 26300; lavapipe (llvmpipe, LLVM 21.1.8) on Linux
  • AI-assisted: yes

🤖 Generated with Claude Code

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4907699092 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7464). Originally posted by [Dripl1x](https://github.com/Dripl1x) on 2026-10-18T08:46:45Z. --- ### What Store a queue-0 label on the CPU after a recorder sync when no host import covers its destination, instead of importing the destination's allocation for the label. `VulkanDevice::WriteLabelOnGpu` takes that path only for queue 0 and only while no submit is held (`Recorder::SubmitHeld()`); it returns a new code 7, which every caller (`commitLabel` in `PacketMemory.cpp`, `recordDeferredLabels` in `DeferredLabels.cpp`) handles like code 1: a CPU store without a device drain. Labels on compute queues, labels behind a held submit and labels whose memory an import already covers keep `main`'s path (import on demand, store recorded on the GPU). The `[sync]` profile line counts the new path on its own: `no covering import (recorder synced)` among the fallbacks and `on the CPU with no covering import (recorder synced)` among the stores (`SynchronizationStatistics`). A label the driver stores from the CPU (`commitLabel`, `recordDeferredLabels`) also ends short guest sleeps (#6658), as a completed GPU batch or a flip already does. **Why it depends on #7465.** On `main` a small block is imported when the title maps it, so its labels find a covering import and this path does not run. #7465 leaves mappings of 64 KiB or less unimported until their first GPU use. In SuperTuxKart (PPSA69421) that first use is a label, so with #7465 alone each of the blocks the menu maps every frame is imported by its first label instead, and the frame rate stays at `main`'s. With this PR on top, those labels are stored on the CPU after a recorder sync and the blocks are not imported at all: | Build | Commit | FPS, run 1 / run 2 | frame p50 ms | |---|---|---:|---:| | `main` | `94fbb8cea8` | 9.91 / 10.24 | 99.8 / 94.3 | | `main` + #7465 | `a1cee90f52` | 10.29 / 10.19 | 94.7 / 95.6 | | `main` + #7465 + this PR | `223f2469f5` | **25.87 / 25.99** | 37.7 / 37.9 | The cost of the path is visible in the same traces: `Recorder.Sync` takes 12.0 ms per frame on the draw committer, which #7465 alone does not show, and the frame still drops from 94.7 to 37.7 ms (p50). ### Tested This head is `223f2469f5`: current `main` `94fbb8cea8`, #7465's head `a1cee90f52`, and this PR's five commits on top, picked without conflicts and unchanged from the previous head `b31bc845fb`. Windows 11 Pro 26300, Ryzen 7 5800H, WinLibs GCC 15.2.0 r7, Release. - **NVIDIA GeForce RTX 3070 Laptop GPU, NVIDIA 617.42**, `ANYPS5_NO_SHADER_CACHE=1`, three runs each: the 74 tests built from `tests/Recorder.cpp`, and `agc_driver_indirect_arguments_pending_producer`, `agc_driver_unimported_label_order`, `agc_driver_cpu_label_wake`, `agc_driver_same_queue_label_wait`, `agc_driver_alias_copy_label`, `agc_driver_pipelined_dma`, `agc_driver_graphics`, `agc_driver_host_import_windows`, `agc_driver_host_import_at_map`, `agc_driver_host_import_teardown`, `guest_sleep_wake`, `guest_sleep_wake_coarse`, `guest_nanosleep`, `precise_wait`. 88/88 on this head; 87/87 on `main` and on #7465 (`agc_driver_cpu_label_wake` is added here). - **Validation layer**, the same set once on `main` `94fbb8cea8` and on this head (`VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation`, `ANYPS5_NO_SHADER_CACHE=1`, `ANYPS5_REQUIRE_VULKAN=1`, `ctest -V`, RTX 3070 Laptop GPU, NVIDIA 617.42; `DISABLE_LAYER=1` turns off a third-party implicit layer installed here, FPS Monitor, whose `vkDestroyInstance` hook crashes later instance lookups): 87/87 and 88/88 pass, neither log reports `was not found but was requested by env var VK_INSTANCE_LAYERS`, and both report the same VUIDs the same number of times (`VUID-VkImageViewCreateInfo-usage-02275` 4, `VUID-vkCmdCopyBuffer-srcBuffer-00118` 2). The change adds none. - **AMD Radeon(TM) Graphics** (the Ryzen 7 5800H's integrated GPU, driver 31.0.21925.1001, selected with `ANYPS5_GPU=AMD`), the same set once and once under the validation layer: 85/88 on this head, 84/87 on `main` and on #7465. The same three tests fail on all three trees (`agc_sample_dumps`, `agc_driver_vertex_target_range_copied`, `agc_driver_vertex_target_range_imported`), so they are `main`'s; the validation logs report the same VUIDs as on NVIDIA and none new. - **Linux** (WSL Ubuntu 26.04, GCC, lavapipe `llvmpipe (LLVM 21.1.8)`): `libSceAgcDriver` builds; `agc_driver_unimported_label_order`, `agc_driver_cpu_label_wake`, `agc_driver_same_queue_label_wait`, `agc_driver_indirect_arguments_pending_producer`, `guest_sleep_wake` and `agc_driver_host_import_windows` pass. - Negative controls, on the previous head `b31bc845fb` with the same source: without the queue-0 gate the compute-queue case fails with reason 7; with `SubmitHeld()` ignoring a held batch still in flight the held-batch case fails after its 5 s watchdog; without the two wake calls `agc_driver_cpu_label_wake` fails. - `tools/check_conventions.py` passes for this range. - Not run: the whole CTest suite, and titles other than SuperTuxKart. **SuperTuxKart captures.** RTX 3070 Laptop GPU, NVIDIA 617.42, same machine and build as above; SuperTuxKart (PPSA69421) tutorial prompt over the main menu, 1920x1080 internal rendering in a maximized 2560x1369 window, warm shader caches, audio muted, no input; `APS5_TRACE_SECONDS=20:8` with `APS5_TRACE_EVENTS=1048576`, console output not redirected, no other `APS5_*` switch; 2026-10-22, one session, order `main`, #7465, this PR, this PR, #7465, `main`; every run kept the window in the foreground, and every summary line reports `dirty: false` and `trace_dropped: false`. <details> <summary>Summary lines (main, #7465, this PR, this PR, #7465, main)</summary> ```json {"commit":"94fbb8cea80a","dirty":false,"env":{"APS5_TRACE_EVENTS":"1048576","APS5_TRACE_SECONDS":"20:8"},"gpu":"NVIDIA GeForce RTX 3070 Laptop GPU","driver":"NVIDIA 617.42","os":"Windows 10.0.26300","cpu":"AMD Ryzen 7 5800H with Radeon Graphics","cpu_threads":16,"memory_mib":64863,"title_id":"PPSA69421","title":"SuperTuxKart","content_version":"00.001.000","resolution":"1920x1080","window":{"spec":"seconds 20:8","first_present":38,"ms":8076.426},"presents":80,"frame_ms":{"p50":99.757,"p90":110.517,"p99":128.310,"max":128.310},"gpu_busy_ms_per_present":5.610,"worker_busy_pct":{"queue worker 0x0":2.846},"top_phases_ms_per_frame":{"Graphics.Draw":7.873,"Graphics.Draw.draw_and_resource_release":7.574,"Vulkan.DrawFromRecipe":6.254,"Graphics.DrawWithRecipe":6.229,"Graphics.DrawWithRecipe.draw_and_resource_release":6.216,"Recorder.Submit":2.908,"Driver.Packet":2.834,"Driver.Packet.draw":2.260},"trace_dropped":false,"trace":"aps5-trace-94fbb8cea80a-424.json.gz"} {"commit":"a1cee90f52cc","dirty":false,"env":{"APS5_TRACE_EVENTS":"1048576","APS5_TRACE_SECONDS":"20:8"},"gpu":"NVIDIA GeForce RTX 3070 Laptop GPU","driver":"NVIDIA 617.42","os":"Windows 10.0.26300","cpu":"AMD Ryzen 7 5800H with Radeon Graphics","cpu_threads":16,"memory_mib":64863,"title_id":"PPSA69421","title":"SuperTuxKart","content_version":"00.001.000","resolution":"1920x1080","window":{"spec":"seconds 20:8","first_present":55,"ms":8065.429},"presents":83,"frame_ms":{"p50":94.730,"p90":106.217,"p99":129.954,"max":129.954},"gpu_busy_ms_per_present":5.650,"worker_busy_pct":{"queue worker 0x0":2.889},"top_phases_ms_per_frame":{"Graphics.Draw":8.166,"Graphics.Draw.draw_and_resource_release":7.877,"Vulkan.DrawFromRecipe":6.616,"Graphics.DrawWithRecipe":6.589,"Graphics.DrawWithRecipe.draw_and_resource_release":6.576,"Recorder.Submit":2.785,"Driver.Packet":2.769,"Driver.Packet.draw":2.207},"trace_dropped":false,"trace":"aps5-trace-a1cee90f52cc-21452.json.gz"} {"commit":"223f2469f5b7","dirty":false,"env":{"APS5_TRACE_EVENTS":"1048576","APS5_TRACE_SECONDS":"20:8"},"gpu":"NVIDIA GeForce RTX 3070 Laptop GPU","driver":"NVIDIA 617.42","os":"Windows 10.0.26300","cpu":"AMD Ryzen 7 5800H with Radeon Graphics","cpu_threads":16,"memory_mib":64863,"title_id":"PPSA69421","title":"SuperTuxKart","content_version":"00.001.000","resolution":"1920x1080","window":{"spec":"seconds 20:8","first_present":131,"ms":8002.835},"presents":207,"frame_ms":{"p50":37.675,"p90":42.179,"p99":54.788,"max":57.409},"gpu_busy_ms_per_present":4.721,"worker_busy_pct":{"queue worker 0x0":5.801},"top_phases_ms_per_frame":{"Recorder.Sync":11.955,"Graphics.Draw":6.348,"Graphics.Draw.draw_and_resource_release":6.104,"Vulkan.DrawFromRecipe":5.275,"Graphics.DrawWithRecipe":5.255,"Graphics.DrawWithRecipe.draw_and_resource_release":5.243,"Recorder.Submit":2.463,"Driver.Packet":2.212},"trace_dropped":false,"trace":"aps5-trace-223f2469f5b7-7524.json.gz"} {"commit":"223f2469f5b7","dirty":false,"env":{"APS5_TRACE_EVENTS":"1048576","APS5_TRACE_SECONDS":"20:8"},"gpu":"NVIDIA GeForce RTX 3070 Laptop GPU","driver":"NVIDIA 617.42","os":"Windows 10.0.26300","cpu":"AMD Ryzen 7 5800H with Radeon Graphics","cpu_threads":16,"memory_mib":64863,"title_id":"PPSA69421","title":"SuperTuxKart","content_version":"00.001.000","resolution":"1920x1080","window":{"spec":"seconds 20:8","first_present":136,"ms":8002.542},"presents":208,"frame_ms":{"p50":37.925,"p90":41.354,"p99":46.729,"max":49.249},"gpu_busy_ms_per_present":4.706,"worker_busy_pct":{"queue worker 0x0":5.815},"top_phases_ms_per_frame":{"Recorder.Sync":11.984,"Graphics.Draw":6.381,"Graphics.Draw.draw_and_resource_release":6.138,"Vulkan.DrawFromRecipe":5.259,"Graphics.DrawWithRecipe":5.238,"Graphics.DrawWithRecipe.draw_and_resource_release":5.227,"Recorder.Submit":2.455,"Driver.Packet":2.205},"trace_dropped":false,"trace":"aps5-trace-223f2469f5b7-36088.json.gz"} {"commit":"a1cee90f52cc","dirty":false,"env":{"APS5_TRACE_EVENTS":"1048576","APS5_TRACE_SECONDS":"20:8"},"gpu":"NVIDIA GeForce RTX 3070 Laptop GPU","driver":"NVIDIA 617.42","os":"Windows 10.0.26300","cpu":"AMD Ryzen 7 5800H with Radeon Graphics","cpu_threads":16,"memory_mib":64863,"title_id":"PPSA69421","title":"SuperTuxKart","content_version":"00.001.000","resolution":"1920x1080","window":{"spec":"seconds 20:8","first_present":60,"ms":8047.206},"presents":82,"frame_ms":{"p50":95.592,"p90":109.603,"p99":121.282,"max":121.282},"gpu_busy_ms_per_present":5.638,"worker_busy_pct":{"queue worker 0x0":2.804},"top_phases_ms_per_frame":{"Graphics.Draw":8.185,"Graphics.Draw.draw_and_resource_release":7.900,"Vulkan.DrawFromRecipe":6.988,"Graphics.DrawWithRecipe":6.962,"Graphics.DrawWithRecipe.draw_and_resource_release":6.949,"Recorder.Submit":2.777,"Driver.Packet":2.710,"Driver.Packet.draw":2.157},"trace_dropped":false,"trace":"aps5-trace-a1cee90f52cc-30808.json.gz"} {"commit":"94fbb8cea80a","dirty":false,"env":{"APS5_TRACE_EVENTS":"1048576","APS5_TRACE_SECONDS":"20:8"},"gpu":"NVIDIA GeForce RTX 3070 Laptop GPU","driver":"NVIDIA 617.42","os":"Windows 10.0.26300","cpu":"AMD Ryzen 7 5800H with Radeon Graphics","cpu_threads":16,"memory_mib":64863,"title_id":"PPSA69421","title":"SuperTuxKart","content_version":"00.001.000","resolution":"1920x1080","window":{"spec":"seconds 20:8","first_present":60,"ms":8004.322},"presents":82,"frame_ms":{"p50":94.350,"p90":108.262,"p99":142.124,"max":142.124},"gpu_busy_ms_per_present":5.714,"worker_busy_pct":{"queue worker 0x0":2.913},"top_phases_ms_per_frame":{"Graphics.Draw":7.571,"Graphics.Draw.draw_and_resource_release":7.276,"Vulkan.DrawFromRecipe":6.235,"Graphics.DrawWithRecipe":6.207,"Graphics.DrawWithRecipe.draw_and_resource_release":6.194,"Recorder.Submit":2.886,"Driver.Packet":2.803,"Driver.Packet.draw":2.235},"trace_dropped":false,"trace":"aps5-trace-94fbb8cea80a-36604.json.gz"} ``` </details> <details> <summary><code>tools/performance_compare.py</code> (first capture of #7465 against the first capture of this PR)</summary> **Performance comparison ** | Capture | Commit | Trace | Presents | Window (ms) | | --- | --- | --- | ---: | ---: | | baseline | a1cee90f52cc | aps5-trace-a1cee90f52cc-21452.json.gz | 83 | 8065.429 | | candidate | 223f2469f5b7 | aps5-trace-223f2469f5b7-7524.json.gz | 207 | 8002.835 | - Compare captures from the same machine, title, content version and scene; matching recorded metadata cannot verify the physical machine or scene. - Changes are candidate minus baseline. A negative frame-time change means a shorter frame interval. - A missing top phase is unreported, not zero; its change is unavailable. - Recorded configuration differs; these measurements do not isolate the code change. **Configuration differences ** | Setting | Baseline | Candidate | | --- | --- | --- | | window.first_present | 55 | 131 | **Frame and GPU times (ms) ** | Metric | Baseline | Candidate | Change | Change (%) | | --- | ---: | ---: | ---: | ---: | | frame_ms.p50 | 94.730 | 37.675 | -57.055 | -60.229 | | frame_ms.p90 | 106.217 | 42.179 | -64.038 | -60.290 | | frame_ms.p99 | 129.954 | 54.788 | -75.166 | -57.840 | | frame_ms.max | 129.954 | 57.409 | -72.545 | -55.824 | | mean_frame_ms | 97.174 | 38.661 | -58.513 | -60.215 | | gpu_busy_ms_per_present | 5.650 | 4.721 | -0.929 | -16.442 | **Top phases (ms per frame) ** | Metric | Baseline | Candidate | Change | Change (%) | | --- | ---: | ---: | ---: | ---: | | Driver.Packet | 2.769 | 2.212 | -0.557 | -20.116 | | Driver.Packet.draw | 2.207 | n/a | n/a | n/a | | Graphics.Draw | 8.166 | 6.348 | -1.818 | -22.263 | | Graphics.Draw.draw_and_resource_release | 7.877 | 6.104 | -1.773 | -22.509 | | Graphics.DrawWithRecipe | 6.589 | 5.255 | -1.334 | -20.246 | | Graphics.DrawWithRecipe.draw_and_resource_release | 6.576 | 5.243 | -1.333 | -20.271 | | Recorder.Submit | 2.785 | 2.463 | -0.322 | -11.562 | | Recorder.Sync | n/a | 11.955 | n/a | n/a | | Vulkan.DrawFromRecipe | 6.616 | 5.275 | -1.341 | -20.269 | </details> <details> <summary><code>tools/trace_digest.py</code> (first capture of #7465, then of this PR; every digest is in the evidence archive)</summary> `v23-s02-7465` **seconds 20:8** from present 55: 83 presents, frame p50 94.7 / p90 106.2 / p99 130.0 / max 130.0 ms, GPU busy 5.7 ms per present NVIDIA GeForce RTX 3070 Laptop GPU, NVIDIA 617.42, Windows 10.0.26300, 1920x1080, commit a1cee90f52cc, dropped: no ```json {"commit":"a1cee90f52cc","dirty":false,"env":{"APS5_TRACE_EVENTS":"1048576","APS5_TRACE_SECONDS":"20:8"},"gpu":"NVIDIA GeForce RTX 3070 Laptop GPU","driver":"NVIDIA 617.42","os":"Windows 10.0.26300","cpu":"AMD Ryzen 7 5800H with Radeon Graphics","cpu_threads":16,"memory_mib":64863,"title_id":"PPSA69421","title":"SuperTuxKart","content_version":"00.001.000","resolution":"1920x1080","window":{"spec":"seconds 20:8","first_present":55,"ms":8065.429},"presents":83,"frame_ms":{"p50":94.73,"p90":106.217,"p99":129.954,"max":129.954},"gpu_busy_ms_per_present":5.65,"worker_busy_pct":{"queue worker 0x0":2.889},"top_phases_ms_per_frame":{"Graphics.Draw":8.166,"Graphics.Draw.draw_and_resource_release":7.877,"Vulkan.DrawFromRecipe":6.616,"Graphics.DrawWithRecipe":6.589,"Graphics.DrawWithRecipe.draw_and_resource_release":6.576,"Recorder.Submit":2.785,"Driver.Packet":2.769,"Driver.Packet.draw":2.207},"trace_dropped":false,"trace":"aps5-trace-a1cee90f52cc-21452.json.gz"} ``` **Slowest frames** (largest slices inside each, inclusive) - present 128: 130.0 ms at 7006 ms: Driver.WorkerWait (queue worker 0x0) 125.1, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x0) 125.0, Graphics.Draw (draw committer) 13.4, Graphics.Draw.draw_and_resource_release (draw committer) 13.0 - present 127: 124.1 ms at 6882 ms: Driver.WorkerWait (queue worker 0x0) 119.4, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x0) 119.3, Graphics.Draw (draw committer) 12.5, Graphics.Draw.draw_and_resource_release (draw committer) 12.1 - present 129: 122.4 ms at 7136 ms: Driver.WorkerWait (queue worker 0x0) 117.9, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x0) 117.7, Graphics.Draw (draw committer) 12.4, Graphics.Draw.draw_and_resource_release (draw committer) 12.0 **Threads** (ms per frame) | thread | busy | wait | untraced | in slices < 20 us | largest | |---|---|---|---|---|---| | title | 0.2 (0 %) | 0.0 (0 %) | 97.0 | 0.4 | Recorder.Sync 0.2 | | queue worker 0x0 | 2.0 (2 %) | 94.0 (97 %) | 1.1 | 4.0 | Driver.Packet 2.0 | | draw committer | 17.6 (18 %) | 0.6 (1 %) | 79.0 | 0.2 | Graphics.Draw 8.2, Vulkan.DrawFromRecipe 6.6 | | presenter | 0.9 (1 %) | 0.0 (0 %) | 96.2 | 0.1 | VideoOut.Flip 0.9, Driver.Present 0.0 | | gpu | 5.7 (6 %) | 0.0 (0 %) | 91.5 | 0.0 | batch 5.7 | **Largest slices** (ms per frame, inclusive, all threads): Driver.WorkerWait 94.0, Driver.WorkerWait.idle_and_completion_poll 94.0, Graphics.Draw 8.2, Graphics.Draw.draw_and_resource_release 7.9, Vulkan.DrawFromRecipe 6.6, Graphics.DrawWithRecipe 6.6 **Longest waits** - Driver.WorkerWait (queue worker 0x0) 18.2 ms at 7659 ms, present 133 - Driver.WorkerWait (queue worker 0x0) 8.3 ms at 1529 ms, present 70 - Driver.WorkerWait (queue worker 0x0) 6.3 ms at 5616 ms, present 114 - Driver.WorkerWait (queue worker 0x0) 6.1 ms at 5047 ms, present 108 - Driver.WorkerWait (queue worker 0x0) 5.7 ms at 7120 ms, present 128 - Driver.WorkerWait (queue worker 0x0) 5.7 ms at 989 ms, present 65 **Largest GPU batches** (GPU ranges inside, and the CPU slices that recorded each, inclusive) - batch 1637: 2.5 ms at 2655 ms, present 82: GPU no ranges; recorded by Vulkan.DrawFromRecipe (draw committer) 0.2, Graphics.DrawWithRecipe (draw committer) 0.2, Graphics.DrawWithRecipe.draw_and_resource_release (draw committer) 0.2, Recorder.Submit (draw committer) 0.1 - batch 4174: 1.7 ms at 6737 ms, present 125: GPU no ranges; recorded by Vulkan.DrawFromRecipe (draw committer) 0.2, Graphics.DrawWithRecipe (draw committer) 0.2, Graphics.DrawWithRecipe.draw_and_resource_release (draw committer) 0.2, Recorder.Submit (draw committer) 0.1 - batch 1991: 1.7 ms at 3218 ms, present 88: GPU no ranges; recorded by Vulkan.DrawFromRecipe (draw committer) 0.2, Graphics.DrawWithRecipe (draw committer) 0.2, Graphics.DrawWithRecipe.draw_and_resource_release (draw committer) 0.2, Recorder.Submit (draw committer) 0.0 `v23-s03-pair` **seconds 20:8** from present 131: 207 presents, frame p50 37.7 / p90 42.2 / p99 54.8 / max 57.4 ms, GPU busy 4.7 ms per present NVIDIA GeForce RTX 3070 Laptop GPU, NVIDIA 617.42, Windows 10.0.26300, 1920x1080, commit 223f2469f5b7, dropped: no ```json {"commit":"223f2469f5b7","dirty":false,"env":{"APS5_TRACE_EVENTS":"1048576","APS5_TRACE_SECONDS":"20:8"},"gpu":"NVIDIA GeForce RTX 3070 Laptop GPU","driver":"NVIDIA 617.42","os":"Windows 10.0.26300","cpu":"AMD Ryzen 7 5800H with Radeon Graphics","cpu_threads":16,"memory_mib":64863,"title_id":"PPSA69421","title":"SuperTuxKart","content_version":"00.001.000","resolution":"1920x1080","window":{"spec":"seconds 20:8","first_present":131,"ms":8002.835},"presents":207,"frame_ms":{"p50":37.675,"p90":42.179,"p99":54.788,"max":57.409},"gpu_busy_ms_per_present":4.721,"worker_busy_pct":{"queue worker 0x0":5.801},"top_phases_ms_per_frame":{"Recorder.Sync":11.955,"Graphics.Draw":6.348,"Graphics.Draw.draw_and_resource_release":6.104,"Vulkan.DrawFromRecipe":5.275,"Graphics.DrawWithRecipe":5.255,"Graphics.DrawWithRecipe.draw_and_resource_release":5.243,"Recorder.Submit":2.463,"Driver.Packet":2.212},"trace_dropped":false,"trace":"aps5-trace-223f2469f5b7-7524.json.gz"} ``` **Slowest frames** (largest slices inside each, inclusive) - present 139: 57.4 ms at 399 ms: Driver.WorkerWait (queue worker 0x0) 53.4, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x0) 53.3, Recorder.Sync (draw committer) 16.0, Graphics.Draw (draw committer) 11.6 - present 131: 57.2 ms at 0 ms: Driver.WorkerWait (queue worker 0x0) 53.5, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x0) 53.4, Recorder.Sync (draw committer) 14.2, Vulkan.DrawFromRecipe (draw committer) 12.0 - present 136: 54.8 ms at 254 ms: Driver.WorkerWait (queue worker 0x0) 51.2, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x0) 51.1, Recorder.Sync (draw committer) 15.9, Vulkan.DrawFromRecipe (draw committer) 9.8 **Threads** (ms per frame) | thread | busy | wait | untraced | in slices < 20 us | largest | |---|---|---|---|---|---| | queue worker 0x0 | 1.4 (4 %) | 36.1 (93 %) | 1.1 | 3.9 | Driver.Packet 1.4, Shader.DrawStage 0.0 | | draw committer | 23.6 (61 %) | 0.7 (2 %) | 14.4 | 0.1 | Recorder.Sync 12.0, Graphics.Draw 6.3 | | presenter | 0.9 (2 %) | 0.0 (0 %) | 37.7 | 0.1 | VideoOut.Flip 0.9, Driver.Present 0.0 | | gpu | 4.7 (12 %) | 0.0 (0 %) | 33.9 | 0.0 | batch 4.7 | **Largest slices** (ms per frame, inclusive, all threads): Driver.WorkerWait 36.1, Driver.WorkerWait.idle_and_completion_poll 36.1, Recorder.Sync 12.0, Graphics.Draw 6.3, Graphics.Draw.draw_and_resource_release 6.1, Vulkan.DrawFromRecipe 5.3 **Longest waits** - Driver.WorkerWait (queue worker 0x0) 3.5 ms at 145 ms, present 133 - Driver.WorkerWait (queue worker 0x0) 2.9 ms at 897 ms, present 150 - Driver.WorkerWait (queue worker 0x0) 2.9 ms at 233 ms, present 135 - Driver.WorkerWait (queue worker 0x0) 2.9 ms at 196 ms, present 134 - Driver.WorkerWait (queue worker 0x0) 2.8 ms at 4073 ms, present 233 - Driver.WorkerWait (queue worker 0x0) 2.8 ms at 774 ms, present 147 **Largest GPU batches** (GPU ranges inside, and the CPU slices that recorded each, inclusive) - batch 1155: 2.5 ms at 897 ms, present 150: GPU no ranges; recorded by Recorder.Sync (draw committer) 2.6, Vulkan.DrawFromRecipe (draw committer) 0.0, Graphics.DrawWithRecipe (draw committer) 0.0, Graphics.DrawWithRecipe.draw_and_resource_release (draw committer) 0.0 - batch 270: 2.4 ms at 233 ms, present 135: GPU no ranges; recorded by Recorder.Sync (draw committer) 2.5, Vulkan.DrawFromRecipe (draw committer) 0.0, Graphics.DrawWithRecipe (draw committer) 0.0, Graphics.DrawWithRecipe.draw_and_resource_release (draw committer) 0.0 - batch 978: 2.4 ms at 774 ms, present 147: GPU no ranges; recorded by Recorder.Sync (draw committer) 2.5, Vulkan.DrawFromRecipe (draw committer) 0.0, Graphics.DrawWithRecipe (draw committer) 0.0, Graphics.DrawWithRecipe.draw_and_resource_release (draw committer) 0.0 </details> Evidence: [7464-evidence-20261022.zip](https://github.com/Dripl1x/AnyPS5/releases/download/review-20261022-7464/7464-evidence-20261022.zip) (the six traces, summary lines, digests and comparisons, test and validation-layer logs). ### Where it helps, and what it costs Probe counters from 2026-10-21, on `main` `2185dbf92e` with a local counter build that is not part of this PR (`APS5_PROFILE_DRAW=1`, medians of two runs per flip over the same 8-s window; they carry profiling overhead and are not used for FPS), in the scene above: the menu maps about 48 blocks of 64 KiB per frame and writes about 59 labels into them. `main` imports each block when it is mapped (48.5 imports per frame, `ImportMappedRanges` 784 µs per call). In a build of `main` with the eleven PRs of that series, which include #7465 and this one, no block is imported (0 per frame) and the labels take this path instead: 58.9 recorder syncs per frame, `WriteLabelOnGpu` 194 µs per call. With this PR reduced to its wake calls in the same build, 47.8 imports per frame come back, every one made by a label (`WriteLabelOnGpu` 696 µs per call). @LeandroLP23 measured the same path in a SuperTuxKart race on a Radeon 860M (comment above): it is the largest cost left there (`Recorder.Sync` 41 ms of a ~96 ms frame), and the two alternatives he tried, importing the label pages and deferring the store to the batch reap, were slower (5.4 and 0.7 FPS against 10.5). **Known limitations.** - The recorder sync waits for all recorded work under the GPU mutex. Recorded guest GPU work that waits for memory only a later CPU write or submission produces would block that sync; the recorder cannot detect it. The one host-released dependency the recorder itself submits with (a held submit) is excluded, and compute queues, which must never wait, keep `main`'s path. - A title that keeps a small block mapped and writes queue-0 labels into it every frame pays one recorder sync per label here, where #7465 alone imports the block once. No such title was measured. In particular Record of Lodoss War (PPSA05347), where #7465 alone reaches the 60 FPS cap (@JJenkx in #7465), was not run with this PR. ### Dependencies and overlap - **Depends on #7465.** This branch contains #7465's three commits; merge #7465 first. - #7963 (GPU-clock `COPY_DATA` stores) changes the same `} else if (reason == 1) {` line of `preparePacketMemory` in `PacketMemory.cpp` that this PR extends with code 7, and #9495 inserts lines after the same `agc_driver_gpu_map_on_fiber_tests` line of `libSceAgcDriver/CMakeLists.txt` as this PR's test registration. Both conflict with this head textually; neither implements the same thing. - #8180 also changes `WriteLabelOnGpu` (small labels behind copied write-backs) and merges cleanly with this head. - No other open PR stores unimported labels on the CPU. ### Checklist <!-- Rules behind each item: https://github.com/boykopovar/AnyPS5/blob/main/CONTRIBUTING.md --> - [x] Based on current `main` `94fbb8cea8` through #7465 `a1cee90f52`; no other open PR implements the same functions - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except [technical debt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed under Silent stubs in their library's [technical debt](https://github.com/boykopovar/AnyPS5/tree/main/docs/dev/debt) file - [x] No notes, investigation `.md` files or images added to the repository (attach them to this PR) - [x] New third-party code is a submodule built from source (none added) - [x] Generic behaviour, not specific to one title - [x] Depends on: #7465 - [x] Fixes: none - [x] Unblocks: none - [x] GPUs tested: NVIDIA GeForce RTX 3070 Laptop GPU, NVIDIA 617.42, Windows 11 Pro 26300; AMD Radeon(TM) Graphics (Ryzen 7 5800H), 31.0.21925.1001, Windows 11 Pro 26300; lavapipe (llvmpipe, LLVM 21.1.8) on Linux - [x] AI-assisted: yes 🤖 Generated with [Claude Code](https://claude.com/claude-code)
blawesom commented 2026-10-18 16:39:10 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by blawesom on 2026-10-18T16:39:10Z.


Rebase handoff — rebased onto current main (both commits, authorship unchanged). One docs-debt conflict, unioned.

Verified on Linux (CachyOS, kernel 7.2.9, GCC 16.2.1, Ninja, Release, BUILD_TESTING=ON, AMD RX 9070 XT / RADV): builds; conventions pass; full suite green apart from the two known main regressions (agc_driver_tessellation — Mesa, #5444; agc_driver_bda_device — #7584), neither from this PR.

To pick it up:

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

Head is fdf2b016d.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6252406407 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7464#issuecomment-6252406407). Originally posted by [blawesom](https://github.com/blawesom) on 2026-10-18T16:39:10Z. --- **Rebase handoff** — rebased onto current `main` (both commits, authorship unchanged). One docs-debt conflict, unioned. Verified on Linux (CachyOS, kernel 7.2.9, GCC 16.2.1, Ninja, Release, `BUILD_TESTING=ON`, AMD RX 9070 XT / RADV): builds; conventions pass; **full suite green apart from the two known `main` regressions** (`agc_driver_tessellation` — Mesa, #5444; `agc_driver_bda_device` — #7584), neither from this PR. **To pick it up:** ``` git fetch https://github.com/blawesom/AnyPS5 rebase/7464 git checkout <your branch> git merge --ff-only FETCH_HEAD ``` Head is `fdf2b016d`.
blawesom commented 2026-10-18 16:39:45 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by blawesom on 2026-10-18T16:39:45Z.


Correction: the first push missed a required ENVIRONMENT.md row for APS5_NO_SLEEP_WAKE (the conventions check reads the commit, not the working tree — the row is now amended in). Head is now f7e0a81c2; conventions pass.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6252412277 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7464#issuecomment-6252412277). Originally posted by [blawesom](https://github.com/blawesom) on 2026-10-18T16:39:45Z. --- Correction: the first push missed a required `ENVIRONMENT.md` row for `APS5_NO_SLEEP_WAKE` (the conventions check reads the commit, not the working tree — the row is now amended in). Head is now `f7e0a81c2`; conventions pass.
Dripl1x commented 2026-10-18 18:28:46 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Dripl1x on 2026-10-18T18:28:46Z.


Thanks for the rebase handoff, Linux validation, and the follow-up ENVIRONMENT.md row. Picked up your corrected handoff and rebased it onto main e1dae23e01; published head is aa92e2c472a9. Both sides of the debt-doc conflict are retained, and I clarified that APS5_NO_SLEEP_WAKE disables early wakeups. The six focused Windows Release checks pass, including unimported-label ordering, CPU wake, same-queue waits, and the sleep checks. A matched SuperTuxKart A-B-B-A repeat with only libSceAgcDriver.prx differing gives 11.945 FPS for the exact #6658 control and 11.900 FPS for this topic (-0.045 FPS); the description now reports the individual captures and their limits instead of using the combined series to justify this topic. Logs, manifests and raw traces: https://github.com/Dripl1x/AnyPS5/releases/download/performance-series-20261018/review-rebase-20261018.zip

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6253537267 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7464#issuecomment-6253537267). Originally posted by [Dripl1x](https://github.com/Dripl1x) on 2026-10-18T18:28:46Z. --- Thanks for the rebase handoff, Linux validation, and the follow-up ENVIRONMENT.md row. Picked up your corrected handoff and rebased it onto main e1dae23e01a4; published head is aa92e2c472a9. Both sides of the debt-doc conflict are retained, and I clarified that APS5_NO_SLEEP_WAKE disables early wakeups. The six focused Windows Release checks pass, including unimported-label ordering, CPU wake, same-queue waits, and the sleep checks. A matched SuperTuxKart A-B-B-A repeat with only libSceAgcDriver.prx differing gives 11.945 FPS for the exact #6658 control and 11.900 FPS for this topic (-0.045 FPS); the description now reports the individual captures and their limits instead of using the combined series to justify this topic. Logs, manifests and raw traces: https://github.com/Dripl1x/AnyPS5/releases/download/performance-series-20261018/review-rebase-20261018.zip
oneandonlydean commented 2026-10-19 04:52:46 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-19T04:52:46Z.


@Dripl1x thanks. The ordering is right. Three things before this can merge:

  1. Main imports an unimported label store once and then frees later GPU label stores; this PR syncs the recorder on every label in unimported memory instead, and its own A/B is -0.38%. Could you post the [sync] profile line from main and from this PR in the measured scene, with the new stall counted separately: how many labels per frame take the Sync path, and how many imports does it avoid?
  2. Please give "unimported, synced" its own return code or counter, so it isn't counted as idle in that line.
  3. The first commit carries #6658. Once #6658 merges, please rebase and drop the duplicate APS5_NO_SLEEP_WAKE row.
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6259944750 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7464#issuecomment-6259944750). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-10-19T04:52:46Z. --- @Dripl1x thanks. The ordering is right. Three things before this can merge: 1. Main imports an unimported label store once and then frees later GPU label stores; this PR syncs the recorder on every label in unimported memory instead, and its own A/B is -0.38%. Could you post the `[sync]` profile line from main and from this PR in the measured scene, with the new stall counted separately: how many labels per frame take the Sync path, and how many imports does it avoid? 2. Please give "unimported, synced" its own return code or counter, so it isn't counted as idle in that line. 3. The first commit carries #6658. Once #6658 merges, please rebase and drop the duplicate `APS5_NO_SLEEP_WAKE` row.
savvaniss commented 2026-10-19 06:36:02 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by savvaniss on 2026-10-19T06:36:02Z.


Intel and AMD Windows data: the 4 label and wake tests pass with this PR on an Intel UHD 770 and an AMD RX 9070 XT.

Windows 11 Pro 26300, WinLibs GCC 15.2.0 r7, Release, every execution test built, ANYPS5_NO_SHADER_CACHE=1, serial CTest. Intel UHD Graphics 770 (8086:a780), driver 32.0.101.7088. AMD Radeon RX 9070 XT (1002:7550), driver 32.0.31041.1004, with VkCache emptied first. This head aa92e2c47 merged into main 07377573f.

Tests, ×3 UHD 770 RX 9070 XT
This head: agc_driver_cpu_label_wake, agc_driver_same_queue_label_wait, agc_driver_unimported_label_order, guest_sleep_wake 4 of 4 pass 4 of 4 pass

The test files don't build on main without the rest of the PR, so there is no before-run.

This is a correctness check only; I measured no speed.

I also ran full CTest with this PR and the 13 other open AGC and shader PRs I tested in the same batch merged together (#7668, #7659, #7504, #7432, #7426, #7413, #7480, #7465, #7466, #7449, #7489, #7673, #7560). Neither GPU showed a failure beyond main's own: the five image-table tests (#6647) and agc_driver_sample_multisample_target (#6957) on the UHD 770, and agc_driver_layered_volume_vertex_no_gpl (#4768) on the RX 9070 XT.

AI-assisted: yes (Claude Code)

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6261245965 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7464#issuecomment-6261245965). Originally posted by [savvaniss](https://github.com/savvaniss) on 2026-10-19T06:36:02Z. --- Intel and AMD Windows data: the 4 label and wake tests pass with this PR on an Intel UHD 770 and an AMD RX 9070 XT. Windows 11 Pro 26300, WinLibs GCC 15.2.0 r7, Release, every execution test built, `ANYPS5_NO_SHADER_CACHE=1`, serial CTest. Intel UHD Graphics 770 (`8086:a780`), driver 32.0.101.7088. AMD Radeon RX 9070 XT (`1002:7550`), driver 32.0.31041.1004, with `VkCache` emptied first. This head `aa92e2c47` merged into `main` `07377573f`. | Tests, ×3 | UHD 770 | RX 9070 XT | |---|---|---| | This head: `agc_driver_cpu_label_wake`, `agc_driver_same_queue_label_wait`, `agc_driver_unimported_label_order`, `guest_sleep_wake` | 4 of 4 pass | 4 of 4 pass | The test files don't build on `main` without the rest of the PR, so there is no before-run. This is a correctness check only; I measured no speed. I also ran full CTest with this PR and the 13 other open AGC and shader PRs I tested in the same batch merged together (#7668, #7659, #7504, #7432, #7426, #7413, #7480, #7465, #7466, #7449, #7489, #7673, #7560). Neither GPU showed a failure beyond `main`'s own: the five image-table tests (#6647) and `agc_driver_sample_multisample_target` (#6957) on the UHD 770, and `agc_driver_layered_volume_vertex_no_gpl` (#4768) on the RX 9070 XT. AI-assisted: yes (Claude Code)
screamm commented 2026-10-20 16:31:17 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by screamm on 2026-10-20T16:31:17Z.


Windows NVIDIA run on the rebase, with the [sync] lines and the per-label counts you asked for. Two blockers came up on current main.

Host: Windows 11 Pro 26220, NVIDIA GeForce RTX 4070 driver 596.21, Ryzen 7 5700X, WinLibs MinGW-w64 GCC 15.2 r7, Release. Head aa92e2c47, which is already newer than blawesom's rebase/7464 (f7e0a81c2), merged onto main 1d4164552. Two include/field unions: EntryPoints.cpp (main's Screenshot.hpp include and yours) and Recorder.hpp (main's submitHold/submitHoldValue and your progressWatcher).

1. agc_driver_indirect_arguments_pending_producer hangs with this PR. It times out at 300 s in the GPU pass and 3/3 at 60 s on main+this PR alone, also with APS5_NO_SLEEP_WAKE=1. main's binary passes 3/3 in about 1 s. The hang is in the last variant, group counts read on the CPU behind an argument label of an earlier graphics batch, which loops on [gpu] recorded batch still running on the GPU after N s. If I restore only this PR's VulkanDevice.cpp hunk (the HostImportCovers / recorder.Sync() path) to main, it passes 3/3. That case records a label into slot.arguments while the fixture's timeline-semaphore gate holds the batch until the producer is submitted (16683be01), and it requires WriteLabelOnGpu(...) == 0. main imports the label memory and records the store. Here the unimported path syncs the held batch instead. The test arrived on main on 10-19 (f6c8e8474, 16683be01), after this PR's base e1dae23e0.

2. The new eight-byte case in agc_driver_unimported_label_order is layout-flaky. The first x3 passed, but 4 of 12 further runs failed with an eight-byte label did not select its unimported CPU path, and it also failed 1 of 1 on the stack build. With a printf it fails exactly when VirtualAlloc places temporary right after a 128 KiB-aligned labels block. The FillBuffer import of labels is then 131072 bytes and covers temporary, so the label correctly goes to the GPU (reason 0):

reason labels temporary import live bytes
0 0x1f138b60000 0x1f138b70000 131072
1 0x2829f8b0000 0x2829f8c0000 65536
1 0x29515640000 0x29515830000 65536

A gap between the two blocks, or a HostImportCovers check on temporary first, would make the case deterministic.

Tests and control. agc_driver_cpu_label_wake, agc_driver_same_queue_label_wait, agc_driver_unimported_label_order and guest_sleep_wake pass 4/4 in the first until-fail:3 run. With APS5_NO_SLEEP_WAKE=1, cpu_label_wake fails (a completed CPU label did not wake the guest short sleep) and guest_sleep_wake aborts (0xc0000409), 4/4 each. same_queue_label_wait still passes.

[sync] line, vkQuake PPSA99010. Shareware pak0 demo loop at 3840x2160, 90 s, APS5_PROFILE_DRAW=1 APS5_PROFILE_GPU=1 APS5_TRACE_SUMMARY_EVERY=10, interleaved with main in one session. The values are cumulative at the drain where the line printed.

main (8223 presents at the next [flip]):
[sync] 5 device drains by packet: DMA_DATA=5 (4 waited without the GPU mutex); 344724 labels written on the GPU, 0 deferred behind completions, 0 no-op, fallbacks: idle 5679, completions 0, not imported 0, undecodable 0; 0 labels queued per worker, recorded in 0 groups, 350403 recorded at once; stores: 12969 recorded on the GPU, 0 behind completions, 3052 on the CPU (idle), 5 synced (drained), 0 DMA fills stored as buffer fills; 0 copies into host memory synced on their source; 0 copies of up to 64 KiB recorded on the GPU behind their source's pending stores
this PR (8419 presents):
[sync] 5 device drains by packet: DMA_DATA=5 (4 waited without the GPU mutex); 352091 labels written on the GPU, 0 deferred behind completions, 0 no-op, fallbacks: idle 6738, completions 0, not imported 0, undecodable 0; 0 labels queued per worker, recorded in 0 groups, 358829 recorded at once; stores: 13653 recorded on the GPU, 0 behind completions, 2742 on the CPU (idle), 5 synced (drained), 0 DMA fills stored as buffer fills; 0 copies into host memory synced on their source; 0 copies of up to 64 KiB recorded on the GPU behind their source's pending stores

Labels on the Sync path and imports avoided. Your point 2 stands: the Sync path returns 1, so in [sync] it shows up as idle. To separate it I added local counters (not proposed for merge) in WriteLabelOnGpu after the Idle() return, on main and on this PR: busy-recorder labels with no covering import (HostImportCovers false; on this PR, exactly the labels that take recorder.Sync()), and Access imports made inside a label's HostImportFor. They printed next to [flip], because Ping Pong and Showcase print no [sync] line in 60 s.

Title (60 s) main: labels without import / imports made this PR: Sync-path labels (per present) / imports made GPU labels per present, main / PR
Middle Ages Ping Pong PPSA28319 2 / 2 2990 (1.00) / 0 13.0 / 9.0
Showcase PPSA99005 3 / 3 2 (0.004) / 0 37.0 / 37.0
vkQuake PPSA99010 0 / 0 0 / 0 42.6 / 42.6

vkQuake gave 0 / 0 in a 120 s run as well. So in Ping Pong this PR avoids 2 imports and syncs the recorder about once per frame instead, as you described. Ping Pong is vsync-bound and stays at 59.94 FPS with p50 16.683 ms on both sides. vkQuake takes the path 0 times, so its FPS difference against main in the same session (+6.8/+5.4% in a loaded round, +2.8/+2.5% in a quiet one: 105.44/105.68 vs 108.36/108.36 FPS) cannot come from the label change. #6658's short-sleep wake is the other change in this PR, but I did not build #6658 alone to confirm that.

GPU pass on main + #7473 + this PR: 599 passed, 2 skipped as on main, 2 failed (pass_input_hazard also fails on main; indirect_arguments_pending_producer as above). Conventions: 0 errors, 1 warning (docs/dev/debt/libkernel.md:228 debt entry 1022 characters). git diff --check is clean.

Not checked: #6658 on its own, the PR head on its own base, Linux, the full non-GPU suite.

Written with Claude Code assistance (validation by a subagent, reviewed in this session).

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6295866291 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7464#issuecomment-6295866291). Originally posted by [screamm](https://github.com/screamm) on 2026-10-20T16:31:17Z. --- Windows NVIDIA run on the rebase, with the `[sync]` lines and the per-label counts you asked for. Two blockers came up on current main. Host: Windows 11 Pro 26220, NVIDIA GeForce RTX 4070 driver 596.21, Ryzen 7 5700X, WinLibs MinGW-w64 GCC 15.2 r7, Release. Head `aa92e2c47`, which is already newer than blawesom's `rebase/7464` (`f7e0a81c2`), merged onto main `1d4164552`. Two include/field unions: `EntryPoints.cpp` (main's `Screenshot.hpp` include and yours) and `Recorder.hpp` (main's `submitHold`/`submitHoldValue` and your `progressWatcher`). **1. `agc_driver_indirect_arguments_pending_producer` hangs with this PR.** It times out at 300 s in the GPU pass and 3/3 at 60 s on main+this PR alone, also with `APS5_NO_SLEEP_WAKE=1`. main's binary passes 3/3 in about 1 s. The hang is in the last variant, `group counts read on the CPU behind an argument label of an earlier graphics batch`, which loops on `[gpu] recorded batch still running on the GPU after N s`. If I restore only this PR's `VulkanDevice.cpp` hunk (the `HostImportCovers` / `recorder.Sync()` path) to main, it passes 3/3. That case records a label into `slot.arguments` while the fixture's timeline-semaphore gate holds the batch until the producer is submitted (`16683be01`), and it requires `WriteLabelOnGpu(...) == 0`. main imports the label memory and records the store. Here the unimported path syncs the held batch instead. The test arrived on main on 10-19 (`f6c8e8474`, `16683be01`), after this PR's base `e1dae23e0`. **2. The new eight-byte case in `agc_driver_unimported_label_order` is layout-flaky.** The first x3 passed, but 4 of 12 further runs failed with `an eight-byte label did not select its unimported CPU path`, and it also failed 1 of 1 on the stack build. With a printf it fails exactly when VirtualAlloc places `temporary` right after a 128 KiB-aligned `labels` block. The `FillBuffer` import of `labels` is then 131072 bytes and covers `temporary`, so the label correctly goes to the GPU (reason 0): | reason | labels | temporary | import live bytes | |---:|---|---|---:| | 0 | `0x1f138b60000` | `0x1f138b70000` | 131072 | | 1 | `0x2829f8b0000` | `0x2829f8c0000` | 65536 | | 1 | `0x29515640000` | `0x29515830000` | 65536 | A gap between the two blocks, or a `HostImportCovers` check on `temporary` first, would make the case deterministic. **Tests and control.** `agc_driver_cpu_label_wake`, `agc_driver_same_queue_label_wait`, `agc_driver_unimported_label_order` and `guest_sleep_wake` pass 4/4 in the first `until-fail:3` run. With `APS5_NO_SLEEP_WAKE=1`, `cpu_label_wake` fails (`a completed CPU label did not wake the guest short sleep`) and `guest_sleep_wake` aborts (0xc0000409), 4/4 each. `same_queue_label_wait` still passes. **`[sync]` line, vkQuake PPSA99010.** Shareware pak0 demo loop at 3840x2160, 90 s, `APS5_PROFILE_DRAW=1 APS5_PROFILE_GPU=1 APS5_TRACE_SUMMARY_EVERY=10`, interleaved with main in one session. The values are cumulative at the drain where the line printed. main (8223 presents at the next `[flip]`): [sync] 5 device drains by packet: DMA_DATA=5 (4 waited without the GPU mutex); 344724 labels written on the GPU, 0 deferred behind completions, 0 no-op, fallbacks: idle 5679, completions 0, not imported 0, undecodable 0; 0 labels queued per worker, recorded in 0 groups, 350403 recorded at once; stores: 12969 recorded on the GPU, 0 behind completions, 3052 on the CPU (idle), 5 synced (drained), 0 DMA fills stored as buffer fills; 0 copies into host memory synced on their source; 0 copies of up to 64 KiB recorded on the GPU behind their source's pending stores this PR (8419 presents): [sync] 5 device drains by packet: DMA_DATA=5 (4 waited without the GPU mutex); 352091 labels written on the GPU, 0 deferred behind completions, 0 no-op, fallbacks: idle 6738, completions 0, not imported 0, undecodable 0; 0 labels queued per worker, recorded in 0 groups, 358829 recorded at once; stores: 13653 recorded on the GPU, 0 behind completions, 2742 on the CPU (idle), 5 synced (drained), 0 DMA fills stored as buffer fills; 0 copies into host memory synced on their source; 0 copies of up to 64 KiB recorded on the GPU behind their source's pending stores **Labels on the Sync path and imports avoided.** Your point 2 stands: the Sync path returns 1, so in `[sync]` it shows up as `idle`. To separate it I added local counters (not proposed for merge) in `WriteLabelOnGpu` after the `Idle()` return, on main and on this PR: busy-recorder labels with no covering import (`HostImportCovers` false; on this PR, exactly the labels that take `recorder.Sync()`), and `Access` imports made inside a label's `HostImportFor`. They printed next to `[flip]`, because Ping Pong and Showcase print no `[sync]` line in 60 s. | Title (60 s) | main: labels without import / imports made | this PR: Sync-path labels (per present) / imports made | GPU labels per present, main / PR | |---|---|---|---| | Middle Ages Ping Pong PPSA28319 | 2 / 2 | 2990 (1.00) / 0 | 13.0 / 9.0 | | Showcase PPSA99005 | 3 / 3 | 2 (0.004) / 0 | 37.0 / 37.0 | | vkQuake PPSA99010 | 0 / 0 | 0 / 0 | 42.6 / 42.6 | vkQuake gave 0 / 0 in a 120 s run as well. So in Ping Pong this PR avoids 2 imports and syncs the recorder about once per frame instead, as you described. Ping Pong is vsync-bound and stays at 59.94 FPS with p50 16.683 ms on both sides. vkQuake takes the path 0 times, so its FPS difference against main in the same session (+6.8/+5.4% in a loaded round, +2.8/+2.5% in a quiet one: 105.44/105.68 vs 108.36/108.36 FPS) cannot come from the label change. #6658's short-sleep wake is the other change in this PR, but I did not build #6658 alone to confirm that. GPU pass on main + #7473 + this PR: 599 passed, 2 skipped as on main, 2 failed (`pass_input_hazard` also fails on main; `indirect_arguments_pending_producer` as above). Conventions: 0 errors, 1 warning (`docs/dev/debt/libkernel.md:228` debt entry 1022 characters). `git diff --check` is clean. Not checked: #6658 on its own, the PR head on its own base, Linux, the full non-GPU suite. Written with Claude Code assistance (validation by a subagent, reviewed in this session).
Dripl1x commented 2026-10-20 23:34:09 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Dripl1x on 2026-10-20T23:34:09Z.


Rebased onto main 2185dbf92e. The #6658 copy is gone (merged as b7596be595), and so are the duplicate APS5_NO_SLEEP_WAKE row and the docs commit, which only reworded text main now has.

@screamm, thank you, both blockers are confirmed and fixed. (1) The unimported path called recorder.Sync() under the GPU mutex, which submits the open batch and waits for every batch in flight. In the argument-label case the open batch is held on the fixture's semaphore until a later producer submit, so Sync never returned; the rebased old topic still times out here. The CPU path now runs only for queue 0 and never while a submit is held (Recorder::SubmitHeld()), so that label is imported and recorded on the GPU as on main; compute queues, which must never wait, keep main's path too. (2) The temporary block sat right after a 128-KiB-aligned labels block and was covered by its import; it is now registered between two unregistered guard blocks, and an adjacent aligned placement that failed the old case passes.

@oneandonlydean, on your three points:

  1. The [sync] line does not print in the SuperTuxKart scene (it prints only at a device drain by packet or with deferred label groups, as @screamm saw in Ping Pong), so I counted the same events with probe counters in main and in the series, A-B-B-A. Per frame the title maps about 48.5 blocks of 64 KiB. Main imports each at map time. #7465 alone defers those imports, and without this PR the next label imports the block anyway (47.8 label imports per frame). With this PR and #7465 in the same build, the label path takes about 59 labels per frame, about 194 µs each, and no import is created. Alone this PR changes nothing measurable here (9.21 / 9.33 FPS against main 9.24 / 9.30); together: main 9.18 / 9.03 FPS, main + #7465 8.66 / 8.91, main + #7465 + #7464 20.85 / 22.02, the whole series 29.01 / 28.70 (SuperTuxKart menu scene, RTX 3070 Laptop, two runs each in A-B-C-D-D-C-B-A order).
  2. Done: the synced path returns its own code 7, handled by every caller like 1, and is counted as no covering import (recorder synced) among the fallbacks and on the CPU with no covering import (recorder synced) among the stores.
  3. Done after #6658 merged.

Tests (Windows 11, RTX 3070 Laptop, Release): indirect_arguments_pending_producer 3/3, unimported_label_order 15/15 twice, cpu_label_wake, same_queue_label_wait, guest_sleep_wake, guest_sleep_wake_coarse, guest_nanosleep, precise_wait, alias_copy_label, pipelined_dma 3/3 each, negative controls for the queue gate, the held batch and the wake. The whole ^agc_driver_ set on this head: 612 tests, 601 passed, 3 skipped, 8 failed. I then ran the eight (depth_clear_hle, depth_fast_clear_submit, multisample_fill_host_only, native_multisample_depth, native_depth_clears, prepared_shaders_indirect, prepared_shaders_debug, prepared_shaders_debug_failure) three times each on main 2185dbf92e and on this head: 13 of 24 failed on main and 11 of 24 here, the same tests on both sides (access violations and timeouts), so I do not attribute them to this change. The description has the counters, the remaining limitation (recorded guest GPU work that waits for memory a later CPU write produces would block the sync), summary lines and evidence.

AI-assisted: yes (Claude Code)

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6304197194 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7464#issuecomment-6304197194). Originally posted by [Dripl1x](https://github.com/Dripl1x) on 2026-10-20T23:34:09Z. --- Rebased onto main `2185dbf92e`. The #6658 copy is gone (merged as `b7596be595`), and so are the duplicate `APS5_NO_SLEEP_WAKE` row and the docs commit, which only reworded text main now has. @screamm, thank you, both blockers are confirmed and fixed. (1) The unimported path called `recorder.Sync()` under the GPU mutex, which submits the open batch and waits for every batch in flight. In the argument-label case the open batch is held on the fixture's semaphore until a later producer submit, so `Sync` never returned; the rebased old topic still times out here. The CPU path now runs only for queue 0 and never while a submit is held (`Recorder::SubmitHeld()`), so that label is imported and recorded on the GPU as on main; compute queues, which must never wait, keep main's path too. (2) The temporary block sat right after a 128-KiB-aligned labels block and was covered by its import; it is now registered between two unregistered guard blocks, and an adjacent aligned placement that failed the old case passes. @oneandonlydean, on your three points: 1. The `[sync]` line does not print in the SuperTuxKart scene (it prints only at a device drain by packet or with deferred label groups, as @screamm saw in Ping Pong), so I counted the same events with probe counters in main and in the series, A-B-B-A. Per frame the title maps about 48.5 blocks of 64 KiB. Main imports each at map time. #7465 alone defers those imports, and without this PR the next label imports the block anyway (47.8 label imports per frame). With this PR and #7465 in the same build, the label path takes about 59 labels per frame, about 194 µs each, and no import is created. Alone this PR changes nothing measurable here (9.21 / 9.33 FPS against main 9.24 / 9.30); together: main 9.18 / 9.03 FPS, main + #7465 8.66 / 8.91, main + #7465 + #7464 20.85 / 22.02, the whole series 29.01 / 28.70 (SuperTuxKart menu scene, RTX 3070 Laptop, two runs each in A-B-C-D-D-C-B-A order). 2. Done: the synced path returns its own code 7, handled by every caller like 1, and is counted as `no covering import (recorder synced)` among the fallbacks and `on the CPU with no covering import (recorder synced)` among the stores. 3. Done after #6658 merged. Tests (Windows 11, RTX 3070 Laptop, Release): `indirect_arguments_pending_producer` 3/3, `unimported_label_order` 15/15 twice, `cpu_label_wake`, `same_queue_label_wait`, `guest_sleep_wake`, `guest_sleep_wake_coarse`, `guest_nanosleep`, `precise_wait`, `alias_copy_label`, `pipelined_dma` 3/3 each, negative controls for the queue gate, the held batch and the wake. The whole `^agc_driver_` set on this head: 612 tests, 601 passed, 3 skipped, 8 failed. I then ran the eight (`depth_clear_hle`, `depth_fast_clear_submit`, `multisample_fill_host_only`, `native_multisample_depth`, `native_depth_clears`, `prepared_shaders_indirect`, `prepared_shaders_debug`, `prepared_shaders_debug_failure`) three times each on main `2185dbf92e` and on this head: 13 of 24 failed on main and 11 of 24 here, the same tests on both sides (access violations and timeouts), so I do not attribute them to this change. The description has the counters, the remaining limitation (recorded guest GPU work that waits for memory a later CPU write produces would block the sync), summary lines and evidence. AI-assisted: yes (Claude Code)
LeandroLP23 commented 2026-10-21 18:25:50 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by LeandroLP23 on 2026-10-21T18:25:50Z.


SuperTuxKart race data on the unimported-label path, in case it helps with this PR and #8858. It doesn't call for a change; the two alternatives I tried were worse.

Setup.

  • Hardware and build: Radeon 860M, Windows 11 26300, AMD 32.0.13058.8001, WinLibs GCC 15.2.0, Release.
  • Tree: main d34da5d694 + #6718 + this PR (b31bc845fb) + #7465 + #8858 + #8748. Only #7465 conflicted, in a test file.
  • Scene: the tutorial race of PPSA69421, with APS5_TRACE_SECONDS=95:20.
  • This tree runs the race at 10.46 / 10.68 FPS, against 1.70 / 2.16 on main alone. Numbers are on #6718 and #8748.

Where the remaining time goes.

  • In a trace_digest, the draw committer is busy 71.6 ms of a ~96 ms frame, and Recorder.Sync takes 41.1 ms of that at its top level.
  • The [recorder] line with APS5_PROFILE_DRAW=1 lists 68256 syncs waiting 47.0 s over the run. 68115 of them, 46.9 s, come from one site: +0x131156, the return from Recorder::SyncForCpuLabel in VulkanDevice::WriteLabelOnGpu. That is this PR's syncUnimported path.
  • The title's thread, ps5-opengl's fence wait, spins briefly, then calls sceKernelUsleep(1000) until the label matches, for up to 2000 tries. That is about 64 % of its samples.
  • So every queue-0 label into memory without an import (about 32 per frame here) drains the recorder.

Two alternatives, both worse. Measured locally, two runs each, same scene:

unimported queue-0 label FPS GPU busy per present
SyncForCpuLabel, then a CPU store (this PR) 10.46 / 10.68 33.9 / 31.0 ms
no HostImportCovers early return, so HostImportFor imports the range and the store goes on the GPU 5.41 / 5.35 73.9 / 78.1 ms
AfterCompletions(..., storedOnGpu = false) and reason 5, so the label lands at the batch's reap with no drain 0.74 / 0.72 28.2 / 77.5 ms
  • Importing the label pages doubles the GPU time per frame.
  • Deferring the store to the reap leaves the label unwritten for about 1.35 s a frame: nothing reaps that batch promptly, and the title polls in 1 ms sleeps until then.

The drain looks like the right choice among these. Unless a completion could be reaped as soon as the progress watcher sees the batch finish (it already wakes the sleepers), the label has to land when the title wakes. I haven't tried that.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6323429207 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7464#issuecomment-6323429207). Originally posted by [LeandroLP23](https://github.com/LeandroLP23) on 2026-10-21T18:25:50Z. --- SuperTuxKart race data on the unimported-label path, in case it helps with this PR and #8858. It doesn't call for a change; the two alternatives I tried were worse. **Setup.** - Hardware and build: Radeon 860M, Windows 11 26300, AMD 32.0.13058.8001, WinLibs GCC 15.2.0, Release. - Tree: `main` `d34da5d694` + #6718 + this PR (`b31bc845fb`) + #7465 + #8858 + #8748. Only #7465 conflicted, in a test file. - Scene: the tutorial race of PPSA69421, with `APS5_TRACE_SECONDS=95:20`. - This tree runs the race at 10.46 / 10.68 FPS, against 1.70 / 2.16 on `main` alone. Numbers are on #6718 and #8748. **Where the remaining time goes.** - In a `trace_digest`, the draw committer is busy 71.6 ms of a ~96 ms frame, and `Recorder.Sync` takes 41.1 ms of that at its top level. - The `[recorder]` line with `APS5_PROFILE_DRAW=1` lists 68256 syncs waiting 47.0 s over the run. 68115 of them, 46.9 s, come from one site: `+0x131156`, the return from `Recorder::SyncForCpuLabel` in `VulkanDevice::WriteLabelOnGpu`. That is this PR's `syncUnimported` path. - The title's thread, ps5-opengl's fence wait, spins briefly, then calls `sceKernelUsleep(1000)` until the label matches, for up to 2000 tries. That is about 64 % of its samples. - So every queue-0 label into memory without an import (about 32 per frame here) drains the recorder. **Two alternatives, both worse.** Measured locally, two runs each, same scene: | unimported queue-0 label | FPS | GPU busy per present | |---|---|---| | `SyncForCpuLabel`, then a CPU store (this PR) | 10.46 / 10.68 | 33.9 / 31.0 ms | | no `HostImportCovers` early return, so `HostImportFor` imports the range and the store goes on the GPU | 5.41 / 5.35 | 73.9 / 78.1 ms | | `AfterCompletions(..., storedOnGpu = false)` and reason 5, so the label lands at the batch's reap with no drain | 0.74 / 0.72 | 28.2 / 77.5 ms | - Importing the label pages doubles the GPU time per frame. - Deferring the store to the reap leaves the label unwritten for about 1.35 s a frame: nothing reaps that batch promptly, and the title polls in 1 ms sleeps until then. The drain looks like the right choice among these. Unless a completion could be reaped as soon as the progress watcher sees the batch finish (it already wakes the sleepers), the label has to land when the title wakes. I haven't tried that.
Dripl1x commented 2026-10-22 02:59:33 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Dripl1x on 2026-10-22T02:59:33Z.


Updated on 2026-10-22; the description is rewritten to match.

  • Stacked on #7465 (Depends on: #7465): the branch is now main 94fbb8cea8 + #7465's three commits + this PR's five, unchanged (the same patch as b31bc845fb); head 223f2469f5. This path only acts on blocks #7465 leaves unimported, so its effect is measured on top of #7465.
  • New SuperTuxKart captures, one session: main 9.91 / 10.24 FPS, #7465 alone 10.29 / 10.19, #7465 with this PR 25.87 / 25.99. The trace also shows the cost of the path: Recorder.Sync 12.0 ms per frame on the draw committer.
  • Re-tested on this head and on main: the label and import tests three times on an RTX 3070 Laptop GPU, once on the AMD integrated GPU and on lavapipe; the validation layer reports the same VUIDs on both.
  • Description: it adds @LeandroLP23's race data, states that a title which keeps a small label block mapped was not measured (Lodoss was not run with this PR), and lists the textual conflicts with #7963 and #9495. Evidence: 7464-evidence-20261022.zip.
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6331599305 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7464#issuecomment-6331599305). Originally posted by [Dripl1x](https://github.com/Dripl1x) on 2026-10-22T02:59:33Z. --- Updated on 2026-10-22; the description is rewritten to match. - **Stacked on #7465** (`Depends on: #7465`): the branch is now `main` `94fbb8cea8` + #7465's three commits + this PR's five, unchanged (the same patch as `b31bc845fb`); head `223f2469f5`. This path only acts on blocks #7465 leaves unimported, so its effect is measured on top of #7465. - **New SuperTuxKart captures**, one session: `main` 9.91 / 10.24 FPS, #7465 alone 10.29 / 10.19, #7465 with this PR 25.87 / 25.99. The trace also shows the cost of the path: `Recorder.Sync` 12.0 ms per frame on the draw committer. - **Re-tested** on this head and on `main`: the label and import tests three times on an RTX 3070 Laptop GPU, once on the AMD integrated GPU and on lavapipe; the validation layer reports the same VUIDs on both. - **Description**: it adds @LeandroLP23's race data, states that a title which keeps a small label block mapped was not measured (Lodoss was not run with this PR), and lists the textual conflicts with #7963 and #9495. Evidence: [7464-evidence-20261022.zip](https://github.com/Dripl1x/AnyPS5/releases/download/review-20261022-7464/7464-evidence-20261022.zip).
JJenkx commented 2026-10-22 07:10:05 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by JJenkx on 2026-10-22T07:10:05Z.


Lodoss, which the description lists as not run: neutral on AMD/Linux, with no measurable cost from the new path.

Setup

  • Record of Lodoss War (PPSA05347), Linux 7.2.9, Ryzen 9 7950X, RX 6650 XT, RADV (Mesa 26.2.4).
  • #7465's head a1cee90f52 against this PR's head 223f2469f5 (#7465 + this PR), both on main 94fbb8cea8, clean builds.
  • Identical shader-cache and save seeds, scripted inputs, 280 s per run, alternated #7465, PR, PR, #7465. APS5_TRACE_SECONDS=200:30 with 2097152 events; every trace reports dirty false and dropped false.
Run presents / FPS frame p50 / p99 ms Recorder.Sync ms per frame host imports made (access) map made / refused / failed
#7465 1799 / 59.94 16.68 / 16.70 0.2 132 (20) 112 / 60 / 75
PR 1799 / 59.94 16.68 / 16.70 0.2 128 (18) 110 / 61 / 75
PR 1799 / 59.94 16.68 / 16.70 0.3 129 (18) 111 / 60 / 75
#7465 1799 / 59.94 16.68 / 16.70 0.2 132 (20) 112 / 60 / 75
  • Both sides hold the title's 60 FPS cap, so this scene cannot show a gain.
  • The PR removes about two first-use imports per run (access 20 → 18) and adds no measurable Recorder.Sync time, unlike the 12 ms per frame in the SuperTuxKart capture. In this scene, Lodoss's small blocks are rarely first touched by a label.
  • The 75 failed map imports appear identically on both sides, so they are not from this PR.

AI-assisted: yes (Claude Code); results above were run on this machine.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6334963359 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7464#issuecomment-6334963359). Originally posted by [JJenkx](https://github.com/JJenkx) on 2026-10-22T07:10:05Z. --- Lodoss, which the description lists as not run: neutral on AMD/Linux, with no measurable cost from the new path. **Setup** - Record of Lodoss War (PPSA05347), Linux 7.2.9, Ryzen 9 7950X, RX 6650 XT, RADV (Mesa 26.2.4). - #7465's head `a1cee90f52` against this PR's head `223f2469f5` (#7465 + this PR), both on `main` `94fbb8cea8`, clean builds. - Identical shader-cache and save seeds, scripted inputs, 280 s per run, alternated #7465, PR, PR, #7465. `APS5_TRACE_SECONDS=200:30` with 2097152 events; every trace reports dirty false and dropped false. | Run | presents / FPS | frame p50 / p99 ms | `Recorder.Sync` ms per frame | host imports made (`access`) | `map` made / refused / failed | |---|---|---|---|---|---| | #7465 | 1799 / 59.94 | 16.68 / 16.70 | 0.2 | 132 (20) | 112 / 60 / 75 | | PR | 1799 / 59.94 | 16.68 / 16.70 | 0.2 | 128 (18) | 110 / 61 / 75 | | PR | 1799 / 59.94 | 16.68 / 16.70 | 0.3 | 129 (18) | 111 / 60 / 75 | | #7465 | 1799 / 59.94 | 16.68 / 16.70 | 0.2 | 132 (20) | 112 / 60 / 75 | - Both sides hold the title's 60 FPS cap, so this scene cannot show a gain. - The PR removes about two first-use imports per run (`access` 20 → 18) and adds no measurable `Recorder.Sync` time, unlike the 12 ms per frame in the SuperTuxKart capture. In this scene, Lodoss's small blocks are rarely first touched by a label. - The 75 failed `map` imports appear identically on both sides, so they are not from this PR. AI-assisted: yes (Claude Code); results above were run on this machine.
MarcZX10 commented 2026-11-19 19:32:03 +00:00 (Migrated from github.com)

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

Review: APPROVED


Reviewed — looks good

Nothing blocks this change; the points below are optional.

What I ran

Reviewed head 4e2ae4323ec03c14485b1183887511b8876eb812 from the prepared diff and the pinned repository source using repo_read.py. No tests or build commands were run; the test results in the PR description are author reported.

Results

Check Result Note
Changed code review passed Inspected all changed files
Build and tests not run Results supplied by author only
Negative control not run Not independently repeated

Findings

Blocking

None.

Non-blocking

  • Recorder::SubmitHeld() deliberately stops gating unimported-label sync once the held batch signals. Consider a focused regression test for a held submit that completes before a later label arrives, since the new helper’s in-flight transition is central to the queue-wait safety condition (core/libs/prx/libSceAgcDriver/Graphics/src/Recorder.cpp:4681).

Not verified

The full CTest suite, console behavior beyond the reported SuperTuxKart run, and author reported build/test results were not independently verified. Read the prepared description, commits, manifest and diff; inspected all changed source and test files, including the full relevant VulkanDevice.cpp function. files.json reports no excluded changed files.

To get this to a good state

Nothing is required. The optional regression-test suggestion above can be considered for follow-up.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5981933789 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7464#pullrequestreview-5981933789). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-19T19:32:03Z. **Review:** APPROVED --- # Reviewed — looks good Nothing blocks this change; the points below are optional. ## What I ran Reviewed head `4e2ae4323ec03c14485b1183887511b8876eb812` from the prepared diff and the pinned repository source using `repo_read.py`. No tests or build commands were run; the test results in the PR description are author reported. ## Results | Check | Result | Note | |---|---|---| | Changed code review | passed | Inspected all changed files | | Build and tests | not run | Results supplied by author only | | Negative control | not run | Not independently repeated | ## Findings ### Blocking None. ### Non-blocking - `Recorder::SubmitHeld()` deliberately stops gating unimported-label sync once the held batch signals. Consider a focused regression test for a held submit that completes before a later label arrives, since the new helper’s in-flight transition is central to the queue-wait safety condition (`core/libs/prx/libSceAgcDriver/Graphics/src/Recorder.cpp:4681`). ## Not verified The full CTest suite, console behavior beyond the reported SuperTuxKart run, and author reported build/test results were not independently verified. Read the prepared description, commits, manifest and diff; inspected all changed source and test files, including the full relevant `VulkanDevice.cpp` function. `files.json` reports no excluded changed files. ## To get this to a good state Nothing is required. The optional regression-test suggestion above can be considered for follow-up.
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!7464
No description provided.