perf(shader): bound resident resource plans by a byte budget #14367

Merged
hugodearaujo merged 6 commits from upstream-pr/14367 into main 2026-11-14 17:33:49 +00:00
hugodearaujo commented 2026-11-01 10:37:51 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by hugodearaujo on 2026-11-01T10:37:51Z.


What

Every shader the title draws keeps its resource plan (IrResourcePlan) in its SourceEntry, and the source table in getSource is never trimmed. #6178 drops plans only for registered shaders that were never captured, so the plan of every shader that was drawn once stays resident for the rest of the run.

In PRAGMATA (PPSA02530) with a warm shader cache, process-private memory goes from ~5 GiB at 10 s to ~20 GiB by 130 s. A diagnostic build counted the cause: the value arrays of the resident plans alone are 9 GiB of 19.7 GiB of malloc in use (6961 plans). Free memory inside the malloc arenas stays at 0.3–0.5 GiB, so this is live data, not fragmentation.

This change adds an opt-in byte budget for resident plans. It is off unless APS5_RESOURCE_PLAN_MB sets one, so by default every plan stays resident as on main:

  • Plan key: SourceEntry keeps the disk cache key its plan was loaded or stored under, and the shader hash it was loaded with. A dropped plan reloads straight from that entry, in acquirePlan under the source's mutex. The reload does not look the source up again by the current request, so it reads the same file.
    • It writes only when the entry is not on disk (a failed write or a file removed from outside). It then rebuilds the plan from the current request and stores it under the same key.
    • That key is the one the current request would build anyway: getSource keys a source on RecompileCacheKey::Build plus the host subgroup size and matches the code word for word, and BuildPlanKey adds only the format constants and the switch key to those fields.
  • Accounting: each resident plan's bytes are counted when it is loaded or built (resourcePlanBytes). The count covers the IrValue array, the operand and use lists of each value, the blocks, the plan's vectors and its compact form.
  • Eviction: once the held bytes pass the budget, the least recently used plans are dropped, oldest first, until the held bytes are at three quarters of the budget.
    • The trim groups the sources by plan object, because the disk cache's shared plan table (#10496) hands one object to every source whose entry has the same payload. A plan is dropped from all its sources at once, and only when every reference to it is one of those sources (use_count() equals the group size). A group is ordered by its most recent use.
    • A capture, a caller, a prepared invocation or a queued disk write using the plan keeps it. A queued write holds the plan until the writer has written it, so a plan is never dropped before its entry is on disk.
    • A plan is dropped only when disk plans are enabled and its key is known.
    • The trim takes each source's mutex with try_lock and runs only from the public entry points, after the plan was acquired and no recompiler lock is held: GetResourcePlan, both CaptureResources, PreparedShaderInvocation::Capture and PrepareShader.
    • When a trim could not get under the budget, the next one waits until the held bytes grow by another eighth of the budget, so a set of shared plans cannot make every capture scan the table.
  • Budget:
    • It is off by default. APS5_RESOURCE_PLAN_MB sets it in MiB, and 0 (the default) keeps every plan, as on main. A default can be picked once paired runs in several titles show how often evicted plans reload and what that costs in frame time.
    • With the budget off, nothing is evicted. What still runs is the accounting (a few atomic counters per plan) and the stored plan key: a plan that #6178's releaseUndrawnPlan drops reloads from that key in acquirePlan, instead of going through getSource again. Both read the same disk entry.
    • The variable is documented in docs/dev/ENVIRONMENT.md and listed in the shader disk cache's neutral switches, because it only decides how long a plan stays in memory, never what a compile produces.
    • Until 47e2440ed3, the budget was on by default, sized from physical memory: an eighth of it, between 1 and 8 GiB. That default was removed in review. The runs below used it: 3899 MiB on this host, which is now APS5_RESOURCE_PLAN_MB=3899.
  • Profile line: with APS5_PROFILE_DRAW, the result memo report adds a line [recompile] resource plans (10 s): N reloaded, M evicted; K plans held, X MiB of a Y MiB budget. The interval comes from TakeResourcePlanInterval, which reads the counters and updates the reported counts under one mutex, so overlapping reporters cannot count an interval twice or underflow.
  • Release path: releaseUndrawnPlan now goes through the same accounting, and the dropped plan is destroyed outside the source's mutex.

Not covered: a plan shared by several sources is counted once per source that holds it, so while it is shared the held bytes are higher than the memory it uses. In PRAGMATA only 8–20 resident plans had another owner at any time.

Tested

Arch Linux (kernel 7.2.11), Ryzen 7 9800X3D, 31 GiB RAM with zram swap, RX 9070 XT (RADV, Mesa 26.2.6), GCC 16.2.1, Release. Head 3a86c44a46. Merge base main 26fa1212b8. The head still merges cleanly with main 926f7dd492.

  • Since 47e2440ed3 (the budget off by default, from review), merged locally with main 118d39300d, kernel 7.2.14. The later main 1d7582cea6 changes only .github/workflows/build.yml.

    • The 62 ^shader|^agc_shader tests pass with VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation, ANYPS5_NO_SHADER_CACHE=1 and ANYPS5_REQUIRE_VULKAN=1, agc_shader_disk_cache (all four budget checks above) included. The loader inserted the layer, and the log has no VUID- line and no was not found but was requested.
    • tools/check_conventions.py --base 1d7582cea6 and git diff --check pass.
    • The checks below set the budget with SetResourcePlanBudget, so they don't depend on the default.
  • Check verifyPlanBudget in agc_shader_disk_cache:

    • Four plans are loaded and their bytes are accounted.
    • A budget is set so that three quarters of it fits only the two most recently used plans. The trim drops exactly the two least recently used plans, and a plan used just before the trim stays resident.
    • An evicted plan reloads as one disk plan hit, with no miss and no write, and encodes the same as before.
    • With a one-byte budget, plans held by the test are not evicted and come back as the same object.
    • A prepared shader's captured plan, evicted and captured again through PreparedShaderInvocation with a relocated push layout, reloads from its own disk cache entry with no miss and no write.
  • Check verifySharedPlanBudget:

    • Two sources (the same code address, code that differs only in a leading s_nop) reload one plan object from two disk entries.
    • While a caller holds the plan, a one-byte budget keeps it.
    • Once the caller lets go, a one-byte budget evicts it from both sources (two evictions, two fewer held plans).
    • The plan then reloads as two disk hits with no miss and no write, shared again, and encodes as before.
  • Check verifyQueuedPlanWrite:

    • 4096 plan writes are queued ahead of a new plan's write, and the budget is trimmed to one byte while that write is still pending (checked with planWrites).
    • The plan stays resident, with no miss and no reload on its next use.
    • After Flush() it is evicted and reloads as one disk hit with no miss and no write.
  • Check verifyPlanReport:

    • A test hook (SetResourcePlanReportHook) runs inside an admitted reporter after it has read the counters.
    • The hook evicts and reloads a plan, starts a second reporter and waits up to 250 ms for it.
    • The two intervals add up to exactly the evictions and the reload, neither is larger than that total, and the next interval is empty.
  • Red/green:

    • Sorting the trim newest first fails with a recently used plan was evicted.
    • Letting the trim ignore the other references fails with a budget of one byte did not evict the unowned plans or evicted the owned ones.
    • The previous trim (one plan per source, use_count() == 1) fails with shared plan budget: a plan shared by two idle sources was not evicted from both.
    • A trim that ignores one extra reference (use_count() > owners + 1) fails 5 of 5 with queued plan write: a plan whose disk write was still queued was evicted and missed on its next use. The earlier budget checks were disabled for that run, because they catch the same mutation first. Without the mutation the check passed 20 of 20 runs.
    • Removing the mutex from TakeResourcePlanInterval fails 5 of 5 with plan report: a reporter delayed past the next interval counted it twice or underflowed.
  • Paired run of the touched set on main 26fa1212b8 and on 3a86c44a46:

    • Set: agc_shader_disk_cache*, agc_driver_prepared_shaders*, agc_shader_result_memo_budget* and agc_shader_memory.
    • Each test ran with its CTest arguments, environment and working directory, plus VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation, ANYPS5_NO_SHADER_CACHE=1 and ANYPS5_REQUIRE_VULKAN=1.
    • The loader debug output shows Insert instance layer "VK_LAYER_KHRONOS_validation" 51 times in each run, with no was not found but was requested line.
    • Both runs pass 30 of 30 (agc_driver_prepared_shaders_debug_failure is a WILL_FAIL test) with no VUID- lines.
  • python3 tools/check_conventions.py --base origin/main and git diff --check pass.

Performance (PRAGMATA, PPSA02530, 01.200.000)

These runs predate 47e2440ed3: the change arm ran with the budget on, at 3899 MiB (now APS5_RESOURCE_PLAN_MB=3899).

Route. This is the route of the memory runs below: boot to the title, no input before the title shows (Cross only after it, by a screenshot match). The capture is APS5_TRACE_SECONDS=40:70, 40 to 110 s after the first present, with no other trace or profile switch. In the profiled run of the change, that window holds three eviction bursts: 1512, 2908 and 603 evictions, and 258 reloads.

Builds. Both arms are the title's integration stack: #10935 895e0341d9, #10304 31f895cb59, #10497 218dce3ad3, #12898 d2d43310ad, #4449 88b99b28b6, #9999 d72cc8ca6a and #11580 fedf3e91a7, each merged with --no-ff. It is the same stack as the memory runs below, without their mallinfo2() print: no diagnostics in either build.

  • base: 0510c350a6 = main 26fa1212b8 + the stack.
  • change: 7d85b40418 = this head 3a86c44a46 + the same stack.

Caches. The change's shader cache source version was pinned to the base's (38d10bea705877c0), so both read the same cache. This change does not alter compiled output.

  • The cache was filled by a 1000 s run of the base, from empty to gameplay, and a 400 s run of the change on top. The change prepares registered shaders the base leaves for first use.
  • Before every run, the same snapshot of the pipeline journal, the Vulkan pipeline cache (shader_cache/driver) and the save was restored. Then the arms ran alternated: base, change, base, change.
  • dirty is null in the lines: git status fails in that build tree, whose submodules are symlinks. The tracked sources had no changes (git status --ignore-submodules was empty).
run presents frame p50 / p90 / p99 / max (ms) GPU busy per present RssAnon+VmSwap at 80 / 130 / 180 s, peak (MiB) shader cache totals title shown
base 1 825 66.8 / 136.3 / 353.3 / 730.7 30.9 ms 11897 / 18155 / 18367, 18368 19575 hits, 0 misses 132 s
change 1 839 66.4 / 134.1 / 273.9 / 545.5 30.5 ms 6954 / 10022 / 10772, 11682 22584 hits, 2 misses, 2 writes 132 s
base 2 843 66.5 / 133.1 / 241.5 / 494.5 31.0 ms 11842 / 17651 / 18460, 18551 19575 hits, 0 misses 182 s
change 2 854 66.9 / 130.4 / 260.8 / 491.2 30.5 ms 6971 / 10037 / 10835, 11709 22586 hits, 0 misses 132 s
  • Memory is sampled from /proc/<pid>/status every 2 s; the sampling stops the title at 200 s. "Title shown" is the first 8 s screenshot that matches the title, so it is coarse.
  • Frame times in the window are within run-to-run spread: p50 66.4–66.9 ms in all four runs. Mean frame time is −1.4 and −1.1 ms, and GPU busy per present is −0.4 and −0.5 ms (tools/performance_compare.py, pair 1 and pair 2).
  • Both base runs print process private memory reached the registered shader preparation budget at ~109 s (#9626). The change runs do not, which is why they have ~3000 more cache hits.
  • Profiled runs (APS5_PROFILE_DRAW=1, not traced) peak at 18470 MiB (base) and 10932 MiB (change). The held plan bytes stayed under the 3899 MiB budget (largest: 3802.0 MiB).

Summary lines (base 1, change 1, base 2, change 2):

{"commit":"0510c350a6f5","dirty":null,"env":{"APS5_LOG_TIMESTAMPS":"1","APS5_PAD_INPUT_FILE":"<path>","APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"40:70"},"gpu":"AMD Radeon RX 9070 XT (RADV GFX1201)","driver":"radv Mesa 26.2.6-arch1.1","os":"Linux 7.2.11-arch1-1","cpu":"AMD Ryzen 7 9800X3D 8-Core Processor","cpu_threads":8,"memory_mib":31192,"title_id":"PPSA02530","title":"PRAGMATA","content_version":"01.200.000","resolution":"3840x2160","window":{"spec":"seconds 40:70","first_present":674,"ms":70057.488},"presents":825,"frame_ms":{"p50":66.777,"p90":136.298,"p99":353.265,"max":730.722},"gpu_busy_ms_per_present":30.947,"worker_busy_pct":{"queue worker 0x38":5.732,"queue worker 0x20":50.267,"queue worker 0x0":91.552,"queue worker 0x28":11.820},"top_phases_ms_per_frame":{"Driver.Packet":134.414,"Driver.Packet.dispatch":74.658,"Driver.Dispatch":60.668,"Driver.Packet.memory_wait":48.115,"Vulkan.Dispatch":47.985,"Vulkan.Dispatch.shader_resources":47.742,"Recorder.Sync":30.161,"Shader.ResolveAbi":24.407},"trace_dropped":false,"trace":"aps5-trace-0510c350a6f5-2831162.json.gz"}
{"commit":"7d85b4041817","dirty":null,"env":{"APS5_LOG_TIMESTAMPS":"1","APS5_PAD_INPUT_FILE":"<path>","APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"40:70"},"gpu":"AMD Radeon RX 9070 XT (RADV GFX1201)","driver":"radv Mesa 26.2.6-arch1.1","os":"Linux 7.2.11-arch1-1","cpu":"AMD Ryzen 7 9800X3D 8-Core Processor","cpu_threads":8,"memory_mib":31192,"title_id":"PPSA02530","title":"PRAGMATA","content_version":"01.200.000","resolution":"3840x2160","window":{"spec":"seconds 40:70","first_present":686,"ms":70074.346},"presents":839,"frame_ms":{"p50":66.445,"p90":134.149,"p99":273.889,"max":545.474},"gpu_busy_ms_per_present":30.527,"worker_busy_pct":{"queue worker 0x38":4.852,"queue worker 0x20":49.880,"queue worker 0x0":92.562,"queue worker 0x28":10.375},"top_phases_ms_per_frame":{"Driver.Packet":130.782,"Driver.Packet.dispatch":73.432,"Driver.Dispatch":59.783,"Vulkan.Dispatch":45.826,"Vulkan.Dispatch.shader_resources":45.562,"Driver.Packet.memory_wait":45.476,"Recorder.Sync":29.496,"Shader.ResolveAbi":23.188},"trace_dropped":false,"trace":"aps5-trace-7d85b4041817-2855161.json.gz"}
{"commit":"0510c350a6f5","dirty":null,"env":{"APS5_LOG_TIMESTAMPS":"1","APS5_PAD_INPUT_FILE":"<path>","APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"40:70"},"gpu":"AMD Radeon RX 9070 XT (RADV GFX1201)","driver":"radv Mesa 26.2.6-arch1.1","os":"Linux 7.2.11-arch1-1","cpu":"AMD Ryzen 7 9800X3D 8-Core Processor","cpu_threads":8,"memory_mib":31192,"title_id":"PPSA02530","title":"PRAGMATA","content_version":"01.200.000","resolution":"3840x2160","window":{"spec":"seconds 40:70","first_present":676,"ms":70074.229},"presents":843,"frame_ms":{"p50":66.507,"p90":133.064,"p99":241.478,"max":494.477},"gpu_busy_ms_per_present":30.980,"worker_busy_pct":{"queue worker 0x38":4.625,"queue worker 0x20":49.946,"queue worker 0x0":92.868,"queue worker 0x28":9.739},"top_phases_ms_per_frame":{"Driver.Packet":129.751,"Driver.Packet.dispatch":72.922,"Driver.Dispatch":59.262,"Vulkan.Dispatch":46.215,"Vulkan.Dispatch.shader_resources":45.975,"Driver.Packet.memory_wait":44.836,"Recorder.Sync":29.920,"Graphics.Draw":21.692},"trace_dropped":false,"trace":"aps5-trace-0510c350a6f5-2879961.json.gz"}
{"commit":"7d85b4041817","dirty":null,"env":{"APS5_LOG_TIMESTAMPS":"1","APS5_PAD_INPUT_FILE":"<path>","APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"40:70"},"gpu":"AMD Radeon RX 9070 XT (RADV GFX1201)","driver":"radv Mesa 26.2.6-arch1.1","os":"Linux 7.2.11-arch1-1","cpu":"AMD Ryzen 7 9800X3D 8-Core Processor","cpu_threads":8,"memory_mib":31192,"title_id":"PPSA02530","title":"PRAGMATA","content_version":"01.200.000","resolution":"3840x2160","window":{"spec":"seconds 40:70","first_present":691,"ms":70065.000},"presents":854,"frame_ms":{"p50":66.879,"p90":130.360,"p99":260.805,"max":491.208},"gpu_busy_ms_per_present":30.519,"worker_busy_pct":{"queue worker 0x38":4.371,"queue worker 0x20":49.044,"queue worker 0x0":92.877,"queue worker 0x28":9.525},"top_phases_ms_per_frame":{"Driver.Packet":126.893,"Driver.Packet.dispatch":71.387,"Driver.Dispatch":57.704,"Vulkan.Dispatch":45.403,"Vulkan.Dispatch.shader_resources":45.164,"Driver.Packet.memory_wait":44.286,"Recorder.Sync":29.876,"Shader.ResolveAbi":23.647},"trace_dropped":false,"trace":"aps5-trace-7d85b4041817-2936462.json.gz"}

Traces: base 1 pr14367-pragmata-base-1.json.gz, change 1 pr14367-pragmata-change-1.json.gz, base 2 pr14367-pragmata-base-2.json.gz, change 2 pr14367-pragmata-change-2.json.gz.

python3 tools/trace_digest.py aps5-trace-0510c350a6f5-2831162.json.gz (base 1)

seconds 40:70 from present 674: 825 presents, frame p50 66.8 / p90 136.3 / p99 353.3 / max 730.7 ms, GPU busy 30.9 ms per present
AMD Radeon RX 9070 XT (RADV GFX1201), radv Mesa 26.2.6-arch1.1, Linux 7.2.11-arch1-1, 3840x2160, commit 0510c350a6f5, dropped: no

{"commit":"0510c350a6f5","dirty":null,"env":{"APS5_LOG_TIMESTAMPS":"1","APS5_PAD_INPUT_FILE":"<path>","APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"40:70"},"gpu":"AMD Radeon RX 9070 XT (RADV GFX1201)","driver":"radv Mesa 26.2.6-arch1.1","os":"Linux 7.2.11-arch1-1","cpu":"AMD Ryzen 7 9800X3D 8-Core Processor","cpu_threads":8,"memory_mib":31192,"title_id":"PPSA02530","title":"PRAGMATA","content_version":"01.200.000","resolution":"3840x2160","window":{"spec":"seconds 40:70","first_present":674,"ms":70057.488},"presents":825,"frame_ms":{"p50":66.777,"p90":136.298,"p99":353.265,"max":730.722},"gpu_busy_ms_per_present":30.947,"worker_busy_pct":{"queue worker 0x38":5.732,"queue worker 0x20":50.267,"queue worker 0x0":91.552,"queue worker 0x28":11.82},"top_phases_ms_per_frame":{"Driver.Packet":134.414,"Driver.Packet.dispatch":74.658,"Driver.Dispatch":60.668,"Driver.Packet.memory_wait":48.115,"Vulkan.Dispatch":47.985,"Vulkan.Dispatch.shader_resources":47.742,"Recorder.Sync":30.161,"Shader.ResolveAbi":24.407},"trace_dropped":false,"trace":"aps5-trace-0510c350a6f5-2831162.json.gz"}

Slowest frames (largest slices inside each, inclusive)

  • present 1238: 730.7 ms at 45210 ms: Driver.Packet (queue worker 0x20) 622.1, Driver.Packet.memory_wait (queue worker 0x20) 604.4, Driver.WorkerWait (queue worker 0x38) 486.9, Driver.WorkerWait.dequeue_order (queue worker 0x38) 486.9
  • present 1237: 690.6 ms at 44520 ms: Shader.ResolveAbi (title) 1629.3, Shader.PrepareArtifact (title) 1611.2, Driver.Packet (queue worker 0x20) 629.8, Driver.Packet (queue worker 0x0) 587.6
  • present 1241: 633.7 ms at 46331 ms: Driver.WorkerWait (queue worker 0x38) 586.9, Driver.WorkerWait.dequeue_order (queue worker 0x38) 586.9, Driver.Packet (queue worker 0x0) 584.4, Driver.WorkerWait (queue worker 0x28) 555.2
  • present 1479: 502.5 ms at 65040 ms: Driver.WorkerWait (queue worker 0x38) 443.9, Driver.WorkerWait.dequeue_order (queue worker 0x38) 443.9, Driver.Packet (queue worker 0x0) 441.3, Driver.WorkerWait (queue worker 0x28) 419.6
  • present 1265: 441.7 ms at 50245 ms: Driver.WorkerWait (queue worker 0x38) 404.9, Driver.WorkerWait.dequeue_order (queue worker 0x38) 404.9, Driver.WorkerWait (queue worker 0x28) 402.4, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x28) 402.4

Threads (ms per frame)

thread busy wait untraced in slices < 20 us largest
shader prepare 0.8 (1 %) 0.0 (0 %) 84.2 0.0 Shader.PrepareArtifact 0.8
shader prepare 0.8 (1 %) 0.0 (0 %) 84.1 0.0 Shader.PrepareArtifact 0.8
shader prepare 0.8 (1 %) 0.0 (0 %) 84.1 0.0 Shader.PrepareArtifact 0.8
shader prepare 0.8 (1 %) 0.0 (0 %) 84.1 0.0 Shader.PrepareArtifact 0.8
shader prepare 0.1 (0 %) 0.0 (0 %) 84.8 0.0 Vulkan.GraphicsPipelinePrebuild 0.1, Vulkan.ComputePipeline 0.0
shader prepare 0.1 (0 %) 0.0 (0 %) 84.8 0.0 Vulkan.GraphicsPipelinePrebuild 0.1
shader prepare 0.2 (0 %) 0.0 (0 %) 84.8 0.0 Vulkan.GraphicsPipelinePrebuild 0.2, Vulkan.ComputePipeline 0.0
shader prepare 0.2 (0 %) 0.0 (0 %) 84.8 0.0 Vulkan.GraphicsPipelinePrebuild 0.1, Vulkan.ComputePipeline 0.0
title 5.8 (7 %) 0.3 (0 %) 78.9 0.0 Shader.ResolveAbi 3.0, Shader.ResolveGraphicsStagesAbi 1.8
title 6.0 (7 %) 0.1 (0 %) 78.8 0.0 Shader.ResolveAbi 3.1, Shader.ResolveGraphicsStagesAbi 2.0
title 5.5 (6 %) 0.4 (0 %) 79.1 0.0 Shader.ResolveAbi 2.3, Shader.ResolveGraphicsStagesAbi 2.3
title 5.7 (7 %) 0.1 (0 %) 79.0 0.0 Shader.ResolveAbi 2.9, Shader.ResolveGraphicsStagesAbi 2.0
queue worker 0x38 4.6 (5 %) 80.0 (94 %) 0.3 0.0 Driver.Packet 4.6, Driver.EndSubmission 0.3
queue worker 0x20 19.4 (23 %) 65.3 (77 %) 0.2 0.4 Driver.Packet 42.4, Driver.EndSubmission 0.2
queue worker 0x0 54.6 (64 %) 29.4 (35 %) 0.9 4.0 Driver.Packet 77.0, Driver.Completion 0.0
draw committer 18.4 (22 %) 3.2 (4 %) 63.3 0.2 Graphics.Draw 20.9, Recorder.Submit 0.1
presenter 1.5 (2 %) 4.1 (5 %) 79.4 0.1 VideoOut.Flip 5.6, Driver.Present 0.0
title 4.7 (6 %) 0.1 (0 %) 80.1 0.0 Shader.ResolveAbi 2.8, Shader.ResolveGraphicsStagesAbi 1.4
title 6.4 (8 %) 0.2 (0 %) 78.4 0.0 Shader.ResolveAbi 3.0, Shader.ResolveGraphicsStagesAbi 2.2
title 7.8 (9 %) 0.2 (0 %) 76.9 0.0 Shader.ResolveAbi 4.6, Shader.ResolveGraphicsStagesAbi 2.0
title 5.7 (7 %) 0.2 (0 %) 78.9 0.0 Shader.ResolveAbi 2.7, Shader.ResolveGraphicsStagesAbi 2.1
queue worker 0x28 0.3 (0 %) 84.4 (99 %) 0.2 0.0 Driver.Packet 9.6, Driver.EndSubmission 0.4
gpu 31.0 (36 %) 0.0 (0 %) 54.0 0.0 batch 31.0

Largest slices (ms per frame, inclusive, all threads): Driver.WorkerWait 203.5, Driver.Packet 133.6, Driver.WorkerWait.idle_and_completion_poll 123.6, Driver.WorkerWait.dequeue_order 79.9, Driver.Packet.dispatch 74.4, Driver.Dispatch 60.3, Driver.Packet.memory_wait 48.1, Vulkan.Dispatch 47.7, Vulkan.Dispatch.shader_resources 47.5, batch 31.0

Longest waits

  • Driver.WorkerWait (queue worker 0x38) 586.9 ms at 46378 ms, present 1241
  • Driver.WorkerWait (queue worker 0x38) 585.8 ms at 44624 ms, present 1237
  • Driver.WorkerWait (queue worker 0x28) 554.8 ms at 46412 ms, present 1241
  • Driver.WorkerWait (queue worker 0x38) 486.9 ms at 45454 ms, present 1238
  • Driver.WorkerWait (queue worker 0x38) 443.9 ms at 65098 ms, present 1479
  • Driver.WorkerWait (queue worker 0x28) 419.2 ms at 65124 ms, present 1479
  • Driver.Packet.memory_wait (queue worker 0x20) 413.4 ms at 45213 ms, present 1238
  • Driver.WorkerWait (queue worker 0x28) 407.8 ms at 45535 ms, present 1238
  • Driver.WorkerWait (queue worker 0x38) 404.9 ms at 50282 ms, present 1265
  • Driver.WorkerWait (queue worker 0x28) 401.7 ms at 50287 ms, present 1265

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

  • batch 15807: 18.4 ms at 54813 ms, present 1298: GPU no ranges; recorded by Driver.Packet (queue worker 0x0) 30.7, Driver.Packet.dispatch (queue worker 0x0) 30.6, Driver.Dispatch (queue worker 0x0) 6.8, Vulkan.Dispatch (queue worker 0x0) 6.6
  • batch 542: 17.2 ms at 2330 ms, present 696: GPU no ranges; recorded by Vulkan.Dispatch.shader_resources (queue worker 0x0) 21.6, Recorder.Sync (queue worker 0x0) 17.4, Driver.Packet (queue worker 0x0) 6.3, Driver.Packet.dispatch (queue worker 0x0) 6.3
  • batch 157: 16.6 ms at 576 ms, present 680: GPU no ranges; recorded by Vulkan.Dispatch.shader_resources (queue worker 0x0) 28.6, Recorder.Sync (queue worker 0x0) 16.7, Driver.Packet (queue worker 0x0) 6.5, Driver.Packet.dispatch (queue worker 0x0) 6.5
  • batch 9312: 16.2 ms at 30867 ms, present 1074: GPU no ranges; recorded by Vulkan.Dispatch.shader_resources (queue worker 0x0) 48.9, Recorder.Sync (queue worker 0x0) 16.9, Driver.Packet (queue worker 0x0) 8.9, Driver.Packet.dispatch (queue worker 0x0) 8.9
  • batch 17125: 14.6 ms at 58766 ms, present 1376: GPU no ranges; recorded by Driver.Packet (queue worker 0x0) 25.9, Driver.Packet.dispatch (queue worker 0x0) 25.9, Driver.Dispatch (queue worker 0x0) 6.2, Vulkan.Dispatch (queue worker 0x0) 6.1
python3 tools/trace_digest.py aps5-trace-7d85b4041817-2855161.json.gz (change 1)

seconds 40:70 from present 686: 839 presents, frame p50 66.4 / p90 134.1 / p99 273.9 / max 545.5 ms, GPU busy 30.5 ms per present
AMD Radeon RX 9070 XT (RADV GFX1201), radv Mesa 26.2.6-arch1.1, Linux 7.2.11-arch1-1, 3840x2160, commit 7d85b4041817, dropped: no

{"commit":"7d85b4041817","dirty":null,"env":{"APS5_LOG_TIMESTAMPS":"1","APS5_PAD_INPUT_FILE":"<path>","APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"40:70"},"gpu":"AMD Radeon RX 9070 XT (RADV GFX1201)","driver":"radv Mesa 26.2.6-arch1.1","os":"Linux 7.2.11-arch1-1","cpu":"AMD Ryzen 7 9800X3D 8-Core Processor","cpu_threads":8,"memory_mib":31192,"title_id":"PPSA02530","title":"PRAGMATA","content_version":"01.200.000","resolution":"3840x2160","window":{"spec":"seconds 40:70","first_present":686,"ms":70074.346},"presents":839,"frame_ms":{"p50":66.445,"p90":134.149,"p99":273.889,"max":545.474},"gpu_busy_ms_per_present":30.527,"worker_busy_pct":{"queue worker 0x38":4.852,"queue worker 0x20":49.88,"queue worker 0x0":92.562,"queue worker 0x28":10.375},"top_phases_ms_per_frame":{"Driver.Packet":130.782,"Driver.Packet.dispatch":73.432,"Driver.Dispatch":59.783,"Vulkan.Dispatch":45.826,"Vulkan.Dispatch.shader_resources":45.562,"Driver.Packet.memory_wait":45.476,"Recorder.Sync":29.496,"Shader.ResolveAbi":23.188},"trace_dropped":false,"trace":"aps5-trace-7d85b4041817-2855161.json.gz"}

Slowest frames (largest slices inside each, inclusive)

  • present 1220: 545.5 ms at 42523 ms: Driver.Packet (queue worker 0x20) 440.1, Driver.WorkerWait (queue worker 0x38) 433.4, Driver.WorkerWait.dequeue_order (queue worker 0x38) 433.4, Driver.Packet (queue worker 0x0) 430.9
  • present 1513: 527.0 ms at 66900 ms: Driver.WorkerWait (queue worker 0x38) 445.9, Driver.WorkerWait.dequeue_order (queue worker 0x38) 445.9, Driver.Packet (queue worker 0x0) 443.1, Driver.WorkerWait (queue worker 0x28) 400.7
  • present 1262: 365.6 ms at 48549 ms: Driver.Packet (queue worker 0x20) 319.6, Driver.WorkerWait (queue worker 0x38) 316.8, Driver.WorkerWait.dequeue_order (queue worker 0x38) 316.8, Driver.Packet (queue worker 0x0) 315.0
  • present 1515: 336.7 ms at 67730 ms: Driver.WorkerWait (queue worker 0x38) 336.7, Driver.WorkerWait.dequeue_order (queue worker 0x38) 332.4, Driver.Packet (queue worker 0x0) 331.3, Driver.WorkerWait (queue worker 0x28) 304.6
  • present 1521: 306.7 ms at 69094 ms: Driver.WorkerWait (queue worker 0x38) 264.7, Driver.WorkerWait.dequeue_order (queue worker 0x38) 264.7, Driver.Packet (queue worker 0x0) 263.2, Driver.Packet (queue worker 0x20) 232.2

Threads (ms per frame)

thread busy wait untraced in slices < 20 us largest
shader prepare 0.9 (1 %) 0.0 (0 %) 82.6 0.0 Shader.PrepareArtifact 0.9
shader prepare 0.8 (1 %) 0.0 (0 %) 82.7 0.0 Shader.PrepareArtifact 0.8
shader prepare 0.9 (1 %) 0.0 (0 %) 82.6 0.0 Shader.PrepareArtifact 0.9
shader prepare 1.0 (1 %) 0.0 (0 %) 82.5 0.0 Shader.PrepareArtifact 1.0
shader prepare 0.2 (0 %) 0.0 (0 %) 83.4 0.0 Vulkan.GraphicsPipelinePrebuild 0.2, Vulkan.ComputePipeline 0.0
shader prepare 0.1 (0 %) 0.0 (0 %) 83.4 0.0 Vulkan.GraphicsPipelinePrebuild 0.1, Vulkan.ComputePipeline 0.0
shader prepare 0.2 (0 %) 0.0 (0 %) 83.3 0.0 Vulkan.GraphicsPipelinePrebuild 0.2
shader prepare 0.1 (0 %) 0.0 (0 %) 83.4 0.0 Vulkan.GraphicsPipelinePrebuild 0.1, Vulkan.ComputePipeline 0.0
title 7.2 (9 %) 0.2 (0 %) 76.2 0.0 Shader.ResolveGraphicsStagesAbi 2.9, Shader.ResolveAbi 2.9
queue worker 0x38 3.9 (5 %) 79.3 (95 %) 0.3 0.0 Driver.Packet 3.8, Driver.EndSubmission 0.3
queue worker 0x20 20.0 (24 %) 63.3 (76 %) 0.2 0.4 Driver.Packet 41.4, Driver.EndSubmission 0.1
queue worker 0x0 53.8 (64 %) 28.7 (34 %) 1.0 4.2 Driver.Packet 76.6, Driver.Completion 0.0
title 6.2 (7 %) 0.2 (0 %) 77.1 0.0 Shader.ResolveAbi 2.5, Shader.ResolveGraphicsStagesAbi 2.5
draw committer 18.4 (22 %) 3.2 (4 %) 61.9 0.2 Graphics.Draw 20.9, Recorder.Submit 0.1
presenter 1.5 (2 %) 3.7 (4 %) 78.4 0.1 VideoOut.Flip 5.2, Driver.Present 0.0
title 8.7 (10 %) 0.2 (0 %) 74.6 0.0 Shader.ResolveGraphicsStagesAbi 3.6, Shader.ResolveAbi 3.4
title 7.0 (8 %) 0.3 (0 %) 76.2 0.0 Shader.ResolveAbi 3.5, Shader.ResolveGraphicsStagesAbi 2.2
title 5.7 (7 %) 0.3 (0 %) 77.6 0.0 Shader.ResolveAbi 2.6, Shader.ResolveGraphicsStagesAbi 2.1
title 5.7 (7 %) 0.3 (0 %) 77.5 0.0 Shader.ResolveAbi 2.4, Shader.ResolveGraphicsStagesAbi 2.0
title 6.4 (8 %) 0.2 (0 %) 76.8 0.0 Shader.ResolveAbi 3.2, Shader.ResolveGraphicsStagesAbi 2.1
title 6.4 (8 %) 0.1 (0 %) 77.0 0.0 Shader.ResolveAbi 2.7, Shader.ResolveGraphicsStagesAbi 2.5
queue worker 0x28 0.2 (0 %) 83.0 (99 %) 0.3 0.0 Driver.Packet 8.2, Driver.EndSubmission 0.5
gpu 30.6 (37 %) 0.0 (0 %) 53.0 0.0 batch 30.6

Largest slices (ms per frame, inclusive, all threads): Driver.WorkerWait 201.4, Driver.Packet 129.9, Driver.WorkerWait.idle_and_completion_poll 122.5, Driver.WorkerWait.dequeue_order 78.9, Driver.Packet.dispatch 73.1, Driver.Dispatch 59.4, Vulkan.Dispatch 45.5, Driver.Packet.memory_wait 45.5, Vulkan.Dispatch.shader_resources 45.4, batch 30.6

Longest waits

  • Driver.WorkerWait (queue worker 0x38) 446.2 ms at 66981 ms, present 1513
  • Driver.WorkerWait (queue worker 0x38) 433.4 ms at 42635 ms, present 1220
  • Driver.WorkerWait (queue worker 0x28) 402.6 ms at 67027 ms, present 1513
  • Driver.WorkerWait (queue worker 0x28) 387.3 ms at 42683 ms, present 1220
  • Driver.WorkerWait (queue worker 0x38) 382.6 ms at 67684 ms, present 1514
  • Driver.WorkerWait (queue worker 0x28) 352.9 ms at 32701 ms, present 1116
  • Driver.WorkerWait (queue worker 0x38) 316.8 ms at 48598 ms, present 1262
  • Driver.WorkerWait (queue worker 0x28) 305.0 ms at 67764 ms, present 1515
  • Driver.WorkerWait (queue worker 0x38) 290.1 ms at 32852 ms, present 1117
  • Driver.WorkerWait (queue worker 0x28) 278.2 ms at 48639 ms, present 1262

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

  • batch 668: 18.8 ms at 2940 ms, present 713: GPU no ranges; recorded by Vulkan.Dispatch.shader_resources (queue worker 0x0) 23.0, Recorder.Sync (queue worker 0x0) 18.9, Driver.Packet (queue worker 0x0) 6.2, Driver.Packet.dispatch (queue worker 0x0) 6.2
  • batch 741: 18.7 ms at 3326 ms, present 716: GPU no ranges; recorded by Vulkan.Dispatch.shader_resources (queue worker 0x0) 23.5, Recorder.Sync (queue worker 0x0) 18.9, Driver.Packet (queue worker 0x0) 6.5, Driver.Packet.dispatch (queue worker 0x0) 6.5
  • batch 303: 18.4 ms at 1157 ms, present 698: GPU no ranges; recorded by Vulkan.Dispatch.shader_resources (queue worker 0x0) 23.1, Recorder.Sync (queue worker 0x0) 18.6, Driver.Packet (queue worker 0x0) 6.7, Driver.Packet.dispatch (queue worker 0x0) 6.7
  • batch 328: 18.4 ms at 1288 ms, present 699: GPU no ranges; recorded by Vulkan.Dispatch.shader_resources (queue worker 0x0) 23.6, Recorder.Sync (queue worker 0x0) 18.5, Driver.Packet (queue worker 0x0) 6.5, Driver.Packet.dispatch (queue worker 0x0) 6.5
  • batch 3055: 17.0 ms at 11059 ms, present 816: GPU no ranges; recorded by Vulkan.Dispatch.shader_resources (queue worker 0x0) 21.2, Recorder.Sync (queue worker 0x0) 17.2, Driver.Packet (queue worker 0x0) 6.3, Driver.Packet.dispatch (queue worker 0x0) 6.3
python3 tools/trace_digest.py aps5-trace-0510c350a6f5-2879961.json.gz (base 2)

seconds 40:70 from present 676: 843 presents, frame p50 66.5 / p90 133.1 / p99 241.5 / max 494.5 ms, GPU busy 31.0 ms per present
AMD Radeon RX 9070 XT (RADV GFX1201), radv Mesa 26.2.6-arch1.1, Linux 7.2.11-arch1-1, 3840x2160, commit 0510c350a6f5, dropped: no

{"commit":"0510c350a6f5","dirty":null,"env":{"APS5_LOG_TIMESTAMPS":"1","APS5_PAD_INPUT_FILE":"<path>","APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"40:70"},"gpu":"AMD Radeon RX 9070 XT (RADV GFX1201)","driver":"radv Mesa 26.2.6-arch1.1","os":"Linux 7.2.11-arch1-1","cpu":"AMD Ryzen 7 9800X3D 8-Core Processor","cpu_threads":8,"memory_mib":31192,"title_id":"PPSA02530","title":"PRAGMATA","content_version":"01.200.000","resolution":"3840x2160","window":{"spec":"seconds 40:70","first_present":676,"ms":70074.229},"presents":843,"frame_ms":{"p50":66.507,"p90":133.064,"p99":241.478,"max":494.477},"gpu_busy_ms_per_present":30.98,"worker_busy_pct":{"queue worker 0x38":4.625,"queue worker 0x20":49.946,"queue worker 0x0":92.868,"queue worker 0x28":9.739},"top_phases_ms_per_frame":{"Driver.Packet":129.751,"Driver.Packet.dispatch":72.922,"Driver.Dispatch":59.262,"Vulkan.Dispatch":46.215,"Vulkan.Dispatch.shader_resources":45.975,"Driver.Packet.memory_wait":44.836,"Recorder.Sync":29.92,"Graphics.Draw":21.692},"trace_dropped":false,"trace":"aps5-trace-0510c350a6f5-2879961.json.gz"}

Slowest frames (largest slices inside each, inclusive)

  • present 1230: 494.5 ms at 43283 ms: Driver.WorkerWait (queue worker 0x38) 430.4, Driver.WorkerWait.dequeue_order (queue worker 0x38) 430.4, Driver.Packet (queue worker 0x0) 427.9, Driver.WorkerWait (queue worker 0x28) 411.3
  • present 1501: 451.1 ms at 66139 ms: Driver.WorkerWait (queue worker 0x38) 392.0, Driver.WorkerWait.dequeue_order (queue worker 0x38) 392.0, Driver.Packet (queue worker 0x0) 389.4, Driver.WorkerWait (queue worker 0x28) 371.4
  • present 1248: 365.0 ms at 45810 ms: Driver.WorkerWait (queue worker 0x38) 327.8, Driver.WorkerWait.dequeue_order (queue worker 0x38) 327.8, Driver.Packet (queue worker 0x0) 326.1, Driver.Packet (queue worker 0x20) 317.3
  • present 1503: 354.3 ms at 66814 ms: Driver.WorkerWait (queue worker 0x38) 306.0, Driver.WorkerWait.dequeue_order (queue worker 0x38) 306.0, Driver.Packet (queue worker 0x0) 303.8, Driver.WorkerWait (queue worker 0x28) 269.0
  • present 1295: 329.6 ms at 52304 ms: Driver.WorkerWait (queue worker 0x38) 289.9, Driver.WorkerWait.dequeue_order (queue worker 0x38) 289.9, Driver.Packet (queue worker 0x0) 288.1, Driver.Packet (queue worker 0x20) 286.5

Threads (ms per frame)

thread busy wait untraced in slices < 20 us largest
shader prepare 0.7 (1 %) 0.0 (0 %) 82.4 0.0 Shader.PrepareArtifact 0.7
shader prepare 0.7 (1 %) 0.0 (0 %) 82.5 0.0 Shader.PrepareArtifact 0.7
shader prepare 0.7 (1 %) 0.0 (0 %) 82.5 0.0 Shader.PrepareArtifact 0.7
shader prepare 0.6 (1 %) 0.0 (0 %) 82.5 0.0 Shader.PrepareArtifact 0.6
shader prepare 0.1 (0 %) 0.0 (0 %) 83.0 0.0 Vulkan.GraphicsPipelinePrebuild 0.1, Vulkan.ComputePipeline 0.0
shader prepare 0.2 (0 %) 0.0 (0 %) 83.0 0.0 Vulkan.GraphicsPipelinePrebuild 0.2, Vulkan.ComputePipeline 0.0
shader prepare 0.2 (0 %) 0.0 (0 %) 83.0 0.0 Vulkan.GraphicsPipelinePrebuild 0.2, Vulkan.ComputePipeline 0.0
shader prepare 0.1 (0 %) 0.0 (0 %) 83.0 0.0 Vulkan.GraphicsPipelinePrebuild 0.1, Vulkan.ComputePipeline 0.0
title 6.0 (7 %) 0.2 (0 %) 76.9 0.0 Shader.ResolveAbi 2.5, Shader.ResolveGraphicsStagesAbi 2.2
title 7.0 (8 %) 0.1 (0 %) 76.1 0.0 Shader.ResolveAbi 3.5, Shader.ResolveGraphicsStagesAbi 2.3
title 6.2 (7 %) 0.2 (0 %) 76.8 0.0 Shader.ResolveAbi 3.0, Shader.ResolveGraphicsStagesAbi 2.1
queue worker 0x38 3.7 (4 %) 79.2 (95 %) 0.3 0.0 Driver.Packet 3.6, Driver.EndSubmission 0.3
queue worker 0x20 19.8 (24 %) 63.1 (76 %) 0.2 0.4 Driver.Packet 41.3, Driver.EndSubmission 0.1
queue worker 0x0 53.4 (64 %) 28.8 (35 %) 0.9 4.1 Driver.Packet 76.5, Driver.Suspend 0.0
draw committer 18.2 (22 %) 3.2 (4 %) 61.7 0.2 Graphics.Draw 20.7, Recorder.Submit 0.1
title 6.4 (8 %) 0.1 (0 %) 76.6 0.0 Shader.ResolveAbi 2.8, Shader.ResolveGraphicsStagesAbi 2.3
presenter 1.5 (2 %) 3.5 (4 %) 78.1 0.1 VideoOut.Flip 5.0, Driver.Present 0.0
title 6.1 (7 %) 0.1 (0 %) 76.9 0.0 Shader.ResolveAbi 2.7, Shader.ResolveGraphicsStagesAbi 2.5
title 6.3 (8 %) 0.2 (0 %) 76.6 0.0 Shader.ResolveAbi 2.7, Shader.ResolveGraphicsStagesAbi 2.5
title 5.3 (6 %) 0.1 (0 %) 77.6 0.0 Shader.ResolveGraphicsStagesAbi 2.5, Shader.ResolveAbi 1.7
title 5.3 (6 %) 0.3 (0 %) 77.5 0.0 Shader.ResolveAbi 2.3, Shader.ResolveGraphicsStagesAbi 2.0
queue worker 0x28 0.3 (0 %) 82.6 (99 %) 0.3 0.0 Driver.Packet 7.6, Driver.EndSubmission 0.4
gpu 31.0 (37 %) 0.0 (0 %) 52.1 0.0 batch 31.0

Largest slices (ms per frame, inclusive, all threads): Driver.WorkerWait 201.0, Driver.Packet 128.9, Driver.WorkerWait.idle_and_completion_poll 122.3, Driver.WorkerWait.dequeue_order 78.7, Driver.Packet.dispatch 72.6, Driver.Dispatch 58.9, Vulkan.Dispatch 45.9, Vulkan.Dispatch.shader_resources 45.8, Driver.Packet.memory_wait 44.8, batch 31.0

Longest waits

  • Driver.WorkerWait (queue worker 0x38) 430.4 ms at 43347 ms, present 1230
  • Driver.WorkerWait (queue worker 0x28) 407.7 ms at 43372 ms, present 1230
  • Driver.WorkerWait (queue worker 0x38) 392.0 ms at 66198 ms, present 1501
  • Driver.WorkerWait (queue worker 0x28) 369.0 ms at 66222 ms, present 1501
  • Driver.WorkerWait (queue worker 0x38) 327.8 ms at 45847 ms, present 1248
  • Driver.WorkerWait (queue worker 0x38) 306.0 ms at 66863 ms, present 1503
  • Driver.WorkerWait (queue worker 0x28) 294.7 ms at 45882 ms, present 1248
  • Driver.WorkerWait (queue worker 0x38) 289.9 ms at 52344 ms, present 1295
  • Driver.WorkerWait (queue worker 0x28) 270.0 ms at 66902 ms, present 1503
  • Driver.WorkerWait (queue worker 0x28) 264.8 ms at 52371 ms, present 1295

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

  • batch 16816: 19.3 ms at 56071 ms, present 1323: GPU no ranges; recorded by Driver.Packet (queue worker 0x0) 34.8, Driver.Packet.dispatch (queue worker 0x0) 34.8, Driver.Dispatch (queue worker 0x0) 9.9, Vulkan.Dispatch (queue worker 0x0) 9.7
  • batch 13614: 19.0 ms at 45670 ms, present 1246: GPU no ranges; recorded by Driver.Packet (queue worker 0x0) 33.9, Driver.Packet.dispatch (queue worker 0x0) 33.7, Driver.Dispatch (queue worker 0x0) 9.9, Vulkan.Dispatch (queue worker 0x0) 9.8
  • batch 1055: 18.0 ms at 4854 ms, present 719: GPU no ranges; recorded by Vulkan.Dispatch.shader_resources (queue worker 0x0) 22.7, Recorder.Sync (queue worker 0x0) 18.1, Driver.Packet (queue worker 0x0) 6.4, Driver.Packet.dispatch (queue worker 0x0) 6.4
  • batch 958: 17.6 ms at 4391 ms, present 715: GPU no ranges; recorded by Vulkan.Dispatch.shader_resources (queue worker 0x0) 22.1, Recorder.Sync (queue worker 0x0) 17.8, Driver.Packet (queue worker 0x0) 6.3, Driver.Packet.dispatch (queue worker 0x0) 6.3
  • batch 13833: 16.7 ms at 46630 ms, present 1251: GPU no ranges; recorded by Recorder.Sync (queue worker 0x0) 16.9, Driver.Packet (queue worker 0x0) 7.8, Driver.Packet.dispatch (queue worker 0x0) 7.8, Driver.Dispatch (queue worker 0x0) 7.8
python3 tools/trace_digest.py aps5-trace-7d85b4041817-2936462.json.gz (change 2)

seconds 40:70 from present 691: 854 presents, frame p50 66.9 / p90 130.4 / p99 260.8 / max 491.2 ms, GPU busy 30.5 ms per present
AMD Radeon RX 9070 XT (RADV GFX1201), radv Mesa 26.2.6-arch1.1, Linux 7.2.11-arch1-1, 3840x2160, commit 7d85b4041817, dropped: no

{"commit":"7d85b4041817","dirty":null,"env":{"APS5_LOG_TIMESTAMPS":"1","APS5_PAD_INPUT_FILE":"<path>","APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"40:70"},"gpu":"AMD Radeon RX 9070 XT (RADV GFX1201)","driver":"radv Mesa 26.2.6-arch1.1","os":"Linux 7.2.11-arch1-1","cpu":"AMD Ryzen 7 9800X3D 8-Core Processor","cpu_threads":8,"memory_mib":31192,"title_id":"PPSA02530","title":"PRAGMATA","content_version":"01.200.000","resolution":"3840x2160","window":{"spec":"seconds 40:70","first_present":691,"ms":70065.0},"presents":854,"frame_ms":{"p50":66.879,"p90":130.36,"p99":260.805,"max":491.208},"gpu_busy_ms_per_present":30.519,"worker_busy_pct":{"queue worker 0x38":4.371,"queue worker 0x20":49.044,"queue worker 0x0":92.877,"queue worker 0x28":9.525},"top_phases_ms_per_frame":{"Driver.Packet":126.893,"Driver.Packet.dispatch":71.387,"Driver.Dispatch":57.704,"Vulkan.Dispatch":45.403,"Vulkan.Dispatch.shader_resources":45.164,"Driver.Packet.memory_wait":44.286,"Recorder.Sync":29.876,"Shader.ResolveAbi":23.647},"trace_dropped":false,"trace":"aps5-trace-7d85b4041817-2936462.json.gz"}

Slowest frames (largest slices inside each, inclusive)

  • present 1531: 491.2 ms at 66760 ms: Driver.WorkerWait (queue worker 0x38) 438.3, Driver.WorkerWait.dequeue_order (queue worker 0x38) 438.3, Driver.Packet (queue worker 0x0) 435.8, Driver.WorkerWait (queue worker 0x28) 390.1
  • present 1268: 436.3 ms at 45889 ms: Driver.WorkerWait (queue worker 0x38) 401.2, Driver.WorkerWait.dequeue_order (queue worker 0x38) 401.2, Driver.Packet (queue worker 0x0) 398.8, Driver.WorkerWait (queue worker 0x28) 372.4
  • present 1533: 394.2 ms at 67500 ms: Driver.WorkerWait (queue worker 0x38) 352.3, Driver.WorkerWait.dequeue_order (queue worker 0x38) 352.3, Driver.Packet (queue worker 0x0) 350.0, Driver.WorkerWait (queue worker 0x28) 313.9
  • present 1305: 341.9 ms at 50808 ms: Driver.WorkerWait (queue worker 0x38) 300.3, Driver.WorkerWait.dequeue_order (queue worker 0x38) 300.3, Driver.Packet (queue worker 0x20) 299.3, Driver.Packet (queue worker 0x0) 298.6
  • present 1138: 317.7 ms at 34266 ms: Shader.PrepareArtifact (shader prepare) 791.1, Driver.WorkerWait (queue worker 0x28) 286.5, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x28) 286.5, Driver.WorkerWait (queue worker 0x38) 280.1

Threads (ms per frame)

thread busy wait untraced in slices < 20 us largest
shader prepare 0.8 (1 %) 0.0 (0 %) 81.3 0.0 Shader.PrepareArtifact 0.8
shader prepare 0.8 (1 %) 0.0 (0 %) 81.2 0.0 Shader.PrepareArtifact 0.8
shader prepare 0.8 (1 %) 0.0 (0 %) 81.2 0.0 Shader.PrepareArtifact 0.8
shader prepare 0.8 (1 %) 0.0 (0 %) 81.2 0.0 Shader.PrepareArtifact 0.8
shader prepare 0.2 (0 %) 0.0 (0 %) 81.9 0.0 Vulkan.GraphicsPipelinePrebuild 0.2, Vulkan.ComputePipeline 0.0
shader prepare 0.2 (0 %) 0.0 (0 %) 81.9 0.0 Vulkan.GraphicsPipelinePrebuild 0.2, Vulkan.ComputePipeline 0.0
shader prepare 0.1 (0 %) 0.0 (0 %) 81.9 0.0 Vulkan.GraphicsPipelinePrebuild 0.1, Vulkan.ComputePipeline 0.0
shader prepare 0.2 (0 %) 0.0 (0 %) 81.9 0.0 Vulkan.GraphicsPipelinePrebuild 0.2, Vulkan.ComputePipeline 0.0
title 6.6 (8 %) 0.2 (0 %) 75.3 0.0 Shader.ResolveAbi 3.1, Shader.ResolveGraphicsStagesAbi 2.2
title 8.2 (10 %) 0.1 (0 %) 73.7 0.0 Shader.ResolveAbi 4.6, Shader.ResolveGraphicsStagesAbi 2.4
queue worker 0x38 3.3 (4 %) 78.5 (96 %) 0.2 0.0 Driver.Packet 3.2, Driver.EndSubmission 0.3
queue worker 0x20 19.4 (24 %) 62.4 (76 %) 0.2 0.4 Driver.Packet 40.0, Driver.EndSubmission 0.1
queue worker 0x0 52.5 (64 %) 28.6 (35 %) 0.9 4.0 Driver.Packet 75.5, Driver.Suspend 0.0
title 5.6 (7 %) 0.1 (0 %) 76.4 0.0 Shader.ResolveGraphicsStagesAbi 2.5, Shader.ResolveAbi 2.0
draw committer 18.0 (22 %) 3.2 (4 %) 60.9 0.2 Graphics.Draw 20.5, Recorder.Submit 0.1
title 4.8 (6 %) 0.2 (0 %) 77.1 0.0 Shader.ResolveAbi 2.0, Shader.ResolveGraphicsStagesAbi 1.7
presenter 1.5 (2 %) 3.4 (4 %) 77.2 0.1 VideoOut.Flip 4.8, Driver.Present 0.0
title 7.5 (9 %) 0.2 (0 %) 74.3 0.0 Shader.ResolveAbi 3.3, Shader.ResolveGraphicsStagesAbi 2.8
title 6.8 (8 %) 0.1 (0 %) 75.1 0.0 Shader.ResolveAbi 2.8, Shader.ResolveGraphicsStagesAbi 2.5
title 4.8 (6 %) 0.2 (0 %) 77.0 0.0 Shader.ResolveAbi 2.1, Shader.ResolveGraphicsStagesAbi 1.8
title 7.9 (10 %) 0.2 (0 %) 73.9 0.0 Shader.ResolveAbi 3.6, Shader.ResolveGraphicsStagesAbi 2.9
queue worker 0x28 0.2 (0 %) 81.6 (99 %) 0.2 0.0 Driver.Packet 7.3, Driver.EndSubmission 0.5
gpu 30.6 (37 %) 0.0 (0 %) 51.5 0.0 batch 30.6

Largest slices (ms per frame, inclusive, all threads): Driver.WorkerWait 199.5, Driver.Packet 126.1, Driver.WorkerWait.idle_and_completion_poll 121.8, Driver.WorkerWait.dequeue_order 77.7, Driver.Packet.dispatch 71.1, Driver.Dispatch 57.4, Vulkan.Dispatch 45.1, Vulkan.Dispatch.shader_resources 45.0, Driver.Packet.memory_wait 44.3, batch 30.6

Longest waits

  • Driver.WorkerWait (queue worker 0x38) 438.3 ms at 66813 ms, present 1531
  • Driver.WorkerWait (queue worker 0x38) 401.2 ms at 45924 ms, present 1268
  • Driver.WorkerWait (queue worker 0x28) 389.9 ms at 66862 ms, present 1531
  • Driver.WorkerWait (queue worker 0x28) 372.5 ms at 45954 ms, present 1268
  • Driver.WorkerWait (queue worker 0x38) 352.2 ms at 67543 ms, present 1533
  • Driver.WorkerWait (queue worker 0x28) 313.1 ms at 67583 ms, present 1533
  • Driver.WorkerWait (queue worker 0x28) 306.3 ms at 34165 ms, present 1137
  • Driver.WorkerWait (queue worker 0x38) 300.3 ms at 50850 ms, present 1305
  • Driver.WorkerWait (queue worker 0x38) 280.1 ms at 34303 ms, present 1138
  • Driver.WorkerWait (queue worker 0x28) 272.9 ms at 50879 ms, present 1305

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

  • batch 9671: 19.5 ms at 31283 ms, present 1106: GPU no ranges; recorded by Vulkan.Dispatch.shader_resources (queue worker 0x0) 37.0, Recorder.Sync (queue worker 0x0) 22.8, Driver.Packet (queue worker 0x0) 19.5, Driver.Packet.dispatch (queue worker 0x0) 19.5
  • batch 10621: 18.7 ms at 35260 ms, present 1146: GPU no ranges; recorded by Vulkan.Dispatch.shader_resources (queue worker 0x0) 22.9, Recorder.Sync (queue worker 0x0) 18.8, Driver.Packet (queue worker 0x0) 6.5, Driver.Packet.dispatch (queue worker 0x0) 6.5
  • batch 19487: 18.2 ms at 65133 ms, present 1510: GPU no ranges; recorded by Recorder.Sync (queue worker 0x0) 18.4, Driver.Packet (queue worker 0x0) 7.2, Driver.Packet.dispatch (queue worker 0x0) 7.2, Driver.Dispatch (queue worker 0x0) 7.2
  • batch 11410: 18.2 ms at 38288 ms, present 1180: GPU no ranges; recorded by Vulkan.Dispatch.shader_resources (queue worker 0x0) 22.3, Recorder.Sync (queue worker 0x0) 18.3, Driver.Packet (queue worker 0x0) 6.4, Driver.Packet.dispatch (queue worker 0x0) 6.4
  • batch 19561: 17.5 ms at 65538 ms, present 1514: GPU no ranges; recorded by Vulkan.Dispatch.shader_resources (queue worker 0x0) 22.2, Recorder.Sync (queue worker 0x0) 17.6, Driver.Packet (queue worker 0x0) 6.4, Driver.Packet.dispatch (queue worker 0x0) 6.4

The earlier memory runs (main 8f55414024 + the same stack + a mallinfo2() print every 10 s, malloc in use; the fix arm was 86e0294bd2):

run malloc in use at 80 / 130 / 180 s peak RssAnon+VmSwap shader cache totals title shown
base 14224 / 19787 / 19899 MiB 20104 MiB 19566 hits, 0 misses, 0 writes 144 s
base, APS5_PROFILE_DRAW=1 13238 / 19086 / 19788 MiB 20333 MiB 19565 hits, 0 misses, 0 writes 151 s
this change 8388 / 11210 / 12161 MiB 12752 MiB 19572 hits, 3012 misses, 3012 writes 193 s
this change, APS5_PROFILE_DRAW=1 9079 / 11591 / 12004 MiB 12197 MiB 22584 hits, 0 misses, 0 writes 152 s
base, APS5_REGISTRATION_PREPARE_COMMIT_GB=0 14931 / 19565 / 19963 MiB 21389 MiB 14750 hits, 0 misses, 0 writes 144 s
this change, APS5_REGISTRATION_PREPARE_COMMIT_GB=0 8857 / 10641 / 10696 MiB 11815 MiB 12812 hits, 0 misses, 0 writes 143 s

Where the 3012 misses come from (first run of this change).

  • None of them are reloads: every reload in the profiled run was a disk hit.
  • In the base, private memory reaches the registration preparation budget of #9626 (half of physical memory) at 92–94 s: process private memory reached the registered shader preparation budget. Later registrations are then left for their first use.
  • With this change the process stays well under that budget, so registration preparation keeps going. It prepared 3012 registered shaders that the base never prepares, which is why they were not in the cache seed.
  • The profiled run of this change started from the cache that run had filled: 0 misses, and the title at 152 s against 151 s for the profiled base.
  • The rows with registration preparation off isolate the plan budget.

From the profiled run of this change:

  • Reloads and evictions come in bursts, for example 74 reloaded, 3327 evicted; 1070 plans held, 3056.0 MiB of a 3899.0 MiB budget.
  • The held bytes stayed under the 3899 MiB budget.

VmRSS still peaks at 23–25 GiB in both arms, because the shader disk cache maps 6–9 GiB of entries (RssFile). Those are clean file pages and are not part of this change.

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
  • No unimplemented paths added
  • No notes, investigation .md files or images added to the repository
  • No new third-party code
  • Generic behavior, not specific to one title
  • Depends on: none
  • Fixes: none (related: #6139, #6178, #9626)
  • Unblocks: none
  • GPUs tested: AMD Radeon RX 9070 XT (RADV, Mesa 26.2.6)
  • AI-assisted: yes (Claude Code)
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5106550255 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/14367). Originally posted by [hugodearaujo](https://github.com/hugodearaujo) on 2026-11-01T10:37:51Z. --- ### What Every shader the title draws keeps its resource plan (`IrResourcePlan`) in its `SourceEntry`, and the source table in `getSource` is never trimmed. #6178 drops plans only for registered shaders that were never captured, so the plan of every shader that was drawn once stays resident for the rest of the run. In PRAGMATA (PPSA02530) with a warm shader cache, process-private memory goes from ~5 GiB at 10 s to ~20 GiB by 130 s. A diagnostic build counted the cause: the value arrays of the resident plans alone are 9 GiB of 19.7 GiB of `malloc` in use (6961 plans). Free memory inside the malloc arenas stays at 0.3–0.5 GiB, so this is live data, not fragmentation. This change adds an opt-in byte budget for resident plans. It is off unless `APS5_RESOURCE_PLAN_MB` sets one, so by default every plan stays resident as on `main`: - **Plan key:** `SourceEntry` keeps the disk cache key its plan was loaded or stored under, and the shader hash it was loaded with. A dropped plan reloads straight from that entry, in `acquirePlan` under the source's mutex. The reload does not look the source up again by the current request, so it reads the same file. - It writes only when the entry is not on disk (a failed write or a file removed from outside). It then rebuilds the plan from the current request and stores it under the same key. - That key is the one the current request would build anyway: `getSource` keys a source on `RecompileCacheKey::Build` plus the host subgroup size and matches the code word for word, and `BuildPlanKey` adds only the format constants and the switch key to those fields. - **Accounting:** each resident plan's bytes are counted when it is loaded or built (`resourcePlanBytes`). The count covers the `IrValue` array, the operand and use lists of each value, the blocks, the plan's vectors and its compact form. - **Eviction:** once the held bytes pass the budget, the least recently used plans are dropped, oldest first, until the held bytes are at three quarters of the budget. - The trim groups the sources by plan object, because the disk cache's shared plan table (#10496) hands one object to every source whose entry has the same payload. A plan is dropped from all its sources at once, and only when every reference to it is one of those sources (`use_count()` equals the group size). A group is ordered by its most recent use. - A capture, a caller, a prepared invocation or a queued disk write using the plan keeps it. A queued write holds the plan until the writer has written it, so a plan is never dropped before its entry is on disk. - A plan is dropped only when disk plans are enabled and its key is known. - The trim takes each source's mutex with `try_lock` and runs only from the public entry points, after the plan was acquired and no recompiler lock is held: `GetResourcePlan`, both `CaptureResources`, `PreparedShaderInvocation::Capture` and `PrepareShader`. - When a trim could not get under the budget, the next one waits until the held bytes grow by another eighth of the budget, so a set of shared plans cannot make every capture scan the table. - **Budget:** - It is off by default. `APS5_RESOURCE_PLAN_MB` sets it in MiB, and `0` (the default) keeps every plan, as on `main`. A default can be picked once paired runs in several titles show how often evicted plans reload and what that costs in frame time. - With the budget off, nothing is evicted. What still runs is the accounting (a few atomic counters per plan) and the stored plan key: a plan that #6178's `releaseUndrawnPlan` drops reloads from that key in `acquirePlan`, instead of going through `getSource` again. Both read the same disk entry. - The variable is documented in `docs/dev/ENVIRONMENT.md` and listed in the shader disk cache's neutral switches, because it only decides how long a plan stays in memory, never what a compile produces. - Until `47e2440ed3`, the budget was on by default, sized from physical memory: an eighth of it, between 1 and 8 GiB. That default was removed in review. The runs below used it: 3899 MiB on this host, which is now `APS5_RESOURCE_PLAN_MB=3899`. - **Profile line:** with `APS5_PROFILE_DRAW`, the result memo report adds a line `[recompile] resource plans (10 s): N reloaded, M evicted; K plans held, X MiB of a Y MiB budget`. The interval comes from `TakeResourcePlanInterval`, which reads the counters and updates the reported counts under one mutex, so overlapping reporters cannot count an interval twice or underflow. - **Release path:** `releaseUndrawnPlan` now goes through the same accounting, and the dropped plan is destroyed outside the source's mutex. Not covered: a plan shared by several sources is counted once per source that holds it, so while it is shared the held bytes are higher than the memory it uses. In PRAGMATA only 8–20 resident plans had another owner at any time. ### Tested Arch Linux (kernel 7.2.11), Ryzen 7 9800X3D, 31 GiB RAM with zram swap, RX 9070 XT (RADV, Mesa 26.2.6), GCC 16.2.1, Release. Head `3a86c44a46`. Merge base `main` 26fa1212b8. The head still merges cleanly with `main` 926f7dd492. - **Since `47e2440ed3`** (the budget off by default, from review), merged locally with `main` 118d39300d, kernel 7.2.14. The later `main` 1d7582cea6 changes only `.github/workflows/build.yml`. - The 62 `^shader|^agc_shader` tests pass with `VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation`, `ANYPS5_NO_SHADER_CACHE=1` and `ANYPS5_REQUIRE_VULKAN=1`, `agc_shader_disk_cache` (all four budget checks above) included. The loader inserted the layer, and the log has no `VUID-` line and no `was not found but was requested`. - `tools/check_conventions.py --base 1d7582cea6` and `git diff --check` pass. - The checks below set the budget with `SetResourcePlanBudget`, so they don't depend on the default. - **Check `verifyPlanBudget` in `agc_shader_disk_cache`:** - Four plans are loaded and their bytes are accounted. - A budget is set so that three quarters of it fits only the two most recently used plans. The trim drops exactly the two least recently used plans, and a plan used just before the trim stays resident. - An evicted plan reloads as one disk plan hit, with no miss and no write, and encodes the same as before. - With a one-byte budget, plans held by the test are not evicted and come back as the same object. - A prepared shader's captured plan, evicted and captured again through `PreparedShaderInvocation` with a relocated push layout, reloads from its own disk cache entry with no miss and no write. - **Check `verifySharedPlanBudget`:** - Two sources (the same code address, code that differs only in a leading `s_nop`) reload one plan object from two disk entries. - While a caller holds the plan, a one-byte budget keeps it. - Once the caller lets go, a one-byte budget evicts it from both sources (two evictions, two fewer held plans). - The plan then reloads as two disk hits with no miss and no write, shared again, and encodes as before. - **Check `verifyQueuedPlanWrite`:** - 4096 plan writes are queued ahead of a new plan's write, and the budget is trimmed to one byte while that write is still pending (checked with `planWrites`). - The plan stays resident, with no miss and no reload on its next use. - After `Flush()` it is evicted and reloads as one disk hit with no miss and no write. - **Check `verifyPlanReport`:** - A test hook (`SetResourcePlanReportHook`) runs inside an admitted reporter after it has read the counters. - The hook evicts and reloads a plan, starts a second reporter and waits up to 250 ms for it. - The two intervals add up to exactly the evictions and the reload, neither is larger than that total, and the next interval is empty. - **Red/green:** - Sorting the trim newest first fails with `a recently used plan was evicted`. - Letting the trim ignore the other references fails with `a budget of one byte did not evict the unowned plans or evicted the owned ones`. - The previous trim (one plan per source, `use_count() == 1`) fails with `shared plan budget: a plan shared by two idle sources was not evicted from both`. - A trim that ignores one extra reference (`use_count() > owners + 1`) fails 5 of 5 with `queued plan write: a plan whose disk write was still queued was evicted and missed on its next use`. The earlier budget checks were disabled for that run, because they catch the same mutation first. Without the mutation the check passed 20 of 20 runs. - Removing the mutex from `TakeResourcePlanInterval` fails 5 of 5 with `plan report: a reporter delayed past the next interval counted it twice or underflowed`. - **Paired run of the touched set on `main` 26fa1212b8 and on `3a86c44a46`:** - Set: `agc_shader_disk_cache*`, `agc_driver_prepared_shaders*`, `agc_shader_result_memo_budget*` and `agc_shader_memory`. - Each test ran with its CTest arguments, environment and working directory, plus `VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation`, `ANYPS5_NO_SHADER_CACHE=1` and `ANYPS5_REQUIRE_VULKAN=1`. - The loader debug output shows `Insert instance layer "VK_LAYER_KHRONOS_validation"` 51 times in each run, with no `was not found but was requested` line. - Both runs pass 30 of 30 (`agc_driver_prepared_shaders_debug_failure` is a `WILL_FAIL` test) with no `VUID-` lines. - `python3 tools/check_conventions.py --base origin/main` and `git diff --check` pass. ### Performance (PRAGMATA, PPSA02530, 01.200.000) These runs predate `47e2440ed3`: the change arm ran with the budget on, at 3899 MiB (now `APS5_RESOURCE_PLAN_MB=3899`). **Route.** This is the route of the memory runs below: boot to the title, no input before the title shows (Cross only after it, by a screenshot match). The capture is `APS5_TRACE_SECONDS=40:70`, 40 to 110 s after the first present, with no other trace or profile switch. In the profiled run of the change, that window holds three eviction bursts: 1512, 2908 and 603 evictions, and 258 reloads. **Builds.** Both arms are the title's integration stack: #10935 `895e0341d9`, #10304 `31f895cb59`, #10497 `218dce3ad3`, #12898 `d2d43310ad`, #4449 `88b99b28b6`, #9999 `d72cc8ca6a` and #11580 `fedf3e91a7`, each merged with `--no-ff`. It is the same stack as the memory runs below, without their `mallinfo2()` print: no diagnostics in either build. - base: `0510c350a6` = `main` 26fa1212b8 + the stack. - change: `7d85b40418` = this head `3a86c44a46` + the same stack. **Caches.** The change's shader cache source version was pinned to the base's (`38d10bea705877c0`), so both read the same cache. This change does not alter compiled output. - The cache was filled by a 1000 s run of the base, from empty to gameplay, and a 400 s run of the change on top. The change prepares registered shaders the base leaves for first use. - Before every run, the same snapshot of the pipeline journal, the Vulkan pipeline cache (`shader_cache/driver`) and the save was restored. Then the arms ran alternated: base, change, base, change. - `dirty` is `null` in the lines: `git status` fails in that build tree, whose submodules are symlinks. The tracked sources had no changes (`git status --ignore-submodules` was empty). | run | presents | frame p50 / p90 / p99 / max (ms) | GPU busy per present | RssAnon+VmSwap at 80 / 130 / 180 s, peak (MiB) | shader cache totals | title shown | |---|---|---|---|---|---|---| | base 1 | 825 | 66.8 / 136.3 / 353.3 / 730.7 | 30.9 ms | 11897 / 18155 / 18367, 18368 | 19575 hits, 0 misses | 132 s | | change 1 | 839 | 66.4 / 134.1 / 273.9 / 545.5 | 30.5 ms | 6954 / 10022 / 10772, 11682 | 22584 hits, 2 misses, 2 writes | 132 s | | base 2 | 843 | 66.5 / 133.1 / 241.5 / 494.5 | 31.0 ms | 11842 / 17651 / 18460, 18551 | 19575 hits, 0 misses | 182 s | | change 2 | 854 | 66.9 / 130.4 / 260.8 / 491.2 | 30.5 ms | 6971 / 10037 / 10835, 11709 | 22586 hits, 0 misses | 132 s | - Memory is sampled from `/proc/<pid>/status` every 2 s; the sampling stops the title at 200 s. "Title shown" is the first 8 s screenshot that matches the title, so it is coarse. - Frame times in the window are within run-to-run spread: p50 66.4–66.9 ms in all four runs. Mean frame time is −1.4 and −1.1 ms, and GPU busy per present is −0.4 and −0.5 ms (`tools/performance_compare.py`, pair 1 and pair 2). - Both base runs print `process private memory reached the registered shader preparation budget` at ~109 s (#9626). The change runs do not, which is why they have ~3000 more cache hits. - Profiled runs (`APS5_PROFILE_DRAW=1`, not traced) peak at 18470 MiB (base) and 10932 MiB (change). The held plan bytes stayed under the 3899 MiB budget (largest: 3802.0 MiB). Summary lines (base 1, change 1, base 2, change 2): ```json {"commit":"0510c350a6f5","dirty":null,"env":{"APS5_LOG_TIMESTAMPS":"1","APS5_PAD_INPUT_FILE":"<path>","APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"40:70"},"gpu":"AMD Radeon RX 9070 XT (RADV GFX1201)","driver":"radv Mesa 26.2.6-arch1.1","os":"Linux 7.2.11-arch1-1","cpu":"AMD Ryzen 7 9800X3D 8-Core Processor","cpu_threads":8,"memory_mib":31192,"title_id":"PPSA02530","title":"PRAGMATA","content_version":"01.200.000","resolution":"3840x2160","window":{"spec":"seconds 40:70","first_present":674,"ms":70057.488},"presents":825,"frame_ms":{"p50":66.777,"p90":136.298,"p99":353.265,"max":730.722},"gpu_busy_ms_per_present":30.947,"worker_busy_pct":{"queue worker 0x38":5.732,"queue worker 0x20":50.267,"queue worker 0x0":91.552,"queue worker 0x28":11.820},"top_phases_ms_per_frame":{"Driver.Packet":134.414,"Driver.Packet.dispatch":74.658,"Driver.Dispatch":60.668,"Driver.Packet.memory_wait":48.115,"Vulkan.Dispatch":47.985,"Vulkan.Dispatch.shader_resources":47.742,"Recorder.Sync":30.161,"Shader.ResolveAbi":24.407},"trace_dropped":false,"trace":"aps5-trace-0510c350a6f5-2831162.json.gz"} {"commit":"7d85b4041817","dirty":null,"env":{"APS5_LOG_TIMESTAMPS":"1","APS5_PAD_INPUT_FILE":"<path>","APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"40:70"},"gpu":"AMD Radeon RX 9070 XT (RADV GFX1201)","driver":"radv Mesa 26.2.6-arch1.1","os":"Linux 7.2.11-arch1-1","cpu":"AMD Ryzen 7 9800X3D 8-Core Processor","cpu_threads":8,"memory_mib":31192,"title_id":"PPSA02530","title":"PRAGMATA","content_version":"01.200.000","resolution":"3840x2160","window":{"spec":"seconds 40:70","first_present":686,"ms":70074.346},"presents":839,"frame_ms":{"p50":66.445,"p90":134.149,"p99":273.889,"max":545.474},"gpu_busy_ms_per_present":30.527,"worker_busy_pct":{"queue worker 0x38":4.852,"queue worker 0x20":49.880,"queue worker 0x0":92.562,"queue worker 0x28":10.375},"top_phases_ms_per_frame":{"Driver.Packet":130.782,"Driver.Packet.dispatch":73.432,"Driver.Dispatch":59.783,"Vulkan.Dispatch":45.826,"Vulkan.Dispatch.shader_resources":45.562,"Driver.Packet.memory_wait":45.476,"Recorder.Sync":29.496,"Shader.ResolveAbi":23.188},"trace_dropped":false,"trace":"aps5-trace-7d85b4041817-2855161.json.gz"} {"commit":"0510c350a6f5","dirty":null,"env":{"APS5_LOG_TIMESTAMPS":"1","APS5_PAD_INPUT_FILE":"<path>","APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"40:70"},"gpu":"AMD Radeon RX 9070 XT (RADV GFX1201)","driver":"radv Mesa 26.2.6-arch1.1","os":"Linux 7.2.11-arch1-1","cpu":"AMD Ryzen 7 9800X3D 8-Core Processor","cpu_threads":8,"memory_mib":31192,"title_id":"PPSA02530","title":"PRAGMATA","content_version":"01.200.000","resolution":"3840x2160","window":{"spec":"seconds 40:70","first_present":676,"ms":70074.229},"presents":843,"frame_ms":{"p50":66.507,"p90":133.064,"p99":241.478,"max":494.477},"gpu_busy_ms_per_present":30.980,"worker_busy_pct":{"queue worker 0x38":4.625,"queue worker 0x20":49.946,"queue worker 0x0":92.868,"queue worker 0x28":9.739},"top_phases_ms_per_frame":{"Driver.Packet":129.751,"Driver.Packet.dispatch":72.922,"Driver.Dispatch":59.262,"Vulkan.Dispatch":46.215,"Vulkan.Dispatch.shader_resources":45.975,"Driver.Packet.memory_wait":44.836,"Recorder.Sync":29.920,"Graphics.Draw":21.692},"trace_dropped":false,"trace":"aps5-trace-0510c350a6f5-2879961.json.gz"} {"commit":"7d85b4041817","dirty":null,"env":{"APS5_LOG_TIMESTAMPS":"1","APS5_PAD_INPUT_FILE":"<path>","APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"40:70"},"gpu":"AMD Radeon RX 9070 XT (RADV GFX1201)","driver":"radv Mesa 26.2.6-arch1.1","os":"Linux 7.2.11-arch1-1","cpu":"AMD Ryzen 7 9800X3D 8-Core Processor","cpu_threads":8,"memory_mib":31192,"title_id":"PPSA02530","title":"PRAGMATA","content_version":"01.200.000","resolution":"3840x2160","window":{"spec":"seconds 40:70","first_present":691,"ms":70065.000},"presents":854,"frame_ms":{"p50":66.879,"p90":130.360,"p99":260.805,"max":491.208},"gpu_busy_ms_per_present":30.519,"worker_busy_pct":{"queue worker 0x38":4.371,"queue worker 0x20":49.044,"queue worker 0x0":92.877,"queue worker 0x28":9.525},"top_phases_ms_per_frame":{"Driver.Packet":126.893,"Driver.Packet.dispatch":71.387,"Driver.Dispatch":57.704,"Vulkan.Dispatch":45.403,"Vulkan.Dispatch.shader_resources":45.164,"Driver.Packet.memory_wait":44.286,"Recorder.Sync":29.876,"Shader.ResolveAbi":23.647},"trace_dropped":false,"trace":"aps5-trace-7d85b4041817-2936462.json.gz"} ``` Traces: base 1 [pr14367-pragmata-base-1.json.gz](https://github.com/hugodearaujo/AnyPS5/releases/download/pr-test-data-2026-11-02/pr14367-pragmata-base-1.json.gz), change 1 [pr14367-pragmata-change-1.json.gz](https://github.com/hugodearaujo/AnyPS5/releases/download/pr-test-data-2026-11-02/pr14367-pragmata-change-1.json.gz), base 2 [pr14367-pragmata-base-2.json.gz](https://github.com/hugodearaujo/AnyPS5/releases/download/pr-test-data-2026-11-02/pr14367-pragmata-base-2.json.gz), change 2 [pr14367-pragmata-change-2.json.gz](https://github.com/hugodearaujo/AnyPS5/releases/download/pr-test-data-2026-11-02/pr14367-pragmata-change-2.json.gz). <details><summary><code>python3 tools/trace_digest.py aps5-trace-0510c350a6f5-2831162.json.gz</code> (base 1)</summary> **seconds 40:70** from present 674: 825 presents, frame p50 66.8 / p90 136.3 / p99 353.3 / max 730.7 ms, GPU busy 30.9 ms per present AMD Radeon RX 9070 XT (RADV GFX1201), radv Mesa 26.2.6-arch1.1, Linux 7.2.11-arch1-1, 3840x2160, commit 0510c350a6f5, dropped: no ```json {"commit":"0510c350a6f5","dirty":null,"env":{"APS5_LOG_TIMESTAMPS":"1","APS5_PAD_INPUT_FILE":"<path>","APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"40:70"},"gpu":"AMD Radeon RX 9070 XT (RADV GFX1201)","driver":"radv Mesa 26.2.6-arch1.1","os":"Linux 7.2.11-arch1-1","cpu":"AMD Ryzen 7 9800X3D 8-Core Processor","cpu_threads":8,"memory_mib":31192,"title_id":"PPSA02530","title":"PRAGMATA","content_version":"01.200.000","resolution":"3840x2160","window":{"spec":"seconds 40:70","first_present":674,"ms":70057.488},"presents":825,"frame_ms":{"p50":66.777,"p90":136.298,"p99":353.265,"max":730.722},"gpu_busy_ms_per_present":30.947,"worker_busy_pct":{"queue worker 0x38":5.732,"queue worker 0x20":50.267,"queue worker 0x0":91.552,"queue worker 0x28":11.82},"top_phases_ms_per_frame":{"Driver.Packet":134.414,"Driver.Packet.dispatch":74.658,"Driver.Dispatch":60.668,"Driver.Packet.memory_wait":48.115,"Vulkan.Dispatch":47.985,"Vulkan.Dispatch.shader_resources":47.742,"Recorder.Sync":30.161,"Shader.ResolveAbi":24.407},"trace_dropped":false,"trace":"aps5-trace-0510c350a6f5-2831162.json.gz"} ``` **Slowest frames** (largest slices inside each, inclusive) - present 1238: 730.7 ms at 45210 ms: Driver.Packet (queue worker 0x20) 622.1, Driver.Packet.memory_wait (queue worker 0x20) 604.4, Driver.WorkerWait (queue worker 0x38) 486.9, Driver.WorkerWait.dequeue_order (queue worker 0x38) 486.9 - present 1237: 690.6 ms at 44520 ms: Shader.ResolveAbi (title) 1629.3, Shader.PrepareArtifact (title) 1611.2, Driver.Packet (queue worker 0x20) 629.8, Driver.Packet (queue worker 0x0) 587.6 - present 1241: 633.7 ms at 46331 ms: Driver.WorkerWait (queue worker 0x38) 586.9, Driver.WorkerWait.dequeue_order (queue worker 0x38) 586.9, Driver.Packet (queue worker 0x0) 584.4, Driver.WorkerWait (queue worker 0x28) 555.2 - present 1479: 502.5 ms at 65040 ms: Driver.WorkerWait (queue worker 0x38) 443.9, Driver.WorkerWait.dequeue_order (queue worker 0x38) 443.9, Driver.Packet (queue worker 0x0) 441.3, Driver.WorkerWait (queue worker 0x28) 419.6 - present 1265: 441.7 ms at 50245 ms: Driver.WorkerWait (queue worker 0x38) 404.9, Driver.WorkerWait.dequeue_order (queue worker 0x38) 404.9, Driver.WorkerWait (queue worker 0x28) 402.4, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x28) 402.4 **Threads** (ms per frame) | thread | busy | wait | untraced | in slices < 20 us | largest | |---|---|---|---|---|---| | shader prepare | 0.8 (1 %) | 0.0 (0 %) | 84.2 | 0.0 | Shader.PrepareArtifact 0.8 | | shader prepare | 0.8 (1 %) | 0.0 (0 %) | 84.1 | 0.0 | Shader.PrepareArtifact 0.8 | | shader prepare | 0.8 (1 %) | 0.0 (0 %) | 84.1 | 0.0 | Shader.PrepareArtifact 0.8 | | shader prepare | 0.8 (1 %) | 0.0 (0 %) | 84.1 | 0.0 | Shader.PrepareArtifact 0.8 | | shader prepare | 0.1 (0 %) | 0.0 (0 %) | 84.8 | 0.0 | Vulkan.GraphicsPipelinePrebuild 0.1, Vulkan.ComputePipeline 0.0 | | shader prepare | 0.1 (0 %) | 0.0 (0 %) | 84.8 | 0.0 | Vulkan.GraphicsPipelinePrebuild 0.1 | | shader prepare | 0.2 (0 %) | 0.0 (0 %) | 84.8 | 0.0 | Vulkan.GraphicsPipelinePrebuild 0.2, Vulkan.ComputePipeline 0.0 | | shader prepare | 0.2 (0 %) | 0.0 (0 %) | 84.8 | 0.0 | Vulkan.GraphicsPipelinePrebuild 0.1, Vulkan.ComputePipeline 0.0 | | title | 5.8 (7 %) | 0.3 (0 %) | 78.9 | 0.0 | Shader.ResolveAbi 3.0, Shader.ResolveGraphicsStagesAbi 1.8 | | title | 6.0 (7 %) | 0.1 (0 %) | 78.8 | 0.0 | Shader.ResolveAbi 3.1, Shader.ResolveGraphicsStagesAbi 2.0 | | title | 5.5 (6 %) | 0.4 (0 %) | 79.1 | 0.0 | Shader.ResolveAbi 2.3, Shader.ResolveGraphicsStagesAbi 2.3 | | title | 5.7 (7 %) | 0.1 (0 %) | 79.0 | 0.0 | Shader.ResolveAbi 2.9, Shader.ResolveGraphicsStagesAbi 2.0 | | queue worker 0x38 | 4.6 (5 %) | 80.0 (94 %) | 0.3 | 0.0 | Driver.Packet 4.6, Driver.EndSubmission 0.3 | | queue worker 0x20 | 19.4 (23 %) | 65.3 (77 %) | 0.2 | 0.4 | Driver.Packet 42.4, Driver.EndSubmission 0.2 | | queue worker 0x0 | 54.6 (64 %) | 29.4 (35 %) | 0.9 | 4.0 | Driver.Packet 77.0, Driver.Completion 0.0 | | draw committer | 18.4 (22 %) | 3.2 (4 %) | 63.3 | 0.2 | Graphics.Draw 20.9, Recorder.Submit 0.1 | | presenter | 1.5 (2 %) | 4.1 (5 %) | 79.4 | 0.1 | VideoOut.Flip 5.6, Driver.Present 0.0 | | title | 4.7 (6 %) | 0.1 (0 %) | 80.1 | 0.0 | Shader.ResolveAbi 2.8, Shader.ResolveGraphicsStagesAbi 1.4 | | title | 6.4 (8 %) | 0.2 (0 %) | 78.4 | 0.0 | Shader.ResolveAbi 3.0, Shader.ResolveGraphicsStagesAbi 2.2 | | title | 7.8 (9 %) | 0.2 (0 %) | 76.9 | 0.0 | Shader.ResolveAbi 4.6, Shader.ResolveGraphicsStagesAbi 2.0 | | title | 5.7 (7 %) | 0.2 (0 %) | 78.9 | 0.0 | Shader.ResolveAbi 2.7, Shader.ResolveGraphicsStagesAbi 2.1 | | queue worker 0x28 | 0.3 (0 %) | 84.4 (99 %) | 0.2 | 0.0 | Driver.Packet 9.6, Driver.EndSubmission 0.4 | | gpu | 31.0 (36 %) | 0.0 (0 %) | 54.0 | 0.0 | batch 31.0 | **Largest slices** (ms per frame, inclusive, all threads): Driver.WorkerWait 203.5, Driver.Packet 133.6, Driver.WorkerWait.idle_and_completion_poll 123.6, Driver.WorkerWait.dequeue_order 79.9, Driver.Packet.dispatch 74.4, Driver.Dispatch 60.3, Driver.Packet.memory_wait 48.1, Vulkan.Dispatch 47.7, Vulkan.Dispatch.shader_resources 47.5, batch 31.0 **Longest waits** - Driver.WorkerWait (queue worker 0x38) 586.9 ms at 46378 ms, present 1241 - Driver.WorkerWait (queue worker 0x38) 585.8 ms at 44624 ms, present 1237 - Driver.WorkerWait (queue worker 0x28) 554.8 ms at 46412 ms, present 1241 - Driver.WorkerWait (queue worker 0x38) 486.9 ms at 45454 ms, present 1238 - Driver.WorkerWait (queue worker 0x38) 443.9 ms at 65098 ms, present 1479 - Driver.WorkerWait (queue worker 0x28) 419.2 ms at 65124 ms, present 1479 - Driver.Packet.memory_wait (queue worker 0x20) 413.4 ms at 45213 ms, present 1238 - Driver.WorkerWait (queue worker 0x28) 407.8 ms at 45535 ms, present 1238 - Driver.WorkerWait (queue worker 0x38) 404.9 ms at 50282 ms, present 1265 - Driver.WorkerWait (queue worker 0x28) 401.7 ms at 50287 ms, present 1265 **Largest GPU batches** (GPU ranges inside, and the CPU slices that recorded each, inclusive) - batch 15807: 18.4 ms at 54813 ms, present 1298: GPU no ranges; recorded by Driver.Packet (queue worker 0x0) 30.7, Driver.Packet.dispatch (queue worker 0x0) 30.6, Driver.Dispatch (queue worker 0x0) 6.8, Vulkan.Dispatch (queue worker 0x0) 6.6 - batch 542: 17.2 ms at 2330 ms, present 696: GPU no ranges; recorded by Vulkan.Dispatch.shader_resources (queue worker 0x0) 21.6, Recorder.Sync (queue worker 0x0) 17.4, Driver.Packet (queue worker 0x0) 6.3, Driver.Packet.dispatch (queue worker 0x0) 6.3 - batch 157: 16.6 ms at 576 ms, present 680: GPU no ranges; recorded by Vulkan.Dispatch.shader_resources (queue worker 0x0) 28.6, Recorder.Sync (queue worker 0x0) 16.7, Driver.Packet (queue worker 0x0) 6.5, Driver.Packet.dispatch (queue worker 0x0) 6.5 - batch 9312: 16.2 ms at 30867 ms, present 1074: GPU no ranges; recorded by Vulkan.Dispatch.shader_resources (queue worker 0x0) 48.9, Recorder.Sync (queue worker 0x0) 16.9, Driver.Packet (queue worker 0x0) 8.9, Driver.Packet.dispatch (queue worker 0x0) 8.9 - batch 17125: 14.6 ms at 58766 ms, present 1376: GPU no ranges; recorded by Driver.Packet (queue worker 0x0) 25.9, Driver.Packet.dispatch (queue worker 0x0) 25.9, Driver.Dispatch (queue worker 0x0) 6.2, Vulkan.Dispatch (queue worker 0x0) 6.1 </details> <details><summary><code>python3 tools/trace_digest.py aps5-trace-7d85b4041817-2855161.json.gz</code> (change 1)</summary> **seconds 40:70** from present 686: 839 presents, frame p50 66.4 / p90 134.1 / p99 273.9 / max 545.5 ms, GPU busy 30.5 ms per present AMD Radeon RX 9070 XT (RADV GFX1201), radv Mesa 26.2.6-arch1.1, Linux 7.2.11-arch1-1, 3840x2160, commit 7d85b4041817, dropped: no ```json {"commit":"7d85b4041817","dirty":null,"env":{"APS5_LOG_TIMESTAMPS":"1","APS5_PAD_INPUT_FILE":"<path>","APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"40:70"},"gpu":"AMD Radeon RX 9070 XT (RADV GFX1201)","driver":"radv Mesa 26.2.6-arch1.1","os":"Linux 7.2.11-arch1-1","cpu":"AMD Ryzen 7 9800X3D 8-Core Processor","cpu_threads":8,"memory_mib":31192,"title_id":"PPSA02530","title":"PRAGMATA","content_version":"01.200.000","resolution":"3840x2160","window":{"spec":"seconds 40:70","first_present":686,"ms":70074.346},"presents":839,"frame_ms":{"p50":66.445,"p90":134.149,"p99":273.889,"max":545.474},"gpu_busy_ms_per_present":30.527,"worker_busy_pct":{"queue worker 0x38":4.852,"queue worker 0x20":49.88,"queue worker 0x0":92.562,"queue worker 0x28":10.375},"top_phases_ms_per_frame":{"Driver.Packet":130.782,"Driver.Packet.dispatch":73.432,"Driver.Dispatch":59.783,"Vulkan.Dispatch":45.826,"Vulkan.Dispatch.shader_resources":45.562,"Driver.Packet.memory_wait":45.476,"Recorder.Sync":29.496,"Shader.ResolveAbi":23.188},"trace_dropped":false,"trace":"aps5-trace-7d85b4041817-2855161.json.gz"} ``` **Slowest frames** (largest slices inside each, inclusive) - present 1220: 545.5 ms at 42523 ms: Driver.Packet (queue worker 0x20) 440.1, Driver.WorkerWait (queue worker 0x38) 433.4, Driver.WorkerWait.dequeue_order (queue worker 0x38) 433.4, Driver.Packet (queue worker 0x0) 430.9 - present 1513: 527.0 ms at 66900 ms: Driver.WorkerWait (queue worker 0x38) 445.9, Driver.WorkerWait.dequeue_order (queue worker 0x38) 445.9, Driver.Packet (queue worker 0x0) 443.1, Driver.WorkerWait (queue worker 0x28) 400.7 - present 1262: 365.6 ms at 48549 ms: Driver.Packet (queue worker 0x20) 319.6, Driver.WorkerWait (queue worker 0x38) 316.8, Driver.WorkerWait.dequeue_order (queue worker 0x38) 316.8, Driver.Packet (queue worker 0x0) 315.0 - present 1515: 336.7 ms at 67730 ms: Driver.WorkerWait (queue worker 0x38) 336.7, Driver.WorkerWait.dequeue_order (queue worker 0x38) 332.4, Driver.Packet (queue worker 0x0) 331.3, Driver.WorkerWait (queue worker 0x28) 304.6 - present 1521: 306.7 ms at 69094 ms: Driver.WorkerWait (queue worker 0x38) 264.7, Driver.WorkerWait.dequeue_order (queue worker 0x38) 264.7, Driver.Packet (queue worker 0x0) 263.2, Driver.Packet (queue worker 0x20) 232.2 **Threads** (ms per frame) | thread | busy | wait | untraced | in slices < 20 us | largest | |---|---|---|---|---|---| | shader prepare | 0.9 (1 %) | 0.0 (0 %) | 82.6 | 0.0 | Shader.PrepareArtifact 0.9 | | shader prepare | 0.8 (1 %) | 0.0 (0 %) | 82.7 | 0.0 | Shader.PrepareArtifact 0.8 | | shader prepare | 0.9 (1 %) | 0.0 (0 %) | 82.6 | 0.0 | Shader.PrepareArtifact 0.9 | | shader prepare | 1.0 (1 %) | 0.0 (0 %) | 82.5 | 0.0 | Shader.PrepareArtifact 1.0 | | shader prepare | 0.2 (0 %) | 0.0 (0 %) | 83.4 | 0.0 | Vulkan.GraphicsPipelinePrebuild 0.2, Vulkan.ComputePipeline 0.0 | | shader prepare | 0.1 (0 %) | 0.0 (0 %) | 83.4 | 0.0 | Vulkan.GraphicsPipelinePrebuild 0.1, Vulkan.ComputePipeline 0.0 | | shader prepare | 0.2 (0 %) | 0.0 (0 %) | 83.3 | 0.0 | Vulkan.GraphicsPipelinePrebuild 0.2 | | shader prepare | 0.1 (0 %) | 0.0 (0 %) | 83.4 | 0.0 | Vulkan.GraphicsPipelinePrebuild 0.1, Vulkan.ComputePipeline 0.0 | | title | 7.2 (9 %) | 0.2 (0 %) | 76.2 | 0.0 | Shader.ResolveGraphicsStagesAbi 2.9, Shader.ResolveAbi 2.9 | | queue worker 0x38 | 3.9 (5 %) | 79.3 (95 %) | 0.3 | 0.0 | Driver.Packet 3.8, Driver.EndSubmission 0.3 | | queue worker 0x20 | 20.0 (24 %) | 63.3 (76 %) | 0.2 | 0.4 | Driver.Packet 41.4, Driver.EndSubmission 0.1 | | queue worker 0x0 | 53.8 (64 %) | 28.7 (34 %) | 1.0 | 4.2 | Driver.Packet 76.6, Driver.Completion 0.0 | | title | 6.2 (7 %) | 0.2 (0 %) | 77.1 | 0.0 | Shader.ResolveAbi 2.5, Shader.ResolveGraphicsStagesAbi 2.5 | | draw committer | 18.4 (22 %) | 3.2 (4 %) | 61.9 | 0.2 | Graphics.Draw 20.9, Recorder.Submit 0.1 | | presenter | 1.5 (2 %) | 3.7 (4 %) | 78.4 | 0.1 | VideoOut.Flip 5.2, Driver.Present 0.0 | | title | 8.7 (10 %) | 0.2 (0 %) | 74.6 | 0.0 | Shader.ResolveGraphicsStagesAbi 3.6, Shader.ResolveAbi 3.4 | | title | 7.0 (8 %) | 0.3 (0 %) | 76.2 | 0.0 | Shader.ResolveAbi 3.5, Shader.ResolveGraphicsStagesAbi 2.2 | | title | 5.7 (7 %) | 0.3 (0 %) | 77.6 | 0.0 | Shader.ResolveAbi 2.6, Shader.ResolveGraphicsStagesAbi 2.1 | | title | 5.7 (7 %) | 0.3 (0 %) | 77.5 | 0.0 | Shader.ResolveAbi 2.4, Shader.ResolveGraphicsStagesAbi 2.0 | | title | 6.4 (8 %) | 0.2 (0 %) | 76.8 | 0.0 | Shader.ResolveAbi 3.2, Shader.ResolveGraphicsStagesAbi 2.1 | | title | 6.4 (8 %) | 0.1 (0 %) | 77.0 | 0.0 | Shader.ResolveAbi 2.7, Shader.ResolveGraphicsStagesAbi 2.5 | | queue worker 0x28 | 0.2 (0 %) | 83.0 (99 %) | 0.3 | 0.0 | Driver.Packet 8.2, Driver.EndSubmission 0.5 | | gpu | 30.6 (37 %) | 0.0 (0 %) | 53.0 | 0.0 | batch 30.6 | **Largest slices** (ms per frame, inclusive, all threads): Driver.WorkerWait 201.4, Driver.Packet 129.9, Driver.WorkerWait.idle_and_completion_poll 122.5, Driver.WorkerWait.dequeue_order 78.9, Driver.Packet.dispatch 73.1, Driver.Dispatch 59.4, Vulkan.Dispatch 45.5, Driver.Packet.memory_wait 45.5, Vulkan.Dispatch.shader_resources 45.4, batch 30.6 **Longest waits** - Driver.WorkerWait (queue worker 0x38) 446.2 ms at 66981 ms, present 1513 - Driver.WorkerWait (queue worker 0x38) 433.4 ms at 42635 ms, present 1220 - Driver.WorkerWait (queue worker 0x28) 402.6 ms at 67027 ms, present 1513 - Driver.WorkerWait (queue worker 0x28) 387.3 ms at 42683 ms, present 1220 - Driver.WorkerWait (queue worker 0x38) 382.6 ms at 67684 ms, present 1514 - Driver.WorkerWait (queue worker 0x28) 352.9 ms at 32701 ms, present 1116 - Driver.WorkerWait (queue worker 0x38) 316.8 ms at 48598 ms, present 1262 - Driver.WorkerWait (queue worker 0x28) 305.0 ms at 67764 ms, present 1515 - Driver.WorkerWait (queue worker 0x38) 290.1 ms at 32852 ms, present 1117 - Driver.WorkerWait (queue worker 0x28) 278.2 ms at 48639 ms, present 1262 **Largest GPU batches** (GPU ranges inside, and the CPU slices that recorded each, inclusive) - batch 668: 18.8 ms at 2940 ms, present 713: GPU no ranges; recorded by Vulkan.Dispatch.shader_resources (queue worker 0x0) 23.0, Recorder.Sync (queue worker 0x0) 18.9, Driver.Packet (queue worker 0x0) 6.2, Driver.Packet.dispatch (queue worker 0x0) 6.2 - batch 741: 18.7 ms at 3326 ms, present 716: GPU no ranges; recorded by Vulkan.Dispatch.shader_resources (queue worker 0x0) 23.5, Recorder.Sync (queue worker 0x0) 18.9, Driver.Packet (queue worker 0x0) 6.5, Driver.Packet.dispatch (queue worker 0x0) 6.5 - batch 303: 18.4 ms at 1157 ms, present 698: GPU no ranges; recorded by Vulkan.Dispatch.shader_resources (queue worker 0x0) 23.1, Recorder.Sync (queue worker 0x0) 18.6, Driver.Packet (queue worker 0x0) 6.7, Driver.Packet.dispatch (queue worker 0x0) 6.7 - batch 328: 18.4 ms at 1288 ms, present 699: GPU no ranges; recorded by Vulkan.Dispatch.shader_resources (queue worker 0x0) 23.6, Recorder.Sync (queue worker 0x0) 18.5, Driver.Packet (queue worker 0x0) 6.5, Driver.Packet.dispatch (queue worker 0x0) 6.5 - batch 3055: 17.0 ms at 11059 ms, present 816: GPU no ranges; recorded by Vulkan.Dispatch.shader_resources (queue worker 0x0) 21.2, Recorder.Sync (queue worker 0x0) 17.2, Driver.Packet (queue worker 0x0) 6.3, Driver.Packet.dispatch (queue worker 0x0) 6.3 </details> <details><summary><code>python3 tools/trace_digest.py aps5-trace-0510c350a6f5-2879961.json.gz</code> (base 2)</summary> **seconds 40:70** from present 676: 843 presents, frame p50 66.5 / p90 133.1 / p99 241.5 / max 494.5 ms, GPU busy 31.0 ms per present AMD Radeon RX 9070 XT (RADV GFX1201), radv Mesa 26.2.6-arch1.1, Linux 7.2.11-arch1-1, 3840x2160, commit 0510c350a6f5, dropped: no ```json {"commit":"0510c350a6f5","dirty":null,"env":{"APS5_LOG_TIMESTAMPS":"1","APS5_PAD_INPUT_FILE":"<path>","APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"40:70"},"gpu":"AMD Radeon RX 9070 XT (RADV GFX1201)","driver":"radv Mesa 26.2.6-arch1.1","os":"Linux 7.2.11-arch1-1","cpu":"AMD Ryzen 7 9800X3D 8-Core Processor","cpu_threads":8,"memory_mib":31192,"title_id":"PPSA02530","title":"PRAGMATA","content_version":"01.200.000","resolution":"3840x2160","window":{"spec":"seconds 40:70","first_present":676,"ms":70074.229},"presents":843,"frame_ms":{"p50":66.507,"p90":133.064,"p99":241.478,"max":494.477},"gpu_busy_ms_per_present":30.98,"worker_busy_pct":{"queue worker 0x38":4.625,"queue worker 0x20":49.946,"queue worker 0x0":92.868,"queue worker 0x28":9.739},"top_phases_ms_per_frame":{"Driver.Packet":129.751,"Driver.Packet.dispatch":72.922,"Driver.Dispatch":59.262,"Vulkan.Dispatch":46.215,"Vulkan.Dispatch.shader_resources":45.975,"Driver.Packet.memory_wait":44.836,"Recorder.Sync":29.92,"Graphics.Draw":21.692},"trace_dropped":false,"trace":"aps5-trace-0510c350a6f5-2879961.json.gz"} ``` **Slowest frames** (largest slices inside each, inclusive) - present 1230: 494.5 ms at 43283 ms: Driver.WorkerWait (queue worker 0x38) 430.4, Driver.WorkerWait.dequeue_order (queue worker 0x38) 430.4, Driver.Packet (queue worker 0x0) 427.9, Driver.WorkerWait (queue worker 0x28) 411.3 - present 1501: 451.1 ms at 66139 ms: Driver.WorkerWait (queue worker 0x38) 392.0, Driver.WorkerWait.dequeue_order (queue worker 0x38) 392.0, Driver.Packet (queue worker 0x0) 389.4, Driver.WorkerWait (queue worker 0x28) 371.4 - present 1248: 365.0 ms at 45810 ms: Driver.WorkerWait (queue worker 0x38) 327.8, Driver.WorkerWait.dequeue_order (queue worker 0x38) 327.8, Driver.Packet (queue worker 0x0) 326.1, Driver.Packet (queue worker 0x20) 317.3 - present 1503: 354.3 ms at 66814 ms: Driver.WorkerWait (queue worker 0x38) 306.0, Driver.WorkerWait.dequeue_order (queue worker 0x38) 306.0, Driver.Packet (queue worker 0x0) 303.8, Driver.WorkerWait (queue worker 0x28) 269.0 - present 1295: 329.6 ms at 52304 ms: Driver.WorkerWait (queue worker 0x38) 289.9, Driver.WorkerWait.dequeue_order (queue worker 0x38) 289.9, Driver.Packet (queue worker 0x0) 288.1, Driver.Packet (queue worker 0x20) 286.5 **Threads** (ms per frame) | thread | busy | wait | untraced | in slices < 20 us | largest | |---|---|---|---|---|---| | shader prepare | 0.7 (1 %) | 0.0 (0 %) | 82.4 | 0.0 | Shader.PrepareArtifact 0.7 | | shader prepare | 0.7 (1 %) | 0.0 (0 %) | 82.5 | 0.0 | Shader.PrepareArtifact 0.7 | | shader prepare | 0.7 (1 %) | 0.0 (0 %) | 82.5 | 0.0 | Shader.PrepareArtifact 0.7 | | shader prepare | 0.6 (1 %) | 0.0 (0 %) | 82.5 | 0.0 | Shader.PrepareArtifact 0.6 | | shader prepare | 0.1 (0 %) | 0.0 (0 %) | 83.0 | 0.0 | Vulkan.GraphicsPipelinePrebuild 0.1, Vulkan.ComputePipeline 0.0 | | shader prepare | 0.2 (0 %) | 0.0 (0 %) | 83.0 | 0.0 | Vulkan.GraphicsPipelinePrebuild 0.2, Vulkan.ComputePipeline 0.0 | | shader prepare | 0.2 (0 %) | 0.0 (0 %) | 83.0 | 0.0 | Vulkan.GraphicsPipelinePrebuild 0.2, Vulkan.ComputePipeline 0.0 | | shader prepare | 0.1 (0 %) | 0.0 (0 %) | 83.0 | 0.0 | Vulkan.GraphicsPipelinePrebuild 0.1, Vulkan.ComputePipeline 0.0 | | title | 6.0 (7 %) | 0.2 (0 %) | 76.9 | 0.0 | Shader.ResolveAbi 2.5, Shader.ResolveGraphicsStagesAbi 2.2 | | title | 7.0 (8 %) | 0.1 (0 %) | 76.1 | 0.0 | Shader.ResolveAbi 3.5, Shader.ResolveGraphicsStagesAbi 2.3 | | title | 6.2 (7 %) | 0.2 (0 %) | 76.8 | 0.0 | Shader.ResolveAbi 3.0, Shader.ResolveGraphicsStagesAbi 2.1 | | queue worker 0x38 | 3.7 (4 %) | 79.2 (95 %) | 0.3 | 0.0 | Driver.Packet 3.6, Driver.EndSubmission 0.3 | | queue worker 0x20 | 19.8 (24 %) | 63.1 (76 %) | 0.2 | 0.4 | Driver.Packet 41.3, Driver.EndSubmission 0.1 | | queue worker 0x0 | 53.4 (64 %) | 28.8 (35 %) | 0.9 | 4.1 | Driver.Packet 76.5, Driver.Suspend 0.0 | | draw committer | 18.2 (22 %) | 3.2 (4 %) | 61.7 | 0.2 | Graphics.Draw 20.7, Recorder.Submit 0.1 | | title | 6.4 (8 %) | 0.1 (0 %) | 76.6 | 0.0 | Shader.ResolveAbi 2.8, Shader.ResolveGraphicsStagesAbi 2.3 | | presenter | 1.5 (2 %) | 3.5 (4 %) | 78.1 | 0.1 | VideoOut.Flip 5.0, Driver.Present 0.0 | | title | 6.1 (7 %) | 0.1 (0 %) | 76.9 | 0.0 | Shader.ResolveAbi 2.7, Shader.ResolveGraphicsStagesAbi 2.5 | | title | 6.3 (8 %) | 0.2 (0 %) | 76.6 | 0.0 | Shader.ResolveAbi 2.7, Shader.ResolveGraphicsStagesAbi 2.5 | | title | 5.3 (6 %) | 0.1 (0 %) | 77.6 | 0.0 | Shader.ResolveGraphicsStagesAbi 2.5, Shader.ResolveAbi 1.7 | | title | 5.3 (6 %) | 0.3 (0 %) | 77.5 | 0.0 | Shader.ResolveAbi 2.3, Shader.ResolveGraphicsStagesAbi 2.0 | | queue worker 0x28 | 0.3 (0 %) | 82.6 (99 %) | 0.3 | 0.0 | Driver.Packet 7.6, Driver.EndSubmission 0.4 | | gpu | 31.0 (37 %) | 0.0 (0 %) | 52.1 | 0.0 | batch 31.0 | **Largest slices** (ms per frame, inclusive, all threads): Driver.WorkerWait 201.0, Driver.Packet 128.9, Driver.WorkerWait.idle_and_completion_poll 122.3, Driver.WorkerWait.dequeue_order 78.7, Driver.Packet.dispatch 72.6, Driver.Dispatch 58.9, Vulkan.Dispatch 45.9, Vulkan.Dispatch.shader_resources 45.8, Driver.Packet.memory_wait 44.8, batch 31.0 **Longest waits** - Driver.WorkerWait (queue worker 0x38) 430.4 ms at 43347 ms, present 1230 - Driver.WorkerWait (queue worker 0x28) 407.7 ms at 43372 ms, present 1230 - Driver.WorkerWait (queue worker 0x38) 392.0 ms at 66198 ms, present 1501 - Driver.WorkerWait (queue worker 0x28) 369.0 ms at 66222 ms, present 1501 - Driver.WorkerWait (queue worker 0x38) 327.8 ms at 45847 ms, present 1248 - Driver.WorkerWait (queue worker 0x38) 306.0 ms at 66863 ms, present 1503 - Driver.WorkerWait (queue worker 0x28) 294.7 ms at 45882 ms, present 1248 - Driver.WorkerWait (queue worker 0x38) 289.9 ms at 52344 ms, present 1295 - Driver.WorkerWait (queue worker 0x28) 270.0 ms at 66902 ms, present 1503 - Driver.WorkerWait (queue worker 0x28) 264.8 ms at 52371 ms, present 1295 **Largest GPU batches** (GPU ranges inside, and the CPU slices that recorded each, inclusive) - batch 16816: 19.3 ms at 56071 ms, present 1323: GPU no ranges; recorded by Driver.Packet (queue worker 0x0) 34.8, Driver.Packet.dispatch (queue worker 0x0) 34.8, Driver.Dispatch (queue worker 0x0) 9.9, Vulkan.Dispatch (queue worker 0x0) 9.7 - batch 13614: 19.0 ms at 45670 ms, present 1246: GPU no ranges; recorded by Driver.Packet (queue worker 0x0) 33.9, Driver.Packet.dispatch (queue worker 0x0) 33.7, Driver.Dispatch (queue worker 0x0) 9.9, Vulkan.Dispatch (queue worker 0x0) 9.8 - batch 1055: 18.0 ms at 4854 ms, present 719: GPU no ranges; recorded by Vulkan.Dispatch.shader_resources (queue worker 0x0) 22.7, Recorder.Sync (queue worker 0x0) 18.1, Driver.Packet (queue worker 0x0) 6.4, Driver.Packet.dispatch (queue worker 0x0) 6.4 - batch 958: 17.6 ms at 4391 ms, present 715: GPU no ranges; recorded by Vulkan.Dispatch.shader_resources (queue worker 0x0) 22.1, Recorder.Sync (queue worker 0x0) 17.8, Driver.Packet (queue worker 0x0) 6.3, Driver.Packet.dispatch (queue worker 0x0) 6.3 - batch 13833: 16.7 ms at 46630 ms, present 1251: GPU no ranges; recorded by Recorder.Sync (queue worker 0x0) 16.9, Driver.Packet (queue worker 0x0) 7.8, Driver.Packet.dispatch (queue worker 0x0) 7.8, Driver.Dispatch (queue worker 0x0) 7.8 </details> <details><summary><code>python3 tools/trace_digest.py aps5-trace-7d85b4041817-2936462.json.gz</code> (change 2)</summary> **seconds 40:70** from present 691: 854 presents, frame p50 66.9 / p90 130.4 / p99 260.8 / max 491.2 ms, GPU busy 30.5 ms per present AMD Radeon RX 9070 XT (RADV GFX1201), radv Mesa 26.2.6-arch1.1, Linux 7.2.11-arch1-1, 3840x2160, commit 7d85b4041817, dropped: no ```json {"commit":"7d85b4041817","dirty":null,"env":{"APS5_LOG_TIMESTAMPS":"1","APS5_PAD_INPUT_FILE":"<path>","APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"40:70"},"gpu":"AMD Radeon RX 9070 XT (RADV GFX1201)","driver":"radv Mesa 26.2.6-arch1.1","os":"Linux 7.2.11-arch1-1","cpu":"AMD Ryzen 7 9800X3D 8-Core Processor","cpu_threads":8,"memory_mib":31192,"title_id":"PPSA02530","title":"PRAGMATA","content_version":"01.200.000","resolution":"3840x2160","window":{"spec":"seconds 40:70","first_present":691,"ms":70065.0},"presents":854,"frame_ms":{"p50":66.879,"p90":130.36,"p99":260.805,"max":491.208},"gpu_busy_ms_per_present":30.519,"worker_busy_pct":{"queue worker 0x38":4.371,"queue worker 0x20":49.044,"queue worker 0x0":92.877,"queue worker 0x28":9.525},"top_phases_ms_per_frame":{"Driver.Packet":126.893,"Driver.Packet.dispatch":71.387,"Driver.Dispatch":57.704,"Vulkan.Dispatch":45.403,"Vulkan.Dispatch.shader_resources":45.164,"Driver.Packet.memory_wait":44.286,"Recorder.Sync":29.876,"Shader.ResolveAbi":23.647},"trace_dropped":false,"trace":"aps5-trace-7d85b4041817-2936462.json.gz"} ``` **Slowest frames** (largest slices inside each, inclusive) - present 1531: 491.2 ms at 66760 ms: Driver.WorkerWait (queue worker 0x38) 438.3, Driver.WorkerWait.dequeue_order (queue worker 0x38) 438.3, Driver.Packet (queue worker 0x0) 435.8, Driver.WorkerWait (queue worker 0x28) 390.1 - present 1268: 436.3 ms at 45889 ms: Driver.WorkerWait (queue worker 0x38) 401.2, Driver.WorkerWait.dequeue_order (queue worker 0x38) 401.2, Driver.Packet (queue worker 0x0) 398.8, Driver.WorkerWait (queue worker 0x28) 372.4 - present 1533: 394.2 ms at 67500 ms: Driver.WorkerWait (queue worker 0x38) 352.3, Driver.WorkerWait.dequeue_order (queue worker 0x38) 352.3, Driver.Packet (queue worker 0x0) 350.0, Driver.WorkerWait (queue worker 0x28) 313.9 - present 1305: 341.9 ms at 50808 ms: Driver.WorkerWait (queue worker 0x38) 300.3, Driver.WorkerWait.dequeue_order (queue worker 0x38) 300.3, Driver.Packet (queue worker 0x20) 299.3, Driver.Packet (queue worker 0x0) 298.6 - present 1138: 317.7 ms at 34266 ms: Shader.PrepareArtifact (shader prepare) 791.1, Driver.WorkerWait (queue worker 0x28) 286.5, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x28) 286.5, Driver.WorkerWait (queue worker 0x38) 280.1 **Threads** (ms per frame) | thread | busy | wait | untraced | in slices < 20 us | largest | |---|---|---|---|---|---| | shader prepare | 0.8 (1 %) | 0.0 (0 %) | 81.3 | 0.0 | Shader.PrepareArtifact 0.8 | | shader prepare | 0.8 (1 %) | 0.0 (0 %) | 81.2 | 0.0 | Shader.PrepareArtifact 0.8 | | shader prepare | 0.8 (1 %) | 0.0 (0 %) | 81.2 | 0.0 | Shader.PrepareArtifact 0.8 | | shader prepare | 0.8 (1 %) | 0.0 (0 %) | 81.2 | 0.0 | Shader.PrepareArtifact 0.8 | | shader prepare | 0.2 (0 %) | 0.0 (0 %) | 81.9 | 0.0 | Vulkan.GraphicsPipelinePrebuild 0.2, Vulkan.ComputePipeline 0.0 | | shader prepare | 0.2 (0 %) | 0.0 (0 %) | 81.9 | 0.0 | Vulkan.GraphicsPipelinePrebuild 0.2, Vulkan.ComputePipeline 0.0 | | shader prepare | 0.1 (0 %) | 0.0 (0 %) | 81.9 | 0.0 | Vulkan.GraphicsPipelinePrebuild 0.1, Vulkan.ComputePipeline 0.0 | | shader prepare | 0.2 (0 %) | 0.0 (0 %) | 81.9 | 0.0 | Vulkan.GraphicsPipelinePrebuild 0.2, Vulkan.ComputePipeline 0.0 | | title | 6.6 (8 %) | 0.2 (0 %) | 75.3 | 0.0 | Shader.ResolveAbi 3.1, Shader.ResolveGraphicsStagesAbi 2.2 | | title | 8.2 (10 %) | 0.1 (0 %) | 73.7 | 0.0 | Shader.ResolveAbi 4.6, Shader.ResolveGraphicsStagesAbi 2.4 | | queue worker 0x38 | 3.3 (4 %) | 78.5 (96 %) | 0.2 | 0.0 | Driver.Packet 3.2, Driver.EndSubmission 0.3 | | queue worker 0x20 | 19.4 (24 %) | 62.4 (76 %) | 0.2 | 0.4 | Driver.Packet 40.0, Driver.EndSubmission 0.1 | | queue worker 0x0 | 52.5 (64 %) | 28.6 (35 %) | 0.9 | 4.0 | Driver.Packet 75.5, Driver.Suspend 0.0 | | title | 5.6 (7 %) | 0.1 (0 %) | 76.4 | 0.0 | Shader.ResolveGraphicsStagesAbi 2.5, Shader.ResolveAbi 2.0 | | draw committer | 18.0 (22 %) | 3.2 (4 %) | 60.9 | 0.2 | Graphics.Draw 20.5, Recorder.Submit 0.1 | | title | 4.8 (6 %) | 0.2 (0 %) | 77.1 | 0.0 | Shader.ResolveAbi 2.0, Shader.ResolveGraphicsStagesAbi 1.7 | | presenter | 1.5 (2 %) | 3.4 (4 %) | 77.2 | 0.1 | VideoOut.Flip 4.8, Driver.Present 0.0 | | title | 7.5 (9 %) | 0.2 (0 %) | 74.3 | 0.0 | Shader.ResolveAbi 3.3, Shader.ResolveGraphicsStagesAbi 2.8 | | title | 6.8 (8 %) | 0.1 (0 %) | 75.1 | 0.0 | Shader.ResolveAbi 2.8, Shader.ResolveGraphicsStagesAbi 2.5 | | title | 4.8 (6 %) | 0.2 (0 %) | 77.0 | 0.0 | Shader.ResolveAbi 2.1, Shader.ResolveGraphicsStagesAbi 1.8 | | title | 7.9 (10 %) | 0.2 (0 %) | 73.9 | 0.0 | Shader.ResolveAbi 3.6, Shader.ResolveGraphicsStagesAbi 2.9 | | queue worker 0x28 | 0.2 (0 %) | 81.6 (99 %) | 0.2 | 0.0 | Driver.Packet 7.3, Driver.EndSubmission 0.5 | | gpu | 30.6 (37 %) | 0.0 (0 %) | 51.5 | 0.0 | batch 30.6 | **Largest slices** (ms per frame, inclusive, all threads): Driver.WorkerWait 199.5, Driver.Packet 126.1, Driver.WorkerWait.idle_and_completion_poll 121.8, Driver.WorkerWait.dequeue_order 77.7, Driver.Packet.dispatch 71.1, Driver.Dispatch 57.4, Vulkan.Dispatch 45.1, Vulkan.Dispatch.shader_resources 45.0, Driver.Packet.memory_wait 44.3, batch 30.6 **Longest waits** - Driver.WorkerWait (queue worker 0x38) 438.3 ms at 66813 ms, present 1531 - Driver.WorkerWait (queue worker 0x38) 401.2 ms at 45924 ms, present 1268 - Driver.WorkerWait (queue worker 0x28) 389.9 ms at 66862 ms, present 1531 - Driver.WorkerWait (queue worker 0x28) 372.5 ms at 45954 ms, present 1268 - Driver.WorkerWait (queue worker 0x38) 352.2 ms at 67543 ms, present 1533 - Driver.WorkerWait (queue worker 0x28) 313.1 ms at 67583 ms, present 1533 - Driver.WorkerWait (queue worker 0x28) 306.3 ms at 34165 ms, present 1137 - Driver.WorkerWait (queue worker 0x38) 300.3 ms at 50850 ms, present 1305 - Driver.WorkerWait (queue worker 0x38) 280.1 ms at 34303 ms, present 1138 - Driver.WorkerWait (queue worker 0x28) 272.9 ms at 50879 ms, present 1305 **Largest GPU batches** (GPU ranges inside, and the CPU slices that recorded each, inclusive) - batch 9671: 19.5 ms at 31283 ms, present 1106: GPU no ranges; recorded by Vulkan.Dispatch.shader_resources (queue worker 0x0) 37.0, Recorder.Sync (queue worker 0x0) 22.8, Driver.Packet (queue worker 0x0) 19.5, Driver.Packet.dispatch (queue worker 0x0) 19.5 - batch 10621: 18.7 ms at 35260 ms, present 1146: GPU no ranges; recorded by Vulkan.Dispatch.shader_resources (queue worker 0x0) 22.9, Recorder.Sync (queue worker 0x0) 18.8, Driver.Packet (queue worker 0x0) 6.5, Driver.Packet.dispatch (queue worker 0x0) 6.5 - batch 19487: 18.2 ms at 65133 ms, present 1510: GPU no ranges; recorded by Recorder.Sync (queue worker 0x0) 18.4, Driver.Packet (queue worker 0x0) 7.2, Driver.Packet.dispatch (queue worker 0x0) 7.2, Driver.Dispatch (queue worker 0x0) 7.2 - batch 11410: 18.2 ms at 38288 ms, present 1180: GPU no ranges; recorded by Vulkan.Dispatch.shader_resources (queue worker 0x0) 22.3, Recorder.Sync (queue worker 0x0) 18.3, Driver.Packet (queue worker 0x0) 6.4, Driver.Packet.dispatch (queue worker 0x0) 6.4 - batch 19561: 17.5 ms at 65538 ms, present 1514: GPU no ranges; recorded by Vulkan.Dispatch.shader_resources (queue worker 0x0) 22.2, Recorder.Sync (queue worker 0x0) 17.6, Driver.Packet (queue worker 0x0) 6.4, Driver.Packet.dispatch (queue worker 0x0) 6.4 </details> The earlier memory runs (`main` 8f55414024 + the same stack + a `mallinfo2()` print every 10 s, `malloc` in use; the fix arm was `86e0294bd2`): | run | `malloc` in use at 80 / 130 / 180 s | peak RssAnon+VmSwap | shader cache totals | title shown | |---|---|---|---|---| | base | 14224 / 19787 / 19899 MiB | 20104 MiB | 19566 hits, 0 misses, 0 writes | 144 s | | base, `APS5_PROFILE_DRAW=1` | 13238 / 19086 / 19788 MiB | 20333 MiB | 19565 hits, 0 misses, 0 writes | 151 s | | this change | 8388 / 11210 / 12161 MiB | 12752 MiB | 19572 hits, 3012 misses, 3012 writes | 193 s | | this change, `APS5_PROFILE_DRAW=1` | 9079 / 11591 / 12004 MiB | 12197 MiB | 22584 hits, 0 misses, 0 writes | 152 s | | base, `APS5_REGISTRATION_PREPARE_COMMIT_GB=0` | 14931 / 19565 / 19963 MiB | 21389 MiB | 14750 hits, 0 misses, 0 writes | 144 s | | this change, `APS5_REGISTRATION_PREPARE_COMMIT_GB=0` | 8857 / 10641 / 10696 MiB | 11815 MiB | 12812 hits, 0 misses, 0 writes | 143 s | **Where the 3012 misses come from (first run of this change).** - None of them are reloads: every reload in the profiled run was a disk hit. - In the base, private memory reaches the registration preparation budget of #9626 (half of physical memory) at 92–94 s: `process private memory reached the registered shader preparation budget`. Later registrations are then left for their first use. - With this change the process stays well under that budget, so registration preparation keeps going. It prepared 3012 registered shaders that the base never prepares, which is why they were not in the cache seed. - The profiled run of this change started from the cache that run had filled: 0 misses, and the title at 152 s against 151 s for the profiled base. - The rows with registration preparation off isolate the plan budget. From the profiled run of this change: - Reloads and evictions come in bursts, for example `74 reloaded, 3327 evicted; 1070 plans held, 3056.0 MiB of a 3899.0 MiB budget`. - The held bytes stayed under the 3899 MiB budget. VmRSS still peaks at 23–25 GiB in both arms, because the shader disk cache maps 6–9 GiB of entries (`RssFile`). Those are clean file pages and are not part of this change. ### Checklist - [x] Based on current `main`; no other open PR implements the same functions - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except technical debt - [x] No unimplemented paths added - [x] No notes, investigation `.md` files or images added to the repository - [x] No new third-party code - [x] Generic behavior, not specific to one title - [x] Depends on: none - [x] Fixes: none (related: #6139, #6178, #9626) - [x] Unblocks: none - [x] GPUs tested: AMD Radeon RX 9070 XT (RADV, Mesa 26.2.6) - [x] AI-assisted: yes (Claude Code)
MarcZX10 commented 2026-11-01 10:43:53 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-01T10:43:53Z.

Review: CHANGES_REQUESTED


Reviewed — changes requested

The trim can leave a shared resource plan unevictable even when no caller is using it, and the required matched performance artifacts are missing.

What I ran

Reviewed head 86e0294bd2217c3d0b5ac7874746ddee2f30141f against PR base 8527dad32ed743d3225042579bfd22acbf2616aa; the live merge preview was clean against target main at e6f57307fa7f47165d7fc1bee945abdb2f6816e7. Environment: Linux 6.1 x86-64, Python 3.11.2, GCC C++ driver 12.2.0 (not used for a build).

python3 tools/pr_precheck.py --repo boykopovar/AnyPS5 --pr 14367
git diff --check 8527dad32ed743d3225042579bfd22acbf2616aa...86e0294bd2217c3d0b5ac7874746ddee2f30141f
python3 tools/pr_test_quality.py --root /tmp/anyps5-14367-exact --json core/libs/prx/libSceAgcDriver/tests/ShaderDiskCache.cpp
grep -R -n 'ShaderDiskCache.cpp' /tmp/anyps5-14367-exact/core --include='CMakeLists.txt' --include='*.cmake'
gh pr checks 14367 -R boykopovar/AnyPS5

Results

Check Result
Diff whitespace Passed; git diff --check emitted no output.
Conventions and PR template Passed in the precheck.
Merge preview / dependencies Passed; clean against main at e6f57307fa7f47165d7fc1bee945abdb2f6816e7; no declared dependencies.
Test-quality heuristic One possible-unregistered-test warning; manually confirmed the target and CTest registration in tests/cmake/agc_shader_disk_cache_tests.cmake.
Source review Found the blocking shared-owner eviction case described below.
Performance evidence Incomplete: the PR body has a metrics table, but lacks both raw aps5-summary.jsonl lines, attached baseline/change traces, and trace_digest.py output required for this perf change.
Author-reported tests The description reports 30/30 paired CTest cases and red/green controls. I did not independently run them, and the description does not identify the exact tested head SHA.
Hosted checks All six checks were pending when checked: conventions, eligibility, intake, labels, library-portability, and report.
Local build / CTest Not run; initial review is no-build.
Unedited outputs

Conventions stdout from the precheck:

All conventions checks passed.

Test-quality heuristic JSON:

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

Manual CMake registration lookup:

/tmp/anyps5-14367-exact/core/libs/prx/libSceAgcDriver/tests/cmake/agc_shader_disk_cache_tests.cmake:1:add_test_executable(agc_shader_disk_cache_tests EXCLUDE_FROM_ALL tests/ShaderDiskCache.cpp)

Hosted check status:

conventions pending 0 https://github.com/boykopovar/AnyPS5/actions/runs/41298339172/job/124823843781
eligibility pending 0 https://github.com/boykopovar/AnyPS5/actions/runs/41298339175/job/124823842904
intake pending 0 https://github.com/boykopovar/AnyPS5/actions/runs/41298339081/job/124823849891
labels pending 0 https://github.com/boykopovar/AnyPS5/actions/runs/41298339123/job/124823843390
library-portability pending 0 https://github.com/boykopovar/AnyPS5/actions/runs/41298339204/job/124823842983
report pending 0 https://github.com/boykopovar/AnyPS5/actions/runs/41298339151/job/124823842695

Negative control

Assertion Mutation/change Result
LRU keeps recently used plan Reverse trim ordering Author reports the test fails; not independently run.
In-use plan remains resident Remove the use_count() == 1 guard Author reports the test fails; not independently run.
Shared plan with multiple idle SourceEntry owners can be trimmed No such case is present in the new test Could not be exercised; the test does not cover this case.

Findings

Blocking

  1. Shared plans can remain permanently above budget. SharedPlanTable::Get returns the same shared_ptr to multiple SourceEntry objects when cache payload and shader hash match. The new evictablePlan only accepts a plan when use_count() == 1; consequently, if two persistent source entries share a plan and neither has an external caller, both are excluded from the trim candidates. Neither entry releases its reference, so the shared object stays resident and the advertised budget may remain exceeded. The PR description acknowledges shared plans but the current code never evicts their references as a group. Please make a shared plan evictable when all owners are eligible (or use equivalent ownership accounting), and add a regression test with two source entries sharing one disk plan that verifies trimming and subsequent reload.

  2. Required performance artifacts are absent. The repository’s performance instructions and PR template require matched main/change summary lines and traces for a perf PR; the performance report form also requests the trace digest. Please add both raw summary lines, attach both trace files, and include python3 tools/trace_digest.py output so the reported memory and timing comparison can be checked against the captures.

Non-blocking

No other blocking source issue was established in this no-build review.

Sources

Not verified

I did not compile or run CTest, independently reproduce the reported game captures, verify the author's red/green runs, or test on Windows, macOS, or a console. The author-reported test run did not specify its exact head SHA. Hosted checks were still pending.

To get this to a good state

Please address the shared-owner eviction case with a regression test and provide the matched performance artifacts. I will rerun the same no-build checks against the updated head.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5727640660 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/14367#pullrequestreview-5727640660). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-01T10:43:53Z. **Review:** CHANGES_REQUESTED --- # Reviewed — changes requested The trim can leave a shared resource plan unevictable even when no caller is using it, and the required matched performance artifacts are missing. ## What I ran Reviewed head `86e0294bd2217c3d0b5ac7874746ddee2f30141f` against PR base `8527dad32ed743d3225042579bfd22acbf2616aa`; the live merge preview was clean against target `main` at `e6f57307fa7f47165d7fc1bee945abdb2f6816e7`. Environment: Linux 6.1 x86-64, Python 3.11.2, GCC C++ driver 12.2.0 (not used for a build). ```sh python3 tools/pr_precheck.py --repo boykopovar/AnyPS5 --pr 14367 git diff --check 8527dad32ed743d3225042579bfd22acbf2616aa...86e0294bd2217c3d0b5ac7874746ddee2f30141f python3 tools/pr_test_quality.py --root /tmp/anyps5-14367-exact --json core/libs/prx/libSceAgcDriver/tests/ShaderDiskCache.cpp grep -R -n 'ShaderDiskCache.cpp' /tmp/anyps5-14367-exact/core --include='CMakeLists.txt' --include='*.cmake' gh pr checks 14367 -R boykopovar/AnyPS5 ``` ## Results | Check | Result | |---|---| | Diff whitespace | Passed; `git diff --check` emitted no output. | | Conventions and PR template | Passed in the precheck. | | Merge preview / dependencies | Passed; clean against `main` at `e6f57307fa7f47165d7fc1bee945abdb2f6816e7`; no declared dependencies. | | Test-quality heuristic | One possible-unregistered-test warning; manually confirmed the target and CTest registration in `tests/cmake/agc_shader_disk_cache_tests.cmake`. | | Source review | Found the blocking shared-owner eviction case described below. | | Performance evidence | Incomplete: the PR body has a metrics table, but lacks both raw `aps5-summary.jsonl` lines, attached baseline/change traces, and `trace_digest.py` output required for this `perf` change. | | Author-reported tests | The description reports 30/30 paired CTest cases and red/green controls. I did not independently run them, and the description does not identify the exact tested head SHA. | | Hosted checks | All six checks were pending when checked: conventions, eligibility, intake, labels, library-portability, and report. | | Local build / CTest | Not run; initial review is no-build. | <details><summary>Unedited outputs</summary> Conventions stdout from the precheck: ```text All conventions checks passed. ``` Test-quality heuristic JSON: ```json { "findings": [ { "path": "core/libs/prx/libSceAgcDriver/tests/ShaderDiskCache.cpp", "line": 1, "kind": "possible-unregistered-cpp-test", "message": "Changed C++ test source path was not found literally in CMake files; inspect registration, generated source lists, and workflow coverage." } ], "negative_control_candidates": [], "limits": [ "Heuristics can miss weak assertions and can flag valid tests; inspect every finding.", "A test that passes against base is not by itself proof that the PR test is inadequate.", "Negative controls are only candidates until the test actually runs against base and fails by assertion rather than import/setup error." ] } ``` Manual CMake registration lookup: ```text /tmp/anyps5-14367-exact/core/libs/prx/libSceAgcDriver/tests/cmake/agc_shader_disk_cache_tests.cmake:1:add_test_executable(agc_shader_disk_cache_tests EXCLUDE_FROM_ALL tests/ShaderDiskCache.cpp) ``` Hosted check status: ```text conventions pending 0 https://github.com/boykopovar/AnyPS5/actions/runs/41298339172/job/124823843781 eligibility pending 0 https://github.com/boykopovar/AnyPS5/actions/runs/41298339175/job/124823842904 intake pending 0 https://github.com/boykopovar/AnyPS5/actions/runs/41298339081/job/124823849891 labels pending 0 https://github.com/boykopovar/AnyPS5/actions/runs/41298339123/job/124823843390 library-portability pending 0 https://github.com/boykopovar/AnyPS5/actions/runs/41298339204/job/124823842983 report pending 0 https://github.com/boykopovar/AnyPS5/actions/runs/41298339151/job/124823842695 ``` </details> ## Negative control | Assertion | Mutation/change | Result | |---|---|---| | LRU keeps recently used plan | Reverse trim ordering | Author reports the test fails; not independently run. | | In-use plan remains resident | Remove the `use_count() == 1` guard | Author reports the test fails; not independently run. | | Shared plan with multiple idle `SourceEntry` owners can be trimmed | No such case is present in the new test | Could not be exercised; the test does not cover this case. | ## Findings ### Blocking 1. **Shared plans can remain permanently above budget.** `SharedPlanTable::Get` returns the same `shared_ptr` to multiple `SourceEntry` objects when cache payload and shader hash match. The new `evictablePlan` only accepts a plan when `use_count() == 1`; consequently, if two persistent source entries share a plan and neither has an external caller, both are excluded from the trim candidates. Neither entry releases its reference, so the shared object stays resident and the advertised budget may remain exceeded. The PR description acknowledges shared plans but the current code never evicts their references as a group. Please make a shared plan evictable when all owners are eligible (or use equivalent ownership accounting), and add a regression test with two source entries sharing one disk plan that verifies trimming and subsequent reload. 2. **Required performance artifacts are absent.** The repository’s performance instructions and PR template require matched `main`/change summary lines and traces for a `perf` PR; the performance report form also requests the trace digest. Please add both raw summary lines, attach both trace files, and include `python3 tools/trace_digest.py` output so the reported memory and timing comparison can be checked against the captures. ### Non-blocking No other blocking source issue was established in this no-build review. ## Sources - [Resource-plan eviction and its `use_count()` guard at this head](https://github.com/boykopovar/AnyPS5/blob/86e0294bd2217c3d0b5ac7874746ddee2f30141f/core/shader/recompiler/Recompiler.cpp#L553-L588) - [Shared plan table returns shared ownership at this head](https://github.com/boykopovar/AnyPS5/blob/86e0294bd2217c3d0b5ac7874746ddee2f30141f/core/shader/recompiler/ShaderDiskCache.cpp#L180-L212) - [Performance capture requirements at this head](https://github.com/boykopovar/AnyPS5/blob/86e0294bd2217c3d0b5ac7874746ddee2f30141f/docs/dev/GAME_TESTING.md#L88-L92) - [Performance report form fields at this head](https://github.com/boykopovar/AnyPS5/blob/86e0294bd2217c3d0b5ac7874746ddee2f30141f/.github/ISSUE_TEMPLATE/performance.yml#L31-L50) - [PR template performance evidence requirement at this head](https://github.com/boykopovar/AnyPS5/blob/86e0294bd2217c3d0b5ac7874746ddee2f30141f/.github/pull_request_template.md#L1-L5) ## Not verified I did not compile or run CTest, independently reproduce the reported game captures, verify the author's red/green runs, or test on Windows, macOS, or a console. The author-reported test run did not specify its exact head SHA. Hosted checks were still pending. ## To get this to a good state Please address the shared-owner eviction case with a regression test and provide the matched performance artifacts. I will rerun the same no-build checks against the updated head.
MarcZX10 commented 2026-11-14 05:08:55 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-14T05:08:55Z.

Review: APPROVED


Reviewed — looks good

Nothing blocks this change; review findings and tests support merging, while title performance runs remain author-reported.

What I ran

Reviewed head e8b34de5969fdaaff19d318e04b585d96ae8451f. I read the prepared description, commits, manifest and diff, and all five changed files. I did not run commands or tests; the test and performance results below are supplied by the author.

Results

Check Result Note
Changed code review passed Five changed files read
Tests and performance runs not run Results reported by author

Findings

Blocking

None.

Non-blocking

None.

Not verified

I did not execute the tests, convention checks, or paired title performance runs. The reported runs and measurements are author supplied.

To get this to a good state

Nothing is required.

Files read: core/libs/prx/libSceAgcDriver/tests/ShaderDiskCache.cpp, core/shader/recompiler/Recompiler.cpp, core/shader/recompiler/Recompiler.hpp, core/shader/recompiler/ShaderDiskCache.cpp, docs/dev/ENVIRONMENT.md. Files reviewed: the same five changed files; none excluded.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5901815564 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/14367#pullrequestreview-5901815564). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-14T05:08:55Z. **Review:** APPROVED --- # Reviewed — looks good Nothing blocks this change; review findings and tests support merging, while title performance runs remain author-reported. ## What I ran Reviewed head `e8b34de5969fdaaff19d318e04b585d96ae8451f`. I read the prepared description, commits, manifest and diff, and all five changed files. I did not run commands or tests; the test and performance results below are supplied by the author. ## Results | Check | Result | Note | |---|---|---| | Changed code review | passed | Five changed files read | | Tests and performance runs | not run | Results reported by author | ## Findings ### Blocking None. ### Non-blocking None. ## Not verified I did not execute the tests, convention checks, or paired title performance runs. The reported runs and measurements are author supplied. ## To get this to a good state Nothing is required. Files read: `core/libs/prx/libSceAgcDriver/tests/ShaderDiskCache.cpp`, `core/shader/recompiler/Recompiler.cpp`, `core/shader/recompiler/Recompiler.hpp`, `core/shader/recompiler/ShaderDiskCache.cpp`, `docs/dev/ENVIRONMENT.md`. Files reviewed: the same five changed files; none excluded.
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!14367
No description provided.