perf(shader): drop f32 NaN-result selects whose payload no sink observes #17227

Merged
talha-devp merged 4 commits from upstream-pr/17227 into main 2026-11-14 17:39:59 +00:00
talha-devp commented 2026-11-08 15:27:57 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by talha-devp on 2026-11-08T15:27:57Z.


What

Part of #11183 (the f32 NaN rule on devices without an f32 denormal mode, step 5), by payload liveness rather than a known-class proof: discussion and numbers.

A select isNaN(t) ? a : b, where a is NaN whenever it is taken and b is NaN whenever t is, differs from b only in the NaN payload. The new IR pass NanPayloadEliminator replaces such selects by b when no sink can observe that payload. It runs after DenormalFlushEliminator, only with exact f32 arithmetic (APS5_FAST_F32 unset).

  • All candidates are replaced together. Differences propagate through the program in three states: equal, NaN-only (equal, or NaN in both programs) and arbitrary.
  • Sinks are result-less instructions (stores, exports, the Reference that keeps a branch condition), instructions with side effects and every opcode outside a list of pure ALU operations. A sink that receives a difference keeps the candidates behind it, and the propagation runs again (at most 16 rounds; a budget overrun keeps every select).
  • Only NaN-ness reaches the result through FPIsNan32, FPSaturate32 (every NaN becomes 0), ordered and unordered compares, the exponent mask and unsigned magnitude compares whose result is the same for every NaN magnitude. Other bit work on a NaN-only difference makes it arbitrary.
  • A select arm's difference is ignored when the condition, evaluated with that difference's cause NaN, picks the other arm. This covers the denormal flush (exp == 0 ? sign : x), the output-modifier scaling and NaN-guarded emulations such as v_exp_f32 (isNaN(x) ? x : ...).

APS5_NO_NAN_PAYLOAD_ELIMINATION keeps every select; the recompiler switch list puts it in the shader cache key. The pass relies on the host returning a NaN for a NaN input to GLSL.std.450 Floor, Ceil, Trunc, RoundEven, Fract, Sqrt and Exp2 under SignedZeroInfNanPreserve; docs/dev/debt/shader.md records that only NVIDIA is measured.

Tested

Windows 10 22H2 (19045), RTX 4060 (NVIDIA 621.14), Ryzen 5 5600, MSYS2 UCRT64 GCC 16.2.0, Release. main f5fe807353 against this branch: 832c2d6126 adds the pass, abff150ae3 makes its analysis faster without changing its output.

Rules. New agc_nan_payload_elimination, 13 IR cases and one through Recompile.

  • IR cases. A clamp-only result loses its selects. These keep them: raw bits, integer work, a sign flip, an exponent-clearing xor, a raw integer compare, a magnitude compare inside the NaN range and bit work outside a NaN guard. These do not: the exponent and ordered tests, a magnitude compare against the infinity bits, the denormal flush and a NaN-guarded ISub32. A NaN shared by an observed and an unobserved rule stays. Four of the cases were added by oneandonlydean in 8c8015f6e6. With the observability check skipped (every candidate replaced), 5 of the first 9 fail.
  • Through Recompile (54a560b95f, from adam25136's review). Two compute programs add v0 to itself twice and store the result. With the second v_add_f32 clamped, no f32 NaN test is left in the SPIR-V; without the clamp, all four stay. With the PrepareResourceProgram call removed, or APS5_NO_NAN_PAYLOAD_ELIMINATION set, both programs keep four and the case fails.

GPU tests. On main and on this branch (at 832c2d6126 and again at abff150ae3), each executable run directly with ANYPS5_REQUIRE_VULKAN=1, ANYPS5_NO_SHADER_CACHE=1, VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation (MSYS2 vulkan-validation-layers 1.4.363, VK_ADD_LAYER_PATH; VK_LOADER_DEBUG=layer shows Insert instance layer "VK_LAYER_KHRONOS_validation"). Neither log reports was not found but was requested by env var VK_INSTANCE_LAYERS.

test main this PR VUID- lines (main / PR)
agc_driver_f32_arithmetic_nan pass pass 0 / 0
agc_driver_f32_min_max_nan pass pass 0 / 0
agc_driver_f32_output_modifier pass pass 0 / 0
agc_driver_f32_result_clamp pass pass 0 / 0
agc_driver_f32_denormal_flush pass pass 0 / 0
agc_driver_f32_add_mul_denormal_modes pass pass 0 / 0
agc_driver_f32_fract_floor_denormal_modes pass pass 0 / 0
agc_driver_f32_compare_constant pass pass 0 / 0
agc_driver_f32_constant_factor_tininess pass pass 0 / 0
agc_driver_sdwa_sin_cos_f32 pass pass 0 / 0
agc_f32_nan_result_selects pass pass 0 / 0
agc_denormal_flush_elimination pass pass 0 / 0
agc_nan_payload_elimination - pass - / 0

In a prototype of the same analysis, the pass removed selects inside f32_arithmetic_nan (66 of 1,361), f32_result_clamp (17 of 380) and f32_output_modifier (45 of 542), and those tests kept passing. The full suite was not run.

Homebrew titles on the same renderer. Catalog builds, SHA-256 checked. tools/title_run.py on main f5fe807353 and on this PR's head 8c8015f6e6. A cold run starts with empty AnyPS5 shader and driver caches; a warm run follows it.

main this PR
Surround Sound Studio (PPSA99051 01.000.003), cold start stops in 3 of 4 runs, at 7.6 to 10.5 s, before the first present: [ps5-agc] submission retirement failed; terminating application before cleanup in download0/hui/dev/app.log renders in 4 of 4 runs
Surround Sound Studio, warm, 45 s 11.5 fps 45.5 fps
Homebrew UI Lab (PPSA99050 01.000.010), cold start stops at 11.0 s, same message stops at 8.6 s, same message
Homebrew UI Lab, warm, 45 s 11.8 fps 33.1 fps

This is the first-run stop LeandroLP23 measured in #11183. On this host the PR clears it for Surround Sound Studio but not for Homebrew UI Lab.

Performance. ProsperoLight (PPSA99002 01.000.110, free homebrew), idle PCs screen, 3840x2160. Most of its GPU time is one fragment program (0x217e15000, the same program as 0x21ebf9000 in #11183) with 9,403 NaN-test selects. tools/title_run.py --runs 3 --seconds 40 with APS5_TRACE_SECONDS=15:10, rounds alternated main / PR / main / PR, run 1 of each round (cold caches) dropped: 4 warm windows per arm. title_run.py also sets APS5_DUMP_FRAMES_EVERY=30 and APS5_TRACE_SUMMARY_EVERY=10 in both arms, and the title writes stderr to its own log.

main f5fe807353 this PR 832c2d6126 change
GPU busy per present, median (range) 17.03 ms (17.00–17.29) 9.56 ms (9.53–9.63) −43.9 %
frame p50, median 20.37 ms 16.67 ms the title's 60 FPS cap
0x217e15000 per draw, separate pair with APS5_PROFILE_GPU=1 APS5_PROFILE_GPU_DRAWS=1 7.75 ms 4.03 ms −48 %
0x217e15000 SPIR-V words (agc_shader_replay on its request) 272,632 204,247 −25 %
agc_shader_replay wall time for that request, best of 3 275 ms 407 ms (797 ms at 832c2d6126) +132 ms
slowest pipeline creation, one cold run per arm (APS5_TRACE_DRAWS=1 APS5_PROFILE_DRAW=1) 1.95 s 1.26 s −35 %

One of the PR's four windows reports gpu_busy_ms_per_present 0.00 while presenting 598 frames at 16.66 ms p50; the GPU range above uses the other three. The same zero showed up once before in an unrelated arm of an earlier session, so it looks like a trace recording issue, not this change; its cause was not investigated.

The GPU numbers were measured at 832c2d6126. At abff150ae3 the program's SPIR-V is byte-identical (agc_shader_replay --spv), so they apply to both commits. The added recompile time is CPU work on the first use of a program; the driver's pipeline creation for the smaller module drops by more than that here.

Window summary lines, one per arm:

{"commit":"f5fe8073533b","dirty":false,"env":{"APS5_DUMP_FRAMES":"100000","APS5_DUMP_FRAMES_EVERY":"30","APS5_DUMP_SCALE":"8","APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"15:10","APS5_TRACE_SUMMARY_EVERY":"10"},"gpu":"NVIDIA GeForce RTX 4060","driver":"NVIDIA 621.14","os":"Windows 10.0.19045","cpu":"AMD Ryzen 5 5600 6-Core Processor","cpu_threads":12,"memory_mib":32678,"title_id":"PPSA99002","title":"ProsperoLight","content_version":"01.000.110","resolution":"3840x2160","window":{"spec":"seconds 15:10","first_present":736,"ms":10019.450},"presents":493,"frame_ms":{"p50":20.168,"p90":21.067,"p99":24.412,"max":30.801},"gpu_busy_ms_per_present":17.053,"worker_busy_pct":{"queue worker 0x0":10.206},"top_phases_ms_per_frame":{"Driver.Packet":2.032,"Graphics.Draw":1.998,"Graphics.Draw.draw_and_resource_release":1.948,"Driver.Packet.draw":0.714,"Driver.Draw":0.708,"VideoOut.Flip":0.646,"Driver.Packet.pipeline_drain":0.565,"Driver.Draw.shader_compile_and_link":0.553},"trace_dropped":false,"trace":"aps5-trace-f5fe8073533b-20336.json.gz"}
{"commit":"832c2d612670","dirty":false,"env":{"APS5_DUMP_FRAMES":"100000","APS5_DUMP_FRAMES_EVERY":"30","APS5_DUMP_SCALE":"8","APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"15:10","APS5_TRACE_SUMMARY_EVERY":"10"},"gpu":"NVIDIA GeForce RTX 4060","driver":"NVIDIA 621.14","os":"Windows 10.0.19045","cpu":"AMD Ryzen 5 5600 6-Core Processor","cpu_threads":12,"memory_mib":32678,"title_id":"PPSA99002","title":"ProsperoLight","content_version":"01.000.110","resolution":"3840x2160","window":{"spec":"seconds 15:10","first_present":897,"ms":10010.081},"presents":600,"frame_ms":{"p50":16.667,"p90":16.893,"p99":16.948,"max":17.410},"gpu_busy_ms_per_present":9.529,"worker_busy_pct":{"queue worker 0x0":13.553},"top_phases_ms_per_frame":{"VideoOut.Flip":4.385,"VideoOut.Flip.vblank_wait":3.750,"Driver.Packet":2.216,"Graphics.Draw":2.026,"Graphics.Draw.draw_and_resource_release":1.976,"Driver.Packet.pipeline_drain":0.742,"Driver.Packet.draw":0.585,"Driver.Draw":0.579},"trace_dropped":false,"trace":"aps5-trace-832c2d612670-23212.json.gz"}

Digests (tools/trace_digest.py):

main:
**seconds 15:10** from present 736: 493 presents, frame p50 20.2 / p90 21.1 / p99 24.4 / max 30.8 ms, GPU busy 17.1 ms per present
NVIDIA GeForce RTX 4060, NVIDIA 621.14, Windows 10.0.19045, 3840x2160, commit f5fe8073533b, dropped: no

**Slowest frames** (largest slices inside each, inclusive)

- present 1190: 30.8 ms at 9203 ms: Driver.WorkerWait (queue worker 0x0) 26.0, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x0) 26.0, batch (gpu) 18.7, Driver.Packet (queue worker 0x0) 4.5
- present 1192: 24.6 ms at 9258 ms: Driver.WorkerWait (queue worker 0x0) 21.5, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x0) 21.5, batch (gpu) 20.0, Driver.Packet (queue worker 0x0) 2.9
- present 1189: 24.6 ms at 9178 ms: Driver.WorkerWait (queue worker 0x0) 21.2, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x0) 21.2, batch (gpu) 19.8, Graphics.Draw (draw committer) 3.1

this PR:
**seconds 15:10** from present 897: 600 presents, frame p50 16.7 / p90 16.9 / p99 16.9 / max 17.4 ms, GPU busy 9.5 ms per present
NVIDIA GeForce RTX 4060, NVIDIA 621.14, Windows 10.0.19045, 3840x2160, commit 832c2d612670, dropped: no

**Slowest frames** (largest slices inside each, inclusive)

- present 1368: 17.4 ms at 7858 ms: Driver.WorkerWait (queue worker 0x0) 13.7, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x0) 13.7, batch (gpu) 9.5, Graphics.Draw (draw committer) 3.4
- present 1371: 17.0 ms at 7908 ms: Driver.WorkerWait (queue worker 0x0) 13.5, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x0) 13.5, batch (gpu) 9.7, Graphics.Draw (draw committer) 3.3
- present 1016: 17.0 ms at 1985 ms: Driver.WorkerWait (queue worker 0x0) 14.8, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x0) 14.8, batch (gpu) 9.5, VideoOut.Flip (presenter) 4.8

The traces can be shared on request; they could not be attached from the command line.

Not measured: AMD and Intel GPUs, Linux, large compute programs (the analysis cost scales with the program; a budget overrun keeps every select). Runs on other vendors would help.

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Fixes: none
  • Unblocks: PPSA99051 #17060
  • GPUs tested: NVIDIA GeForce RTX 4060, driver 621.14, Windows 10 22H2 (19045)
  • AI-assisted: yes

🤖 Generated with Claude Code

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5212562062 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/17227). Originally posted by [talha-devp](https://github.com/talha-devp) on 2026-11-08T15:27:57Z. --- ### What Part of #11183 (the f32 NaN rule on devices without an f32 denormal mode, step 5), by payload liveness rather than a known-class proof: [discussion and numbers](https://github.com/boykopovar/AnyPS5/issues/11183). A select `isNaN(t) ? a : b`, where `a` is NaN whenever it is taken and `b` is NaN whenever `t` is, differs from `b` only in the NaN payload. The new IR pass `NanPayloadEliminator` replaces such selects by `b` when no sink can observe that payload. It runs after `DenormalFlushEliminator`, only with exact f32 arithmetic (`APS5_FAST_F32` unset). - All candidates are replaced together. Differences propagate through the program in three states: equal, NaN-only (equal, or NaN in both programs) and arbitrary. - Sinks are result-less instructions (stores, exports, the `Reference` that keeps a branch condition), instructions with side effects and every opcode outside a list of pure ALU operations. A sink that receives a difference keeps the candidates behind it, and the propagation runs again (at most 16 rounds; a budget overrun keeps every select). - Only NaN-ness reaches the result through `FPIsNan32`, `FPSaturate32` (every NaN becomes 0), ordered and unordered compares, the exponent mask and unsigned magnitude compares whose result is the same for every NaN magnitude. Other bit work on a NaN-only difference makes it arbitrary. - A select arm's difference is ignored when the condition, evaluated with that difference's cause NaN, picks the other arm. This covers the denormal flush (`exp == 0 ? sign : x`), the output-modifier scaling and NaN-guarded emulations such as `v_exp_f32` (`isNaN(x) ? x : ...`). `APS5_NO_NAN_PAYLOAD_ELIMINATION` keeps every select; the recompiler switch list puts it in the shader cache key. The pass relies on the host returning a NaN for a NaN input to GLSL.std.450 `Floor`, `Ceil`, `Trunc`, `RoundEven`, `Fract`, `Sqrt` and `Exp2` under `SignedZeroInfNanPreserve`; `docs/dev/debt/shader.md` records that only NVIDIA is measured. ### Tested Windows 10 22H2 (19045), RTX 4060 (NVIDIA 621.14), Ryzen 5 5600, MSYS2 UCRT64 GCC 16.2.0, Release. `main` `f5fe807353` against this branch: `832c2d6126` adds the pass, `abff150ae3` makes its analysis faster without changing its output. **Rules.** New `agc_nan_payload_elimination`, 13 IR cases and one through `Recompile`. - **IR cases.** A clamp-only result loses its selects. These keep them: raw bits, integer work, a sign flip, an exponent-clearing xor, a raw integer compare, a magnitude compare inside the NaN range and bit work outside a NaN guard. These do not: the exponent and ordered tests, a magnitude compare against the infinity bits, the denormal flush and a NaN-guarded `ISub32`. A NaN shared by an observed and an unobserved rule stays. Four of the cases were added by oneandonlydean in `8c8015f6e6`. With the observability check skipped (every candidate replaced), 5 of the first 9 fail. - **Through `Recompile`** (`54a560b95f`, from adam25136's review). Two compute programs add `v0` to itself twice and store the result. With the second `v_add_f32` clamped, no f32 NaN test is left in the SPIR-V; without the clamp, all four stay. With the `PrepareResourceProgram` call removed, or `APS5_NO_NAN_PAYLOAD_ELIMINATION` set, both programs keep four and the case fails. **GPU tests.** On `main` and on this branch (at `832c2d6126` and again at `abff150ae3`), each executable run directly with `ANYPS5_REQUIRE_VULKAN=1`, `ANYPS5_NO_SHADER_CACHE=1`, `VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation` (MSYS2 `vulkan-validation-layers` 1.4.363, `VK_ADD_LAYER_PATH`; `VK_LOADER_DEBUG=layer` shows `Insert instance layer "VK_LAYER_KHRONOS_validation"`). Neither log reports `was not found but was requested by env var VK_INSTANCE_LAYERS`. | test | `main` | this PR | `VUID-` lines (main / PR) | |---|---|---|---| | `agc_driver_f32_arithmetic_nan` | pass | pass | 0 / 0 | | `agc_driver_f32_min_max_nan` | pass | pass | 0 / 0 | | `agc_driver_f32_output_modifier` | pass | pass | 0 / 0 | | `agc_driver_f32_result_clamp` | pass | pass | 0 / 0 | | `agc_driver_f32_denormal_flush` | pass | pass | 0 / 0 | | `agc_driver_f32_add_mul_denormal_modes` | pass | pass | 0 / 0 | | `agc_driver_f32_fract_floor_denormal_modes` | pass | pass | 0 / 0 | | `agc_driver_f32_compare_constant` | pass | pass | 0 / 0 | | `agc_driver_f32_constant_factor_tininess` | pass | pass | 0 / 0 | | `agc_driver_sdwa_sin_cos_f32` | pass | pass | 0 / 0 | | `agc_f32_nan_result_selects` | pass | pass | 0 / 0 | | `agc_denormal_flush_elimination` | pass | pass | 0 / 0 | | `agc_nan_payload_elimination` | - | pass | - / 0 | In a prototype of the same analysis, the pass removed selects inside `f32_arithmetic_nan` (66 of 1,361), `f32_result_clamp` (17 of 380) and `f32_output_modifier` (45 of 542), and those tests kept passing. The full suite was not run. **Homebrew titles on the same renderer.** Catalog builds, SHA-256 checked. `tools/title_run.py` on `main` `f5fe807353` and on this PR's head `8c8015f6e6`. A cold run starts with empty AnyPS5 shader and driver caches; a warm run follows it. | | `main` | this PR | |---|---|---| | Surround Sound Studio (PPSA99051 01.000.003), cold start | stops in 3 of 4 runs, at 7.6 to 10.5 s, before the first present: `[ps5-agc] submission retirement failed; terminating application before cleanup` in `download0/hui/dev/app.log` | renders in 4 of 4 runs | | Surround Sound Studio, warm, 45 s | 11.5 fps | 45.5 fps | | Homebrew UI Lab (PPSA99050 01.000.010), cold start | stops at 11.0 s, same message | stops at 8.6 s, same message | | Homebrew UI Lab, warm, 45 s | 11.8 fps | 33.1 fps | This is the first-run stop LeandroLP23 measured in #11183. On this host the PR clears it for Surround Sound Studio but not for Homebrew UI Lab. **Performance.** ProsperoLight (PPSA99002 01.000.110, free homebrew), idle PCs screen, 3840x2160. Most of its GPU time is one fragment program (`0x217e15000`, the same program as `0x21ebf9000` in #11183) with 9,403 NaN-test selects. `tools/title_run.py --runs 3 --seconds 40` with `APS5_TRACE_SECONDS=15:10`, rounds alternated main / PR / main / PR, run 1 of each round (cold caches) dropped: 4 warm windows per arm. `title_run.py` also sets `APS5_DUMP_FRAMES_EVERY=30` and `APS5_TRACE_SUMMARY_EVERY=10` in both arms, and the title writes stderr to its own log. | | `main` `f5fe807353` | this PR `832c2d6126` | change | |---|---|---|---| | GPU busy per present, median (range) | 17.03 ms (17.00–17.29) | 9.56 ms (9.53–9.63) | −43.9 % | | frame p50, median | 20.37 ms | 16.67 ms | the title's 60 FPS cap | | `0x217e15000` per draw, separate pair with `APS5_PROFILE_GPU=1 APS5_PROFILE_GPU_DRAWS=1` | 7.75 ms | 4.03 ms | −48 % | | `0x217e15000` SPIR-V words (`agc_shader_replay` on its request) | 272,632 | 204,247 | −25 % | | `agc_shader_replay` wall time for that request, best of 3 | 275 ms | 407 ms (797 ms at `832c2d6126`) | +132 ms | | slowest pipeline creation, one cold run per arm (`APS5_TRACE_DRAWS=1 APS5_PROFILE_DRAW=1`) | 1.95 s | 1.26 s | −35 % | One of the PR's four windows reports `gpu_busy_ms_per_present` 0.00 while presenting 598 frames at 16.66 ms p50; the GPU range above uses the other three. The same zero showed up once before in an unrelated arm of an earlier session, so it looks like a trace recording issue, not this change; its cause was not investigated. The GPU numbers were measured at `832c2d6126`. At `abff150ae3` the program's SPIR-V is byte-identical (`agc_shader_replay --spv`), so they apply to both commits. The added recompile time is CPU work on the first use of a program; the driver's pipeline creation for the smaller module drops by more than that here. Window summary lines, one per arm: ```json {"commit":"f5fe8073533b","dirty":false,"env":{"APS5_DUMP_FRAMES":"100000","APS5_DUMP_FRAMES_EVERY":"30","APS5_DUMP_SCALE":"8","APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"15:10","APS5_TRACE_SUMMARY_EVERY":"10"},"gpu":"NVIDIA GeForce RTX 4060","driver":"NVIDIA 621.14","os":"Windows 10.0.19045","cpu":"AMD Ryzen 5 5600 6-Core Processor","cpu_threads":12,"memory_mib":32678,"title_id":"PPSA99002","title":"ProsperoLight","content_version":"01.000.110","resolution":"3840x2160","window":{"spec":"seconds 15:10","first_present":736,"ms":10019.450},"presents":493,"frame_ms":{"p50":20.168,"p90":21.067,"p99":24.412,"max":30.801},"gpu_busy_ms_per_present":17.053,"worker_busy_pct":{"queue worker 0x0":10.206},"top_phases_ms_per_frame":{"Driver.Packet":2.032,"Graphics.Draw":1.998,"Graphics.Draw.draw_and_resource_release":1.948,"Driver.Packet.draw":0.714,"Driver.Draw":0.708,"VideoOut.Flip":0.646,"Driver.Packet.pipeline_drain":0.565,"Driver.Draw.shader_compile_and_link":0.553},"trace_dropped":false,"trace":"aps5-trace-f5fe8073533b-20336.json.gz"} {"commit":"832c2d612670","dirty":false,"env":{"APS5_DUMP_FRAMES":"100000","APS5_DUMP_FRAMES_EVERY":"30","APS5_DUMP_SCALE":"8","APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"15:10","APS5_TRACE_SUMMARY_EVERY":"10"},"gpu":"NVIDIA GeForce RTX 4060","driver":"NVIDIA 621.14","os":"Windows 10.0.19045","cpu":"AMD Ryzen 5 5600 6-Core Processor","cpu_threads":12,"memory_mib":32678,"title_id":"PPSA99002","title":"ProsperoLight","content_version":"01.000.110","resolution":"3840x2160","window":{"spec":"seconds 15:10","first_present":897,"ms":10010.081},"presents":600,"frame_ms":{"p50":16.667,"p90":16.893,"p99":16.948,"max":17.410},"gpu_busy_ms_per_present":9.529,"worker_busy_pct":{"queue worker 0x0":13.553},"top_phases_ms_per_frame":{"VideoOut.Flip":4.385,"VideoOut.Flip.vblank_wait":3.750,"Driver.Packet":2.216,"Graphics.Draw":2.026,"Graphics.Draw.draw_and_resource_release":1.976,"Driver.Packet.pipeline_drain":0.742,"Driver.Packet.draw":0.585,"Driver.Draw":0.579},"trace_dropped":false,"trace":"aps5-trace-832c2d612670-23212.json.gz"} ``` Digests (`tools/trace_digest.py`): ``` main: **seconds 15:10** from present 736: 493 presents, frame p50 20.2 / p90 21.1 / p99 24.4 / max 30.8 ms, GPU busy 17.1 ms per present NVIDIA GeForce RTX 4060, NVIDIA 621.14, Windows 10.0.19045, 3840x2160, commit f5fe8073533b, dropped: no **Slowest frames** (largest slices inside each, inclusive) - present 1190: 30.8 ms at 9203 ms: Driver.WorkerWait (queue worker 0x0) 26.0, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x0) 26.0, batch (gpu) 18.7, Driver.Packet (queue worker 0x0) 4.5 - present 1192: 24.6 ms at 9258 ms: Driver.WorkerWait (queue worker 0x0) 21.5, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x0) 21.5, batch (gpu) 20.0, Driver.Packet (queue worker 0x0) 2.9 - present 1189: 24.6 ms at 9178 ms: Driver.WorkerWait (queue worker 0x0) 21.2, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x0) 21.2, batch (gpu) 19.8, Graphics.Draw (draw committer) 3.1 this PR: **seconds 15:10** from present 897: 600 presents, frame p50 16.7 / p90 16.9 / p99 16.9 / max 17.4 ms, GPU busy 9.5 ms per present NVIDIA GeForce RTX 4060, NVIDIA 621.14, Windows 10.0.19045, 3840x2160, commit 832c2d612670, dropped: no **Slowest frames** (largest slices inside each, inclusive) - present 1368: 17.4 ms at 7858 ms: Driver.WorkerWait (queue worker 0x0) 13.7, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x0) 13.7, batch (gpu) 9.5, Graphics.Draw (draw committer) 3.4 - present 1371: 17.0 ms at 7908 ms: Driver.WorkerWait (queue worker 0x0) 13.5, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x0) 13.5, batch (gpu) 9.7, Graphics.Draw (draw committer) 3.3 - present 1016: 17.0 ms at 1985 ms: Driver.WorkerWait (queue worker 0x0) 14.8, Driver.WorkerWait.idle_and_completion_poll (queue worker 0x0) 14.8, batch (gpu) 9.5, VideoOut.Flip (presenter) 4.8 ``` The traces can be shared on request; they could not be attached from the command line. Not measured: AMD and Intel GPUs, Linux, large compute programs (the analysis cost scales with the program; a budget overrun keeps every select). Runs on other vendors would help. ### Checklist <!-- Rules behind each item: https://github.com/boykopovar/AnyPS5/blob/main/CONTRIBUTING.md --> - [x] Based on current `main`; no other open PR implements the same functions - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except [technical debt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed under Silent stubs in their library's [technical debt](https://github.com/boykopovar/AnyPS5/tree/main/docs/dev/debt) file - [x] No notes, investigation `.md` files or images added to the repository (attach them to this PR) - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: none - [x] Fixes: none - [x] Unblocks: PPSA99051 #17060 - [x] GPUs tested: NVIDIA GeForce RTX 4060, driver 621.14, Windows 10 22H2 (19045) - [x] AI-assisted: yes 🤖 Generated with [Claude Code](https://claude.com/claude-code)
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!17227
No description provided.