revert(vk): the eviction's waits in presents again at any frame rate, as before #771 #873

Merged
HumanBean merged 1 commit from HumanBean/Longshot:revert/evict-seconds into main 2026-11-15 18:50:08 +00:00
Owner

Type: revert · Risk: low · Tested on: none (game-free: the tree is main before #771, fd770e7f's parent, byte for byte) · Needs: none

Why

#771 was merged while its review asked for a change. Its idea is right: below 60 fps, the waits before an unused texture is let go should be counted in seconds, not in frames. But the way it measures the frame rate goes wrong right after a load or a long hitch, even at a steady 60 fps.

It ages every texture by the frame rate averaged over the last ten seconds. A gap with no frames, such as an area load's stall, makes that average read far too low for the next ten seconds. At 60 fps after a 30 s gap it reads about 2 fps one second in and about 8.6 fps five seconds in, so textures look 7 to 30 times older than they are:

  • a texture unused for 1.4 s counts as past the ten-second line, and one unused for 4.3 s as past the thirty-second line;
  • the minute kept for textures the GPU drew drops to as little as 2 s.

That happens just after an area loads, when VRAM is tightest. The textures let go are uploaded again, and one the GPU drew can come back empty, which the minute's wait exists to prevent. The review's details: #771 (comment)

This takes it back out so that main and the next release candidate don't ship it. The change comes back in its own pull request, with the age measured per texture in seconds instead of through one average rate.

See #771.

What changed

A plain jj revert of fd770e7f (#771). Main goes back to counting the compaction's hold and reserve, and the GPU-drawn textures' keep, in presents at any frame rate, as before #771.

  • gpu/vk/vk_texture.cpp: the frame-rate marks and present_rate removed; hold_target and the keep take the present counts again.
  • gpu/vk/vram_compact.h: age_at_60 removed. gpu/vk/keep_rendered.h: at_rate removed.
  • docs/development.md: the RX_VK_EVICT_BY_PRESENTS row removed.
  • tests/test_keep_rendered.*, tests/test_vram_compact.*: back to main's before #771.

Measurements

Nothing to measure: this restores main's code from before #771 exactly (jj diff --from fd770e7f- --to this commit is empty), whose behaviour is what every release so far has shipped.

Flags and settings

RX_VK_EVICT_BY_PRESENTS (added by #771) goes away with it: what it switched back to is the only behaviour again.

Flag What it is Before this PR After this PR Effect Helps / doesn't help / untested Recommendation
RX_VK_EVICT_BY_PRESENTS #771's off switch: the waits in presents unset: waits by the measured rate below 60 fps removed: waits in presents always as before #771 before #771's behaviour, shipped in every release removed with #771

Testing

Tested: game-free only, by reading: the reverted tree is identical to main before #771 (an empty diff against fd770e7f's parent). No tests were run on this PC; the checks are left to CI.

Not tested: nothing new to test: the code is what main ran before #771 merged, today.

Must be tested: None.

Risks

What could break: nothing that main didn't do before today: below 60 fps, the hold's ten and thirty seconds and the keep's minute stretch again (at 3.5 fps they are three, nine and seventeen minutes), which is what #771 set out to fix and its follow-up will fix again.

Turning it off: revert this commit.

Compatibility: Nothing changes: no save, option, cache or vk ABI is touched.

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). Left to CI: no tests are run on this PC.
  • 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 check under tests/ that reads changed source updated in this PR, not weakened.
  • Host code builds on both Windows (llvm-mingw) and Linux, with UTF-8 paths. (The code is main's from before #771, which the nightlies built on both.)
  • Docs updated.

🤖 Generated with Claude Code

**Type:** revert · **Risk:** low · **Tested on:** none (game-free: the tree is main before #771, fd770e7f's parent, byte for byte) · **Needs:** none ## Why [#771](https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/771) was merged while its review asked for a change. Its idea is right: below 60 fps, the waits before an unused texture is let go should be counted in seconds, not in frames. But the way it measures the frame rate goes wrong right after a load or a long hitch, even at a steady 60 fps. It ages every texture by the frame rate averaged over the last ten seconds. A gap with no frames, such as an area load's stall, makes that average read far too low for the next ten seconds. At 60 fps after a 30 s gap it reads about 2 fps one second in and about 8.6 fps five seconds in, so textures look 7 to 30 times older than they are: - a texture unused for 1.4 s counts as past the ten-second line, and one unused for 4.3 s as past the thirty-second line; - the minute kept for textures the GPU drew drops to as little as 2 s. That happens just after an area loads, when VRAM is tightest. The textures let go are uploaded again, and one the GPU drew can come back empty, which the minute's wait exists to prevent. The review's details: https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/771#issuecomment-26880 This takes it back out so that main and the next release candidate don't ship it. The change comes back in its own pull request, with the age measured per texture in seconds instead of through one average rate. See [#771](https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/771). ## What changed A plain `jj revert` of fd770e7f (#771). Main goes back to counting the compaction's hold and reserve, and the GPU-drawn textures' keep, in presents at any frame rate, as before #771. - `gpu/vk/vk_texture.cpp`: the frame-rate marks and `present_rate` removed; `hold_target` and the keep take the present counts again. - `gpu/vk/vram_compact.h`: `age_at_60` removed. `gpu/vk/keep_rendered.h`: `at_rate` removed. - `docs/development.md`: the `RX_VK_EVICT_BY_PRESENTS` row removed. - `tests/test_keep_rendered.*`, `tests/test_vram_compact.*`: back to main's before #771. ## Measurements Nothing to measure: this restores main's code from before #771 exactly (`jj diff --from fd770e7f- --to` this commit is empty), whose behaviour is what every release so far has shipped. ### Flags and settings `RX_VK_EVICT_BY_PRESENTS` (added by #771) goes away with it: what it switched back to is the only behaviour again. | Flag | What it is | Before this PR | After this PR | Effect | Helps / doesn't help / untested | Recommendation | |---|---|---|---|---|---|---| | `RX_VK_EVICT_BY_PRESENTS` | #771's off switch: the waits in presents | unset: waits by the measured rate below 60 fps | removed: waits in presents always | as before #771 | before #771's behaviour, shipped in every release | removed with #771 | ## Testing **Tested:** game-free only, by reading: the reverted tree is identical to main before #771 (an empty diff against fd770e7f's parent). No tests were run on this PC; the checks are left to CI. **Not tested:** nothing new to test: the code is what main ran before #771 merged, today. **Must be tested:** None. ## Risks **What could break:** nothing that main didn't do before today: below 60 fps, the hold's ten and thirty seconds and the keep's minute stretch again (at 3.5 fps they are three, nine and seventeen minutes), which is what #771 set out to fix and its follow-up will fix again. **Turning it off:** revert this commit. **Compatibility:** Nothing changes: no save, option, cache or vk ABI is touched. ## 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`. - [ ] `python -I -B tests/run_all.py` passes (any failure that also fails on `main` is named). Left to CI: no tests are run on this PC. - [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 check under `tests/` that reads changed source updated in this PR, not weakened. - [x] Host code builds on both Windows (llvm-mingw) and Linux, with UTF-8 paths. (The code is main's from before #771, which the nightlies built on both.) - [x] Docs updated. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
revert(vk): the eviction's waits in presents again at any frame rate, as before #771
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_target) Has been skipped
CI / Conventional Commit title (pull_request) Successful in 4s
CI / Workflow lint (actionlint) (pull_request) Successful in 5s
Guide screenshots / Guide images and local UI source review (pull_request) Failing after 5s
Third-party parts / As their notes say (pull_request) Successful in 8s
PR description / Description follows the template (pull_request_target) Successful in 4s
d8c9a4aa28
This reverts commit fd770e7f5f (#771), merged with a request for changes standing:
its rate, averaged over the last ten seconds, reads far too low for ten seconds after any gap without presents (a
load's stall, a long hitch), so textures are aged several times too fast right after an area loads, even at 60 fps.
The change comes back in a new pull request with that fixed.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
HumanBean force-pushed revert/evict-seconds from d8c9a4aa28
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_target) Has been skipped
CI / Conventional Commit title (pull_request) Successful in 4s
CI / Workflow lint (actionlint) (pull_request) Successful in 5s
Guide screenshots / Guide images and local UI source review (pull_request) Failing after 5s
Third-party parts / As their notes say (pull_request) Successful in 8s
PR description / Description follows the template (pull_request_target) Successful in 4s
to e020e46983
Some checks failed
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been skipped
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
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 5s
CI / Workflow lint (actionlint) (pull_request) Successful in 12s
Guide screenshots / Guide images and local UI source review (pull_request) Failing after 14s
Third-party parts / As their notes say (pull_request) Successful in 23s
PR description / Description follows the template (pull_request_target) Waiting to run
2026-11-15 18:41:00 +00:00
Compare
HumanBean changed title from WIP: revert(vk): the eviction's waits in presents again at any frame rate, as before #771 to revert(vk): the eviction's waits in presents again at any frame rate, as before #771 2026-11-15 18:49:58 +00:00
HumanBean deleted branch revert/evict-seconds 2026-11-15 18:50:08 +00:00
Sign in to join this conversation.
No reviewers
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!873
No description provided.