perf(shader): record a BDA fault with one atomic claim and branch-free stores #20870

Merged
Ketz7 merged 1 commit from upstream-pr/20870 into main 2026-11-16 08:24:59 +00:00
Ketz7 commented 2026-11-15 17:15:00 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Ketz7 on 2026-11-15T17:15:00Z.


What

  • record_bda_fault is called at every guest-memory access that can fault. It is marked DontInline, but AMD's Windows compiler (LLPC) inlines it anyway: removing the flag from a captured module changes nothing (75.8 s against 76.7 s). In vkQuake's ray-traced shadow compute shader (PPSA99010, program 0x20c60f400) it ends up about 1,540 times in the inlined module, from 326 call sites, many of them inside other inlined helpers.
  • Each copy did an atomic OR on otherFaults inside a branch, a compare-exchange lock on state, six stores inside a second branch, and a release atomic store of Ready. That pipeline takes 75–85 s to create on an RX 7900 XT, well past any title's GPU wait, so vkQuake shows no frame on a cold cache.
  • The fault record gets a claim word in place of otherFaults, plus discard and reserved words (32 → 40 bytes):
    • One atomic OR on claim sets bit 0 (claimed) and, unless the reason is Unaligned, bit 1 (another fault). The caller that finds bit 0 clear in the old value wins.
    • The winner's reason, address, bytes, stage, instruction and Ready go to the record. Every other caller writes the same values to discard instead, through an OpSelected index, so the function has no branches.
    • The record keeps its meaning: the first fault's fields, published once, with the sticky other-fault flag. state is written only by the winner, so no plain store races an atomic. The losers' stores to discard race only with each other, and nothing reads that word.
  • The rect-list recorder claims the same word, so the two recorders cannot both write the record.
  • BdaResources::checkFault reads the other-fault flag from claim through BdaAbi::OtherFaults, and checks claim where it checked otherFaults. OtherFaults is added to the shader-cache reviewed names: it only reads a record on the host.
  • SpirvFaultReportOnly accepts an access-chain index that is an OpSelect of two constants in the record. Without this, every shader would lose its report-only fault slot.
  • Tests: BdaExecution and BdaResources read the flag through OtherFaults, and ShaderMemory's "fault recorded outside record_bda_fault" check counts the claim OR.
  • Neighbouring PRs:
    • #12840 adds a line right after the checkFault line changed here. Whichever merges second keeps both lines.
    • #7392 changes StopBdaInvocationIf in the same file but not the recorder.

Tested

  • How the recorder was found, on SPIR-V captured from vkQuake with APS5_DUMP_COMPUTE_PIPELINES and edited by hand. Each variant was timed with agc_compute_pipeline_replay, AMD's driver cache moved aside before every compile:

    • Stubbing record_bda_fault out took the pipeline from 76.7 s to 28.4 s. Every load and store stayed in the module.
    • The same record with plain stores and no lock took 38.6 s, and a single atomic OR alone 39.5 s. The lock and its branches cost about 35 s.
    • Each atomic costs about 5–10 s. With a compare-exchange claim, keeping otherFaults as a separate atomic OR took 55.2–56.3 s against 47.7–50.0 s without it.
    • Things that did not help:
      • a relaxed Ready store: 75.2 s;
      • deferring the record to the end of the shader through Private variables: 70.5 s, because the variables became about 10,000 extra phis across the module's 1,052 inlined loops;
      • branch-free call sites: 62.1 s.
  • This branch (4003dfc383) against main (03dc6b3020), on modules captured from vkQuake built from each:

    • The modules differ only in record_bda_fault: 39 → 37 instructions, 3 → 1 atomics. main and the other 13 helpers are instruction-for-instruction identical, and both pass spirv-val.
    • pipeline_create, two runs each in alternating order, driver cache moved aside each time: main 77.9 s and 91.7 s, this branch 56.0 s and 59.9 s (about 32% less).
  • Vulkan tests with ANYPS5_REQUIRE_VULKAN=1, every test from agc_driver_bda_device_tests, agc_shader_memory_tests, agc_driver_graphics_tests, agc_rect_list_position_invariant_tests, agc_spirv_lds_atomic_lock_tests and agc_bda_atomics_tests:

    • AMD Radeon RX 7900 XT, AMD proprietary driver 26.10.1 (LLPC) 32.0.32015.7029, Windows 11 Pro 26H2 (build 26300.9974): 89 of 89 pass.
    • llvmpipe (Mesa, LLVM 20.1.2), Ubuntu 24.04, GCC 13.3: 91 of 91 pass. This covers the first-fault, other-fault-sequence and store-fault GPU tests in BdaExecution.
  • tools/check_conventions.py passes.

  • tools/pr_overlap.py --branch: #12840 is the only line overlap, described above. The PRs it could not compare are the descriptor-heap stack (#9508, #7642, #10193, #13928, #13929), which carries merges of main, plus #7392 and older PRs that only share test files.

  • Performance (Performance report form): AMD Radeon RX 7900 XT, AMD proprietary driver 26.10.1 (LLPC), Windows 11 Pro 26H2 (build 26300), Ryzen 9 7900X.

    • Cold first-use compile, the reason for this change: vkQuake (PPSA99010 1.0, r_rtshadows 1), AMD's driver cache moved aside, APS5_PROFILE_DRAW=1. The driver's own line for the ray-traced shadow compute pipeline (program 0x20c60f400):
      • main b7aeb6f406: [dispatch] created a pipeline for 152566 SPIR-V words in 83856 ms
      • this PR 4003dfc383: [dispatch] created a pipeline for 152602 SPIR-V words in 56888 ms
    • vkQuake presents no frame on either build: after the shadow pipeline it exits with code 0. That is unrelated to this change, so it gives no summary line, and a summary window opens at the first present anyway, after this compile.
    • Warm frame times, to show the change costs nothing at run time: Surround Sound Studio (PPSA99051 01.000.003), caches warm (the title ran once and was restarted), APS5_TRACE_SECONDS=10:20 and no other APS5_TRACE_* or APS5_PROFILE_* switch. Frame p50/p90/p99/max is 16.684/16.902/16.994/17.155 ms on main and 16.686/16.881/16.979/17.103 ms here, 1,199 presents each (vsync at 60 Hz). Traces attached.

main (eef73731fc):

{"commit":"eef73731fc92","dirty":false,"env":{"APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"10:20"},"gpu":"AMD Radeon RX 7900 XT","driver":"AMD proprietary driver 26.10.1 (LLPC)","os":"Windows 10.0.26300","cpu":"AMD Ryzen 9 7900X 12-Core Processor","cpu_threads":24,"memory_mib":31904,"title_id":"PPSA99051","title":"Surround Sound Studio","content_version":"01.000.003","resolution":"3840x2160","window":{"spec":"seconds 10:20","first_present":598,"ms":20003.061},"presents":1199,"frame_ms":{"p50":16.684,"p90":16.902,"p99":16.994,"max":17.155},"gpu_busy_ms_per_present":5.519,"worker_busy_pct":{"queue worker 0x0":4.208},"phase_totals_ms":{"Driver.Completion":0.948,"Driver.Draw":278.912,"Driver.Draw.device_setup":13.327,"Driver.Draw.draw_enqueued":31.404,"Driver.Draw.post_compile_prepare":1.140,"Driver.Draw.prepare":37.523,"Driver.Draw.shader_compile_and_link":191.531,"Driver.EndSubmission":1.118,"Driver.Packet":839.379,"Driver.Packet.device_lock":3.112,"Driver.Packet.draw":281.854,"Driver.Packet.execute":19.748,"Driver.Packet.flip_flush":67.080,"Driver.Packet.flush_between_packets":4.269,"Driver.Packet.pipeline_drain":427.702,"Driver.Packet.pipeline_prepare":4.949,"Driver.Packet.prepare_memory":5.778,"Driver.Present":1259.366,"Driver.Present.acquire_image":684.134,"Driver.Present.device_setup":0.508,"Driver.Present.gpu_mutex_wait":2.593,"Driver.Present.inflight_wait":3.124,"Driver.Present.present_display_buffer":165.136,"Driver.Present.queue_present":312.326,"Driver.Present.release_and_callback":1.070,"Driver.Present.render_fence_wait":86.797,"Driver.Present.resize":2.544,"Driver.Present.validate":0.490,"Driver.Suspend":0.319,"GpuMutex.wait.draw":0.148,"GpuMutex.wait.flush":0.003,"GpuMutex.wait.present":0.126,"GpuMutex.wait.wait":0.963,"Graphics.Draw":715.029,"Graphics.Draw.draw_and_resource_release":689.922,"Graphics.Draw.index_upload":0.552,"Graphics.Draw.validate":18.526,"Graphics.Draw.vertex_upload":2.936,"Recorder.Reap":39.924,"Recorder.Submit":183.398,"Recorder.WaitSerial":15.402,"Resources.Complete":53.338,"Resources.Prepare":63.071,"Shader.DrawStage":163.411,"Shader.DrawStage.capture_resources":108.032,"Shader.DrawStage.materialize":27.595,"Shader.DrawStage.prepared_invocation":26.079,"VideoOut.Flip":18914.471,"VideoOut.Flip.completion_mutex_wait":1.140,"VideoOut.Flip.config_mutex_wait":0.099,"VideoOut.Flip.frame_limit":2.608,"VideoOut.Flip.notify_game":41.991,"VideoOut.Flip.present":1262.496,"VideoOut.Flip.validate":0.927,"VideoOut.Flip.vblank_wait":17565.379,"VideoOut.Flip.window_prepare":2.530,"VideoOut.Flip.window_title":51.000,"VideoOut.Readiness":1.571,"VideoOut.Readiness.locks_validate":0.335,"Vulkan.Acquire":682.802,"Vulkan.Acquire.acquire_fence_wait":599.639,"Vulkan.Acquire.acquire_image":78.857,"Vulkan.Acquire.fence_reset":2.142,"Vulkan.Acquire.retired_swapchains":1.697,"Vulkan.Present":90.815,"Vulkan.Present.command_record_scale":36.700,"Vulkan.Present.pixel_upload":2.317,"Vulkan.Present.queue_submit":50.981,"Vulkan.QueuePresent":310.611,"Vulkan.QueuePresent.queue_present":308.923,"Vulkan.Retire":86.948,"Vulkan.Retire.wait":79.343},"top_phases_ms_per_frame":{"VideoOut.Flip":15.775,"VideoOut.Flip.vblank_wait":14.650,"VideoOut.Flip.present":1.053,"Driver.Present":1.050,"Driver.Packet":0.700,"Graphics.Draw":0.596,"Graphics.Draw.draw_and_resource_release":0.575,"Driver.Present.acquire_image":0.571},"owned_draw_counts":{},"graphics_track":{"Graphics.Barrier.draw":4796,"Graphics.Barrier.label-run":7194,"Graphics.Barrier.present-blit":2398,"Graphics.RenderPass":2398,"Graphics.RenderPass.Close.new-batch":2398,"Graphics.RenderPass.Continued":5995},"trace_dropped":false,"trace":"aps5-trace-eef73731fc92-3184.json.gz"}

This PR (4003dfc383):

{"commit":"4003dfc38385","dirty":false,"env":{"APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"10:20"},"gpu":"AMD Radeon RX 7900 XT","driver":"AMD proprietary driver 26.10.1 (LLPC)","os":"Windows 10.0.26300","cpu":"AMD Ryzen 9 7900X 12-Core Processor","cpu_threads":24,"memory_mib":31904,"title_id":"PPSA99051","title":"Surround Sound Studio","content_version":"01.000.003","resolution":"3840x2160","window":{"spec":"seconds 10:20","first_present":598,"ms":20003.066},"presents":1199,"frame_ms":{"p50":16.686,"p90":16.881,"p99":16.979,"max":17.103},"gpu_busy_ms_per_present":5.633,"worker_busy_pct":{"queue worker 0x0":4.261},"phase_totals_ms":{"Driver.Completion":0.968,"Driver.Draw":276.248,"Driver.Draw.device_setup":12.243,"Driver.Draw.draw_enqueued":31.224,"Driver.Draw.post_compile_prepare":1.209,"Driver.Draw.prepare":37.265,"Driver.Draw.shader_compile_and_link":190.418,"Driver.EndSubmission":1.097,"Driver.Packet":849.923,"Driver.Packet.device_lock":3.087,"Driver.Packet.draw":279.350,"Driver.Packet.execute":18.724,"Driver.Packet.flip_flush":64.438,"Driver.Packet.flush_between_packets":4.466,"Driver.Packet.pipeline_drain":444.152,"Driver.Packet.pipeline_prepare":4.910,"Driver.Packet.prepare_memory":5.994,"Driver.Present":1268.685,"Driver.Present.acquire_image":682.413,"Driver.Present.device_setup":0.558,"Driver.Present.gpu_mutex_wait":2.358,"Driver.Present.inflight_wait":2.935,"Driver.Present.present_display_buffer":166.564,"Driver.Present.queue_present":312.609,"Driver.Present.release_and_callback":1.117,"Driver.Present.render_fence_wait":96.682,"Driver.Present.resize":2.276,"Driver.Present.validate":0.570,"Driver.Suspend":0.290,"GpuMutex.wait.draw":0.001,"GpuMutex.wait.flush":0.250,"GpuMutex.wait.present":0.077,"Graphics.Draw":705.779,"Graphics.Draw.draw_and_resource_release":682.562,"Graphics.Draw.index_upload":0.580,"Graphics.Draw.validate":17.391,"Graphics.Draw.vertex_upload":2.213,"Recorder.Reap":38.966,"Recorder.Submit":172.835,"Recorder.WaitSerial":14.826,"Resources.Complete":53.897,"Resources.Prepare":62.929,"Shader.DrawStage":163.105,"Shader.DrawStage.capture_resources":108.432,"Shader.DrawStage.materialize":28.004,"Shader.DrawStage.prepared_invocation":25.051,"VideoOut.Flip":18906.607,"VideoOut.Flip.completion_mutex_wait":0.981,"VideoOut.Flip.config_mutex_wait":0.091,"VideoOut.Flip.frame_limit":2.755,"VideoOut.Flip.notify_game":22.507,"VideoOut.Flip.present":1272.018,"VideoOut.Flip.validate":0.886,"VideoOut.Flip.vblank_wait":17565.121,"VideoOut.Flip.window_prepare":2.295,"VideoOut.Flip.window_title":54.096,"VideoOut.Readiness":1.559,"VideoOut.Readiness.locks_validate":0.360,"Vulkan.Acquire":681.163,"Vulkan.Acquire.acquire_fence_wait":597.879,"Vulkan.Acquire.acquire_image":79.125,"Vulkan.Acquire.fence_reset":2.070,"Vulkan.Acquire.retired_swapchains":1.706,"Vulkan.Present":91.493,"Vulkan.Present.command_record_scale":36.351,"Vulkan.Present.pixel_upload":2.427,"Vulkan.Present.queue_submit":51.917,"Vulkan.QueuePresent":310.850,"Vulkan.QueuePresent.queue_present":309.266,"Vulkan.Retire":96.674,"Vulkan.Retire.wait":89.093},"top_phases_ms_per_frame":{"VideoOut.Flip":15.769,"VideoOut.Flip.vblank_wait":14.650,"VideoOut.Flip.present":1.061,"Driver.Present":1.058,"Driver.Packet":0.709,"Graphics.Draw":0.589,"Graphics.Draw.draw_and_resource_release":0.569,"Driver.Present.acquire_image":0.569},"owned_draw_counts":{},"graphics_track":{"Graphics.Barrier.draw":4797,"Graphics.Barrier.label-run":7194,"Graphics.Barrier.present-blit":2398,"Graphics.RenderPass":2398,"Graphics.RenderPass.Close.new-batch":2398,"Graphics.RenderPass.Continued":5995},"trace_dropped":false,"trace":"aps5-trace-4003dfc38385-20976.json.gz"}

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 and the licence notice of code adapted from upstream (see AGENTS.md)
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Fixes: none
  • Unblocks: none (vkQuake's shadow pipeline still takes about 58 s on a cold cache)
  • GPUs tested: AMD Radeon RX 7900 XT, AMD proprietary driver 26.10.1 (LLPC) 32.0.32015.7029, Windows 11 Pro 26H2 (build 26300.9974); llvmpipe (Mesa, LLVM 20.1.2) on Ubuntu 24.04
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5325141641 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/20870). Originally posted by [Ketz7](https://github.com/Ketz7) on 2026-11-15T17:15:00Z. --- ### What - `record_bda_fault` is called at every guest-memory access that can fault. It is marked `DontInline`, but AMD's Windows compiler (LLPC) inlines it anyway: removing the flag from a captured module changes nothing (75.8 s against 76.7 s). In vkQuake's ray-traced shadow compute shader (PPSA99010, program `0x20c60f400`) it ends up about 1,540 times in the inlined module, from 326 call sites, many of them inside other inlined helpers. - Each copy did an atomic OR on `otherFaults` inside a branch, a compare-exchange lock on `state`, six stores inside a second branch, and a release atomic store of `Ready`. That pipeline takes 75–85 s to create on an RX 7900 XT, well past any title's GPU wait, so vkQuake shows no frame on a cold cache. - The fault record gets a `claim` word in place of `otherFaults`, plus `discard` and `reserved` words (32 → 40 bytes): - One atomic OR on `claim` sets bit 0 (claimed) and, unless the reason is `Unaligned`, bit 1 (another fault). The caller that finds bit 0 clear in the old value wins. - The winner's reason, address, bytes, stage, instruction and `Ready` go to the record. Every other caller writes the same values to `discard` instead, through an `OpSelect`ed index, so the function has no branches. - The record keeps its meaning: the first fault's fields, published once, with the sticky other-fault flag. `state` is written only by the winner, so no plain store races an atomic. The losers' stores to `discard` race only with each other, and nothing reads that word. - The rect-list recorder claims the same word, so the two recorders cannot both write the record. - `BdaResources::checkFault` reads the other-fault flag from `claim` through `BdaAbi::OtherFaults`, and checks `claim` where it checked `otherFaults`. `OtherFaults` is added to the shader-cache reviewed names: it only reads a record on the host. - `SpirvFaultReportOnly` accepts an access-chain index that is an `OpSelect` of two constants in the record. Without this, every shader would lose its report-only fault slot. - Tests: `BdaExecution` and `BdaResources` read the flag through `OtherFaults`, and `ShaderMemory`'s "fault recorded outside `record_bda_fault`" check counts the claim OR. - Neighbouring PRs: - #12840 adds a line right after the `checkFault` line changed here. Whichever merges second keeps both lines. - #7392 changes `StopBdaInvocationIf` in the same file but not the recorder. ### Tested - How the recorder was found, on SPIR-V captured from vkQuake with `APS5_DUMP_COMPUTE_PIPELINES` and edited by hand. Each variant was timed with `agc_compute_pipeline_replay`, AMD's driver cache moved aside before every compile: - Stubbing `record_bda_fault` out took the pipeline from 76.7 s to 28.4 s. Every load and store stayed in the module. - The same record with plain stores and no lock took 38.6 s, and a single atomic OR alone 39.5 s. The lock and its branches cost about 35 s. - Each atomic costs about 5–10 s. With a compare-exchange claim, keeping `otherFaults` as a separate atomic OR took 55.2–56.3 s against 47.7–50.0 s without it. - Things that did not help: - a relaxed `Ready` store: 75.2 s; - deferring the record to the end of the shader through Private variables: 70.5 s, because the variables became about 10,000 extra phis across the module's 1,052 inlined loops; - branch-free call sites: 62.1 s. - This branch (4003dfc383) against `main` (03dc6b3020), on modules captured from vkQuake built from each: - The modules differ only in `record_bda_fault`: 39 → 37 instructions, 3 → 1 atomics. `main` and the other 13 helpers are instruction-for-instruction identical, and both pass `spirv-val`. - `pipeline_create`, two runs each in alternating order, driver cache moved aside each time: `main` 77.9 s and 91.7 s, this branch 56.0 s and 59.9 s (about 32% less). - Vulkan tests with `ANYPS5_REQUIRE_VULKAN=1`, every test from `agc_driver_bda_device_tests`, `agc_shader_memory_tests`, `agc_driver_graphics_tests`, `agc_rect_list_position_invariant_tests`, `agc_spirv_lds_atomic_lock_tests` and `agc_bda_atomics_tests`: - AMD Radeon RX 7900 XT, AMD proprietary driver 26.10.1 (LLPC) 32.0.32015.7029, Windows 11 Pro 26H2 (build 26300.9974): 89 of 89 pass. - llvmpipe (Mesa, LLVM 20.1.2), Ubuntu 24.04, GCC 13.3: 91 of 91 pass. This covers the first-fault, other-fault-sequence and store-fault GPU tests in `BdaExecution`. - `tools/check_conventions.py` passes. - `tools/pr_overlap.py --branch`: #12840 is the only line overlap, described above. The PRs it could not compare are the descriptor-heap stack (#9508, #7642, #10193, #13928, #13929), which carries merges of `main`, plus #7392 and older PRs that only share test files. - Performance (Performance report form): AMD Radeon RX 7900 XT, AMD proprietary driver 26.10.1 (LLPC), Windows 11 Pro 26H2 (build 26300), Ryzen 9 7900X. - Cold first-use compile, the reason for this change: vkQuake (PPSA99010 1.0, `r_rtshadows 1`), AMD's driver cache moved aside, `APS5_PROFILE_DRAW=1`. The driver's own line for the ray-traced shadow compute pipeline (program `0x20c60f400`): - `main` b7aeb6f406: `[dispatch] created a pipeline for 152566 SPIR-V words in 83856 ms` - this PR 4003dfc383: `[dispatch] created a pipeline for 152602 SPIR-V words in 56888 ms` - vkQuake presents no frame on either build: after the shadow pipeline it exits with code 0. That is unrelated to this change, so it gives no summary line, and a summary window opens at the first present anyway, after this compile. - Warm frame times, to show the change costs nothing at run time: Surround Sound Studio (PPSA99051 01.000.003), caches warm (the title ran once and was restarted), `APS5_TRACE_SECONDS=10:20` and no other `APS5_TRACE_*` or `APS5_PROFILE_*` switch. Frame p50/p90/p99/max is 16.684/16.902/16.994/17.155 ms on `main` and 16.686/16.881/16.979/17.103 ms here, 1,199 presents each (vsync at 60 Hz). Traces attached. `main` (eef73731fc): ```json {"commit":"eef73731fc92","dirty":false,"env":{"APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"10:20"},"gpu":"AMD Radeon RX 7900 XT","driver":"AMD proprietary driver 26.10.1 (LLPC)","os":"Windows 10.0.26300","cpu":"AMD Ryzen 9 7900X 12-Core Processor","cpu_threads":24,"memory_mib":31904,"title_id":"PPSA99051","title":"Surround Sound Studio","content_version":"01.000.003","resolution":"3840x2160","window":{"spec":"seconds 10:20","first_present":598,"ms":20003.061},"presents":1199,"frame_ms":{"p50":16.684,"p90":16.902,"p99":16.994,"max":17.155},"gpu_busy_ms_per_present":5.519,"worker_busy_pct":{"queue worker 0x0":4.208},"phase_totals_ms":{"Driver.Completion":0.948,"Driver.Draw":278.912,"Driver.Draw.device_setup":13.327,"Driver.Draw.draw_enqueued":31.404,"Driver.Draw.post_compile_prepare":1.140,"Driver.Draw.prepare":37.523,"Driver.Draw.shader_compile_and_link":191.531,"Driver.EndSubmission":1.118,"Driver.Packet":839.379,"Driver.Packet.device_lock":3.112,"Driver.Packet.draw":281.854,"Driver.Packet.execute":19.748,"Driver.Packet.flip_flush":67.080,"Driver.Packet.flush_between_packets":4.269,"Driver.Packet.pipeline_drain":427.702,"Driver.Packet.pipeline_prepare":4.949,"Driver.Packet.prepare_memory":5.778,"Driver.Present":1259.366,"Driver.Present.acquire_image":684.134,"Driver.Present.device_setup":0.508,"Driver.Present.gpu_mutex_wait":2.593,"Driver.Present.inflight_wait":3.124,"Driver.Present.present_display_buffer":165.136,"Driver.Present.queue_present":312.326,"Driver.Present.release_and_callback":1.070,"Driver.Present.render_fence_wait":86.797,"Driver.Present.resize":2.544,"Driver.Present.validate":0.490,"Driver.Suspend":0.319,"GpuMutex.wait.draw":0.148,"GpuMutex.wait.flush":0.003,"GpuMutex.wait.present":0.126,"GpuMutex.wait.wait":0.963,"Graphics.Draw":715.029,"Graphics.Draw.draw_and_resource_release":689.922,"Graphics.Draw.index_upload":0.552,"Graphics.Draw.validate":18.526,"Graphics.Draw.vertex_upload":2.936,"Recorder.Reap":39.924,"Recorder.Submit":183.398,"Recorder.WaitSerial":15.402,"Resources.Complete":53.338,"Resources.Prepare":63.071,"Shader.DrawStage":163.411,"Shader.DrawStage.capture_resources":108.032,"Shader.DrawStage.materialize":27.595,"Shader.DrawStage.prepared_invocation":26.079,"VideoOut.Flip":18914.471,"VideoOut.Flip.completion_mutex_wait":1.140,"VideoOut.Flip.config_mutex_wait":0.099,"VideoOut.Flip.frame_limit":2.608,"VideoOut.Flip.notify_game":41.991,"VideoOut.Flip.present":1262.496,"VideoOut.Flip.validate":0.927,"VideoOut.Flip.vblank_wait":17565.379,"VideoOut.Flip.window_prepare":2.530,"VideoOut.Flip.window_title":51.000,"VideoOut.Readiness":1.571,"VideoOut.Readiness.locks_validate":0.335,"Vulkan.Acquire":682.802,"Vulkan.Acquire.acquire_fence_wait":599.639,"Vulkan.Acquire.acquire_image":78.857,"Vulkan.Acquire.fence_reset":2.142,"Vulkan.Acquire.retired_swapchains":1.697,"Vulkan.Present":90.815,"Vulkan.Present.command_record_scale":36.700,"Vulkan.Present.pixel_upload":2.317,"Vulkan.Present.queue_submit":50.981,"Vulkan.QueuePresent":310.611,"Vulkan.QueuePresent.queue_present":308.923,"Vulkan.Retire":86.948,"Vulkan.Retire.wait":79.343},"top_phases_ms_per_frame":{"VideoOut.Flip":15.775,"VideoOut.Flip.vblank_wait":14.650,"VideoOut.Flip.present":1.053,"Driver.Present":1.050,"Driver.Packet":0.700,"Graphics.Draw":0.596,"Graphics.Draw.draw_and_resource_release":0.575,"Driver.Present.acquire_image":0.571},"owned_draw_counts":{},"graphics_track":{"Graphics.Barrier.draw":4796,"Graphics.Barrier.label-run":7194,"Graphics.Barrier.present-blit":2398,"Graphics.RenderPass":2398,"Graphics.RenderPass.Close.new-batch":2398,"Graphics.RenderPass.Continued":5995},"trace_dropped":false,"trace":"aps5-trace-eef73731fc92-3184.json.gz"} ``` This PR (4003dfc383): ```json {"commit":"4003dfc38385","dirty":false,"env":{"APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"10:20"},"gpu":"AMD Radeon RX 7900 XT","driver":"AMD proprietary driver 26.10.1 (LLPC)","os":"Windows 10.0.26300","cpu":"AMD Ryzen 9 7900X 12-Core Processor","cpu_threads":24,"memory_mib":31904,"title_id":"PPSA99051","title":"Surround Sound Studio","content_version":"01.000.003","resolution":"3840x2160","window":{"spec":"seconds 10:20","first_present":598,"ms":20003.066},"presents":1199,"frame_ms":{"p50":16.686,"p90":16.881,"p99":16.979,"max":17.103},"gpu_busy_ms_per_present":5.633,"worker_busy_pct":{"queue worker 0x0":4.261},"phase_totals_ms":{"Driver.Completion":0.968,"Driver.Draw":276.248,"Driver.Draw.device_setup":12.243,"Driver.Draw.draw_enqueued":31.224,"Driver.Draw.post_compile_prepare":1.209,"Driver.Draw.prepare":37.265,"Driver.Draw.shader_compile_and_link":190.418,"Driver.EndSubmission":1.097,"Driver.Packet":849.923,"Driver.Packet.device_lock":3.087,"Driver.Packet.draw":279.350,"Driver.Packet.execute":18.724,"Driver.Packet.flip_flush":64.438,"Driver.Packet.flush_between_packets":4.466,"Driver.Packet.pipeline_drain":444.152,"Driver.Packet.pipeline_prepare":4.910,"Driver.Packet.prepare_memory":5.994,"Driver.Present":1268.685,"Driver.Present.acquire_image":682.413,"Driver.Present.device_setup":0.558,"Driver.Present.gpu_mutex_wait":2.358,"Driver.Present.inflight_wait":2.935,"Driver.Present.present_display_buffer":166.564,"Driver.Present.queue_present":312.609,"Driver.Present.release_and_callback":1.117,"Driver.Present.render_fence_wait":96.682,"Driver.Present.resize":2.276,"Driver.Present.validate":0.570,"Driver.Suspend":0.290,"GpuMutex.wait.draw":0.001,"GpuMutex.wait.flush":0.250,"GpuMutex.wait.present":0.077,"Graphics.Draw":705.779,"Graphics.Draw.draw_and_resource_release":682.562,"Graphics.Draw.index_upload":0.580,"Graphics.Draw.validate":17.391,"Graphics.Draw.vertex_upload":2.213,"Recorder.Reap":38.966,"Recorder.Submit":172.835,"Recorder.WaitSerial":14.826,"Resources.Complete":53.897,"Resources.Prepare":62.929,"Shader.DrawStage":163.105,"Shader.DrawStage.capture_resources":108.432,"Shader.DrawStage.materialize":28.004,"Shader.DrawStage.prepared_invocation":25.051,"VideoOut.Flip":18906.607,"VideoOut.Flip.completion_mutex_wait":0.981,"VideoOut.Flip.config_mutex_wait":0.091,"VideoOut.Flip.frame_limit":2.755,"VideoOut.Flip.notify_game":22.507,"VideoOut.Flip.present":1272.018,"VideoOut.Flip.validate":0.886,"VideoOut.Flip.vblank_wait":17565.121,"VideoOut.Flip.window_prepare":2.295,"VideoOut.Flip.window_title":54.096,"VideoOut.Readiness":1.559,"VideoOut.Readiness.locks_validate":0.360,"Vulkan.Acquire":681.163,"Vulkan.Acquire.acquire_fence_wait":597.879,"Vulkan.Acquire.acquire_image":79.125,"Vulkan.Acquire.fence_reset":2.070,"Vulkan.Acquire.retired_swapchains":1.706,"Vulkan.Present":91.493,"Vulkan.Present.command_record_scale":36.351,"Vulkan.Present.pixel_upload":2.427,"Vulkan.Present.queue_submit":51.917,"Vulkan.QueuePresent":310.850,"Vulkan.QueuePresent.queue_present":309.266,"Vulkan.Retire":96.674,"Vulkan.Retire.wait":89.093},"top_phases_ms_per_frame":{"VideoOut.Flip":15.769,"VideoOut.Flip.vblank_wait":14.650,"VideoOut.Flip.present":1.061,"Driver.Present":1.058,"Driver.Packet":0.709,"Graphics.Draw":0.589,"Graphics.Draw.draw_and_resource_release":0.569,"Driver.Present.acquire_image":0.569},"owned_draw_counts":{},"graphics_track":{"Graphics.Barrier.draw":4797,"Graphics.Barrier.label-run":7194,"Graphics.Barrier.present-blit":2398,"Graphics.RenderPass":2398,"Graphics.RenderPass.Close.new-batch":2398,"Graphics.RenderPass.Continued":5995},"trace_dropped":false,"trace":"aps5-trace-4003dfc38385-20976.json.gz"} ``` ### Checklist <!-- Rules behind each item: https://github.com/boykopovar/AnyPS5/blob/main/CONTRIBUTING.md --> - [x] Based on current `main`; no other open PR implements the same functions - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except [technical debt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) and the licence notice of code adapted from upstream (see AGENTS.md) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed under Silent stubs in their library's [technical debt](https://github.com/boykopovar/AnyPS5/tree/main/docs/dev/debt) file - [x] No notes, investigation `.md` files or images added to the repository (attach them to this PR) - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: none - [x] Fixes: none - [x] Unblocks: none (vkQuake's shadow pipeline still takes about 58 s on a cold cache) - [x] GPUs tested: AMD Radeon RX 7900 XT, AMD proprietary driver 26.10.1 (LLPC) 32.0.32015.7029, Windows 11 Pro 26H2 (build 26300.9974); llvmpipe (Mesa, LLVM 20.1.2) on Ubuntu 24.04 - [x] AI-assisted: yes
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!20870
No description provided.