GitHub PRs 3043 and 2785 (pool import cost) are missing from Longshot: measured on the Market entry #330

Closed
opened 2026-11-14 00:55:38 +00:00 by DUDUYG · 0 comments

Two pool-import fixes were merged into Hookshot on GitHub on 2026-11-13. They didn't make it into Longshot, because Longshot's main branched from 4dd972a8, before that night's merges. Nobody has re-sent them here yet:

  • GitHub PR 3043 (jarynclouatre), a pool import does not pay a walk over the game's heap (GitHub commit 771a9e46)
  • GitHub PR 2785 (FIocker), no pool import for one GPU unswizzle, and the CPU unswizzle threaded from 4 MB (GitHub commit 5192732a)

I measured them on Longshot, because they target the biggest part of the stutter when the Market first comes into view.

Where the Market entry's time goes on main (514591a3)

I used RX_VK_FRAME_TRACE=1 plus the all-thread sampler (HOS_SAMPLE_ALL, with the samples aligned to the presents) on the late presents of the Market entry. The Presentation_Thread spends 24% of its samples waiting in mkwvk::import_pool, and 25-43% in the two biggest frames (369 and 422 ms). The rest is spread over UnswizzleTexture, upload_inner, BindImageMemory and LowerToMaxwellWith. In this run every import took 7-15 ms, all of it in vkAllocateMemory.

A/B

  • A is main 514591a3, plus three env-gated test-logging commits of mine (a present-time log, and the sampler on the same clock). B is A plus 771a9e46 and 5192732a, both cherry-picked cleanly.
  • RTX 5070 (NVIDIA 621.14), Ryzen 7 9800X3D, Windows 11.
  • Both copies on the same NVMe; the romfs on a SATA disk.
  • One saved game in the Market, loaded and driven the same way each run (headless, HOS_INPUT_EXCLUSIVE=1), with disks idle before each run.
  • Runs alternated A1 B1 A2 B2 A3 B3. A2 is excluded: the save never loaded.
Market entry A (main) B (+ GitHub PRs 3043, 2785)
Worst frame 548 / 516 ms 406 / 354 / 440 ms
Biggest slow submit 228 / 251 ms 118 / 131 / 152 ms
Slow submits >= 100 ms per run 4 / 4 1 / 2 / 1
slow upload lines per run 7 / 6 1 / 1 / 1
Pool imports (vk: import lines) 7-15 ms each mostly 2-3 ms; a few at 16-50 ms
Frames > 50 ms per run 13 / 12 13 / 12 / 14

So the entry's frames are much shorter, but there are about as many of them. B still has a few slow imports (allocate 16-50 ms) that PR 3043 doesn't cover.

Notes

  • On today's main (5b81a8a1), 771a9e46 has a one-line conflict: both sides add an #include at the same place in vk_memory.cpp (mirror_budget.h and import_fence.h). Keeping both is enough. On that base, tests/run_all.py import_fence import_buffer_binding image_view_retry mirror_trim upload texture_staging gives 7 passed (Windows).
  • #324 (lazy heap commit on Windows) changes the very heap layout that PR 3043 explains, so the two may overlap. It might be worth measuring the import times with #324 too.

@jarynclouatre @FIocker, would you re-send these here? If it's easier, I can open a PR with your two commits as they are (authorship kept).

Two pool-import fixes were merged into Hookshot on GitHub on 2026-11-13. They didn't make it into Longshot, because Longshot's main branched from 4dd972a8, before that night's merges. Nobody has re-sent them here yet: - **GitHub PR 3043** (jarynclouatre), *a pool import does not pay a walk over the game's heap* (GitHub commit 771a9e46) - **GitHub PR 2785** (FIocker), *no pool import for one GPU unswizzle, and the CPU unswizzle threaded from 4 MB* (GitHub commit 5192732a) I measured them on Longshot, because they target the biggest part of the stutter when the Market first comes into view. ## Where the Market entry's time goes on main (514591a3) I used `RX_VK_FRAME_TRACE=1` plus the all-thread sampler (`HOS_SAMPLE_ALL`, with the samples aligned to the presents) on the late presents of the Market entry. The Presentation_Thread spends **24% of its samples waiting in `mkwvk::import_pool`**, and 25-43% in the two biggest frames (369 and 422 ms). The rest is spread over `UnswizzleTexture`, `upload_inner`, `BindImageMemory` and `LowerToMaxwellWith`. In this run every import took 7-15 ms, all of it in `vkAllocateMemory`. ## A/B - **A** is main 514591a3, plus three env-gated test-logging commits of mine (a present-time log, and the sampler on the same clock). **B** is A plus 771a9e46 and 5192732a, both cherry-picked cleanly. - RTX 5070 (NVIDIA 621.14), Ryzen 7 9800X3D, Windows 11. - Both copies on the same NVMe; the romfs on a SATA disk. - One saved game in the Market, loaded and driven the same way each run (headless, `HOS_INPUT_EXCLUSIVE=1`), with disks idle before each run. - Runs alternated A1 B1 A2 B2 A3 B3. A2 is excluded: the save never loaded. | Market entry | A (main) | B (+ GitHub PRs 3043, 2785) | |---|---|---| | Worst frame | 548 / 516 ms | 406 / 354 / 440 ms | | Biggest slow submit | 228 / 251 ms | 118 / 131 / 152 ms | | Slow submits >= 100 ms per run | 4 / 4 | 1 / 2 / 1 | | `slow upload` lines per run | 7 / 6 | 1 / 1 / 1 | | Pool imports (`vk: import` lines) | 7-15 ms each | mostly 2-3 ms; a few at 16-50 ms | | Frames > 50 ms per run | 13 / 12 | 13 / 12 / 14 | So the entry's frames are much shorter, but there are about as many of them. B still has a few slow imports (`allocate` 16-50 ms) that PR 3043 doesn't cover. ## Notes - On today's main (5b81a8a1), 771a9e46 has a one-line conflict: both sides add an `#include` at the same place in `vk_memory.cpp` (`mirror_budget.h` and `import_fence.h`). Keeping both is enough. On that base, `tests/run_all.py import_fence import_buffer_binding image_view_retry mirror_trim upload texture_staging` gives 7 passed (Windows). - #324 (lazy heap commit on Windows) changes the very heap layout that PR 3043 explains, so the two may overlap. It might be worth measuring the import times with #324 too. @jarynclouatre @FIocker, would you re-send these here? If it's easier, I can open a PR with your two commits as they are (authorship kept).
Sign in to join this conversation.
No milestone
No project
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.

Dependencies

No dependencies set

Reference
MagicBeanDev/Longshot#330
No description provided.