perf(agc): re-check only the host imports a registry change can reach #9402

Merged
janzezno merged 2 commits from upstream-pr/9402 into main 2026-10-27 05:10:49 +00:00
janzezno commented 2026-10-21 20:49:12 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by janzezno on 2026-10-21T20:49:12Z.


What

refreshImports re-checked every live host import, and every remembered failure and refusal, each time the guest allocation registry changed. A title that maps memory often pays that walk constantly. SuperTuxKart (PPSA69421) maps about 1650 times a second at its menu. With #8091's budget fix, about 440 imports (~1.1 GiB) stay live there, and the walk alone costs ~118 ms of CPU per second on the frame's critical path. The frame rate falls as the import budget grows: ~34 FPS with the default budget, ~48 FPS with APS5_HOST_IMPORT_MIB=128.

This PR makes the refresh incremental:

  • The import table keeps the (address, bytes, weak_ptr) of every range in the lease it was last checked against. The snapshot holds weak_ptrs because a lease pins its ranges: unmap waits while use_count() != 1.
  • A refresh merges that snapshot with the new lease by range identity (owner_before, as sameRun does). The result is the address spans whose ranges were added, removed or replaced, whatever mutation did it, including backing renewals.
  • Only imports whose import window ([base / window * window, max(that + window, base + bytes))) touches a changed span are checked again. These are found with a lower_bound on the import map plus one predecessor; imports never overlap, as peekImport already relies on. importRun, exactRun and joinedRun read only ranges inside that span. The scan carries a cursor across the changed spans, so each import is checked at most once per refresh even when several separate spans fall in one window.
  • Imports made since the last refresh are always checked. A thread can make an import from a lease taken before another thread's refresh, and the next diff would not show that range. They are kept as a set of distinct bases (pendingImports); retiring an import removes its base, so the set never holds more than the live imports.
  • Every import is checked, as before, when the window is 0 or the window or the effective budget changed since the last refresh.
  • check is the only place either walk retires an import, so #8926's handling of retired imports (now on main) sits there: check notes the unwatched ranges of each import it retires, and those ranges go back in the write watch once after both walks.
  • Remembered failures, failed joins, failed blocks and refusals are dropped by the same window test. Every use site already validates them with sameRun, so this is cleanup only.

One behaviour differs, and it is recorded in docs/dev/debt/libSceAgcDriver.md. An unchanged import whose run could now be larger, because a remembered refusal no longer holds, is kept until its window changes. A request that needs the larger run still retires it (wouldRetireImport). On main, any registry change anywhere retired it. Under a 128 MiB budget in SuperTuxKart, main retired and re-made the same three still-valid single-range imports about 1650 times a second for this reason.

New test agc_windowed_import_refresh (128 KiB window, three windows):

  • a continuing range added inside an import's window, outside the import's own bytes, retires it;
  • an import in another window survives;
  • re-mapping a range retires its import only.

It passes on main and on this PR. It fails when the window query is narrowed to lower_bound(begin): "an import whose window gained a continuing range was kept".

Two local probes (not in this PR) checked the review follow-ups:

  • 32 single-range imports in one 8 MiB window, then 32 separate ranges added between them in one mutation: the refresh made 1024 checks before the cursor and 32 with it.
  • SuperTuxKart with #8091 counted the pending set at each of ~12,000 refreshes per 5 s. With a 128 MiB budget (71 live imports, 107,397 made in 50 s) and with the default budget (440 live), it never held more than 1 entry or more than the live imports.

Tested

Arch Linux (kernel 7.2.11), Ryzen 5 7500F, AMD Radeon RX 7900 GRE, RADV Mesa 26.2.5, on main 716cb74e08. SuperTuxKart (PPSA69421 00.001.000, catalog sha256 f2240bf0…b712a), relinked with --trap-sdk-syscall-stubs. Main menu with no input, headless gamescope --backend headless -W 1920 -H 1080, APS5_TRACE_SUMMARY_EVERY=10, 70 s runs. Each side's first run creates the game's configuration and starts in a different first-launch scene, so it only warms the shader caches and is not counted. Then four rounds of one run per side, main first. The FPS is the presents in the last 8 s of each run (VideoOut telemetry).

Why #8091 is applied on both sides. On RADV, plain main lowers the import budget after memfd-backed imports are refused (#8091). The menu then randomly settles in a GPU-bound ~3 FPS mode, with GPU ~90% busy and a CPU nearly idle, or a fast mode with ~74 MiB of imports. Both sides do this: on plain main eaff87674c, main ran 2.9 / 2.7 / 3.3 FPS and this PR 1.0 / 3.2 / 53.7 FPS. That noise hides the walk. Both builds below therefore carry #8091's one-line production change in importRunAt. This PR does not depend on #8091.

Side FPS, last 8 s, rounds 2-4 Round 1 GPU busy per present
main + #8091 32.5 / 32.3 / 32.1 30.5 1.9 ms
this PR + #8091 36.8 / 36.8 / 36.5 32.3 1.9 ms

Round 1 started right after this PR's build finished (load average 12.7) and is slower on both sides, so it is listed apart; the fourth round was added for that reason. On the previous base 1e20650e84 the same protocol gave 32.3 / 32.3 / 32.2 on main and 39.7 / 38.5 / 38.5 with this PR, and on b7d1d47a5f 37.2 / 35.9 / 36.8 and 51.8 / 54.0 / 53.2.

main was built from 716cb74e08 and this PR from its pushed head 90b365b5b9, each with #8091's one-line change uncommitted, so both sides' summary lines show as dirty. tools/trace_digest.py of the first clean run (round 2) of each side (summary files of all runs attached):

main + #8091

6 intervals, 0.0 to 60.1 s, 1790 presents
AMD Radeon RX 7900 GRE (RADV NAVI31), radv Mesa 26.2.5-arch1.1, Linux 7.2.11-arch1-1, 1920x1080, commit 716cb74e08 (dirty)

# seconds presents p50 p90 p99 max GPU busy busiest worker largest phase
1 0-10 195 31.1 97.1 350.2 1386.4 1.9 3 % Graphics.Draw 3.4
2 10-20 323 30.8 31.9 34.4 52.1 1.9 5 % Graphics.Draw 2.8
3 20-30 318 31.3 33.1 34.9 35.6 1.9 5 % Graphics.Draw 2.9
4 30-40 309 32.1 34.1 39.3 44.3 1.9 5 % Graphics.Draw 3.0
5 40-50 322 31.0 31.6 33.0 33.7 1.9 4 % Graphics.Draw 2.7
6 50-60 323 30.9 31.4 35.0 45.9 1.9 4 % Graphics.Draw 2.7
p99 ms  @_____  0-350.2
gpu ms  @@@@@@  0-1.9
this PR + #8091

6 intervals, 0.0 to 60.1 s, 2051 presents
AMD Radeon RX 7900 GRE (RADV NAVI31), radv Mesa 26.2.5-arch1.1, Linux 7.2.11-arch1-1, 1920x1080, commit 90b365b5b9f0 (dirty)

# seconds presents p50 p90 p99 max GPU busy busiest worker largest phase
1 0-10 225 27.6 70.9 242.5 1380.7 1.9 3 % Graphics.Draw 2.3
2 10-20 369 26.7 29.6 35.1 37.9 1.9 5 % Recorder.Submit 1.9
3 20-30 367 27.0 29.9 32.7 37.1 1.9 5 % Recorder.Submit 1.9
4 30-40 358 27.7 30.9 32.2 41.5 1.9 5 % Recorder.Submit 2.0
5 40-50 367 27.0 29.7 30.6 31.2 1.9 5 % Recorder.Submit 1.9
6 50-60 365 27.1 29.9 32.5 38.9 1.9 5 % Recorder.Submit 1.9
p99 ms  @_____  0-242.5
gpu ms  @@@@@@  0-1.9

Trace windows for the perf check. APS5_TRACE_SECONDS=40:10, same scene, machine and builds as the runs above. Two windows per side: main 322 / 326 presents, p50 31.1 / 30.7 ms, p99 32.2 / 31.6 ms; this PR 370 / 364 presents, p50 26.7 / 27.3 ms, p99 33.1 / 30.9 ms. The first PR window has one 43 ms frame, which puts its p99 and max above main's; the second does not. The first window of each side, with its trace attached (aps5-trace-716cb74e0871-151594 is main, aps5-trace-90b365b5b9f0-151903 is this PR):

main + #8091:

{"commit":"716cb74e0871","dirty":true,"env":{"APS5_NO_PAD_INPUT":"1","APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"40:10","APS5_TRACE_SUMMARY_EVERY":"10","APS5_VIDEOOUT_TELEMETRY_DIR":"<path>"},"gpu":"AMD Radeon RX 7900 GRE (RADV NAVI31)","driver":"radv Mesa 26.2.5-arch1.1","os":"Linux 7.2.11-arch1-1","cpu":"AMD Ryzen 5 7500F 6-Core Processor","cpu_threads":12,"memory_mib":31744,"title_id":"PPSA69421","title":"SuperTuxKart","content_version":"00.001.000","resolution":"1920x1080","window":{"spec":"seconds 40:10","first_present":1149,"ms":10026.366},"presents":322,"frame_ms":{"p50":31.120,"p90":31.659,"p99":32.202,"max":33.652},"gpu_busy_ms_per_present":1.884,"worker_busy_pct":{"queue worker 0x0":4.131},"top_phases_ms_per_frame":{"Graphics.Draw":2.800,"Vulkan.DrawFromRecipe":2.614,"Graphics.DrawWithRecipe":2.598,"Graphics.DrawWithRecipe.draw_and_resource_release":2.591,"Graphics.Draw.draw_and_resource_release":2.099,"Recorder.Submit":1.968,"Driver.Packet":1.267,"Driver.Packet.draw":0.863},"trace_dropped":false,"trace":"aps5-trace-716cb74e0871-151594.json.gz"}

this PR + #8091:

{"commit":"90b365b5b9f0","dirty":true,"env":{"APS5_NO_PAD_INPUT":"1","APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"40:10","APS5_TRACE_SUMMARY_EVERY":"10","APS5_VIDEOOUT_TELEMETRY_DIR":"<path>"},"gpu":"AMD Radeon RX 7900 GRE (RADV NAVI31)","driver":"radv Mesa 26.2.5-arch1.1","os":"Linux 7.2.11-arch1-1","cpu":"AMD Ryzen 5 7500F 6-Core Processor","cpu_threads":12,"memory_mib":31744,"title_id":"PPSA69421","title":"SuperTuxKart","content_version":"00.001.000","resolution":"1920x1080","window":{"spec":"seconds 40:10","first_present":1328,"ms":10022.000},"presents":370,"frame_ms":{"p50":26.698,"p90":29.304,"p99":33.106,"max":43.172},"gpu_busy_ms_per_present":1.885,"worker_busy_pct":{"queue worker 0x0":4.573},"top_phases_ms_per_frame":{"Recorder.Submit":1.885,"Graphics.Draw":1.777,"Vulkan.DrawFromRecipe":1.494,"Graphics.DrawWithRecipe":1.479,"Graphics.DrawWithRecipe.draw_and_resource_release":1.472,"Graphics.Draw.draw_and_resource_release":1.471,"Driver.Packet":1.220,"Driver.Packet.draw":0.830},"trace_dropped":false,"trace":"aps5-trace-90b365b5b9f0-151903.json.gz"}
tools/trace_digest.py, main + #8091

seconds 40:10 from present 1149: 322 presents, frame p50 31.1 / p90 31.7 / p99 32.2 / max 33.7 ms, GPU busy 1.9 ms per present
AMD Radeon RX 7900 GRE (RADV NAVI31), radv Mesa 26.2.5-arch1.1, Linux 7.2.11-arch1-1, 1920x1080, commit 716cb74e08 (dirty), dropped: no

{"commit":"716cb74e0871","dirty":true,"env":{"APS5_NO_PAD_INPUT":"1","APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"40:10","APS5_TRACE_SUMMARY_EVERY":"10","APS5_VIDEOOUT_TELEMETRY_DIR":"<path>"},"gpu":"AMD Radeon RX 7900 GRE (RADV NAVI31)","driver":"radv Mesa 26.2.5-arch1.1","os":"Linux 7.2.11-arch1-1","cpu":"AMD Ryzen 5 7500F 6-Core Processor","cpu_threads":12,"memory_mib":31744,"title_id":"PPSA69421","title":"SuperTuxKart","content_version":"00.001.000","resolution":"1920x1080","window":{"spec":"seconds 40:10","first_present":1149,"ms":10026.366},"presents":322,"frame_ms":{"p50":31.12,"p90":31.659,"p99":32.202,"max":33.652},"gpu_busy_ms_per_present":1.884,"worker_busy_pct":{"queue worker 0x0":4.131},"top_phases_ms_per_frame":{"Graphics.Draw":2.8,"Vulkan.DrawFromRecipe":2.614,"Graphics.DrawWithRecipe":2.598,"Graphics.DrawWithRecipe.draw_and_resource_release":2.591,"Graphics.Draw.draw_and_resource_release":2.099,"Recorder.Submit":1.968,"Driver.Packet":1.267,"Driver.Packet.draw":0.863},"trace_dropped":false,"trace":"aps5-trace-716cb74e0871-151594.json.gz"}

Slowest frames (largest slices inside each, inclusive)

  • present 1378: 33.7 ms at 7116 ms: Driver.WorkerWait (queue worker 0x0) 32.2, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x0) 32.1, Graphics.Draw (draw committer) 3.4, Vulkan.DrawFromRecipe (draw committer) 3.0
  • present 1352: 32.7 ms at 6305 ms: Driver.WorkerWait (queue worker 0x0) 31.0, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x0) 30.9, Graphics.Draw (draw committer) 3.1, Vulkan.DrawFromRecipe (draw committer) 2.8
  • present 1379: 32.2 ms at 7150 ms: Driver.WorkerWait (queue worker 0x0) 31.0, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x0) 30.9, Graphics.Draw (draw committer) 3.3, Vulkan.DrawFromRecipe (draw committer) 2.9
  • present 1467: 32.2 ms at 9901 ms: Driver.WorkerWait (queue worker 0x0) 30.7, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x0) 30.7, Graphics.Draw (draw committer) 3.1, Vulkan.DrawFromRecipe (draw committer) 2.9
  • present 1340: 32.2 ms at 5930 ms: Driver.WorkerWait (queue worker 0x0) 30.6, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x0) 30.6, Vulkan.DrawFromRecipe (draw committer) 3.0, Graphics.DrawWithRecipe (draw committer) 2.9

Threads (ms per frame)

thread busy wait untraced in slices < 20 us largest
title 0.0 (0 %) 0.0 (0 %) 31.1 0.3 Recorder.Sync 0.0
queue worker 0x0 0.4 (1 %) 29.7 (95 %) 1.0 3.4 Driver.Packet 0.4
draw committer 7.4 (24 %) 0.2 (1 %) 23.5 0.1 Graphics.Draw 2.8, Vulkan.DrawFromRecipe 2.6
presenter 0.3 (1 %) 0.0 (0 %) 30.8 0.1 VideoOut.Flip 0.3
gpu 1.9 (6 %) 0.0 (0 %) 29.3 0.0 batch 1.9

Largest slices (ms per frame, inclusive, all threads): Driver.WorkerWait 29.7, Driver.WorkerWait.idle_and_completion_poll 29.7, Graphics.Draw 2.8, Vulkan.DrawFromRecipe 2.6, Graphics.DrawWithRecipe 2.6, Graphics.DrawWithRecipe.draw_and_resource_release 2.6, Graphics.Draw.draw_and_resource_release 2.1, Recorder.Submit 2.0, batch 1.9, Graphics.Draw.validate 0.7

Longest waits

  • Driver.WorkerWait (queue worker 0x0) 1.6 ms at 7137 ms, present 1378
  • Driver.WorkerWait (queue worker 0x0) 1.2 ms at 8204 ms, present 1412
  • Driver.WorkerWait (queue worker 0x0) 1.1 ms at 3716 ms, present 1268
  • Driver.WorkerWait (queue worker 0x0) 1.1 ms at 1445 ms, present 1195
  • Driver.WorkerWait (queue worker 0x0) 1.1 ms at 9611 ms, present 1457
  • Driver.WorkerWait (queue worker 0x0) 1.1 ms at 6014 ms, present 1342
  • Driver.WorkerWait (queue worker 0x0) 1.1 ms at 7205 ms, present 1380
  • Driver.WorkerWait (queue worker 0x0) 1.1 ms at 8141 ms, present 1410
  • Driver.WorkerWait (queue worker 0x0) 1.1 ms at 8829 ms, present 1432
  • Driver.WorkerWait (queue worker 0x0) 1.1 ms at 8766 ms, present 1430

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

  • batch 75908: 0.5 ms at 4646 ms, present 1298: GPU no ranges; recorded by Vulkan.DrawFromRecipe (draw committer) 0.1, Graphics.DrawWithRecipe (draw committer) 0.1, Graphics.DrawWithRecipe.draw_and_resource_release (draw committer) 0.1, Recorder.Submit (draw committer) 0.0
  • batch 76793: 0.5 ms at 5110 ms, present 1313: GPU no ranges; recorded by Vulkan.DrawFromRecipe (draw committer) 0.1, Graphics.DrawWithRecipe (draw committer) 0.1, Graphics.DrawWithRecipe.draw_and_resource_release (draw committer) 0.1, Recorder.Submit (draw committer) 0.0
  • batch 70834: 0.5 ms at 1971 ms, present 1212: GPU no ranges; recorded by Vulkan.DrawFromRecipe (draw committer) 0.1, Graphics.DrawWithRecipe (draw committer) 0.1, Graphics.DrawWithRecipe.draw_and_resource_release (draw committer) 0.1, Recorder.Submit (draw committer) 0.0
  • batch 79969: 0.5 ms at 6790 ms, present 1367: GPU no ranges; recorded by Recorder.Submit (draw committer) 0.0, Vulkan.DrawFromRecipe (draw committer) 0.0, Graphics.DrawWithRecipe (draw committer) 0.0, Graphics.DrawWithRecipe.draw_and_resource_release (draw committer) 0.0
  • batch 84405: 0.5 ms at 9143 ms, present 1442: GPU no ranges; recorded by Vulkan.DrawFromRecipe (draw committer) 0.1, Graphics.DrawWithRecipe (draw committer) 0.1, Graphics.DrawWithRecipe.draw_and_resource_release (draw committer) 0.1, Recorder.Submit (draw committer) 0.0
tools/trace_digest.py, this PR + #8091

seconds 40:10 from present 1328: 370 presents, frame p50 26.7 / p90 29.3 / p99 33.1 / max 43.2 ms, GPU busy 1.9 ms per present
AMD Radeon RX 7900 GRE (RADV NAVI31), radv Mesa 26.2.5-arch1.1, Linux 7.2.11-arch1-1, 1920x1080, commit 90b365b5b9f0 (dirty), dropped: no

{"commit":"90b365b5b9f0","dirty":true,"env":{"APS5_NO_PAD_INPUT":"1","APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"40:10","APS5_TRACE_SUMMARY_EVERY":"10","APS5_VIDEOOUT_TELEMETRY_DIR":"<path>"},"gpu":"AMD Radeon RX 7900 GRE (RADV NAVI31)","driver":"radv Mesa 26.2.5-arch1.1","os":"Linux 7.2.11-arch1-1","cpu":"AMD Ryzen 5 7500F 6-Core Processor","cpu_threads":12,"memory_mib":31744,"title_id":"PPSA69421","title":"SuperTuxKart","content_version":"00.001.000","resolution":"1920x1080","window":{"spec":"seconds 40:10","first_present":1328,"ms":10022.0},"presents":370,"frame_ms":{"p50":26.698,"p90":29.304,"p99":33.106,"max":43.172},"gpu_busy_ms_per_present":1.885,"worker_busy_pct":{"queue worker 0x0":4.573},"top_phases_ms_per_frame":{"Recorder.Submit":1.885,"Graphics.Draw":1.777,"Vulkan.DrawFromRecipe":1.494,"Graphics.DrawWithRecipe":1.479,"Graphics.DrawWithRecipe.draw_and_resource_release":1.472,"Graphics.Draw.draw_and_resource_release":1.471,"Driver.Packet":1.22,"Driver.Packet.draw":0.83},"trace_dropped":false,"trace":"aps5-trace-90b365b5b9f0-151903.json.gz"}

Slowest frames (largest slices inside each, inclusive)

  • present 1455: 43.2 ms at 3422 ms: Driver.WorkerWait (queue worker 0x0) 40.8, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x0) 40.8, Graphics.Draw (draw committer) 2.5, Recorder.Submit (draw committer) 2.4
  • present 1574: 40.5 ms at 6630 ms: Driver.WorkerWait (queue worker 0x0) 38.3, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x0) 38.2, Recorder.Submit (draw committer) 2.4, Graphics.Draw (draw committer) 2.4
  • present 1575: 37.3 ms at 6671 ms: Driver.WorkerWait (queue worker 0x0) 35.0, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x0) 34.9, Recorder.Submit (draw committer) 2.6, Graphics.Draw (draw committer) 2.3
  • present 1456: 33.1 ms at 3465 ms: Driver.WorkerWait (queue worker 0x0) 31.3, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x0) 31.2, Graphics.Draw (draw committer) 2.4, Recorder.Submit (draw committer) 2.1
  • present 1573: 31.2 ms at 6599 ms: Driver.WorkerWait (queue worker 0x0) 29.2, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x0) 29.1, Recorder.Submit (draw committer) 2.0, batch (gpu) 1.9

Threads (ms per frame)

thread busy wait untraced in slices < 20 us largest
title 0.0 (0 %) 0.0 (0 %) 27.1 0.3 Recorder.Sync 0.0
queue worker 0x0 0.4 (1 %) 25.7 (95 %) 1.0 3.3 Driver.Packet 0.4
draw committer 5.1 (19 %) 0.2 (1 %) 21.7 0.1 Recorder.Submit 1.9, Graphics.Draw 1.8
presenter 0.3 (1 %) 0.0 (0 %) 26.8 0.1 VideoOut.Flip 0.3
gpu 1.9 (7 %) 0.0 (0 %) 25.2 0.0 batch 1.9

Largest slices (ms per frame, inclusive, all threads): Driver.WorkerWait 25.7, Driver.WorkerWait.idle_and_completion_poll 25.7, batch 1.9, Recorder.Submit 1.9, Graphics.Draw 1.8, Vulkan.DrawFromRecipe 1.5, Graphics.DrawWithRecipe 1.5, Graphics.DrawWithRecipe.draw_and_resource_release 1.5, Graphics.Draw.draw_and_resource_release 1.5, Driver.Packet 0.4

Longest waits

  • Driver.WorkerWait (queue worker 0x0) 3.1 ms at 3428 ms, present 1455
  • Driver.WorkerWait (queue worker 0x0) 2.7 ms at 3432 ms, present 1455
  • Driver.WorkerWait (queue worker 0x0) 2.4 ms at 6647 ms, present 1574
  • Driver.WorkerWait (queue worker 0x0) 1.8 ms at 3466 ms, present 1456
  • Driver.WorkerWait (queue worker 0x0) 1.6 ms at 6642 ms, present 1574
  • Driver.WorkerWait (queue worker 0x0) 1.5 ms at 3461 ms, present 1455
  • Driver.WorkerWait (queue worker 0x0) 1.5 ms at 3426 ms, present 1455
  • Driver.WorkerWait (queue worker 0x0) 1.5 ms at 6644 ms, present 1574
  • Driver.WorkerWait (queue worker 0x0) 1.4 ms at 6645 ms, present 1574
  • Driver.WorkerWait (queue worker 0x0) 1.4 ms at 6686 ms, present 1575

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

  • batch 96070: 0.5 ms at 8478 ms, present 1640: GPU no ranges; recorded by Vulkan.DrawFromRecipe (draw committer) 0.0, Graphics.DrawWithRecipe (draw committer) 0.0, Graphics.DrawWithRecipe.draw_and_resource_release (draw committer) 0.0, Recorder.Submit (draw committer) 0.0
  • batch 79255: 0.5 ms at 730 ms, present 1355: GPU no ranges; recorded by Vulkan.DrawFromRecipe (draw committer) 0.0, Graphics.DrawWithRecipe (draw committer) 0.0, Recorder.Submit (draw committer) 0.0, Graphics.DrawWithRecipe.draw_and_resource_release (draw committer) 0.0
  • batch 92294: 0.5 ms at 6721 ms, present 1576: GPU no ranges; recorded by Vulkan.DrawFromRecipe (draw committer) 0.0, Graphics.DrawWithRecipe (draw committer) 0.0, Graphics.DrawWithRecipe.draw_and_resource_release (draw committer) 0.0, Recorder.Submit (draw committer) 0.0
  • batch 87820: 0.5 ms at 4672 ms, present 1500: GPU no ranges; recorded by Vulkan.DrawFromRecipe (draw committer) 0.0, Graphics.DrawWithRecipe (draw committer) 0.0, Graphics.DrawWithRecipe.draw_and_resource_release (draw committer) 0.0, Recorder.Submit (draw committer) 0.0
  • batch 82333: 0.5 ms at 2122 ms, present 1407: GPU no ranges; recorded by Vulkan.DrawFromRecipe (draw committer) 0.1, Graphics.DrawWithRecipe (draw committer) 0.1, Graphics.DrawWithRecipe.draw_and_resource_release (draw committer) 0.1, Recorder.Submit (draw committer) 0.0
tools/performance_compare.py

Performance comparison

Capture Commit Trace Presents Window (ms)
baseline 716cb74e08 aps5-trace-716cb74e0871-151594.json.gz 322 10026.366
candidate 90b365b5b9f0 aps5-trace-90b365b5b9f0-151903.json.gz 370 10022.000
  • 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.
  • baseline: source tree is dirty or its state is unknown; the commit alone does not identify the build.
  • candidate: source tree is dirty or its state is unknown; the commit alone does not identify the build.

Configuration differences

Setting Baseline Candidate
window.first_present 1149 1328

Frame and GPU times (ms)

Metric Baseline Candidate Change Change (%)
frame_ms.p50 31.120 26.698 -4.422 -14.210
frame_ms.p90 31.659 29.304 -2.355 -7.439
frame_ms.p99 32.202 33.106 +0.904 +2.807
frame_ms.max 33.652 43.172 +9.520 +28.290
mean_frame_ms 31.138 27.086 -4.051 -13.011
gpu_busy_ms_per_present 1.884 1.885 +0.001 +0.053

Top phases (ms per frame)

Metric Baseline Candidate Change Change (%)
Driver.Packet 1.267 1.220 -0.047 -3.710
Driver.Packet.draw 0.863 0.830 -0.033 -3.824
Graphics.Draw 2.800 1.777 -1.023 -36.536
Graphics.Draw.draw_and_resource_release 2.099 1.471 -0.628 -29.919
Graphics.DrawWithRecipe 2.598 1.479 -1.119 -43.072
Graphics.DrawWithRecipe.draw_and_resource_release 2.591 1.472 -1.119 -43.188
Recorder.Submit 1.968 1.885 -0.083 -4.217
Vulkan.DrawFromRecipe 2.614 1.494 -1.120 -42.846

perf, measured on the previous base, 10 s from 40 s into a run, same scene, on 1e20650e84 + #8091: on main, _Rb_tree_increment 3.0%, importRunBounds 1.9%, leasedIndexContaining 1.5%, walkRun 1.1% and sameRange 0.7% of samples. With this PR, _Rb_tree_increment is 2.2%, refreshImports itself 0.8%, and importRunBounds, leasedIndexContaining, walkRun and sameRange are each 0.2% or less. clock_gettime is about 22% on both sides.

Other measurements (same machine and scene, menu, main eaff87674c + #8091):

  • The walk is the whole cost. A local build that skipped the walk (unsafe, measurement only) ran ~50 FPS with 616 live imports. APS5_PROFILE_GPU=1 shows the same recorded GPU time per present on both sides (2.4 ms in 59 batches), and APS5_NO_DRAW_INPUTS_IN_PLACE=1 changes nothing. So this is not #5895's in-place read cost.
  • perf on that base: importRun 4.3%, _Rb_tree_increment 2.3%, leasedIndexContaining 1.8% and sameRange 1.6% of user samples. With this PR, importRun, leasedIndexContaining and sameRange stay under 0.3%. refreshImports itself is 1.7%: the lease diff is linear in the ~800 registered ranges, and the remembered failures and refusals are still iterated.
  • Equivalence check. A local check mode ran the full walk's sameRange for every import the incremental refresh skipped. With the default budget it found 0 differences in ~3.4M skipped checks. None of the skipped unwatched imports were back in the write watch, and no imports overlapped. With a 128 MiB budget, the only differences were the refusal-dependent run shapes described above.

AGC, shader recompiler: ctest --test-dir build -R "agc|shader|recompiler" -V -j6 with ANYPS5_REQUIRE_VULKAN=1, ANYPS5_NO_SHADER_CACHE=1 and VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation, on main 7903201bb4 and on this change applied to it, same machine, without #8091. main has since moved to 716cb74e08 with documentation changes only. Neither log contains was not found but was requested by env var VK_INSTANCE_LAYERS.

  • main: 1045 of 1046 passed. This PR: 1046 of 1047, with the new test.
  • agc_driver_tessellation (segfault, Mesa 26.2, #5444) fails on both.
  • The same VUIDs with the same counts: VkPipelineColorBlendStateCreateInfo-pAttachments-00605 ×26.

Overlap with open pull requests, from tools/pr_overlap.py on 3c4aab5acc, which reports none:

  • #8926 merged first and this branch is rebased onto it, as agreed in its thread: its retired-import handling now sits in check and after both walks, as described above.
  • #9879 merged first and this branch is rebased onto it, as agreed in its thread: refreshImports keeps its state.gateRefusals.clear() after the generation check, before this PR's window test. Its color-target imports are made in importRunAt, which records them in pendingImports, so the incremental walk checks them.
  • agc_windowed_import_refresh gets its Windows PATH in its own if(WIN32) block after its registration, not in the shared set_tests_properties list that #6182, #6185, #6186, #9565, #9712, #9875, #9898 and #11451 also extend.
  • #6951, now on main, memoizes importRun's run bounds, which lowers the cost of each check. This PR lowers how many checks run.
  • Of the 80 other pull requests it could not compare, seven change or call refreshImports, retireImport, importRunAt or ClearHostImports:
    • #4448 rewrites the GuestMemory::Unwatch line in the import loop, which this PR moves into check, and notes every import it re-unwatches. With this PR only re-checked imports are re-unwatched. Write watching only comes back on a range through a registry change (a new mapping, or a remap, whose Protect replaces the ranges), through a settle that marks its import watched, or through #8926's rewatch of a retired import's ranges, which skips ranges a live unwatched import still covers. So a skipped import is never back in the write watch, as the check mode above also found.
    • #2434 and #7457 change how importRunAt makes an import, not the refresh; #7457 only reads refreshedGeneration.
    • #4449 changes how importRunAt creates a dma-buf import; the import is still added through the same emplace, which records it in pendingImports.
    • #6197 adds a refreshImports call with the whole acquired lease, as the other callers pass, and makes its joined import through importRunAt, so pendingImports records it.
    • #6918 calls ClearHostImports; it does not touch the line this PR adds there.
    • #9012 edits retireImport, importRunAt, refreshImports and ClearHostImports next to this PR's lines (its epoch counter), not the lines themselves.
  • main added one refreshImports caller since the last base (WatchedAfterSettle, 44141f9aaf); it passes the whole acquired lease, as the others do.

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Fixes: none
  • Unblocks: none
  • GPUs tested: AMD Radeon RX 7900 GRE (RADV NAVI31), Mesa 26.2.5, Arch Linux kernel 7.2.11
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4958160138 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9402). Originally posted by [janzezno](https://github.com/janzezno) on 2026-10-21T20:49:12Z. --- ### What `refreshImports` re-checked every live host import, and every remembered failure and refusal, each time the guest allocation registry changed. A title that maps memory often pays that walk constantly. SuperTuxKart (PPSA69421) maps about 1650 times a second at its menu. With #8091's budget fix, about 440 imports (~1.1 GiB) stay live there, and the walk alone costs ~118 ms of CPU per second on the frame's critical path. The frame rate falls as the import budget grows: ~34 FPS with the default budget, ~48 FPS with `APS5_HOST_IMPORT_MIB=128`. This PR makes the refresh incremental: - The import table keeps the `(address, bytes, weak_ptr)` of every range in the lease it was last checked against. The snapshot holds `weak_ptr`s because a lease pins its ranges: unmap waits while `use_count() != 1`. - A refresh merges that snapshot with the new lease by range identity (`owner_before`, as `sameRun` does). The result is the address spans whose ranges were added, removed or replaced, whatever mutation did it, including backing renewals. - Only imports whose import window (`[base / window * window, max(that + window, base + bytes))`) touches a changed span are checked again. These are found with a `lower_bound` on the import map plus one predecessor; imports never overlap, as `peekImport` already relies on. `importRun`, `exactRun` and `joinedRun` read only ranges inside that span. The scan carries a cursor across the changed spans, so each import is checked at most once per refresh even when several separate spans fall in one window. - Imports made since the last refresh are always checked. A thread can make an import from a lease taken before another thread's refresh, and the next diff would not show that range. They are kept as a set of distinct bases (`pendingImports`); retiring an import removes its base, so the set never holds more than the live imports. - Every import is checked, as before, when the window is 0 or the window or the effective budget changed since the last refresh. - `check` is the only place either walk retires an import, so #8926's handling of retired imports (now on `main`) sits there: `check` notes the unwatched ranges of each import it retires, and those ranges go back in the write watch once after both walks. - Remembered failures, failed joins, failed blocks and refusals are dropped by the same window test. Every use site already validates them with `sameRun`, so this is cleanup only. One behaviour differs, and it is recorded in `docs/dev/debt/libSceAgcDriver.md`. An unchanged import whose run could now be larger, because a remembered refusal no longer holds, is kept until its window changes. A request that needs the larger run still retires it (`wouldRetireImport`). On `main`, any registry change anywhere retired it. Under a 128 MiB budget in SuperTuxKart, `main` retired and re-made the same three still-valid single-range imports about 1650 times a second for this reason. New test `agc_windowed_import_refresh` (128 KiB window, three windows): - a continuing range added inside an import's window, outside the import's own bytes, retires it; - an import in another window survives; - re-mapping a range retires its import only. It passes on `main` and on this PR. It fails when the window query is narrowed to `lower_bound(begin)`: "an import whose window gained a continuing range was kept". Two local probes (not in this PR) checked the review follow-ups: - 32 single-range imports in one 8 MiB window, then 32 separate ranges added between them in one mutation: the refresh made 1024 checks before the cursor and 32 with it. - SuperTuxKart with #8091 counted the pending set at each of ~12,000 refreshes per 5 s. With a 128 MiB budget (71 live imports, 107,397 made in 50 s) and with the default budget (440 live), it never held more than 1 entry or more than the live imports. ### Tested Arch Linux (kernel 7.2.11), Ryzen 5 7500F, AMD Radeon RX 7900 GRE, RADV Mesa 26.2.5, on `main` `716cb74e08`. SuperTuxKart (PPSA69421 00.001.000, catalog sha256 `f2240bf0…b712a`), relinked with `--trap-sdk-syscall-stubs`. Main menu with no input, headless `gamescope --backend headless -W 1920 -H 1080`, `APS5_TRACE_SUMMARY_EVERY=10`, 70 s runs. Each side's first run creates the game's configuration and starts in a different first-launch scene, so it only warms the shader caches and is not counted. Then four rounds of one run per side, main first. The FPS is the presents in the last 8 s of each run (VideoOut telemetry). **Why #8091 is applied on both sides.** On RADV, plain `main` lowers the import budget after memfd-backed imports are refused (#8091). The menu then randomly settles in a GPU-bound ~3 FPS mode, with GPU ~90% busy and a CPU nearly idle, or a fast mode with ~74 MiB of imports. Both sides do this: on plain `main` eaff87674c, main ran 2.9 / 2.7 / 3.3 FPS and this PR 1.0 / 3.2 / 53.7 FPS. That noise hides the walk. Both builds below therefore carry #8091's one-line production change in `importRunAt`. This PR does not depend on #8091. | Side | FPS, last 8 s, rounds 2-4 | Round 1 | GPU busy per present | |---|---|---|---| | main + #8091 | 32.5 / 32.3 / 32.1 | 30.5 | 1.9 ms | | this PR + #8091 | 36.8 / 36.8 / 36.5 | 32.3 | 1.9 ms | Round 1 started right after this PR's build finished (load average 12.7) and is slower on both sides, so it is listed apart; the fourth round was added for that reason. On the previous base `1e20650e84` the same protocol gave 32.3 / 32.3 / 32.2 on `main` and 39.7 / 38.5 / 38.5 with this PR, and on `b7d1d47a5f` 37.2 / 35.9 / 36.8 and 51.8 / 54.0 / 53.2. `main` was built from `716cb74e08` and this PR from its pushed head `90b365b5b9`, each with #8091's one-line change uncommitted, so both sides' summary lines show as dirty. `tools/trace_digest.py` of the first clean run (round 2) of each side (summary files of all runs attached): <details> <summary>main + #8091</summary> **6 intervals**, 0.0 to 60.1 s, 1790 presents AMD Radeon RX 7900 GRE (RADV NAVI31), radv Mesa 26.2.5-arch1.1, Linux 7.2.11-arch1-1, 1920x1080, commit 716cb74e0871 (dirty) | # | seconds | presents | p50 | p90 | p99 | max | GPU busy | busiest worker | largest phase | |---|---|---|---|---|---|---|---|---|---| | 1 | 0-10 | 195 | 31.1 | 97.1 | 350.2 | 1386.4 | 1.9 | 3 % | Graphics.Draw 3.4 | | 2 | 10-20 | 323 | 30.8 | 31.9 | 34.4 | 52.1 | 1.9 | 5 % | Graphics.Draw 2.8 | | 3 | 20-30 | 318 | 31.3 | 33.1 | 34.9 | 35.6 | 1.9 | 5 % | Graphics.Draw 2.9 | | 4 | 30-40 | 309 | 32.1 | 34.1 | 39.3 | 44.3 | 1.9 | 5 % | Graphics.Draw 3.0 | | 5 | 40-50 | 322 | 31.0 | 31.6 | 33.0 | 33.7 | 1.9 | 4 % | Graphics.Draw 2.7 | | 6 | 50-60 | 323 | 30.9 | 31.4 | 35.0 | 45.9 | 1.9 | 4 % | Graphics.Draw 2.7 | ``` p99 ms @_____ 0-350.2 gpu ms @@@@@@ 0-1.9 ``` </details> <details> <summary>this PR + #8091</summary> **6 intervals**, 0.0 to 60.1 s, 2051 presents AMD Radeon RX 7900 GRE (RADV NAVI31), radv Mesa 26.2.5-arch1.1, Linux 7.2.11-arch1-1, 1920x1080, commit 90b365b5b9f0 (dirty) | # | seconds | presents | p50 | p90 | p99 | max | GPU busy | busiest worker | largest phase | |---|---|---|---|---|---|---|---|---|---| | 1 | 0-10 | 225 | 27.6 | 70.9 | 242.5 | 1380.7 | 1.9 | 3 % | Graphics.Draw 2.3 | | 2 | 10-20 | 369 | 26.7 | 29.6 | 35.1 | 37.9 | 1.9 | 5 % | Recorder.Submit 1.9 | | 3 | 20-30 | 367 | 27.0 | 29.9 | 32.7 | 37.1 | 1.9 | 5 % | Recorder.Submit 1.9 | | 4 | 30-40 | 358 | 27.7 | 30.9 | 32.2 | 41.5 | 1.9 | 5 % | Recorder.Submit 2.0 | | 5 | 40-50 | 367 | 27.0 | 29.7 | 30.6 | 31.2 | 1.9 | 5 % | Recorder.Submit 1.9 | | 6 | 50-60 | 365 | 27.1 | 29.9 | 32.5 | 38.9 | 1.9 | 5 % | Recorder.Submit 1.9 | ``` p99 ms @_____ 0-242.5 gpu ms @@@@@@ 0-1.9 ``` </details> **Trace windows for the perf check.** `APS5_TRACE_SECONDS=40:10`, same scene, machine and builds as the runs above. Two windows per side: main 322 / 326 presents, p50 31.1 / 30.7 ms, p99 32.2 / 31.6 ms; this PR 370 / 364 presents, p50 26.7 / 27.3 ms, p99 33.1 / 30.9 ms. The first PR window has one 43 ms frame, which puts its p99 and max above `main`'s; the second does not. The first window of each side, with its trace attached (`aps5-trace-716cb74e0871-151594` is `main`, `aps5-trace-90b365b5b9f0-151903` is this PR): main + #8091: ```json {"commit":"716cb74e0871","dirty":true,"env":{"APS5_NO_PAD_INPUT":"1","APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"40:10","APS5_TRACE_SUMMARY_EVERY":"10","APS5_VIDEOOUT_TELEMETRY_DIR":"<path>"},"gpu":"AMD Radeon RX 7900 GRE (RADV NAVI31)","driver":"radv Mesa 26.2.5-arch1.1","os":"Linux 7.2.11-arch1-1","cpu":"AMD Ryzen 5 7500F 6-Core Processor","cpu_threads":12,"memory_mib":31744,"title_id":"PPSA69421","title":"SuperTuxKart","content_version":"00.001.000","resolution":"1920x1080","window":{"spec":"seconds 40:10","first_present":1149,"ms":10026.366},"presents":322,"frame_ms":{"p50":31.120,"p90":31.659,"p99":32.202,"max":33.652},"gpu_busy_ms_per_present":1.884,"worker_busy_pct":{"queue worker 0x0":4.131},"top_phases_ms_per_frame":{"Graphics.Draw":2.800,"Vulkan.DrawFromRecipe":2.614,"Graphics.DrawWithRecipe":2.598,"Graphics.DrawWithRecipe.draw_and_resource_release":2.591,"Graphics.Draw.draw_and_resource_release":2.099,"Recorder.Submit":1.968,"Driver.Packet":1.267,"Driver.Packet.draw":0.863},"trace_dropped":false,"trace":"aps5-trace-716cb74e0871-151594.json.gz"} ``` this PR + #8091: ```json {"commit":"90b365b5b9f0","dirty":true,"env":{"APS5_NO_PAD_INPUT":"1","APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"40:10","APS5_TRACE_SUMMARY_EVERY":"10","APS5_VIDEOOUT_TELEMETRY_DIR":"<path>"},"gpu":"AMD Radeon RX 7900 GRE (RADV NAVI31)","driver":"radv Mesa 26.2.5-arch1.1","os":"Linux 7.2.11-arch1-1","cpu":"AMD Ryzen 5 7500F 6-Core Processor","cpu_threads":12,"memory_mib":31744,"title_id":"PPSA69421","title":"SuperTuxKart","content_version":"00.001.000","resolution":"1920x1080","window":{"spec":"seconds 40:10","first_present":1328,"ms":10022.000},"presents":370,"frame_ms":{"p50":26.698,"p90":29.304,"p99":33.106,"max":43.172},"gpu_busy_ms_per_present":1.885,"worker_busy_pct":{"queue worker 0x0":4.573},"top_phases_ms_per_frame":{"Recorder.Submit":1.885,"Graphics.Draw":1.777,"Vulkan.DrawFromRecipe":1.494,"Graphics.DrawWithRecipe":1.479,"Graphics.DrawWithRecipe.draw_and_resource_release":1.472,"Graphics.Draw.draw_and_resource_release":1.471,"Driver.Packet":1.220,"Driver.Packet.draw":0.830},"trace_dropped":false,"trace":"aps5-trace-90b365b5b9f0-151903.json.gz"} ``` <details> <summary><code>tools/trace_digest.py</code>, main + #8091</summary> **seconds 40:10** from present 1149: 322 presents, frame p50 31.1 / p90 31.7 / p99 32.2 / max 33.7 ms, GPU busy 1.9 ms per present AMD Radeon RX 7900 GRE (RADV NAVI31), radv Mesa 26.2.5-arch1.1, Linux 7.2.11-arch1-1, 1920x1080, commit 716cb74e0871 (dirty), dropped: no ```json {"commit":"716cb74e0871","dirty":true,"env":{"APS5_NO_PAD_INPUT":"1","APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"40:10","APS5_TRACE_SUMMARY_EVERY":"10","APS5_VIDEOOUT_TELEMETRY_DIR":"<path>"},"gpu":"AMD Radeon RX 7900 GRE (RADV NAVI31)","driver":"radv Mesa 26.2.5-arch1.1","os":"Linux 7.2.11-arch1-1","cpu":"AMD Ryzen 5 7500F 6-Core Processor","cpu_threads":12,"memory_mib":31744,"title_id":"PPSA69421","title":"SuperTuxKart","content_version":"00.001.000","resolution":"1920x1080","window":{"spec":"seconds 40:10","first_present":1149,"ms":10026.366},"presents":322,"frame_ms":{"p50":31.12,"p90":31.659,"p99":32.202,"max":33.652},"gpu_busy_ms_per_present":1.884,"worker_busy_pct":{"queue worker 0x0":4.131},"top_phases_ms_per_frame":{"Graphics.Draw":2.8,"Vulkan.DrawFromRecipe":2.614,"Graphics.DrawWithRecipe":2.598,"Graphics.DrawWithRecipe.draw_and_resource_release":2.591,"Graphics.Draw.draw_and_resource_release":2.099,"Recorder.Submit":1.968,"Driver.Packet":1.267,"Driver.Packet.draw":0.863},"trace_dropped":false,"trace":"aps5-trace-716cb74e0871-151594.json.gz"} ``` **Slowest frames** (largest slices inside each, inclusive) - present 1378: 33.7 ms at 7116 ms: Driver.WorkerWait (queue worker 0x0) 32.2, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x0) 32.1, Graphics.Draw (draw committer) 3.4, Vulkan.DrawFromRecipe (draw committer) 3.0 - present 1352: 32.7 ms at 6305 ms: Driver.WorkerWait (queue worker 0x0) 31.0, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x0) 30.9, Graphics.Draw (draw committer) 3.1, Vulkan.DrawFromRecipe (draw committer) 2.8 - present 1379: 32.2 ms at 7150 ms: Driver.WorkerWait (queue worker 0x0) 31.0, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x0) 30.9, Graphics.Draw (draw committer) 3.3, Vulkan.DrawFromRecipe (draw committer) 2.9 - present 1467: 32.2 ms at 9901 ms: Driver.WorkerWait (queue worker 0x0) 30.7, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x0) 30.7, Graphics.Draw (draw committer) 3.1, Vulkan.DrawFromRecipe (draw committer) 2.9 - present 1340: 32.2 ms at 5930 ms: Driver.WorkerWait (queue worker 0x0) 30.6, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x0) 30.6, Vulkan.DrawFromRecipe (draw committer) 3.0, Graphics.DrawWithRecipe (draw committer) 2.9 **Threads** (ms per frame) | thread | busy | wait | untraced | in slices < 20 us | largest | |---|---|---|---|---|---| | title | 0.0 (0 %) | 0.0 (0 %) | 31.1 | 0.3 | Recorder.Sync 0.0 | | queue worker 0x0 | 0.4 (1 %) | 29.7 (95 %) | 1.0 | 3.4 | Driver.Packet 0.4 | | draw committer | 7.4 (24 %) | 0.2 (1 %) | 23.5 | 0.1 | Graphics.Draw 2.8, Vulkan.DrawFromRecipe 2.6 | | presenter | 0.3 (1 %) | 0.0 (0 %) | 30.8 | 0.1 | VideoOut.Flip 0.3 | | gpu | 1.9 (6 %) | 0.0 (0 %) | 29.3 | 0.0 | batch 1.9 | **Largest slices** (ms per frame, inclusive, all threads): Driver.WorkerWait 29.7, Driver.WorkerWait.idle_and_completion_poll 29.7, Graphics.Draw 2.8, Vulkan.DrawFromRecipe 2.6, Graphics.DrawWithRecipe 2.6, Graphics.DrawWithRecipe.draw_and_resource_release 2.6, Graphics.Draw.draw_and_resource_release 2.1, Recorder.Submit 2.0, batch 1.9, Graphics.Draw.validate 0.7 **Longest waits** - Driver.WorkerWait (queue worker 0x0) 1.6 ms at 7137 ms, present 1378 - Driver.WorkerWait (queue worker 0x0) 1.2 ms at 8204 ms, present 1412 - Driver.WorkerWait (queue worker 0x0) 1.1 ms at 3716 ms, present 1268 - Driver.WorkerWait (queue worker 0x0) 1.1 ms at 1445 ms, present 1195 - Driver.WorkerWait (queue worker 0x0) 1.1 ms at 9611 ms, present 1457 - Driver.WorkerWait (queue worker 0x0) 1.1 ms at 6014 ms, present 1342 - Driver.WorkerWait (queue worker 0x0) 1.1 ms at 7205 ms, present 1380 - Driver.WorkerWait (queue worker 0x0) 1.1 ms at 8141 ms, present 1410 - Driver.WorkerWait (queue worker 0x0) 1.1 ms at 8829 ms, present 1432 - Driver.WorkerWait (queue worker 0x0) 1.1 ms at 8766 ms, present 1430 **Largest GPU batches** (GPU ranges inside, and the CPU slices that recorded each, inclusive) - batch 75908: 0.5 ms at 4646 ms, present 1298: GPU no ranges; recorded by Vulkan.DrawFromRecipe (draw committer) 0.1, Graphics.DrawWithRecipe (draw committer) 0.1, Graphics.DrawWithRecipe.draw_and_resource_release (draw committer) 0.1, Recorder.Submit (draw committer) 0.0 - batch 76793: 0.5 ms at 5110 ms, present 1313: GPU no ranges; recorded by Vulkan.DrawFromRecipe (draw committer) 0.1, Graphics.DrawWithRecipe (draw committer) 0.1, Graphics.DrawWithRecipe.draw_and_resource_release (draw committer) 0.1, Recorder.Submit (draw committer) 0.0 - batch 70834: 0.5 ms at 1971 ms, present 1212: GPU no ranges; recorded by Vulkan.DrawFromRecipe (draw committer) 0.1, Graphics.DrawWithRecipe (draw committer) 0.1, Graphics.DrawWithRecipe.draw_and_resource_release (draw committer) 0.1, Recorder.Submit (draw committer) 0.0 - batch 79969: 0.5 ms at 6790 ms, present 1367: GPU no ranges; recorded by Recorder.Submit (draw committer) 0.0, Vulkan.DrawFromRecipe (draw committer) 0.0, Graphics.DrawWithRecipe (draw committer) 0.0, Graphics.DrawWithRecipe.draw_and_resource_release (draw committer) 0.0 - batch 84405: 0.5 ms at 9143 ms, present 1442: GPU no ranges; recorded by Vulkan.DrawFromRecipe (draw committer) 0.1, Graphics.DrawWithRecipe (draw committer) 0.1, Graphics.DrawWithRecipe.draw_and_resource_release (draw committer) 0.1, Recorder.Submit (draw committer) 0.0 </details> <details> <summary><code>tools/trace_digest.py</code>, this PR + #8091</summary> **seconds 40:10** from present 1328: 370 presents, frame p50 26.7 / p90 29.3 / p99 33.1 / max 43.2 ms, GPU busy 1.9 ms per present AMD Radeon RX 7900 GRE (RADV NAVI31), radv Mesa 26.2.5-arch1.1, Linux 7.2.11-arch1-1, 1920x1080, commit 90b365b5b9f0 (dirty), dropped: no ```json {"commit":"90b365b5b9f0","dirty":true,"env":{"APS5_NO_PAD_INPUT":"1","APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"40:10","APS5_TRACE_SUMMARY_EVERY":"10","APS5_VIDEOOUT_TELEMETRY_DIR":"<path>"},"gpu":"AMD Radeon RX 7900 GRE (RADV NAVI31)","driver":"radv Mesa 26.2.5-arch1.1","os":"Linux 7.2.11-arch1-1","cpu":"AMD Ryzen 5 7500F 6-Core Processor","cpu_threads":12,"memory_mib":31744,"title_id":"PPSA69421","title":"SuperTuxKart","content_version":"00.001.000","resolution":"1920x1080","window":{"spec":"seconds 40:10","first_present":1328,"ms":10022.0},"presents":370,"frame_ms":{"p50":26.698,"p90":29.304,"p99":33.106,"max":43.172},"gpu_busy_ms_per_present":1.885,"worker_busy_pct":{"queue worker 0x0":4.573},"top_phases_ms_per_frame":{"Recorder.Submit":1.885,"Graphics.Draw":1.777,"Vulkan.DrawFromRecipe":1.494,"Graphics.DrawWithRecipe":1.479,"Graphics.DrawWithRecipe.draw_and_resource_release":1.472,"Graphics.Draw.draw_and_resource_release":1.471,"Driver.Packet":1.22,"Driver.Packet.draw":0.83},"trace_dropped":false,"trace":"aps5-trace-90b365b5b9f0-151903.json.gz"} ``` **Slowest frames** (largest slices inside each, inclusive) - present 1455: 43.2 ms at 3422 ms: Driver.WorkerWait (queue worker 0x0) 40.8, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x0) 40.8, Graphics.Draw (draw committer) 2.5, Recorder.Submit (draw committer) 2.4 - present 1574: 40.5 ms at 6630 ms: Driver.WorkerWait (queue worker 0x0) 38.3, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x0) 38.2, Recorder.Submit (draw committer) 2.4, Graphics.Draw (draw committer) 2.4 - present 1575: 37.3 ms at 6671 ms: Driver.WorkerWait (queue worker 0x0) 35.0, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x0) 34.9, Recorder.Submit (draw committer) 2.6, Graphics.Draw (draw committer) 2.3 - present 1456: 33.1 ms at 3465 ms: Driver.WorkerWait (queue worker 0x0) 31.3, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x0) 31.2, Graphics.Draw (draw committer) 2.4, Recorder.Submit (draw committer) 2.1 - present 1573: 31.2 ms at 6599 ms: Driver.WorkerWait (queue worker 0x0) 29.2, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x0) 29.1, Recorder.Submit (draw committer) 2.0, batch (gpu) 1.9 **Threads** (ms per frame) | thread | busy | wait | untraced | in slices < 20 us | largest | |---|---|---|---|---|---| | title | 0.0 (0 %) | 0.0 (0 %) | 27.1 | 0.3 | Recorder.Sync 0.0 | | queue worker 0x0 | 0.4 (1 %) | 25.7 (95 %) | 1.0 | 3.3 | Driver.Packet 0.4 | | draw committer | 5.1 (19 %) | 0.2 (1 %) | 21.7 | 0.1 | Recorder.Submit 1.9, Graphics.Draw 1.8 | | presenter | 0.3 (1 %) | 0.0 (0 %) | 26.8 | 0.1 | VideoOut.Flip 0.3 | | gpu | 1.9 (7 %) | 0.0 (0 %) | 25.2 | 0.0 | batch 1.9 | **Largest slices** (ms per frame, inclusive, all threads): Driver.WorkerWait 25.7, Driver.WorkerWait.idle_and_completion_poll 25.7, batch 1.9, Recorder.Submit 1.9, Graphics.Draw 1.8, Vulkan.DrawFromRecipe 1.5, Graphics.DrawWithRecipe 1.5, Graphics.DrawWithRecipe.draw_and_resource_release 1.5, Graphics.Draw.draw_and_resource_release 1.5, Driver.Packet 0.4 **Longest waits** - Driver.WorkerWait (queue worker 0x0) 3.1 ms at 3428 ms, present 1455 - Driver.WorkerWait (queue worker 0x0) 2.7 ms at 3432 ms, present 1455 - Driver.WorkerWait (queue worker 0x0) 2.4 ms at 6647 ms, present 1574 - Driver.WorkerWait (queue worker 0x0) 1.8 ms at 3466 ms, present 1456 - Driver.WorkerWait (queue worker 0x0) 1.6 ms at 6642 ms, present 1574 - Driver.WorkerWait (queue worker 0x0) 1.5 ms at 3461 ms, present 1455 - Driver.WorkerWait (queue worker 0x0) 1.5 ms at 3426 ms, present 1455 - Driver.WorkerWait (queue worker 0x0) 1.5 ms at 6644 ms, present 1574 - Driver.WorkerWait (queue worker 0x0) 1.4 ms at 6645 ms, present 1574 - Driver.WorkerWait (queue worker 0x0) 1.4 ms at 6686 ms, present 1575 **Largest GPU batches** (GPU ranges inside, and the CPU slices that recorded each, inclusive) - batch 96070: 0.5 ms at 8478 ms, present 1640: GPU no ranges; recorded by Vulkan.DrawFromRecipe (draw committer) 0.0, Graphics.DrawWithRecipe (draw committer) 0.0, Graphics.DrawWithRecipe.draw_and_resource_release (draw committer) 0.0, Recorder.Submit (draw committer) 0.0 - batch 79255: 0.5 ms at 730 ms, present 1355: GPU no ranges; recorded by Vulkan.DrawFromRecipe (draw committer) 0.0, Graphics.DrawWithRecipe (draw committer) 0.0, Recorder.Submit (draw committer) 0.0, Graphics.DrawWithRecipe.draw_and_resource_release (draw committer) 0.0 - batch 92294: 0.5 ms at 6721 ms, present 1576: GPU no ranges; recorded by Vulkan.DrawFromRecipe (draw committer) 0.0, Graphics.DrawWithRecipe (draw committer) 0.0, Graphics.DrawWithRecipe.draw_and_resource_release (draw committer) 0.0, Recorder.Submit (draw committer) 0.0 - batch 87820: 0.5 ms at 4672 ms, present 1500: GPU no ranges; recorded by Vulkan.DrawFromRecipe (draw committer) 0.0, Graphics.DrawWithRecipe (draw committer) 0.0, Graphics.DrawWithRecipe.draw_and_resource_release (draw committer) 0.0, Recorder.Submit (draw committer) 0.0 - batch 82333: 0.5 ms at 2122 ms, present 1407: GPU no ranges; recorded by Vulkan.DrawFromRecipe (draw committer) 0.1, Graphics.DrawWithRecipe (draw committer) 0.1, Graphics.DrawWithRecipe.draw_and_resource_release (draw committer) 0.1, Recorder.Submit (draw committer) 0.0 </details> <details> <summary><code>tools/performance_compare.py</code></summary> # Performance comparison | Capture | Commit | Trace | Presents | Window (ms) | | --- | --- | --- | ---: | ---: | | baseline | 716cb74e0871 | aps5-trace-716cb74e0871-151594.json.gz | 322 | 10026.366 | | candidate | 90b365b5b9f0 | aps5-trace-90b365b5b9f0-151903.json.gz | 370 | 10022.000 | - 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. - baseline: source tree is dirty or its state is unknown; the commit alone does not identify the build. - candidate: source tree is dirty or its state is unknown; the commit alone does not identify the build. ## Configuration differences | Setting | Baseline | Candidate | | --- | --- | --- | | window.first_present | 1149 | 1328 | ## Frame and GPU times (ms) | Metric | Baseline | Candidate | Change | Change (%) | | --- | ---: | ---: | ---: | ---: | | frame_ms.p50 | 31.120 | 26.698 | -4.422 | -14.210 | | frame_ms.p90 | 31.659 | 29.304 | -2.355 | -7.439 | | frame_ms.p99 | 32.202 | 33.106 | +0.904 | +2.807 | | frame_ms.max | 33.652 | 43.172 | +9.520 | +28.290 | | mean_frame_ms | 31.138 | 27.086 | -4.051 | -13.011 | | gpu_busy_ms_per_present | 1.884 | 1.885 | +0.001 | +0.053 | ## Top phases (ms per frame) | Metric | Baseline | Candidate | Change | Change (%) | | --- | ---: | ---: | ---: | ---: | | Driver.Packet | 1.267 | 1.220 | -0.047 | -3.710 | | Driver.Packet.draw | 0.863 | 0.830 | -0.033 | -3.824 | | Graphics.Draw | 2.800 | 1.777 | -1.023 | -36.536 | | Graphics.Draw.draw_and_resource_release | 2.099 | 1.471 | -0.628 | -29.919 | | Graphics.DrawWithRecipe | 2.598 | 1.479 | -1.119 | -43.072 | | Graphics.DrawWithRecipe.draw_and_resource_release | 2.591 | 1.472 | -1.119 | -43.188 | | Recorder.Submit | 1.968 | 1.885 | -0.083 | -4.217 | | Vulkan.DrawFromRecipe | 2.614 | 1.494 | -1.120 | -42.846 | </details> **perf**, measured on the previous base, 10 s from 40 s into a run, same scene, on `1e20650e84` + #8091: on `main`, `_Rb_tree_increment` 3.0%, `importRunBounds` 1.9%, `leasedIndexContaining` 1.5%, `walkRun` 1.1% and `sameRange` 0.7% of samples. With this PR, `_Rb_tree_increment` is 2.2%, `refreshImports` itself 0.8%, and `importRunBounds`, `leasedIndexContaining`, `walkRun` and `sameRange` are each 0.2% or less. `clock_gettime` is about 22% on both sides. Other measurements (same machine and scene, menu, `main` eaff87674c + #8091): - **The walk is the whole cost.** A local build that skipped the walk (unsafe, measurement only) ran ~50 FPS with 616 live imports. `APS5_PROFILE_GPU=1` shows the same recorded GPU time per present on both sides (2.4 ms in 59 batches), and `APS5_NO_DRAW_INPUTS_IN_PLACE=1` changes nothing. So this is not #5895's in-place read cost. - **perf on that base:** `importRun` 4.3%, `_Rb_tree_increment` 2.3%, `leasedIndexContaining` 1.8% and `sameRange` 1.6% of user samples. With this PR, `importRun`, `leasedIndexContaining` and `sameRange` stay under 0.3%. `refreshImports` itself is 1.7%: the lease diff is linear in the ~800 registered ranges, and the remembered failures and refusals are still iterated. - **Equivalence check.** A local check mode ran the full walk's `sameRange` for every import the incremental refresh skipped. With the default budget it found 0 differences in ~3.4M skipped checks. None of the skipped `unwatched` imports were back in the write watch, and no imports overlapped. With a 128 MiB budget, the only differences were the refusal-dependent run shapes described above. AGC, shader recompiler: `ctest --test-dir build -R "agc|shader|recompiler" -V -j6` with `ANYPS5_REQUIRE_VULKAN=1`, `ANYPS5_NO_SHADER_CACHE=1` and `VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation`, on `main` `7903201bb4` and on this change applied to it, same machine, without #8091. `main` has since moved to `716cb74e08` with documentation changes only. Neither log contains `was not found but was requested by env var VK_INSTANCE_LAYERS`. - `main`: 1045 of 1046 passed. This PR: 1046 of 1047, with the new test. - `agc_driver_tessellation` (segfault, Mesa 26.2, #5444) fails on both. - The same VUIDs with the same counts: `VkPipelineColorBlendStateCreateInfo-pAttachments-00605` ×26. Overlap with open pull requests, from `tools/pr_overlap.py` on `3c4aab5acc`, which reports none: - #8926 merged first and this branch is rebased onto it, as [agreed in its thread](https://github.com/boykopovar/AnyPS5/pull/8926#issuecomment-6348426507): its retired-import handling now sits in `check` and after both walks, as described above. - #9879 merged first and this branch is rebased onto it, as [agreed in its thread](https://github.com/boykopovar/AnyPS5/pull/9879#issuecomment-6365494222): `refreshImports` keeps its `state.gateRefusals.clear()` after the generation check, before this PR's window test. Its color-target imports are made in `importRunAt`, which records them in `pendingImports`, so the incremental walk checks them. - `agc_windowed_import_refresh` gets its Windows `PATH` in its own `if(WIN32)` block after its registration, not in the shared `set_tests_properties` list that #6182, #6185, #6186, #9565, #9712, #9875, #9898 and #11451 also extend. - #6951, now on `main`, memoizes `importRun`'s run bounds, which lowers the cost of each check. This PR lowers how many checks run. - Of the 80 other pull requests it could not compare, seven change or call `refreshImports`, `retireImport`, `importRunAt` or `ClearHostImports`: - #4448 rewrites the `GuestMemory::Unwatch` line in the import loop, which this PR moves into `check`, and notes every import it re-unwatches. With this PR only re-checked imports are re-unwatched. Write watching only comes back on a range through a registry change (a new mapping, or a remap, whose `Protect` replaces the ranges), through a settle that marks its import watched, or through #8926's rewatch of a retired import's ranges, which skips ranges a live unwatched import still covers. So a skipped import is never back in the write watch, as the check mode above also found. - #2434 and #7457 change how `importRunAt` makes an import, not the refresh; #7457 only reads `refreshedGeneration`. - #4449 changes how `importRunAt` creates a dma-buf import; the import is still added through the same `emplace`, which records it in `pendingImports`. - #6197 adds a `refreshImports` call with the whole acquired lease, as the other callers pass, and makes its joined import through `importRunAt`, so `pendingImports` records it. - #6918 calls `ClearHostImports`; it does not touch the line this PR adds there. - #9012 edits `retireImport`, `importRunAt`, `refreshImports` and `ClearHostImports` next to this PR's lines (its epoch counter), not the lines themselves. - `main` added one `refreshImports` caller since the last base (`WatchedAfterSettle`, 44141f9aaf); it passes the whole acquired lease, as the others do. ### Checklist <!-- Rules behind each item: https://github.com/boykopovar/AnyPS5/blob/main/CONTRIBUTING.md --> - [x] Based on current `main`; no other open PR implements the same functions - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except [technical debt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed under Silent stubs in their library's [technical debt](https://github.com/boykopovar/AnyPS5/tree/main/docs/dev/debt) file - [x] No notes, investigation `.md` files or images added to the repository (attach them to this PR) - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: none - [x] Fixes: none - [x] Unblocks: none - [x] GPUs tested: AMD Radeon RX 7900 GRE (RADV NAVI31), Mesa 26.2.5, Arch Linux kernel 7.2.11 - [x] AI-assisted: yes
github-actions[bot] commented 2026-10-21 20:49:29 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-21T20:49:29Z.


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

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

Imported from boykopovar/AnyPS5. Originally posted by janzezno on 2026-10-21T20:51:54Z.


Summary files (APS5_TRACE_SUMMARY_EVERY=10) of the six SuperTuxKart runs in the table above, on main 0c6a5bd593:

GitHub does not accept .jsonl, so each file is a JSON array of its interval lines. To digest one with tools/trace_digest.py, convert it back first:

python3 -c "import json,sys; [print(json.dumps(r)) for r in json.load(open(sys.argv[1]))]" aps5-summary-main+8091-run1.json > run1.jsonl
python3 tools/trace_digest.py run1.jsonl
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6326286730 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9402#issuecomment-6326286730). Originally posted by [janzezno](https://github.com/janzezno) on 2026-10-21T20:51:54Z. --- Summary files (`APS5_TRACE_SUMMARY_EVERY=10`) of the six SuperTuxKart runs in the table above, on `main` 0c6a5bd593: - main + #8091: [run 1](https://github.com/user-attachments/files/33788928/aps5-summary-main%2B8091-run1.json), [run 2](https://github.com/user-attachments/files/33788929/aps5-summary-main%2B8091-run2.json), [run 3](https://github.com/user-attachments/files/33788930/aps5-summary-main%2B8091-run3.json) - this PR + #8091: [run 1](https://github.com/user-attachments/files/33788924/aps5-summary-change%2B8091-run1.json), [run 2](https://github.com/user-attachments/files/33788925/aps5-summary-change%2B8091-run2.json), [run 3](https://github.com/user-attachments/files/33788926/aps5-summary-change%2B8091-run3.json) GitHub does not accept `.jsonl`, so each file is a JSON array of its interval lines. To digest one with `tools/trace_digest.py`, convert it back first: python3 -c "import json,sys; [print(json.dumps(r)) for r in json.load(open(sys.argv[1]))]" aps5-summary-main+8091-run1.json > run1.jsonl python3 tools/trace_digest.py run1.jsonl
janzezno commented 2026-10-21 21:03:54 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by janzezno on 2026-10-21T21:03:54Z.


Traces of the two windows whose summary lines are in the description: main + #8091 (0c6a5bd593) and this PR + #8091 (ceefc5bcde), APS5_TRACE_SECONDS=40:10.
aps5-trace-0c6a5bd5938f-742372.json.gz
aps5-trace-ceefc5bcdeac-742647.json.gz

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6326509329 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9402#issuecomment-6326509329). Originally posted by [janzezno](https://github.com/janzezno) on 2026-10-21T21:03:54Z. --- Traces of the two windows whose summary lines are in the description: main + #8091 (0c6a5bd593) and this PR + #8091 (ceefc5bcde), `APS5_TRACE_SECONDS=40:10`. [aps5-trace-0c6a5bd5938f-742372.json.gz](https://github.com/user-attachments/files/33789373/aps5-trace-0c6a5bd5938f-742372.json.gz) [aps5-trace-ceefc5bcdeac-742647.json.gz](https://github.com/user-attachments/files/33789399/aps5-trace-ceefc5bcdeac-742647.json.gz)
MarcZX10 commented 2026-10-22 05:37:32 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-22T05:37:32Z.

Review: DISMISSED


This is a substantial performance investigation. The report includes same-machine SuperTuxKart comparisons, traces, an equivalence check across millions of skipped validations, a large focused test set, and paired Vulkan validation results with matching VUIDs. git diff --check passes; GitHub reports the head mergeable, and eligibility, conventions, intake, labels, and report checks pass.

I’m requesting changes for the remaining contribution-rule items:

  • The benchmark and test descriptions use bases 0c6a5bd593 and eaff87674c; current main is 4a17c71757. Please rebase onto current main, rerun the focused AGC tests on the same machine and GPU with the required validation-layer settings on both current main and the change, compare VUIDs, and refresh the performance summaries/traces against that base.
  • Please coordinate the shared refresh-loop behavior with #8926 before merge. Your overlap analysis notes that #8926 re-inserts imports in this loop and that the incremental path must add those imports to pendingImports if both changes land. Agree on order with its author and reflect any prerequisite in Depends on:. Also refresh the overlap check and coordinate any actual same-line overlaps found in the import insertion, test registration, and debt entry with their authors; the current body records adjacent conflicts with #7261, #6820/#8104, and #7844, while the current overlap scan did not complete in my shared checkout due concurrent temporary-ref updates.

No local AGC test or GPU run was possible in this review environment. The reported older-base results are useful evidence, but the repository requires current-main validation for this change before it is ready.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5609706769 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9402#pullrequestreview-5609706769). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-22T05:37:32Z. **Review:** DISMISSED --- This is a substantial performance investigation. The report includes same-machine SuperTuxKart comparisons, traces, an equivalence check across millions of skipped validations, a large focused test set, and paired Vulkan validation results with matching VUIDs. `git diff --check` passes; GitHub reports the head mergeable, and eligibility, conventions, intake, labels, and report checks pass. I’m requesting changes for the remaining contribution-rule items: - The benchmark and test descriptions use bases `0c6a5bd593` and `eaff87674c`; current `main` is `4a17c71757`. Please rebase onto current `main`, rerun the focused AGC tests on the same machine and GPU with the required validation-layer settings on both current main and the change, compare VUIDs, and refresh the performance summaries/traces against that base. - Please coordinate the shared refresh-loop behavior with #8926 before merge. Your overlap analysis notes that #8926 re-inserts imports in this loop and that the incremental path must add those imports to `pendingImports` if both changes land. Agree on order with its author and reflect any prerequisite in `Depends on:`. Also refresh the overlap check and coordinate any actual same-line overlaps found in the import insertion, test registration, and debt entry with their authors; the current body records adjacent conflicts with #7261, #6820/#8104, and #7844, while the current overlap scan did not complete in my shared checkout due concurrent temporary-ref updates. No local AGC test or GPU run was possible in this review environment. The reported older-base results are useful evidence, but the repository requires current-main validation for this change before it is ready.
adriadam10 commented 2026-10-24 00:38:27 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-24T00:38:27Z.

Review: CHANGES_REQUESTED


Checked the incremental refresh against the current main (5e6ae6e3d): changedSpans, the window test, the predecessor and cursor across spans, pendingImports, and the keys of the remembered failures and refusals. No defect found in the code. Before merge:

  • The branch merges cleanly on current main, but the validation runs were on b7d1d47a5f. GuestBufferMemory.cpp changed on main since then (completeSpaceWrites, MarkDirectWrites, WriteBack). Please rerun ctest --test-dir build -R "agc|shader|recompiler" -V with ANYPS5_REQUIRE_VULKAN=1, ANYPS5_NO_SHADER_CACHE=1 and VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation on current main and on this change, same machine and GPU, and compare the VUIDs.
  • Refresh the SuperTuxKart summaries and traces against that base, as requested in the review.
  • Put the agreed order with #8926 in the description once its author confirms it.

The open CHANGES_REQUESTED review needs a re-review after these before it can merge.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5635866042 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9402#pullrequestreview-5635866042). Originally posted by [adriadam10](https://github.com/adriadam10) on 2026-10-24T00:38:27Z. **Review:** CHANGES_REQUESTED --- Checked the incremental refresh against the current `main` (`5e6ae6e3d`): `changedSpans`, the window test, the predecessor and cursor across spans, `pendingImports`, and the keys of the remembered failures and refusals. No defect found in the code. Before merge: - The branch merges cleanly on current `main`, but the validation runs were on `b7d1d47a5f`. `GuestBufferMemory.cpp` changed on `main` since then (`completeSpaceWrites`, `MarkDirectWrites`, `WriteBack`). Please rerun `ctest --test-dir build -R "agc|shader|recompiler" -V` with `ANYPS5_REQUIRE_VULKAN=1`, `ANYPS5_NO_SHADER_CACHE=1` and `VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation` on current `main` and on this change, same machine and GPU, and compare the VUIDs. - Refresh the SuperTuxKart summaries and traces against that base, as requested in the review. - Put the agreed order with #8926 in the description once its author confirms it. The open CHANGES_REQUESTED review needs a re-review after these before it can merge.
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!9402
No description provided.