fix(vk): raise the integrated GPU texture budget when ASTC is decoded on the CPU #1559

Open
Jer9 wants to merge 3 commits from Jer9/Longshot:fix/igpu-cpu-astc-texture-budget into main
First-time contributor

Type: fix · Risk: low · Tested on: Windows 11, AMD Ryzen AI 7 350 / Radeon 860M (2x2 interleaved A/B + windowed startup + game-free C++/Python checks) · Needs: Windows Ryzen 7000/9000 desktop iGPU (> 16 GB RAM); any iGPU with 24 GB RAM; Linux full suite

TL;DR

On integrated graphics with over 16 GB of memory, decoding ASTC textures on the CPU stores them uncompressed at roughly four times the size, overflowing the default 4,096 MB texture budget in Kokiri Forest and forcing continuous evictions and slow CPU re-decodes. When CPU ASTC decoding is active above 16 GB of RAM, this change raises the texture share cap to 8,192 MB and the RAM cap to 6,144 MB (up to 24 GB) or 8,192 MB (above 24 GB). On a 32 GB Radeon 860M laptop, budget evictions drop from 3,060 to 0, upload stalls fall 33%, Kokiri initial FPS rises 44%, and revisit FPS rises 91%; tests fail on main and pass here.

Breakdown

  • Who it helps: players on integrated GPUs with more than 16 GB of RAM when ASTC textures are decoded on the CPU (default on Windows Radeon 860M and Ryzen 7000/9000 desktop graphics, or RX_VK_ASTC_CPU=1).
  • What was wrong: CPU-decoded RGBA8 textures take ~5.0–7.1 GB across Kokiri Forest and Zora's Domain, but the integrated GPU texture budget stayed capped at 4,096 MB on 32 GB PCs (3,584 MB on 24 GB), causing constant eviction thrashing and multi-second CPU re-decode stalls.
  • What changes: when ASTC is decoded on the CPU, the integrated allowance share cap rises from 6,144 MB to 8,192 MB and the RAM cap above 16 GB rises to 6,144 MB (up to 24 GB) or 8,192 MB (above 24 GB), keeping the 8/12/16 GB RAM caps and available-RAM clamps unchanged.
  • What does not change: discrete GPUs, integrated GPUs using the GPU ASTC decoder (astc_on_cpu=0), systems with 16 GB RAM or less, explicit RX_VK_VRAM_MB overrides, saves, and options files.
  • How it was checked: 2x2 interleaved compiled-binary A/B on origin/main (ef6038ab) vs 8dd2987 (0 vs 3,060 median budget evictions, +43.9% Kokiri initial FPS, +91.4% Kokiri revisit FPS), normal windowed startup log check (8192 MB), test_texture_budget.py & test_device_policy.py (g++ and clang++ + mutant checks), and tests/run_all.py.
  • What is still open: physical hardware runs on Ryzen 7000/9000 desktop iGPUs (> 16 GB RAM), a 24 GB RAM iGPU, and native Linux tests/run_all.py via Test Farm.
  • Risk: low; systems at or below 16 GB RAM and GPU-decoded iGPUs stay on existing limits, RX_VK_VRAM_MB=4096 or RX_VK_ASTC_CPU=0 restores the old cap, and the 90% driver count line and Windows commit headroom guard remain active.

Why

PR #489 enabled CPU ASTC decoding (astc_on_cpu=1) on Windows for Ryzen 7000 (0x164E) and Ryzen 9000 (0x13C0) desktop iGPUs, and PR #1296 extended that default to the AMD Radeon 860M (0x1114) for Part 1 of #1040, eliminating Kokiri Forest VK_ERROR_DEVICE_LOST resets. However, CPU ASTC decoding stores textures as uncompressed RGBA8 (~4x the memory of BC3), pushing Kokiri Forest's texture working set to ~5.0–5.7 GB and Kokiri + Zora's Domain to ~7.0–7.1 GB.

On a 32 GB laptop with 6 GB Variable Graphics Memory (26,283 MB Windows-usable RAM, 12,214 MB driver allowance), texture_rule::integrated_bytes() capped the allowance share at 6,144 MB and policy_rule::integrated_texture_budget() further capped RAM <= 32 GB at 4,096 MB. As a result, once Kokiri Forest loaded, the renderer continuously evicted hundreds of textures per burst and immediately re-decoded them on the CPU (14+ s max single-frame stalls, ~75 s total upload stalls across a Kokiri + Zora + Kokiri run). Raising the cap only when astc_on_cpu is active and ram > 16 GB resolves Part 2 of #1040 without tightening memory safety on 8–16 GB handhelds/laptops or changing GPU-decoded iGPUs.

prior work: none found (integrated_texture_budget, "texture budget" "astc_on_cpu", #1040)

See #1040

How to reproduce

Seen on: Windows 11 (build 26200), AMD Ryzen AI 7 350 / Radeon 860M (1002:1114, Adrenalin 26.10.1 LLPC), 32 GB RAM (26,283 MB usable with 6 GB Variable Graphics Memory, 12,214 MB driver-allowed video memory)
Settings and switches: defaults (quality_preset=6 Auto, RX_VK_VRAM_MB unset, RX_VK_ASTC_CPU unset -> astc_on_cpu=1 default)
Steps:

  1. Launch with no longshot_env.txt (vk: switches set: none in play).
  2. Load kokiri-start, teleport to KokiriForest_Child (0), then ZoraDomain_Child (13), then return to KokiriForest_Child (0).
    Expected: Kokiri Forest and Zora's Domain textures remain cached within an 8,192 MB budget with zero budget evictions and no re-decode thrashing.
    Actual: vk: integrated GPU texture budget: 4096 MB logs at startup, Kokiri Forest overflows 4,096 MB to ~5.3 GB, and the renderer evicts ~3,060 textures across 20 budget-eviction events, causing ~75.4 s of CPU ASTC upload stalls and halving Kokiri revisit FPS (18.39 vs 35.20 fps).

What changed

Thread astc_on_cpu from DevicePolicy and vk_texture.cpp's astc_on_cpu() into both texture_rule::integrated_bytes() and policy_rule::integrated_texture_budget(), raising the integrated share cap from 6 GB to 8 GB and the > 16 GB RAM caps to 6 GB (<= 24 GB) and 8 GB (> 24 GB) when ASTC is decoded on the CPU, while recomputing p.texture_budget after reading RX_VK_ASTC_CPU in device_policy_env().

  • gpu/vk/texture_budget.h: added bool astc_on_cpu = false to texture_rule::integrated_bytes(uint64_t allowed, uint64_t vram, bool astc_on_cpu = false), raising the 70% allowance share cap from 6144 * kMB to 8192 * kMB when astc_on_cpu is true (keeping the 2200 * kMB small-heap cap and 4096 * kMB unknown-allowance fallback unchanged).
  • gpu/vk/device_policy.h: added bool astc_on_cpu = false to policy_rule::integrated_texture_budget() and policy_rule::texture_budget(), raising cap when astc_on_cpu && ram > 16 * kGB to 6144 * kMB (<= 24 * kGB) and 8192 * kMB (> 24 * kGB) while preserving available = ram - integrated_reserved(ram) and share clamps; passed p.astc_on_cpu in device_policy() and recomputed p.texture_budget after flag(Sw::astc_on_cpu, "RX_VK_ASTC_CPU", p.astc_on_cpu) in device_policy_env().
  • gpu/vk/vk_texture.cpp: passed astc_on_cpu() to texture_rule::integrated_bytes(a, device_vram_bytes(), astc_on_cpu()) and policy_rule::integrated_texture_budget(driver_budget, system_ram, astc_on_cpu()) in texture_frame(), and updated the nearby comments on astc_on_cpu() and integrated_texture_budget.
  • docs/development.md: updated the RX_VK_VRAM_MB default description for the raised integrated share/RAM caps when ASTC is decoded on the CPU.
  • tests/test_texture_budget.cpp & tests/test_device_policy.py: added unit/edge/env/source checks (12214 MB share with false/true, RAPHAEL 7162 MB default and RX_VK_ASTC_CPU=0 -> 4096 MB, UHD RX_VK_ASTC_CPU=1 staying 2560 MB, and 16384 / 24576 / 26283 MB RAM rules), failing on origin/main (ef6038ab) and passing after the fix.
  • docs/tested/: added 2026-11-18-igpu-cpu-astc-texture-budget-jer9-old.md and 2026-11-18-igpu-cpu-astc-texture-budget-jer9-new.md.

Measurements

Verdict: Fixed Part 2 of #1040 on the 32 GB Radeon 860M laptop with zero environment switches set: texture budget rose from 4,096 MB to 8,192 MB, budget evictions dropped from 3,060 (median across 20 events) to 0, full-run CPU ASTC upload stalls fell by -33.1% (75,442 -> 50,457 ms), KokiriForest_Child initial 360-present wall FPS rose +43.9% (14.71 -> 21.18 fps), and KokiriForest_Child revisit FPS after ZoraDomain_Child rose +91.4% (18.39 -> 35.20 fps); settled stationary ZoraDomain_Child FPS measured 33.77 -> 31.77 fps (-5.9%) with 7.0 GB kept resident instead of 3.9 GB.

Hardware: Windows 11 (build 26200), AMD Radeon(TM) 860M Graphics (integrated, 1002:1114, 8 CUs, RDNA 3.5, 12857 MB VRAM heap, 12214 MB allowed), AMD proprietary driver 26.10.1 (LLPC), AMD Ryzen AI 7 350 (8c/16t, znver5), 32 GB RAM (26,283 MB usable, 6 GB Variable Graphics Memory)
Scene: KokiriForest_Child (initial 360 presents + revisit 360 presents after ZoraDomain_Child) and ZoraDomain_Child (settled 360 presents after 180-present warm-up); 2560x1440 output, quality_preset=6 Auto (resolution=4 50%, handheld_profile=0, upscaling=0, frame_generation=0, threaded_rendering=0), RX_VK_VRAM_MB unset, RX_VK_ASTC_CPU unset (astc_on_cpu=1)
Method: Built origin/main (ef6038ab) base and renderer pack igpu-tex-budget (8dd2987, identical renderer tree to measured 9858994) with scripts/dev_packs.py (seeded from nightly, warmed on both runtimes), then ran 2x2 interleaved runs (0_old, 1_new, 2_old, 3_new) via scripts/longshot_ctl.py --profile test --repo-save kokiri-start plus one normal windowed launch (windowed_new), taking the median of each pair.
How to reproduce: python -I scripts/longshot_ctl.py --run <dir> launch <RUNTIME> --profile test --repo-save kokiri-start --repo . (press A until state=play, wait present --frames 60), teleport 0 --timeout 60 --arrive 120, wait in_play, wait present --frames 360, teleport 13 --timeout 60 --arrive 120, wait in_play, wait present --frames 180, wait present --frames 360, teleport 0 --timeout 60 --arrive 120, wait in_play, wait present --frames 360.

Before: main @ ef6038ab After: this PR @ 8dd2987 Δ
Integrated GPU texture budget 4096 MB 8192 MB +4096 MB (2x)
Full-run budget evictions (2 runs -> median) 2992, 3128 (3060 across 20 events) 0, 0 (0) -100%
Full-run upload stalls (2 runs -> median) 74,023, 76,860 ms (75,442 ms) 50,004, 50,910 ms (50,457 ms) -33.1% (-24,985 ms)
Peak textures held (0_old/2_old vs 1_new/3_new) 4064, 4638 MB 7037, 7130 MB Fits working set
KokiriForest_Child initial 360p wall FPS 15.23, 14.20 (14.71 fps) 20.71, 21.65 (21.18 fps) +43.9%
KokiriForest_Child revisit 360p wall FPS 18.22, 18.56 (18.39 fps) 35.69, 34.72 (35.20 fps) +91.4%
ZoraDomain_Child settled 360p wall FPS 33.89, 33.65 (33.77 fps) 30.90, 32.63 (31.77 fps) -5.9%

Redacted log lines (0_old vs 1_new, HOS_HEADLESS=1, RX_VK_VRAM_MB & RX_VK_ASTC_CPU unset):

0_old (Before: main @ ef6038ab):
[hos MainThread] vk: switches set (4): HOS_AUDIO=0 (kill), HOS_CONTROL=longshot-control-... (diag), HOS_ENV_FILE=<a path> (diag), HOS_HEADLESS=1 (diag)
[hos MainThread] vk: policy: sizes by the allowance at the start (the sites read it later): textures 4096 MB, ...
[hos Presentation Thread] vk: integrated GPU texture budget: 4096 MB (system RAM 25 GB, driver allows 12214 MB, its share for textures 6144 MB, reserved 8 GB)
[hos Presentation Thread] vk: 335 textures retired (789 left, 4249 MB): budget 332, drawn over 3, dead targets 0; GPU-drawn with no copy kept: 0 live, 7 finalized, 20 MB
[hos Presentation Thread] vk: 500 textures retired (722 left, 4063 MB): budget 499, drawn over 1, dead targets 0; GPU-drawn with no copy kept: 0 live, 2 finalized, 0 MB
[hos Presentation Thread] vk: 271 textures retired (689 left, 3941 MB): budget 270, drawn over 1, dead targets 0; GPU-drawn with no copy kept: 0 live, 3 finalized, 0 MB

1_new (After: this PR @ 8dd2987):
[hos MainThread] vk: switches set (4): HOS_AUDIO=0 (kill), HOS_CONTROL=longshot-control-... (diag), HOS_ENV_FILE=<a path> (diag), HOS_HEADLESS=1 (diag)
[hos MainThread] vk: policy: sizes by the allowance at the start (the sites read it later): textures 8192 MB, ...
[hos Presentation Thread] vk: integrated GPU texture budget: 8192 MB (system RAM 25 GB, driver allows 12214 MB, its share for textures 8192 MB, reserved 8 GB)
[hos Presentation Thread] vk: VRAM: 5791 MB used of 12214 MB allowed (317 MB of it free in the blocks); textures 5172 MB (budget 8192 MB), 1240 textures
[hos Presentation Thread] vk: VRAM: 7792 MB used of 12214 MB allowed (341 MB of it free in the blocks); textures 7037 MB (budget 8192 MB), 2041 textures

Flags and settings

None

Testing

Tested:

  • Windows 11 (26200), AMD Ryzen AI 7 350 / Radeon 860M (26.10.1 LLPC, 32 GB RAM / 26283 MB usable):
    • Two-commit fix-with-test check: Commit 413e092 compiles and fails at runtime on origin/main (ef6038ab) (FAIL line 48: call_integrated_bytes(12214 * MB, 6 * GB, true) == 8192 * MB in test_texture_budget.py, and RAPHAEL: texture_budget is 4096, expected 7162 / 24576 MB 3584 != 6144 / 26283 MB 4096 != 8192 in test_device_policy.py with both g++ and clang++); Commit 8dd2987 passes python -I -B tests/test_texture_budget.py --cxx g++ & --cxx clang++ (PASS: the texture budget by the card), python -I -B tests/test_device_policy.py --cxx g++ & --cxx clang++ (ok: 19 PCs, each of DevicePolicy's 68 fields as the rules have it; 64 environments through the switches' one rule; 55 rule edges), python -I -B tests/test_astc_cpu_860m.py --cc gcc (ok), and mutant checks (reverting the astc_on_cpu caps in texture_budget.h and device_policy.h fails both tests).
    • Fragment & full suite: python -I -B tests/test_tested_configurations.py Repository (Ran 1 test in 6.188s OK); python -I -B tests/run_all.py (656 passed, 57 failed, 57 skipped in 179 s, where all 57 failures are pre-existing origin/main / Windows host drift).
    • Compiled-binary 2x2 interleaved A/B (scripts/dev_packs.py) across KokiriForest_Child (initial + revisit) and ZoraDomain_Child (0_old, 1_new, 2_old, 3_new) plus normal windowed startup (windowed_new) confirming vk: integrated GPU texture budget: 8192 MB and 0 budget evictions.

Not tested:

  • Physical hardware with Ryzen 7000/9000 desktop iGPUs (0x164E, 0x13C0) or 24 GB RAM integrated-GPU PCs (only 32 GB Radeon 860M hardware is on this PC; RAPHAEL and 16/24/32 GB boundaries are covered by tests/test_device_policy.py).
  • Native Linux compile and full Linux tests/run_all.py (spirv-val, glslang, POSIX tests).

Must be tested:

  • Windows, Ryzen 7000/9000 desktop iGPU (0x164E or 0x13C0, > 16 GB RAM): launch in Kokiri Forest with RX_VK_VRAM_MB and RX_VK_ASTC_CPU unset, expecting astc_on_cpu=1, the startup texture budget log line above 4096 MB (up to 8192 MB), and no budget eviction thrashing (by hand on a Ryzen 7000/9000 desktop iGPU)
  • Linux, any GPU: run python -I -B tests/run_all.py, expecting test_texture_budget.py, test_device_policy.py, and test_tested_configurations.py to pass cleanly (Test Farm: @Beanstalk linux)

Risks

What could break: Raising the integrated GPU texture budget up to 6144 MB (at 24 GB RAM) or 8192 MB (above 24 GB RAM) when astc_on_cpu is enabled keeps more system RAM pinned in VMA texture allocations if another memory-heavy application runs concurrently or if RX_VK_COMMIT_RESERVE_MB is disabled. The existing 90% driver-allowance count line (count_line_pct = 90), available = ram - integrated_reserved(ram) clamp, Windows commit headroom guard (RX_VK_COMMIT_RESERVE_MB), and Linux PressureHold still trim the budget if system memory tightens; iGPUs with <= 16 GB RAM and GPU-decoded iGPUs (astc_on_cpu = false) are unchanged.

Turning it off: Set RX_VK_VRAM_MB=4096 (or RX_VK_ASTC_CPU=0 where the GPU ASTC decoder is stable) in longshot_env.txt, or revert commit 8dd2987.

Compatibility: Nothing changes for saves, longshot_options.ini, shader translation stamps (device_policy.h, texture_budget.h, and vk_texture.cpp are not in translator_files), pipeline caches, or MKWVK_API_VERSION.

Issues

See #1040

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).
  • Tested on my own PC where it runs (in the game, for a change the game runs), as Testing's Tested says; what
    can't be run by hand is in Testing's Not testable by hand, with why.
  • Measurements has a verdict, or one line saying why there is nothing to measure.
  • Nothing gets worse that I know of: any cost (speed, latency, memory, a setup that worked before) is measured and
    in Risks.
  • 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.
  • Numbers from the same PC, scene and settings, at least 2 interleaved runs each, the median reported.
  • A file in docs/tested/ for each new measured run (format in docs/tested-configurations.md).
  • A game-free test added for the fix, failing on main and passing here.
  • A check under tests/ that reads changed source updated in this PR, not weakened.
  • Docs updated.
**Type:** fix · **Risk:** low · **Tested on:** Windows 11, AMD Ryzen AI 7 350 / Radeon 860M (2x2 interleaved A/B + windowed startup + game-free C++/Python checks) · **Needs:** Windows Ryzen 7000/9000 desktop iGPU (> 16 GB RAM); any iGPU with 24 GB RAM; Linux full suite ## TL;DR On integrated graphics with over 16 GB of memory, decoding ASTC textures on the CPU stores them uncompressed at roughly four times the size, overflowing the default 4,096 MB texture budget in Kokiri Forest and forcing continuous evictions and slow CPU re-decodes. When CPU ASTC decoding is active above 16 GB of RAM, this change raises the texture share cap to 8,192 MB and the RAM cap to 6,144 MB (up to 24 GB) or 8,192 MB (above 24 GB). On a 32 GB Radeon 860M laptop, budget evictions drop from 3,060 to 0, upload stalls fall 33%, Kokiri initial FPS rises 44%, and revisit FPS rises 91%; tests fail on main and pass here. ## Breakdown - **Who it helps:** players on integrated GPUs with more than 16 GB of RAM when ASTC textures are decoded on the CPU (default on Windows Radeon 860M and Ryzen 7000/9000 desktop graphics, or `RX_VK_ASTC_CPU=1`). - **What was wrong:** CPU-decoded RGBA8 textures take ~5.0–7.1 GB across Kokiri Forest and Zora's Domain, but the integrated GPU texture budget stayed capped at 4,096 MB on 32 GB PCs (`3,584 MB` on 24 GB), causing constant eviction thrashing and multi-second CPU re-decode stalls. - **What changes:** when ASTC is decoded on the CPU, the integrated allowance share cap rises from 6,144 MB to 8,192 MB and the RAM cap above 16 GB rises to 6,144 MB (up to 24 GB) or 8,192 MB (above 24 GB), keeping the 8/12/16 GB RAM caps and available-RAM clamps unchanged. - **What does not change:** discrete GPUs, integrated GPUs using the GPU ASTC decoder (`astc_on_cpu=0`), systems with 16 GB RAM or less, explicit `RX_VK_VRAM_MB` overrides, saves, and options files. - **How it was checked:** 2x2 interleaved compiled-binary A/B on `origin/main` (`ef6038ab`) vs `8dd2987` (`0` vs `3,060` median budget evictions, `+43.9%` Kokiri initial FPS, `+91.4%` Kokiri revisit FPS), normal windowed startup log check (`8192 MB`), `test_texture_budget.py` & `test_device_policy.py` (`g++` and `clang++` + mutant checks), and `tests/run_all.py`. - **What is still open:** physical hardware runs on Ryzen 7000/9000 desktop iGPUs (> 16 GB RAM), a 24 GB RAM iGPU, and native Linux `tests/run_all.py` via Test Farm. - **Risk:** low; systems at or below 16 GB RAM and GPU-decoded iGPUs stay on existing limits, `RX_VK_VRAM_MB=4096` or `RX_VK_ASTC_CPU=0` restores the old cap, and the 90% driver count line and Windows commit headroom guard remain active. ## Why PR #489 enabled CPU ASTC decoding (`astc_on_cpu=1`) on Windows for Ryzen 7000 (`0x164E`) and Ryzen 9000 (`0x13C0`) desktop iGPUs, and PR #1296 extended that default to the AMD Radeon 860M (`0x1114`) for Part 1 of #1040, eliminating Kokiri Forest `VK_ERROR_DEVICE_LOST` resets. However, CPU ASTC decoding stores textures as uncompressed RGBA8 (~4x the memory of BC3), pushing Kokiri Forest's texture working set to ~5.0–5.7 GB and Kokiri + Zora's Domain to ~7.0–7.1 GB. On a 32 GB laptop with 6 GB Variable Graphics Memory (`26,283 MB` Windows-usable RAM, `12,214 MB` driver allowance), `texture_rule::integrated_bytes()` capped the allowance share at `6,144 MB` and `policy_rule::integrated_texture_budget()` further capped RAM `<= 32 GB` at `4,096 MB`. As a result, once Kokiri Forest loaded, the renderer continuously evicted hundreds of textures per burst and immediately re-decoded them on the CPU (`14+ s` max single-frame stalls, ~75 s total upload stalls across a Kokiri + Zora + Kokiri run). Raising the cap only when `astc_on_cpu` is active and `ram > 16 GB` resolves Part 2 of #1040 without tightening memory safety on 8–16 GB handhelds/laptops or changing GPU-decoded iGPUs. prior work: none found (`integrated_texture_budget`, `"texture budget" "astc_on_cpu"`, #1040) See #1040 ## How to reproduce **Seen on:** Windows 11 (build 26200), AMD Ryzen AI 7 350 / Radeon 860M (1002:1114, Adrenalin 26.10.1 LLPC), 32 GB RAM (`26,283 MB` usable with 6 GB Variable Graphics Memory, `12,214 MB` driver-allowed video memory) **Settings and switches:** defaults (`quality_preset=6` Auto, `RX_VK_VRAM_MB` unset, `RX_VK_ASTC_CPU` unset -> `astc_on_cpu=1` default) **Steps:** 1. Launch with no `longshot_env.txt` (`vk: switches set: none` in play). 2. Load `kokiri-start`, teleport to `KokiriForest_Child` (`0`), then `ZoraDomain_Child` (`13`), then return to `KokiriForest_Child` (`0`). **Expected:** Kokiri Forest and Zora's Domain textures remain cached within an `8,192 MB` budget with zero budget evictions and no re-decode thrashing. **Actual:** `vk: integrated GPU texture budget: 4096 MB` logs at startup, Kokiri Forest overflows `4,096 MB` to `~5.3 GB`, and the renderer evicts ~3,060 textures across 20 budget-eviction events, causing ~75.4 s of CPU ASTC upload stalls and halving Kokiri revisit FPS (`18.39` vs `35.20 fps`). ## What changed Thread `astc_on_cpu` from `DevicePolicy` and `vk_texture.cpp`'s `astc_on_cpu()` into both `texture_rule::integrated_bytes()` and `policy_rule::integrated_texture_budget()`, raising the integrated share cap from 6 GB to 8 GB and the `> 16 GB` RAM caps to 6 GB (`<= 24 GB`) and 8 GB (`> 24 GB`) when ASTC is decoded on the CPU, while recomputing `p.texture_budget` after reading `RX_VK_ASTC_CPU` in `device_policy_env()`. - `gpu/vk/texture_budget.h`: added `bool astc_on_cpu = false` to `texture_rule::integrated_bytes(uint64_t allowed, uint64_t vram, bool astc_on_cpu = false)`, raising the 70% allowance share cap from `6144 * kMB` to `8192 * kMB` when `astc_on_cpu` is true (keeping the `2200 * kMB` small-heap cap and `4096 * kMB` unknown-allowance fallback unchanged). - `gpu/vk/device_policy.h`: added `bool astc_on_cpu = false` to `policy_rule::integrated_texture_budget()` and `policy_rule::texture_budget()`, raising `cap` when `astc_on_cpu && ram > 16 * kGB` to `6144 * kMB` (`<= 24 * kGB`) and `8192 * kMB` (`> 24 * kGB`) while preserving `available = ram - integrated_reserved(ram)` and `share` clamps; passed `p.astc_on_cpu` in `device_policy()` and recomputed `p.texture_budget` after `flag(Sw::astc_on_cpu, "RX_VK_ASTC_CPU", p.astc_on_cpu)` in `device_policy_env()`. - `gpu/vk/vk_texture.cpp`: passed `astc_on_cpu()` to `texture_rule::integrated_bytes(a, device_vram_bytes(), astc_on_cpu())` and `policy_rule::integrated_texture_budget(driver_budget, system_ram, astc_on_cpu())` in `texture_frame()`, and updated the nearby comments on `astc_on_cpu()` and `integrated_texture_budget`. - `docs/development.md`: updated the `RX_VK_VRAM_MB` default description for the raised integrated share/RAM caps when ASTC is decoded on the CPU. - `tests/test_texture_budget.cpp` & `tests/test_device_policy.py`: added unit/edge/env/source checks (`12214 MB` share with `false`/`true`, `RAPHAEL` `7162 MB` default and `RX_VK_ASTC_CPU=0` -> `4096 MB`, `UHD` `RX_VK_ASTC_CPU=1` staying `2560 MB`, and `16384` / `24576` / `26283 MB` RAM rules), failing on `origin/main` (`ef6038ab`) and passing after the fix. - `docs/tested/`: added `2026-11-18-igpu-cpu-astc-texture-budget-jer9-old.md` and `2026-11-18-igpu-cpu-astc-texture-budget-jer9-new.md`. ## Measurements **Verdict:** Fixed Part 2 of #1040 on the 32 GB Radeon 860M laptop with zero environment switches set: texture budget rose from `4,096 MB` to `8,192 MB`, budget evictions dropped from `3,060` (median across 20 events) to **`0`**, full-run CPU ASTC upload stalls fell by **-33.1%** (`75,442 -> 50,457 ms`), `KokiriForest_Child` initial 360-present wall FPS rose **+43.9%** (`14.71 -> 21.18 fps`), and `KokiriForest_Child` revisit FPS after `ZoraDomain_Child` rose **+91.4%** (`18.39 -> 35.20 fps`); settled stationary `ZoraDomain_Child` FPS measured `33.77 -> 31.77 fps` (**-5.9%**) with `7.0 GB` kept resident instead of `3.9 GB`. Hardware: Windows 11 (build 26200), AMD Radeon(TM) 860M Graphics (integrated, 1002:1114, 8 CUs, RDNA 3.5, 12857 MB VRAM heap, 12214 MB allowed), AMD proprietary driver 26.10.1 (LLPC), AMD Ryzen AI 7 350 (8c/16t, znver5), 32 GB RAM (`26,283 MB` usable, 6 GB Variable Graphics Memory) Scene: `KokiriForest_Child` (initial 360 presents + revisit 360 presents after `ZoraDomain_Child`) and `ZoraDomain_Child` (settled 360 presents after 180-present warm-up); `2560x1440` output, `quality_preset=6` Auto (`resolution=4` 50%, `handheld_profile=0`, `upscaling=0`, `frame_generation=0`, `threaded_rendering=0`), `RX_VK_VRAM_MB` unset, `RX_VK_ASTC_CPU` unset (`astc_on_cpu=1`) Method: Built `origin/main` (`ef6038ab`) base and renderer pack `igpu-tex-budget` (`8dd2987`, identical renderer tree to measured `9858994`) with `scripts/dev_packs.py` (seeded from `nightly`, warmed on both runtimes), then ran 2x2 interleaved runs (`0_old`, `1_new`, `2_old`, `3_new`) via `scripts/longshot_ctl.py --profile test --repo-save kokiri-start` plus one normal windowed launch (`windowed_new`), taking the median of each pair. How to reproduce: `python -I scripts/longshot_ctl.py --run <dir> launch <RUNTIME> --profile test --repo-save kokiri-start --repo .` (press `A` until `state=play`, `wait present --frames 60`), `teleport 0 --timeout 60 --arrive 120`, `wait in_play`, `wait present --frames 360`, `teleport 13 --timeout 60 --arrive 120`, `wait in_play`, `wait present --frames 180`, `wait present --frames 360`, `teleport 0 --timeout 60 --arrive 120`, `wait in_play`, `wait present --frames 360`. | | Before: main @ ef6038ab | After: this PR @ 8dd2987 | Δ | |---|---|---|---| | Integrated GPU texture budget | `4096 MB` | `8192 MB` | **+4096 MB** (2x) | | Full-run budget evictions (2 runs -> median) | `2992`, `3128` (`3060` across `20` events) | `0`, `0` (**`0`**) | **-100%** | | Full-run upload stalls (2 runs -> median) | `74,023`, `76,860 ms` (`75,442 ms`) | `50,004`, `50,910 ms` (`50,457 ms`) | **-33.1%** (-24,985 ms) | | Peak textures held (`0_old`/`2_old` vs `1_new`/`3_new`) | `4064`, `4638 MB` | `7037`, `7130 MB` | Fits working set | | `KokiriForest_Child` initial 360p wall FPS | `15.23`, `14.20` (`14.71 fps`) | `20.71`, `21.65` (`21.18 fps`) | **+43.9%** | | `KokiriForest_Child` revisit 360p wall FPS | `18.22`, `18.56` (`18.39 fps`) | `35.69`, `34.72` (`35.20 fps`) | **+91.4%** | | `ZoraDomain_Child` settled 360p wall FPS | `33.89`, `33.65` (`33.77 fps`) | `30.90`, `32.63` (`31.77 fps`) | -5.9% | Redacted log lines (`0_old` vs `1_new`, `HOS_HEADLESS=1`, `RX_VK_VRAM_MB` & `RX_VK_ASTC_CPU` unset): ```text 0_old (Before: main @ ef6038ab): [hos MainThread] vk: switches set (4): HOS_AUDIO=0 (kill), HOS_CONTROL=longshot-control-... (diag), HOS_ENV_FILE=<a path> (diag), HOS_HEADLESS=1 (diag) [hos MainThread] vk: policy: sizes by the allowance at the start (the sites read it later): textures 4096 MB, ... [hos Presentation Thread] vk: integrated GPU texture budget: 4096 MB (system RAM 25 GB, driver allows 12214 MB, its share for textures 6144 MB, reserved 8 GB) [hos Presentation Thread] vk: 335 textures retired (789 left, 4249 MB): budget 332, drawn over 3, dead targets 0; GPU-drawn with no copy kept: 0 live, 7 finalized, 20 MB [hos Presentation Thread] vk: 500 textures retired (722 left, 4063 MB): budget 499, drawn over 1, dead targets 0; GPU-drawn with no copy kept: 0 live, 2 finalized, 0 MB [hos Presentation Thread] vk: 271 textures retired (689 left, 3941 MB): budget 270, drawn over 1, dead targets 0; GPU-drawn with no copy kept: 0 live, 3 finalized, 0 MB 1_new (After: this PR @ 8dd2987): [hos MainThread] vk: switches set (4): HOS_AUDIO=0 (kill), HOS_CONTROL=longshot-control-... (diag), HOS_ENV_FILE=<a path> (diag), HOS_HEADLESS=1 (diag) [hos MainThread] vk: policy: sizes by the allowance at the start (the sites read it later): textures 8192 MB, ... [hos Presentation Thread] vk: integrated GPU texture budget: 8192 MB (system RAM 25 GB, driver allows 12214 MB, its share for textures 8192 MB, reserved 8 GB) [hos Presentation Thread] vk: VRAM: 5791 MB used of 12214 MB allowed (317 MB of it free in the blocks); textures 5172 MB (budget 8192 MB), 1240 textures [hos Presentation Thread] vk: VRAM: 7792 MB used of 12214 MB allowed (341 MB of it free in the blocks); textures 7037 MB (budget 8192 MB), 2041 textures ``` ### Flags and settings None ## Testing **Tested:** - Windows 11 (26200), AMD Ryzen AI 7 350 / Radeon 860M (26.10.1 LLPC, 32 GB RAM / 26283 MB usable): - Two-commit `fix-with-test` check: Commit `413e092` compiles and fails at runtime on `origin/main` (`ef6038ab`) (`FAIL line 48: call_integrated_bytes(12214 * MB, 6 * GB, true) == 8192 * MB` in `test_texture_budget.py`, and `RAPHAEL: texture_budget is 4096, expected 7162` / `24576 MB` `3584 != 6144` / `26283 MB` `4096 != 8192` in `test_device_policy.py` with both `g++` and `clang++`); Commit `8dd2987` passes `python -I -B tests/test_texture_budget.py --cxx g++` & `--cxx clang++` (`PASS: the texture budget by the card`), `python -I -B tests/test_device_policy.py --cxx g++` & `--cxx clang++` (`ok: 19 PCs, each of DevicePolicy's 68 fields as the rules have it; 64 environments through the switches' one rule; 55 rule edges`), `python -I -B tests/test_astc_cpu_860m.py --cc gcc` (`ok`), and mutant checks (reverting the `astc_on_cpu` caps in `texture_budget.h` and `device_policy.h` fails both tests). - Fragment & full suite: `python -I -B tests/test_tested_configurations.py Repository` (`Ran 1 test in 6.188s OK`); `python -I -B tests/run_all.py` (`656 passed, 57 failed, 57 skipped in 179 s`, where all 57 failures are pre-existing `origin/main` / Windows host drift). - Compiled-binary 2x2 interleaved A/B (`scripts/dev_packs.py`) across `KokiriForest_Child` (initial + revisit) and `ZoraDomain_Child` (`0_old`, `1_new`, `2_old`, `3_new`) plus normal windowed startup (`windowed_new`) confirming `vk: integrated GPU texture budget: 8192 MB` and `0` budget evictions. **Not tested:** - Physical hardware with Ryzen 7000/9000 desktop iGPUs (`0x164E`, `0x13C0`) or 24 GB RAM integrated-GPU PCs (only 32 GB Radeon 860M hardware is on this PC; `RAPHAEL` and 16/24/32 GB boundaries are covered by `tests/test_device_policy.py`). - Native Linux compile and full Linux `tests/run_all.py` (`spirv-val`, `glslang`, POSIX tests). **Must be tested:** - Windows, Ryzen 7000/9000 desktop iGPU (`0x164E` or `0x13C0`, > 16 GB RAM): launch in Kokiri Forest with `RX_VK_VRAM_MB` and `RX_VK_ASTC_CPU` unset, expecting `astc_on_cpu=1`, the startup texture budget log line above `4096 MB` (up to `8192 MB`), and no budget eviction thrashing (by hand on a Ryzen 7000/9000 desktop iGPU) - Linux, any GPU: run `python -I -B tests/run_all.py`, expecting `test_texture_budget.py`, `test_device_policy.py`, and `test_tested_configurations.py` to pass cleanly (Test Farm: `@Beanstalk linux`) ## Risks **What could break:** Raising the integrated GPU texture budget up to `6144 MB` (at 24 GB RAM) or `8192 MB` (above 24 GB RAM) when `astc_on_cpu` is enabled keeps more system RAM pinned in VMA texture allocations if another memory-heavy application runs concurrently or if `RX_VK_COMMIT_RESERVE_MB` is disabled. The existing `90%` driver-allowance count line (`count_line_pct = 90`), `available = ram - integrated_reserved(ram)` clamp, Windows commit headroom guard (`RX_VK_COMMIT_RESERVE_MB`), and Linux `PressureHold` still trim the budget if system memory tightens; iGPUs with `<= 16 GB` RAM and GPU-decoded iGPUs (`astc_on_cpu = false`) are unchanged. **Turning it off:** Set `RX_VK_VRAM_MB=4096` (or `RX_VK_ASTC_CPU=0` where the GPU ASTC decoder is stable) in `longshot_env.txt`, or revert commit `8dd2987`. **Compatibility:** Nothing changes for saves, `longshot_options.ini`, shader translation stamps (`device_policy.h`, `texture_budget.h`, and `vk_texture.cpp` are not in `translator_files`), pipeline caches, or `MKWVK_API_VERSION`. ## Issues See #1040 ## 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] Tested on my own PC where it runs (in the game, for a change the game runs), as Testing's Tested says; what can't be run by hand is in Testing's Not testable by hand, with why. - [x] Measurements has a verdict, or one line saying why there is nothing to measure. - [x] Nothing gets worse that I know of: any cost (speed, latency, memory, a setup that worked before) is measured and in Risks. - [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] Numbers from the same PC, scene and settings, at least 2 interleaved runs each, the median reported. - [x] A file in `docs/tested/` for each new measured run (format in `docs/tested-configurations.md`). - [x] A game-free test added for the fix, failing on `main` and passing here. - [x] A check under `tests/` that reads changed source updated in this PR, not weakened. - [x] Docs updated.
Assisted-by: Antigravity
Assisted-by: Antigravity
docs(tested): record Radeon 860M CPU ASTC texture budget A/B runs
Some checks are pending
CI / Conventional Commit title (pull_request) Blocked by required conditions
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Blocked by required conditions
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Blocked by required conditions
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Blocked by required conditions
CI / Workflow lint (actionlint) (pull_request) Blocked by required conditions
Guide screenshots / Guide images and local UI source review (pull_request) Blocked by required conditions
Third-party parts / As their notes say (pull_request) Blocked by required conditions
Third-party parts / The same as upstream (pull_request) Blocked by required conditions
Website / Website on Cloudflare (pull_request) Blocked by required conditions
PR description / Description follows the template (pull_request_target) Successful in 4s
Website / Website on Cloudflare (pull_request_target) Has been skipped
beanstalk/approval approved by HumanBean (reviewed)
beanstalk/steamdeck 0/2 pass, 1 running, 2 queued
beanstalk/igpu+ram24gb 0/1 pass, 0 running, 2 queued
beanstalk/igpu+ram-ge25gb 0/1 pass, 0 running, 1 queued
9519ce0fb0
Assisted-by: Antigravity
Author
First-time contributor

Tested in game: Windows 11 (build 26200), AMD Ryzen AI 7 350 w/ Radeon 860M (1002:1114, Adrenalin 26.10.1 LLPC, 32 GB RAM / 26,283 MB usable): 2x2 interleaved A/B in KokiriForest_Child and ZoraDomain_Child with no switches set; integrated GPU texture budget rose from 4096 MB to 8192 MB, budget evictions dropped from 3060 (20 events) to 0, and KokiriForest_Child wall FPS rose from 14.71 to 21.18 fps (+43.9% initial) and 18.39 to 35.20 fps (+91.4% revisit).

Tested in game: Windows 11 (build 26200), AMD Ryzen AI 7 350 w/ Radeon 860M (1002:1114, Adrenalin 26.10.1 LLPC, 32 GB RAM / 26,283 MB usable): 2x2 interleaved A/B in KokiriForest_Child and ZoraDomain_Child with no switches set; integrated GPU texture budget rose from 4096 MB to 8192 MB, budget evictions dropped from 3060 (20 events) to 0, and KokiriForest_Child wall FPS rose from 14.71 to 21.18 fps (+43.9% initial) and 18.39 to 35.20 fps (+91.4% revisit).
Author
First-time contributor

@Beanstalk linux

@Beanstalk linux
Member

@Jer9 only members of BigBeans can start the farm. One of them can approve this request by reacting 👍 to it or to this comment.

@Jer9 only members of `BigBeans` can start the farm. One of them can approve this request by reacting 👍 to it or to this comment.
Owner

@Beanstalk let's test on 2 steam decks and more

@Beanstalk let's test on 2 steam decks and more
Member

Beanstalk test farm

Commit 9519ce0 · tier reviewed · approved by HumanBean · dashboard

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

The plan compares CPU and GPU ASTC decoding during a Kokiri Forest–Zora’s Domain–Kokiri revisit, measuring frame times, memory, load times and visual differences against main. It requests reports from two Steam Decks, plus integrated GPUs with 24 GB and more than 24 GB of RAM; these targets are not currently listed online and will wait for matching testers. Each tester’s game runs take roughly 25 minutes. Crashes, device loss, substantial frame-time or system-memory regressions, and visual differences fail the plan. No tester online now matches steamdeck, igpu+ram24gb, igpu+ram-ge25gb: those targets wait for one.

  • Where: steamdeck (2-3 reports), igpu+ram24gb (24 GB RAM, 1-2 reports), igpu+ram-ge25gb (25 GB RAM or more, 1-2 reports).
  • Matrix: 2 cells, each on main and the PR: RX_VK_ASTC_CPU 0 or 1.
  • texture-revisit: from the repository's save kokiri-start, then teleport to Kokiri Forest, measure kokiri-initial for 20 s (after 5 s warm-up), take the picture kokiri-initial to compare with main, teleport to Zora's Domain, measure zora for 20 s (after 5 s warm-up), take the picture zora to compare with main, measure kokiri-revisit for 20 s (after 5 s warm-up), take the picture kokiri-revisit to compare with main; 1 run on each side for each of 2 cells (2 game starts a run).
  • Measured: crashes, frame times, stutters and hitches, memory and CPU time, VRAM use, load times, the game's log.
  • The PR fails if: it crashes; or a picture differs from main by more than 5%; or peak memory is more than 30% above main; or frame time (p99) is more than 25% above main; or forbidden log lines is above 0.
  • Time: about 25 min of game runs per tester (4 game starts), plus the two builds.

Started at 09:54 UTC.

Estimate: done in about 25 min, from the queue and the testers online now; some jobs can't start yet.

⚠ No tester has a PC for igpu+ram24gb (none seen in 14 days): it waits until one signs in.

Target Reports Crash Frame p99 (ms) vs main VRAM peak (MB) vs main Result
steamdeck 0/2 — — — running
igpu+ram24gb 0/1 — — — queued
igpu+ram-ge25gb · 1: windows+amd+amd-proprietary+igpu AMD Radeon(TM) 860M Graphics, 2.0.416 1/1 1 none — — queued
Scenario · matrix cell Target Frame p99 (ms) vs main Result
texture-revisit · RX_VK_ASTC_CPU=0 steamdeck — —
texture-revisit · RX_VK_ASTC_CPU=0 igpu+ram24gb — —
texture-revisit · RX_VK_ASTC_CPU=0 igpu+ram-ge25gb — not judged
texture-revisit · RX_VK_ASTC_CPU=1 steamdeck — —
texture-revisit · RX_VK_ASTC_CPU=1 igpu+ram24gb — —
texture-revisit · RX_VK_ASTC_CPU=1 igpu+ram-ge25gb — not judged

Measurements · igpu+ram-ge25gb

Verdict: queued on igpu+ram-ge25gb (1/1 report).

Hardware: 1: windows+amd+amd-proprietary+igpu AMD Radeon(TM) 860M Graphics, 2.0.416 AMD Ryzen AI 7 350 w/ Radeon 860M, 26 GB RAM
Scene: texture-revisit, from the repository's save kokiri-start; each cell's settings and switches as the table names them
Method: the Beanstalk test farm: main and this PR built and run on the same PC in one session, game starts alternating (ABBA); texture-revisit: 1 game start a side, kokiri-initial 20 s after 5 s warm-up, zora 20 s after 5 s warm-up, kokiri-revisit 20 s after 5 s warm-up; each number the median of the runs, then of 1 report
How to reproduce: the farm's plan above (@Beanstalk on this PR runs it again)

Nothing was measured: no metric came back.

Flags and settings

Flag What it is Values tried Before this PR After this PR Effect (peak memory) Helps / doesn't help / untested
RX_VK_ASTC_CPU switch 0, 1 main's default the PR's default texture-revisit, the PR at 0 → at 1: not measured untested
Markdown for the PR description
## Measurements

**Verdict:** queued on igpu+ram-ge25gb (1/1 report).

Hardware: 1: windows+amd+amd-proprietary+igpu `AMD Radeon(TM) 860M Graphics, 2.0.416` `AMD Ryzen AI 7 350 w/ Radeon 860M, 26 GB RAM`  
Scene: texture-revisit, from the repository's save kokiri-start; each cell's settings and switches as the table names them  
Method: the Beanstalk test farm: main and this PR built and run on the same PC in one session, game starts alternating (ABBA); texture-revisit: 1 game start a side, kokiri-initial 20 s after 5 s warm-up, zora 20 s after 5 s warm-up, kokiri-revisit 20 s after 5 s warm-up; each number the median of the runs, then of 1 report  
How to reproduce: the farm's plan above (`@Beanstalk` on this PR runs it again)

Nothing was measured: no metric came back.

### Flags and settings

| Flag | What it is | Values tried | Before this PR | After this PR | Effect (peak memory) | Helps / doesn't help / untested |
|---|---|---|---|---|---|---|
| `RX_VK_ASTC_CPU` | switch | `0`, `1` | main's default | the PR's default | texture-revisit, the PR at 0 → at 1: not measured | untested |
<!-- beanstalk:sticky --> ### Beanstalk test farm Commit `9519ce0` · tier **reviewed** · approved by HumanBean · [dashboard](https://beanstalk.magicbean.dev/prs/1559) **What will be tested** · AI plan (`gpt-6.1-terra`) The plan compares CPU and GPU ASTC decoding during a Kokiri Forest–Zora’s Domain–Kokiri revisit, measuring frame times, memory, load times and visual differences against main. It requests reports from two Steam Decks, plus integrated GPUs with 24 GB and more than 24 GB of RAM; these targets are not currently listed online and will wait for matching testers. Each tester’s game runs take roughly 25 minutes. Crashes, device loss, substantial frame-time or system-memory regressions, and visual differences fail the plan. No tester online now matches steamdeck, igpu+ram24gb, igpu+ram-ge25gb: those targets wait for one. - **Where:** steamdeck (2-3 reports), igpu+ram24gb (24 GB RAM, 1-2 reports), igpu+ram-ge25gb (25 GB RAM or more, 1-2 reports). - **Matrix:** 2 cells, each on main and the PR: RX_VK_ASTC_CPU `0` or `1`. - **texture-revisit:** from the repository's save `kokiri-start`, then teleport to Kokiri Forest, measure kokiri-initial for 20 s (after 5 s warm-up), take the picture kokiri-initial to compare with main, teleport to Zora's Domain, measure zora for 20 s (after 5 s warm-up), take the picture zora to compare with main, measure kokiri-revisit for 20 s (after 5 s warm-up), take the picture kokiri-revisit to compare with main; 1 run on each side for each of 2 cells (2 game starts a run). - **Measured:** crashes, frame times, stutters and hitches, memory and CPU time, VRAM use, load times, the game's log. - **The PR fails if:** it crashes; or a picture differs from main by more than 5%; or peak memory is more than 30% above main; or frame time (p99) is more than 25% above main; or forbidden log lines is above 0. - **Time:** about 25 min of game runs per tester (4 game starts), plus the two builds. Started at 09:54 UTC. **Estimate:** done in about 25 min, from the queue and the testers online now; some jobs can't start yet. ⚠ No tester has a PC for `igpu+ram24gb` (none seen in 14 days): it waits until one signs in. | Target | Reports | Crash | Frame p99 (ms) vs main | VRAM peak (MB) vs main | Result | | --- | --- | --- | --- | --- | --- | | steamdeck | 0/2 | — | — | — | running | | igpu+ram24gb | 0/1 | — | — | — | queued | | igpu+ram-ge25gb · 1: windows+amd+amd-proprietary+igpu `AMD Radeon(TM) 860M Graphics, 2.0.416` | 1/1 [1](https://beanstalk.magicbean.dev/reports/rp_3e49686869749248) | none | — | — | queued | | Scenario · matrix cell | Target | Frame p99 (ms) vs main | Result | | --- | --- | --- | --- | | texture-revisit · `RX_VK_ASTC_CPU=0` | steamdeck | — | — | | texture-revisit · `RX_VK_ASTC_CPU=0` | igpu+ram24gb | — | — | | texture-revisit · `RX_VK_ASTC_CPU=0` | igpu+ram-ge25gb | — | not judged | | texture-revisit · `RX_VK_ASTC_CPU=1` | steamdeck | — | — | | texture-revisit · `RX_VK_ASTC_CPU=1` | igpu+ram24gb | — | — | | texture-revisit · `RX_VK_ASTC_CPU=1` | igpu+ram-ge25gb | — | not judged | #### Measurements · igpu+ram-ge25gb **Verdict:** queued on igpu+ram-ge25gb (1/1 report). Hardware: 1: windows+amd+amd-proprietary+igpu `AMD Radeon(TM) 860M Graphics, 2.0.416` `AMD Ryzen AI 7 350 w/ Radeon 860M, 26 GB RAM` Scene: texture-revisit, from the repository's save kokiri-start; each cell's settings and switches as the table names them Method: the Beanstalk test farm: main and this PR built and run on the same PC in one session, game starts alternating (ABBA); texture-revisit: 1 game start a side, kokiri-initial 20 s after 5 s warm-up, zora 20 s after 5 s warm-up, kokiri-revisit 20 s after 5 s warm-up; each number the median of the runs, then of 1 report How to reproduce: the farm's plan above (`@Beanstalk` on this PR runs it again) Nothing was measured: no metric came back. ### Flags and settings | Flag | What it is | Values tried | Before this PR | After this PR | Effect (peak memory) | Helps / doesn't help / untested | |---|---|---|---|---|---|---| | `RX_VK_ASTC_CPU` | switch | `0`, `1` | main's default | the PR's default | texture-revisit, the PR at 0 → at 1: not measured | untested | <details><summary>Markdown for the PR description</summary> ```markdown ## Measurements **Verdict:** queued on igpu+ram-ge25gb (1/1 report). Hardware: 1: windows+amd+amd-proprietary+igpu `AMD Radeon(TM) 860M Graphics, 2.0.416` `AMD Ryzen AI 7 350 w/ Radeon 860M, 26 GB RAM` Scene: texture-revisit, from the repository's save kokiri-start; each cell's settings and switches as the table names them Method: the Beanstalk test farm: main and this PR built and run on the same PC in one session, game starts alternating (ABBA); texture-revisit: 1 game start a side, kokiri-initial 20 s after 5 s warm-up, zora 20 s after 5 s warm-up, kokiri-revisit 20 s after 5 s warm-up; each number the median of the runs, then of 1 report How to reproduce: the farm's plan above (`@Beanstalk` on this PR runs it again) Nothing was measured: no metric came back. ### Flags and settings | Flag | What it is | Values tried | Before this PR | After this PR | Effect (peak memory) | Helps / doesn't help / untested | |---|---|---|---|---|---|---| | `RX_VK_ASTC_CPU` | switch | `0`, `1` | main's default | the PR's default | texture-revisit, the PR at 0 → at 1: not measured | untested | ``` </details>
Contributor

For the Steam Deck testers, a note from reading the diff at 9519ce0f, not yet run: this probably doesn't change the Deck's texture budget.

  • The higher caps apply only when ASTC is decoded on the CPU and the RAM is above 16 GB.
  • CPU ASTC is on by default only for the Windows AMD iGPUs in device_policy.h. The Deck (Linux, RADV VANGOGH) decodes ASTC on the GPU, and has ~14.8 GB usable of 16 GB.
  • So it stays in the "2.5 GB with 16 GB" band, even with RX_VK_ASTC_CPU=1.

A Deck run of the PR should log the same vk: integrated GPU texture budget: line as main. If a Deck tester sees a different value, that would be worth a look.

For the Steam Deck testers, a note from reading the diff at `9519ce0f`, not yet run: this probably doesn't change the Deck's texture budget. - The higher caps apply only when ASTC is decoded on the CPU **and** the RAM is above 16 GB. - CPU ASTC is on by default only for the Windows AMD iGPUs in `device_policy.h`. The Deck (Linux, RADV VANGOGH) decodes ASTC on the GPU, and has ~14.8 GB usable of 16 GB. - So it stays in the "2.5 GB with 16 GB" band, even with `RX_VK_ASTC_CPU=1`. A Deck run of the PR should log the same `vk: integrated GPU texture budget:` line as main. If a Deck tester sees a different value, that would be worth a look.
futondestroyer left a comment

Verdict: Request changes. The bigger texture cache eliminates the measured Kokiri eviction thrashing on the Radeon 860M. Both patched runs were slower in settled Zora’s Domain, and the higher budget can also take effect when ASTC still uploads compressed.

Reviewed 9519ce0fb0a0 against ef6038abe489. Read the changed policy, budget and texture code, both fixtures and documentation, and checked the native format selection and memory-pressure paths. The measured renderer at 8dd2987 matches the reviewed renderer. Code review only. No changes pushed.

Blocking

  • gpu/vk/device_policy.h:128 increases the cap on the affected UMA path. The author’s interleaved 860M runs report settled Zora at 30.90 and 32.63 fps after versus 33.89 and 33.65 before, a 5.9% median drop. Peak texture residency rose from 4,064–4,638 MiB to 7,037–7,130 MiB. Please repeat the warm interleaved route on a current main base, with settled frame times and system-memory headroom. If the slowdown holds, tune the cap or eviction policy before merging. The earlier 6 GiB result in issue 1040 still had evictions in Zora, so a smaller cap needs measurement too.
  • gpu/vk/vk_texture.cpp:4991 and the corresponding startup estimate use the CPU-decode policy bit. Format selection picks a supported native ASTC format before it reaches the decode fallback. With RX_VK_ASTC_CPU=1, native ASTC, more than 16 GiB usable RAM and sufficient driver allowance, the budget can rise while textures remain compressed. Gate both calculations on the same native-format capability and cover that combination in the fixture.

The driver allowance and pressure clamps still apply, and the explicit override still bypasses the default. The tested 860M showed 3,060 to zero median evictions and strong gains on the two Kokiri visits. The Windows suite report should name its 57 baseline failures. The farm request still lacks conclusive metrics on affected desktop iGPUs and the lower RAM tier. The Deck is in the unchanged budget band even with CPU decode forced, so a Deck result alone cannot validate the increase.

No merge-order dependency found. Recheck the route if ASTC reuse hashing lands first.

**Verdict: Request changes.** The bigger texture cache eliminates the measured Kokiri eviction thrashing on the Radeon 860M. Both patched runs were slower in settled Zora’s Domain, and the higher budget can also take effect when ASTC still uploads compressed. **Reviewed** `9519ce0fb0a0` against `ef6038abe489`. Read the changed policy, budget and texture code, both fixtures and documentation, and checked the native format selection and memory-pressure paths. The measured renderer at `8dd2987` matches the reviewed renderer. Code review only. No changes pushed. **Blocking** - `gpu/vk/device_policy.h:128` increases the cap on the affected UMA path. The author’s interleaved 860M runs report settled Zora at 30.90 and 32.63 fps after versus 33.89 and 33.65 before, a 5.9% median drop. Peak texture residency rose from 4,064–4,638 MiB to 7,037–7,130 MiB. Please repeat the warm interleaved route on a current main base, with settled frame times and system-memory headroom. If the slowdown holds, tune the cap or eviction policy before merging. The earlier 6 GiB result in [issue 1040](https://git.magicbean.dev/MagicBeanDev/Longshot/issues/1040) still had evictions in Zora, so a smaller cap needs measurement too. - `gpu/vk/vk_texture.cpp:4991` and the corresponding startup estimate use the CPU-decode policy bit. Format selection picks a supported native ASTC format before it reaches the decode fallback. With `RX_VK_ASTC_CPU=1`, native ASTC, more than 16 GiB usable RAM and sufficient driver allowance, the budget can rise while textures remain compressed. Gate both calculations on the same native-format capability and cover that combination in the fixture. The driver allowance and pressure clamps still apply, and the explicit override still bypasses the default. The tested 860M showed 3,060 to zero median evictions and strong gains on the two Kokiri visits. The Windows suite report should name its 57 baseline failures. The [farm request](https://beanstalk.magicbean.dev/prs/1559) still lacks conclusive metrics on affected desktop iGPUs and the lower RAM tier. The Deck is in the unchanged budget band even with CPU decode forced, so a Deck result alone cannot validate the increase. No merge-order dependency found. Recheck the route if [ASTC reuse hashing](https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/1281) lands first.
@ -124,3 +125,4 @@
const uint64_t available = ram > reserved ? ram - reserved : 0;
uint64_t b = std::min(available, share);
const uint64_t cap = ram <= 8 * kGB ? 1536 * kMB : ram <= 12 * kGB ? 2048 * kMB : ram <= 16 * kGB ? 2560 * kMB
: astc_on_cpu ? (ram <= 24 * kGB ? 6144 * kMB : 8192 * kMB)
Member

Both patched 860M samples lost settled Zora FPS while peak residency grew by several GiB. Please replicate settled timing and memory headroom on the rebased pair, and tune the cap or policy if the loss holds.

Both patched 860M samples lost settled Zora FPS while peak residency grew by several GiB. Please replicate settled timing and memory headroom on the rebased pair, and tune the cap or policy if the loss holds.
@ -4987,3 +4989,3 @@
const uint64_t reserved = policy_rule::integrated_reserved(system_ram); // (for the line below)
const uint64_t driver_budget = own; // (its share of the allowance: texture_budget.h integrated_bytes)
own = policy_rule::integrated_texture_budget(driver_budget, system_ram);
own = policy_rule::integrated_texture_budget(driver_budget, system_ram, astc_on_cpu());
Member

Please gate the increased default on the actual decode path. A forced CPU policy bit can coexist with native compressed ASTC selected first in vk_formats.cpp. Keep the startup estimate aligned.

Please gate the increased default on the actual decode path. A forced CPU policy bit can coexist with native compressed ASTC selected first in vk_formats.cpp. Keep the startup estimate aligned.
Member

Independent Windows game-free check at 9519ce0f, with llvm-mingw Clang and Vulkan-Headers 1.4.345. test_texture_budget.py passed, and test_device_policy.py passed its 19 PC profiles, 64 switch environments and 55 rule edges.

These checks exercise the budget formulas and policy wiring. The live native-ASTC format case and the settled Zora's Domain result in the existing review still need coverage. The existing farm plan has the useful 24 GB and above-24 GB integrated-GPU targets. Steam Deck gives a control for the unchanged memory tier.

Independent Windows game-free check at `9519ce0f`, with llvm-mingw Clang and Vulkan-Headers 1.4.345. `test_texture_budget.py` passed, and `test_device_policy.py` passed its 19 PC profiles, 64 switch environments and 55 rule edges. These checks exercise the budget formulas and policy wiring. The live native-ASTC format case and the settled Zora's Domain result in the [existing review](https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/1559#issuecomment-48763) still need coverage. The existing farm plan has the useful 24 GB and above-24 GB integrated-GPU targets. Steam Deck gives a control for the unchanged memory tier.
Some checks are pending
CI / Conventional Commit title (pull_request) Blocked by required conditions
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Blocked by required conditions
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Blocked by required conditions
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Blocked by required conditions
CI / Workflow lint (actionlint) (pull_request) Blocked by required conditions
Guide screenshots / Guide images and local UI source review (pull_request) Blocked by required conditions
Third-party parts / As their notes say (pull_request) Blocked by required conditions
Third-party parts / The same as upstream (pull_request) Blocked by required conditions
Website / Website on Cloudflare (pull_request) Blocked by required conditions
PR description / Description follows the template (pull_request_target) Successful in 4s
Website / Website on Cloudflare (pull_request_target) Has been skipped
beanstalk/approval approved by HumanBean (reviewed)
beanstalk/steamdeck 0/2 pass, 1 running, 2 queued
beanstalk/igpu+ram24gb 0/1 pass, 0 running, 2 queued
beanstalk/igpu+ram-ge25gb 0/1 pass, 0 running, 1 queued
This pull request doesn't have enough approvals yet. 0 of 1 approvals granted.
Some workflows are waiting to be reviewed.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u 'fix/igpu-cpu-astc-texture-budget:Jer9-fix/igpu-cpu-astc-texture-budget'
git switch 'Jer9-fix/igpu-cpu-astc-texture-budget'
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
5 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!1559
No description provided.