perf(vk): rank slow upload frames by ASTC, GPU unswizzle or CPU #2745

Open
github-sync wants to merge 1 commit from github/pr/2745 into main
Owner

@yeetbot90 opened this pull request on GitHub · 2026-11-12 10:33 UTC · original

Summary Frames whose uploads take over 50 ms are logged one by one and then stop at 300 lines, so a session never says whether the hitch was ASTC on the GPU, an unswizzle on the GPU, or the CPU. Keep counting those frames and print vk: upload rollup on the first and every 10. Measure only. The 50 ms gate and the per-frame line are unchanged, and nothing about how a texture is uploaded changes. ## Test plan - [x] python -I -B tests/test_upload_rollup.py - [x] RX_VK_ONLY=1 rebuild of hookshot_vk.dll (llvm-mingw), copied into D:\Hookshot_OOT - [x] AMD RX 9070 XT / Windows, load into a save: vk: upload rollup: 1 frames over 50 ms, 157 ms, mostly on the CPU (76 ms, 469 MB), then unswizzled on the GPU (59 ms) Made with Cursor

> [@yeetbot90](https://github.com/yeetbot90) opened this pull request on GitHub · 2026-11-12 10:33 UTC · [original](https://github.com/NotRexed/Hookshot/pull/2745) ## Summary Frames whose uploads take over 50 ms are logged one by one and then stop at 300 lines, so a session never says whether the hitch was ASTC on the GPU, an unswizzle on the GPU, or the CPU. Keep counting those frames and print `vk: upload rollup` on the first and every 10. Measure only. The 50 ms gate and the per-frame line are unchanged, and nothing about how a texture is uploaded changes. ## Test plan - [x] `python -I -B tests/test_upload_rollup.py` - [x] `RX_VK_ONLY=1` rebuild of `hookshot_vk.dll` (llvm-mingw), copied into `D:\Hookshot_OOT` - [x] AMD RX 9070 XT / Windows, load into a save: `vk: upload rollup: 1 frames over 50 ms, 157 ms, mostly on the CPU (76 ms, 469 MB), then unswizzled on the GPU (59 ms)` Made with [Cursor](https://cursor.com) <!-- github-sync:item:2745 -->
The per-frame upload line stops at 300, so a long session never says which route took the hitch. Keep counting frames over 50 ms and print a rollup.

Co-authored-by: Cursor <[email protected]>
Author
Owner

@Joey-Magnus reviewed on GitHub · 2026-11-12 14:34 UTC · original

I merged this into current main and ran tests/test_upload_rollup.py, which passes. The accumulator in upload_frame_report (gpu/vk/vk_texture.cpp:1397-1430) is only touched under up_mu. The per-frame line and its 50 ms gate are unchanged, and the route names are only hoisted, so nothing about uploads changes. The load-into-a-save line in the description is a real measurement on the RX 9070 XT.

Two small things. The rollup fires on the first frame and every 10th after that, with no end. Frames over 50 ms are much rarer than #2740's 15 ms submits, so it's less of a problem here, but the same geometric cadence (1, 10, 100...) would keep a long session on a slow CPU from adding a line every few seconds during streaming. Also, the doc text went into the RX_VK_SLOW_LOG row (docs/development.md:145) even though the rollup doesn't depend on that switch, and #2740 rewrites the same row, so the two PRs conflict there. Moving both into their own row would fix both problems.

> [@Joey-Magnus](https://github.com/Joey-Magnus) reviewed on GitHub · 2026-11-12 14:34 UTC · [original](https://github.com/NotRexed/Hookshot/pull/2745#pullrequestreview-5876244995) I merged this into current main and ran tests/test_upload_rollup.py, which passes. The accumulator in `upload_frame_report` (gpu/vk/vk_texture.cpp:1397-1430) is only touched under `up_mu`. The per-frame line and its 50 ms gate are unchanged, and the route names are only hoisted, so nothing about uploads changes. The load-into-a-save line in the description is a real measurement on the RX 9070 XT. Two small things. The rollup fires on the first frame and every 10th after that, with no end. Frames over 50 ms are much rarer than #2740's 15 ms submits, so it's less of a problem here, but the same geometric cadence (1, 10, 100...) would keep a long session on a slow CPU from adding a line every few seconds during streaming. Also, the doc text went into the `RX_VK_SLOW_LOG` row (docs/development.md:145) even though the rollup doesn't depend on that switch, and #2740 rewrites the same row, so the two PRs conflict there. Moving both into their own row would fix both problems. <!-- github-sync:r:5876244995 -->
Commenting is not possible because the repository is archived.
No description provided.