perf(agc): key large image tables and their maps by a hash of their content #17226

Merged
XatiX merged 2 commits from upstream-pr/17226 into main 2026-11-09 19:58:00 +00:00
XatiX commented 2026-11-08 15:23:19 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by XatiX on 2026-11-08T15:23:19Z.


What

A draw's resource cache key carried an image table's content whole: its
descriptor words, samplers, shapes and per-element flags, about 12 words
per element. A draw binding a 14k-entry table built, hashed and compared
a key of that size on every draw. A table over 8192 descriptor words now
enters the key as a marker and two 64-bit hashes of the same content,
computed in four independent lanes (the xxHash64 round), so equal tables
still key equal and a changed element changes the key.

ShaderRecompiler::ElementFlags gains ForEachSet, which visits the set
flags a word at a time, so the per-element flags enter the hash without
a lookup per element.

A draw's resource cache key carried the ImageTableMap binding's words
whole: 136,000 to 260,000 words per pixel stage for a 14k-entry table,
built, hashed and compared on every draw next to the table itself,
already keyed by a hash. A map over 8192 words now enters the key the
same way, as a marker and two 64-bit hashes of its words.

Tested

Windows 11 Pro 26300, NVIDIA GeForce RTX 5080, driver 617.42, MinGW-w64 GCC, Release.

Focused AGC tests (ctest -R '^agc.*(image_table|table|reuse|template|revalid|variant|resource_cache|bda|texture_cache|storage|shader_memory|locks|draw_cache|depth_surface|snapshot|pending|per_use)' -V with ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation), same machine and GPU:

  • main f5fe807353: 100% tests passed, 0 tests failed out of 148, 0 VUID- lines, layer loaded (0 "was not found" lines) - main-focused.log
  • this change: 100% tests passed, 0 tests failed out of 148, 0 VUID- lines, layer loaded (0 "was not found" lines) - H-focused.log

Age of Mythology: Retold (PPSA18653), title screen, idle, APS5_TRACE_SECONDS=60:120 (about 16 presents) after a warm-up run. main here is upstream/main with #15327 and 41f70c5e1c merged, an earlier head of #16437 that fails clock id 20 with EINVAL; the title needs both to run past the title screen (a GPU hang, then an abort on clock 20). Runs alternated with runs of that build; each run of the change is compared with the mean of the runs just before and after it.

Run of the change main + #15327 + 41f70c5e1c, frame p50 (ms) change, frame p50 (ms) difference
H-1 7841 (mean of M-2 and M-3) 7395 -5.7 %
H-2 7870 (mean of M-3 and M-4) 7566 -3.9 %
H-3 7834 (mean of M-4 and M-5) 7266 -7.2 %

Mean difference: -5.6 %.

Summary lines:

{"commit":"57be81439239","dirty":false,"env":{"APS5_TRACE_SECONDS":"60:120"},"gpu":"NVIDIA GeForce RTX 5080","driver":"NVIDIA 617.42","os":"Windows 10.0.26300","cpu":"AMD Ryzen 7 9800X3D 8-Core Processor","cpu_threads":16,"memory_mib":32404,"title_id":"PPSA18653","title":"Age of Mythology: Retold","content_version":"01.043.000","resolution":"3840x2160","window":{"spec":"seconds 60:120","first_present":496,"ms":125470.936},"presents":16,"frame_ms":{"p50":7817.181,"p90":8067.830,"p99":8150.237,"max":8150.237},"gpu_busy_ms_per_present":567.219,"worker_busy_pct":{"queue worker 0x0":99.983},"top_phases_ms_per_frame":{"Driver.Packet":7840.296,"Driver.Packet.draw":7721.676,"Driver.Draw":7721.253,"Driver.Draw.draw_and_resource_release":6617.351,"Graphics.Draw":6592.406,"Graphics.Draw.draw_and_resource_release":6287.131,"Resources.Complete":6090.595,"Driver.Draw.shader_compile_and_link":1083.267},"trace_dropped":false,"trace":"aps5-trace-57be81439239-38472.json.gz"}
{"commit":"4d213d56f93e","dirty":false,"env":{"APS5_TRACE_SECONDS":"60:120"},"gpu":"NVIDIA GeForce RTX 5080","driver":"NVIDIA 617.42","os":"Windows 10.0.26300","cpu":"AMD Ryzen 7 9800X3D 8-Core Processor","cpu_threads":16,"memory_mib":32404,"title_id":"PPSA18653","title":"Age of Mythology: Retold","content_version":"01.043.000","resolution":"3840x2160","window":{"spec":"seconds 60:120","first_present":531,"ms":126385.316},"presents":17,"frame_ms":{"p50":7394.865,"p90":7779.597,"p99":7975.671,"max":7975.671},"gpu_busy_ms_per_present":586.519,"worker_busy_pct":{"queue worker 0x0":99.982},"top_phases_ms_per_frame":{"Driver.Packet":7432.794,"Driver.Packet.draw":7336.243,"Driver.Draw":7335.872,"Driver.Draw.draw_and_resource_release":6249.890,"Graphics.Draw":6226.477,"Graphics.Draw.draw_and_resource_release":6190.530,"Resources.Complete":6135.678,"Driver.Draw.shader_compile_and_link":1067.711},"trace_dropped":false,"trace":"aps5-trace-4d213d56f93e-26756.json.gz"}

Digest, main:

**seconds 60:120** from present 496: 16 presents, frame p50 7817.2 / p90 8067.8 / p99 8150.2 / max 8150.2 ms, GPU busy 567.2 ms per present
NVIDIA GeForce RTX 5080, NVIDIA 617.42, Windows 10.0.26300, 3840x2160, commit 57be81439239, dropped: no

```json
{"commit":"57be81439239","dirty":false,"env":{"APS5_TRACE_SECONDS":"60:120"},"gpu":"NVIDIA GeForce RTX 5080","driver":"NVIDIA 617.42","os":"Windows 10.0.26300","cpu":"AMD Ryzen 7 9800X3D 8-Core Processor","cpu_threads":16,"memory_mib":32404,"title_id":"PPSA18653","title":"Age of Mythology: Retold","content_version":"01.043.000","resolution":"3840x2160","window":{"spec":"seconds 60:120","first_present":496,"ms":125470.936},"presents":16,"frame_ms":{"p50":7817.181,"p90":8067.83,"p99":8150.237,"max":8150.237},"gpu_busy_ms_per_present":567.219,"worker_busy_pct":{"queue worker 0x0":99.983},"top_phases_ms_per_frame":{"Driver.Packet":7840.296,"Driver.Packet.draw":7721.676,"Driver.Draw":7721.253,"Driver.Draw.draw_and_resource_release":6617.351,"Graphics.Draw":6592.406,"Graphics.Draw.draw_and_resource_release":6287.131,"Resources.Complete":6090.595,"Driver.Draw.shader_compile_and_link":1083.267},"trace_dropped":false,"trace":"aps5-trace-57be81439239-38472.json.gz"}

Slowest frames (largest slices inside each, inclusive)

  • present 502: 8150.2 ms at 46810 ms: Driver.Packet (queue worker 0x0) 8142.7, Driver.Packet.draw (queue worker 0x0) 8016.4, Driver.Draw (queue worker 0x0) 8015.8, Driver.Draw.draw_and_resource_release (queue worker 0x0) 6672.9
  • present 503: 8067.8 ms at 54960 ms: Driver.Packet (queue worker 0x0) 8060.1, Driver.Packet.draw (queue worker 0x0) 7918.5, Driver.Draw (queue worker 0x0) 7917.9, Driver.Draw.draw_and_resource_release (queue worker 0x0) 6599.2
  • present 504: 8004.9 ms at 63028 ms: Driver.Packet (queue worker 0x0) 7997.2, Driver.Packet.draw (queue worker 0x0) 7892.5, Driver.Draw (queue worker 0x0) 7891.9, Driver.Draw.draw_and_resource_release (queue worker 0x0) 6585.5
  • present 496: 7911.6 ms at 0 ms: Driver.Packet (queue worker 0x0) 7903.7, Driver.Packet.draw (queue worker 0x0) 7792.7, Driver.Draw (queue worker 0x0) 7792.1, Driver.Draw.draw_and_resource_release (queue worker 0x0) 6691.3
  • present 507: 7888.2 ms at 86685 ms: Driver.Packet (queue worker 0x0) 7880.3, Driver.Packet.draw (queue worker 0x0) 7709.6, Driver.Draw (queue worker 0x0) 7709.1, Driver.Draw.draw_and_resource_release (queue worker 0x0) 6654.8

Persistent spikes (frame time above the fastest frame that separates it from a longer frame; one entry per stall, not per frame)

  • present 502: 8150.2 ms at 46810 ms, persistence 469.7 ms
  • present 496: 7911.6 ms at 0 ms, persistence 189.6 ms
  • present 507: 7888.2 ms at 86685 ms, persistence 81.9 ms
  • present 498: 7857.0 ms at 15688 ms, persistence 80.6 ms
  • present 511: 7733.2 ms at 117738 ms, persistence 52.6 ms

Threads (ms per frame)

thread busy wait untraced in slices < 20 us largest
title 0.0 (0 %) 48.1 (1 %) 7793.9 0.0
queue worker 0x0 7834.0 (100 %) 0.5 (0 %) 7.4 57.8 Driver.Packet 7834.5
draw committer 44.6 (1 %) 0.0 (0 %) 7797.3 0.5 Recorder.Sync 41.6, Recorder.Submit 2.5
presenter 0.6 (0 %) 42.3 (1 %) 7799.0 0.1 VideoOut.Flip 41.8, Driver.Present 1.1
title 0.0 (0 %) 0.0 (0 %) 7841.9 0.0
title 0.0 (0 %) 0.0 (0 %) 7841.9 0.0
title 0.0 (0 %) 0.0 (0 %) 7841.9 0.0
title 0.0 (0 %) 0.0 (0 %) 7841.9 0.0
title 0.0 (0 %) 0.0 (0 %) 7841.9 0.0
gpu 547.0 (7 %) 0.0 (0 %) 7294.9 0.0 batch 547.0

Largest slices (ms per frame, inclusive, all threads): Driver.Packet 7834.5, Driver.Packet.draw 7719.6, Driver.Draw 7719.1, Driver.Draw.draw_and_resource_release 6614.2, Graphics.Draw 6589.3, Graphics.Draw.draw_and_resource_release 6284.6, Resources.Complete 6090.4, Driver.Draw.shader_compile_and_link 1080.6, batch 547.0, Graphics.Draw.validate 286.7

Longest waits

  • Recorder.WaitSerial (title) 109.1 ms at 38992 ms, present 501
  • Driver.Present.render_fence_wait (presenter) 106.8 ms at 38995 ms, present 501
  • Recorder.WaitSerial (title) 102.6 ms at 54960 ms, present 503
  • Driver.Present.render_fence_wait (presenter) 102.1 ms at 54961 ms, present 503
  • Recorder.WaitSerial (title) 66.8 ms at 7912 ms, present 497
  • Driver.Present.render_fence_wait (presenter) 66.7 ms at 7912 ms, present 497
  • Driver.Present.render_fence_wait (presenter) 55.8 ms at 117738 ms, present 511
  • Recorder.WaitSerial (title) 54.2 ms at 117738 ms, present 511
  • Recorder.WaitSerial (title) 51.0 ms at 23545 ms, present 499
  • Driver.Present.render_fence_wait (presenter) 50.8 ms at 23545 ms, present 499

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

  • batch 573: 96.2 ms at 54958 ms, present 502: GPU no ranges; recorded by Recorder.Submit (draw committer) 0.1
  • batch 407: 93.2 ms at 38991 ms, present 500: GPU no ranges; recorded by Recorder.Submit (draw committer) 0.0
  • batch 75: 64.8 ms at 7910 ms, present 496: GPU no ranges; recorded by no CPU slices
  • batch 36: 60.2 ms at 4604 ms, present 496: GPU no ranges; recorded by Driver.Packet (queue worker 0x0) 129.7, Driver.Packet.draw (queue worker 0x0) 129.7, Driver.Draw (queue worker 0x0) 129.7, Resources.Complete (queue worker 0x0) 116.2
  • batch 132: 59.7 ms at 14058 ms, present 497: GPU no ranges; recorded by Driver.Packet (queue worker 0x0) 276.8, Driver.Packet.draw (queue worker 0x0) 276.8, Driver.Draw (queue worker 0x0) 276.8, Driver.Draw.draw_and_resource_release (queue worker 0x0) 242.7

Digest, this change:

seconds 60:120 from present 531: 17 presents, frame p50 7394.9 / p90 7779.6 / p99 7975.7 / max 7975.7 ms, GPU busy 586.5 ms per present
NVIDIA GeForce RTX 5080, NVIDIA 617.42, Windows 10.0.26300, 3840x2160, commit 4d213d56f93e, dropped: no

{"commit":"4d213d56f93e","dirty":false,"env":{"APS5_TRACE_SECONDS":"60:120"},"gpu":"NVIDIA GeForce RTX 5080","driver":"NVIDIA 617.42","os":"Windows 10.0.26300","cpu":"AMD Ryzen 7 9800X3D 8-Core Processor","cpu_threads":16,"memory_mib":32404,"title_id":"PPSA18653","title":"Age of Mythology: Retold","content_version":"01.043.000","resolution":"3840x2160","window":{"spec":"seconds 60:120","first_present":531,"ms":126385.316},"presents":17,"frame_ms":{"p50":7394.865,"p90":7779.597,"p99":7975.671,"max":7975.671},"gpu_busy_ms_per_present":586.519,"worker_busy_pct":{"queue worker 0x0":99.982},"top_phases_ms_per_frame":{"Driver.Packet":7432.794,"Driver.Packet.draw":7336.243,"Driver.Draw":7335.872,"Driver.Draw.draw_and_resource_release":6249.89,"Graphics.Draw":6226.477,"Graphics.Draw.draw_and_resource_release":6190.53,"Resources.Complete":6135.678,"Driver.Draw.shader_compile_and_link":1067.711},"trace_dropped":false,"trace":"aps5-trace-4d213d56f93e-26756.json.gz"}

Slowest frames (largest slices inside each, inclusive)

  • present 531: 7975.7 ms at 0 ms: Driver.Packet (queue worker 0x0) 7967.7, Driver.Packet.draw (queue worker 0x0) 7856.4, Driver.Draw (queue worker 0x0) 7855.7, Driver.Draw.draw_and_resource_release (queue worker 0x0) 6496.6
  • present 532: 7779.6 ms at 7976 ms: Driver.Packet (queue worker 0x0) 7772.2, Driver.Packet.draw (queue worker 0x0) 7684.2, Driver.Draw (queue worker 0x0) 7683.7, Driver.Draw.draw_and_resource_release (queue worker 0x0) 6334.2
  • present 547: 7453.9 ms at 118931 ms: Driver.Packet (queue worker 0x0) 7446.4, Driver.Packet.draw (queue worker 0x0) 7328.9, Driver.Draw (queue worker 0x0) 7328.3, Driver.Draw.draw_and_resource_release (queue worker 0x0) 6275.7
  • present 545: 7453.5 ms at 104076 ms: Driver.Packet (queue worker 0x0) 7446.2, Driver.Packet.draw (queue worker 0x0) 7331.4, Driver.Draw (queue worker 0x0) 7330.9, Driver.Draw.draw_and_resource_release (queue worker 0x0) 6279.7
  • present 533: 7428.5 ms at 15755 ms: Driver.Packet (queue worker 0x0) 7421.4, Driver.Packet.draw (queue worker 0x0) 7343.2, Driver.Draw (queue worker 0x0) 7342.8, Driver.Draw.draw_and_resource_release (queue worker 0x0) 6254.1

Persistent spikes (frame time above the fastest frame that separates it from a longer frame; one entry per stall, not per frame)

  • present 531: 7975.7 ms at 0 ms, persistence 708.1 ms
  • present 547: 7453.9 ms at 118931 ms, persistence 186.3 ms
  • present 540: 7404.3 ms at 67148 ms, persistence 60.2 ms
  • present 545: 7453.5 ms at 104076 ms, persistence 51.1 ms
  • present 543: 7410.6 ms at 89291 ms, persistence 36.8 ms
  • present 536: 7358.6 ms at 37886 ms, persistence 32.4 ms

Threads (ms per frame)

thread busy wait untraced in slices < 20 us largest
title 0.0 (0 %) 28.9 (0 %) 7405.5 0.0
queue worker 0x0 7426.5 (100 %) 0.5 (0 %) 7.4 57.8 Driver.Packet 7427.0, Driver.EndSubmission 0.0
draw committer 25.8 (0 %) 0.0 (0 %) 7408.6 0.5 Recorder.Sync 22.7, Recorder.Submit 2.6
presenter 0.8 (0 %) 25.7 (0 %) 7407.9 0.1 VideoOut.Flip 24.1, Driver.Present 2.4
title 0.0 (0 %) 0.0 (0 %) 7434.4 0.0 Shader.ResolveAbi 0.0
title 0.0 (0 %) 0.0 (0 %) 7434.4 0.0
title 0.0 (0 %) 0.0 (0 %) 7434.4 0.0
title 0.0 (0 %) 0.0 (0 %) 7434.4 0.0
title 0.0 (0 %) 0.0 (0 %) 7434.4 0.0
gpu 589.1 (8 %) 0.0 (0 %) 6845.4 0.0 batch 589.1

Largest slices (ms per frame, inclusive, all threads): Driver.Packet 7427.0, Driver.Packet.draw 7334.1, Driver.Draw 7333.6, Driver.Draw.draw_and_resource_release 6246.8, Graphics.Draw 6223.4, Graphics.Draw.draw_and_resource_release 6188.1, Resources.Complete 6135.5, Driver.Draw.shader_compile_and_link 1065.1, batch 589.1, Shader.DrawStage 172.4

Longest waits

  • Recorder.WaitSerial (title) 102.3 ms at 45244 ms, present 537
  • Driver.Present.render_fence_wait (presenter) 102.2 ms at 45244 ms, present 537
  • Recorder.WaitSerial (title) 53.6 ms at 118931 ms, present 547
  • Driver.Present.render_fence_wait (presenter) 53.2 ms at 118932 ms, present 547
  • Recorder.WaitSerial (title) 51.3 ms at 30559 ms, present 535
  • Driver.Present.render_fence_wait (presenter) 51.2 ms at 30560 ms, present 535
  • Recorder.WaitSerial (title) 48.4 ms at 59791 ms, present 539
  • Recorder.WaitSerial (title) 48.4 ms at 104076 ms, present 545
  • Driver.Present.render_fence_wait (presenter) 47.9 ms at 59792 ms, present 539
  • Driver.Present.render_fence_wait (presenter) 47.9 ms at 104076 ms, present 545

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

  • batch 880: 107.6 ms at 80377 ms, present 541: GPU no ranges; recorded by Driver.Packet (queue worker 0x0) 264.4, Driver.Packet.draw (queue worker 0x0) 264.4, Driver.Draw (queue worker 0x0) 264.4, Resources.Complete (queue worker 0x0) 236.4
  • batch 216: 107.0 ms at 21580 ms, present 533: GPU no ranges; recorded by Driver.Packet (queue worker 0x0) 257.2, Driver.Packet.draw (queue worker 0x0) 257.2, Driver.Draw (queue worker 0x0) 257.2, Resources.Complete (queue worker 0x0) 233.3
  • batch 963: 105.5 ms at 87729 ms, present 542: GPU no ranges; recorded by Driver.Packet (queue worker 0x0) 265.9, Driver.Packet.draw (queue worker 0x0) 265.9, Driver.Draw (queue worker 0x0) 265.9, Resources.Complete (queue worker 0x0) 236.1
  • batch 792: 96.4 ms at 71939 ms, present 540: GPU no ranges; recorded by Driver.Packet (queue worker 0x0) 250.5, Driver.Packet.draw (queue worker 0x0) 250.4, Driver.Draw (queue worker 0x0) 250.4, Resources.Complete (queue worker 0x0) 220.7
  • batch 491: 96.0 ms at 45243 ms, present 536: GPU no ranges; recorded by no CPU slices

The two traces and both test logs are attached.

main-focused.log

H-focused.log

main-aps5-trace-57be81439239-38472.json.gz

change-aps5-trace-4d213d56f93e-26756.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
  • 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 (speed of PPSA18653, #15328)
  • GPUs tested: NVIDIA GeForce RTX 5080, driver 617.42, Windows 11 Pro 26300
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5212527879 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/17226). Originally posted by [XatiX](https://github.com/XatiX) on 2026-11-08T15:23:19Z. --- ### What A draw's resource cache key carried an image table's content whole: its descriptor words, samplers, shapes and per-element flags, about 12 words per element. A draw binding a 14k-entry table built, hashed and compared a key of that size on every draw. A table over 8192 descriptor words now enters the key as a marker and two 64-bit hashes of the same content, computed in four independent lanes (the xxHash64 round), so equal tables still key equal and a changed element changes the key. ShaderRecompiler::ElementFlags gains ForEachSet, which visits the set flags a word at a time, so the per-element flags enter the hash without a lookup per element. A draw's resource cache key carried the ImageTableMap binding's words whole: 136,000 to 260,000 words per pixel stage for a 14k-entry table, built, hashed and compared on every draw next to the table itself, already keyed by a hash. A map over 8192 words now enters the key the same way, as a marker and two 64-bit hashes of its words. ### Tested Windows 11 Pro 26300, NVIDIA GeForce RTX 5080, driver 617.42, MinGW-w64 GCC, Release. Focused AGC tests (`ctest -R '^agc.*(image_table|table|reuse|template|revalid|variant|resource_cache|bda|texture_cache|storage|shader_memory|locks|draw_cache|depth_surface|snapshot|pending|per_use)' -V` with `ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation`), same machine and GPU: - `main` `f5fe807353`: 100% tests passed, 0 tests failed out of 148, 0 `VUID-` lines, layer loaded (0 "was not found" lines) - `main-focused.log` - this change: 100% tests passed, 0 tests failed out of 148, 0 `VUID-` lines, layer loaded (0 "was not found" lines) - `H-focused.log` Age of Mythology: Retold (PPSA18653), title screen, idle, `APS5_TRACE_SECONDS=60:120` (about 16 presents) after a warm-up run. `main` here is `upstream/main` with #15327 and `41f70c5e1c` merged, an earlier head of #16437 that fails clock id 20 with `EINVAL`; the title needs both to run past the title screen (a GPU hang, then an abort on clock 20). Runs alternated with runs of that build; each run of the change is compared with the mean of the runs just before and after it. | Run of the change | `main` + #15327 + `41f70c5e1c`, frame p50 (ms) | change, frame p50 (ms) | difference | |---|---|---|---| | H-1 | 7841 (mean of M-2 and M-3) | 7395 | -5.7 % | | H-2 | 7870 (mean of M-3 and M-4) | 7566 | -3.9 % | | H-3 | 7834 (mean of M-4 and M-5) | 7266 | -7.2 % | Mean difference: -5.6 %. Summary lines: ``` {"commit":"57be81439239","dirty":false,"env":{"APS5_TRACE_SECONDS":"60:120"},"gpu":"NVIDIA GeForce RTX 5080","driver":"NVIDIA 617.42","os":"Windows 10.0.26300","cpu":"AMD Ryzen 7 9800X3D 8-Core Processor","cpu_threads":16,"memory_mib":32404,"title_id":"PPSA18653","title":"Age of Mythology: Retold","content_version":"01.043.000","resolution":"3840x2160","window":{"spec":"seconds 60:120","first_present":496,"ms":125470.936},"presents":16,"frame_ms":{"p50":7817.181,"p90":8067.830,"p99":8150.237,"max":8150.237},"gpu_busy_ms_per_present":567.219,"worker_busy_pct":{"queue worker 0x0":99.983},"top_phases_ms_per_frame":{"Driver.Packet":7840.296,"Driver.Packet.draw":7721.676,"Driver.Draw":7721.253,"Driver.Draw.draw_and_resource_release":6617.351,"Graphics.Draw":6592.406,"Graphics.Draw.draw_and_resource_release":6287.131,"Resources.Complete":6090.595,"Driver.Draw.shader_compile_and_link":1083.267},"trace_dropped":false,"trace":"aps5-trace-57be81439239-38472.json.gz"} {"commit":"4d213d56f93e","dirty":false,"env":{"APS5_TRACE_SECONDS":"60:120"},"gpu":"NVIDIA GeForce RTX 5080","driver":"NVIDIA 617.42","os":"Windows 10.0.26300","cpu":"AMD Ryzen 7 9800X3D 8-Core Processor","cpu_threads":16,"memory_mib":32404,"title_id":"PPSA18653","title":"Age of Mythology: Retold","content_version":"01.043.000","resolution":"3840x2160","window":{"spec":"seconds 60:120","first_present":531,"ms":126385.316},"presents":17,"frame_ms":{"p50":7394.865,"p90":7779.597,"p99":7975.671,"max":7975.671},"gpu_busy_ms_per_present":586.519,"worker_busy_pct":{"queue worker 0x0":99.982},"top_phases_ms_per_frame":{"Driver.Packet":7432.794,"Driver.Packet.draw":7336.243,"Driver.Draw":7335.872,"Driver.Draw.draw_and_resource_release":6249.890,"Graphics.Draw":6226.477,"Graphics.Draw.draw_and_resource_release":6190.530,"Resources.Complete":6135.678,"Driver.Draw.shader_compile_and_link":1067.711},"trace_dropped":false,"trace":"aps5-trace-4d213d56f93e-26756.json.gz"} ``` Digest, `main`: ``` **seconds 60:120** from present 496: 16 presents, frame p50 7817.2 / p90 8067.8 / p99 8150.2 / max 8150.2 ms, GPU busy 567.2 ms per present NVIDIA GeForce RTX 5080, NVIDIA 617.42, Windows 10.0.26300, 3840x2160, commit 57be81439239, dropped: no ```json {"commit":"57be81439239","dirty":false,"env":{"APS5_TRACE_SECONDS":"60:120"},"gpu":"NVIDIA GeForce RTX 5080","driver":"NVIDIA 617.42","os":"Windows 10.0.26300","cpu":"AMD Ryzen 7 9800X3D 8-Core Processor","cpu_threads":16,"memory_mib":32404,"title_id":"PPSA18653","title":"Age of Mythology: Retold","content_version":"01.043.000","resolution":"3840x2160","window":{"spec":"seconds 60:120","first_present":496,"ms":125470.936},"presents":16,"frame_ms":{"p50":7817.181,"p90":8067.83,"p99":8150.237,"max":8150.237},"gpu_busy_ms_per_present":567.219,"worker_busy_pct":{"queue worker 0x0":99.983},"top_phases_ms_per_frame":{"Driver.Packet":7840.296,"Driver.Packet.draw":7721.676,"Driver.Draw":7721.253,"Driver.Draw.draw_and_resource_release":6617.351,"Graphics.Draw":6592.406,"Graphics.Draw.draw_and_resource_release":6287.131,"Resources.Complete":6090.595,"Driver.Draw.shader_compile_and_link":1083.267},"trace_dropped":false,"trace":"aps5-trace-57be81439239-38472.json.gz"} ``` **Slowest frames** (largest slices inside each, inclusive) - present 502: 8150.2 ms at 46810 ms: Driver.Packet (queue worker 0x0) 8142.7, Driver.Packet.draw (queue worker 0x0) 8016.4, Driver.Draw (queue worker 0x0) 8015.8, Driver.Draw.draw_and_resource_release (queue worker 0x0) 6672.9 - present 503: 8067.8 ms at 54960 ms: Driver.Packet (queue worker 0x0) 8060.1, Driver.Packet.draw (queue worker 0x0) 7918.5, Driver.Draw (queue worker 0x0) 7917.9, Driver.Draw.draw_and_resource_release (queue worker 0x0) 6599.2 - present 504: 8004.9 ms at 63028 ms: Driver.Packet (queue worker 0x0) 7997.2, Driver.Packet.draw (queue worker 0x0) 7892.5, Driver.Draw (queue worker 0x0) 7891.9, Driver.Draw.draw_and_resource_release (queue worker 0x0) 6585.5 - present 496: 7911.6 ms at 0 ms: Driver.Packet (queue worker 0x0) 7903.7, Driver.Packet.draw (queue worker 0x0) 7792.7, Driver.Draw (queue worker 0x0) 7792.1, Driver.Draw.draw_and_resource_release (queue worker 0x0) 6691.3 - present 507: 7888.2 ms at 86685 ms: Driver.Packet (queue worker 0x0) 7880.3, Driver.Packet.draw (queue worker 0x0) 7709.6, Driver.Draw (queue worker 0x0) 7709.1, Driver.Draw.draw_and_resource_release (queue worker 0x0) 6654.8 **Persistent spikes** (frame time above the fastest frame that separates it from a longer frame; one entry per stall, not per frame) - present 502: 8150.2 ms at 46810 ms, persistence 469.7 ms - present 496: 7911.6 ms at 0 ms, persistence 189.6 ms - present 507: 7888.2 ms at 86685 ms, persistence 81.9 ms - present 498: 7857.0 ms at 15688 ms, persistence 80.6 ms - present 511: 7733.2 ms at 117738 ms, persistence 52.6 ms **Threads** (ms per frame) | thread | busy | wait | untraced | in slices < 20 us | largest | |---|---|---|---|---|---| | title | 0.0 (0 %) | 48.1 (1 %) | 7793.9 | 0.0 | | | queue worker 0x0 | 7834.0 (100 %) | 0.5 (0 %) | 7.4 | 57.8 | Driver.Packet 7834.5 | | draw committer | 44.6 (1 %) | 0.0 (0 %) | 7797.3 | 0.5 | Recorder.Sync 41.6, Recorder.Submit 2.5 | | presenter | 0.6 (0 %) | 42.3 (1 %) | 7799.0 | 0.1 | VideoOut.Flip 41.8, Driver.Present 1.1 | | title | 0.0 (0 %) | 0.0 (0 %) | 7841.9 | 0.0 | | | title | 0.0 (0 %) | 0.0 (0 %) | 7841.9 | 0.0 | | | title | 0.0 (0 %) | 0.0 (0 %) | 7841.9 | 0.0 | | | title | 0.0 (0 %) | 0.0 (0 %) | 7841.9 | 0.0 | | | title | 0.0 (0 %) | 0.0 (0 %) | 7841.9 | 0.0 | | | gpu | 547.0 (7 %) | 0.0 (0 %) | 7294.9 | 0.0 | batch 547.0 | **Largest slices** (ms per frame, inclusive, all threads): Driver.Packet 7834.5, Driver.Packet.draw 7719.6, Driver.Draw 7719.1, Driver.Draw.draw_and_resource_release 6614.2, Graphics.Draw 6589.3, Graphics.Draw.draw_and_resource_release 6284.6, Resources.Complete 6090.4, Driver.Draw.shader_compile_and_link 1080.6, batch 547.0, Graphics.Draw.validate 286.7 **Longest waits** - Recorder.WaitSerial (title) 109.1 ms at 38992 ms, present 501 - Driver.Present.render_fence_wait (presenter) 106.8 ms at 38995 ms, present 501 - Recorder.WaitSerial (title) 102.6 ms at 54960 ms, present 503 - Driver.Present.render_fence_wait (presenter) 102.1 ms at 54961 ms, present 503 - Recorder.WaitSerial (title) 66.8 ms at 7912 ms, present 497 - Driver.Present.render_fence_wait (presenter) 66.7 ms at 7912 ms, present 497 - Driver.Present.render_fence_wait (presenter) 55.8 ms at 117738 ms, present 511 - Recorder.WaitSerial (title) 54.2 ms at 117738 ms, present 511 - Recorder.WaitSerial (title) 51.0 ms at 23545 ms, present 499 - Driver.Present.render_fence_wait (presenter) 50.8 ms at 23545 ms, present 499 **Largest GPU batches** (GPU ranges inside, and the CPU slices that recorded each, inclusive) - batch 573: 96.2 ms at 54958 ms, present 502: GPU no ranges; recorded by Recorder.Submit (draw committer) 0.1 - batch 407: 93.2 ms at 38991 ms, present 500: GPU no ranges; recorded by Recorder.Submit (draw committer) 0.0 - batch 75: 64.8 ms at 7910 ms, present 496: GPU no ranges; recorded by no CPU slices - batch 36: 60.2 ms at 4604 ms, present 496: GPU no ranges; recorded by Driver.Packet (queue worker 0x0) 129.7, Driver.Packet.draw (queue worker 0x0) 129.7, Driver.Draw (queue worker 0x0) 129.7, Resources.Complete (queue worker 0x0) 116.2 - batch 132: 59.7 ms at 14058 ms, present 497: GPU no ranges; recorded by Driver.Packet (queue worker 0x0) 276.8, Driver.Packet.draw (queue worker 0x0) 276.8, Driver.Draw (queue worker 0x0) 276.8, Driver.Draw.draw_and_resource_release (queue worker 0x0) 242.7 ``` Digest, this change: ``` **seconds 60:120** from present 531: 17 presents, frame p50 7394.9 / p90 7779.6 / p99 7975.7 / max 7975.7 ms, GPU busy 586.5 ms per present NVIDIA GeForce RTX 5080, NVIDIA 617.42, Windows 10.0.26300, 3840x2160, commit 4d213d56f93e, dropped: no ```json {"commit":"4d213d56f93e","dirty":false,"env":{"APS5_TRACE_SECONDS":"60:120"},"gpu":"NVIDIA GeForce RTX 5080","driver":"NVIDIA 617.42","os":"Windows 10.0.26300","cpu":"AMD Ryzen 7 9800X3D 8-Core Processor","cpu_threads":16,"memory_mib":32404,"title_id":"PPSA18653","title":"Age of Mythology: Retold","content_version":"01.043.000","resolution":"3840x2160","window":{"spec":"seconds 60:120","first_present":531,"ms":126385.316},"presents":17,"frame_ms":{"p50":7394.865,"p90":7779.597,"p99":7975.671,"max":7975.671},"gpu_busy_ms_per_present":586.519,"worker_busy_pct":{"queue worker 0x0":99.982},"top_phases_ms_per_frame":{"Driver.Packet":7432.794,"Driver.Packet.draw":7336.243,"Driver.Draw":7335.872,"Driver.Draw.draw_and_resource_release":6249.89,"Graphics.Draw":6226.477,"Graphics.Draw.draw_and_resource_release":6190.53,"Resources.Complete":6135.678,"Driver.Draw.shader_compile_and_link":1067.711},"trace_dropped":false,"trace":"aps5-trace-4d213d56f93e-26756.json.gz"} ``` **Slowest frames** (largest slices inside each, inclusive) - present 531: 7975.7 ms at 0 ms: Driver.Packet (queue worker 0x0) 7967.7, Driver.Packet.draw (queue worker 0x0) 7856.4, Driver.Draw (queue worker 0x0) 7855.7, Driver.Draw.draw_and_resource_release (queue worker 0x0) 6496.6 - present 532: 7779.6 ms at 7976 ms: Driver.Packet (queue worker 0x0) 7772.2, Driver.Packet.draw (queue worker 0x0) 7684.2, Driver.Draw (queue worker 0x0) 7683.7, Driver.Draw.draw_and_resource_release (queue worker 0x0) 6334.2 - present 547: 7453.9 ms at 118931 ms: Driver.Packet (queue worker 0x0) 7446.4, Driver.Packet.draw (queue worker 0x0) 7328.9, Driver.Draw (queue worker 0x0) 7328.3, Driver.Draw.draw_and_resource_release (queue worker 0x0) 6275.7 - present 545: 7453.5 ms at 104076 ms: Driver.Packet (queue worker 0x0) 7446.2, Driver.Packet.draw (queue worker 0x0) 7331.4, Driver.Draw (queue worker 0x0) 7330.9, Driver.Draw.draw_and_resource_release (queue worker 0x0) 6279.7 - present 533: 7428.5 ms at 15755 ms: Driver.Packet (queue worker 0x0) 7421.4, Driver.Packet.draw (queue worker 0x0) 7343.2, Driver.Draw (queue worker 0x0) 7342.8, Driver.Draw.draw_and_resource_release (queue worker 0x0) 6254.1 **Persistent spikes** (frame time above the fastest frame that separates it from a longer frame; one entry per stall, not per frame) - present 531: 7975.7 ms at 0 ms, persistence 708.1 ms - present 547: 7453.9 ms at 118931 ms, persistence 186.3 ms - present 540: 7404.3 ms at 67148 ms, persistence 60.2 ms - present 545: 7453.5 ms at 104076 ms, persistence 51.1 ms - present 543: 7410.6 ms at 89291 ms, persistence 36.8 ms - present 536: 7358.6 ms at 37886 ms, persistence 32.4 ms **Threads** (ms per frame) | thread | busy | wait | untraced | in slices < 20 us | largest | |---|---|---|---|---|---| | title | 0.0 (0 %) | 28.9 (0 %) | 7405.5 | 0.0 | | | queue worker 0x0 | 7426.5 (100 %) | 0.5 (0 %) | 7.4 | 57.8 | Driver.Packet 7427.0, Driver.EndSubmission 0.0 | | draw committer | 25.8 (0 %) | 0.0 (0 %) | 7408.6 | 0.5 | Recorder.Sync 22.7, Recorder.Submit 2.6 | | presenter | 0.8 (0 %) | 25.7 (0 %) | 7407.9 | 0.1 | VideoOut.Flip 24.1, Driver.Present 2.4 | | title | 0.0 (0 %) | 0.0 (0 %) | 7434.4 | 0.0 | Shader.ResolveAbi 0.0 | | title | 0.0 (0 %) | 0.0 (0 %) | 7434.4 | 0.0 | | | title | 0.0 (0 %) | 0.0 (0 %) | 7434.4 | 0.0 | | | title | 0.0 (0 %) | 0.0 (0 %) | 7434.4 | 0.0 | | | title | 0.0 (0 %) | 0.0 (0 %) | 7434.4 | 0.0 | | | gpu | 589.1 (8 %) | 0.0 (0 %) | 6845.4 | 0.0 | batch 589.1 | **Largest slices** (ms per frame, inclusive, all threads): Driver.Packet 7427.0, Driver.Packet.draw 7334.1, Driver.Draw 7333.6, Driver.Draw.draw_and_resource_release 6246.8, Graphics.Draw 6223.4, Graphics.Draw.draw_and_resource_release 6188.1, Resources.Complete 6135.5, Driver.Draw.shader_compile_and_link 1065.1, batch 589.1, Shader.DrawStage 172.4 **Longest waits** - Recorder.WaitSerial (title) 102.3 ms at 45244 ms, present 537 - Driver.Present.render_fence_wait (presenter) 102.2 ms at 45244 ms, present 537 - Recorder.WaitSerial (title) 53.6 ms at 118931 ms, present 547 - Driver.Present.render_fence_wait (presenter) 53.2 ms at 118932 ms, present 547 - Recorder.WaitSerial (title) 51.3 ms at 30559 ms, present 535 - Driver.Present.render_fence_wait (presenter) 51.2 ms at 30560 ms, present 535 - Recorder.WaitSerial (title) 48.4 ms at 59791 ms, present 539 - Recorder.WaitSerial (title) 48.4 ms at 104076 ms, present 545 - Driver.Present.render_fence_wait (presenter) 47.9 ms at 59792 ms, present 539 - Driver.Present.render_fence_wait (presenter) 47.9 ms at 104076 ms, present 545 **Largest GPU batches** (GPU ranges inside, and the CPU slices that recorded each, inclusive) - batch 880: 107.6 ms at 80377 ms, present 541: GPU no ranges; recorded by Driver.Packet (queue worker 0x0) 264.4, Driver.Packet.draw (queue worker 0x0) 264.4, Driver.Draw (queue worker 0x0) 264.4, Resources.Complete (queue worker 0x0) 236.4 - batch 216: 107.0 ms at 21580 ms, present 533: GPU no ranges; recorded by Driver.Packet (queue worker 0x0) 257.2, Driver.Packet.draw (queue worker 0x0) 257.2, Driver.Draw (queue worker 0x0) 257.2, Resources.Complete (queue worker 0x0) 233.3 - batch 963: 105.5 ms at 87729 ms, present 542: GPU no ranges; recorded by Driver.Packet (queue worker 0x0) 265.9, Driver.Packet.draw (queue worker 0x0) 265.9, Driver.Draw (queue worker 0x0) 265.9, Resources.Complete (queue worker 0x0) 236.1 - batch 792: 96.4 ms at 71939 ms, present 540: GPU no ranges; recorded by Driver.Packet (queue worker 0x0) 250.5, Driver.Packet.draw (queue worker 0x0) 250.4, Driver.Draw (queue worker 0x0) 250.4, Resources.Complete (queue worker 0x0) 220.7 - batch 491: 96.0 ms at 45243 ms, present 536: GPU no ranges; recorded by no CPU slices The two traces and both test logs are attached. [main-focused.log](https://github.com/user-attachments/files/34546126/main-focused.log) [H-focused.log](https://github.com/user-attachments/files/34546127/H-focused.log) [main-aps5-trace-57be81439239-38472.json.gz](https://github.com/user-attachments/files/34546129/main-aps5-trace-57be81439239-38472.json.gz) [change-aps5-trace-4d213d56f93e-26756.json.gz](https://github.com/user-attachments/files/34546130/change-aps5-trace-4d213d56f93e-26756.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) - [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 (speed of PPSA18653, #15328) - [x] GPUs tested: NVIDIA GeForce RTX 5080, driver 617.42, Windows 11 Pro 26300 - [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!17226
No description provided.