perf(shader): skip fault checks dominated by the same check #15795

Merged
Pipodi merged 2 commits from upstream-pr/15795 into main 2026-11-04 19:19:00 +00:00
Pipodi commented 2026-11-04 16:12:02 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Pipodi on 2026-11-04T16:12:02Z.


What

Skips an invalid-descriptor fault check of a GPU-descriptor buffer access, and the swizzle-selector check of a formatted load, when an identical check on the same descriptor under the same execution guard already sits earlier in the same IR block or in a dominating block. The fault record is first-writer-wins and the invocation stops at the first failing check, so a dominated repeat cannot change the record; only the pc stored for a fault that two invocations race to record can differ. Scalar buffer reads carry no descriptor-flag check on main and are untouched. APS5_NO_FAULT_CHECK_DEDUP restores every check. The row is in docs/dev/ENVIRONMENT.md and the gap in docs/dev/debt/shader.md.

agc_driver_fault_check_dedup (new, 0.4 s) recompiles hand-assembled compute programs that load through a reserved-bit V# with the dedup on and with APS5_NO_FAULT_CHECK_DEDUP in one process, counts record_bda_fault calls in the SPIR-V (removed: straight line 2, vector load in a uniform if 2, join pair after a skipped if 1, divergent if 1, repeat of the second descriptor 1; kept: other exec mask, empty exec mask, other descriptor), runs both on the GPU and compares the logged fault (address, pc, bytes, stage, reason) and the output for every valid/invalid combination of two descriptors.

Tested

Windows 11 Pro 10.0.26300, NVIDIA GeForce RTX 4090 (driver 617.42), Vulkan SDK 1.4.363.0. Based on main b11c7bf84f. Game captures are below (warm runs of Ghost of Yōtei).

  • Build: build-test (Release, SPIRV-Tools off), ninja -k 0 and libs build. Full ctest: main 4005 tests, 4 fail; this PR 4006 tests, the same 4 fail: test_registration and select_tests_MissingCommandTests (Windows symlink privilege, WinError 1314), agc_driver_direct_write_completion, guest_filesystem (exception 0xc0000409). The new test passes. guest_raise_exception timed out once at 60 s in a loaded full run of this PR and passes alone in 13.0 s on both trees.
  • Validation layer, same machine and GPU, main b11c7bf84f and this PR: ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation ctest --test-dir build-test -R '<pattern>' -V over agc_driver_fault_check_dedup (PR only), agc_driver_buffer_load_store, agc_driver_buffer_descriptor_runtime, agc_driver_bda_span_reads, agc_driver_bda_anchor_reads, agc_driver_descriptor_web_faults, agc_driver_buffer_format, agc_driver_gpu_buffer_format, agc_driver_buffer_atomics, agc_driver_buffer_atomic_unaligned, agc_device_fault, agc_bda_atomics, agc_driver_bda_device, agc_driver_draw_unsupported_buffer_type, agc_driver_gcn_buffer_format_lookup, agc_driver_queued_raw_shader. main: 15 of 15 passed, this PR: 16 of 16 passed. Neither log contains was not found but was requested by env var VK_INSTANCE_LAYERS; VUID- lines: 0 on main, 0 on this PR. With VK_LOADER_DEBUG=layer the loader reports env var 'VK_INSTANCE_LAYERS' defined and adding layers "VK_LAYER_KHRONOS_validation" and the new test still prints fault check dedup tests passed. The new test logs the expected BDA access failed ... reason=8 lines in both modes.
  • Offline compile bench (SPIRV-Tools ON build-spvt of main and of this PR, cold NVIDIA GLCache per step moved aside and restored, 1748 files before and after, 3 interleaved passes, env of the run588 extra list plus the inline list with APS5_SPIRV_OPT=large and APS5_SPIRV_LARGE_OPT_MIN_WORDS=400000; main has no large mode, so it runs its default pipeline). Requests are 8 captured compute programs of one title scene; the capture was serialized by a fork format, so the trailing fork-only byte (singleWorkgroup, always 0) was dropped for both trees. Module words, blocks and calls are from the captured SPIR-V; every module passes spirv-val --target-env vulkan1.3. Output hashes are the request bench hash over every written buffer (fill=mix seeds 1-3; fill=small and zero for 801cdd2700, which device-loses on mix).
program words main -> PR main-function blocks record_bda_fault calls cold create main (median of 3) cold create PR (median of 3) change output hash seeds 1-3 GPU median main / PR (ms, seed 1)
801cdd2700 686775 -> 675107 12163 -> 11211 2326 -> 1850 72.03 s 62.98 s -12.6% equal (fill=small) 2.924 / 2.546
80001e5f00 1189826 -> 1189298 12177 -> 12113 758 -> 742 46.41 s 46.34 s -0.1% equal (fill=mix) 14.920 / 7.910
801cb7f200 1069341 -> 1069341 6835 -> 6835 16 -> 16 15.21 s 15.13 s -0.5% equal (fill=mix) 0.338 / 0.333
8000261500 534941 -> 502865 7596 -> 6012 794 -> 398 23.64 s 18.47 s -21.9% equal (fill=mix) 4.940 / 5.219
801cb8de00 609320 -> 609320 4243 -> 4243 0 -> 0 10.45 s 10.46 s +0.0% equal (fill=mix) 0.380 / 0.362
80001fd400 494564 -> 494564 3929 -> 3929 16 -> 16 7.85 s 7.79 s -0.8% equal (fill=mix) 11.182 / 11.325
801cbd2f00 327418 -> 327418 2037 -> 2037 0 -> 0 3.39 s 3.40 s +0.3% equal (fill=mix) 0.205 / 0.226
8068c7f200 526113 -> 526113 4084 -> 4084 80 -> 80 6.37 s 6.36 s -0.2% equal (fill=mix) 0.243 / 0.245

Five of the eight modules are byte-identical (same SHA-256). The GPU medians are single seeds of 5 repeats and noisy (80001e5f00 seed 1 to 3: 14.9, 15.0, 14.9 ms on main against 7.9, 6.7, 13.6 ms on the PR, with equal hashes); they are not a speed claim.

Raw cold pipeline create per pass, module SHA-256 and output hashes

Cold pipeline_create (s); the order inside a pass alternates (main first, PR first, main first):

program tree pass 1 s pass 2 s pass 3 s
801cdd2700 main 72.03 73.14 71.53
801cdd2700 PR 62.98 63.57 62.23
80001e5f00 main 47.84 46.36 46.41
80001e5f00 PR 47.23 46.34 45.21
801cb7f200 main 15.31 15.21 14.80
801cb7f200 PR 15.22 15.13 14.82
8000261500 main 23.66 23.64 23.19
8000261500 PR 18.66 18.47 18.12
801cb8de00 main 10.73 10.45 10.18
801cb8de00 PR 10.50 10.46 10.19
80001fd400 main 7.88 7.85 7.62
80001fd400 PR 7.79 7.85 7.64
801cbd2f00 main 3.39 3.42 3.32
801cbd2f00 PR 3.40 3.46 3.33
8068c7f200 main 6.37 6.41 6.19
8068c7f200 PR 6.36 6.43 6.22

Modules:

program tree words main-function blocks all blocks record_bda_fault calls spirv-val SHA-256
801cdd2700 main 686775 12163 12565 2326 OK 65dc2268113964498c66f60cf7885c422d8e8dd35e2818357cb5c72de7538d87
801cdd2700 PR 675107 11211 11613 1850 OK e86ffefc6805d16905a0189c3b919e81c8bf1938edaa2ac75965fed6c7653dde
80001e5f00 main 1189826 12177 12503 758 OK 670c6c7dc6ba8caf61fcafa41ce499291ba1ab7619f2513420aba9fe2bc53b6d
80001e5f00 PR 1189298 12113 12439 742 OK d227572589768d4fc6a3201a8d237e530b1b88b85ce12500ca29869664e4a32b
801cb7f200 main 1069341 6835 6840 16 OK 915b79bfa9eaebb6c895b1d232fda3ce9cf686647381cf37f9334a10e9fff3f3
801cb7f200 PR 1069341 6835 6840 16 OK 915b79bfa9eaebb6c895b1d232fda3ce9cf686647381cf37f9334a10e9fff3f3
8000261500 main 534941 7596 8003 794 OK 413a151326019cad4b3a841ad9370cb772c6bd705bfbd8a2a4354b4a1529a120
8000261500 PR 502865 6012 6419 398 OK f73862999c61a91d066f93596ec03709683743f2050fa639a60d4e5fdfebc055
801cb8de00 main 609320 4243 4253 0 OK fbea5a2d0e58526ee5b456adad0fcc65ae6b3d2032451b2e2009dad775a41817
801cb8de00 PR 609320 4243 4253 0 OK fbea5a2d0e58526ee5b456adad0fcc65ae6b3d2032451b2e2009dad775a41817
80001fd400 main 494564 3929 3941 16 OK c561498e57fe01851590e27f0c43014801a522e51cbdf75cc6121d529d538b2a
80001fd400 PR 494564 3929 3941 16 OK c561498e57fe01851590e27f0c43014801a522e51cbdf75cc6121d529d538b2a
801cbd2f00 main 327418 2037 2047 0 OK 712f131190a441c29b1b6908a894e964658ecce9d3587ec99955ba0aa0402da3
801cbd2f00 PR 327418 2037 2047 0 OK 712f131190a441c29b1b6908a894e964658ecce9d3587ec99955ba0aa0402da3
8068c7f200 main 526113 4084 4094 80 OK 40d9bbee24e7378d2371f1896894ccf81952c89c96c857582fcc026312b26032
8068c7f200 PR 526113 4084 4094 80 OK 40d9bbee24e7378d2371f1896894ccf81952c89c96c857582fcc026312b26032

Output hashes (agc_driver_request_bench2_tests, 5 repeats):

program fill seed hash main hash PR equal GPU median main (ms) GPU median PR (ms)
80001e5f00 mix 1 1a4f1c0df3008303 1a4f1c0df3008303 yes 14.920 7.910
80001e5f00 mix 2 cdf95945b6c1bc83 cdf95945b6c1bc83 yes 14.998 6.658
80001e5f00 mix 3 2a569656afe68483 2a569656afe68483 yes 14.876 13.594
80001fd400 mix 1 02ac3483d1b3a783 02ac3483d1b3a783 yes 11.182 11.325
80001fd400 mix 2 a106ffbdefc1c383 a106ffbdefc1c383 yes 11.402 11.665
80001fd400 mix 3 38a1bdb9d89fee83 38a1bdb9d89fee83 yes 11.703 11.454
8000261500 mix 1 ec8cbba982d7c103 ec8cbba982d7c103 yes 4.940 5.219
8000261500 mix 2 4dadce562eac9f83 4dadce562eac9f83 yes 5.207 5.242
8000261500 mix 3 5edd07bc71574703 5edd07bc71574703 yes 5.246 5.373
801cb7f200 mix 1 b10ac80bfa9754f1 b10ac80bfa9754f1 yes 0.338 0.333
801cb7f200 mix 2 c685723f9c65bcb4 c685723f9c65bcb4 yes 0.330 0.347
801cb7f200 mix 3 f45f3fec48fd8c6b f45f3fec48fd8c6b yes 0.379 0.360
801cb8de00 mix 1 63502f78cec82a2e 63502f78cec82a2e yes 0.380 0.362
801cb8de00 mix 2 701b4d0710adc187 701b4d0710adc187 yes 0.433 0.373
801cb8de00 mix 3 ef243f9758ac8777 ef243f9758ac8777 yes 0.367 0.367
801cbd2f00 mix 1 16361509255e0b54 16361509255e0b54 yes 0.205 0.226
801cbd2f00 mix 2 044717d17cbd3128 044717d17cbd3128 yes 0.204 0.214
801cbd2f00 mix 3 5f124543f6dc9ff6 5f124543f6dc9ff6 yes 0.208 0.214
801cdd2700 small 1 97e30eb7f64933c2 97e30eb7f64933c2 yes 2.924 2.546
801cdd2700 small 2 082ee9aa33ec31d6 082ee9aa33ec31d6 yes 1.047 0.842
801cdd2700 small 3 597af73725bf22b3 597af73725bf22b3 yes 1.986 1.528
801cdd2700 zero 1 f73e8a364c5a47db f73e8a364c5a47db yes 0.147 0.146
801cdd2700 zero 2 f73e8a364c5a47db f73e8a364c5a47db yes 0.153 0.152
801cdd2700 zero 3 f73e8a364c5a47db f73e8a364c5a47db yes 0.175 0.143
8068c7f200 mix 1 4b92acf449b76836 4b92acf449b76836 yes 0.243 0.245
8068c7f200 mix 2 841bfd2ea647e133 841bfd2ea647e133 yes 0.237 0.249
8068c7f200 mix 3 75121ee2f967e4c6 75121ee2f967e4c6 yes 0.236 0.273
  • Game captures, warm, same machine and scene (Ghost of Yōtei PPSA26344, 3840x2160, shader and NVIDIA caches warmed by a first run of each build), APS5_TRACE_FRAMES=250:30 only, order A1 main b11c7bf84f, B1 this PR c1cf922bb1, A2 main, one run each. The window is frames 250-280 of a warm run. It does not include the cold compiles this change speeds up, so these captures are a runtime no-regression check; the compile claim rests on the offline bench above.
Summary lines (A1, B1, A2)
{"commit":"b11c7bf84f5d","dirty":false,"env":{"APS5_TRACE_FRAMES":"250:30"},"gpu":"NVIDIA GeForce RTX 4090","driver":"NVIDIA 617.42","os":"Windows 10.0.26300","cpu":"13th Gen Intel(R) Core(TM) i9-13900K","cpu_threads":32,"memory_mib":32476,"title_id":"PPSA26344","title":"Ghost of Yōtei","content_version":"01.008.000","resolution":"3840x2160","window":{"spec":"frames 250:30","first_present":250,"ms":4988.621},"presents":30,"frame_ms":{"p50":110.615,"p90":225.827,"p99":1141.923,"max":1141.923},"gpu_busy_ms_per_present":58.903,"worker_busy_pct":{"queue worker 0x0":66.920,"queue worker 0x52":0.000,"queue worker 0x53":0.000,"queue worker 0x20":10.596,"queue worker 0x30":54.988,"queue worker 0x38":58.907,"queue worker 0x48":3.551},"top_phases_ms_per_frame":{"Driver.Packet":322.282,"Shader.PrepareArtifact":243.366,"Driver.Packet.memory_wait":165.526,"Driver.Packet.dispatch":96.459,"Shader.Register":66.441,"Driver.Packet.prepare_memory":49.586,"Driver.Dispatch":44.218,"Graphics.Draw":41.496},"trace_dropped":false,"trace":"aps5-trace-b11c7bf84f5d-31588.json.gz"}
{"commit":"c1cf922bb1d2","dirty":false,"env":{"APS5_TRACE_FRAMES":"250:30"},"gpu":"NVIDIA GeForce RTX 4090","driver":"NVIDIA 617.42","os":"Windows 10.0.26300","cpu":"13th Gen Intel(R) Core(TM) i9-13900K","cpu_threads":32,"memory_mib":32476,"title_id":"PPSA26344","title":"Ghost of Yōtei","content_version":"01.008.000","resolution":"3840x2160","window":{"spec":"frames 250:30","first_present":250,"ms":4306.997},"presents":30,"frame_ms":{"p50":110.097,"p90":224.726,"p99":518.029,"max":518.029},"gpu_busy_ms_per_present":57.043,"worker_busy_pct":{"queue worker 0x0":78.169,"queue worker 0x52":0.000,"queue worker 0x53":0.000,"queue worker 0x20":12.321,"queue worker 0x30":64.240,"queue worker 0x38":67.956,"queue worker 0x48":4.560},"top_phases_ms_per_frame":{"Driver.Packet":324.682,"Driver.Packet.memory_wait":166.590,"Shader.PrepareArtifact":102.910,"Driver.Packet.dispatch":98.853,"Driver.Packet.prepare_memory":49.948,"Driver.Dispatch":44.694,"Graphics.Draw":41.092,"Graphics.Draw.draw_and_resource_release":41.041},"trace_dropped":false,"trace":"aps5-trace-c1cf922bb1d2-34228.json.gz"}
{"commit":"b11c7bf84f5d","dirty":false,"env":{"APS5_TRACE_FRAMES":"250:30"},"gpu":"NVIDIA GeForce RTX 4090","driver":"NVIDIA 617.42","os":"Windows 10.0.26300","cpu":"13th Gen Intel(R) Core(TM) i9-13900K","cpu_threads":32,"memory_mib":32476,"title_id":"PPSA26344","title":"Ghost of Yōtei","content_version":"01.008.000","resolution":"3840x2160","window":{"spec":"frames 250:30","first_present":250,"ms":4957.723},"presents":30,"frame_ms":{"p50":109.183,"p90":207.623,"p99":1155.769,"max":1155.769},"gpu_busy_ms_per_present":57.848,"worker_busy_pct":{"queue worker 0x0":66.191,"queue worker 0x52":0.000,"queue worker 0x53":0.000,"queue worker 0x20":11.348,"queue worker 0x30":55.732,"queue worker 0x38":58.837,"queue worker 0x48":4.001},"top_phases_ms_per_frame":{"Driver.Packet":322.788,"Shader.PrepareArtifact":243.340,"Driver.Packet.memory_wait":167.704,"Driver.Packet.dispatch":96.475,"Shader.Register":67.338,"Driver.Packet.prepare_memory":49.899,"Driver.Dispatch":41.730,"Graphics.Draw":41.117},"trace_dropped":false,"trace":"aps5-trace-b11c7bf84f5d-36564.json.gz"}
commit window time (ms) frame p50 / p90 (ms) gpu busy per present (ms) busiest worker
A1 main b11c7bf84f 4988.6 110.6 / 225.8 58.9 queue worker 0x0, 66.9 %
B1 PR c1cf922bb1 4307.0 110.1 / 224.7 57.0 queue worker 0x0, 78.2 %
A2 main b11c7bf84f 4957.7 109.2 / 207.6 57.8 queue worker 0x0, 66.2 %

python -I tools/trace_digest.py <trace>, ms per frame (29 frames), the hottest thread (queue worker 0x0) and the other threads that carry the Shader and Graphics phases:

thread, largest slice A1 main B1 PR A2 main
queue worker 0x0 busy, Driver.Packet 99.1 (59 %), 110.7 100.7 (69 %), 111.7 101.3 (60 %), 108.8
queue worker 0x0 wait 67.8 42.9 64.7
queue worker 0x38 busy, Driver.Packet 32.7, 97.5 33.7, 97.5 33.4, 97.3
title thread busy, Shader.Register 66.2 39.7 67.2
shader prepare threads, Shader.PrepareArtifact (sum of 16-17 threads) 251.6 106.6 251.8
draw committer busy, Graphics.Draw 40.1, 41.6 39.7, 41.2 39.8, 41.1
gpu busy, batch 58.9 56.9 57.7

The hottest thread and the graphics and GPU rows are equal within run spread; the PR's shorter window and lower Shader.Register and Shader.PrepareArtifact come from the two 1.1 s frames that both main runs hit around present 275 (3.55 s of inclusive PrepareArtifact in them) and the PR run did not, which a single pair of runs cannot attribute to the change. The three traces are available on request.

Checklist

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

🤖 Generated with Claude Code

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5157570850 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/15795). Originally posted by [Pipodi](https://github.com/Pipodi) on 2026-11-04T16:12:02Z. --- ### What Skips an invalid-descriptor fault check of a GPU-descriptor buffer access, and the swizzle-selector check of a formatted load, when an identical check on the same descriptor under the same execution guard already sits earlier in the same IR block or in a dominating block. The fault record is first-writer-wins and the invocation stops at the first failing check, so a dominated repeat cannot change the record; only the pc stored for a fault that two invocations race to record can differ. Scalar buffer reads carry no descriptor-flag check on `main` and are untouched. `APS5_NO_FAULT_CHECK_DEDUP` restores every check. The row is in `docs/dev/ENVIRONMENT.md` and the gap in `docs/dev/debt/shader.md`. `agc_driver_fault_check_dedup` (new, 0.4 s) recompiles hand-assembled compute programs that load through a reserved-bit V# with the dedup on and with `APS5_NO_FAULT_CHECK_DEDUP` in one process, counts `record_bda_fault` calls in the SPIR-V (removed: straight line 2, vector load in a uniform if 2, join pair after a skipped if 1, divergent if 1, repeat of the second descriptor 1; kept: other exec mask, empty exec mask, other descriptor), runs both on the GPU and compares the logged fault (address, pc, bytes, stage, reason) and the output for every valid/invalid combination of two descriptors. ### Tested <!-- OS, title or homebrew, what was checked. "Not tested" is a valid answer. A performance change: the summary lines of main and of this PR from the same machine and scene, with the traces attached, captured as the Performance report issue form describes. --> Windows 11 Pro 10.0.26300, NVIDIA GeForce RTX 4090 (driver 617.42), Vulkan SDK 1.4.363.0. Based on `main` b11c7bf84f. Game captures are below (warm runs of Ghost of Yōtei). - Build: `build-test` (Release, SPIRV-Tools off), `ninja -k 0` and `libs` build. Full `ctest`: `main` 4005 tests, 4 fail; this PR 4006 tests, the same 4 fail: `test_registration` and `select_tests_MissingCommandTests` (Windows symlink privilege, `WinError 1314`), `agc_driver_direct_write_completion`, `guest_filesystem` (exception 0xc0000409). The new test passes. `guest_raise_exception` timed out once at 60 s in a loaded full run of this PR and passes alone in 13.0 s on both trees. - Validation layer, same machine and GPU, `main` b11c7bf84f and this PR: `ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation ctest --test-dir build-test -R '<pattern>' -V` over `agc_driver_fault_check_dedup` (PR only), `agc_driver_buffer_load_store`, `agc_driver_buffer_descriptor_runtime`, `agc_driver_bda_span_reads`, `agc_driver_bda_anchor_reads`, `agc_driver_descriptor_web_faults`, `agc_driver_buffer_format`, `agc_driver_gpu_buffer_format`, `agc_driver_buffer_atomics`, `agc_driver_buffer_atomic_unaligned`, `agc_device_fault`, `agc_bda_atomics`, `agc_driver_bda_device`, `agc_driver_draw_unsupported_buffer_type`, `agc_driver_gcn_buffer_format_lookup`, `agc_driver_queued_raw_shader`. `main`: 15 of 15 passed, this PR: 16 of 16 passed. Neither log contains `was not found but was requested by env var VK_INSTANCE_LAYERS`; `VUID-` lines: 0 on `main`, 0 on this PR. With `VK_LOADER_DEBUG=layer` the loader reports `env var 'VK_INSTANCE_LAYERS' defined and adding layers "VK_LAYER_KHRONOS_validation"` and the new test still prints `fault check dedup tests passed`. The new test logs the expected `BDA access failed ... reason=8` lines in both modes. - Offline compile bench (SPIRV-Tools ON `build-spvt` of `main` and of this PR, cold NVIDIA GLCache per step moved aside and restored, 1748 files before and after, 3 interleaved passes, env of the `run588` extra list plus the inline list with `APS5_SPIRV_OPT=large` and `APS5_SPIRV_LARGE_OPT_MIN_WORDS=400000`; `main` has no `large` mode, so it runs its default pipeline). Requests are 8 captured compute programs of one title scene; the capture was serialized by a fork format, so the trailing fork-only byte (`singleWorkgroup`, always 0) was dropped for both trees. Module words, blocks and calls are from the captured SPIR-V; every module passes `spirv-val --target-env vulkan1.3`. Output hashes are the request bench hash over every written buffer (fill=mix seeds 1-3; fill=small and zero for 801cdd2700, which device-loses on mix). | program | words main -> PR | main-function blocks | `record_bda_fault` calls | cold create main (median of 3) | cold create PR (median of 3) | change | output hash seeds 1-3 | GPU median main / PR (ms, seed 1) | |---|---|---|---|---|---|---|---|---| | 801cdd2700 | 686775 -> 675107 | 12163 -> 11211 | 2326 -> 1850 | 72.03 s | 62.98 s | -12.6% | equal (fill=small) | 2.924 / 2.546 | | 80001e5f00 | 1189826 -> 1189298 | 12177 -> 12113 | 758 -> 742 | 46.41 s | 46.34 s | -0.1% | equal (fill=mix) | 14.920 / 7.910 | | 801cb7f200 | 1069341 -> 1069341 | 6835 -> 6835 | 16 -> 16 | 15.21 s | 15.13 s | -0.5% | equal (fill=mix) | 0.338 / 0.333 | | 8000261500 | 534941 -> 502865 | 7596 -> 6012 | 794 -> 398 | 23.64 s | 18.47 s | -21.9% | equal (fill=mix) | 4.940 / 5.219 | | 801cb8de00 | 609320 -> 609320 | 4243 -> 4243 | 0 -> 0 | 10.45 s | 10.46 s | +0.0% | equal (fill=mix) | 0.380 / 0.362 | | 80001fd400 | 494564 -> 494564 | 3929 -> 3929 | 16 -> 16 | 7.85 s | 7.79 s | -0.8% | equal (fill=mix) | 11.182 / 11.325 | | 801cbd2f00 | 327418 -> 327418 | 2037 -> 2037 | 0 -> 0 | 3.39 s | 3.40 s | +0.3% | equal (fill=mix) | 0.205 / 0.226 | | 8068c7f200 | 526113 -> 526113 | 4084 -> 4084 | 80 -> 80 | 6.37 s | 6.36 s | -0.2% | equal (fill=mix) | 0.243 / 0.245 | Five of the eight modules are byte-identical (same SHA-256). The GPU medians are single seeds of 5 repeats and noisy (80001e5f00 seed 1 to 3: 14.9, 15.0, 14.9 ms on `main` against 7.9, 6.7, 13.6 ms on the PR, with equal hashes); they are not a speed claim. <details><summary>Raw cold pipeline create per pass, module SHA-256 and output hashes</summary> Cold `pipeline_create` (s); the order inside a pass alternates (main first, PR first, main first): | program | tree | pass 1 s | pass 2 s | pass 3 s | |---|---|---|---|---| | 801cdd2700 | main | 72.03 | 73.14 | 71.53 | | 801cdd2700 | PR | 62.98 | 63.57 | 62.23 | | 80001e5f00 | main | 47.84 | 46.36 | 46.41 | | 80001e5f00 | PR | 47.23 | 46.34 | 45.21 | | 801cb7f200 | main | 15.31 | 15.21 | 14.80 | | 801cb7f200 | PR | 15.22 | 15.13 | 14.82 | | 8000261500 | main | 23.66 | 23.64 | 23.19 | | 8000261500 | PR | 18.66 | 18.47 | 18.12 | | 801cb8de00 | main | 10.73 | 10.45 | 10.18 | | 801cb8de00 | PR | 10.50 | 10.46 | 10.19 | | 80001fd400 | main | 7.88 | 7.85 | 7.62 | | 80001fd400 | PR | 7.79 | 7.85 | 7.64 | | 801cbd2f00 | main | 3.39 | 3.42 | 3.32 | | 801cbd2f00 | PR | 3.40 | 3.46 | 3.33 | | 8068c7f200 | main | 6.37 | 6.41 | 6.19 | | 8068c7f200 | PR | 6.36 | 6.43 | 6.22 | Modules: | program | tree | words | main-function blocks | all blocks | `record_bda_fault` calls | spirv-val | SHA-256 | |---|---|---|---|---|---|---|---| | 801cdd2700 | main | 686775 | 12163 | 12565 | 2326 | OK | `65dc2268113964498c66f60cf7885c422d8e8dd35e2818357cb5c72de7538d87` | | 801cdd2700 | PR | 675107 | 11211 | 11613 | 1850 | OK | `e86ffefc6805d16905a0189c3b919e81c8bf1938edaa2ac75965fed6c7653dde` | | 80001e5f00 | main | 1189826 | 12177 | 12503 | 758 | OK | `670c6c7dc6ba8caf61fcafa41ce499291ba1ab7619f2513420aba9fe2bc53b6d` | | 80001e5f00 | PR | 1189298 | 12113 | 12439 | 742 | OK | `d227572589768d4fc6a3201a8d237e530b1b88b85ce12500ca29869664e4a32b` | | 801cb7f200 | main | 1069341 | 6835 | 6840 | 16 | OK | `915b79bfa9eaebb6c895b1d232fda3ce9cf686647381cf37f9334a10e9fff3f3` | | 801cb7f200 | PR | 1069341 | 6835 | 6840 | 16 | OK | `915b79bfa9eaebb6c895b1d232fda3ce9cf686647381cf37f9334a10e9fff3f3` | | 8000261500 | main | 534941 | 7596 | 8003 | 794 | OK | `413a151326019cad4b3a841ad9370cb772c6bd705bfbd8a2a4354b4a1529a120` | | 8000261500 | PR | 502865 | 6012 | 6419 | 398 | OK | `f73862999c61a91d066f93596ec03709683743f2050fa639a60d4e5fdfebc055` | | 801cb8de00 | main | 609320 | 4243 | 4253 | 0 | OK | `fbea5a2d0e58526ee5b456adad0fcc65ae6b3d2032451b2e2009dad775a41817` | | 801cb8de00 | PR | 609320 | 4243 | 4253 | 0 | OK | `fbea5a2d0e58526ee5b456adad0fcc65ae6b3d2032451b2e2009dad775a41817` | | 80001fd400 | main | 494564 | 3929 | 3941 | 16 | OK | `c561498e57fe01851590e27f0c43014801a522e51cbdf75cc6121d529d538b2a` | | 80001fd400 | PR | 494564 | 3929 | 3941 | 16 | OK | `c561498e57fe01851590e27f0c43014801a522e51cbdf75cc6121d529d538b2a` | | 801cbd2f00 | main | 327418 | 2037 | 2047 | 0 | OK | `712f131190a441c29b1b6908a894e964658ecce9d3587ec99955ba0aa0402da3` | | 801cbd2f00 | PR | 327418 | 2037 | 2047 | 0 | OK | `712f131190a441c29b1b6908a894e964658ecce9d3587ec99955ba0aa0402da3` | | 8068c7f200 | main | 526113 | 4084 | 4094 | 80 | OK | `40d9bbee24e7378d2371f1896894ccf81952c89c96c857582fcc026312b26032` | | 8068c7f200 | PR | 526113 | 4084 | 4094 | 80 | OK | `40d9bbee24e7378d2371f1896894ccf81952c89c96c857582fcc026312b26032` | Output hashes (`agc_driver_request_bench2_tests`, 5 repeats): | program | fill | seed | hash main | hash PR | equal | GPU median main (ms) | GPU median PR (ms) | |---|---|---|---|---|---|---|---| | 80001e5f00 | mix | 1 | `1a4f1c0df3008303` | `1a4f1c0df3008303` | yes | 14.920 | 7.910 | | 80001e5f00 | mix | 2 | `cdf95945b6c1bc83` | `cdf95945b6c1bc83` | yes | 14.998 | 6.658 | | 80001e5f00 | mix | 3 | `2a569656afe68483` | `2a569656afe68483` | yes | 14.876 | 13.594 | | 80001fd400 | mix | 1 | `02ac3483d1b3a783` | `02ac3483d1b3a783` | yes | 11.182 | 11.325 | | 80001fd400 | mix | 2 | `a106ffbdefc1c383` | `a106ffbdefc1c383` | yes | 11.402 | 11.665 | | 80001fd400 | mix | 3 | `38a1bdb9d89fee83` | `38a1bdb9d89fee83` | yes | 11.703 | 11.454 | | 8000261500 | mix | 1 | `ec8cbba982d7c103` | `ec8cbba982d7c103` | yes | 4.940 | 5.219 | | 8000261500 | mix | 2 | `4dadce562eac9f83` | `4dadce562eac9f83` | yes | 5.207 | 5.242 | | 8000261500 | mix | 3 | `5edd07bc71574703` | `5edd07bc71574703` | yes | 5.246 | 5.373 | | 801cb7f200 | mix | 1 | `b10ac80bfa9754f1` | `b10ac80bfa9754f1` | yes | 0.338 | 0.333 | | 801cb7f200 | mix | 2 | `c685723f9c65bcb4` | `c685723f9c65bcb4` | yes | 0.330 | 0.347 | | 801cb7f200 | mix | 3 | `f45f3fec48fd8c6b` | `f45f3fec48fd8c6b` | yes | 0.379 | 0.360 | | 801cb8de00 | mix | 1 | `63502f78cec82a2e` | `63502f78cec82a2e` | yes | 0.380 | 0.362 | | 801cb8de00 | mix | 2 | `701b4d0710adc187` | `701b4d0710adc187` | yes | 0.433 | 0.373 | | 801cb8de00 | mix | 3 | `ef243f9758ac8777` | `ef243f9758ac8777` | yes | 0.367 | 0.367 | | 801cbd2f00 | mix | 1 | `16361509255e0b54` | `16361509255e0b54` | yes | 0.205 | 0.226 | | 801cbd2f00 | mix | 2 | `044717d17cbd3128` | `044717d17cbd3128` | yes | 0.204 | 0.214 | | 801cbd2f00 | mix | 3 | `5f124543f6dc9ff6` | `5f124543f6dc9ff6` | yes | 0.208 | 0.214 | | 801cdd2700 | small | 1 | `97e30eb7f64933c2` | `97e30eb7f64933c2` | yes | 2.924 | 2.546 | | 801cdd2700 | small | 2 | `082ee9aa33ec31d6` | `082ee9aa33ec31d6` | yes | 1.047 | 0.842 | | 801cdd2700 | small | 3 | `597af73725bf22b3` | `597af73725bf22b3` | yes | 1.986 | 1.528 | | 801cdd2700 | zero | 1 | `f73e8a364c5a47db` | `f73e8a364c5a47db` | yes | 0.147 | 0.146 | | 801cdd2700 | zero | 2 | `f73e8a364c5a47db` | `f73e8a364c5a47db` | yes | 0.153 | 0.152 | | 801cdd2700 | zero | 3 | `f73e8a364c5a47db` | `f73e8a364c5a47db` | yes | 0.175 | 0.143 | | 8068c7f200 | mix | 1 | `4b92acf449b76836` | `4b92acf449b76836` | yes | 0.243 | 0.245 | | 8068c7f200 | mix | 2 | `841bfd2ea647e133` | `841bfd2ea647e133` | yes | 0.237 | 0.249 | | 8068c7f200 | mix | 3 | `75121ee2f967e4c6` | `75121ee2f967e4c6` | yes | 0.236 | 0.273 | </details> - Game captures, warm, same machine and scene (Ghost of Yōtei PPSA26344, 3840x2160, shader and NVIDIA caches warmed by a first run of each build), `APS5_TRACE_FRAMES=250:30` only, order A1 `main` b11c7bf84f, B1 this PR c1cf922bb1, A2 `main`, one run each. The window is frames 250-280 of a warm run. It does not include the cold compiles this change speeds up, so these captures are a runtime no-regression check; the compile claim rests on the offline bench above. <details><summary>Summary lines (A1, B1, A2)</summary> ```json {"commit":"b11c7bf84f5d","dirty":false,"env":{"APS5_TRACE_FRAMES":"250:30"},"gpu":"NVIDIA GeForce RTX 4090","driver":"NVIDIA 617.42","os":"Windows 10.0.26300","cpu":"13th Gen Intel(R) Core(TM) i9-13900K","cpu_threads":32,"memory_mib":32476,"title_id":"PPSA26344","title":"Ghost of Yōtei","content_version":"01.008.000","resolution":"3840x2160","window":{"spec":"frames 250:30","first_present":250,"ms":4988.621},"presents":30,"frame_ms":{"p50":110.615,"p90":225.827,"p99":1141.923,"max":1141.923},"gpu_busy_ms_per_present":58.903,"worker_busy_pct":{"queue worker 0x0":66.920,"queue worker 0x52":0.000,"queue worker 0x53":0.000,"queue worker 0x20":10.596,"queue worker 0x30":54.988,"queue worker 0x38":58.907,"queue worker 0x48":3.551},"top_phases_ms_per_frame":{"Driver.Packet":322.282,"Shader.PrepareArtifact":243.366,"Driver.Packet.memory_wait":165.526,"Driver.Packet.dispatch":96.459,"Shader.Register":66.441,"Driver.Packet.prepare_memory":49.586,"Driver.Dispatch":44.218,"Graphics.Draw":41.496},"trace_dropped":false,"trace":"aps5-trace-b11c7bf84f5d-31588.json.gz"} {"commit":"c1cf922bb1d2","dirty":false,"env":{"APS5_TRACE_FRAMES":"250:30"},"gpu":"NVIDIA GeForce RTX 4090","driver":"NVIDIA 617.42","os":"Windows 10.0.26300","cpu":"13th Gen Intel(R) Core(TM) i9-13900K","cpu_threads":32,"memory_mib":32476,"title_id":"PPSA26344","title":"Ghost of Yōtei","content_version":"01.008.000","resolution":"3840x2160","window":{"spec":"frames 250:30","first_present":250,"ms":4306.997},"presents":30,"frame_ms":{"p50":110.097,"p90":224.726,"p99":518.029,"max":518.029},"gpu_busy_ms_per_present":57.043,"worker_busy_pct":{"queue worker 0x0":78.169,"queue worker 0x52":0.000,"queue worker 0x53":0.000,"queue worker 0x20":12.321,"queue worker 0x30":64.240,"queue worker 0x38":67.956,"queue worker 0x48":4.560},"top_phases_ms_per_frame":{"Driver.Packet":324.682,"Driver.Packet.memory_wait":166.590,"Shader.PrepareArtifact":102.910,"Driver.Packet.dispatch":98.853,"Driver.Packet.prepare_memory":49.948,"Driver.Dispatch":44.694,"Graphics.Draw":41.092,"Graphics.Draw.draw_and_resource_release":41.041},"trace_dropped":false,"trace":"aps5-trace-c1cf922bb1d2-34228.json.gz"} {"commit":"b11c7bf84f5d","dirty":false,"env":{"APS5_TRACE_FRAMES":"250:30"},"gpu":"NVIDIA GeForce RTX 4090","driver":"NVIDIA 617.42","os":"Windows 10.0.26300","cpu":"13th Gen Intel(R) Core(TM) i9-13900K","cpu_threads":32,"memory_mib":32476,"title_id":"PPSA26344","title":"Ghost of Yōtei","content_version":"01.008.000","resolution":"3840x2160","window":{"spec":"frames 250:30","first_present":250,"ms":4957.723},"presents":30,"frame_ms":{"p50":109.183,"p90":207.623,"p99":1155.769,"max":1155.769},"gpu_busy_ms_per_present":57.848,"worker_busy_pct":{"queue worker 0x0":66.191,"queue worker 0x52":0.000,"queue worker 0x53":0.000,"queue worker 0x20":11.348,"queue worker 0x30":55.732,"queue worker 0x38":58.837,"queue worker 0x48":4.001},"top_phases_ms_per_frame":{"Driver.Packet":322.788,"Shader.PrepareArtifact":243.340,"Driver.Packet.memory_wait":167.704,"Driver.Packet.dispatch":96.475,"Shader.Register":67.338,"Driver.Packet.prepare_memory":49.899,"Driver.Dispatch":41.730,"Graphics.Draw":41.117},"trace_dropped":false,"trace":"aps5-trace-b11c7bf84f5d-36564.json.gz"} ``` </details> | | commit | window time (ms) | frame p50 / p90 (ms) | gpu busy per present (ms) | busiest worker | |---|---|---|---|---|---| | A1 | `main` b11c7bf84f | 4988.6 | 110.6 / 225.8 | 58.9 | queue worker 0x0, 66.9 % | | B1 | PR c1cf922bb1 | 4307.0 | 110.1 / 224.7 | 57.0 | queue worker 0x0, 78.2 % | | A2 | `main` b11c7bf84f | 4957.7 | 109.2 / 207.6 | 57.8 | queue worker 0x0, 66.2 % | `python -I tools/trace_digest.py <trace>`, ms per frame (29 frames), the hottest thread (queue worker 0x0) and the other threads that carry the Shader and Graphics phases: | thread, largest slice | A1 `main` | B1 PR | A2 `main` | |---|---|---|---| | queue worker 0x0 busy, Driver.Packet | 99.1 (59 %), 110.7 | 100.7 (69 %), 111.7 | 101.3 (60 %), 108.8 | | queue worker 0x0 wait | 67.8 | 42.9 | 64.7 | | queue worker 0x38 busy, Driver.Packet | 32.7, 97.5 | 33.7, 97.5 | 33.4, 97.3 | | title thread busy, Shader.Register | 66.2 | 39.7 | 67.2 | | shader prepare threads, Shader.PrepareArtifact (sum of 16-17 threads) | 251.6 | 106.6 | 251.8 | | draw committer busy, Graphics.Draw | 40.1, 41.6 | 39.7, 41.2 | 39.8, 41.1 | | gpu busy, batch | 58.9 | 56.9 | 57.7 | The hottest thread and the graphics and GPU rows are equal within run spread; the PR's shorter window and lower Shader.Register and Shader.PrepareArtifact come from the two 1.1 s frames that both `main` runs hit around present 275 (3.55 s of inclusive PrepareArtifact in them) and the PR run did not, which a single pair of runs cannot attribute to the change. The three traces are available on request. ### Checklist <!-- Rules behind each item: https://github.com/boykopovar/AnyPS5/blob/main/CONTRIBUTING.md --> - [x] Based on current `main`; no other open PR implements the same functions - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except [technical debt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed under Silent stubs in their library's [technical debt](https://github.com/boykopovar/AnyPS5/tree/main/docs/dev/debt) file - [x] No notes, investigation `.md` files or images added to the repository (attach them to this PR) - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: none - [x] Fixes: none - [x] Unblocks: none - [x] GPUs tested: NVIDIA GeForce RTX 4090, driver 617.42, Windows 11 Pro 10.0.26300 (shader recompiler) - [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!15795
No description provided.