perf(vk): the dead render targets go at every present, as RX_VK_DEAD_EVERY=1 meant, and a pooled image waits 8 presents (RX_VK_POOL_IDLE) #1255

Merged
HumanBean merged 2 commits from GummiNaomi/Longshot:perf/dead-targets-every-present into main 2026-11-16 22:59:50 +00:00
Member

Type: perf · Risk: low · Tested on: Windows 11, RTX 4070 SUPER (NVIDIA 617.42) · Needs: an AMD card; Linux; a Steam Deck; a card of 8 GB or less

Why

In Castle Town's market the game uses 1.5 to 2 GB of video memory for render targets it is no longer using, and on a 12 GB card that is enough to push it into the texture budget's cut: in a played session the market went from 5.7-6.5 GB on the first visit to 8.9-9.2 GB after a shop, the budget was cut from 6,998 MB to 4,093-4,604 MB, and 208 frames of 2,778 ran over 25 ms.

#994 set RX_VK_DEAD_EVERY to 1 so that the dead transient targets would be looked for at every present. That never took effect, and it is my mistake: the pass that reads the switch sits behind texture_frame's older if (frame_no % 10) return;, so it still ran at every tenth present only (the gate was already there in 1db4c290, and #994's test checked the default's value, not when the pass runs). A frame's dead targets waited up to nine more presents and came back to the pool ten frames' worth at once. Measured in the market with the camera turning: 160-290 rendered images (700-830 MB) alive at a time that were unused for two presents or more, and every one of them already met the dead rule (another target drawn over its storage from another start, the GPU done).

Once they do come back every present, the pool's own idle time shows: an image waited 120 presents for the next target of its shape. The game sizes each near character's shadow map anew every frame (397, 439, 479 ... pixels a side), each a pool key of its own that never comes again, and those filled the pool to its 768 MB bound.

Related: #994 (the pool's bound and these defaults), #1104 (the pool given back over the hold's line: the same memory from the other side; with this change the pool holds 100-140 MB in the market, not 480-530 MB).

What changed

The dead transient render targets are let go at every present, as RX_VK_DEAD_EVERY=1 was meant to do, and an image waits 8 presents in the pool, not 120.

  • vk: dead_targets_sweep() runs on the presents between the eviction's passes (gpu/vk/vk_texture.cpp). It lets go exactly what the pass's own rule lets go and nothing else: a render target of one level and layer, unused for RX_VK_DEAD_MIN_UNUSED presents, the GPU past its last use, with another target drawn over its storage from another start since (target_overlap.h). Nothing is written back; the image goes to the target pool. gpu/vk/dead_targets.h holds when the pass and the sweep run, so the cadence can be tested. RX_VK_DEAD_EVERY=10 leaves them to the pass alone, as it was in effect; RX_VK_DEAD_TARGETS=0 and RX_VK_NO_EVICT turn the sweep off as they turn the pass's off.
  • vk: RX_VK_POOL_IDLE=<presents>, 8 by default (gpu/vk/target_pool.h, pool_trim); 120 is the behaviour before.
  • vk: the 600-present line "render targets drawn over from another start, let go" also says how many went between the passes.
  • tests: tests/test_dead_targets_sweep.py (the presents the pass and the sweep run at, compiled from the header; that texture_frame's gate calls the sweep before it returns; that the sweep uses the pass's rule and writes nothing back; the pool's idle rule). tests/test_target_image_pool.py follows the moved lines, and its check of "every present" now asks for the sweep's call.
  • docs: docs/development.md (the switches' row); docs/tested/2026-11-16-dead-targets-every-present-gumminaomi-old.md and -new.md.

Measurements

Verdict: in the market with the camera turning, 0.6 to 1.0 GB less video memory (the render targets' blocks 576-768 MB against 1,440-1,856 MB) and 18-30 % fewer images made new, for about half a millisecond more of the render thread a frame; the frame rate is the same within the runs' spread (60.4 and 60.5 fps against 60.8 and 62.2).

Hardware: Windows 11 Pro 26200, RTX 4070 SUPER 12 GB (NVIDIA 617.42), Ryzen 9 9950X3D (16 cores, SMT off), 32 GB
Scene: save set "First Step into Hyrule Town", the walk into Castle Town's market and the camera turning (town-market.txt, wall clock, 100 s), 2560x1440, DLAA, uncapped
Method: headless runs, two rounds with the two sides in turn; the frame trace from 48 s on (the camera turn) and the log's status lines (the last three of a run)
Baseline: main's behaviour is this PR with RX_VK_DEAD_EVERY=10 RX_VK_POOL_IDLE=120 (the sweep never runs and the pool's idle time is main's); both sides are one build, main ac778751 with this change. The branch has since been merged with main a413bf1c (one conflict in vk_texture.cpp: main's reuse_retire_frame and this PR's sweep were added at the same place, both kept) and built and run once there: 22,468 of 25,032 dead targets let go between the passes, the render targets' blocks 608-736 MB
How to reproduce: RX_VK_DEAD_EVERY=10 RX_VK_POOL_IDLE=120 against no switches, on the route above

Before, RX_VK_DEAD_EVERY=10 RX_VK_POOL_IDLE=120: this PR @ 79381e65 (two runs) After: this PR @ 79381e65 (two runs)
VRAM used 7,632-8,048 and 7,246-7,600 MB 6,732-6,926 and 6,796-6,860 MB
The render targets' blocks 1,568-1,856 and 1,440-1,824 MB 576 and 608-768 MB
Images in those blocks 1,095-1,574 and 1,129-1,581 MB 468-523 and 508-653 MB
The target pool holds (end of run) 480 and 534 MB 139 and 106 MB
Render target images made new 8,540 and 7,256 5,965 and 5,936
reused from the pool 37,379 and 29,197 41,553 and 41,914
Dead targets let go between the passes 0 of 41,937 and 0 of 38,419 44,867 of 50,053 and 44,900 of 49,738
Market fps 60.8 and 62.2 60.4 and 60.5
Median / 99th percentile frame 15.8 / 25.5 and 15.5 / 24.6 ms 15.8 / 25.1 and 15.8 / 25.8 ms
Frames over 25 ms 33 and 23 29 and 42
Descriptors, a frame 1.74 and 1.68 ms 2.19 and 2.17 ms
texture_frame, a frame 0.60 and 0.48 ms 0.80 and 0.79 ms

The cost: the texture-destroyed generation now moves at every present, so each handle a recording resolved is looked up again once a frame (descriptors about +0.45 ms), and the sweep orders the rendered textures by address each present (texture_frame about +0.25 ms). RX_VK_DEAD_EVERY=2 would halve both; not measured.

Picture checks, both sides:

Before, RX_VK_DEAD_EVERY=10 RX_VK_POOL_IDLE=120: this PR @ 79381e65 After: this PR @ 79381e65
Textures let go, made again and then sampled empty (RX_VK_LOG_REMADE=1), the gate at night and the market, 100 s each 0 and 0 0 and 0
The same check on an earlier build with this change (three runs a side over both routes) 0, 0, 0 0, 0, 0
Frames with 1 % or more of a 320x180 shot flipping for one frame, the gate at night (~12,500 frames a run) 25 and 35; on the earlier build 30, 36, 13, 36 20 and 52; on the earlier build 72, 31, 58, 35

The flip count runs higher on this side in three of six runs and I cannot rule out a small real difference. I looked at the worst frames of both sides: on both they are scattered single pixels along the edges of the distant lit town while Link walks through the gate, the same on either side, with no surface that flashes. In two played sessions with this change (and the shadow maps' storage slots, a separate PR) the player saw no flicker, and the texture budget was not cut once (6,998 MB throughout, where the session before it was cut to 4,093-4,604 MB).

Flags and settings

One switch now does what it said, and one is new; both on by default. RX_VK_NO_EVICT and RX_VK_DEAD_TARGETS (existing) turn the sweep off as they turn the pass's off.

Flag What it is Before this PR After this PR Effect Helps / doesn't help / untested Recommendation
RX_VK_DEAD_EVERY how often the dead transient targets are looked for, in presents 1, in effect 10 1, in effect 1 0.6-1.0 GB less VRAM in the market, +0.5 ms of the render thread a frame helps on the RTX 4070 SUPER; untested on AMD, Intel, Linux, the Deck 1
RX_VK_POOL_IDLE how long an image waits in the target pool, in presents (none: 120) 8 the pool holds 100-140 MB in the market, not its 768 MB bound as above 8

Testing

Tested: Windows 11, RTX 4070 SUPER, NVIDIA 617.42: the runs above; two played sessions in the market, a shop and back (with the shadow maps' storage slots as well); tests/test_dead_targets_sweep.py, tests/test_target_image_pool.py, tests/test_target_pool_cap.py and tests/test_target_overlap.py pass; python -I -B tests/run_all.py: 391 passed, 90 failed, 213 skipped, the same 90 failing as on main ac778751 on this PC (390 passed there; its toolchain: no gcc, Windows line endings, fixtures needing tools not installed).

Not tested: AMD, Intel, Linux, the Steam Deck; a card of 8 GB or less, where the memory matters most; frame generation on; other games.

Must be tested:

  • A card of 8 GB or less, Castle Town's market with the camera turning: expecting less VRAM in use and fewer textures retired for the budget than with RX_VK_DEAD_EVERY=10 RX_VK_POOL_IDLE=120, and no flicker of shadows or lit windows (by hand)
  • Linux, any GPU: the same route, expecting no crash and no flicker (Test Farm: @Beanstalk linux)
  • A Steam Deck: the market, expecting the same or a better frame rate (by hand)

Risks

What could break: a render target let go a few presents earlier than before and then read again without being drawn would come back empty for a frame (a shadow or a bloom flicker). The rule that decides it is unchanged and the made-again check found none, but the flip counts above leave a small doubt. About half a millisecond more of the render thread a frame where targets die every frame.

Turning it off: RX_VK_DEAD_EVERY=10 RX_VK_POOL_IDLE=120.

Compatibility: Nothing changes.

Issues

None found for this exactly. #994 is the change it corrects.

Checklist

Everyone

  • One topic.
  • The title is a Conventional Commit (type(scope): description) of the status line's type.
  • Why gives the reason plainly and links the issues that fit (the tracker searched).
  • Measurements has a verdict, or one line saying why there is nothing to measure.
  • Testing names what was tested, what wasn't, and what must still be tested, where and how.
  • Rebased on current main.
  • python -I -B tests/run_all.py passes (any failure that also fails on main is named).
  • No game files, dumps, build output or generated files.
  • third_party/ untouched (a new folder with a PROVENANCE.md instead).
  • The license is OK: GPL-3.0-or-later, nothing incompatible and nothing decompiled.

When it applies

  • AI assistance recorded with Assisted-by: / Co-Authored-By: trailers.
  • Switches documented (docs/development.md; the README for a menu row) and shipped at their recommended value.
  • A file in docs/tested/ for each new measured run (format in docs/tested-configurations.md).
  • A check under tests/ that reads changed source updated in this PR, not weakened.
  • Docs updated.
  • Host code builds on both Windows (llvm-mingw) and Linux, with UTF-8 paths. (Built on Windows only.)

🤖 Generated with Claude Code

**Type:** perf · **Risk:** low · **Tested on:** Windows 11, RTX 4070 SUPER (NVIDIA 617.42) · **Needs:** an AMD card; Linux; a Steam Deck; a card of 8 GB or less ## Why In Castle Town's market the game uses 1.5 to 2 GB of video memory for render targets it is no longer using, and on a 12 GB card that is enough to push it into the texture budget's cut: in a played session the market went from 5.7-6.5 GB on the first visit to 8.9-9.2 GB after a shop, the budget was cut from 6,998 MB to 4,093-4,604 MB, and 208 frames of 2,778 ran over 25 ms. #994 set `RX_VK_DEAD_EVERY` to 1 so that the dead transient targets would be looked for at every present. That never took effect, and it is my mistake: the pass that reads the switch sits behind `texture_frame`'s older `if (frame_no % 10) return;`, so it still ran at every tenth present only (the gate was already there in 1db4c290, and #994's test checked the default's value, not when the pass runs). A frame's dead targets waited up to nine more presents and came back to the pool ten frames' worth at once. Measured in the market with the camera turning: 160-290 rendered images (700-830 MB) alive at a time that were unused for two presents or more, and every one of them already met the dead rule (another target drawn over its storage from another start, the GPU done). Once they do come back every present, the pool's own idle time shows: an image waited 120 presents for the next target of its shape. The game sizes each near character's shadow map anew every frame (397, 439, 479 ... pixels a side), each a pool key of its own that never comes again, and those filled the pool to its 768 MB bound. Related: #994 (the pool's bound and these defaults), #1104 (the pool given back over the hold's line: the same memory from the other side; with this change the pool holds 100-140 MB in the market, not 480-530 MB). ## What changed The dead transient render targets are let go at every present, as `RX_VK_DEAD_EVERY=1` was meant to do, and an image waits 8 presents in the pool, not 120. - vk: `dead_targets_sweep()` runs on the presents between the eviction's passes (`gpu/vk/vk_texture.cpp`). It lets go exactly what the pass's own rule lets go and nothing else: a render target of one level and layer, unused for `RX_VK_DEAD_MIN_UNUSED` presents, the GPU past its last use, with another target drawn over its storage from another start since (`target_overlap.h`). Nothing is written back; the image goes to the target pool. `gpu/vk/dead_targets.h` holds when the pass and the sweep run, so the cadence can be tested. `RX_VK_DEAD_EVERY=10` leaves them to the pass alone, as it was in effect; `RX_VK_DEAD_TARGETS=0` and `RX_VK_NO_EVICT` turn the sweep off as they turn the pass's off. - vk: `RX_VK_POOL_IDLE=<presents>`, 8 by default (`gpu/vk/target_pool.h`, `pool_trim`); 120 is the behaviour before. - vk: the 600-present line "render targets drawn over from another start, let go" also says how many went between the passes. - tests: `tests/test_dead_targets_sweep.py` (the presents the pass and the sweep run at, compiled from the header; that `texture_frame`'s gate calls the sweep before it returns; that the sweep uses the pass's rule and writes nothing back; the pool's idle rule). `tests/test_target_image_pool.py` follows the moved lines, and its check of "every present" now asks for the sweep's call. - docs: `docs/development.md` (the switches' row); `docs/tested/2026-11-16-dead-targets-every-present-gumminaomi-old.md` and `-new.md`. ## Measurements **Verdict:** in the market with the camera turning, 0.6 to 1.0 GB less video memory (the render targets' blocks 576-768 MB against 1,440-1,856 MB) and 18-30 % fewer images made new, for about half a millisecond more of the render thread a frame; the frame rate is the same within the runs' spread (60.4 and 60.5 fps against 60.8 and 62.2). Hardware: Windows 11 Pro 26200, RTX 4070 SUPER 12 GB (NVIDIA 617.42), Ryzen 9 9950X3D (16 cores, SMT off), 32 GB Scene: save set "First Step into Hyrule Town", the walk into Castle Town's market and the camera turning (town-market.txt, wall clock, 100 s), 2560x1440, DLAA, uncapped Method: headless runs, two rounds with the two sides in turn; the frame trace from 48 s on (the camera turn) and the log's status lines (the last three of a run) Baseline: main's behaviour is this PR with `RX_VK_DEAD_EVERY=10 RX_VK_POOL_IDLE=120` (the sweep never runs and the pool's idle time is main's); both sides are one build, main ac778751 with this change. The branch has since been merged with main a413bf1c (one conflict in `vk_texture.cpp`: main's `reuse_retire_frame` and this PR's sweep were added at the same place, both kept) and built and run once there: 22,468 of 25,032 dead targets let go between the passes, the render targets' blocks 608-736 MB How to reproduce: `RX_VK_DEAD_EVERY=10 RX_VK_POOL_IDLE=120` against no switches, on the route above | | Before, `RX_VK_DEAD_EVERY=10 RX_VK_POOL_IDLE=120`: this PR @ 79381e65 (two runs) | After: this PR @ 79381e65 (two runs) | |---|---|---| | VRAM used | 7,632-8,048 and 7,246-7,600 MB | 6,732-6,926 and 6,796-6,860 MB | | The render targets' blocks | 1,568-1,856 and 1,440-1,824 MB | 576 and 608-768 MB | | Images in those blocks | 1,095-1,574 and 1,129-1,581 MB | 468-523 and 508-653 MB | | The target pool holds (end of run) | 480 and 534 MB | 139 and 106 MB | | Render target images made new | 8,540 and 7,256 | 5,965 and 5,936 | | reused from the pool | 37,379 and 29,197 | 41,553 and 41,914 | | Dead targets let go between the passes | 0 of 41,937 and 0 of 38,419 | 44,867 of 50,053 and 44,900 of 49,738 | | Market fps | 60.8 and 62.2 | 60.4 and 60.5 | | Median / 99th percentile frame | 15.8 / 25.5 and 15.5 / 24.6 ms | 15.8 / 25.1 and 15.8 / 25.8 ms | | Frames over 25 ms | 33 and 23 | 29 and 42 | | Descriptors, a frame | 1.74 and 1.68 ms | 2.19 and 2.17 ms | | `texture_frame`, a frame | 0.60 and 0.48 ms | 0.80 and 0.79 ms | The cost: the texture-destroyed generation now moves at every present, so each handle a recording resolved is looked up again once a frame (descriptors about +0.45 ms), and the sweep orders the rendered textures by address each present (`texture_frame` about +0.25 ms). `RX_VK_DEAD_EVERY=2` would halve both; not measured. Picture checks, both sides: | | Before, `RX_VK_DEAD_EVERY=10 RX_VK_POOL_IDLE=120`: this PR @ 79381e65 | After: this PR @ 79381e65 | |---|---|---| | Textures let go, made again and then sampled empty (`RX_VK_LOG_REMADE=1`), the gate at night and the market, 100 s each | 0 and 0 | 0 and 0 | | The same check on an earlier build with this change (three runs a side over both routes) | 0, 0, 0 | 0, 0, 0 | | Frames with 1 % or more of a 320x180 shot flipping for one frame, the gate at night (~12,500 frames a run) | 25 and 35; on the earlier build 30, 36, 13, 36 | 20 and 52; on the earlier build 72, 31, 58, 35 | The flip count runs higher on this side in three of six runs and I cannot rule out a small real difference. I looked at the worst frames of both sides: on both they are scattered single pixels along the edges of the distant lit town while Link walks through the gate, the same on either side, with no surface that flashes. In two played sessions with this change (and the shadow maps' storage slots, a separate PR) the player saw no flicker, and the texture budget was not cut once (6,998 MB throughout, where the session before it was cut to 4,093-4,604 MB). ### Flags and settings One switch now does what it said, and one is new; both on by default. `RX_VK_NO_EVICT` and `RX_VK_DEAD_TARGETS` (existing) turn the sweep off as they turn the pass's off. | Flag | What it is | Before this PR | After this PR | Effect | Helps / doesn't help / untested | Recommendation | |---|---|---|---|---|---|---| | `RX_VK_DEAD_EVERY` | how often the dead transient targets are looked for, in presents | 1, in effect 10 | 1, in effect 1 | 0.6-1.0 GB less VRAM in the market, +0.5 ms of the render thread a frame | helps on the RTX 4070 SUPER; untested on AMD, Intel, Linux, the Deck | 1 | | `RX_VK_POOL_IDLE` | how long an image waits in the target pool, in presents | (none: 120) | 8 | the pool holds 100-140 MB in the market, not its 768 MB bound | as above | 8 | ## Testing **Tested:** Windows 11, RTX 4070 SUPER, NVIDIA 617.42: the runs above; two played sessions in the market, a shop and back (with the shadow maps' storage slots as well); `tests/test_dead_targets_sweep.py`, `tests/test_target_image_pool.py`, `tests/test_target_pool_cap.py` and `tests/test_target_overlap.py` pass; `python -I -B tests/run_all.py`: 391 passed, 90 failed, 213 skipped, the same 90 failing as on main ac778751 on this PC (390 passed there; its toolchain: no gcc, Windows line endings, fixtures needing tools not installed). **Not tested:** AMD, Intel, Linux, the Steam Deck; a card of 8 GB or less, where the memory matters most; frame generation on; other games. **Must be tested:** - A card of 8 GB or less, Castle Town's market with the camera turning: expecting less VRAM in use and fewer textures retired for the budget than with `RX_VK_DEAD_EVERY=10 RX_VK_POOL_IDLE=120`, and no flicker of shadows or lit windows (by hand) - Linux, any GPU: the same route, expecting no crash and no flicker (Test Farm: @Beanstalk linux) - A Steam Deck: the market, expecting the same or a better frame rate (by hand) ## Risks **What could break:** a render target let go a few presents earlier than before and then read again without being drawn would come back empty for a frame (a shadow or a bloom flicker). The rule that decides it is unchanged and the made-again check found none, but the flip counts above leave a small doubt. About half a millisecond more of the render thread a frame where targets die every frame. **Turning it off:** `RX_VK_DEAD_EVERY=10 RX_VK_POOL_IDLE=120`. **Compatibility:** Nothing changes. ## Issues None found for this exactly. #994 is the change it corrects. ## Checklist ### Everyone - [x] One topic. - [x] The title is a Conventional Commit (`type(scope): description`) of the status line's type. - [x] Why gives the reason plainly and links the issues that fit (the tracker searched). - [x] Measurements has a verdict, or one line saying why there is nothing to measure. - [x] Testing names what was tested, what wasn't, and what must still be tested, where and how. - [x] Rebased on current `main`. - [x] `python -I -B tests/run_all.py` passes (any failure that also fails on `main` is named). - [x] No game files, dumps, build output or generated files. - [x] `third_party/` untouched (a new folder with a `PROVENANCE.md` instead). - [x] The license is OK: GPL-3.0-or-later, nothing incompatible and nothing decompiled. ### When it applies - [x] AI assistance recorded with `Assisted-by:` / `Co-Authored-By:` trailers. - [x] Switches documented (docs/development.md; the README for a menu row) and shipped at their recommended value. - [x] A file in `docs/tested/` for each new measured run (format in `docs/tested-configurations.md`). - [x] A check under `tests/` that reads changed source updated in this PR, not weakened. - [x] Docs updated. - [ ] Host code builds on both Windows (llvm-mingw) and Linux, with UTF-8 paths. (Built on Windows only.) 🤖 Generated with [Claude Code](https://claude.com/claude-code)
RX_VK_DEAD_EVERY has defaulted to 1 since #994, but the pass that reads it
sits behind texture_frame's older `if (frame_no % 10) return;` and still ran
at every tenth present: a frame's dead transient targets waited up to nine
more presents and came back to the pool ten frames' worth at once. In Castle
Town's market with the camera turning, 160-290 rendered images (700-830 MB)
were alive at a time that already met the dead rule.

dead_targets_sweep() now runs on the presents between the passes, with the
pass's own rule and nothing else (one level and layer, unused for
RX_VK_DEAD_MIN_UNUSED presents, the GPU done, another target drawn over its
storage from another start); gpu/vk/dead_targets.h holds when each runs.
With the targets back every present, an image waits 8 presents in the pool,
not 120 (RX_VK_POOL_IDLE): the shapes that never come again (the character
shadow maps whose side changes every frame) had filled it to its bound.

Market, camera turning, two runs a side: VRAM 6.7-6.9 GB against 7.2-8.0,
the render targets' blocks 576-768 MB against 1,440-1,856, images made new
5,936-5,965 against 7,256-8,540, 60.4 and 60.5 fps against 60.8 and 62.2;
descriptors +0.45 ms and texture_frame +0.25 ms a frame. No texture let go,
made again and sampled empty in either side's runs.
RX_VK_DEAD_EVERY=10 RX_VK_POOL_IDLE=120: as before.

Assisted-by: Claude Mythos 5.2
Co-Authored-By: Claude Mythos 5.2 <[email protected]>
Merge main into perf/dead-targets-every-present
Some checks failed
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been skipped
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been skipped
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been skipped
Third-party parts / The same as upstream (pull_request) Has been skipped
Website / Website on Cloudflare (pull_request) Has been skipped
CI / Conventional Commit title (pull_request) Successful in 12s
Guide screenshots / Guide images and local UI source review (pull_request) Failing after 17s
CI / Workflow lint (actionlint) (pull_request) Successful in 25s
Third-party parts / As their notes say (pull_request) Successful in 28s
Website / Website on Cloudflare (pull_request_target) Has been skipped
PR description / Description follows the template (pull_request_target) Failing after 5s
beanstalk/approval approved by GummiNaomi (reviewed)
beanstalk/linux 0/1 pass, 0 running, 0 queued
f490c2aa7e
main's reuse_retire_frame (#1222) and this branch's dead_targets_sweep were both added before texture_frame in
gpu/vk/vk_texture.cpp: both kept.

Assisted-by: Claude Mythos 5.2
Co-Authored-By: Claude Mythos 5.2 <[email protected]>
Collaborator

Possibly related, for context:

  • PR #518 WIP: fix(vk): cap the render-target image pool and count it in the texture budget — Open PR also changes render-target pool handling and trimming
  • issue #668 Game: [CRITICAL] GPU hang + Windows forced reset in Hyrule Castle Town at night - RTX 5050 8GB — Open Castle Town VRAM-pressure crash report, same scene and constraint
Possibly related, for context: - PR #518 WIP: fix(vk): cap the render-target image pool and count it in the texture budget — Open PR also changes render-target pool handling and trimming - issue #668 Game: [CRITICAL] GPU hang + Windows forced reset in Hyrule Castle Town at night - RTX 5050 8GB — Open Castle Town VRAM-pressure crash report, same scene and constraint
Author
Member

@Beanstalk linux: Castle Town's market with the camera turning (save set "First Step into Hyrule Town", the walk north into the market, then the camera turned for a minute), once with this PR's defaults and once with RX_VK_DEAD_EVERY=10 RX_VK_POOL_IDLE=120 (the behaviour before it). Expecting: no crash; the same picture on both, with no flicker of shadows or lit windows; with the defaults less video memory in use and smaller render-target blocks (the log's vk: VRAM: and image blocks (render targets) lines), and a frame rate no worse.

🤖 Generated with Claude Code

@Beanstalk linux: Castle Town's market with the camera turning (save set "First Step into Hyrule Town", the walk north into the market, then the camera turned for a minute), once with this PR's defaults and once with `RX_VK_DEAD_EVERY=10 RX_VK_POOL_IDLE=120` (the behaviour before it). Expecting: no crash; the same picture on both, with no flicker of shadows or lit windows; with the defaults less video memory in use and smaller render-target blocks (the log's `vk: VRAM:` and `image blocks (render targets)` lines), and a frame rate no worse. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Member

Beanstalk test farm

Commit f490c2a · tier reviewed · approved by GummiNaomi · dashboard

What will be tested · AI plan (gpt-6.1-terra)

On Linux, the plan teleports a new save to Castle Town's market and turns the camera, comparing PR defaults and the earlier render-target behavior against main. It takes roughly 30 minutes per tester and measures VRAM, frame rate and frame times, with snapshots for visual regressions. Crashes, substantial VRAM or performance regressions, and picture differences fail the plan. The requested town save is unavailable; render-target block sizes and transient flicker cannot be directly compared by these probes.

  • Where: linux (1 report).
  • Matrix: 1 cell, each on main and the PR: RX_VK_POOL_IDLE 120 (PR only); RX_VK_DEAD_EVERY 10 (PR only).
  • market-defaults: from a new save, then teleport to Market, take the picture market-start to compare with main, 3 times: move the stick, take the picture market-mid to compare with main, take the picture market-end to compare with main, measure market for 20 s (after 0 s warm-up); 1 run on each side.
  • market-previous: from a new save, then teleport to Market, take the picture market-start to compare with main, 3 times: move the stick, take the picture market-mid to compare with main, take the picture market-end to compare with main, measure market for 20 s (after 0 s warm-up); 1 run on each side.
  • Measured: crashes, VRAM use, frame times, stutters and hitches, draws and frame rate, the game's log.
  • The PR fails if: it crashes; or frame rate is more than 5% below main; or a picture differs from main by more than 5%; or peak VRAM is more than 10% above main; or frame time (p99) is more than 15% above main.
  • Time: about 26 min of game runs per tester (4 game starts), plus the two builds.

Done. Comment @Beanstalk to run it again.

Target Reports Crash Frame p99 (ms) vs main VRAM peak (MB) vs main Result
linux 0/1 — — — queued
<!-- beanstalk:sticky --> ### Beanstalk test farm Commit `f490c2a` · tier **reviewed** · approved by GummiNaomi · [dashboard](https://beanstalk.magicbean.dev/prs/1255) **What will be tested** · AI plan (`gpt-6.1-terra`) On Linux, the plan teleports a new save to Castle Town's market and turns the camera, comparing PR defaults and the earlier render-target behavior against main. It takes roughly 30 minutes per tester and measures VRAM, frame rate and frame times, with snapshots for visual regressions. Crashes, substantial VRAM or performance regressions, and picture differences fail the plan. The requested town save is unavailable; render-target block sizes and transient flicker cannot be directly compared by these probes. - **Where:** linux (1 report). - **Matrix:** 1 cell, each on main and the PR: RX_VK_POOL_IDLE `120` (PR only); RX_VK_DEAD_EVERY `10` (PR only). - **market-defaults:** from a new save, then teleport to Market, take the picture market-start to compare with main, 3 times: move the stick, take the picture market-mid to compare with main, take the picture market-end to compare with main, measure market for 20 s (after 0 s warm-up); 1 run on each side. - **market-previous:** from a new save, then teleport to Market, take the picture market-start to compare with main, 3 times: move the stick, take the picture market-mid to compare with main, take the picture market-end to compare with main, measure market for 20 s (after 0 s warm-up); 1 run on each side. - **Measured:** crashes, VRAM use, frame times, stutters and hitches, draws and frame rate, the game's log. - **The PR fails if:** it crashes; or frame rate is more than 5% below main; or a picture differs from main by more than 5%; or peak VRAM is more than 10% above main; or frame time (p99) is more than 15% above main. - **Time:** about 26 min of game runs per tester (4 game starts), plus the two builds. Done. Comment `@Beanstalk` to run it again. | Target | Reports | Crash | Frame p99 (ms) vs main | VRAM peak (MB) vs main | Result | | --- | --- | --- | --- | --- | --- | | linux | 0/1 | — | — | — | queued |
GummiNaomi changed title from WIP: perf(vk): the dead render targets go at every present, as RX_VK_DEAD_EVERY=1 meant, and a pooled image waits 8 presents (RX_VK_POOL_IDLE) to perf(vk): the dead render targets go at every present, as RX_VK_DEAD_EVERY=1 meant, and a pooled image waits 8 presents (RX_VK_POOL_IDLE) 2026-11-16 22:34:22 +00:00
HumanBean deleted branch perf/dead-targets-every-present 2026-11-16 22:59:50 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
3 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!1255
No description provided.