perf(vk): the VRAM budgets set by the card, not a menu row or a preset; 8 GB cards' mirrors 2 GB #735

Merged
HumanBean merged 1 commit from HumanBean/Longshot:perf/vram-budget-by-card into main 2026-11-15 07:56:55 +00:00
Owner

Type: perf · Risk: medium · Tested on: none (not run) · Needs: Windows or Linux, an 8 GB card (NVIDIA and AMD); a 6 GB card; a 4 GB card; a Steam Deck; a 16 GB card

Why

The VRAM budget setting confuses players and gets in their way. Its steps read like a quality slider, and players on 6 and 8 GB cards report that setting it to 6 GB makes the game run much better. That shows the default is wrong for them, not that the setting is needed: no player should have to find a memory number by trial.

On an 8 GB card the default (Auto (this PC) picks the Balanced (8GB) preset) gave the game's memory copies in VRAM (the mirrors) 1 GB. They fill within minutes, and from then on the GPU reads the game's memory over PCIe, so the frame rate swings with each area visited (#724 measured it on an RTX 3060 Ti). Picking 6 GB in the menu happened to raise the mirrors to 1.5 GB, which is why it helped.

This PR removes the setting. The game chooses both budgets from the card, with the same sizes every card already got by default, except the 8 GB cards' mirrors, which go to 2 GB.

See #724 (the 8 GB mirrors: this PR gives them the same 2 GB, and also removes the setting and the presets' budgets), #637 (memory management under 8 GB, the same code), #130 and #668 (8 GB cards losing the device at the driver's VRAM limit: what not to make worse).

What changed

The Insert menu's VRAM budget row is gone, and the Quality presets no longer set memory budgets. One rule by the card sets the textures' budget (new gpu/vk/texture_budget.h) and one the mirrors' (gpu/vk/mirror_budget.h). Their sizes are the ones each card already started on through Auto (this PC)'s tier, so nothing moves for most players, apart from 2 GB of mirrors on 8 GB cards.

What each dedicated card gets by default, before and after (textures / mirrors):

Card Before (Auto (this PC) at its tier) After
4 GB Minimum: 2.2 GB / 256 MB 2.2 GB / 256 MB
6 GB Low: 3.6 GB / 1536 MB 3.5 GB / 1536 MB
8 GB Balanced: 4.8 GB / 1024 MB 4.67 GB / 2048 MB
10-11 GB the old rule: 70% of what the driver allows, at most 6 GB / 2.5 GB 5.8-6.4 GB / 2 GB
12 GB High: 7.5 GB / 2048 MB 7 GB / 2048 MB
16 GB Ultra: 11 GB / 3072 MB 11 GB / 3072 MB
24 GB the old rule: 6 GB / 3072 MB 11 GB / 3072 MB
Integrated GPU, Steam Deck its share by the system's RAM (2.5 GB with 16 GB), Minimum's 2.2 GB on a heap of 4.5 GB or less; no mirrors the same

Textures: 7/12 of the card's memory, or all of it but 5 GB where that is more, at most 11 GB, at most 2.2 GB on a card of 4.5 GB or less, and at most 75% of what the driver allows (the presets' own clamp, for a card other programs already fill). The rule goes by the card, not the driver's allowance, so it gives the same size on Windows and on a Linux driver that allows nearly the whole card. 65% of the allowance would have given 5.1 GB on such an 8 GB card, the size that once had the driver page VRAM out (an RTX 3060 Ti at 14 fps). On a PC with under 12 GB of RAM and a card over 6.75 GB, it keeps the rule from before (45% of the allowance up to 8.5 GB, at most 6 GB), as it had. The cache still shrinks below its size near the driver's limit (texture_frame's 90% and 97% rules). Mirrors: a quarter of the card, at most 2 GB under 15 GB and 3 GB from there, at most 256 MB on a card of 4.5 GB or less.

  • vk (textures): texture_rule::dedicated_bytes (by the card's memory and the PC's RAM) and integrated_bytes (the integrated GPUs' rule as before) in gpu/vk/texture_budget.h; texture_frame in gpu/vk/vk_texture.cpp takes RX_VK_VRAM_MB or the rule, and the preset path (preset_texture_budget, the 75% clamp) is gone. A vk: texture budget: line logs the size chosen on a dedicated card. device_vram_bytes() is declared in vk_internal.h for it.
  • vk (mirrors): mirror_rule::auto_bytes is the only rule; budget_bytes and preset_caps_memory() are gone; mirror_budget() in vk_memory.cpp reads no options.
  • menu: the row, its tables, vram_budget_sync, sync_preset_budgets and Auto's keeping of a player's budget (apply_auto has no parameter now) are removed from gpu/vk/vk_menu.cpp; Options loses vram_mb, mirror_mb and vram_budget. opts.budget (memory_budget=) stays: it still marks Minimum's settings for the low-VRAM mip trimming (low_vram_texture_mips). save() drops an old file's vram_budget= line, and a file that had the row set under Auto (memory_budget=0) gets Auto's tier back in menu_auto_for_gpu. The Quality preset's help no longer says it sets memory limits, and the Custom hint loses "the VRAM budget row keeps its value"; the weak-laptop button says "smaller textures".
  • translations: gpu/vk/menu_i18n.h drops the row's nine texts and rewords the Quality preset's help and the Custom hint in all 13 tables; the counts follow.
  • docs: the README's options table and Quality preset note, docs/common-issues.md, docs/development.md (RX_VK_VRAM_MB, RX_VK_MIRROR_MB defaults) and gpu/vk/VULKAN.md.
  • tests: test_texture_budget.py/.cpp (the rule's sizes, and that no preset, row or option reaches it) replaces test_preset_texture_budget.py and test_vram_budget_row.py; test_mirror_budget checks the one rule; the menu fixtures (test_framegen_preset, test_rumble_menu, test_upscaler_round_trip, test_menu_keys, test_bug_report_defaults, test_auto_settings, test_menu_sections) lose the removed functions and the row.

Measurements

Verdict: not measured yet: nothing was run, in the game or the checks. The one size that changes on 8 GB cards, 2 GB of mirrors, is #724's measurement on an RTX 3060 Ti (37.1 to 45.3 fps, 1% lows 16.4 to 20.7, Kokiri Forest, Hyrule Field and the Market at 1080p, three interleaved runs each); the other sizes are each card's default before this PR.

Flags and settings

A menu row and an ini key removed; two switches' defaults follow the new rule.

Flag What it is Before this PR After this PR Effect Helps / doesn't help / untested Recommendation
VRAM budget (menu row), vram_budget= (ini) the textures' and mirrors' budget Auto, 3.6-11 GB; a preset set it removed; an old line is dropped at the next save the budgets come from the card alone untested in the game removed
memory_budget= (ini) the preset Custom came from which preset's budgets held only Minimum's mip trimming none on the budgets n/a kept
RX_VK_VRAM_MB the texture budget, for testing over the default (70% of allowed, 45% up to 8.5 GB, at most 6 GB) and over a preset's over the default (by the card: 2.2 GB on 4 GB to 11 GB on 16; texture_budget.h) the default it replaces untested only for testing
RX_VK_MIRROR_MB the mirrors' budget, for testing over the default (a quarter, at most 3 GB, an eighth up to 4.5 GB) and over a preset's over the default (a quarter, at most 2 GB under 15 GB, else 3 GB; at most 256 MB up to 4.5 GB) the default it replaces untested only for testing

Testing

Tested: nothing yet. The change was read through and reviewed, and no build or check was run on this PC.

Not tested: the game on any card; python -I -B tests/run_all.py (left to CI).

Must be tested:

  • An 8 GB card, NVIDIA and AMD (Windows or Linux): Hyrule Field, Kokiri Forest and the Market on main and on this PR, about 2 minutes each, two interleaved runs each. Expect the log's vk: texture budget: line at 4778 MB, the mirrors at 2048 MB, fps and 1% lows at least main's, no device lost or VRAM paging (the GPU time staying near main's) (Test Farm: @Beanstalk on an 8 GB card, main against this PR in Hyrule Field, Kokiri Forest and the Market; or by hand).
  • A 6 GB card and a 4 GB card: the same route; expect about the same budgets as main (3584 MB / 1536 MB and 2200 MB / 256 MB) and the same fps (by hand or the Test Farm).
  • A Steam Deck: the same route; expect the integrated GPU's line as on main (vk: integrated GPU texture budget: 2560 MB with 16 GB of RAM) (Test Farm: @Beanstalk steamdeck, main against this PR in the Market).
  • A 12 or 16 GB card (Windows or Linux): Hyrule Field on main and on this PR, about 2 minutes each, expecting no device lost and fps as on main (Test Farm: @Beanstalk on a 12 or 16 GB card, main against this PR in Hyrule Field).
  • Any PC: open the Insert menu's Graphics tab, and start once with vram_budget=4 added to longshot_options.ini, expecting GPU and memory to show only GPU device and Threaded rendering, the game to start normally, and the vram_budget= line gone after changing any setting (by hand: the menu and the options file).

Risks

What could break: an 8 GB card has 1 GB more of mirrors in VRAM. Where the textures and the rest of the game's VRAM already fill it (#130, #668), that could take it to the driver's limit; the texture cache shrinks first (the 90% and 97% rules), which #724's runs relied on too. Cards Auto put at Minimum for another reason than memory (no mesh shaders: a GTX 1060 6 GB, a GTX 1070, Polaris 8 GB) and Custom players from before Auto had the old rule (45% of the allowance on 8 GB, ~3.3 GB) and now get their card's size (3.5 GB on 6 GB, 4.67 GB on 8 GB). Mirrors are at most 2 GB under 15 GB of VRAM (#724 found 2 GB enough on 8 GB: no pool over PCIe), so cards past their tier's preset, which had a quarter of the card, get less: 10-11 GB cards 2.5-2.75 GB to 2 GB, 13-15 GB cards about 3 GB to 2 GB, and a 12 GB card in a PC with under 12 GB of RAM 3 GB to 2 GB. Players who chose a size on the row lose it: the 6 GB a player chose on an 8 GB card gave about 5.5 GB of textures and 1.5 GB of mirrors, where this gives 4.67 GB and 2 GB. PRs #724, #637 and #622 touch the same code and checks and will conflict.

Turning it off: RX_VK_VRAM_MB=<MB> and RX_VK_MIRROR_MB=<MB> set either budget for a run; otherwise revert the commit.

Compatibility: longshot_options.ini: vram_budget= is ignored and dropped at the next save; memory_budget= is read as before. Saves, the shader and pipeline caches, the vk ABI (vk_api.h untouched) and the builder's tools don't change. The guide's Graphics screenshot (docs/images/guide/) was taken before this change: the rows it pictures don't include GPU and memory, but its Quality preset help may need the source review (the Custom hint changed).

Issues

See #724
See #637
See #130
See #668

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). (Not run on this PC; left to CI.)
  • 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.
  • Numbers from the same PC, scene and settings, at least 2 interleaved runs each, the median reported. (Not measured yet: Must be tested.)
  • 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.
  • Docs updated.
  • Host code builds on both Windows (llvm-mingw) and Linux, with UTF-8 paths. (Not built on this PC: CI builds both.)

🤖 Generated with Claude Code

**Type:** perf · **Risk:** medium · **Tested on:** none (not run) · **Needs:** Windows or Linux, an 8 GB card (NVIDIA and AMD); a 6 GB card; a 4 GB card; a Steam Deck; a 16 GB card ## Why The VRAM budget setting confuses players and gets in their way. Its steps read like a quality slider, and players on 6 and 8 GB cards report that setting it to 6 GB makes the game run much better. That shows the default is wrong for them, not that the setting is needed: no player should have to find a memory number by trial. On an 8 GB card the default (Auto (this PC) picks the Balanced (8GB) preset) gave the game's memory copies in VRAM (the mirrors) 1 GB. They fill within minutes, and from then on the GPU reads the game's memory over PCIe, so the frame rate swings with each area visited (#724 measured it on an RTX 3060 Ti). Picking 6 GB in the menu happened to raise the mirrors to 1.5 GB, which is why it helped. This PR removes the setting. The game chooses both budgets from the card, with the same sizes every card already got by default, except the 8 GB cards' mirrors, which go to 2 GB. See #724 (the 8 GB mirrors: this PR gives them the same 2 GB, and also removes the setting and the presets' budgets), #637 (memory management under 8 GB, the same code), #130 and #668 (8 GB cards losing the device at the driver's VRAM limit: what not to make worse). ## What changed The Insert menu's **VRAM budget** row is gone, and the Quality presets no longer set memory budgets. One rule by the card sets the textures' budget (new `gpu/vk/texture_budget.h`) and one the mirrors' (`gpu/vk/mirror_budget.h`). Their sizes are the ones each card already started on through Auto (this PC)'s tier, so nothing moves for most players, apart from 2 GB of mirrors on 8 GB cards. What each dedicated card gets by default, before and after (textures / mirrors): | Card | Before (Auto (this PC) at its tier) | After | |---|---|---| | 4 GB | Minimum: 2.2 GB / 256 MB | 2.2 GB / 256 MB | | 6 GB | Low: 3.6 GB / 1536 MB | 3.5 GB / 1536 MB | | 8 GB | Balanced: 4.8 GB / **1024 MB** | 4.67 GB / **2048 MB** | | 10-11 GB | the old rule: 70% of what the driver allows, at most 6 GB / 2.5 GB | 5.8-6.4 GB / 2 GB | | 12 GB | High: 7.5 GB / 2048 MB | 7 GB / 2048 MB | | 16 GB | Ultra: 11 GB / 3072 MB | 11 GB / 3072 MB | | 24 GB | the old rule: 6 GB / 3072 MB | 11 GB / 3072 MB | | Integrated GPU, Steam Deck | its share by the system's RAM (2.5 GB with 16 GB), Minimum's 2.2 GB on a heap of 4.5 GB or less; no mirrors | the same | Textures: 7/12 of the card's memory, or all of it but 5 GB where that is more, at most 11 GB, at most 2.2 GB on a card of 4.5 GB or less, and at most 75% of what the driver allows (the presets' own clamp, for a card other programs already fill). The rule goes by the card, not the driver's allowance, so it gives the same size on Windows and on a Linux driver that allows nearly the whole card. 65% of the allowance would have given 5.1 GB on such an 8 GB card, the size that once had the driver page VRAM out (an RTX 3060 Ti at 14 fps). On a PC with under 12 GB of RAM and a card over 6.75 GB, it keeps the rule from before (45% of the allowance up to 8.5 GB, at most 6 GB), as it had. The cache still shrinks below its size near the driver's limit (`texture_frame`'s 90% and 97% rules). Mirrors: a quarter of the card, at most 2 GB under 15 GB and 3 GB from there, at most 256 MB on a card of 4.5 GB or less. - vk (textures): `texture_rule::dedicated_bytes` (by the card's memory and the PC's RAM) and `integrated_bytes` (the integrated GPUs' rule as before) in `gpu/vk/texture_budget.h`; `texture_frame` in `gpu/vk/vk_texture.cpp` takes `RX_VK_VRAM_MB` or the rule, and the preset path (`preset_texture_budget`, the 75% clamp) is gone. A `vk: texture budget:` line logs the size chosen on a dedicated card. `device_vram_bytes()` is declared in `vk_internal.h` for it. - vk (mirrors): `mirror_rule::auto_bytes` is the only rule; `budget_bytes` and `preset_caps_memory()` are gone; `mirror_budget()` in `vk_memory.cpp` reads no options. - menu: the row, its tables, `vram_budget_sync`, `sync_preset_budgets` and Auto's keeping of a player's budget (`apply_auto` has no parameter now) are removed from `gpu/vk/vk_menu.cpp`; `Options` loses `vram_mb`, `mirror_mb` and `vram_budget`. `opts.budget` (`memory_budget=`) stays: it still marks Minimum's settings for the low-VRAM mip trimming (`low_vram_texture_mips`). `save()` drops an old file's `vram_budget=` line, and a file that had the row set under Auto (`memory_budget=0`) gets Auto's tier back in `menu_auto_for_gpu`. The Quality preset's help no longer says it sets memory limits, and the Custom hint loses "the VRAM budget row keeps its value"; the weak-laptop button says "smaller textures". - translations: `gpu/vk/menu_i18n.h` drops the row's nine texts and rewords the Quality preset's help and the Custom hint in all 13 tables; the counts follow. - docs: the README's options table and Quality preset note, `docs/common-issues.md`, `docs/development.md` (`RX_VK_VRAM_MB`, `RX_VK_MIRROR_MB` defaults) and `gpu/vk/VULKAN.md`. - tests: `test_texture_budget.py`/`.cpp` (the rule's sizes, and that no preset, row or option reaches it) replaces `test_preset_texture_budget.py` and `test_vram_budget_row.py`; `test_mirror_budget` checks the one rule; the menu fixtures (`test_framegen_preset`, `test_rumble_menu`, `test_upscaler_round_trip`, `test_menu_keys`, `test_bug_report_defaults`, `test_auto_settings`, `test_menu_sections`) lose the removed functions and the row. ## Measurements **Verdict:** not measured yet: nothing was run, in the game or the checks. The one size that changes on 8 GB cards, 2 GB of mirrors, is #724's measurement on an RTX 3060 Ti (37.1 to 45.3 fps, 1% lows 16.4 to 20.7, Kokiri Forest, Hyrule Field and the Market at 1080p, three interleaved runs each); the other sizes are each card's default before this PR. ### Flags and settings A menu row and an ini key removed; two switches' defaults follow the new rule. | Flag | What it is | Before this PR | After this PR | Effect | Helps / doesn't help / untested | Recommendation | |---|---|---|---|---|---|---| | VRAM budget (menu row), `vram_budget=` (ini) | the textures' and mirrors' budget | Auto, 3.6-11 GB; a preset set it | removed; an old line is dropped at the next save | the budgets come from the card alone | untested in the game | removed | | `memory_budget=` (ini) | the preset Custom came from | which preset's budgets held | only Minimum's mip trimming | none on the budgets | n/a | kept | | `RX_VK_VRAM_MB` | the texture budget, for testing | over the default (70% of allowed, 45% up to 8.5 GB, at most 6 GB) and over a preset's | over the default (by the card: 2.2 GB on 4 GB to 11 GB on 16; `texture_budget.h`) | the default it replaces | untested | only for testing | | `RX_VK_MIRROR_MB` | the mirrors' budget, for testing | over the default (a quarter, at most 3 GB, an eighth up to 4.5 GB) and over a preset's | over the default (a quarter, at most 2 GB under 15 GB, else 3 GB; at most 256 MB up to 4.5 GB) | the default it replaces | untested | only for testing | ## Testing **Tested:** nothing yet. The change was read through and reviewed, and no build or check was run on this PC. **Not tested:** the game on any card; `python -I -B tests/run_all.py` (left to CI). **Must be tested:** - An 8 GB card, NVIDIA and AMD (Windows or Linux): Hyrule Field, Kokiri Forest and the Market on main and on this PR, about 2 minutes each, two interleaved runs each. Expect the log's `vk: texture budget:` line at 4778 MB, the mirrors at 2048 MB, fps and 1% lows at least main's, no `device lost` or VRAM paging (the GPU time staying near main's) (Test Farm: @Beanstalk on an 8 GB card, main against this PR in Hyrule Field, Kokiri Forest and the Market; or by hand). - A 6 GB card and a 4 GB card: the same route; expect about the same budgets as main (3584 MB / 1536 MB and 2200 MB / 256 MB) and the same fps (by hand or the Test Farm). - A Steam Deck: the same route; expect the integrated GPU's line as on main (`vk: integrated GPU texture budget: 2560 MB` with 16 GB of RAM) (Test Farm: @Beanstalk steamdeck, main against this PR in the Market). - A 12 or 16 GB card (Windows or Linux): Hyrule Field on main and on this PR, about 2 minutes each, expecting no device lost and fps as on main (Test Farm: @Beanstalk on a 12 or 16 GB card, main against this PR in Hyrule Field). - Any PC: open the Insert menu's Graphics tab, and start once with `vram_budget=4` added to `longshot_options.ini`, expecting GPU and memory to show only GPU device and Threaded rendering, the game to start normally, and the `vram_budget=` line gone after changing any setting (by hand: the menu and the options file). ## Risks **What could break:** an 8 GB card has 1 GB more of mirrors in VRAM. Where the textures and the rest of the game's VRAM already fill it (#130, #668), that could take it to the driver's limit; the texture cache shrinks first (the 90% and 97% rules), which #724's runs relied on too. Cards Auto put at Minimum for another reason than memory (no mesh shaders: a GTX 1060 6 GB, a GTX 1070, Polaris 8 GB) and Custom players from before Auto had the old rule (45% of the allowance on 8 GB, ~3.3 GB) and now get their card's size (3.5 GB on 6 GB, 4.67 GB on 8 GB). Mirrors are at most 2 GB under 15 GB of VRAM (#724 found 2 GB enough on 8 GB: no pool over PCIe), so cards past their tier's preset, which had a quarter of the card, get less: 10-11 GB cards 2.5-2.75 GB to 2 GB, 13-15 GB cards about 3 GB to 2 GB, and a 12 GB card in a PC with under 12 GB of RAM 3 GB to 2 GB. Players who chose a size on the row lose it: the 6 GB a player chose on an 8 GB card gave about 5.5 GB of textures and 1.5 GB of mirrors, where this gives 4.67 GB and 2 GB. PRs #724, #637 and #622 touch the same code and checks and will conflict. **Turning it off:** `RX_VK_VRAM_MB=<MB>` and `RX_VK_MIRROR_MB=<MB>` set either budget for a run; otherwise revert the commit. **Compatibility:** `longshot_options.ini`: `vram_budget=` is ignored and dropped at the next save; `memory_budget=` is read as before. Saves, the shader and pipeline caches, the vk ABI (`vk_api.h` untouched) and the builder's tools don't change. The guide's Graphics screenshot (`docs/images/guide/`) was taken before this change: the rows it pictures don't include GPU and memory, but its Quality preset help may need the source review (the Custom hint changed). ## Issues See #724 See #637 See #130 See #668 ## 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). (Not run on this PC; left to CI.) - [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. - [ ] Numbers from the same PC, scene and settings, at least 2 interleaved runs each, the median reported. (Not measured yet: Must be tested.) - [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] Docs updated. - [ ] Host code builds on both Windows (llvm-mingw) and Linux, with UTF-8 paths. (Not built on this PC: CI builds both.) 🤖 Generated with [Claude Code](https://claude.com/claude-code)
perf(vk): the VRAM budgets set by the card, not a menu row or a preset; 8 GB cards' mirrors 2 GB
Some checks failed
CI / Conventional Commit title (pull_request) Successful in 6s
Guide screenshots / Guide images and local UI source review (pull_request) Failing after 9s
CI / Workflow lint (actionlint) (pull_request) Successful in 10s
Third-party parts / As their notes say (pull_request) Successful in 15s
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
PR description / Description follows the template (pull_request_target) Failing after 4s
beanstalk/approval approved by HumanBean (reviewed)
beanstalk/linux 0/1 pass, 0 running, 0 queued
6f91fae912
The Insert menu's VRAM budget row and the Quality presets' memory budgets are
gone. One rule by the card sets the textures' budget (gpu/vk/texture_budget.h)
and one the mirrors' (gpu/vk/mirror_budget.h), at the sizes each card already
started on through Auto (this PC)'s tier, except 8 GB cards' mirrors: 1024 MB
to 2048 MB, where the pools no longer go over PCIe (#724's measurement).
Integrated GPUs and the Steam Deck keep their budgets. RX_VK_VRAM_MB and
RX_VK_MIRROR_MB still set either for a test; an old vram_budget= line is
dropped at the next save.

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

Description: each Must be tested item now says where, what to expect and who runs it; the build box added, unticked until CI builds it.

Description: each Must be tested item now says where, what to expect and who runs it; the build box added, unticked until CI builds it.
Author
Owner

@Beanstalk

@Beanstalk
Member

Beanstalk test farm

Commit 6f91fae · tier reviewed · approved by HumanBean · dashboard

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

On a Linux tester, compare main and the PR through Kokiri Forest, Hyrule Field and the Market, spending about 15 minutes on game runs. The plan measures frame times, GPU time, VRAM use and load times, and compares pictures after area changes. A crash, device-lost log, substantial frame-time or GPU-time regression, or excessive image difference fails the plan; VRAM use is recorded without a limit because the budget intentionally changes.

  • Where: linux (1 report).
  • area-route: from a new save (settings frame_generation=0), then measure forest for 25 s (after 10 s warm-up), take the picture forest to compare with main, teleport to Hyrule Field, measure field for 25 s (after 10 s warm-up), take the picture field to compare with main, teleport to Market, measure market for 25 s (after 10 s warm-up), take the picture market to compare with main; 1 run on each side.
  • Measured: crashes, frame times, stutters and hitches, GPU time per pass, VRAM use, load times, the game's log.
  • The PR fails if: it crashes; or a picture differs from main by more than 15%; or GPU time a frame is more than 20% above main; or frame time (p99) is more than 20% above main; or forbidden log lines is above 0.
  • Time: about 16 min of game runs per tester (2 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 `6f91fae` · tier **reviewed** · approved by HumanBean · [dashboard](https://beanstalk.magicbean.dev/prs/735) **What will be tested** · AI plan (`gpt-6.1-terra`) On a Linux tester, compare main and the PR through Kokiri Forest, Hyrule Field and the Market, spending about 15 minutes on game runs. The plan measures frame times, GPU time, VRAM use and load times, and compares pictures after area changes. A crash, device-lost log, substantial frame-time or GPU-time regression, or excessive image difference fails the plan; VRAM use is recorded without a limit because the budget intentionally changes. - **Where:** linux (1 report). - **area-route:** from a new save (settings frame_generation=0), then measure forest for 25 s (after 10 s warm-up), take the picture forest to compare with main, teleport to Hyrule Field, measure field for 25 s (after 10 s warm-up), take the picture field to compare with main, teleport to Market, measure market for 25 s (after 10 s warm-up), take the picture market to compare with main; 1 run on each side. - **Measured:** crashes, frame times, stutters and hitches, GPU time per pass, VRAM use, load times, the game's log. - **The PR fails if:** it crashes; or a picture differs from main by more than 15%; or GPU time a frame is more than 20% above main; or frame time (p99) is more than 20% above main; or forbidden log lines is above 0. - **Time:** about 16 min of game runs per tester (2 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 |
HumanBean changed title from WIP: perf(vk): the VRAM budgets set by the card, not a menu row or a preset; 8 GB cards' mirrors 2 GB to perf(vk): the VRAM budgets set by the card, not a menu row or a preset; 8 GB cards' mirrors 2 GB 2026-11-15 07:56:49 +00:00
HumanBean deleted branch perf/vram-budget-by-card 2026-11-15 07:56:55 +00:00
First-time contributor

Test of #735 on an 8 GB card: pass

Hardware: RTX 3060 Ti 8 GB, driver 621.14, i7-12700F, 64 GB, Windows 11. Built the renderer of this PR @ 511e9b03 and of main @ 35465d12 (the commit before it), each run in the same v3.0.0-rc.4 game folder (vk ABI unchanged between them), with no switches in the environment (RX_VK_MIRROR_MB and RX_VK_VRAM_MB unset) and the options file as a player has it (Auto (this PC), which picked Balanced (8GB), vram_budget=3).

What I checked: Kokiri Forest, Hyrule Field and the Market (child), 1920x1080 output and render, frame generation off, no frame cap. Each run: per area 10 s settle, 30 s standing, 30 s turning the camera, a warm-up pass and then a recorded pass, RX_VK_FRAME_LOG frame times. Four runs, interleaved: main, PR, PR, main. Then one start of the PR with vram_budget=4 in longshot_options.ini, and the Insert menu's Graphics tab.

Result:

main @ 35465d12 this PR @ 511e9b03
fps, runs (mean of the 6 segments) 42.1, 50.2 44.2, 49.7
fps, mean of runs 46.1 47.0
1% low, runs 18.0, 27.1 18.5, 25.0
Kokiri / Hyrule Field / Market (fps, mean of runs) 52.9 / 50.5 / 35.1 52.3 / 51.6 / 37.1
vk: texture budget: (no line) 4680 MB
mirrors in use at the end 1018, 1019 MB of 1024 1221, 1233 MB
"bound in guest memory" (GPU reads over PCIe) lines 310, 282 0, 0
host time in GPU resource waits, mean of the log's lines 7.81, 6.00 ms 5.55, 4.21 ms
VRAM max, MB used of allowed 6358/6538, 6982/6452 6450/6495, 6468/6624
VRAM: lines over what the driver allows 0 of 32, 1 of 37 0 of 36, 0 of 40
device lost 0, 0 0, 0
  • fps is at least main's: within the run-to-run spread overall (the first run of each side was the slower one), ahead in the Market. The 1% lows are within the same spread (25.0 against main's 27.1 in the second runs, 18.5 against 18.0 in the first).
  • On main the mirrors fill at 1024 MB and pools stay in system memory (vk: pool 0x102e800000 (52 MB, its mirror 48 MB) stays in system memory: the mirrors have 1014 MB of 1024); with the PR no pool is read over PCIe, and the host waits less on the GPU.
  • The texture budget line reads 4680 MB, not the 4778 in Must be tested: the card reports 8024 MB, and 7/12 of that is 4680 (vk: texture budget: 4680 MB (driver allows 7256 MB, the card has 8024 MB, RAM 65375 MB)).
  • vram_budget=4 in the options file: the game started and loaded a save normally; the Graphics tab's GPU and memory section shows only GPU device and Threaded rendering; the vram_budget= line was gone from longshot_options.ini by the time the menu was open (memory_budget=3 kept). The Quality preset's help no longer mentions memory limits.
Test of #735 on an 8 GB card: pass Hardware: RTX 3060 Ti 8 GB, driver 621.14, i7-12700F, 64 GB, Windows 11. Built the renderer of this PR @ 511e9b03 and of main @ 35465d12 (the commit before it), each run in the same v3.0.0-rc.4 game folder (vk ABI unchanged between them), with no switches in the environment (`RX_VK_MIRROR_MB` and `RX_VK_VRAM_MB` unset) and the options file as a player has it (Auto (this PC), which picked Balanced (8GB), `vram_budget=3`). What I checked: Kokiri Forest, Hyrule Field and the Market (child), 1920x1080 output and render, frame generation off, no frame cap. Each run: per area 10 s settle, 30 s standing, 30 s turning the camera, a warm-up pass and then a recorded pass, `RX_VK_FRAME_LOG` frame times. Four runs, interleaved: main, PR, PR, main. Then one start of the PR with `vram_budget=4` in `longshot_options.ini`, and the Insert menu's Graphics tab. Result: | | main @ 35465d12 | this PR @ 511e9b03 | |---|---|---| | fps, runs (mean of the 6 segments) | 42.1, 50.2 | 44.2, 49.7 | | fps, mean of runs | 46.1 | 47.0 | | 1% low, runs | 18.0, 27.1 | 18.5, 25.0 | | Kokiri / Hyrule Field / Market (fps, mean of runs) | 52.9 / 50.5 / 35.1 | 52.3 / 51.6 / 37.1 | | `vk: texture budget:` | (no line) | 4680 MB | | mirrors in use at the end | 1018, 1019 MB of 1024 | 1221, 1233 MB | | "bound in guest memory" (GPU reads over PCIe) lines | 310, 282 | 0, 0 | | host time in GPU resource waits, mean of the log's lines | 7.81, 6.00 ms | 5.55, 4.21 ms | | VRAM max, MB used of allowed | 6358/6538, 6982/6452 | 6450/6495, 6468/6624 | | `VRAM:` lines over what the driver allows | 0 of 32, 1 of 37 | 0 of 36, 0 of 40 | | device lost | 0, 0 | 0, 0 | - fps is at least main's: within the run-to-run spread overall (the first run of each side was the slower one), ahead in the Market. The 1% lows are within the same spread (25.0 against main's 27.1 in the second runs, 18.5 against 18.0 in the first). - On main the mirrors fill at 1024 MB and pools stay in system memory (`vk: pool 0x102e800000 (52 MB, its mirror 48 MB) stays in system memory: the mirrors have 1014 MB of 1024`); with the PR no pool is read over PCIe, and the host waits less on the GPU. - The texture budget line reads 4680 MB, not the 4778 in Must be tested: the card reports 8024 MB, and 7/12 of that is 4680 (`vk: texture budget: 4680 MB (driver allows 7256 MB, the card has 8024 MB, RAM 65375 MB)`). - `vram_budget=4` in the options file: the game started and loaded a save normally; the Graphics tab's GPU and memory section shows only GPU device and Threaded rendering; the `vram_budget=` line was gone from `longshot_options.ini` by the time the menu was open (`memory_budget=3` kept). The Quality preset's help no longer mentions memory limits.
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!735
No description provided.