perf(agc): time compute pipeline creation #6896

Merged
milescoviello merged 1 commit from upstream-pr/6896 into main 2026-10-19 17:36:04 +00:00
milescoviello commented 2026-10-16 17:03:27 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by milescoviello on 2026-10-16T17:03:27Z.


What

Traces (APS5_TRACE_SECONDS, APS5_TRACE_FRAMES) and frame timing name graphics pipeline builds (Vulkan.GraphicsPipeline, ...Library, ...Link, ...Prebuild), but not compute pipeline builds. VulkanDevice::createComputePipeline, which dispatches and the pipeline journal's replay both use, had no timer. A dispatch that compiles its pipeline therefore showed up as Driver.Dispatch time with nothing under it, and tools/trace_digest.py could not say where it went.

MXGP 26 (PPSA30839) is an example, on Linux/NVIDIA with the PRs it needs to get this far (#6814, #6094, #6160). In a 10 s window 120 s in, the title presented 2 frames. Driver.Dispatch took 8.9 s across the two queue workers, and 5.3 s of that was under no slice. Its longest dispatch took 2.9 s, of which recording took 1.1 ms. gdb samples during the stalls found the worker inside createComputePipeline, in NVIDIA's compiler.

This adds PerformanceTimer timing("Vulkan.ComputePipeline") at the top of createComputePipeline, as Pipeline's constructor has for graphics.

Tested

Ubuntu 24.04, GCC 13.3, Release, RTX 4070 Ti (NVIDIA 595.99.02).

  • MXGP 26, APS5_TRACE_SECONDS=120:10, pad input. Both runs use main + #6814 + #6094 + #6160; the second also has this change and a cold cache:
Build Driver.Dispatch in the window under no child slice largest child slice
without this change 8,859 ms (1,777 dispatches) 5,332 ms Resources.Prepare 1,930 ms
with it 41,782 ms (1,853 dispatches) 86 ms Vulkan.ComputePipeline 38,148 ms

The summary line's top_phases_ms_per_frame now lists Vulkan.ComputePipeline (38,148 ms of a 40,912 ms frame).

  • On main 66e290f1c: the 7 tests matching journal|performance_trace|compute_pipeline pass 3 of 3. The 501 tests matching ^agc_driver_|^agc_vertex_barrier|recompiler|shader_cache|request_serializer|spirv|^agc_shader|bda|journal pass except agc_driver_store_over_untracked, which fails on main too.

When no trace or frame timing is active, the timer only checks whether one is, as the other timers do. A pipeline build costs milliseconds to seconds, so this is negligible.

@LeandroLP23 ran it on Windows 11 with an AMD Radeon 860M (RDNA 3.5, driver 32.0.13058.8001) (comment), in one build of main 6efb7261b with this PR and six other pull requests: it builds cleanly and agc_driver_store_over_untracked passes 3 runs of 3.

Not checked: macOS, Intel (the change is platform-independent).

Checklist

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

🤖 Generated with Claude Code

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4891672423 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6896). Originally posted by [milescoviello](https://github.com/milescoviello) on 2026-10-16T17:03:27Z. --- ### What Traces (`APS5_TRACE_SECONDS`, `APS5_TRACE_FRAMES`) and frame timing name graphics pipeline builds (`Vulkan.GraphicsPipeline`, `...Library`, `...Link`, `...Prebuild`), but not compute pipeline builds. `VulkanDevice::createComputePipeline`, which dispatches and the pipeline journal's replay both use, had no timer. A dispatch that compiles its pipeline therefore showed up as `Driver.Dispatch` time with nothing under it, and `tools/trace_digest.py` could not say where it went. MXGP 26 (PPSA30839) is an example, on Linux/NVIDIA with the PRs it needs to get this far (#6814, #6094, #6160). In a 10 s window 120 s in, the title presented 2 frames. `Driver.Dispatch` took 8.9 s across the two queue workers, and 5.3 s of that was under no slice. Its longest dispatch took 2.9 s, of which recording took 1.1 ms. gdb samples during the stalls found the worker inside `createComputePipeline`, in NVIDIA's compiler. This adds `PerformanceTimer timing("Vulkan.ComputePipeline")` at the top of `createComputePipeline`, as `Pipeline`'s constructor has for graphics. ### Tested Ubuntu 24.04, GCC 13.3, Release, RTX 4070 Ti (NVIDIA 595.99.02). - MXGP 26, `APS5_TRACE_SECONDS=120:10`, pad input. Both runs use `main` + #6814 + #6094 + #6160; the second also has this change and a cold cache: | Build | `Driver.Dispatch` in the window | under no child slice | largest child slice | |---|---|---|---| | without this change | 8,859 ms (1,777 dispatches) | 5,332 ms | `Resources.Prepare` 1,930 ms | | with it | 41,782 ms (1,853 dispatches) | 86 ms | `Vulkan.ComputePipeline` 38,148 ms | The summary line's `top_phases_ms_per_frame` now lists `Vulkan.ComputePipeline` (38,148 ms of a 40,912 ms frame). - On `main` 66e290f1c: the 7 tests matching `journal|performance_trace|compute_pipeline` pass 3 of 3. The 501 tests matching `^agc_driver_|^agc_vertex_barrier|recompiler|shader_cache|request_serializer|spirv|^agc_shader|bda|journal` pass except `agc_driver_store_over_untracked`, which fails on `main` too. When no trace or frame timing is active, the timer only checks whether one is, as the other timers do. A pipeline build costs milliseconds to seconds, so this is negligible. @LeandroLP23 ran it on Windows 11 with an AMD Radeon 860M (RDNA 3.5, driver 32.0.13058.8001) ([comment](https://github.com/boykopovar/AnyPS5/pull/6896#issuecomment-6252730411)), in one build of `main` 6efb7261b with this PR and six other pull requests: it builds cleanly and `agc_driver_store_over_untracked` passes 3 runs of 3. Not checked: macOS, Intel (the change is platform-independent). ### 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](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed under Silent stubs in their library's [technical debt](https://github.com/boykopovar/AnyPS5/tree/main/docs/dev/debt) file - [x] No notes, investigation `.md` files or images added to the repository (attach them to this PR) - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: none - [x] Unblocks: none (diagnostics) - [x] GPUs tested: NVIDIA GeForce RTX 4070 Ti, driver 595.99, Ubuntu 24.04; AMD Radeon 860M, driver 32.0.13058.8001, Windows 11 (tests, by @LeandroLP23) - [x] AI-assisted: yes 🤖 Generated with [Claude Code](https://claude.com/claude-code)
LeandroLP23 commented 2026-10-18 17:10:45 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by LeandroLP23 on 2026-10-18T17:10:45Z.


AMD on Windows run. Radeon 860M (RDNA 3.5, driver 32.0.13058.8001), Windows 11 26300, WinLibs GCC 15.2.0 r7, Release, BUILD_TESTING=ON. Build: main 6efb7261b with #7524, #7006, #6612, #6929, #7119, #6896 and #6856 merged together (each merge clean, built once).

The build is clean and agc_driver_store_over_untracked passes 3 runs of 3.

AI-assisted

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6252730411 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6896#issuecomment-6252730411). Originally posted by [LeandroLP23](https://github.com/LeandroLP23) on 2026-10-18T17:10:45Z. --- AMD on Windows run. Radeon 860M (RDNA 3.5, driver 32.0.13058.8001), Windows 11 26300, WinLibs GCC 15.2.0 r7, Release, `BUILD_TESTING=ON`. Build: `main` `6efb7261b` with #7524, #7006, #6612, #6929, #7119, #6896 and #6856 merged together (each merge clean, built once). The build is clean and `agc_driver_store_over_untracked` passes 3 runs of 3. AI-assisted
milescoviello commented 2026-10-18 18:46:08 +00:00 (Migrated from github.com)

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


Thanks @LeandroLP23 for the AMD run on Windows. I added it to the description.

AI-assisted: yes (Claude Code)

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6253714577 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6896#issuecomment-6253714577). Originally posted by [milescoviello](https://github.com/milescoviello) on 2026-10-18T18:46:08Z. --- Thanks @LeandroLP23 for the AMD run on Windows. I added it to the description. AI-assisted: yes (Claude Code)
adriadam10 commented 2026-10-19 17:37:29 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-19T17:37:29Z.


Checked the one-line timer in createComputePipeline against the other PerformanceTimer uses in the file (header already included, no behaviour change, applies cleanly on current main); merged.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6273354135 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6896#issuecomment-6273354135). Originally posted by [adriadam10](https://github.com/adriadam10) on 2026-10-19T17:37:29Z. --- Checked the one-line timer in `createComputePipeline` against the other `PerformanceTimer` uses in the file (header already included, no behaviour change, applies cleanly on current main); merged.
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!6896
No description provided.