WIP: perf(vk): the textures' pools keep spare blocks made off the render thread, so an area's first frames make none #2890

Closed
conongnang wants to merge 3 commits from (deleted):perf/texture-block-reserve into main
Contributor

Summary

An area's first frames made new 32 MB VRAM blocks for its textures on the render thread: a synchronous vkAllocateMemory, about 5.7 ms each on AMD's Windows driver (2-34 ms). The textures' pool grew from 24 to 149 blocks over a six-area tour, about 20 blocks per arrival. The images that made a block took 669 of the tour's 737 ms of texture creation.

Part of it is a regression: #637 (8e3dfde6) shrank kImageBlock from 128 MB to 32 MB but kept blocks_at_start's count of 2-24. So the blocks made at the start fell from about 3 GB to 768 MB on a 16 GB card.

This PR:

  • Start blocks as a size again: 15% of the device-local heap capped at 3 GB (8% capped at 1.5 GB under 8 GiB), so 76 blocks on 16 GB. They are made on a thread at the renderer's start, not on the replay thread's first texture (which cost 94 ms in a boot frame).
  • A reserve of spare blocks, made ahead on a thread of its own:
    • Sizes: 24 large + 8 small on 16 GB, 12 + 4 on 12 GB, 2 + 1 on 8 GB, none below that or on an integrated GPU.
    • When an image finds no room, the replay thread frees one spare (VMA keeps the emptied block) and the image takes it, in place of a vkAllocateMemory in the frame.
    • Spares are refilled during a burst as they run low, and let go when the driver's count passes 90% of the allowance or the arbiter asks. They are never counted as textures in the budget.
  • Switches: RX_VK_TEXTURE_BLOCK_RESERVE=<n> (0: none, as before); RX_VK_IMAGE_PREALLOC as before.

Read first: gpu/vk/texture_block_reserve.h, the reserve section of gpu/vk/vk_vma.cpp, gpu/vk/vram_compact.h (blocks_at_start).

How to see it on main: RX_VK_LOG_MADE_BURST=50, teleport to Market (child). The images that make a block take 5-34 ms each, the rest 0.01-0.1 ms, and vk: image blocks (textures, compacted) climbs from 24 blocks.

Testing

Tested: Windows 11, AMD Radeon RX 6800, driver 26.10.1, a pack over main 28cb22b9, the tour in Measurements. No visual differences seen in the tour's areas.

  • Reserve of 24, alone: 39 images of 2 ms or more instead of 117, and 329 ms of texture creation instead of 737 ms over the tour. The log line said 218 taken, 254 made ahead, 57 made in the frame anyway: 14 render targets (they have their own pool), 12 sampled textures larger than a block, and the rest held back by the 100 ms refill rule, since changed.
  • With the other two PRs, three runs: texture creation in the loads 187-247 ms instead of 492-536 ms.

Checks:

  • tests/test_texture_block_reserve.py (new): the rules, and the reserve thread run against a stand-in VMA that follows VmaBlockVector::Free's empty-block rule.
  • test_blocks_at_start.py (its fixture fixed; it fails on main), test_device_policy.py, test_memory_priority.py and test_mem_account.py pass.
  • clang++ -fsyntax-only with the builder's flags on vk_vma.cpp, vk_texture.cpp and vk_main.cpp.

Still to test:

  • 8 GB and 12 GB cards, NVIDIA and Intel: the tour, expecting no VRAM pressure regressions and fewer blocks made in frames (@Beanstalk teleport through Market, Hyrule Field and Kakariko; compare the vk: image blocks lines and frame times with main).
  • Steam Deck and integrated GPUs: no reserve and no start blocks, as before (@Beanstalk).
  • llvmpipe: it now gets 96 start blocks (3 GB of RAM); check that's acceptable (by hand).

Measurements

Verdict: each change does the work it targets (below), but on its own none moves total stutter at area changes beyond run-to-run noise. Together with its two sibling PRs, the worst frame at an arrival is 15-25% shorter. An earlier claim here of "-20% stutter in the loads" was mostly how long each load took: the loads' length alone varies from 3,300 to 4,900 frames between runs of the same build.

Setup:

  • Windows 11, AMD Radeon RX 6800 (16 GB), AMD driver 26.10.1, i7-13700. The player's own settings: 1920x1080 output, uncapped, windowed.
  • A scripted tour, each run through the job queue in timing mode: the repository save kokiri-start, then teleports to Market (child), Hyrule Field (child), Kakariko Village, Kokiri Forest, Hyrule Field (adult) and Lake Hylia (adult). 25 s in each with the camera turning, plus 20 s walking in circles in Hyrule Field.
  • The frame trace (RX_VK_FRAME_TRACE=1).
  • Visible stutter: what frames of 25 ms or more spend over 16.7 ms, from 1 s before control returns to 2 s after, summed over the six arrivals.
Runs (each a separate launch) Visible stutter at the 6 arrivals (ms) Worst frame at an arrival (ms) Texture creation in the loads (ms)
main @ 28cb22b9 (5) 2583, 2943, 2948, 3263, 3491 390-422 492-550
texture block reserve alone (2) 2624, 3245 355, 370 147-177
shader parse cache alone (2) 2543, 3608 357, 366 525-576
sparse bind smoothing alone (2) 2542, 3019 378, 395 495-560
all three together (3) 2309, 2819, 3091 306-348 187-247

In play (the walk and the camera turns, outside the arrivals), every run of every build has a median frame of 9.8-10.0 ms and 0-1 frames of 33 ms or more.

What the worst arrival frames are spent on, in the runs with all three: draw 100-440 ms, mostly in the recording's commands (up to 396 ms: the first bindings of vertex and index buffers, which import host memory and make mirrors) and descriptors. A change that imports pools ahead of their first binding is being measured on top of these three.

Risks

  • VRAM held from the start: 2.4 GB on a 16 GB card (768 MB on main; about 3 GB before #637), plus up to 1 GB of spares. Spares are released first when VRAM is short, and the texture floors (1800 MB, or a quarter of the allowance) stay above the start blocks.
  • A texture made while a spare is being made waits for the rest of that one block, not for the whole burst.
  • One unexplained hang: on the first run after building the three PRs together, the driver refused every submit with VK_ERROR_OUT_OF_DEVICE_MEMORY shortly after arriving in Market (7.8 of 15.5 GB of VRAM in use), and the game stopped drawing. It has not come back in nine runs since, and no run of main or the nightly (about 20) has refused a submit. Until it is explained, treat this PR as a possible cause.
  • Turning it off: RX_VK_TEXTURE_BLOCK_RESERVE=0 with RX_VK_IMAGE_PREALLOC=24 gives main's behaviour; otherwise a revert. Nothing changes in saves, settings or caches.

Checklist

Ready for review

  • One topic, on current main; the title is a Conventional Commit.
  • Tested on my own PC, in the game for a change the game runs, as Testing says.
  • mise run test passes (any failure that also fails on main is named). (Not run yet: the checks reading the changed files pass, apart from failures they share with main.)
  • Measured against main, or Measurements says why there is nothing to measure. (Measured: no stutter gain on its own beyond the noise.)
  • No game files, build output or hand-edited generated files; third_party/ untouched; nothing GPL-incompatible.

When it applies

  • A switch added or changed: it ships at the default the measurements chose, with its row in gpu/vk/switches.def. (Rows added; defaults to be confirmed by this PR's own A/B.)
  • A check under tests/ that reads changed source is updated, not weakened.
  • Docs updated.
  • AI assistance recorded with Assisted-by: / Co-Authored-By: trailers.

Ready to merge

  • Everything in Still to test has run, its results in Tested.
  • Tier 1 hardware it can affect is tested (docs/dev/standards.md, "Hardware tiers").
  • Approved in review, every comment answered.
  • CI passes on the head; on current main, measured again or a comment says why the numbers still hold.

🤖 Generated with Claude Code

## Summary An area's first frames made new 32 MB VRAM blocks for its textures on the render thread: a synchronous `vkAllocateMemory`, about 5.7 ms each on AMD's Windows driver (2-34 ms). The textures' pool grew from 24 to 149 blocks over a six-area tour, about 20 blocks per arrival. The images that made a block took 669 of the tour's 737 ms of texture creation. Part of it is a regression: #637 (8e3dfde6) shrank `kImageBlock` from 128 MB to 32 MB but kept `blocks_at_start`'s count of 2-24. So the blocks made at the start fell from about 3 GB to 768 MB on a 16 GB card. This PR: - **Start blocks as a size again:** 15% of the device-local heap capped at 3 GB (8% capped at 1.5 GB under 8 GiB), so 76 blocks on 16 GB. They are made on a thread at the renderer's start, not on the replay thread's first texture (which cost 94 ms in a boot frame). - **A reserve of spare blocks, made ahead on a thread of its own:** - Sizes: 24 large + 8 small on 16 GB, 12 + 4 on 12 GB, 2 + 1 on 8 GB, none below that or on an integrated GPU. - When an image finds no room, the replay thread frees one spare (VMA keeps the emptied block) and the image takes it, in place of a `vkAllocateMemory` in the frame. - Spares are refilled during a burst as they run low, and let go when the driver's count passes 90% of the allowance or the arbiter asks. They are never counted as textures in the budget. - **Switches:** `RX_VK_TEXTURE_BLOCK_RESERVE=<n>` (0: none, as before); `RX_VK_IMAGE_PREALLOC` as before. Read first: `gpu/vk/texture_block_reserve.h`, the reserve section of `gpu/vk/vk_vma.cpp`, `gpu/vk/vram_compact.h` (`blocks_at_start`). **How to see it on main:** `RX_VK_LOG_MADE_BURST=50`, teleport to Market (child). The images that make a block take 5-34 ms each, the rest 0.01-0.1 ms, and `vk: image blocks (textures, compacted)` climbs from 24 blocks. ## Testing **Tested:** Windows 11, AMD Radeon RX 6800, driver 26.10.1, a pack over main 28cb22b9, the tour in Measurements. No visual differences seen in the tour's areas. - **Reserve of 24, alone:** 39 images of 2 ms or more instead of 117, and 329 ms of texture creation instead of 737 ms over the tour. The log line said `218 taken, 254 made ahead, 57 made in the frame anyway`: 14 render targets (they have their own pool), 12 sampled textures larger than a block, and the rest held back by the 100 ms refill rule, since changed. - **With the other two PRs, three runs:** texture creation in the loads 187-247 ms instead of 492-536 ms. **Checks:** - `tests/test_texture_block_reserve.py` (new): the rules, and the reserve thread run against a stand-in VMA that follows `VmaBlockVector::Free`'s empty-block rule. - `test_blocks_at_start.py` (its fixture fixed; it fails on main), `test_device_policy.py`, `test_memory_priority.py` and `test_mem_account.py` pass. - `clang++ -fsyntax-only` with the builder's flags on `vk_vma.cpp`, `vk_texture.cpp` and `vk_main.cpp`. **Still to test:** - 8 GB and 12 GB cards, NVIDIA and Intel: the tour, expecting no VRAM pressure regressions and fewer blocks made in frames (@Beanstalk teleport through Market, Hyrule Field and Kakariko; compare the `vk: image blocks` lines and frame times with main). - Steam Deck and integrated GPUs: no reserve and no start blocks, as before (@Beanstalk). - llvmpipe: it now gets 96 start blocks (3 GB of RAM); check that's acceptable (by hand). ## Measurements **Verdict:** each change does the work it targets (below), but on its own none moves total stutter at area changes beyond run-to-run noise. Together with its two sibling PRs, the worst frame at an arrival is 15-25% shorter. An earlier claim here of "-20% stutter in the loads" was mostly how long each load took: the loads' length alone varies from 3,300 to 4,900 frames between runs of the same build. **Setup:** - Windows 11, AMD Radeon RX 6800 (16 GB), AMD driver 26.10.1, i7-13700. The player's own settings: 1920x1080 output, uncapped, windowed. - A scripted tour, each run through the job queue in timing mode: the repository save `kokiri-start`, then teleports to Market (child), Hyrule Field (child), Kakariko Village, Kokiri Forest, Hyrule Field (adult) and Lake Hylia (adult). 25 s in each with the camera turning, plus 20 s walking in circles in Hyrule Field. - The frame trace (`RX_VK_FRAME_TRACE=1`). - **Visible stutter:** what frames of 25 ms or more spend over 16.7 ms, from 1 s before control returns to 2 s after, summed over the six arrivals. | Runs (each a separate launch) | Visible stutter at the 6 arrivals (ms) | Worst frame at an arrival (ms) | Texture creation in the loads (ms) | |---|---|---|---| | main @ 28cb22b9 (5) | 2583, 2943, 2948, 3263, 3491 | 390-422 | 492-550 | | texture block reserve alone (2) | 2624, 3245 | 355, 370 | 147-177 | | shader parse cache alone (2) | 2543, 3608 | 357, 366 | 525-576 | | sparse bind smoothing alone (2) | 2542, 3019 | 378, 395 | 495-560 | | all three together (3) | 2309, 2819, 3091 | 306-348 | 187-247 | In play (the walk and the camera turns, outside the arrivals), every run of every build has a median frame of 9.8-10.0 ms and 0-1 frames of 33 ms or more. What the worst arrival frames are spent on, in the runs with all three: draw 100-440 ms, mostly in the recording's commands (up to 396 ms: the first bindings of vertex and index buffers, which import host memory and make mirrors) and descriptors. A change that imports pools ahead of their first binding is being measured on top of these three. ## Risks - **VRAM held from the start:** 2.4 GB on a 16 GB card (768 MB on main; about 3 GB before #637), plus up to 1 GB of spares. Spares are released first when VRAM is short, and the texture floors (1800 MB, or a quarter of the allowance) stay above the start blocks. - **A texture made while a spare is being made** waits for the rest of that one block, not for the whole burst. - **One unexplained hang:** on the first run after building the three PRs together, the driver refused every submit with `VK_ERROR_OUT_OF_DEVICE_MEMORY` shortly after arriving in Market (7.8 of 15.5 GB of VRAM in use), and the game stopped drawing. It has not come back in nine runs since, and no run of main or the nightly (about 20) has refused a submit. Until it is explained, treat this PR as a possible cause. - **Turning it off:** `RX_VK_TEXTURE_BLOCK_RESERVE=0` with `RX_VK_IMAGE_PREALLOC=24` gives main's behaviour; otherwise a revert. Nothing changes in saves, settings or caches. ## Checklist ### Ready for review - [x] One topic, on current `main`; the title is a Conventional Commit. - [x] Tested on my own PC, in the game for a change the game runs, as Testing says. - [ ] `mise run test` passes (any failure that also fails on `main` is named). (Not run yet: the checks reading the changed files pass, apart from failures they share with main.) - [ ] Measured against `main`, or Measurements says why there is nothing to measure. (Measured: no stutter gain on its own beyond the noise.) - [x] No game files, build output or hand-edited generated files; `third_party/` untouched; nothing GPL-incompatible. ### When it applies - [ ] A switch added or changed: it ships at the default the measurements chose, with its row in `gpu/vk/switches.def`. (Rows added; defaults to be confirmed by this PR's own A/B.) - [x] A check under `tests/` that reads changed source is updated, not weakened. - [x] Docs updated. - [x] AI assistance recorded with `Assisted-by:` / `Co-Authored-By:` trailers. ### Ready to merge - [ ] Everything in Still to test has run, its results in Tested. - [ ] Tier 1 hardware it can affect is tested (docs/dev/standards.md, "Hardware tiers"). - [ ] Approved in review, every comment answered. - [ ] CI passes on the head; on current `main`, measured again or a comment says why the numbers still hold. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
On an RX 6800 (AMD's Windows driver 26.10.1) an area entered made 15-47 blocks in the textures' pools, each a
vkAllocateMemory on the replay thread of 2-115 ms (5-20 mostly, against 0.01-0.1 ms for an image where a block had
room): stutters of 120-530 ms.

A thread of its own now keeps whole blocks spare in each textures' pool (one allocation of the block's size each):
4 in the large pool and 2 in the small one from 12 GB of VRAM, 2 and 1 from 8 GB, none under it or on an integrated
GPU (gpu/vk/texture_block_reserve.h). create_image makes a texture in the blocks VMA has (NEVER_ALLOCATE) and, where
they have no room, frees a spare and makes it in the block that leaves, which VMA keeps empty for it
(VmaBlockVector::Free keeps the one empty block within budget). The thread makes the next spare once no texture has
been made in the pool for 100 ms: VMA makes a block under its lock of the pool.

The spares are no texture's: the compaction ignores a move it finds no texture for, none is freed while a pass is
open (the reaper's rule), none is made while a run is under way, and the pools' figures leave them out (kept_only, a
compaction's start). The budget takes them off the driver's count as it does the blocks' free space, they show as
"block reserve" in the budget line, and they all go past 90% of the allowance or at the arbiter's ask, with none made
again for 30 s. The window's close stops the thread and frees them. "vk: image blocks (textures, compacted)" counts
the spares taken, made ahead, blocks made in the frame anyway, let go and refused.

RX_VK_TEXTURE_BLOCK_RESERVE=<n>: n large and half as many small; 0 keeps none, as before.
tests/test_texture_block_reserve.py runs the rules, and the reserve's code from vk_vma.cpp on its thread against a
stand-in VMA.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The blocks a textures' pool starts with were 15% of the card's memory as 2 to 24 blocks (8%, 2 to 12, under 8 GB).
That count was chosen with 128 MB blocks; #637 made them 32 MB, and the 24 held 768 MB: an RX 6800's large textures'
pool went from its 24 to 149 blocks across a six-area tour, each made in the frame (~5.7 ms a block on AMD's Windows
driver, 34 ms at worst). vram_compact::blocks_at_start is now a size: 15% of the heap, 3 GB at most (8%, 1.5 GB at
most, under 8 GB), two blocks at least; with 128 MB blocks it gives the counts it gave. 76 blocks (2.4 GB) on a 16 GB
card, 57 on 12 GB, 20 on an 8 GB card that reports under 8 GiB, none on an integrated GPU.

They are VMA's minBlockCount, made by vmaCreatePool, which was the first texture's call on the replay thread (~94 ms
of a boot frame with 24). vma_init now has the textures' pools made on a thread of their own (with the block
reserve's thread after), unless RX_VK_COMPACT=0; textures_pool makes them once (call_once), a texture that comes
first waits for them, and the replay thread's looks at the pools go by a flag until they are made. The budget's rules
see them as before: their free space comes off the count (reclaim), a compaction never counts them returnable, and
kept_only waits the 97% rule only once the pool is down to them; every texture floor (1800 MB, a quarter of the
allowance) is above them.

tests/test_blocks_at_start.py compiles the pools' constructors again (the small textures' pool had broken its
fixture) and checks the thread; test_device_policy's blocks at the start follow the rule.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
perf(vk): the block reserve keeps 24 + 8 spare blocks on a 16 GB card, made again in the middle of a burst, and says why a block was made in the frame
Some checks failed
PR description / Title and description (pull_request_target) Successful in 7s
CI / What the change needs (pull_request) Has been cancelled
CI / Lint (pre-commit, ShellCheck, actionlint) (pull_request) Has been cancelled
CI / Third-party parts and guide screenshots (pull_request) Has been cancelled
CI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request) Has been cancelled
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Has been cancelled
CI / Renderer build check (Windows, compile --only renderer, without and with FSR 4) (pull_request) Has been cancelled
CI / Renderer build check (Linux, compile --only renderer, without and with FSR 4) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 1/2) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 2/2) (pull_request) Has been cancelled
CI / Website build and checks (pull_request) Has been cancelled
923d537f5c
On an RX 6800 (16 GB) across a six-area tour with RX_VK_TEXTURE_BLOCK_RESERVE=24 the spares took 218 blocks and the
images of 2 ms and more went from 117 (669 ms) to 39 (246 ms in the burst log). Of those 39, 14 were render targets
(their own pool, no spares), 12 sampled textures over a 32 MB block (4096x4096 RGBA8, 3072x3072 with mips, 1365x1365x90
arrays: VMA gives each memory of its own, 109 ms), and 13 within a block (49 ms). The large pool's spares fell to 9 of
24 in the first area while the small pool's never went below 11 of 12, and the 100 ms quiet before a spare is made
again held while textures came every frame.

- By the card: 24 large and 8 small from 16 GB, 12 and 4 from 12 GB, 2 and 1 from 8 GB, none under it or on an
  integrated GPU; RX_VK_TEXTURE_BLOCK_RESERVE=<n> is n and a third as many small, 64 at most.
- The quiet a spare waits for shrinks as they run out (texture_block_reserve::quiet_needed): 100 ms from half of them
  up, 20 ms under half, none under a quarter. A texture that then meets a spare being made waits for the rest of one
  vkAllocateMemory under VMA's pool lock, where with none left it would make the whole block itself.
- The image blocks line says what "made in the frame anyway" was: with none left, with spares there but not to be
  taken (a pass open, VMA's heap at its budget), the textures that waited for a spare being made (no longer counted
  as made in the frame), and the textures over a block, outside the pools.

The release rules are as they were: all of them past 90% of the allowance or at the arbiter's ask, none for 30 s after.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Author
Contributor

Tested in game: Windows 11, AMD Radeon RX 6800, driver 26.10.1, i7-13700: a pack over main 28cb22b9 with the texture block reserve, shader parse cache and sparse bind PRs together, six teleport tours through Market, Hyrule Field (child and adult), Kakariko, Kokiri Forest and Lake Hylia with the player's settings; no visual differences, loads stutter about 20% less, frame rate in play unchanged. One run (the first after the build) froze with refused submits (VK_ERROR_OUT_OF_DEVICE_MEMORY), not seen again in nine runs: under investigation, see Risks.

Tested in game: Windows 11, AMD Radeon RX 6800, driver 26.10.1, i7-13700: a pack over main 28cb22b9 with the texture block reserve, shader parse cache and sparse bind PRs together, six teleport tours through Market, Hyrule Field (child and adult), Kakariko, Kokiri Forest and Lake Hylia with the player's settings; no visual differences, loads stutter about 20% less, frame rate in play unchanged. One run (the first after the build) froze with refused submits (VK_ERROR_OUT_OF_DEVICE_MEMORY), not seen again in nine runs: under investigation, see Risks.
Member

Possibly related, for context:

  • PR #421 WIP: perf(vk): the images' pool in 32 MB blocks, not 128 (RX_VK_IMAGES_BLOCK_MB) — Same sampled-texture pool block sizing and allocation policy area
  • issue #1268 Game: 200-470 ms stutters when many new textures arrive: the main thread waits ~0.3 s on a GPU fence after a frame of uploads (RTX 3090, Linux) — Reports stutters when bursts of new textures arrive; related symptom, different GPU mechanism
Possibly related, for context: - PR #421 WIP: perf(vk): the images' pool in 32 MB blocks, not 128 (RX_VK_IMAGES_BLOCK_MB) — Same sampled-texture pool block sizing and allocation policy area - issue #1268 Game: 200-470 ms stutters when many new textures arrive: the main thread waits ~0.3 s on a GPU fence after a frame of uploads (RTX 3090, Linux) — Reports stutters when bursts of new textures arrive; related symptom, different GPU mechanism
Author
Contributor

Measurements corrected: each change built alone over main (two runs each), against five runs of main. The earlier '-20% stutter in the loads' was mostly load length varying between runs. On its own this change does not move visible stutter at arrivals beyond the noise; with its two siblings the worst arrival frame is 15-25% shorter. Staying WIP while the next change (imports made ahead of their first binding) is measured on top.

Measurements corrected: each change built alone over main (two runs each), against five runs of main. The earlier '-20% stutter in the loads' was mostly load length varying between runs. On its own this change does not move visible stutter at arrivals beyond the noise; with its two siblings the worst arrival frame is 15-25% shorter. Staying WIP while the next change (imports made ahead of their first binding) is measured on top.
Author
Contributor

Closing as not significant: the stutter a player sees at an area change is not measurably lower with this change, alone or together with its siblings (#2890, #2891, #2892) and three further fixes. Each does the work it targets; the frames that stutter just move to other work.

Setup: Windows 11, RX 6800, driver 26.10.1, the player's settings, uncapped. A six-teleport tour, each run a separate launch in timing mode. Visible stutter is what frames of 25 ms or more spend over 16.7 ms, from 1 s before control returns to 2 s after, summed over the six arrivals.

Build Visible stutter at the arrivals Worst arrival frame
main @ 28cb22b9 (8 runs) 2527-3491 ms, median 2945 383-425 ms
this PR alone (2 runs each) within main's range 355-395 ms
#2890 + #2891 + #2892 together (6 runs) 2289-3091 ms, median 2626 287-348 ms
the three plus imports reused across loads, imports during loading screens, and mirrors idle by play time (3 runs) 2647-3223 ms, median 3046 372-485 ms

What did show:

  • #2890 cut texture creation in the loads from ~520 ms to ~170 ms.
  • Together, the three shortened the worst arrival frame by 15-25%.
  • With the further fixes, stutter inside the loads fell (2256-2711 ms against main's 2663-3195), but mostly behind the loading screen; and the 10 s after an arrival got worse (479-629 ms against 274-545).

What holds an arrival frame now, from symbolized samples: host-memory imports of the game's re-created area pools (39% of the replay thread), and mirrors rebuilt after the loading screen (~16%). The first frame of an area pays for whatever is first used in it; moving one cost earlier did not shorten that frame overall.

The branches stay on conongnang's fork in case someone picks this up.

🤖 Generated with Claude Code

Closing as not significant: the stutter a player sees at an area change is not measurably lower with this change, alone or together with its siblings (#2890, #2891, #2892) and three further fixes. Each does the work it targets; the frames that stutter just move to other work. **Setup:** Windows 11, RX 6800, driver 26.10.1, the player's settings, uncapped. A six-teleport tour, each run a separate launch in timing mode. Visible stutter is what frames of 25 ms or more spend over 16.7 ms, from 1 s before control returns to 2 s after, summed over the six arrivals. | Build | Visible stutter at the arrivals | Worst arrival frame | |---|---|---| | main @ 28cb22b9 (8 runs) | 2527-3491 ms, median 2945 | 383-425 ms | | this PR alone (2 runs each) | within main's range | 355-395 ms | | #2890 + #2891 + #2892 together (6 runs) | 2289-3091 ms, median 2626 | 287-348 ms | | the three plus imports reused across loads, imports during loading screens, and mirrors idle by play time (3 runs) | 2647-3223 ms, median 3046 | 372-485 ms | What did show: - **#2890** cut texture creation in the loads from ~520 ms to ~170 ms. - **Together**, the three shortened the worst arrival frame by 15-25%. - **With the further fixes**, stutter inside the loads fell (2256-2711 ms against main's 2663-3195), but mostly behind the loading screen; and the 10 s after an arrival got worse (479-629 ms against 274-545). **What holds an arrival frame now**, from symbolized samples: host-memory imports of the game's re-created area pools (39% of the replay thread), and mirrors rebuilt after the loading screen (~16%). The first frame of an area pays for whatever is first used in it; moving one cost earlier did not shorten that frame overall. The branches stay on conongnang's fork in case someone picks this up. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
conongnang closed this pull request 2026-11-30 10:55:52 +00:00
Some checks failed
PR description / Title and description (pull_request_target) Successful in 7s
CI / What the change needs (pull_request) Has been cancelled
CI / Lint (pre-commit, ShellCheck, actionlint) (pull_request) Has been cancelled
CI / Third-party parts and guide screenshots (pull_request) Has been cancelled
CI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request) Has been cancelled
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Has been cancelled
CI / Renderer build check (Windows, compile --only renderer, without and with FSR 4) (pull_request) Has been cancelled
CI / Renderer build check (Linux, compile --only renderer, without and with FSR 4) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 1/2) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 2/2) (pull_request) Has been cancelled
CI / Website build and checks (pull_request) Has been cancelled

Pull request closed

Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
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!2890
No description provided.