WIP: feat(vk): a disk cache of decoded ASTC textures (RX_VK_TEX_CACHE, off by default) #2292

Draft
TrashPanda wants to merge 3 commits from TrashPanda/Longshot:feat/tex-disk-cache into main
Contributor

Summary

No longer stacked: #2307 and #2314 have merged, and this now sits directly on main (three commits, head 679e25d90 on 94cd0a204). It was rebuilt on #2314 because the cache keeps what the GPU ASTC decoder produces (and, for big textures, what the BC re-encoder makes of it) in files; #2314 defines what the correct output is (bit-exact to astcenc, sRGB formats in the sRGB decode mode), so the cache has to sit on it. Only the three commits under #2314 are this pull request; it can be rebased onto main once #2307 and #2314 land.

What the first version got wrong, and what this one drops. The first version was pushed from a private development branch: its 35 commits sat on an old main (141 commits behind) and only the top five were the cache. Underneath they carried a temporary texel read-back harness (RX_VK_TEXDECODE_CHECK, texdecode_use.*, a dlsym hook that logged texel values), three experimental switches (RX_VK_ASTC_GPU_PORT, RX_VK_UNSWIZZLE_GPU_PORT, RX_VK_ASTC_BC3_OWN), a ported GPU ASTC decoder, a GPU deswizzle and a BC3 encoder that were later measured to be slower on integrated GPUs and are not offered, and a commit pair (0d9325aa9 and its revert) that held another project's file. That was a mistake in how the first version was pushed, not something to review. None of it is here: the branch is three commits, the cache and its tests only, and git grep for those names finds nothing. Also dropped: the two commits that fixed Eden's decoder reading uninitialised colour bits; main already zeroes color_endpoint_data (the line at the top of the block's colour decode, from #2194 and #2314's follow-ups), and the in-game check below finds no difference on either GPU.

What it does. The first whole upload of a decoded ASTC texture is looked up by the hash of its blocks (reuse_upload already makes it), the texture's shape and a producer stamp. A file is copied into the image with one vkCmdCopyBufferToImage when a small cost model says the read takes under half the decode's time; otherwise the texture is decoded as before and its final image read back and written by a background thread at idle I/O priority, for the next run. Textures decoded on the CPU are never read or written. Files live under cache/textures/<stamp>/, made from the player's game files like the rest of cache/: they never leave the PC.

The default is now off (the title used to say "on for integrated GPUs"). On this PC's integrated GPU (Raphael, RADV), on top of #2194's fast decoder and #2314, a warm cache gains no more than the run-to-run spread (Measurements). RX_VK_TEX_CACHE=1 turns it on with the cost model; =2 for every texture the cache takes, for checks. Reviewer data on a Steam Deck (42% fewer hitches, 51% fewer slow-frame seconds, an hour of play with no failure) says it wins there; that is the number to confirm on this head, and it decides whether the default goes back on.

Changes in answer to omgitsgela's review (thank you for the Deck run and for feeding old files to the new decoder, which is how the gap was found):

  • Producer stamp. A file is now unreachable, not only detectable, when anything that determines its bytes differs from what would be made now. The stamp (tex_cache::make_stamp) folds the cache's format version, the generated SPIR-V the renderer embeds for the ASTC decoder and for the BC encoder (BC7's too when BC7 is on), and the rule that picks the decode mode (astc_nvn_srgb, evaluated over every NVN format), so a shader change invalidates by itself with nothing to remember to bump. The decoder's error colour is a constant in its SPIR-V, so it is covered. Each texture's shape carries its own decode mode and format (RGBA8, BC1/BC3/BC7), which are in the key and the header. The stamp is in the key (a file of another stamp is at another name, so a lookup cannot reach it), in the header (refused if a file is moved or renamed) and in the folder name (so the start-up can tell what is stale without opening files). The CPU decoder's version is not in the stamp because nothing the CPU route makes is cached (tex_cache::refused: "decoded on the CPU"); a route that fills the cache from the CPU must add it.
  • Stale files. At start-up, on the index thread and never on the upload path, every file of another stamp is deleted (it can never be read again). The log says how many.
  • Eviction. Also at start-up only: when this stamp's files are over the cap, the least recently read go first (a read touches its file) down to nine tenths of it. The cap is the tune switch RX_VK_TEX_CACHE_MB, 4096 MB by default, never more than a tenth of the disk's free space (the cache's own files counted as free), at least 1 GB. A write that would pass it is refused. 4 GB is chosen from the measured sizes: a route through Link's house, Kokiri Forest and Hyrule Field is 1.5 to 2 GB on this PC (1.1 GB for one of the areas), and the reviewer's day of play was about 1 GB, so the cap holds several routes' worth and about four times a day. It was 8192 MB.
  • No RAM tier. The reviewer found that on Linux integrated GPUs a second tier would mostly duplicate the page cache, so none is added. Open question for Windows (whose file cache behaves differently): whether a RAM tier pays there.
  • Rebased first onto #2314's head, then, after #2307 and #2314 merged, straight onto main with no conflicts (same three commits; the measurements below were taken at ceb46c513, whose tree differs from the current head only by what merged beneath it).

Read first: gpu/vk/tex_cache.h (key, stamp, header, regions, eviction, cost model), then tex_cache_fill, tex_cache_capture, tex_cache_frame and tc_stamp in gpu/vk/vk_texture.cpp, then gpu/vk/tex_cache.cpp (index and writer threads). Where the hooks sit: upload_inner takes the memory generation before the blocks are hashed, tex_cache_fill runs after reuse_upload and before upload_astc_gpu, tex_cache_capture runs after upload_astc_gpu succeeds on a first whole upload; texture_frame calls tex_cache_frame, mkwvk_close_asked stops the writer. The copies use whole-block row lengths (#2015's rule) and one region a layer for a multi-layer BC level whose extent is not a multiple of 4 (#2228's AMD Windows finding, applied on every driver).

Written with AI agents under the project owner's direction.

Testing

Tested: (head ceb46c513; Linux, this PC: RTX 4070 Ti, and the integrated GPU of the Ryzen 7 9800X3D on RADV; lavapipe):

  • Game-free: tests/test_tex_cache.py passes with g++ and clang++ (every field of the shape and every stamp component changes the key or the stamp; a header with another stamp is refused; the eviction rule; the store on a temporary folder). tests/test_tex_cache_gpu.py (six shapes: BC3 and RGBA8, 1 and 3 layers, 11-level chains to 1 x 1, linear and sRGB decode modes; the renderer's own decoder and encoder SPIR-V; capture, file, fill, every byte compared) passes on lavapipe with the validation layer, on the RTX 4070 Ti and on the RADV iGPU.
  • suite.py compare against #2314's head 511dd4049: 936 passed, 3 failed, 26 skipped, against 934, 3, 26 on the base; failing only here: 0; failing only on the base: 0 (test_dev_packs, test_pipeline_state_computes, test_thinlto_tls fail on both); the two new checks pass. The translator stamp is unchanged (9a7560c9042d2783 on both).
  • In the game, a scratch build (never part of this branch) that decodes every texture served from a file again as without the cache and compares both with the file byte for byte (RX_VK_TEX_CACHE=2, one fill pass then one reading pass on the same folder; every run alone on the GPU in the queue's timing mode; Link's house, Kokiri Forest and Hyrule Field one scene a run): RTX 4070 Ti reading pass 232, 340 and 313 textures (1474, 1930 and 1816 MB) compared, 0 differ, and the copies read back from the files 0 differ; RADV iGPU (RX_VK_DEVICE=1, 1280x720, RX_VK_AUTO_TUNE=0) 250, 383 and 373 textures (924, 1234 and 1102 MB), 0 differ. All runs stopped cleanly.
  • The upgrade scenario, for real (RTX, RX_VK_TEX_CACHE=2, Kokiri Forest): a folder filled by main's decoder from before #2314 (its SPIR-V loaded with RX_VK_SHADER_DIR, stamp a437...: 168 files, 950 MB), then this build on the same folder (stamp f086...): the log says "0 MB of this build's stamp and 950 MB of other stamps found ... 168 files (950 MB) deleted ... 0 files listed", 0 files read, 408 "not there", then its own fill of 173 files; a third run lists those 173 files and reads 103 of them.
  • gamerun, the three scenes (house, Kokiri Forest, Hyrule Field) on the RTX, cache off against on and warm: all clean stops, 0 warning lines, logdiff finds no new, gone or changed warning or error kind in any scene; the screenshots read the same (only the animation pose differs).

Still to test:

  • Steam Deck on this head: the reviewer offered to rerun; expecting the 42% / 51% they measured, which decides the default (by hand).
  • Windows (not compiled here: _wfopen, _wgetenv, THREAD_MODE_BACKGROUND_BEGIN, MoveFileExW): @Beanstalk build and a run with RX_VK_TEX_CACHE=1.
  • AMD's Windows driver: the per-layer regions for uneven BC levels on the fill and the capture; Hyrule Field's far ground with the cache warm, expecting no grid lines (@Beanstalk on an RX 6000, forced on with RX_VK_TEX_CACHE=2).
  • Intel and other APUs (780M, 890M): expecting no worse than off (@Beanstalk).
  • A microSD or a slow HDD: the read rate is learnt from the first reads; expecting the cost model to refuse where reads are slow (by hand).

Measurements

Verdict: On this PC's integrated GPU the cache no longer pays, on top of #2194 and #2314: no gain beyond the run-to-run spread, so it ships off. On the RTX forcing it on is worse (the cost model declines every file by default, as designed). The first version's gain (frames over 100 ms 12.1 s to 7.5 s on this GPU) was measured against the old decoder, and the integrated cost model's decode seed (150 MB/s) comes from it: the decode now runs at about 500 MB/s here against a file read of about 380 MB/s. The reviewer's Deck numbers (42% fewer hitches, 51% fewer slow-frame seconds) do not carry over to this GPU; the Deck's rerun on this head is the open question.

Setup: Linux, this PC, queue timing mode (each run alone on the GPU, checked with qoverlap), head ceb46c513 (the runs were made at c64f28250; the later commits change only the default), RX_VK_FRAME_LOG, worst frames from the whole-run log, 2 interleaved rounds, median (range). A: RX_VK_TEX_CACHE=0 (what main does), B: an empty folder (cold: the fill's cost), C: the same folder straight after (warm). iGPU: Raphael, RADV, RX_VK_DEVICE=1, 1280x720, RX_VK_AUTO_TUNE=0, house 20 s then 45 s in Kokiri Forest (F) or in Hyrule Field (H), two separate runs (the three-stop route loses the device here on every build). RTX 4070 Ti: the three-stop route, RX_VK_TEX_CACHE=2 (forced). Switches added and their defaults: RX_VK_TEX_CACHE off (above), RX_VK_TEX_CACHE_MB 4096 (the size of a route and a day, above), RX_VK_TEX_CACHE_VERIFY on (a file's checksum is checked as it is read, about 0.05 ms a MB; off only for measurements) and RX_VK_TEX_CACHE_DIR the game folder's cache/textures (a folder for tests; no measurement chose it). Logs: Longshot/work/texcache2/logs/summary_igpu.txt, summary_rtx.txt (not published: they hold game-derived names).

Before: main @ 511dd4049 (#2314's head; cache off, A) After: this PR @ ceb46c513, cold (B) After: this PR @ ceb46c513, warm (C)
iGPU F: worst frame, ms 1980 (1063-2897) 1106 (1026-1187) 1198 (1057-1340)
iGPU F: frames over 100 ms, total ms 6325 (4391-8258) 5728 (4532-6924) 5343 (4807-5879)
iGPU F: slow-upload time, ms 2125 (2070-2180) 2144 (2093-2194) 2850 (2508-3191), 1487 from files
iGPU F: files read / written, MB - 0 / 562 561 / 459
iGPU F: teleport window worst frame, ms 292 (192-392) 224 (208-240) 365 (228-502)
iGPU H: worst frame, ms 1024 (998-1049) 1098 (1059-1136) 931 (923-940)
iGPU H: frames over 100 ms, total ms 4508 (4439-4576) 4868 (4858-4877) 5027 (4602-5451)
iGPU H: slow-upload time, ms 2573 (2453-2692) 2807 (2796-2817) 2848 (2832-2864), 890 from files
iGPU H: files read / written, MB - 0 / 417 417 / 493
iGPU: VRAM by the driver, MB (F, H) 4111, 4740 4074, 4820 3905, 4804
RTX: worst frame, ms 339 (204-474) 244 (239-250) 735 (592-878)
RTX: frames over 100 ms, total ms 1110 (577-1644) 1000 (993-1007) 2904 (2649-3159)
RTX: files read / written, MB - 0 / 2214 1316 / 1268

Every run reached its teleport, with 0 warning lines. House load time (launch to map) is 21 to 23 s in every arm after the first run. Disk used by a filled cache: 0.5 GB per iGPU route, 2.2 GB on the RTX (forced). The old branch's numbers (iGPU, three-stop route, same GPU, before #2194): off 12.1 s of frames over 100 ms and a 2.7 s worst frame, warm 7.5 s and 1.3 s. Against them: here A's worst frame is already 1.0 to 2.0 s and its frames over 100 ms 4.5 to 6.3 s without the cache, so there is less left for it to remove, and the reads cost about what the decodes do.

Risks

  • A wrong file would show a wrong texture until it is deleted. Guarded by the key (blocks hash, full shape, stamp), the header check, the payload's checksum, and the storage-unchanged check before a write; and checked in the game (0 differences in the reading passes of both GPUs above).
  • Off by default; RX_VK_TEX_CACHE=0 forces it off, deleting cache/textures/ is always safe. A revert is enough.
  • Disk: up to RX_VK_TEX_CACHE_MB (4096 MB) in the game folder's cache/, when it is on. Memory: read-backs waiting to be written hold at most 512 MB (256 below 16 GB of RAM).
  • Nothing changes for a player with it off. Turned on, no save or options file changes; a folder cache/textures/ appears. A build whose shaders differ deletes the previous build's files at its first start (two builds sharing one game folder would delete each other's).
  • Integrated cost model: the decode seed (150 MB/s) is out of date for the fast decoder; with it on, the model reads files where the decode is now about as fast. It re-learns decode rates only from decodes that wait on their own chunks. To re-measure before any default-on.

Checklist

Ready for review

  • One topic, on current main; the title is a Conventional Commit. (On current main since #2307 and #2314 merged.)
  • Tested on my own PC, in the game for a change the game runs, as Testing says.
  • mise run test passes (any failure that also fails on main is named). (The suite's three failures also fail on the base, named above.)
  • Measured against main, or Measurements says why there is nothing to measure.
  • No game files, build output or hand-edited generated files; third_party/ untouched; nothing GPL-incompatible.

When it applies

  • A fix: a game-free test that fails on main and passes here. (Not a fix: a feature, off by default; its tests are game-free and in Testing.)
  • A switch added or changed: it ships at the default the measurements chose, with its row in gpu/vk/switches.def.
  • A check under tests/ that reads changed source is updated, not weakened.
  • MKWVK_API_VERSION bumped (MkwVkHost or MkwVkRenderer in gpu/vk/vk_api.h changed). (Not needed: vk_api.h is untouched.)
  • The SPIR-V headers regenerated (a shader changed). (No shader changed.)
  • Host code builds on Windows (llvm-mingw) and Linux, with UTF-8 paths. (Linux only so far: not compiled for Windows, see Still to test.)
  • Screenshots of the same spot on main and here, for a change that shows on screen. (Nothing shows on screen; the cache-off and cache-warm screenshots read the same.)
  • Docs updated.
  • AI assistance recorded with Assisted-by: / Co-Authored-By: trailers.

Ready to merge

  • Everything in Still to test has run, its results in Tested.
  • Tier 1 hardware it can affect is tested (docs/dev/standards.md, "Hardware tiers").
  • Approved in review, every comment answered.
  • CI passes on the head; on current main, measured again or a comment says why the numbers still hold.
## Summary **No longer stacked: #2307 and #2314 have merged, and this now sits directly on `main` (three commits, head 679e25d90 on 94cd0a204).** It was rebuilt on #2314 because the cache keeps what the GPU ASTC decoder produces (and, for big textures, what the BC re-encoder makes of it) in files; #2314 defines what the correct output is (bit-exact to astcenc, sRGB formats in the sRGB decode mode), so the cache has to sit on it. Only the three commits under #2314 are this pull request; it can be rebased onto `main` once #2307 and #2314 land. **What the first version got wrong, and what this one drops.** The first version was pushed from a private development branch: its 35 commits sat on an old `main` (141 commits behind) and only the top five were the cache. Underneath they carried a temporary texel read-back harness (`RX_VK_TEXDECODE_CHECK`, `texdecode_use.*`, a `dlsym` hook that logged texel values), three experimental switches (`RX_VK_ASTC_GPU_PORT`, `RX_VK_UNSWIZZLE_GPU_PORT`, `RX_VK_ASTC_BC3_OWN`), a ported GPU ASTC decoder, a GPU deswizzle and a BC3 encoder that were later measured to be slower on integrated GPUs and are not offered, and a commit pair (0d9325aa9 and its revert) that held another project's file. That was a mistake in how the first version was pushed, not something to review. None of it is here: the branch is three commits, the cache and its tests only, and `git grep` for those names finds nothing. Also dropped: the two commits that fixed Eden's decoder reading uninitialised colour bits; `main` already zeroes `color_endpoint_data` (the line at the top of the block's colour decode, from #2194 and #2314's follow-ups), and the in-game check below finds no difference on either GPU. **What it does.** The first whole upload of a decoded ASTC texture is looked up by the hash of its blocks (`reuse_upload` already makes it), the texture's shape and a producer stamp. A file is copied into the image with one `vkCmdCopyBufferToImage` when a small cost model says the read takes under half the decode's time; otherwise the texture is decoded as before and its final image read back and written by a background thread at idle I/O priority, for the next run. Textures decoded on the CPU are never read or written. Files live under `cache/textures/<stamp>/`, made from the player's game files like the rest of `cache/`: they never leave the PC. **The default is now off** (the title used to say "on for integrated GPUs"). On this PC's integrated GPU (Raphael, RADV), on top of #2194's fast decoder and #2314, a warm cache gains no more than the run-to-run spread (Measurements). `RX_VK_TEX_CACHE=1` turns it on with the cost model; `=2` for every texture the cache takes, for checks. Reviewer data on a Steam Deck (42% fewer hitches, 51% fewer slow-frame seconds, an hour of play with no failure) says it wins there; that is the number to confirm on this head, and it decides whether the default goes back on. **Changes in answer to omgitsgela's review** (thank you for the Deck run and for feeding old files to the new decoder, which is how the gap was found): - **Producer stamp.** A file is now unreachable, not only detectable, when anything that determines its bytes differs from what would be made now. The stamp (`tex_cache::make_stamp`) folds the cache's format version, the generated SPIR-V the renderer embeds for the ASTC decoder and for the BC encoder (BC7's too when BC7 is on), and the rule that picks the decode mode (`astc_nvn_srgb`, evaluated over every NVN format), so a shader change invalidates by itself with nothing to remember to bump. The decoder's error colour is a constant in its SPIR-V, so it is covered. Each texture's shape carries its own decode mode and format (RGBA8, BC1/BC3/BC7), which are in the key and the header. The stamp is in the **key** (a file of another stamp is at another name, so a lookup cannot reach it), in the **header** (refused if a file is moved or renamed) and in the **folder name** (so the start-up can tell what is stale without opening files). The CPU decoder's version is not in the stamp because nothing the CPU route makes is cached (`tex_cache::refused`: "decoded on the CPU"); a route that fills the cache from the CPU must add it. - **Stale files.** At start-up, on the index thread and never on the upload path, every file of another stamp is deleted (it can never be read again). The log says how many. - **Eviction.** Also at start-up only: when this stamp's files are over the cap, the least recently read go first (a read touches its file) down to nine tenths of it. The cap is the `tune` switch `RX_VK_TEX_CACHE_MB`, **4096 MB by default**, never more than a tenth of the disk's free space (the cache's own files counted as free), at least 1 GB. A write that would pass it is refused. 4 GB is chosen from the measured sizes: a route through Link's house, Kokiri Forest and Hyrule Field is 1.5 to 2 GB on this PC (1.1 GB for one of the areas), and the reviewer's day of play was about 1 GB, so the cap holds several routes' worth and about four times a day. It was 8192 MB. - **No RAM tier.** The reviewer found that on Linux integrated GPUs a second tier would mostly duplicate the page cache, so none is added. Open question for Windows (whose file cache behaves differently): whether a RAM tier pays there. - **Rebased** first onto #2314's head, then, after #2307 and #2314 merged, straight onto `main` with no conflicts (same three commits; the measurements below were taken at ceb46c513, whose tree differs from the current head only by what merged beneath it). **Read first:** `gpu/vk/tex_cache.h` (key, stamp, header, regions, eviction, cost model), then `tex_cache_fill`, `tex_cache_capture`, `tex_cache_frame` and `tc_stamp` in `gpu/vk/vk_texture.cpp`, then `gpu/vk/tex_cache.cpp` (index and writer threads). Where the hooks sit: `upload_inner` takes the memory generation before the blocks are hashed, `tex_cache_fill` runs after `reuse_upload` and before `upload_astc_gpu`, `tex_cache_capture` runs after `upload_astc_gpu` succeeds on a first whole upload; `texture_frame` calls `tex_cache_frame`, `mkwvk_close_asked` stops the writer. The copies use whole-block row lengths (#2015's rule) and one region a layer for a multi-layer BC level whose extent is not a multiple of 4 (#2228's AMD Windows finding, applied on every driver). Written with AI agents under the project owner's direction. ## Testing **Tested:** (head ceb46c513; Linux, this PC: RTX 4070 Ti, and the integrated GPU of the Ryzen 7 9800X3D on RADV; lavapipe): - Game-free: `tests/test_tex_cache.py` passes with g++ and clang++ (every field of the shape and every stamp component changes the key or the stamp; a header with another stamp is refused; the eviction rule; the store on a temporary folder). `tests/test_tex_cache_gpu.py` (six shapes: BC3 and RGBA8, 1 and 3 layers, 11-level chains to 1 x 1, linear and sRGB decode modes; the renderer's own decoder and encoder SPIR-V; capture, file, fill, every byte compared) passes on lavapipe with the validation layer, on the RTX 4070 Ti and on the RADV iGPU. - `suite.py compare` against #2314's head 511dd4049: 936 passed, 3 failed, 26 skipped, against 934, 3, 26 on the base; failing only here: 0; failing only on the base: 0 (`test_dev_packs`, `test_pipeline_state_computes`, `test_thinlto_tls` fail on both); the two new checks pass. The translator stamp is unchanged (9a7560c9042d2783 on both). - In the game, a scratch build (never part of this branch) that decodes every texture served from a file again as without the cache and compares both with the file byte for byte (`RX_VK_TEX_CACHE=2`, one fill pass then one reading pass on the same folder; every run alone on the GPU in the queue's timing mode; Link's house, Kokiri Forest and Hyrule Field one scene a run): **RTX 4070 Ti** reading pass 232, 340 and 313 textures (1474, 1930 and 1816 MB) compared, 0 differ, and the copies read back from the files 0 differ; **RADV iGPU** (`RX_VK_DEVICE=1`, 1280x720, `RX_VK_AUTO_TUNE=0`) 250, 383 and 373 textures (924, 1234 and 1102 MB), 0 differ. All runs stopped cleanly. - The upgrade scenario, for real (RTX, `RX_VK_TEX_CACHE=2`, Kokiri Forest): a folder filled by main's decoder from before #2314 (its SPIR-V loaded with `RX_VK_SHADER_DIR`, stamp a437...: 168 files, 950 MB), then this build on the same folder (stamp f086...): the log says "0 MB of this build's stamp and 950 MB of other stamps found ... 168 files (950 MB) deleted ... 0 files listed", 0 files read, 408 "not there", then its own fill of 173 files; a third run lists those 173 files and reads 103 of them. - `gamerun`, the three scenes (house, Kokiri Forest, Hyrule Field) on the RTX, cache off against on and warm: all clean stops, 0 warning lines, `logdiff` finds no new, gone or changed warning or error kind in any scene; the screenshots read the same (only the animation pose differs). **Still to test:** - Steam Deck on this head: the reviewer offered to rerun; expecting the 42% / 51% they measured, which decides the default (by hand). - Windows (not compiled here: `_wfopen`, `_wgetenv`, `THREAD_MODE_BACKGROUND_BEGIN`, `MoveFileExW`): `@Beanstalk` build and a run with `RX_VK_TEX_CACHE=1`. - AMD's Windows driver: the per-layer regions for uneven BC levels on the fill and the capture; Hyrule Field's far ground with the cache warm, expecting no grid lines (`@Beanstalk` on an RX 6000, forced on with `RX_VK_TEX_CACHE=2`). - Intel and other APUs (780M, 890M): expecting no worse than off (`@Beanstalk`). - A microSD or a slow HDD: the read rate is learnt from the first reads; expecting the cost model to refuse where reads are slow (by hand). ## Measurements **Verdict:** On this PC's integrated GPU the cache no longer pays, on top of #2194 and #2314: no gain beyond the run-to-run spread, so it ships **off**. On the RTX forcing it on is worse (the cost model declines every file by default, as designed). The first version's gain (frames over 100 ms 12.1 s to 7.5 s on this GPU) was measured against the old decoder, and the integrated cost model's decode seed (150 MB/s) comes from it: the decode now runs at about 500 MB/s here against a file read of about 380 MB/s. The reviewer's Deck numbers (42% fewer hitches, 51% fewer slow-frame seconds) do not carry over to this GPU; the Deck's rerun on this head is the open question. Setup: Linux, this PC, queue timing mode (each run alone on the GPU, checked with `qoverlap`), head ceb46c513 (the runs were made at c64f28250; the later commits change only the default), `RX_VK_FRAME_LOG`, worst frames from the whole-run log, 2 interleaved rounds, median (range). A: `RX_VK_TEX_CACHE=0` (what main does), B: an empty folder (cold: the fill's cost), C: the same folder straight after (warm). iGPU: Raphael, RADV, `RX_VK_DEVICE=1`, 1280x720, `RX_VK_AUTO_TUNE=0`, house 20 s then 45 s in Kokiri Forest (F) or in Hyrule Field (H), two separate runs (the three-stop route loses the device here on every build). RTX 4070 Ti: the three-stop route, `RX_VK_TEX_CACHE=2` (forced). Switches added and their defaults: `RX_VK_TEX_CACHE` off (above), `RX_VK_TEX_CACHE_MB` 4096 (the size of a route and a day, above), `RX_VK_TEX_CACHE_VERIFY` on (a file's checksum is checked as it is read, about 0.05 ms a MB; off only for measurements) and `RX_VK_TEX_CACHE_DIR` the game folder's `cache/textures` (a folder for tests; no measurement chose it). Logs: `Longshot/work/texcache2/logs/summary_igpu.txt`, `summary_rtx.txt` (not published: they hold game-derived names). | | Before: main @ 511dd4049 (#2314's head; cache off, A) | After: this PR @ ceb46c513, cold (B) | After: this PR @ ceb46c513, warm (C) | |---|---|---|---| | iGPU F: worst frame, ms | 1980 (1063-2897) | 1106 (1026-1187) | 1198 (1057-1340) | | iGPU F: frames over 100 ms, total ms | 6325 (4391-8258) | 5728 (4532-6924) | 5343 (4807-5879) | | iGPU F: slow-upload time, ms | 2125 (2070-2180) | 2144 (2093-2194) | 2850 (2508-3191), 1487 from files | | iGPU F: files read / written, MB | - | 0 / 562 | 561 / 459 | | iGPU F: teleport window worst frame, ms | 292 (192-392) | 224 (208-240) | 365 (228-502) | | iGPU H: worst frame, ms | 1024 (998-1049) | 1098 (1059-1136) | 931 (923-940) | | iGPU H: frames over 100 ms, total ms | 4508 (4439-4576) | 4868 (4858-4877) | 5027 (4602-5451) | | iGPU H: slow-upload time, ms | 2573 (2453-2692) | 2807 (2796-2817) | 2848 (2832-2864), 890 from files | | iGPU H: files read / written, MB | - | 0 / 417 | 417 / 493 | | iGPU: VRAM by the driver, MB (F, H) | 4111, 4740 | 4074, 4820 | 3905, 4804 | | RTX: worst frame, ms | 339 (204-474) | 244 (239-250) | 735 (592-878) | | RTX: frames over 100 ms, total ms | 1110 (577-1644) | 1000 (993-1007) | 2904 (2649-3159) | | RTX: files read / written, MB | - | 0 / 2214 | 1316 / 1268 | Every run reached its teleport, with 0 warning lines. House load time (launch to map) is 21 to 23 s in every arm after the first run. Disk used by a filled cache: 0.5 GB per iGPU route, 2.2 GB on the RTX (forced). The old branch's numbers (iGPU, three-stop route, same GPU, before #2194): off 12.1 s of frames over 100 ms and a 2.7 s worst frame, warm 7.5 s and 1.3 s. Against them: here A's worst frame is already 1.0 to 2.0 s and its frames over 100 ms 4.5 to 6.3 s without the cache, so there is less left for it to remove, and the reads cost about what the decodes do. ## Risks - A wrong file would show a wrong texture until it is deleted. Guarded by the key (blocks hash, full shape, stamp), the header check, the payload's checksum, and the storage-unchanged check before a write; and checked in the game (0 differences in the reading passes of both GPUs above). - Off by default; `RX_VK_TEX_CACHE=0` forces it off, deleting `cache/textures/` is always safe. A revert is enough. - Disk: up to `RX_VK_TEX_CACHE_MB` (4096 MB) in the game folder's `cache/`, when it is on. Memory: read-backs waiting to be written hold at most 512 MB (256 below 16 GB of RAM). - Nothing changes for a player with it off. Turned on, no save or options file changes; a folder `cache/textures/` appears. A build whose shaders differ deletes the previous build's files at its first start (two builds sharing one game folder would delete each other's). - Integrated cost model: the decode seed (150 MB/s) is out of date for the fast decoder; with it on, the model reads files where the decode is now about as fast. It re-learns decode rates only from decodes that wait on their own chunks. To re-measure before any default-on. ## Checklist ### Ready for review - [x] One topic, on current `main`; the title is a Conventional Commit. (On current `main` since #2307 and #2314 merged.) - [x] Tested on my own PC, in the game for a change the game runs, as Testing says. - [x] `mise run test` passes (any failure that also fails on `main` is named). (The suite's three failures also fail on the base, named above.) - [x] Measured against `main`, or Measurements says why there is nothing to measure. - [x] No game files, build output or hand-edited generated files; `third_party/` untouched; nothing GPL-incompatible. ### When it applies - [x] A fix: a game-free test that fails on `main` and passes here. (Not a fix: a feature, off by default; its tests are game-free and in Testing.) - [x] A switch added or changed: it ships at the default the measurements chose, with its row in `gpu/vk/switches.def`. - [x] A check under `tests/` that reads changed source is updated, not weakened. - [x] `MKWVK_API_VERSION` bumped (`MkwVkHost` or `MkwVkRenderer` in `gpu/vk/vk_api.h` changed). (Not needed: `vk_api.h` is untouched.) - [x] The SPIR-V headers regenerated (a shader changed). (No shader changed.) - [ ] Host code builds on Windows (llvm-mingw) and Linux, with UTF-8 paths. (Linux only so far: not compiled for Windows, see Still to test.) - [x] Screenshots of the same spot on `main` and here, for a change that shows on screen. (Nothing shows on screen; the cache-off and cache-warm screenshots read the same.) - [x] Docs updated. - [x] AI assistance recorded with `Assisted-by:` / `Co-Authored-By:` trailers. ### Ready to merge - [ ] Everything in Still to test has run, its results in Tested. - [ ] Tier 1 hardware it can affect is tested (docs/dev/standards.md, "Hardware tiers"). - [ ] Approved in review, every comment answered. - [ ] CI passes on the head; on current `main`, measured again or a comment says why the numbers still hold.
Library only, not wired into vk_texture.cpp yet. astc.cpp is ocarina-recomp's tex_astc.c (from LAS Recomp, MIT) and
block_linear.cpp its tex_deswizzle.c (from MacNativeGames, MIT), in C++ with spans, bounds checks and error counts.
PROVENANCE.md and LICENSE-MIT say where each came from and what changed.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
The ASTC test decodes 3976 random blocks (both modes) and compares them with ARM's astcenc, error blocks included;
scripts/gen_texdecode_astc_vectors.py regenerates the vector file with an astcenc of your own. The swizzle test
round-trips 4325 layouts and checks hand-computed offsets. Both are registered by their RUN_ALL_ARGS line.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
Same time as texture_tiles::unswizzle on RGBA8 1024x1024 (0.066 vs 0.067 ms), 2.3x faster than suyu's; the output is
unchanged (143360 layouts agree with suyu byte for byte).

Co-Authored-By: Claude Fable 5.2 <[email protected]>
Co-Authored-By: Claude Fable 5.2 <[email protected]>
Off by default; suyu's path stays. Both switches go when it is deleted.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
Co-Authored-By: Claude Fable 5.2 <[email protected]>
Temporary measurement code in the same switch family; nothing is deleted or switched by default.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
deswizzle and swizzle multiplied row_bytes * h * d and the GOB offsets in 64 bits unchecked, and astc_decode multiplied
bx * by * depth and width * height * depth unchecked (and added bw to a u32 width): with absurd geometry the products
wrapped to a small number, the span checks passed on empty spans and the loops walked far outside them (ASan SEGV on the
review's two reproductions). Every product is now checked, bytes per block is limited to 16 (the widest NVN format) and the
strip loop counts in 64 bits. Width, height and depth need no cap of their own: any u32 is accepted when its byte counts fit
64 bits and the spans hold it, so no legal texture is refused. Decoded output is unchanged (all vectors and swizzle tests pass).

Tests: the two reproductions return false / -1 and write nothing, the largest 2D and 3D levels a GPU makes are counted exactly,
bpb 17 is refused. Run under -fsanitize=address,undefined as well.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
PROVENANCE.md no longer says the copy-loop split and the Switch 2 offset bits were made in a GPL repository: the files do not
say who made them. It records that ocarina-recomp's notices name TotK Recomp (MIT, Copyright (c) 2026 Valiantsin Dzerakh) as
the base of the repository and that the files cannot settle whether the two sources came through it (shallow clone, no
history), so LICENSE-MIT carries that notice too. It states ocarina-recomp's licence as its files state it (README: GPL-3.0;
notices: GPL-3.0-or-later for the DKB Recomp it descends from) and what that means for GPL-3.0-or-later here, and lists what
was not checked (the upstream LICENSE texts). "first-party" is gone from the files here; texdecode.h's header now says which
parts are this repository's own, as PROVENANCE.md does.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
ASTC vectors (scripts/texdecode_astc_gen.cpp, appended after the random ones from a seed of their own, astcenc 6.0.0 gives every
expected value): a void extent with low == high in s or t, one with wrong reserved bits, the 6x10 and 10x6 weight grids, block
modes whose weights take 97 to 100 bits. The 3D GOB order with tile height != tile depth is worked out by hand in
texdecode_swizzle_test.cpp. The random part of the file is unchanged byte for byte; the file is 169 KB and regenerates identically.
Each case kills a mutant the old tests let live (y-major GOB order, s0 > s1, no reserved-bits check, no 6x10 mode, weight bits
limit 97 to 100). The two docstrings name tests/test_texdecode_*.py now, not files that do not exist.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
The CPU ASTC decoder the renderer uses (suyu's) reads the spare bits after the colour endpoints'
integer sequence as part of the sequence's last, partial trit/quint group; astcenc and the spec
read the missing bits as zero. Where the spare bits are not zero (random blocks) one partition's
endpoints decode wrongly: up to 153 of 255 in a channel, mostly alpha. The test decodes eight
such random blocks and three controls through renderer_cpu_astc_decode and compares with
astcenc 6.0.0's answers (within one step, and exact).

run_all.py has no expected-failure marker, so the committed default decoder is texdecode's
(passes); --decoder suyu shows the fault on the current code.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
gpu/vk/host_shaders/astc_decode_port.comp is runtime/shaders/astc_decode.comp of ocarina-recomp
(https://github.com/sostenesfreitas/ocarina-recomp @ 406b3ae0321eff8dd083a607a8186aa56b52b873, sha256
6c4a7f59c558f1bef8134dbe6fe15ee42fd3d4ee5c4c06ca8469e03e0736707a), byte for byte: a GLSL port of LAS Recomp's ASTC LDR
decoder, the one gpu/vk/texdecode/astc.cpp is ported from. The next commit adapts it to Longshot's upload; this one keeps
the file as it came, so that diff is exactly what changed.

PROVENANCE.md beside it records where it is from and under what licence: GPL-3.0-or-later as taken from ocarina-recomp
(its README says "GPL-3.0"; its author confirmed "GPL 3 or later" to the project's owner on 2026-11-21), and the same file
in TotK Recomp (MIT, Copyright (c) 2026 Valiantsin Dzerakh; the same git blob, the same two commits by that author in both
histories), whose notice is kept with LAS Recomp's (MIT, Copyright (c) 2026 Peiikai).

The port is in commits of its own behind RX_VK_ASTC_GPU_PORT, so it can be backed out.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The ported shader (host_shaders/astc_decode_port.comp, ocarina-recomp @ 406b3ae0, the same file as TotK Recomp's: a GLSL port of
LAS Recomp's ASTC decoder, which texdecode is ported from) takes the place of Eden's in upload_astc_gpu when the switch is on.
Off by default while RX_VK_TEXDECODE_CHECK=3 proves it in the game; it goes when Eden's shader goes.

What the port needed, and nothing else (the diff against the previous commit is the shader's whole change, PROVENANCE.md
lists it):
- input: the shader reads the blocks where the upload staged them, in the Switch 2 block-linear layout (bl_index, from
  texdecode/block_linear.cpp, in 16-byte units), a layer's blocks layer_stride apart; a block past the level's bytes reads as
  zero (an error block) instead of past the bound range. No deswizzle pass, no copy.
- output: imageStore of the bytes into an R8G8B8A8_UINT view. An integer format stores the bits; a UNORM store of n/255 is
  exact only where the GPU rounds to nearest, which Vulkan recommends but does not require. R8G8B8A8_UINT storage is
  mandatory in Vulkan (checked anyway: Eden's decoder if a driver says no). The decoded textures are MUTABLE_FORMAT already;
  the BC scratches get MUTABLE_FORMAT and a UINT view, given back with them, only with the switch. No new device feature.
- tables: a const array in the shader, upstream's layout, made from texdecode's tables (no buffer, upload or binding).
- push constants and grid: astc_port.h (64 lanes a workgroup, up to 4 blocks of a block row), shared with the GPU test.
- the sRGB formats (NVN 0x87..0x94) decode in the sRGB mode; illegal blocks are magenta, as texdecode's.

Same staging, repack, chunking (RX_VK_ASTC_CHUNK_MPX), BC3/BC7 chain, read-back hooks and decline conditions. With the switch
off nothing changes but the view keys' code path. scripts/shaders.py host builds the header (glslang 16.6.0, vulkan1.1).
test_image_view_retry runs the UINT views' routes too; the chunking fixture stubs the switch off.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
tests/test_astc_port_gpu.py: in the suite (no GPU), the shader's table is texdecode's unquantization tables in the shader's
layout, its push constants are astc_port.h's Push field for field, and the harness compiles and checks astc_port.h's push
constants, grid and refusals. With --device (run_vulkan_fixtures.py on lavapipe, validation on; or a real GPU), the
checked-in SPIR-V decodes every block of texdecode_astc_vectors.vec in its footprint, linear and sRGB (9,388 decodes), against
astcenc's checksums, and 42 whole levels against texdecode: three layers with garbage between them, edge blocks clipped, GOB
blocks 1 to 8 GOBs high and 1 or 2 deep, and a level whose bytes end halfway though the binding goes on. The blocks are
swizzled with texdecode's swizzle; the image is R8G8B8A8_UNORM, MUTABLE_FORMAT, written through an R8G8B8A8_UINT view, as in
the renderer. Every texel must be equal.

Mutants of the shader it catches (each run on lavapipe): GOB x bits swapped, tile height ignored, tile depth ignored, GOB
columns miscounted, layer stride off, sRGB mode ignored, rounding +1, the short-binding guard removed. The fixture is the
fourth in run_vulkan_fixtures.py (its CI test counts four).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Measured on an RTX 4070 Ti against Eden's decoder (a scratch benchmark: 2048 x 2048 texels of astcenc-legal blocks from the
vector file, the same swizzled input, timestamps around the dispatch, median of 20): with one texel a lane the port took 1.4
to 1.5 times Eden's GPU time at 5x5, 6x6 and 8x5 (5x5 0.455 against 0.318 ms), the footprints the game uses most. Each warp's
fixed cost (the block's header, its integer sequences, the partition set-up) was shared by 32 texels where Eden's thread
shares it with a block's 25-64, and 6x6 and 8x5 left 24 to 28 of 64 lanes idle.

Now a block of 64 texels or fewer gets texels / 4 lanes (at least 4, for the endpoints) and a workgroup takes 64 / that many
blocks (up to 16; the shared arrays are 16 blocks deep, 6 KB). Over 64 texels nothing changes. Of 1, 2, 3 and 4 texels a lane,
4 was best or within 0.03 of best at every footprint: port / Eden 4x4 0.88, 5x4 0.98, 5x5 0.91, 6x5 0.72, 6x6 0.68, 8x5 0.64,
8x6 0.56, 8x8 0.42, 10x6 0.54; 10x8 to 12x12 0.49-0.82 as before.

The decode is unchanged: the lavapipe check passes bit for bit (9,388 vector decodes, 42 levels), and catches a shader whose
split no longer matches astc_port.h's grid. astc_port.h's blocks_per_group follows the shader.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
An all-zero ASTC block is an illegal one (a reserved block mode), and storage the game has not written yet is decoded
(upload_all_zero skips ASTC): texdecode wrote such a block opaque magenta, where main's decoders (suyu's on the CPU,
Eden's on the GPU) write transparent black. As decided for feat/texdecode-ported-cpu, the colour is a parameter of
astc_decode_block and astc_decode (Rgba8 error_color, default kErrorMagenta, astcenc's, for the library's astcenc tests);
texdecode.h and astc.cpp are that branch's files, byte for byte, and so is the test block added to texdecode_astc_test.cpp.
An HDR endpoint mode keeps magenta for its partition whatever the colour.

texdecode_use (RX_VK_TEXDECODE, RX_VK_TEXDECODE_CHECK) passes texdecode_use::kAstcErrorRgba, transparent black, so the CPU
route on this branch writes what the renderer's will and the GPU read-back check compares with the same colour. The
ported GPU decoder's colour follows in the next commit.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
astc_decode_port.comp wrote an error block (an illegal encoding, an HDR void extent) opaque magenta, as astcenc and the
ASTC specification do; Eden's decoder and main's CPU decoder write transparent black, and an all-zero block, which is
what storage the game has not written yet reads as, is an illegal one. The colour is now the push constant error_rgba
(astc_port.h: Push grows to 44 bytes, make() takes it, rgba() packs it, kErrorMagenta is astcenc's). upload_astc_gpu
pushes texdecode_use::kAstcErrorRgba, transparent black, the CPU route's colour, so RX_VK_TEXDECODE_CHECK=3 compares like
with like. A partition with an HDR endpoint mode stays magenta, as texdecode's CPU route has it whatever its error
colour (Eden's shader decoded HDR endpoint modes to half floats clamped to 0..1).

tests/test_astc_port_gpu.py on lavapipe: the astcenc vectors and the linear levels still in magenta; the sRGB levels and
the short binding in the renderer's colour against texdecode with the same colour; a new case of all-zero blocks, alone
and among legal ones, in both colours and both modes (32 levels). With the shader made to write magenta always, the sRGB
levels and the short bindings fail. The chunking fixture's texdecode_use stub gains the constant.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
host_shaders/deswizzle.comp unswizzles one 2D level of the Switch 2 block-linear (GOB) layout into an image level, every layer,
reading the storage where it is: written here from gpu/vk/texdecode/block_linear.cpp (gob_start, the GOB offset formula, copy_strip's
16-byte segments) and the address function astc_decode_port.comp's bl_index has, not from Eden's block_linear_unswizzle_2d.comp,
which it is to replace; only the interface upload_unswizzle_gpu gives both is the same (binding 0 the storage, binding 1 the level's
UINT storage view, 1 to 16 bytes a texel). An invocation takes one 16-byte segment of a GOB: one load, its 16 / bpb texels stored;
32 x 4 invocations are four GOBs one under the other; a segment holding no texel is not read. Its push constants, variant and grid
are deswizzle_gpu.h's, shared with the test. Not used yet: the next commit wires it behind a switch.

A storage image's format qualifier is fixed in SPIR-V, so the shader is built once a texel size (-DBPB=1..16: r8ui, r16ui, r32ui,
rg32ui, rgba32ui) into one header of five arrays: scripts/shaders.py host gains HOST_VARIANTS. With the formats declared it needs
no shaderStorageImageWriteWithoutFormat, and reading 32-bit words it needs no 8- or 16-bit storage buffer access (Eden's shader
declares StorageImageWriteWithoutFormat, StorageBuffer8BitAccess and StorageBuffer16BitAccess).

tests/test_deswizzle_gpu.py: in the suite, the push constants against deswizzle_gpu.h's Push, the workgroup against kGobsDown, the
five arrays in variant order, deswizzle_gpu.h on the CPU. On lavapipe (run_vulkan_fixtures.py, validation on): 50 layouts, 175
levels (1, 2, 4, 8, 16 bytes a texel; tile_h 0-5; partial GOBs and GOB blocks; 1 x 1; one and three layers; mip chains laid out
as the call site finds them, each level bound from its offset, small levels' blocks shrunk; random bytes) byte-equal to
texdecode::deswizzle through UINT views of MUTABLE_FORMAT images. Five mutations of the address (x and y bits swapped, the
block's GOB row dropped, a segment's last texel dropped, the layer stride dropped) each fail it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
upload_unswizzle_gpu takes the same textures as before (2D block-linear, 8 MB or more, not ASTC, BC or depth, 1 to 16 bytes a
texel), binds the same storage range and the same UINT storage views; with the switch it dispatches deswizzle.comp (the variant
for the texture's texel size, deswizzle_gpu.h's push constants and grid) instead of block_linear_unswizzle_2d.comp. unswizzle_ready
makes the five small pipelines in place of Eden's one, through the same pipeline cache, before the game (texture_pipelines_warm).
A level deswizzle_gpu::make refuses sends the texture to the CPU path, as any other refusal does. Off while RX_VK_TEXDECODE_CHECK=3
proves it in the game; goes when Eden's shader goes. switches.def gains the row.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
host_shaders/bc3_encoder.comp re-encodes the RGBA8 scratch into BC3 through the interface every re-encoder has in vk_texture.cpp
(binding 0 the scratch, binding 1 the output buffer, BcPush), written in this repository with the textbook methods as stb_dxt
(Fabian Giesen's public-domain/MIT stb_dxt.h) and J.M.P. van Waveren's "Real-Time DXT Compression" (2006) describe them; no code
taken from either or from any other encoder:
- colour, the four-colour block BC3 always decodes: a block of one colour takes, per channel, the 5- or 6-bit endpoint pair whose
  2/3 point is nearest the value (a 256-entry table, the smaller spread on a tie so decoders that round the 2/3 point differently
  agree: at most 1.33 and 0.67 off where plain quantization is 4 and 2 off); any other block the two ends of its texels' spread
  along the principal axis of their colours (power iteration), then up to twice the least-squares endpoints for the indices
  chosen, kept while the error falls; then the bounding box's diagonal turned to the colours' covariance and inset by 1/16, where
  that errs less; each texel the nearest of the four colours (its projection on their line);
- alpha: the eight-value block between the smallest and largest alpha, or, when the block holds 0 or 255, the six-value block
  between its other values with 0 and 255 exact, whichever errs less.

tests/test_bc3_encoder.py: in the suite, the one-colour table against the rule worked out in Python (--print-table makes it), the
push constants against BcPush, the harness's CPU BC3 decoder on a block made by hand. On lavapipe (run_vulkan_fixtures.py,
validation on): one-colour blocks of every value within 4/3, 2/3, 4/3 and alpha exact; two colours on the 5:6:5 grid and alpha
0/255 exact; alpha within half a step of the six- and eight-value ramps; a smooth gradient at 45.5 dB, above the plain bounding
box's 45.0; layers, edge clamping, out_offset and the four-colour order. Also passes on an AMD iGPU (RADV).

Wired behind a switch only if the measurement chooses it (the next commits compare it with Eden's, Longshot's BC7 and
ocarina-recomp's encoders on the game's textures).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
For the first decoded layer of every BC run in upload_astc_gpu, the scratch goes through four encoders: Eden's bc_encoder.comp
(today's), Longshot's bc7_encoder.comp, Longshot's own bc3_encoder.comp and ocarina-recomp's runtime/shaders/bc3_encode.comp
(@ 406b3ae0, sha256 ac318d35...8541, no licence line of its own, GPL-3.0-or-later by the project's README and its author's word;
adapted only to read the scratch image and take BcPush). Each result is copied into a BC3 or BC7 image and fetched back through
the texture unit (bc_check_fetch.comp, texelFetch packed to RGBA8), so it is compared as the GPU samples it; the input and the four
results are read back and compared on the CPU by NVN format: colour and alpha PSNR, the worst level and worst block, and the
blocks more than 1 dB worse than Eden's (a block's MSE floored at 0.25). Numbers in the log only. RX_VK_BC_ENCODER=own|ocarina
puts either BC3 encoder in Eden's place for timing runs. Both switches have rows marked temporary.

Measurement scaffolding: reverted once the re-encoder is chosen, so the branch keeps none of it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The measurement is done (Longshot/work/astcgpu, the design note's part 3): the check, its fetch shader, ocarina-recomp's candidate
encoder, RX_VK_BC_ENCODER and the two temporary switch rows go. Longshot's own BC3 encoder stays (its own commit); the next commit
wires it behind RX_VK_ASTC_BC3_OWN.

This reverts commit 0d9325aa99.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
bc_ready makes bc_pipe from host_shaders/bc3_encoder.comp (Longshot's, its own commit and test) instead of Eden's bc_encoder.comp
when the switch is on: the same BC3 format and memory, the same interface (scratch image, output buffer, BcPush) and dispatch, so
the run sizes, the small scratch, the AMD resized path (blitted into the second scratch, encoded from there) and RX_VK_ASTC_BC7
are as before. The log line says which encoder.

Chosen by measurement (the design note's part 3, Longshot/work/astcgpu): on the game's textures, read back through the texture unit
(the temporary RX_VK_BC_CHECK, 2,385 levels, 33.5 M blocks), colour 33.22 dB against Eden's 31.79, the worst level 23.93 against
22.35 and the worst block 16.24 against 14.95; alpha 54.88 against 54.80; 0.50% of blocks more than 1 dB worse than Eden's
(their MSE floored at 0.25). Timing, three interleaved rounds with the ported ASTC decoder: worst frame 200 (181-215) ms against
209 (206-417), Kokiri entry 45 against 54, Hyrule entry 125 against 126, frames over 100 ms 3 against 3; the astc spans' GPU time
265 (254-377) ms a route against 237. Longshot's BC7 encoder (10 times the GPU time, 1.37 s frames, alpha 8.6 dB worse) and
ocarina-recomp's BC3 encoder (no better than Eden's) were not taken. Off while it is proven; goes when Eden's encoder goes.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The note said every other shader in host_shaders/ is Eden's and Eglantine's; the folder now also holds Longshot's bc3_encoder.comp
and deswizzle.comp beside bc7_encoder.comp, each saying in its header what it was written from, and the three Eden/yuzu shaders
are the ones the switches replace.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
At one byte a texel deswizzle.comp gave an invocation a 16-byte segment and stored its 16 texels one by one: the 32 lanes of a
store wrote one byte each, 16 bytes apart across eight rows. The same workgroup (32 x 4) and grid now take another split there:
an invocation a 4-byte word of each of the workgroup's four GOBs, a warp's lanes along two GOB rows, so the lanes of a store write
neighbouring texels of one row. The word's place in the GOB is block_linear.cpp's offset formula over 4, as for the segments;
words past the row's end and rows past the level's are not read. Other texel sizes and deswizzle_gpu.h are unchanged.

Microbenchmark (scratch, RTX 4070 Ti, queue timing mode, 24 dispatches a side alternating, median; every output equal to
texdecode::deswizzle): 4096 x 4096 tile_h 4 Eden 0.192 ms, before 0.209 (1.09), now 0.060 (0.31); 4096 x 2048 0.098 / 0.107 /
0.032; 3000 x 2900 tile_h 3 0.102 / 0.112 / 0.033; 2048 x 2048 x 4 layers 0.192 / 0.208 / 0.060; 8192 x 8192 tile_h 5 0.971 /
0.818 / 0.291. Reachable through upload_unswizzle_gpu for NVN R8, R8SN, R8UI and R8I textures of 8 MB or more; the route's
read-back checks met none (bytes per texel 2 and 4 only).

tests/test_deswizzle_gpu.py on lavapipe and the RTX 4070 Ti: 50 layouts, 175 levels byte-equal (ten layouts at one byte a
texel, tile_h 0-5, partial GOBs, layers, mip chains, 1 x 1). Three mutations of the new path (a row bit of the word's offset
dropped, the fourth GOB skipped, a word's fourth texel dropped) each fail it. scripts/shaders.py host --check: the other headers
unchanged.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
tests/deswizzle_gpu_test.cpp, astc_port_gpu_test.cpp and bc3_encoder_gpu_test.cpp made, wrote and freed a host-visible memory
object for every case's input and read-back. On the AMD integrated GPU (RADV, Raphael, Mesa 26.0.8, Linux 7.0) that pattern
reads back wrong bytes while another process fills the GPU's memory: the cause of the deswizzle fixture's one failure in about
160 runs. Each case's buffers are now bound into one host-visible memory object made once (slot 0 the input, slot 1 the
read-back), as the renderer's buffers are placed in blocks it keeps. Every byte is still compared; nothing is retried.

Found with a scratch loop (not in the repository) beside a second process that allocates and fills 1.5 GB of device-local memory a
round (three times the APU's 512 MB carve-out):
- the deswizzle check in one process, 1,500 iterations a phase: shader 16 and 22 iterations with wrong bytes; the same with a plain
  buffer-to-image copy in the shader's place (no shader) 30; memory made once 0 and 0 (copy 0); images' memory once but buffers'
  per case 48; buffers' once but images' per case 0. Alone: 0 of 1,500, and 0 of 4,609 process runs (the 4,610th failed as a
  game started on the same GPU). Wrong bytes: zeros in 64-byte runs (16 per segment of input), never the clear value or the
  read-back's sentinel. Khronos validation, synchronisation validation and GPU-assisted validation clean (their negative
  controls fire on RADV and lavapipe); lavapipe 5,000 shuffled iterations clean.
- the fixtures as process runs beside the same stressor: deswizzle 69 of 2,000 failed as they were, 3 of 2,000 with this change;
  ASTC port 4 and 2 of 300; BC3 0 and 0 of 300. So this narrows the driver's window; it does not close it.

The shader is not the cause (the copy-only control fails as often); the fixtures' Vulkan use is valid (validation clean). The
renderer's uploads read guest memory imports and staging arenas it keeps, not a memory object a dispatch.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The first piece of a disk cache for decoded ASTC (the final BC3, BC7 or RGBA8 image the GPU route makes), with no Vulkan and no
files, so that a check can run every rule:
- the key: XXH64 of the blocks' hash (reuse_upload's, of the whole storage), the shape and the producer stamp. The shape holds more
  than astc_reuse::Shape: level_geo and upload_astc_gpu read the descriptor's size and levels before the top levels left out, its
  layer stride, its tiles and the storage's size, so those are folded too;
- the producer stamp: the format number, then the decoder's and encoders' SPIR-V words and the error colour as pieces (fed by the
  renderer); not the GPU, driver or translator stamp;
- the file: a 160-byte header (magic, format, stamp, key, blocks hash, payload size and checksum, the shape's 24 words), then the
  payload level after level, each level's layers packed; decode() refuses a short file, another magic, format, stamp, key or
  shape, and a size that is not the shape's; the checksum is the chained XXH64 of 4 MiB pieces, so a reader checks as it reads;
- the copies: a region a level, rows and layers given in whole blocks (#2015's rule), and a layer a region for a multi-layer BC
  level whose extent is not a multiple of 4 (PR 2228's AMD Windows bug; here on every driver, the safe superset);
- the size: 8192 MB by default, no more than a tenth of the free space counted with the folder's own files, at least 1 GB;
  writes stop below 10 GB or a twentieth of the disk free; at the start other stamps' files go first, the oldest first, then
  this stamp's least recently used, down to nine tenths;
- the cost model: a read is taken only when it costs under half the decode (seeds 150 MB/s for an integrated GPU's decode,
  3 GB/s for a discrete one's, 500 MB/s and 1 ms for a read; learnt a quarter of the way per sample), and a texture is written
  only when the same rule would read it; unset, the cache is on for integrated GPUs only.

tests/test_tex_cache.py: payload sizes for BC3 1365 x 1365 x 90 and 683 x 683 x 90 (no level a multiple of 4), BC1, RGBA8 with a
2048 x 2 twelve-level tail and 1 x 1 levels, worked out texel row by texel row; regions cover the payload once, in whole blocks,
split exactly where they should; every shape field changes the key; each header refusal; eviction order; the size rules; the
cost model's decisions. Eight mutations of the header each fail it (g++ and clang++).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The store under the rules of tex_cache.h, still with no Vulkan (nothing calls it yet):
- open() starts two threads at background priority (Windows: THREAD_MODE_BACKGROUND_BEGIN; Linux: the idle I/O class and nice
  10). The index thread makes <dir>/<stamp>/, lists every stamp's files, deletes another run's temporary files older than an hour,
  works out the cap (cap_bytes, with the disk's free space) and deletes the files over it (other stamps' first), then publishes
  the index. Until then every lookup misses and no file is opened;
- write() queues a payload (its memory the caller's until written() gives its cookie back), refused when the index is not listed,
  the key is known or queued, or the folder would pass its cap (other stamps' files counted); the writer refuses it below the
  disk's floor, writes header + payload to <key>.ltc.tmp-<process>-<n> and renames it, then indexes it;
- read() is the caller's, on its own thread: the header checked against the stamp, key, blocks and shape asked for and the file's
  size, the payload read through a 4 MiB buffer of the thread's (the destination may be write-combined staging memory, which
  must not be read back), its checksum checked piece by piece (RX_VK_TEX_CACHE_VERIFY will turn that off). A bad file is taken out
  of the index and the writer deletes it;
- touch() makes a read file's time now (the eviction's order); counters() for the renderer's log line; close() stops both threads,
  waiting a bounded time.
Paths are std::filesystem paths (wide on Windows: _wfopen, MoveFileExW through std::filesystem::rename); names are ASCII.

tests/tex_cache_store_test.cpp (run by test_tex_cache.py on a temporary folder): three files written, found, read back byte for
byte (one over 4 MiB); a changed byte refused by the checksum and the file deleted; a header naming another shape refused; touch;
a later start listing what is left; another stamp listing nothing of it; the eviction at a 40 MB and a 5 MB cap (the oldest of
other stamps' files first, only as many as needed, then this stamp's least recently used, emptied folders removed); a stale
temporary file deleted and a fresh one kept; a write past the cap refused; the check off reading a changed byte as it is.
g++ and clang++; clean under ThreadSanitizer and Address/UndefinedBehaviorSanitizer. Not compiled for Windows here (no llvm-mingw
on this PC).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The hooks of the disk texture cache (tex_cache.h, tex_cache.cpp) in vk_texture.cpp:
- upload_inner: the memory generation taken before the blocks are hashed; after reuse_upload (which hashes every first whole
  upload of decoded ASTC), tex_cache_fill: the shape and key, a lookup in the index (no file is opened on a miss), the cost model,
  the file read into staging through the store's buffer, one vkCmdCopyBufferToImage with a region a level (whole-block row
  length and image height, #2015's rule) and a layer a region where a multi-layer BC level is not a multiple of 4 (PR 2228's AMD
  Windows rule, on every driver); a bad file goes and the texture is decoded as before. A new route, "from the disk cache", in
  the frame's upload line (UP_CACHE);
- after upload_astc_gpu succeeds on a first whole upload, tex_cache_capture: where the cache takes the texture (2D, single-sample,
  not sparse, not a resized BC image, from 64 KB of storage, not in a virtual pool), has no file of it and the cost model would
  read one, the final image is read back (the same regions, into host-cached memory of its own, within 512 MB held beside 16 GB
  of RAM, else 256). It also learns the decode's rate from a texture whose decode waited on chunks of its own;
- texture_frame, after completed_value: tex_cache_frame hands a read-back whose recording is done, two presents on, to the writer
  only if no page of its storage was written since the generation taken before its hash (else its image may not be its blocks');
  frees what the writer is done with; logs the counts every 600 presents. mkwvk_close_asked logs them at close and stops the
  writer after the file it is writing;
- the stamp: which decoder and BC3 encoder are in use and their SPIR-V words (BUILTIN_SPV, so RX_VK_SHADER_DIR's too), BC7's when
  on, the illegal block's colour, the sRGB formats' range. Opened at texture_pipelines_warm (else at the first upload).

Switches (switches.def): RX_VK_TEX_CACHE (hw: unset on for integrated GPUs only, tex_cache::default_on, decided at the site; 0 off,
1 on with the cost model, 2 every texture without it), RX_VK_TEX_CACHE_MB (8192), RX_VK_TEX_CACHE_DIR (the game folder's
cache/textures; never from longshot_env.txt), RX_VK_TEX_CACHE_VERIFY (on), RX_VK_TEX_CACHE_CHECK (temporary: a hit is copied,
read back, decoded over and read back again, both compared with the file byte for byte; every texture written). With
RX_VK_TEXDECODE_CHECK the cache reads nothing. docs/dev/reference/switches.md (Memory) and architecture.md (cache/textures/, made
from the game: never leaves the PC); vk_bug_report.cpp says it gathers logs/ only.

tests/test_tex_cache.py now also checks the wiring: the order in upload_inner (generation, reuse, fill, decode, capture of a first
whole upload only), no fill with RX_VK_TEXDECODE_CHECK, the copies from tex_cache::regions both ways, the read-backs finished after
completed_value and checked against the storage's writes, the close hook. vk_texture.cpp, vk_main.cpp and tex_cache.cpp compiled
with the build's own clang flags (no new warning with -Wall -Wextra).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
tests/test_tex_cache_gpu.py cuts tc_copies out of vk_texture.cpp and compiles it, with the store (tex_cache.cpp), into
tests/tex_cache_gpu_test.cpp. On a device, for each shape: synthetic ASTC (the vector file's astcenc blocks, swizzled as the game's
storage, GOB heights 1 to 16) decoded level by level by the ported decoder straight into an RGBA8 image, or into a scratch and
re-encoded by Longshot's BC3 encoder into a BC3 image, as the renderer's GPU route does; then
1. the image captured with tc_copies must equal its layers read back by the driver's own tightly packed copies (row length 0, a
   layer a region), concatenated level after level: the payload's layout, by a rule other than tex_cache.h's;
2. the capture written as a file by the store, the store closed and opened again, and the file read back (at a staging offset of
   256) must be the capture;
3. a fresh image given garbage first (plain copies of 0xA5), then the file's payload with tc_copies, must read back as the first.
Shapes: BC3 1365 x 1365 x 3 (11 levels, none a multiple of 4: 33 regions of a layer), BC3 683 x 683 x 1, RGBA8 683 x 683 x 3, RGBA8
1365 x 1365 x 1; every chain down to 1 x 1. Without a device the CPU part checks the shapes' regions (the suite).

Passes with validation on lavapipe (2.8 s), the RTX 4070 Ti (NVIDIA 580) and the Raphael iGPU (RADV, Mesa 26.0.8). Three mutations
of tc_copies fail it: the row length as the level's width (the CPU part), a layer's offset off by a block (the CPU part), every
region at layer 0 (the GPU part: the capture and the fill differ). run_vulkan_fixtures.py runs it (seven fixtures; 6 pass on this
PC, test_present_aspect_vulkan.py failing as before: -lvulkan is not installed); test_vulkan_fixtures_ci.py's counts follow.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
A CHECK run on the RTX 4070 Ti (hyrule-field, the second pass) did not stop within gamerun's 15 s after its close hooks had run: the
writer had been writing at 17 MB/s (198 MB in 11.5 s, the disk busy with other jobs and swap) and was inside one fwrite of a whole
payload, up to 224 MB, when the game closed; a process cannot end while one of its threads is in a write. And in the idle I/O class
(IOPRIO_CLASS_IDLE) a writer can wait without end under another program's steady I/O.
- the payload is written in 4 MiB pieces; close() sets a flag the writer checks between them, and an unfinished file is deleted
  (a file is still whole or not there);
- Linux: the best-effort class's lowest level (and nice 10) instead of the idle class. Windows keeps background mode.
tests/tex_cache_store_test.cpp: a close while a 256 MB file is written returns within its wait (5-300 ms here) and leaves no
temporary file and no file cut short (the leaving itself needs a slow disk to be seen; this checks what it must keep). g++,
clang++, ThreadSanitizer clean.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
tests/test_astc_gpu_colour_tail.py cuts vk_texture.cpp's AstcPush and the lines of upload_astc_gpu that fill it into
tests/astc_gpu_colour_tail_test.cpp, with suyu's astc.cpp (the shader's source) and texdecode. Blocks: one partition, a 4 x 4
weight grid, every legal weight range but 4- and 5-bit plain weights, CEM 12, 8 and 4, the other bits seeded random. The CPU part
(the suite) checks that texdecode takes every class as a legal block and that three classes end in a partial trit group whose
whole-group reads cross into a 32-bit word of color_endpoint_data the colour data never filled. With --device: 64 x 64 blocks in
4x4, 6x6 and 8x8 footprints, swizzled as the game's storage, decoded four times with the renderer's push constants and grid;
every texel within one step of suyu's DecompressSerial and equal to the first decode.

On this head (the shader declares color_endpoint_data without an initializer and writes only the words the colour data fills):
Raphael iGPU (RADV, Mesa 26.0.8) FAIL, 2,649 of 1,900,544 texels off suyu's and 4,225 differing from the first decode of the same
blocks; RTX 4070 Ti (NVIDIA 580) FAIL, 2,852 off, 0 differing (the same wrong values every run); lavapipe PASS (it reads the words
as zero). Only the three crossing classes fail. This is the in-game RX_VK_TEX_CACHE_CHECK=1 failure on the iGPU: a fresh decode
differing from the cache file written by an earlier one. 4- and 5-bit plain weights are left out because the shader unquantizes
them as round(v * 64 / (2^n - 1)), not by suyu's and the specification's bit replication: up to 3 steps off whatever the colour
bits (a fault of its own, not fixed here). run_vulkan_fixtures.py runs it; test_vulkan_fixtures_ci.py's counts follow.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
fix(vk): Eden's GPU ASTC decoder zeroes color_endpoint_data first: a partial last colour group no longer reads registers
Some checks failed
Website / Website on Cloudflare (pull_request_target) Has been skipped
PR description / Description follows the template (pull_request_target) Successful in 5s
CI / Conventional Commit title (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been cancelled
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been cancelled
CI / Workflow lint (actionlint) (pull_request) Has been cancelled
CI / Website build and checks (pull_request) Has been cancelled
Guide screenshots / Guide images and local UI source review (pull_request) Has been cancelled
Third-party parts / As their notes say (pull_request) Has been cancelled
Third-party parts / The same as upstream (pull_request) Has been cancelled
Website / Website on Cloudflare (pull_request) Has been cancelled
0fec7986a3
astc_decoder.comp declared `uvec4 color_endpoint_data;` without an initializer and wrote only the words the colour data fills;
DecodeTritBlock and DecodeQuintBlock read a partial last group whole, so where those reads crossed into a word the loop never
reached, the missing values' bits (zero in suyu's decoder, the shader's source, and in the specification) were whatever the
register held. The trit or quint of the sequence's last values (alpha's endpoints for CEM 12, blue's for CEM 8) then changed by
a step: 3 to 6 apart at 4- and 5-bit quantization. On the Raphael iGPU (RADV, Mesa 26.0.8) the value changed from dispatch to
dispatch, alone on the GPU too; on the RTX 4070 Ti (NVIDIA 580) it was wrong the same way every time; lavapipe reads zero.

That is the iGPU's RX_VK_TEX_CACHE_CHECK=1 failure on 0df7c3e2: a fresh decode differed from the file an earlier decode wrote in
40-60% of compared textures, by a few bytes to ~10,000 of 2-224 MB, near values, alpha first in the RGBA8 ones (the file read back
always equal to the file). A repeat-decode harness over the in-game SPIR-V (work/texcache/diag) decoded the same blocks 8 times:
on RADV every repeat differed from the first, in every footprint 4x4 to 12x12, astcenc vectors and random blocks; zeroed, 0 of 7
differed anywhere. main's #2194 (658e5f2b) made the same fix inside its rewrite of the shader; this is that one line alone, for
this branch's base. The producer stamp hashes the decoder's SPIR-V, so cache files made before this are another stamp's.

tests/test_astc_gpu_colour_tail.py --device: before FAIL on RADV (2,649 texels off suyu's, 4,225 differing between decodes) and on
NVIDIA (2,852 off), PASS on lavapipe; after PASS on all three. scripts/shaders.py host --check: 7 match (glslang 16.6.0, the
version the headers were made with); only astc_decoder_comp_spv.h changed.

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

Tested in game: Linux 7.0, AMD Raphael iGPU (RADV, Mesa 26.0.8, 1280x720) and RTX 4070 Ti (NVIDIA 595.99.02): with RX_VK_TEX_CACHE_CHECK=1 every cache hit decoded again and compared: iGPU at 0fec7986a, Kokiri Forest and Hyrule Field two passes, 0 differences (374 and 454 decodes in pass 2); RTX at c184bc28e, Link's house, Kokiri Forest, Hyrule Field two passes, 0 differences. Measurements still running. Stacked on the unopened texture decoding series.

Tested in game: Linux 7.0, AMD Raphael iGPU (RADV, Mesa 26.0.8, 1280x720) and RTX 4070 Ti (NVIDIA 595.99.02): with RX_VK_TEX_CACHE_CHECK=1 every cache hit decoded again and compared: iGPU at 0fec7986a, Kokiri Forest and Hyrule Field two passes, 0 differences (374 and 454 decodes in pass 2); RTX at c184bc28e, Link's house, Kokiri Forest, Hyrule Field two passes, 0 differences. Measurements still running. Stacked on the unopened texture decoding series.
Member

Deck LCD data for this idea, from an independent implementation, plus an offer to run this branch itself once it's rebased.

Context: this is the Deck LCD bench from the emulation campaign. Last week we built our own minimal version of the same cache before finding this PR: the finished converted image, keyed by the reuse_upload XXH64 plus shape, written to cache/bc3 by a writer thread, read back with one vkCmdCopyBufferToImage when in-session reuse misses (RX_VK_BC3_DISK=1, ~230 lines, one file). Reading tex_cache.h afterwards: your design matches ours where it counts and is stricter everywhere ours is thin. The stamp especially — see finding 2.

Deck LCD numbers. Hardware: Steam Deck LCD (Vangogh, 16 GB LPDDR5, stock carve-out). Scene: Castle Town, scripted walk-and-turn from a save at Castle Market, 20 cycles, RX_VK_FRAME_LOG per arm, hitch = a frame over 60 ms. Against v3.1.1 stock, warm cache: hitches >60 ms −38%, >150 ms −83%, slow-frame seconds −62%, staged MB −51%, 1% low +29%; cold run no worse than stock.

The number the repo still needs, and which decides how this ships: does the disk cache still pay after #2194's 5.3x decode speedup? Your RTX arms show the cost model correctly going inert there. We put #2194's merged commit on the same base and re-ran:

arm >60 ms >150 ms slow-frame s staged MB 1% low mean fps
control, cache off (two boots) 251 / 306 30 / 11 33.7 / 25.7 3869 / 3811 13.3 / 13.0 40.3 / 38.9
warm cache 161 8 14.6 1506 15.4 42.9
cold cache 187 12 21.9 2187 14.4 41.2
upgrade: files written by the pre-#2194 decoder, read by the new one 161 13 17.6 1516 15.5 39.8

On Vangogh the cache still wins clearly after the fast decoder: −42% hitches, −51% slow-frame seconds, −61% bytes staged. The biggest single hitches improved less than pre-#2194 (the fast decode eats part of it), but count, seconds and bytes hold. I'd expect your learned read rate to sit well above the 500 MB/s seed on this hardware, for the reason in finding 1.

A human minute too: 62 minutes of normal free play, warm cache, 94k frames — 1.37% of frames over 60 ms, 0.067% over 150 ms, 5,057 uploads (2.9 GB) served from file, zero failures.

Two findings that bear on the design.

  1. On Deck, the "disk" cache is already a RAM cache: warm hits read through the Linux page cache and cost about a memcpy. On Linux integrated GPUs an explicit second RAM tier mostly re-stores the same bytes in the same LPDDR5 with a double copy. Where a RAM tier earns its keep is #2273's case — bytes the VRAM budget evicted mid-session, before anything reached a file. Different bug class; worth keeping out of this cache's path.

  2. The producer stamp is not paranoia; we proved the scenario and our un-stamped key passed it only by luck of the check. The upgrade arm fed pre-#2194 files to the post-#2194 decoder: 1,600+ hits, zero header failures, screenshots clean — but that only shows the checks passed, not that shader-changed bytes were right. Please keep the stamp through the rebase; we're adding one to our branch before it ships anywhere.

Eviction. Our pilot has none, and its folder reached 996 MB after one day of test runs plus an hour of play, untrimmed, so take this from the "it's needed" side. One observation before anyone reaches for least-frequently-used: on the Castle route, every file the cache held was read at least once by the next session — frequency only starts to separate from recency on big caches with long-tail areas. Your stamp-first, then least-recently-read order is a reasonable default; if you want the hit-distribution data that actually decides LRU vs LFU, we can instrument the bench to log per-file counts across normal play.

Offer. When this rebases onto main (once the series beneath settles), we'll run it on this Deck LCD: the Castle arms cold/warm/upgrade, with traces. The description lists Deck among the untested hardware, and the Deck is where the on-by-default-for-integrated claim actually lives.

Deck LCD data for this idea, from an independent implementation, plus an offer to run this branch itself once it's rebased. Context: this is the Deck LCD bench from the emulation campaign. Last week we built our own minimal version of the same cache before finding this PR: the finished converted image, keyed by the `reuse_upload` XXH64 plus shape, written to `cache/bc3` by a writer thread, read back with one `vkCmdCopyBufferToImage` when in-session reuse misses (`RX_VK_BC3_DISK=1`, ~230 lines, one file). Reading `tex_cache.h` afterwards: your design matches ours where it counts and is stricter everywhere ours is thin. The stamp especially — see finding 2. **Deck LCD numbers.** Hardware: Steam Deck LCD (Vangogh, 16 GB LPDDR5, stock carve-out). Scene: Castle Town, scripted walk-and-turn from a save at Castle Market, 20 cycles, `RX_VK_FRAME_LOG` per arm, hitch = a frame over 60 ms. Against v3.1.1 stock, warm cache: hitches >60 ms −38%, >150 ms −83%, slow-frame seconds −62%, staged MB −51%, 1% low +29%; cold run no worse than stock. The number the repo still needs, and which decides how this ships: **does the disk cache still pay after #2194's 5.3x decode speedup?** Your RTX arms show the cost model correctly going inert there. We put #2194's merged commit on the same base and re-ran: | arm | >60 ms | >150 ms | slow-frame s | staged MB | 1% low | mean fps | |---|---|---|---|---|---|---| | control, cache off (two boots) | 251 / 306 | 30 / 11 | 33.7 / 25.7 | 3869 / 3811 | 13.3 / 13.0 | 40.3 / 38.9 | | warm cache | 161 | 8 | 14.6 | 1506 | 15.4 | 42.9 | | cold cache | 187 | 12 | 21.9 | 2187 | 14.4 | 41.2 | | upgrade: files written by the pre-#2194 decoder, read by the new one | 161 | 13 | 17.6 | 1516 | 15.5 | 39.8 | On Vangogh the cache still wins clearly after the fast decoder: −42% hitches, −51% slow-frame seconds, −61% bytes staged. The biggest single hitches improved less than pre-#2194 (the fast decode eats part of it), but count, seconds and bytes hold. I'd expect your learned read rate to sit well above the 500 MB/s seed on this hardware, for the reason in finding 1. A human minute too: 62 minutes of normal free play, warm cache, 94k frames — 1.37% of frames over 60 ms, 0.067% over 150 ms, 5,057 uploads (2.9 GB) served from file, zero failures. **Two findings that bear on the design.** 1. On Deck, the "disk" cache is already a RAM cache: warm hits read through the Linux page cache and cost about a memcpy. On Linux integrated GPUs an explicit second RAM tier mostly re-stores the same bytes in the same LPDDR5 with a double copy. Where a RAM tier earns its keep is #2273's case — bytes the VRAM budget evicted mid-session, before anything reached a file. Different bug class; worth keeping out of this cache's path. 2. The producer stamp is not paranoia; we proved the scenario and our un-stamped key passed it only by luck of the check. The upgrade arm fed pre-#2194 files to the post-#2194 decoder: 1,600+ hits, zero header failures, screenshots clean — but that only shows the checks passed, not that shader-changed bytes were right. Please keep the stamp through the rebase; we're adding one to our branch before it ships anywhere. **Eviction.** Our pilot has none, and its folder reached 996 MB after one day of test runs plus an hour of play, untrimmed, so take this from the "it's needed" side. One observation before anyone reaches for least-frequently-used: on the Castle route, every file the cache held was read at least once by the next session — frequency only starts to separate from recency on big caches with long-tail areas. Your stamp-first, then least-recently-read order is a reasonable default; if you want the hit-distribution data that actually decides LRU vs LFU, we can instrument the bench to log per-file counts across normal play. **Offer.** When this rebases onto main (once the series beneath settles), we'll run it on this Deck LCD: the Castle arms cold/warm/upgrade, with traces. The description lists Deck among the untested hardware, and the Deck is where the on-by-default-for-integrated claim actually lives.
TrashPanda force-pushed feat/tex-disk-cache from 0fec7986a3
Some checks failed
Website / Website on Cloudflare (pull_request_target) Has been skipped
PR description / Description follows the template (pull_request_target) Successful in 5s
CI / Conventional Commit title (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been cancelled
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been cancelled
CI / Workflow lint (actionlint) (pull_request) Has been cancelled
CI / Website build and checks (pull_request) Has been cancelled
Guide screenshots / Guide images and local UI source review (pull_request) Has been cancelled
Third-party parts / As their notes say (pull_request) Has been cancelled
Third-party parts / The same as upstream (pull_request) Has been cancelled
Website / Website on Cloudflare (pull_request) Has been cancelled
to ceb46c5138
Some checks failed
PR description / Description follows the template (pull_request_target) Failing after 2m56s
CI / Conventional Commit title (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been cancelled
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been cancelled
CI / Workflow lint (actionlint) (pull_request) Has been cancelled
CI / Website build and checks (pull_request) Has been cancelled
Guide screenshots / Guide images and local UI source review (pull_request) Has been cancelled
Third-party parts / As their notes say (pull_request) Has been cancelled
Third-party parts / The same as upstream (pull_request) Has been cancelled
Website / Website on Cloudflare (pull_request) Has been cancelled
2026-11-23 15:34:58 +00:00
Compare
Author
Contributor

Thank you, omgitsgela: the Deck run, the "an hour of play with zero failures", and above all feeding files from the old decoder to the new one. That test is what found the gap. Here is what changed in answer to each point.

Rebased, and where. The branch is rebuilt, not rebased: the first version was pushed from a private development branch, so most of its 35 commits were not the cache at all (a texel read-back harness, three experimental switches, a ported decoder and encoder that are not offered, and a file of another project). That was a mistake in how I pushed it. The branch is now three commits (the cache's rules and store, the wiring, a GPU test) on top of #2314's head (fix/astc-gpu-exact, 511dd4049, which is on #2307). It is stacked there on purpose: the cache stores what the decoder produces, and #2314 defines the correct output (it moves about 18% of texels by a step and decodes sRGB formats in the sRGB mode), so files made before it are stale by definition.

Producer stamp. Done. The stamp folds the cache format, the generated SPIR-V of the ASTC decoder and of the BC encoder (BC7's when on) and the rule that picks the decode mode, so any shader change invalidates by itself. It is in the key (a stale file is unreachable, not just detected), in the header, and in the folder name. A game-free test changes each component and checks the stamp moves. I ran your upgrade scenario for real on the RTX: a folder filled with main's decoder from before #2314, then the new build on it: 168 files (950 MB) of the other stamp deleted at start, 0 read, then its own fill.

Eviction. The stale files go at start-up, whatever the size; this stamp's files go least recently read first when over a cap, down to 90% of it, also only at start-up, never on the upload path. The cap is RX_VK_TEX_CACHE_MB, now 4096 MB (it was 8192): a three-area route is 1.5 to 2 GB on my PC and your day was about 1 GB. Since every file was read at least once on your route, the cap is what bounds it; an LRU alone could not.

RAM tier. None, following your finding about the page cache on Linux integrated GPUs. I left Windows as an open question in the description.

Default. The title no longer says "on by default". On my Raphael iGPU, on top of #2194's decoder and #2314, a warm cache gains no more than the run-to-run spread (frames over 100 ms 6.3 s off against 5.3 s warm in Kokiri Forest, 4.5 s against 5.0 s in Hyrule Field; file reads about 380 MB/s against a decode of about 500 MB/s), so it ships off. That is the opposite of what you saw on the Deck, so your numbers are the ones that matter. Checked in the game, both GPUs, every texture served from a file against a fresh decode, byte for byte: 0 differences (about 250 to 380 textures a scene).

Ask. Could you rerun your Deck test on this branch (head ceb46c513, on top of #2314), with RX_VK_TEX_CACHE=1? If it still shows the 42% and 51%, the default goes back on for integrated GPUs and the cost model's decode seed gets re-measured on your numbers. The full write-up is in the updated description.

Thank you, omgitsgela: the Deck run, the "an hour of play with zero failures", and above all feeding files from the old decoder to the new one. That test is what found the gap. Here is what changed in answer to each point. **Rebased, and where.** The branch is rebuilt, not rebased: the first version was pushed from a private development branch, so most of its 35 commits were not the cache at all (a texel read-back harness, three experimental switches, a ported decoder and encoder that are not offered, and a file of another project). That was a mistake in how I pushed it. The branch is now three commits (the cache's rules and store, the wiring, a GPU test) on top of #2314's head (`fix/astc-gpu-exact`, 511dd4049, which is on #2307). It is stacked there on purpose: the cache stores what the decoder produces, and #2314 defines the correct output (it moves about 18% of texels by a step and decodes sRGB formats in the sRGB mode), so files made before it are stale by definition. **Producer stamp.** Done. The stamp folds the cache format, the generated SPIR-V of the ASTC decoder and of the BC encoder (BC7's when on) and the rule that picks the decode mode, so any shader change invalidates by itself. It is in the key (a stale file is unreachable, not just detected), in the header, and in the folder name. A game-free test changes each component and checks the stamp moves. I ran your upgrade scenario for real on the RTX: a folder filled with main's decoder from before #2314, then the new build on it: 168 files (950 MB) of the other stamp deleted at start, 0 read, then its own fill. **Eviction.** The stale files go at start-up, whatever the size; this stamp's files go least recently read first when over a cap, down to 90% of it, also only at start-up, never on the upload path. The cap is `RX_VK_TEX_CACHE_MB`, now 4096 MB (it was 8192): a three-area route is 1.5 to 2 GB on my PC and your day was about 1 GB. Since every file was read at least once on your route, the cap is what bounds it; an LRU alone could not. **RAM tier.** None, following your finding about the page cache on Linux integrated GPUs. I left Windows as an open question in the description. **Default.** The title no longer says "on by default". On my Raphael iGPU, on top of #2194's decoder and #2314, a warm cache gains no more than the run-to-run spread (frames over 100 ms 6.3 s off against 5.3 s warm in Kokiri Forest, 4.5 s against 5.0 s in Hyrule Field; file reads about 380 MB/s against a decode of about 500 MB/s), so it ships off. That is the opposite of what you saw on the Deck, so your numbers are the ones that matter. Checked in the game, both GPUs, every texture served from a file against a fresh decode, byte for byte: 0 differences (about 250 to 380 textures a scene). **Ask.** Could you rerun your Deck test on this branch (head ceb46c513, on top of #2314), with `RX_VK_TEX_CACHE=1`? If it still shows the 42% and 51%, the default goes back on for integrated GPUs and the cost model's decode seed gets re-measured on your numbers. The full write-up is in the updated description.
TrashPanda changed title from WIP: feat(vk): a disk cache of decoded ASTC textures, on by default for integrated GPUs (RX_VK_TEX_CACHE) to WIP: feat(vk): a disk cache of decoded ASTC textures (RX_VK_TEX_CACHE, off by default) 2026-11-23 15:35:16 +00:00
TrashPanda force-pushed feat/tex-disk-cache from ceb46c5138
Some checks failed
PR description / Description follows the template (pull_request_target) Failing after 2m56s
CI / Conventional Commit title (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been cancelled
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been cancelled
CI / Workflow lint (actionlint) (pull_request) Has been cancelled
CI / Website build and checks (pull_request) Has been cancelled
Guide screenshots / Guide images and local UI source review (pull_request) Has been cancelled
Third-party parts / As their notes say (pull_request) Has been cancelled
Third-party parts / The same as upstream (pull_request) Has been cancelled
Website / Website on Cloudflare (pull_request) Has been cancelled
to 679e25d900
Some checks reported errors
CI / Workflow lint (actionlint) (pull_request) Blocked by required conditions
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Blocked by required conditions
CI / Conventional Commit title (pull_request) Blocked by required conditions
Third-party parts / The same as upstream (pull_request) Blocked by required conditions
CI / Python source checks (ubuntu-24.04, part 1/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
Website / Website on Cloudflare (pull_request) Blocked by required conditions
CI / Website build and checks (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
PR description / Description follows the template (pull_request_target) Successful in 22s
Website / Website on Cloudflare (pull_request_target) Has been skipped
beanstalk/approval approved by HumanBean (reviewed)
beanstalk/nvidia 1/1 fail
beanstalk/linux+radv 1/1 fail
beanstalk/intel 0/1 pass, 2 error
Website / Website builds (pull_request_target) Has been skipped
Website / Website preview, build (pull_request_target) Has been skipped
Website / Website preview, upload (pull_request_target) Has been skipped
beanstalk/windows+amd 1/1 pass
beanstalk/steamdeck 1/1 fail
beanstalk/igpu 1/1 fail
2026-11-23 16:14:17 +00:00
Compare
Author
Contributor

Rebased straight onto main now that #2307 and #2314 have merged: the same three commits, no conflicts, head 679e25d90. The pull request is no longer stacked and shows only its own 16 files. The game-free cache test and the switch table check were rerun after the rebase and pass; the in-game measurements in the description were taken at the previous head.

Rebased straight onto `main` now that #2307 and #2314 have merged: the same three commits, no conflicts, head 679e25d90. The pull request is no longer stacked and shows only its own 16 files. The game-free cache test and the switch table check were rerun after the rebase and pass; the in-game measurements in the description were taken at the previous head.
Owner
@review
Owner

@Beanstalk

@Beanstalk
Member

Beanstalk test farm · ❌ failed on nvidia, linux+radv, steamdeck and 1 more

Commit 679e25d · approved by HumanBean (reviewed) · dashboard

⚠️ Note: Two starts per side fit the time budget but provide less resilience to noisy results than three; cache files and actual hits are not guaranteed, so this cannot establish a controlled warm-cache improvement.
⚠️ Note: The farm cannot reproduce the prior 60 ms hitch threshold, slow-frame seconds, byte-for-byte texture verification, stale-file upgrade or eviction tests with this plan.

Summary, written by AI (gpt-6.1-terra) from the numbers below:

The change failed on NVIDIA, Linux RADV, Steam Deck and integrated GPU targets; Windows AMD passed, while Intel could not be judged. On the Linux GTX 1660 Ti, maximum load time rose 7.65 → 11.18 s (+46.1%), worst frame time rose 2671 → 6279 ms (+135.1%), and maximum screenshot difference rose 0.0789 → 0.8081 (limit 0.25); Steam Deck and the Radeon 890M also failed the screenshot limit, at 0.2532 and 0.8076 respectively. On the RX 580, enabling the cache in the PR worsened market frame-time p99 from 43.23 → 60.20 ms (+39.3%) and Kokiri p99 from 47.97 → 57.78 ms (+20.5%) compared with the PR default. Intel had a baseline build setup error and a report where both builds crashed on every start;…

Done (started 05:48 UTC, last report 16:05 UTC). Comment @Beanstalk to run it again.

Target Result Reports VRAM peak (MB) Crashes
nvidia ❌ fail (an outlier) 2 1 2 — none
windows+amd ✅ pass 2 1 2 — 4 PR runs
linux+radv ❌ fail (an outlier) 2 1 2 — none
intel ⚠️ couldn't be judged 2 1 2 — 4 PR runs
steamdeck ❌ fail (an outlier) 2 1 2 — none
igpu ❌ fail (an outlier) 2 1 2 — none

market-and-kokiri · frame time p99 (ms)

Target main RX_VK_TEX_CACHE= (reference) RX_VK_TEX_CACHE=1
nvidia 20.4 20.6 20.6 (+0%)
windows+amd 19.1 19.2 19.0 (−1%)
linux+radv 34.6 33.7 38.0 (+13%)
intel — — —
steamdeck 46.8 43.2 44.6 (+3%)
igpu 22.5 22.6 22.8 (+1%)

Why it failed

  • nvidia: market-and-kokiri · RX_VK_TEX_CACHE= (PR only) screenshot.max_diff: 0.1 → 0.8; limit 0.2
  • nvidia: market-and-kokiri · RX_VK_TEX_CACHE= (PR only) load_time_max_s.max_delta_pct: 7.7 → 11.2 (+46.1%); limit 30.0
  • nvidia: market-and-kokiri · RX_VK_TEX_CACHE= (PR only) run_frametime_max_ms.max_delta_pct: 2,671 → 6,279 (+135.1%); limit 50.0
  • linux+radv: market-and-kokiri · RX_VK_TEX_CACHE=1 (PR only) market.frametime_p99_ms: RX_VK_TEX_CACHE=1 vs RX_VK_TEX_CACHE= (PR): 43.2 → 60.2 (+39.3%); limit 20.0; the PR's own cells: RX_VK_TEX_CACHE=1 against RX_VK_TEX_CACHE= (RX_VK_TEX_CACHE= (PR only))
  • linux+radv: market-and-kokiri · RX_VK_TEX_CACHE=1 (PR only) kokiri.frametime_p99_ms: RX_VK_TEX_CACHE=1 vs RX_VK_TEX_CACHE= (PR): 48.0 → 57.8 (+20.5%); limit 20.0; the PR's own cells: RX_VK_TEX_CACHE=1 against RX_VK_TEX_CACHE= (RX_VK_TEX_CACHE= (PR only))
  • steamdeck: market-and-kokiri · RX_VK_TEX_CACHE= (PR only) screenshot.max_diff: 0.8 → 0.3; limit 0.2
  • igpu: market-and-kokiri · RX_VK_TEX_CACHE=1 (PR only) screenshot.max_diff: 0.1 → 0.8; limit 0.2

Couldn't be judged: the tester's PC could not finish the test. The farm tries another PC, or the same one after a fix; it says nothing about the PR on its own.

  • windows+amd, report 2: Insufficient frame-time evidence for 12 required comparison(s). See rule results.
  • intel, report 1: the main base failed (exit 1): Windows doesn't let programs look inside C:\, a folder above the builder's own compiler, so it can't start. Move Longshot's folder out of it (for example to C:\Longshot) and start Longshot from there.
  • intel, report 2: Insufficient frame-time evidence for 12 required comparison(s). See rule results.
What was tested

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

The plan compares main with the pull request in Castle Town Market and Kokiri Forest, using two starts per side for each cache setting and about 50 minutes per tester. The cache axis tests both the shipped default and the cost-model-enabled mode across GPU makers, AMD drivers, integrated GPUs and Steam Deck. It measures frame-time tails, hitches and worst frames, and compares stationary screenshots. Crashes, substantial performance regressions or significant picture differences fail the plan; the enabled mode is also compared with the pull request's default.

  • Where: nvidia (1-2 reports), windows+amd (1-2 reports), linux+radv (1-2 reports), intel (1-2 reports), steamdeck (1-2 reports), igpu (1-2 reports).
  • Matrix: 2 cells, each on main and the PR: RX_VK_TEX_CACHE `` or 1 (PR only).
  • market-and-kokiri: from the repository's save market-entrance, then teleport to Market, take the picture market to compare with main, move the stick, measure market for 20 s (after 5 s warm-up), teleport to Kokiri Forest, take the picture kokiri to compare with main, measure kokiri for 20 s (after 5 s warm-up); 2 runs on each side for each of 2 cells (2 game starts a run).
  • Measured: crashes, frame times, stutters and hitches, load times.
  • The PR fails if: it crashes; or the PR's frame time (p99) with RX_VK_TEX_CACHE=1 is more than 20% above RX_VK_TEX_CACHE=; or the PR's worst frame time in the whole run with RX_VK_TEX_CACHE=1 is more than 50% above RX_VK_TEX_CACHE=; or a picture differs from main by more than 25%; or longest load is more than 30% above main; or frame time (p99) is more than 20% above main; or worst frame time in the whole run is more than 50% above main; or frame time (worst 1%) is more than 20% above main.
  • Time: about 48 min of game runs per tester (8 game starts), plus the two builds.
Measurements on `nvidia`, for the PR description

Verdict: fail on nvidia (2 reports): market-and-kokiri screenshot.max_diff; market-and-kokiri load_time_max_s.max_delta_pct (+46.1%); market-and-kokiri run_frametime_max_ms.max_delta_pct (+135.1%) failed.

Hardware: 1: windows+nvidia+nvidia-proprietary+dgpu NVIDIA GeForce RTX 3080 Ti, 621.24.0 AMD Ryzen 9 5900X 12-Core Processor, 64 GB RAM; 2: linux+nvidia+nvidia-proprietary+dgpu NVIDIA GeForce GTX 1660 Ti, 620.73.4 Intel(R) Core(TM) i7-10750H CPU @ 2.60GHz, 16 GB RAM
Scene: market-and-kokiri, from the repository's save market-entrance; 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); market-and-kokiri: 2 game starts a side, market 20 s after 5 s warm-up, kokiri 20 s after 5 s warm-up; each number the median of the runs, then of 2 reports
How to reproduce: the farm's plan above (@Beanstalk on this PR runs it again)

Before: main @ 94cd0a2 After: this PR @ 679e25d
market-and-kokiri · RX_VK_TEX_CACHE= (PR only) · longest load (s) 12.3 13.7 (+11%)
market-and-kokiri · RX_VK_TEX_CACHE= (PR only) · kokiri · frame time (p99) (ms) 20.4 20.6 (+1%)
market-and-kokiri · RX_VK_TEX_CACHE= (PR only) · market · frame time (p99) (ms) 23.2 23.4 (+1%)
market-and-kokiri · RX_VK_TEX_CACHE= (PR only) · worst frame time in the whole run (ms) 7,870 9,335 (+19%)
market-and-kokiri · RX_VK_TEX_CACHE= (PR only) · kokiri · frame time (worst 1%) (ms) 21.8 22.6 (+4%)
market-and-kokiri · RX_VK_TEX_CACHE= (PR only) · market · frame time (worst 1%) (ms) 27.8 27.5 (−1%)
market-and-kokiri · RX_VK_TEX_CACHE=1 (PR only) · longest load (s) 12.6 12.0 (−5%)
market-and-kokiri · RX_VK_TEX_CACHE=1 (PR only) · kokiri · frame time (p99) (ms) 20.4 20.6 (+1%)
market-and-kokiri · RX_VK_TEX_CACHE=1 (PR only) · market · frame time (p99) (ms) 23.4 23.2 (−1%)
market-and-kokiri · RX_VK_TEX_CACHE=1 (PR only) · worst frame time in the whole run (ms) 8,037 7,511 (−7%)
market-and-kokiri · RX_VK_TEX_CACHE=1 (PR only) · kokiri · frame time (worst 1%) (ms) 21.7 22.1 (+2%)
market-and-kokiri · RX_VK_TEX_CACHE=1 (PR only) · market · frame time (worst 1%) (ms) 28.7 28.5 (−1%)

Flags and settings

Flag What it is Values tried Before this PR After this PR Effect (frame time (p99)) Helps / doesn't help / untested
RX_VK_TEX_CACHE switch the PR adds (set on the PR side only) ``, 1 not in main the PR's default market-and-kokiri, main without it → the PR with : 20.4 → 20.6 (+1%) no clear effect

As Markdown for the PR description:

## Measurements

**Verdict:** fail on nvidia (2 reports): `market-and-kokiri screenshot.max_diff`; `market-and-kokiri load_time_max_s.max_delta_pct (+46.1%)`; `market-and-kokiri run_frametime_max_ms.max_delta_pct (+135.1%)` failed.

Hardware: 1: windows+nvidia+nvidia-proprietary+dgpu `NVIDIA GeForce RTX 3080 Ti, 621.24.0` `AMD Ryzen 9 5900X 12-Core Processor, 64 GB RAM`; 2: linux+nvidia+nvidia-proprietary+dgpu `NVIDIA GeForce GTX 1660 Ti, 620.73.4` `Intel(R) Core(TM) i7-10750H CPU @ 2.60GHz, 16 GB RAM`  
Scene: market-and-kokiri, from the repository's save market-entrance; 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); market-and-kokiri: 2 game starts a side, market 20 s after 5 s warm-up, kokiri 20 s after 5 s warm-up; each number the median of the runs, then of 2 reports  
How to reproduce: the farm's plan above (`@Beanstalk` on this PR runs it again)

| | Before: main @ 94cd0a2 | After: this PR @ 679e25d |
|---|---|---|
| market-and-kokiri · `RX_VK_TEX_CACHE= (PR only)` · longest load (s) | 12.3 | 13.7 (+11%) |
| market-and-kokiri · `RX_VK_TEX_CACHE= (PR only)` · kokiri · frame time (p99) (ms) | 20.4 | 20.6 (+1%) |
| market-and-kokiri · `RX_VK_TEX_CACHE= (PR only)` · market · frame time (p99) (ms) | 23.2 | 23.4 (+1%) |
| market-and-kokiri · `RX_VK_TEX_CACHE= (PR only)` · worst frame time in the whole run (ms) | 7,870 | 9,335 (+19%) |
| market-and-kokiri · `RX_VK_TEX_CACHE= (PR only)` · kokiri · frame time (worst 1%) (ms) | 21.8 | 22.6 (+4%) |
| market-and-kokiri · `RX_VK_TEX_CACHE= (PR only)` · market · frame time (worst 1%) (ms) | 27.8 | 27.5 (−1%) |
| market-and-kokiri · `RX_VK_TEX_CACHE=1 (PR only)` · longest load (s) | 12.6 | 12.0 (−5%) |
| market-and-kokiri · `RX_VK_TEX_CACHE=1 (PR only)` · kokiri · frame time (p99) (ms) | 20.4 | 20.6 (+1%) |
| market-and-kokiri · `RX_VK_TEX_CACHE=1 (PR only)` · market · frame time (p99) (ms) | 23.4 | 23.2 (−1%) |
| market-and-kokiri · `RX_VK_TEX_CACHE=1 (PR only)` · worst frame time in the whole run (ms) | 8,037 | 7,511 (−7%) |
| market-and-kokiri · `RX_VK_TEX_CACHE=1 (PR only)` · kokiri · frame time (worst 1%) (ms) | 21.7 | 22.1 (+2%) |
| market-and-kokiri · `RX_VK_TEX_CACHE=1 (PR only)` · market · frame time (worst 1%) (ms) | 28.7 | 28.5 (−1%) |

**Flags and settings**

| Flag | What it is | Values tried | Before this PR | After this PR | Effect (frame time (p99)) | Helps / doesn't help / untested |
|---|---|---|---|---|---|---|
| `RX_VK_TEX_CACHE` | switch the PR adds (set on the PR side only) | ``, `1` | not in main | the PR's default | market-and-kokiri, main without it → the PR with : 20.4 → 20.6 (+1%) | no clear effect |
Measurements on `windows+amd`, for the PR description

Verdict: pass on windows+amd (2 reports): no rule failed and no PR run crashed.

Hardware: 1: windows+amd+amd-proprietary+dgpu AMD Radeon RX 9070 XT, 2.0.416 AMD Ryzen 7 5800X3D 8-Core Processor, 32 GB RAM; 2: windows+amd+amd-proprietary+igpu AMD Radeon Graphics, 2.0.388 AMD Ryzen Z1 Extreme, 16 GB RAM
Scene: market-and-kokiri, from the repository's save market-entrance; 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); market-and-kokiri: 2 game starts a side, market 20 s after 5 s warm-up, kokiri 20 s after 5 s warm-up; each number the median of the runs, then of 2 reports
How to reproduce: the farm's plan above (@Beanstalk on this PR runs it again)

Before: main @ 94cd0a2 After: this PR @ 679e25d
market-and-kokiri · RX_VK_TEX_CACHE= (PR only) · longest load (s) 8.5 6.5 (−23%)
market-and-kokiri · RX_VK_TEX_CACHE= (PR only) · kokiri · frame time (p99) (ms) 19.1 19.2 (+1%)
market-and-kokiri · RX_VK_TEX_CACHE= (PR only) · market · frame time (p99) (ms) 20.4 20.5 (+0%)
market-and-kokiri · RX_VK_TEX_CACHE= (PR only) · worst frame time in the whole run (ms) 2,603 2,524 (−3%)
market-and-kokiri · RX_VK_TEX_CACHE= (PR only) · kokiri · frame time (worst 1%) (ms) 19.8 21.3 (+8%)
market-and-kokiri · RX_VK_TEX_CACHE= (PR only) · market · frame time (worst 1%) (ms) 25.0 21.0 (−16%)
market-and-kokiri · RX_VK_TEX_CACHE=1 (PR only) · longest load (s) 6.7 6.7 (−1%)
market-and-kokiri · RX_VK_TEX_CACHE=1 (PR only) · kokiri · frame time (p99) (ms) 19.2 19.0 (−1%)
market-and-kokiri · RX_VK_TEX_CACHE=1 (PR only) · market · frame time (p99) (ms) 20.8 20.3 (−3%)
market-and-kokiri · RX_VK_TEX_CACHE=1 (PR only) · worst frame time in the whole run (ms) 2,526 2,406 (−5%)
market-and-kokiri · RX_VK_TEX_CACHE=1 (PR only) · kokiri · frame time (worst 1%) (ms) 21.8 20.7 (−5%)
market-and-kokiri · RX_VK_TEX_CACHE=1 (PR only) · market · frame time (worst 1%) (ms) 28.6 21.0 (−26%)

Flags and settings

Flag What it is Values tried Before this PR After this PR Effect (frame time (p99)) Helps / doesn't help / untested
RX_VK_TEX_CACHE switch the PR adds (set on the PR side only) ``, 1 not in main the PR's default market-and-kokiri, main without it → the PR with : 19.1 → 19.2 (+1%) no clear effect

As Markdown for the PR description:

## Measurements

**Verdict:** pass on windows+amd (2 reports): no rule failed and no PR run crashed.

Hardware: 1: windows+amd+amd-proprietary+dgpu `AMD Radeon RX 9070 XT, 2.0.416` `AMD Ryzen 7 5800X3D 8-Core Processor, 32 GB RAM`; 2: windows+amd+amd-proprietary+igpu `AMD Radeon Graphics, 2.0.388` `AMD Ryzen Z1 Extreme, 16 GB RAM`  
Scene: market-and-kokiri, from the repository's save market-entrance; 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); market-and-kokiri: 2 game starts a side, market 20 s after 5 s warm-up, kokiri 20 s after 5 s warm-up; each number the median of the runs, then of 2 reports  
How to reproduce: the farm's plan above (`@Beanstalk` on this PR runs it again)

| | Before: main @ 94cd0a2 | After: this PR @ 679e25d |
|---|---|---|
| market-and-kokiri · `RX_VK_TEX_CACHE= (PR only)` · longest load (s) | 8.5 | 6.5 (−23%) |
| market-and-kokiri · `RX_VK_TEX_CACHE= (PR only)` · kokiri · frame time (p99) (ms) | 19.1 | 19.2 (+1%) |
| market-and-kokiri · `RX_VK_TEX_CACHE= (PR only)` · market · frame time (p99) (ms) | 20.4 | 20.5 (+0%) |
| market-and-kokiri · `RX_VK_TEX_CACHE= (PR only)` · worst frame time in the whole run (ms) | 2,603 | 2,524 (−3%) |
| market-and-kokiri · `RX_VK_TEX_CACHE= (PR only)` · kokiri · frame time (worst 1%) (ms) | 19.8 | 21.3 (+8%) |
| market-and-kokiri · `RX_VK_TEX_CACHE= (PR only)` · market · frame time (worst 1%) (ms) | 25.0 | 21.0 (−16%) |
| market-and-kokiri · `RX_VK_TEX_CACHE=1 (PR only)` · longest load (s) | 6.7 | 6.7 (−1%) |
| market-and-kokiri · `RX_VK_TEX_CACHE=1 (PR only)` · kokiri · frame time (p99) (ms) | 19.2 | 19.0 (−1%) |
| market-and-kokiri · `RX_VK_TEX_CACHE=1 (PR only)` · market · frame time (p99) (ms) | 20.8 | 20.3 (−3%) |
| market-and-kokiri · `RX_VK_TEX_CACHE=1 (PR only)` · worst frame time in the whole run (ms) | 2,526 | 2,406 (−5%) |
| market-and-kokiri · `RX_VK_TEX_CACHE=1 (PR only)` · kokiri · frame time (worst 1%) (ms) | 21.8 | 20.7 (−5%) |
| market-and-kokiri · `RX_VK_TEX_CACHE=1 (PR only)` · market · frame time (worst 1%) (ms) | 28.6 | 21.0 (−26%) |

**Flags and settings**

| Flag | What it is | Values tried | Before this PR | After this PR | Effect (frame time (p99)) | Helps / doesn't help / untested |
|---|---|---|---|---|---|---|
| `RX_VK_TEX_CACHE` | switch the PR adds (set on the PR side only) | ``, `1` | not in main | the PR's default | market-and-kokiri, main without it → the PR with : 19.1 → 19.2 (+1%) | no clear effect |
Measurements on `linux+radv`, for the PR description

Verdict: fail on linux+radv (2 reports): market-and-kokiri market.frametime_p99_ms: RX_VK_TEX_CACHE=1 vs RX_VK_TEX_CACHE= (PR) (+39.3%); market-and-kokiri kokiri.frametime_p99_ms: RX_VK_TEX_CACHE=1 vs RX_VK_TEX_CACHE= (PR) (+20.5%) failed.

Hardware: 1: linux+amd+radv+dgpu AMD Radeon RX 580 Series (RADV POLARIS10), 26.2.7 AMD Ryzen 5 5500F 6-Core Processor, 32 GB RAM; 2: linux+amd+radv+dgpu AMD Radeon RX 7900 XTX (RADV NAVI31), 26.3.1 AMD Ryzen 7 7800X3D 8-Core Processor, 32 GB RAM
Scene: market-and-kokiri, from the repository's save market-entrance; 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); market-and-kokiri: 2 game starts a side, market 20 s after 5 s warm-up, kokiri 20 s after 5 s warm-up; each number the median of the runs, then of 2 reports
How to reproduce: the farm's plan above (@Beanstalk on this PR runs it again)

Before: main @ 94cd0a2 After: this PR @ 679e25d
market-and-kokiri · RX_VK_TEX_CACHE= (PR only) · longest load (s) 6.2 6.0 (−4%)
market-and-kokiri · RX_VK_TEX_CACHE= (PR only) · kokiri · frame time (p99) (ms) 34.6 33.7 (−3%)
market-and-kokiri · RX_VK_TEX_CACHE= (PR only) · market · frame time (p99) (ms) 36.7 32.1 (−13%)
market-and-kokiri · RX_VK_TEX_CACHE= (PR only) · worst frame time in the whole run (ms) 2,183 2,162 (−1%)
market-and-kokiri · RX_VK_TEX_CACHE= (PR only) · kokiri · frame time (worst 1%) (ms) 39.6 37.8 (−5%)
market-and-kokiri · RX_VK_TEX_CACHE= (PR only) · market · frame time (worst 1%) (ms) 46.7 37.3 (−20%)
market-and-kokiri · RX_VK_TEX_CACHE=1 (PR only) · longest load (s) 5.6 5.6 (+0%)
market-and-kokiri · RX_VK_TEX_CACHE=1 (PR only) · kokiri · frame time (p99) (ms) 34.2 38.0 (+11%)
market-and-kokiri · RX_VK_TEX_CACHE=1 (PR only) · market · frame time (p99) (ms) 40.0 40.2 (+0%)
market-and-kokiri · RX_VK_TEX_CACHE=1 (PR only) · worst frame time in the whole run (ms) 2,091 2,021 (−3%)
market-and-kokiri · RX_VK_TEX_CACHE=1 (PR only) · kokiri · frame time (worst 1%) (ms) 39.8 42.3 (+6%)
market-and-kokiri · RX_VK_TEX_CACHE=1 (PR only) · market · frame time (worst 1%) (ms) 47.7 50.9 (+7%)

Flags and settings

Flag What it is Values tried Before this PR After this PR Effect (frame time (p99)) Helps / doesn't help / untested
RX_VK_TEX_CACHE switch the PR adds (set on the PR side only) ``, 1 not in main the PR's default market-and-kokiri, main without it → the PR with : 34.6 → 33.7 (−3%) helps

As Markdown for the PR description:

## Measurements

**Verdict:** fail on linux+radv (2 reports): `market-and-kokiri market.frametime_p99_ms: RX_VK_TEX_CACHE=1 vs RX_VK_TEX_CACHE= (PR) (+39.3%)`; `market-and-kokiri kokiri.frametime_p99_ms: RX_VK_TEX_CACHE=1 vs RX_VK_TEX_CACHE= (PR) (+20.5%)` failed.

Hardware: 1: linux+amd+radv+dgpu `AMD Radeon RX 580 Series (RADV POLARIS10), 26.2.7` `AMD Ryzen 5 5500F 6-Core Processor, 32 GB RAM`; 2: linux+amd+radv+dgpu `AMD Radeon RX 7900 XTX (RADV NAVI31), 26.3.1` `AMD Ryzen 7 7800X3D 8-Core Processor, 32 GB RAM`  
Scene: market-and-kokiri, from the repository's save market-entrance; 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); market-and-kokiri: 2 game starts a side, market 20 s after 5 s warm-up, kokiri 20 s after 5 s warm-up; each number the median of the runs, then of 2 reports  
How to reproduce: the farm's plan above (`@Beanstalk` on this PR runs it again)

| | Before: main @ 94cd0a2 | After: this PR @ 679e25d |
|---|---|---|
| market-and-kokiri · `RX_VK_TEX_CACHE= (PR only)` · longest load (s) | 6.2 | 6.0 (−4%) |
| market-and-kokiri · `RX_VK_TEX_CACHE= (PR only)` · kokiri · frame time (p99) (ms) | 34.6 | 33.7 (−3%) |
| market-and-kokiri · `RX_VK_TEX_CACHE= (PR only)` · market · frame time (p99) (ms) | 36.7 | 32.1 (−13%) |
| market-and-kokiri · `RX_VK_TEX_CACHE= (PR only)` · worst frame time in the whole run (ms) | 2,183 | 2,162 (−1%) |
| market-and-kokiri · `RX_VK_TEX_CACHE= (PR only)` · kokiri · frame time (worst 1%) (ms) | 39.6 | 37.8 (−5%) |
| market-and-kokiri · `RX_VK_TEX_CACHE= (PR only)` · market · frame time (worst 1%) (ms) | 46.7 | 37.3 (−20%) |
| market-and-kokiri · `RX_VK_TEX_CACHE=1 (PR only)` · longest load (s) | 5.6 | 5.6 (+0%) |
| market-and-kokiri · `RX_VK_TEX_CACHE=1 (PR only)` · kokiri · frame time (p99) (ms) | 34.2 | 38.0 (+11%) |
| market-and-kokiri · `RX_VK_TEX_CACHE=1 (PR only)` · market · frame time (p99) (ms) | 40.0 | 40.2 (+0%) |
| market-and-kokiri · `RX_VK_TEX_CACHE=1 (PR only)` · worst frame time in the whole run (ms) | 2,091 | 2,021 (−3%) |
| market-and-kokiri · `RX_VK_TEX_CACHE=1 (PR only)` · kokiri · frame time (worst 1%) (ms) | 39.8 | 42.3 (+6%) |
| market-and-kokiri · `RX_VK_TEX_CACHE=1 (PR only)` · market · frame time (worst 1%) (ms) | 47.7 | 50.9 (+7%) |

**Flags and settings**

| Flag | What it is | Values tried | Before this PR | After this PR | Effect (frame time (p99)) | Helps / doesn't help / untested |
|---|---|---|---|---|---|---|
| `RX_VK_TEX_CACHE` | switch the PR adds (set on the PR side only) | ``, `1` | not in main | the PR's default | market-and-kokiri, main without it → the PR with : 34.6 → 33.7 (−3%) | helps |
Measurements on `intel`, for the PR description

Verdict: could not be judged on intel (2 reports): required frame-time comparison inconclusive (fewer than two usable starts per side).

Hardware: 1: windows+intel+intel-proprietary+dgpu Intel(R) Arc(TM) B580 Graphics, 0.406.983 AMD Ryzen 5 9600X 6-Core Processor, 16 GB RAM; 2: windows+intel+intel-proprietary+dgpu+xess Intel(R) Arc(TM) B580 Graphics, 0.406.983 AMD Ryzen 5 9600X 6-Core Processor, 16 GB RAM
Scene: market-and-kokiri, from the repository's save market-entrance; 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); market-and-kokiri: 2 game starts a side, market 20 s after 5 s warm-up, kokiri 20 s after 5 s warm-up; each number the median of the runs, then of 2 reports
How to reproduce: the farm's plan above (@Beanstalk on this PR runs it again)

Before: main @ 94cd0a2 After: this PR @ 679e25d
market-and-kokiri · RX_VK_TEX_CACHE= (PR only) · worst frame time in the whole run (ms) 109.6 120.4 (+10%)
market-and-kokiri · RX_VK_TEX_CACHE=1 (PR only) · worst frame time in the whole run (ms) 107.6 110.7 (+3%)

Flags and settings

Flag What it is Values tried Before this PR After this PR Effect (frame time (p99)) Helps / doesn't help / untested
RX_VK_TEX_CACHE switch the PR adds (set on the PR side only) ``, 1 not in main the PR's default market-and-kokiri, main without it → the PR with : not measured untested

As Markdown for the PR description:

## Measurements

**Verdict:** could not be judged on intel (2 reports): required frame-time comparison inconclusive (fewer than two usable starts per side).

Hardware: 1: windows+intel+intel-proprietary+dgpu `Intel(R) Arc(TM) B580 Graphics, 0.406.983` `AMD Ryzen 5 9600X 6-Core Processor, 16 GB RAM`; 2: windows+intel+intel-proprietary+dgpu+xess `Intel(R) Arc(TM) B580 Graphics, 0.406.983` `AMD Ryzen 5 9600X 6-Core Processor, 16 GB RAM`  
Scene: market-and-kokiri, from the repository's save market-entrance; 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); market-and-kokiri: 2 game starts a side, market 20 s after 5 s warm-up, kokiri 20 s after 5 s warm-up; each number the median of the runs, then of 2 reports  
How to reproduce: the farm's plan above (`@Beanstalk` on this PR runs it again)

| | Before: main @ 94cd0a2 | After: this PR @ 679e25d |
|---|---|---|
| market-and-kokiri · `RX_VK_TEX_CACHE= (PR only)` · worst frame time in the whole run (ms) | 109.6 | 120.4 (+10%) |
| market-and-kokiri · `RX_VK_TEX_CACHE=1 (PR only)` · worst frame time in the whole run (ms) | 107.6 | 110.7 (+3%) |

**Flags and settings**

| Flag | What it is | Values tried | Before this PR | After this PR | Effect (frame time (p99)) | Helps / doesn't help / untested |
|---|---|---|---|---|---|---|
| `RX_VK_TEX_CACHE` | switch the PR adds (set on the PR side only) | ``, `1` | not in main | the PR's default | market-and-kokiri, main without it → the PR with : not measured | untested |
Measurements on `steamdeck`, for the PR description

Verdict: fail on steamdeck (2 reports): market-and-kokiri screenshot.max_diff failed.

Hardware: 1: linux+amd+radv+igpu+handheld AMD Custom GPU 0405 (RADV VANGOGH), 26.1.99 AMD Custom APU 0405, 12 GB RAM; 2: linux+amd+radv+igpu+handheld AMD Custom GPU 0405 (RADV VANGOGH), 26.1.99 AMD Custom APU 0405, 12 GB RAM
Scene: market-and-kokiri, from the repository's save market-entrance; 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); market-and-kokiri: 2 game starts a side, market 20 s after 5 s warm-up, kokiri 20 s after 5 s warm-up; each number the median of the runs, then of 2 reports
How to reproduce: the farm's plan above (@Beanstalk on this PR runs it again)

Before: main @ 94cd0a2 After: this PR @ 679e25d
market-and-kokiri · RX_VK_TEX_CACHE= (PR only) · longest load (s) 10.3 9.7 (−6%)
market-and-kokiri · RX_VK_TEX_CACHE= (PR only) · kokiri · frame time (p99) (ms) 46.8 43.2 (−8%)
market-and-kokiri · RX_VK_TEX_CACHE= (PR only) · market · frame time (p99) (ms) 81.5 65.3 (−20%)
market-and-kokiri · RX_VK_TEX_CACHE= (PR only) · worst frame time in the whole run (ms) 4,674 4,880 (+4%)
market-and-kokiri · RX_VK_TEX_CACHE= (PR only) · kokiri · frame time (worst 1%) (ms) 54.9 49.1 (−11%)
market-and-kokiri · RX_VK_TEX_CACHE= (PR only) · market · frame time (worst 1%) (ms) 188.7 166.4 (−12%)
market-and-kokiri · RX_VK_TEX_CACHE=1 (PR only) · longest load (s) 9.6 9.3 (−4%)
market-and-kokiri · RX_VK_TEX_CACHE=1 (PR only) · kokiri · frame time (p99) (ms) 44.9 44.6 (−1%)
market-and-kokiri · RX_VK_TEX_CACHE=1 (PR only) · market · frame time (p99) (ms) 65.5 48.4 (−26%)
market-and-kokiri · RX_VK_TEX_CACHE=1 (PR only) · worst frame time in the whole run (ms) 5,193 5,235 (+1%)
market-and-kokiri · RX_VK_TEX_CACHE=1 (PR only) · kokiri · frame time (worst 1%) (ms) 49.2 50.1 (+2%)
market-and-kokiri · RX_VK_TEX_CACHE=1 (PR only) · market · frame time (worst 1%) (ms) 146.3 54.3 (−63%)

Flags and settings

Flag What it is Values tried Before this PR After this PR Effect (frame time (p99)) Helps / doesn't help / untested
RX_VK_TEX_CACHE switch the PR adds (set on the PR side only) ``, 1 not in main the PR's default market-and-kokiri, main without it → the PR with : 46.8 → 43.2 (−8%) helps

As Markdown for the PR description:

## Measurements

**Verdict:** fail on steamdeck (2 reports): `market-and-kokiri screenshot.max_diff` failed.

Hardware: 1: linux+amd+radv+igpu+handheld `AMD Custom GPU 0405 (RADV VANGOGH), 26.1.99` `AMD Custom APU 0405, 12 GB RAM`; 2: linux+amd+radv+igpu+handheld `AMD Custom GPU 0405 (RADV VANGOGH), 26.1.99` `AMD Custom APU 0405, 12 GB RAM`  
Scene: market-and-kokiri, from the repository's save market-entrance; 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); market-and-kokiri: 2 game starts a side, market 20 s after 5 s warm-up, kokiri 20 s after 5 s warm-up; each number the median of the runs, then of 2 reports  
How to reproduce: the farm's plan above (`@Beanstalk` on this PR runs it again)

| | Before: main @ 94cd0a2 | After: this PR @ 679e25d |
|---|---|---|
| market-and-kokiri · `RX_VK_TEX_CACHE= (PR only)` · longest load (s) | 10.3 | 9.7 (−6%) |
| market-and-kokiri · `RX_VK_TEX_CACHE= (PR only)` · kokiri · frame time (p99) (ms) | 46.8 | 43.2 (−8%) |
| market-and-kokiri · `RX_VK_TEX_CACHE= (PR only)` · market · frame time (p99) (ms) | 81.5 | 65.3 (−20%) |
| market-and-kokiri · `RX_VK_TEX_CACHE= (PR only)` · worst frame time in the whole run (ms) | 4,674 | 4,880 (+4%) |
| market-and-kokiri · `RX_VK_TEX_CACHE= (PR only)` · kokiri · frame time (worst 1%) (ms) | 54.9 | 49.1 (−11%) |
| market-and-kokiri · `RX_VK_TEX_CACHE= (PR only)` · market · frame time (worst 1%) (ms) | 188.7 | 166.4 (−12%) |
| market-and-kokiri · `RX_VK_TEX_CACHE=1 (PR only)` · longest load (s) | 9.6 | 9.3 (−4%) |
| market-and-kokiri · `RX_VK_TEX_CACHE=1 (PR only)` · kokiri · frame time (p99) (ms) | 44.9 | 44.6 (−1%) |
| market-and-kokiri · `RX_VK_TEX_CACHE=1 (PR only)` · market · frame time (p99) (ms) | 65.5 | 48.4 (−26%) |
| market-and-kokiri · `RX_VK_TEX_CACHE=1 (PR only)` · worst frame time in the whole run (ms) | 5,193 | 5,235 (+1%) |
| market-and-kokiri · `RX_VK_TEX_CACHE=1 (PR only)` · kokiri · frame time (worst 1%) (ms) | 49.2 | 50.1 (+2%) |
| market-and-kokiri · `RX_VK_TEX_CACHE=1 (PR only)` · market · frame time (worst 1%) (ms) | 146.3 | 54.3 (−63%) |

**Flags and settings**

| Flag | What it is | Values tried | Before this PR | After this PR | Effect (frame time (p99)) | Helps / doesn't help / untested |
|---|---|---|---|---|---|---|
| `RX_VK_TEX_CACHE` | switch the PR adds (set on the PR side only) | ``, `1` | not in main | the PR's default | market-and-kokiri, main without it → the PR with : 46.8 → 43.2 (−8%) | helps |
Measurements on `igpu`, for the PR description

Verdict: fail on igpu (2 reports): market-and-kokiri screenshot.max_diff failed.

Hardware: 1: linux+amd+radv+igpu AMD Radeon 890M Graphics (RADV STRIX1), 26.1.99 AMD Ryzen Z2 Extreme, 32 GB RAM; 2: linux+amd+radv+igpu AMD Radeon 8060S Graphics (RADV STRIX_HALO), 26.99.99 AMD RYZEN AI MAX+ 395 w/ Radeon 8060S, 64 GB RAM
Scene: market-and-kokiri, from the repository's save market-entrance; 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); market-and-kokiri: 2 game starts a side, market 20 s after 5 s warm-up, kokiri 20 s after 5 s warm-up; each number the median of the runs, then of 2 reports
How to reproduce: the farm's plan above (@Beanstalk on this PR runs it again)

Before: main @ 94cd0a2 After: this PR @ 679e25d
market-and-kokiri · RX_VK_TEX_CACHE= (PR only) · longest load (s) 5.8 5.6 (−3%)
market-and-kokiri · RX_VK_TEX_CACHE= (PR only) · kokiri · frame time (p99) (ms) 22.5 22.6 (+1%)
market-and-kokiri · RX_VK_TEX_CACHE= (PR only) · market · frame time (p99) (ms) 22.9 23.2 (+1%)
market-and-kokiri · RX_VK_TEX_CACHE= (PR only) · worst frame time in the whole run (ms) 1,983 1,789 (−10%)
market-and-kokiri · RX_VK_TEX_CACHE= (PR only) · kokiri · frame time (worst 1%) (ms) 27.1 23.2 (−14%)
market-and-kokiri · RX_VK_TEX_CACHE= (PR only) · market · frame time (worst 1%) (ms) 28.3 30.6 (+8%)
market-and-kokiri · RX_VK_TEX_CACHE=1 (PR only) · longest load (s) 5.3 5.1 (−4%)
market-and-kokiri · RX_VK_TEX_CACHE=1 (PR only) · kokiri · frame time (p99) (ms) 22.9 22.8 (−1%)
market-and-kokiri · RX_VK_TEX_CACHE=1 (PR only) · market · frame time (p99) (ms) 22.9 23.3 (+2%)
market-and-kokiri · RX_VK_TEX_CACHE=1 (PR only) · worst frame time in the whole run (ms) 1,686 1,787 (+6%)
market-and-kokiri · RX_VK_TEX_CACHE=1 (PR only) · kokiri · frame time (worst 1%) (ms) 25.5 23.5 (−8%)
market-and-kokiri · RX_VK_TEX_CACHE=1 (PR only) · market · frame time (worst 1%) (ms) 26.5 28.4 (+7%)

Flags and settings

Flag What it is Values tried Before this PR After this PR Effect (frame time (p99)) Helps / doesn't help / untested
RX_VK_TEX_CACHE switch the PR adds (set on the PR side only) ``, 1 not in main the PR's default market-and-kokiri, main without it → the PR with : 22.5 → 22.6 (+1%) no clear effect

As Markdown for the PR description:

## Measurements

**Verdict:** fail on igpu (2 reports): `market-and-kokiri screenshot.max_diff` failed.

Hardware: 1: linux+amd+radv+igpu `AMD Radeon 890M Graphics (RADV STRIX1), 26.1.99` `AMD Ryzen Z2 Extreme, 32 GB RAM`; 2: linux+amd+radv+igpu `AMD Radeon 8060S Graphics (RADV STRIX_HALO), 26.99.99` `AMD RYZEN AI MAX+ 395 w/ Radeon 8060S, 64 GB RAM`  
Scene: market-and-kokiri, from the repository's save market-entrance; 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); market-and-kokiri: 2 game starts a side, market 20 s after 5 s warm-up, kokiri 20 s after 5 s warm-up; each number the median of the runs, then of 2 reports  
How to reproduce: the farm's plan above (`@Beanstalk` on this PR runs it again)

| | Before: main @ 94cd0a2 | After: this PR @ 679e25d |
|---|---|---|
| market-and-kokiri · `RX_VK_TEX_CACHE= (PR only)` · longest load (s) | 5.8 | 5.6 (−3%) |
| market-and-kokiri · `RX_VK_TEX_CACHE= (PR only)` · kokiri · frame time (p99) (ms) | 22.5 | 22.6 (+1%) |
| market-and-kokiri · `RX_VK_TEX_CACHE= (PR only)` · market · frame time (p99) (ms) | 22.9 | 23.2 (+1%) |
| market-and-kokiri · `RX_VK_TEX_CACHE= (PR only)` · worst frame time in the whole run (ms) | 1,983 | 1,789 (−10%) |
| market-and-kokiri · `RX_VK_TEX_CACHE= (PR only)` · kokiri · frame time (worst 1%) (ms) | 27.1 | 23.2 (−14%) |
| market-and-kokiri · `RX_VK_TEX_CACHE= (PR only)` · market · frame time (worst 1%) (ms) | 28.3 | 30.6 (+8%) |
| market-and-kokiri · `RX_VK_TEX_CACHE=1 (PR only)` · longest load (s) | 5.3 | 5.1 (−4%) |
| market-and-kokiri · `RX_VK_TEX_CACHE=1 (PR only)` · kokiri · frame time (p99) (ms) | 22.9 | 22.8 (−1%) |
| market-and-kokiri · `RX_VK_TEX_CACHE=1 (PR only)` · market · frame time (p99) (ms) | 22.9 | 23.3 (+2%) |
| market-and-kokiri · `RX_VK_TEX_CACHE=1 (PR only)` · worst frame time in the whole run (ms) | 1,686 | 1,787 (+6%) |
| market-and-kokiri · `RX_VK_TEX_CACHE=1 (PR only)` · kokiri · frame time (worst 1%) (ms) | 25.5 | 23.5 (−8%) |
| market-and-kokiri · `RX_VK_TEX_CACHE=1 (PR only)` · market · frame time (worst 1%) (ms) | 26.5 | 28.4 (+7%) |

**Flags and settings**

| Flag | What it is | Values tried | Before this PR | After this PR | Effect (frame time (p99)) | Helps / doesn't help / untested |
|---|---|---|---|---|---|---|
| `RX_VK_TEX_CACHE` | switch the PR adds (set on the PR side only) | ``, `1` | not in main | the PR's default | market-and-kokiri, main without it → the PR with : 22.5 → 22.6 (+1%) | no clear effect |
The testers' hardware
Target Report Ran on
nvidia 1 windows+nvidia+nvidia-proprietary+dgpu NVIDIA GeForce RTX 3080 Ti, 621.24.0 AMD Ryzen 9 5900X 12-Core Processor, 64 GB RAM
nvidia 2 linux+nvidia+nvidia-proprietary+dgpu NVIDIA GeForce GTX 1660 Ti, 620.73.4 Intel(R) Core(TM) i7-10750H CPU @ 2.60GHz, 16 GB RAM
windows+amd 1 windows+amd+amd-proprietary+dgpu AMD Radeon RX 9070 XT, 2.0.416 AMD Ryzen 7 5800X3D 8-Core Processor, 32 GB RAM
windows+amd 2 windows+amd+amd-proprietary+igpu AMD Radeon Graphics, 2.0.388 AMD Ryzen Z1 Extreme, 16 GB RAM
linux+radv 1 linux+amd+radv+dgpu AMD Radeon RX 580 Series (RADV POLARIS10), 26.2.7 AMD Ryzen 5 5500F 6-Core Processor, 32 GB RAM
linux+radv 2 linux+amd+radv+dgpu AMD Radeon RX 7900 XTX (RADV NAVI31), 26.3.1 AMD Ryzen 7 7800X3D 8-Core Processor, 32 GB RAM
intel 1 windows+intel+intel-proprietary+dgpu Intel(R) Arc(TM) B580 Graphics, 0.406.983 AMD Ryzen 5 9600X 6-Core Processor, 16 GB RAM
intel 2 windows+intel+intel-proprietary+dgpu+xess Intel(R) Arc(TM) B580 Graphics, 0.406.983 AMD Ryzen 5 9600X 6-Core Processor, 16 GB RAM
steamdeck 1 linux+amd+radv+igpu+handheld AMD Custom GPU 0405 (RADV VANGOGH), 26.1.99 AMD Custom APU 0405, 12 GB RAM
steamdeck 2 linux+amd+radv+igpu+handheld AMD Custom GPU 0405 (RADV VANGOGH), 26.1.99 AMD Custom APU 0405, 12 GB RAM
igpu 1 linux+amd+radv+igpu AMD Radeon 890M Graphics (RADV STRIX1), 26.1.99 AMD Ryzen Z2 Extreme, 32 GB RAM
igpu 2 linux+amd+radv+igpu AMD Radeon 8060S Graphics (RADV STRIX_HALO), 26.99.99 AMD RYZEN AI MAX+ 395 w/ Radeon 8060S, 64 GB RAM
<!-- beanstalk:sticky --> ### Beanstalk test farm · ❌ failed on nvidia, linux+radv, steamdeck and 1 more Commit `679e25d` · approved by HumanBean (reviewed) · [dashboard](https://beanstalk.magicbean.dev/prs/2292) ⚠️ **Note:** Two starts per side fit the time budget but provide less resilience to noisy results than three; cache files and actual hits are not guaranteed, so this cannot establish a controlled warm-cache improvement. ⚠️ **Note:** The farm cannot reproduce the prior 60 ms hitch threshold, slow-frame seconds, byte-for-byte texture verification, stale-file upgrade or eviction tests with this plan. > **Summary**, written by AI (`gpt-6.1-terra`) from the numbers below: > > The change failed on NVIDIA, Linux RADV, Steam Deck and integrated GPU targets; Windows AMD passed, while Intel could not be judged. On the Linux GTX 1660 Ti, maximum load time rose 7.65 → 11.18 s (+46.1%), worst frame time rose 2671 → 6279 ms (+135.1%), and maximum screenshot difference rose 0.0789 → 0.8081 (limit 0.25); Steam Deck and the Radeon 890M also failed the screenshot limit, at 0.2532 and 0.8076 respectively. On the RX 580, enabling the cache in the PR worsened market frame-time p99 from 43.23 → 60.20 ms (+39.3%) and Kokiri p99 from 47.97 → 57.78 ms (+20.5%) compared with the PR default. Intel had a baseline build setup error and a report where both builds crashed on every start;… Done (started 05:48 UTC, last report 16:05 UTC). Comment `@Beanstalk` to run it again. | Target | Result | Reports | VRAM peak (MB) | Crashes | | --- | --- | --- | --- | --- | | `nvidia` | ❌ fail (an outlier) | 2 [1](https://beanstalk.magicbean.dev/reports/rp_23471421ff7a855a) [2](https://beanstalk.magicbean.dev/reports/rp_b096b57362880066) | — | none | | `windows+amd` | ✅ pass | 2 [1](https://beanstalk.magicbean.dev/reports/rp_7eac6de30b54c44c) [2](https://beanstalk.magicbean.dev/reports/rp_37e223f4789568f4) | — | 4 PR runs | | `linux+radv` | ❌ fail (an outlier) | 2 [1](https://beanstalk.magicbean.dev/reports/rp_666a988b1d3efc21) [2](https://beanstalk.magicbean.dev/reports/rp_09b2579ada653093) | — | none | | `intel` | ⚠️ couldn't be judged | 2 [1](https://beanstalk.magicbean.dev/reports/rp_6f07ac578a2a5416) [2](https://beanstalk.magicbean.dev/reports/rp_c483aaec85396f08) | — | 4 PR runs | | `steamdeck` | ❌ fail (an outlier) | 2 [1](https://beanstalk.magicbean.dev/reports/rp_5b9eba310f6e7da3) [2](https://beanstalk.magicbean.dev/reports/rp_5d6bd429f0908764) | — | none | | `igpu` | ❌ fail (an outlier) | 2 [1](https://beanstalk.magicbean.dev/reports/rp_cae4bade96c2fc86) [2](https://beanstalk.magicbean.dev/reports/rp_81395496252f07d1) | — | none | **`market-and-kokiri`** · frame time p99 (ms) | Target | main | `RX_VK_TEX_CACHE=` (reference) | `RX_VK_TEX_CACHE=1` | | --- | --- | --- | --- | | `nvidia` | 20.4 | 20.6 | 20.6 (+0%) | | `windows+amd` | 19.1 | 19.2 | 19.0 (−1%) | | `linux+radv` | 34.6 | 33.7 | 38.0 (+13%) | | `intel` | — | — | — | | `steamdeck` | 46.8 | 43.2 | 44.6 (+3%) | | `igpu` | 22.5 | 22.6 | 22.8 (+1%) | **Why it failed** - `nvidia`: `market-and-kokiri · RX_VK_TEX_CACHE= (PR only)` `screenshot.max_diff`: `0.1 → 0.8; limit 0.2` - `nvidia`: `market-and-kokiri · RX_VK_TEX_CACHE= (PR only)` `load_time_max_s.max_delta_pct`: `7.7 → 11.2 (+46.1%); limit 30.0` - `nvidia`: `market-and-kokiri · RX_VK_TEX_CACHE= (PR only)` `run_frametime_max_ms.max_delta_pct`: `2,671 → 6,279 (+135.1%); limit 50.0` - `linux+radv`: `market-and-kokiri · RX_VK_TEX_CACHE=1 (PR only)` `market.frametime_p99_ms: RX_VK_TEX_CACHE=1 vs RX_VK_TEX_CACHE= (PR)`: `43.2 → 60.2 (+39.3%); limit 20.0; the PR's own cells: RX_VK_TEX_CACHE=1 against RX_VK_TEX_CACHE= (RX_VK_TEX_CACHE= (PR only))` - `linux+radv`: `market-and-kokiri · RX_VK_TEX_CACHE=1 (PR only)` `kokiri.frametime_p99_ms: RX_VK_TEX_CACHE=1 vs RX_VK_TEX_CACHE= (PR)`: `48.0 → 57.8 (+20.5%); limit 20.0; the PR's own cells: RX_VK_TEX_CACHE=1 against RX_VK_TEX_CACHE= (RX_VK_TEX_CACHE= (PR only))` - `steamdeck`: `market-and-kokiri · RX_VK_TEX_CACHE= (PR only)` `screenshot.max_diff`: `0.8 → 0.3; limit 0.2` - `igpu`: `market-and-kokiri · RX_VK_TEX_CACHE=1 (PR only)` `screenshot.max_diff`: `0.1 → 0.8; limit 0.2` **Couldn't be judged**: the tester's PC could not finish the test. The farm tries another PC, or the same one after a fix; it says nothing about the PR on its own. - `windows+amd`, [report 2](https://beanstalk.magicbean.dev/reports/rp_37e223f4789568f4): `Insufficient frame-time evidence for 12 required comparison(s). See rule results.` - `intel`, [report 1](https://beanstalk.magicbean.dev/reports/rp_6f07ac578a2a5416): `the main base failed (exit 1): Windows doesn't let programs look inside C:\, a folder above the builder's own compiler, so it can't start. Move Longshot's folder out of it (for example to C:\Longshot) and start Longshot from there.` - `intel`, [report 2](https://beanstalk.magicbean.dev/reports/rp_c483aaec85396f08): `Insufficient frame-time evidence for 12 required comparison(s). See rule results.` <details><summary>What was tested</summary> **What will be tested** · AI plan (`gpt-6.1-terra`) The plan compares main with the pull request in Castle Town Market and Kokiri Forest, using two starts per side for each cache setting and about 50 minutes per tester. The cache axis tests both the shipped default and the cost-model-enabled mode across GPU makers, AMD drivers, integrated GPUs and Steam Deck. It measures frame-time tails, hitches and worst frames, and compares stationary screenshots. Crashes, substantial performance regressions or significant picture differences fail the plan; the enabled mode is also compared with the pull request's default. - **Where:** nvidia (1-2 reports), windows+amd (1-2 reports), linux+radv (1-2 reports), intel (1-2 reports), steamdeck (1-2 reports), igpu (1-2 reports). - **Matrix:** 2 cells, each on main and the PR: RX_VK_TEX_CACHE `` or `1` (PR only). - **market-and-kokiri:** from the repository's save `market-entrance`, then teleport to Market, take the picture market to compare with main, move the stick, measure market for 20 s (after 5 s warm-up), teleport to Kokiri Forest, take the picture kokiri to compare with main, measure kokiri for 20 s (after 5 s warm-up); 2 runs on each side for each of 2 cells (2 game starts a run). - **Measured:** crashes, frame times, stutters and hitches, load times. - **The PR fails if:** it crashes; or the PR's frame time (p99) with RX_VK_TEX_CACHE=1 is more than 20% above RX_VK_TEX_CACHE=; or the PR's worst frame time in the whole run with RX_VK_TEX_CACHE=1 is more than 50% above RX_VK_TEX_CACHE=; or a picture differs from main by more than 25%; or longest load is more than 30% above main; or frame time (p99) is more than 20% above main; or worst frame time in the whole run is more than 50% above main; or frame time (worst 1%) is more than 20% above main. - **Time:** about 48 min of game runs per tester (8 game starts), plus the two builds. </details> <details><summary>Measurements on `nvidia`, for the PR description</summary> **Verdict:** fail on nvidia (2 reports): `market-and-kokiri screenshot.max_diff`; `market-and-kokiri load_time_max_s.max_delta_pct (+46.1%)`; `market-and-kokiri run_frametime_max_ms.max_delta_pct (+135.1%)` failed. Hardware: 1: windows+nvidia+nvidia-proprietary+dgpu `NVIDIA GeForce RTX 3080 Ti, 621.24.0` `AMD Ryzen 9 5900X 12-Core Processor, 64 GB RAM`; 2: linux+nvidia+nvidia-proprietary+dgpu `NVIDIA GeForce GTX 1660 Ti, 620.73.4` `Intel(R) Core(TM) i7-10750H CPU @ 2.60GHz, 16 GB RAM` Scene: market-and-kokiri, from the repository's save market-entrance; 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); market-and-kokiri: 2 game starts a side, market 20 s after 5 s warm-up, kokiri 20 s after 5 s warm-up; each number the median of the runs, then of 2 reports How to reproduce: the farm's plan above (`@Beanstalk` on this PR runs it again) | | Before: main @ 94cd0a2 | After: this PR @ 679e25d | |---|---|---| | market-and-kokiri · `RX_VK_TEX_CACHE= (PR only)` · longest load (s) | 12.3 | 13.7 (+11%) | | market-and-kokiri · `RX_VK_TEX_CACHE= (PR only)` · kokiri · frame time (p99) (ms) | 20.4 | 20.6 (+1%) | | market-and-kokiri · `RX_VK_TEX_CACHE= (PR only)` · market · frame time (p99) (ms) | 23.2 | 23.4 (+1%) | | market-and-kokiri · `RX_VK_TEX_CACHE= (PR only)` · worst frame time in the whole run (ms) | 7,870 | 9,335 (+19%) | | market-and-kokiri · `RX_VK_TEX_CACHE= (PR only)` · kokiri · frame time (worst 1%) (ms) | 21.8 | 22.6 (+4%) | | market-and-kokiri · `RX_VK_TEX_CACHE= (PR only)` · market · frame time (worst 1%) (ms) | 27.8 | 27.5 (−1%) | | market-and-kokiri · `RX_VK_TEX_CACHE=1 (PR only)` · longest load (s) | 12.6 | 12.0 (−5%) | | market-and-kokiri · `RX_VK_TEX_CACHE=1 (PR only)` · kokiri · frame time (p99) (ms) | 20.4 | 20.6 (+1%) | | market-and-kokiri · `RX_VK_TEX_CACHE=1 (PR only)` · market · frame time (p99) (ms) | 23.4 | 23.2 (−1%) | | market-and-kokiri · `RX_VK_TEX_CACHE=1 (PR only)` · worst frame time in the whole run (ms) | 8,037 | 7,511 (−7%) | | market-and-kokiri · `RX_VK_TEX_CACHE=1 (PR only)` · kokiri · frame time (worst 1%) (ms) | 21.7 | 22.1 (+2%) | | market-and-kokiri · `RX_VK_TEX_CACHE=1 (PR only)` · market · frame time (worst 1%) (ms) | 28.7 | 28.5 (−1%) | **Flags and settings** | Flag | What it is | Values tried | Before this PR | After this PR | Effect (frame time (p99)) | Helps / doesn't help / untested | |---|---|---|---|---|---|---| | `RX_VK_TEX_CACHE` | switch the PR adds (set on the PR side only) | ``, `1` | not in main | the PR's default | market-and-kokiri, main without it → the PR with : 20.4 → 20.6 (+1%) | no clear effect | As Markdown for the PR description: ```markdown ## Measurements **Verdict:** fail on nvidia (2 reports): `market-and-kokiri screenshot.max_diff`; `market-and-kokiri load_time_max_s.max_delta_pct (+46.1%)`; `market-and-kokiri run_frametime_max_ms.max_delta_pct (+135.1%)` failed. Hardware: 1: windows+nvidia+nvidia-proprietary+dgpu `NVIDIA GeForce RTX 3080 Ti, 621.24.0` `AMD Ryzen 9 5900X 12-Core Processor, 64 GB RAM`; 2: linux+nvidia+nvidia-proprietary+dgpu `NVIDIA GeForce GTX 1660 Ti, 620.73.4` `Intel(R) Core(TM) i7-10750H CPU @ 2.60GHz, 16 GB RAM` Scene: market-and-kokiri, from the repository's save market-entrance; 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); market-and-kokiri: 2 game starts a side, market 20 s after 5 s warm-up, kokiri 20 s after 5 s warm-up; each number the median of the runs, then of 2 reports How to reproduce: the farm's plan above (`@Beanstalk` on this PR runs it again) | | Before: main @ 94cd0a2 | After: this PR @ 679e25d | |---|---|---| | market-and-kokiri · `RX_VK_TEX_CACHE= (PR only)` · longest load (s) | 12.3 | 13.7 (+11%) | | market-and-kokiri · `RX_VK_TEX_CACHE= (PR only)` · kokiri · frame time (p99) (ms) | 20.4 | 20.6 (+1%) | | market-and-kokiri · `RX_VK_TEX_CACHE= (PR only)` · market · frame time (p99) (ms) | 23.2 | 23.4 (+1%) | | market-and-kokiri · `RX_VK_TEX_CACHE= (PR only)` · worst frame time in the whole run (ms) | 7,870 | 9,335 (+19%) | | market-and-kokiri · `RX_VK_TEX_CACHE= (PR only)` · kokiri · frame time (worst 1%) (ms) | 21.8 | 22.6 (+4%) | | market-and-kokiri · `RX_VK_TEX_CACHE= (PR only)` · market · frame time (worst 1%) (ms) | 27.8 | 27.5 (−1%) | | market-and-kokiri · `RX_VK_TEX_CACHE=1 (PR only)` · longest load (s) | 12.6 | 12.0 (−5%) | | market-and-kokiri · `RX_VK_TEX_CACHE=1 (PR only)` · kokiri · frame time (p99) (ms) | 20.4 | 20.6 (+1%) | | market-and-kokiri · `RX_VK_TEX_CACHE=1 (PR only)` · market · frame time (p99) (ms) | 23.4 | 23.2 (−1%) | | market-and-kokiri · `RX_VK_TEX_CACHE=1 (PR only)` · worst frame time in the whole run (ms) | 8,037 | 7,511 (−7%) | | market-and-kokiri · `RX_VK_TEX_CACHE=1 (PR only)` · kokiri · frame time (worst 1%) (ms) | 21.7 | 22.1 (+2%) | | market-and-kokiri · `RX_VK_TEX_CACHE=1 (PR only)` · market · frame time (worst 1%) (ms) | 28.7 | 28.5 (−1%) | **Flags and settings** | Flag | What it is | Values tried | Before this PR | After this PR | Effect (frame time (p99)) | Helps / doesn't help / untested | |---|---|---|---|---|---|---| | `RX_VK_TEX_CACHE` | switch the PR adds (set on the PR side only) | ``, `1` | not in main | the PR's default | market-and-kokiri, main without it → the PR with : 20.4 → 20.6 (+1%) | no clear effect | ``` </details> <details><summary>Measurements on `windows+amd`, for the PR description</summary> **Verdict:** pass on windows+amd (2 reports): no rule failed and no PR run crashed. Hardware: 1: windows+amd+amd-proprietary+dgpu `AMD Radeon RX 9070 XT, 2.0.416` `AMD Ryzen 7 5800X3D 8-Core Processor, 32 GB RAM`; 2: windows+amd+amd-proprietary+igpu `AMD Radeon Graphics, 2.0.388` `AMD Ryzen Z1 Extreme, 16 GB RAM` Scene: market-and-kokiri, from the repository's save market-entrance; 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); market-and-kokiri: 2 game starts a side, market 20 s after 5 s warm-up, kokiri 20 s after 5 s warm-up; each number the median of the runs, then of 2 reports How to reproduce: the farm's plan above (`@Beanstalk` on this PR runs it again) | | Before: main @ 94cd0a2 | After: this PR @ 679e25d | |---|---|---| | market-and-kokiri · `RX_VK_TEX_CACHE= (PR only)` · longest load (s) | 8.5 | 6.5 (−23%) | | market-and-kokiri · `RX_VK_TEX_CACHE= (PR only)` · kokiri · frame time (p99) (ms) | 19.1 | 19.2 (+1%) | | market-and-kokiri · `RX_VK_TEX_CACHE= (PR only)` · market · frame time (p99) (ms) | 20.4 | 20.5 (+0%) | | market-and-kokiri · `RX_VK_TEX_CACHE= (PR only)` · worst frame time in the whole run (ms) | 2,603 | 2,524 (−3%) | | market-and-kokiri · `RX_VK_TEX_CACHE= (PR only)` · kokiri · frame time (worst 1%) (ms) | 19.8 | 21.3 (+8%) | | market-and-kokiri · `RX_VK_TEX_CACHE= (PR only)` · market · frame time (worst 1%) (ms) | 25.0 | 21.0 (−16%) | | market-and-kokiri · `RX_VK_TEX_CACHE=1 (PR only)` · longest load (s) | 6.7 | 6.7 (−1%) | | market-and-kokiri · `RX_VK_TEX_CACHE=1 (PR only)` · kokiri · frame time (p99) (ms) | 19.2 | 19.0 (−1%) | | market-and-kokiri · `RX_VK_TEX_CACHE=1 (PR only)` · market · frame time (p99) (ms) | 20.8 | 20.3 (−3%) | | market-and-kokiri · `RX_VK_TEX_CACHE=1 (PR only)` · worst frame time in the whole run (ms) | 2,526 | 2,406 (−5%) | | market-and-kokiri · `RX_VK_TEX_CACHE=1 (PR only)` · kokiri · frame time (worst 1%) (ms) | 21.8 | 20.7 (−5%) | | market-and-kokiri · `RX_VK_TEX_CACHE=1 (PR only)` · market · frame time (worst 1%) (ms) | 28.6 | 21.0 (−26%) | **Flags and settings** | Flag | What it is | Values tried | Before this PR | After this PR | Effect (frame time (p99)) | Helps / doesn't help / untested | |---|---|---|---|---|---|---| | `RX_VK_TEX_CACHE` | switch the PR adds (set on the PR side only) | ``, `1` | not in main | the PR's default | market-and-kokiri, main without it → the PR with : 19.1 → 19.2 (+1%) | no clear effect | As Markdown for the PR description: ```markdown ## Measurements **Verdict:** pass on windows+amd (2 reports): no rule failed and no PR run crashed. Hardware: 1: windows+amd+amd-proprietary+dgpu `AMD Radeon RX 9070 XT, 2.0.416` `AMD Ryzen 7 5800X3D 8-Core Processor, 32 GB RAM`; 2: windows+amd+amd-proprietary+igpu `AMD Radeon Graphics, 2.0.388` `AMD Ryzen Z1 Extreme, 16 GB RAM` Scene: market-and-kokiri, from the repository's save market-entrance; 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); market-and-kokiri: 2 game starts a side, market 20 s after 5 s warm-up, kokiri 20 s after 5 s warm-up; each number the median of the runs, then of 2 reports How to reproduce: the farm's plan above (`@Beanstalk` on this PR runs it again) | | Before: main @ 94cd0a2 | After: this PR @ 679e25d | |---|---|---| | market-and-kokiri · `RX_VK_TEX_CACHE= (PR only)` · longest load (s) | 8.5 | 6.5 (−23%) | | market-and-kokiri · `RX_VK_TEX_CACHE= (PR only)` · kokiri · frame time (p99) (ms) | 19.1 | 19.2 (+1%) | | market-and-kokiri · `RX_VK_TEX_CACHE= (PR only)` · market · frame time (p99) (ms) | 20.4 | 20.5 (+0%) | | market-and-kokiri · `RX_VK_TEX_CACHE= (PR only)` · worst frame time in the whole run (ms) | 2,603 | 2,524 (−3%) | | market-and-kokiri · `RX_VK_TEX_CACHE= (PR only)` · kokiri · frame time (worst 1%) (ms) | 19.8 | 21.3 (+8%) | | market-and-kokiri · `RX_VK_TEX_CACHE= (PR only)` · market · frame time (worst 1%) (ms) | 25.0 | 21.0 (−16%) | | market-and-kokiri · `RX_VK_TEX_CACHE=1 (PR only)` · longest load (s) | 6.7 | 6.7 (−1%) | | market-and-kokiri · `RX_VK_TEX_CACHE=1 (PR only)` · kokiri · frame time (p99) (ms) | 19.2 | 19.0 (−1%) | | market-and-kokiri · `RX_VK_TEX_CACHE=1 (PR only)` · market · frame time (p99) (ms) | 20.8 | 20.3 (−3%) | | market-and-kokiri · `RX_VK_TEX_CACHE=1 (PR only)` · worst frame time in the whole run (ms) | 2,526 | 2,406 (−5%) | | market-and-kokiri · `RX_VK_TEX_CACHE=1 (PR only)` · kokiri · frame time (worst 1%) (ms) | 21.8 | 20.7 (−5%) | | market-and-kokiri · `RX_VK_TEX_CACHE=1 (PR only)` · market · frame time (worst 1%) (ms) | 28.6 | 21.0 (−26%) | **Flags and settings** | Flag | What it is | Values tried | Before this PR | After this PR | Effect (frame time (p99)) | Helps / doesn't help / untested | |---|---|---|---|---|---|---| | `RX_VK_TEX_CACHE` | switch the PR adds (set on the PR side only) | ``, `1` | not in main | the PR's default | market-and-kokiri, main without it → the PR with : 19.1 → 19.2 (+1%) | no clear effect | ``` </details> <details><summary>Measurements on `linux+radv`, for the PR description</summary> **Verdict:** fail on linux+radv (2 reports): `market-and-kokiri market.frametime_p99_ms: RX_VK_TEX_CACHE=1 vs RX_VK_TEX_CACHE= (PR) (+39.3%)`; `market-and-kokiri kokiri.frametime_p99_ms: RX_VK_TEX_CACHE=1 vs RX_VK_TEX_CACHE= (PR) (+20.5%)` failed. Hardware: 1: linux+amd+radv+dgpu `AMD Radeon RX 580 Series (RADV POLARIS10), 26.2.7` `AMD Ryzen 5 5500F 6-Core Processor, 32 GB RAM`; 2: linux+amd+radv+dgpu `AMD Radeon RX 7900 XTX (RADV NAVI31), 26.3.1` `AMD Ryzen 7 7800X3D 8-Core Processor, 32 GB RAM` Scene: market-and-kokiri, from the repository's save market-entrance; 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); market-and-kokiri: 2 game starts a side, market 20 s after 5 s warm-up, kokiri 20 s after 5 s warm-up; each number the median of the runs, then of 2 reports How to reproduce: the farm's plan above (`@Beanstalk` on this PR runs it again) | | Before: main @ 94cd0a2 | After: this PR @ 679e25d | |---|---|---| | market-and-kokiri · `RX_VK_TEX_CACHE= (PR only)` · longest load (s) | 6.2 | 6.0 (−4%) | | market-and-kokiri · `RX_VK_TEX_CACHE= (PR only)` · kokiri · frame time (p99) (ms) | 34.6 | 33.7 (−3%) | | market-and-kokiri · `RX_VK_TEX_CACHE= (PR only)` · market · frame time (p99) (ms) | 36.7 | 32.1 (−13%) | | market-and-kokiri · `RX_VK_TEX_CACHE= (PR only)` · worst frame time in the whole run (ms) | 2,183 | 2,162 (−1%) | | market-and-kokiri · `RX_VK_TEX_CACHE= (PR only)` · kokiri · frame time (worst 1%) (ms) | 39.6 | 37.8 (−5%) | | market-and-kokiri · `RX_VK_TEX_CACHE= (PR only)` · market · frame time (worst 1%) (ms) | 46.7 | 37.3 (−20%) | | market-and-kokiri · `RX_VK_TEX_CACHE=1 (PR only)` · longest load (s) | 5.6 | 5.6 (+0%) | | market-and-kokiri · `RX_VK_TEX_CACHE=1 (PR only)` · kokiri · frame time (p99) (ms) | 34.2 | 38.0 (+11%) | | market-and-kokiri · `RX_VK_TEX_CACHE=1 (PR only)` · market · frame time (p99) (ms) | 40.0 | 40.2 (+0%) | | market-and-kokiri · `RX_VK_TEX_CACHE=1 (PR only)` · worst frame time in the whole run (ms) | 2,091 | 2,021 (−3%) | | market-and-kokiri · `RX_VK_TEX_CACHE=1 (PR only)` · kokiri · frame time (worst 1%) (ms) | 39.8 | 42.3 (+6%) | | market-and-kokiri · `RX_VK_TEX_CACHE=1 (PR only)` · market · frame time (worst 1%) (ms) | 47.7 | 50.9 (+7%) | **Flags and settings** | Flag | What it is | Values tried | Before this PR | After this PR | Effect (frame time (p99)) | Helps / doesn't help / untested | |---|---|---|---|---|---|---| | `RX_VK_TEX_CACHE` | switch the PR adds (set on the PR side only) | ``, `1` | not in main | the PR's default | market-and-kokiri, main without it → the PR with : 34.6 → 33.7 (−3%) | helps | As Markdown for the PR description: ```markdown ## Measurements **Verdict:** fail on linux+radv (2 reports): `market-and-kokiri market.frametime_p99_ms: RX_VK_TEX_CACHE=1 vs RX_VK_TEX_CACHE= (PR) (+39.3%)`; `market-and-kokiri kokiri.frametime_p99_ms: RX_VK_TEX_CACHE=1 vs RX_VK_TEX_CACHE= (PR) (+20.5%)` failed. Hardware: 1: linux+amd+radv+dgpu `AMD Radeon RX 580 Series (RADV POLARIS10), 26.2.7` `AMD Ryzen 5 5500F 6-Core Processor, 32 GB RAM`; 2: linux+amd+radv+dgpu `AMD Radeon RX 7900 XTX (RADV NAVI31), 26.3.1` `AMD Ryzen 7 7800X3D 8-Core Processor, 32 GB RAM` Scene: market-and-kokiri, from the repository's save market-entrance; 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); market-and-kokiri: 2 game starts a side, market 20 s after 5 s warm-up, kokiri 20 s after 5 s warm-up; each number the median of the runs, then of 2 reports How to reproduce: the farm's plan above (`@Beanstalk` on this PR runs it again) | | Before: main @ 94cd0a2 | After: this PR @ 679e25d | |---|---|---| | market-and-kokiri · `RX_VK_TEX_CACHE= (PR only)` · longest load (s) | 6.2 | 6.0 (−4%) | | market-and-kokiri · `RX_VK_TEX_CACHE= (PR only)` · kokiri · frame time (p99) (ms) | 34.6 | 33.7 (−3%) | | market-and-kokiri · `RX_VK_TEX_CACHE= (PR only)` · market · frame time (p99) (ms) | 36.7 | 32.1 (−13%) | | market-and-kokiri · `RX_VK_TEX_CACHE= (PR only)` · worst frame time in the whole run (ms) | 2,183 | 2,162 (−1%) | | market-and-kokiri · `RX_VK_TEX_CACHE= (PR only)` · kokiri · frame time (worst 1%) (ms) | 39.6 | 37.8 (−5%) | | market-and-kokiri · `RX_VK_TEX_CACHE= (PR only)` · market · frame time (worst 1%) (ms) | 46.7 | 37.3 (−20%) | | market-and-kokiri · `RX_VK_TEX_CACHE=1 (PR only)` · longest load (s) | 5.6 | 5.6 (+0%) | | market-and-kokiri · `RX_VK_TEX_CACHE=1 (PR only)` · kokiri · frame time (p99) (ms) | 34.2 | 38.0 (+11%) | | market-and-kokiri · `RX_VK_TEX_CACHE=1 (PR only)` · market · frame time (p99) (ms) | 40.0 | 40.2 (+0%) | | market-and-kokiri · `RX_VK_TEX_CACHE=1 (PR only)` · worst frame time in the whole run (ms) | 2,091 | 2,021 (−3%) | | market-and-kokiri · `RX_VK_TEX_CACHE=1 (PR only)` · kokiri · frame time (worst 1%) (ms) | 39.8 | 42.3 (+6%) | | market-and-kokiri · `RX_VK_TEX_CACHE=1 (PR only)` · market · frame time (worst 1%) (ms) | 47.7 | 50.9 (+7%) | **Flags and settings** | Flag | What it is | Values tried | Before this PR | After this PR | Effect (frame time (p99)) | Helps / doesn't help / untested | |---|---|---|---|---|---|---| | `RX_VK_TEX_CACHE` | switch the PR adds (set on the PR side only) | ``, `1` | not in main | the PR's default | market-and-kokiri, main without it → the PR with : 34.6 → 33.7 (−3%) | helps | ``` </details> <details><summary>Measurements on `intel`, for the PR description</summary> **Verdict:** could not be judged on intel (2 reports): required frame-time comparison inconclusive (fewer than two usable starts per side). Hardware: 1: windows+intel+intel-proprietary+dgpu `Intel(R) Arc(TM) B580 Graphics, 0.406.983` `AMD Ryzen 5 9600X 6-Core Processor, 16 GB RAM`; 2: windows+intel+intel-proprietary+dgpu+xess `Intel(R) Arc(TM) B580 Graphics, 0.406.983` `AMD Ryzen 5 9600X 6-Core Processor, 16 GB RAM` Scene: market-and-kokiri, from the repository's save market-entrance; 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); market-and-kokiri: 2 game starts a side, market 20 s after 5 s warm-up, kokiri 20 s after 5 s warm-up; each number the median of the runs, then of 2 reports How to reproduce: the farm's plan above (`@Beanstalk` on this PR runs it again) | | Before: main @ 94cd0a2 | After: this PR @ 679e25d | |---|---|---| | market-and-kokiri · `RX_VK_TEX_CACHE= (PR only)` · worst frame time in the whole run (ms) | 109.6 | 120.4 (+10%) | | market-and-kokiri · `RX_VK_TEX_CACHE=1 (PR only)` · worst frame time in the whole run (ms) | 107.6 | 110.7 (+3%) | **Flags and settings** | Flag | What it is | Values tried | Before this PR | After this PR | Effect (frame time (p99)) | Helps / doesn't help / untested | |---|---|---|---|---|---|---| | `RX_VK_TEX_CACHE` | switch the PR adds (set on the PR side only) | ``, `1` | not in main | the PR's default | market-and-kokiri, main without it → the PR with : not measured | untested | As Markdown for the PR description: ```markdown ## Measurements **Verdict:** could not be judged on intel (2 reports): required frame-time comparison inconclusive (fewer than two usable starts per side). Hardware: 1: windows+intel+intel-proprietary+dgpu `Intel(R) Arc(TM) B580 Graphics, 0.406.983` `AMD Ryzen 5 9600X 6-Core Processor, 16 GB RAM`; 2: windows+intel+intel-proprietary+dgpu+xess `Intel(R) Arc(TM) B580 Graphics, 0.406.983` `AMD Ryzen 5 9600X 6-Core Processor, 16 GB RAM` Scene: market-and-kokiri, from the repository's save market-entrance; 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); market-and-kokiri: 2 game starts a side, market 20 s after 5 s warm-up, kokiri 20 s after 5 s warm-up; each number the median of the runs, then of 2 reports How to reproduce: the farm's plan above (`@Beanstalk` on this PR runs it again) | | Before: main @ 94cd0a2 | After: this PR @ 679e25d | |---|---|---| | market-and-kokiri · `RX_VK_TEX_CACHE= (PR only)` · worst frame time in the whole run (ms) | 109.6 | 120.4 (+10%) | | market-and-kokiri · `RX_VK_TEX_CACHE=1 (PR only)` · worst frame time in the whole run (ms) | 107.6 | 110.7 (+3%) | **Flags and settings** | Flag | What it is | Values tried | Before this PR | After this PR | Effect (frame time (p99)) | Helps / doesn't help / untested | |---|---|---|---|---|---|---| | `RX_VK_TEX_CACHE` | switch the PR adds (set on the PR side only) | ``, `1` | not in main | the PR's default | market-and-kokiri, main without it → the PR with : not measured | untested | ``` </details> <details><summary>Measurements on `steamdeck`, for the PR description</summary> **Verdict:** fail on steamdeck (2 reports): `market-and-kokiri screenshot.max_diff` failed. Hardware: 1: linux+amd+radv+igpu+handheld `AMD Custom GPU 0405 (RADV VANGOGH), 26.1.99` `AMD Custom APU 0405, 12 GB RAM`; 2: linux+amd+radv+igpu+handheld `AMD Custom GPU 0405 (RADV VANGOGH), 26.1.99` `AMD Custom APU 0405, 12 GB RAM` Scene: market-and-kokiri, from the repository's save market-entrance; 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); market-and-kokiri: 2 game starts a side, market 20 s after 5 s warm-up, kokiri 20 s after 5 s warm-up; each number the median of the runs, then of 2 reports How to reproduce: the farm's plan above (`@Beanstalk` on this PR runs it again) | | Before: main @ 94cd0a2 | After: this PR @ 679e25d | |---|---|---| | market-and-kokiri · `RX_VK_TEX_CACHE= (PR only)` · longest load (s) | 10.3 | 9.7 (−6%) | | market-and-kokiri · `RX_VK_TEX_CACHE= (PR only)` · kokiri · frame time (p99) (ms) | 46.8 | 43.2 (−8%) | | market-and-kokiri · `RX_VK_TEX_CACHE= (PR only)` · market · frame time (p99) (ms) | 81.5 | 65.3 (−20%) | | market-and-kokiri · `RX_VK_TEX_CACHE= (PR only)` · worst frame time in the whole run (ms) | 4,674 | 4,880 (+4%) | | market-and-kokiri · `RX_VK_TEX_CACHE= (PR only)` · kokiri · frame time (worst 1%) (ms) | 54.9 | 49.1 (−11%) | | market-and-kokiri · `RX_VK_TEX_CACHE= (PR only)` · market · frame time (worst 1%) (ms) | 188.7 | 166.4 (−12%) | | market-and-kokiri · `RX_VK_TEX_CACHE=1 (PR only)` · longest load (s) | 9.6 | 9.3 (−4%) | | market-and-kokiri · `RX_VK_TEX_CACHE=1 (PR only)` · kokiri · frame time (p99) (ms) | 44.9 | 44.6 (−1%) | | market-and-kokiri · `RX_VK_TEX_CACHE=1 (PR only)` · market · frame time (p99) (ms) | 65.5 | 48.4 (−26%) | | market-and-kokiri · `RX_VK_TEX_CACHE=1 (PR only)` · worst frame time in the whole run (ms) | 5,193 | 5,235 (+1%) | | market-and-kokiri · `RX_VK_TEX_CACHE=1 (PR only)` · kokiri · frame time (worst 1%) (ms) | 49.2 | 50.1 (+2%) | | market-and-kokiri · `RX_VK_TEX_CACHE=1 (PR only)` · market · frame time (worst 1%) (ms) | 146.3 | 54.3 (−63%) | **Flags and settings** | Flag | What it is | Values tried | Before this PR | After this PR | Effect (frame time (p99)) | Helps / doesn't help / untested | |---|---|---|---|---|---|---| | `RX_VK_TEX_CACHE` | switch the PR adds (set on the PR side only) | ``, `1` | not in main | the PR's default | market-and-kokiri, main without it → the PR with : 46.8 → 43.2 (−8%) | helps | As Markdown for the PR description: ```markdown ## Measurements **Verdict:** fail on steamdeck (2 reports): `market-and-kokiri screenshot.max_diff` failed. Hardware: 1: linux+amd+radv+igpu+handheld `AMD Custom GPU 0405 (RADV VANGOGH), 26.1.99` `AMD Custom APU 0405, 12 GB RAM`; 2: linux+amd+radv+igpu+handheld `AMD Custom GPU 0405 (RADV VANGOGH), 26.1.99` `AMD Custom APU 0405, 12 GB RAM` Scene: market-and-kokiri, from the repository's save market-entrance; 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); market-and-kokiri: 2 game starts a side, market 20 s after 5 s warm-up, kokiri 20 s after 5 s warm-up; each number the median of the runs, then of 2 reports How to reproduce: the farm's plan above (`@Beanstalk` on this PR runs it again) | | Before: main @ 94cd0a2 | After: this PR @ 679e25d | |---|---|---| | market-and-kokiri · `RX_VK_TEX_CACHE= (PR only)` · longest load (s) | 10.3 | 9.7 (−6%) | | market-and-kokiri · `RX_VK_TEX_CACHE= (PR only)` · kokiri · frame time (p99) (ms) | 46.8 | 43.2 (−8%) | | market-and-kokiri · `RX_VK_TEX_CACHE= (PR only)` · market · frame time (p99) (ms) | 81.5 | 65.3 (−20%) | | market-and-kokiri · `RX_VK_TEX_CACHE= (PR only)` · worst frame time in the whole run (ms) | 4,674 | 4,880 (+4%) | | market-and-kokiri · `RX_VK_TEX_CACHE= (PR only)` · kokiri · frame time (worst 1%) (ms) | 54.9 | 49.1 (−11%) | | market-and-kokiri · `RX_VK_TEX_CACHE= (PR only)` · market · frame time (worst 1%) (ms) | 188.7 | 166.4 (−12%) | | market-and-kokiri · `RX_VK_TEX_CACHE=1 (PR only)` · longest load (s) | 9.6 | 9.3 (−4%) | | market-and-kokiri · `RX_VK_TEX_CACHE=1 (PR only)` · kokiri · frame time (p99) (ms) | 44.9 | 44.6 (−1%) | | market-and-kokiri · `RX_VK_TEX_CACHE=1 (PR only)` · market · frame time (p99) (ms) | 65.5 | 48.4 (−26%) | | market-and-kokiri · `RX_VK_TEX_CACHE=1 (PR only)` · worst frame time in the whole run (ms) | 5,193 | 5,235 (+1%) | | market-and-kokiri · `RX_VK_TEX_CACHE=1 (PR only)` · kokiri · frame time (worst 1%) (ms) | 49.2 | 50.1 (+2%) | | market-and-kokiri · `RX_VK_TEX_CACHE=1 (PR only)` · market · frame time (worst 1%) (ms) | 146.3 | 54.3 (−63%) | **Flags and settings** | Flag | What it is | Values tried | Before this PR | After this PR | Effect (frame time (p99)) | Helps / doesn't help / untested | |---|---|---|---|---|---|---| | `RX_VK_TEX_CACHE` | switch the PR adds (set on the PR side only) | ``, `1` | not in main | the PR's default | market-and-kokiri, main without it → the PR with : 46.8 → 43.2 (−8%) | helps | ``` </details> <details><summary>Measurements on `igpu`, for the PR description</summary> **Verdict:** fail on igpu (2 reports): `market-and-kokiri screenshot.max_diff` failed. Hardware: 1: linux+amd+radv+igpu `AMD Radeon 890M Graphics (RADV STRIX1), 26.1.99` `AMD Ryzen Z2 Extreme, 32 GB RAM`; 2: linux+amd+radv+igpu `AMD Radeon 8060S Graphics (RADV STRIX_HALO), 26.99.99` `AMD RYZEN AI MAX+ 395 w/ Radeon 8060S, 64 GB RAM` Scene: market-and-kokiri, from the repository's save market-entrance; 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); market-and-kokiri: 2 game starts a side, market 20 s after 5 s warm-up, kokiri 20 s after 5 s warm-up; each number the median of the runs, then of 2 reports How to reproduce: the farm's plan above (`@Beanstalk` on this PR runs it again) | | Before: main @ 94cd0a2 | After: this PR @ 679e25d | |---|---|---| | market-and-kokiri · `RX_VK_TEX_CACHE= (PR only)` · longest load (s) | 5.8 | 5.6 (−3%) | | market-and-kokiri · `RX_VK_TEX_CACHE= (PR only)` · kokiri · frame time (p99) (ms) | 22.5 | 22.6 (+1%) | | market-and-kokiri · `RX_VK_TEX_CACHE= (PR only)` · market · frame time (p99) (ms) | 22.9 | 23.2 (+1%) | | market-and-kokiri · `RX_VK_TEX_CACHE= (PR only)` · worst frame time in the whole run (ms) | 1,983 | 1,789 (−10%) | | market-and-kokiri · `RX_VK_TEX_CACHE= (PR only)` · kokiri · frame time (worst 1%) (ms) | 27.1 | 23.2 (−14%) | | market-and-kokiri · `RX_VK_TEX_CACHE= (PR only)` · market · frame time (worst 1%) (ms) | 28.3 | 30.6 (+8%) | | market-and-kokiri · `RX_VK_TEX_CACHE=1 (PR only)` · longest load (s) | 5.3 | 5.1 (−4%) | | market-and-kokiri · `RX_VK_TEX_CACHE=1 (PR only)` · kokiri · frame time (p99) (ms) | 22.9 | 22.8 (−1%) | | market-and-kokiri · `RX_VK_TEX_CACHE=1 (PR only)` · market · frame time (p99) (ms) | 22.9 | 23.3 (+2%) | | market-and-kokiri · `RX_VK_TEX_CACHE=1 (PR only)` · worst frame time in the whole run (ms) | 1,686 | 1,787 (+6%) | | market-and-kokiri · `RX_VK_TEX_CACHE=1 (PR only)` · kokiri · frame time (worst 1%) (ms) | 25.5 | 23.5 (−8%) | | market-and-kokiri · `RX_VK_TEX_CACHE=1 (PR only)` · market · frame time (worst 1%) (ms) | 26.5 | 28.4 (+7%) | **Flags and settings** | Flag | What it is | Values tried | Before this PR | After this PR | Effect (frame time (p99)) | Helps / doesn't help / untested | |---|---|---|---|---|---|---| | `RX_VK_TEX_CACHE` | switch the PR adds (set on the PR side only) | ``, `1` | not in main | the PR's default | market-and-kokiri, main without it → the PR with : 22.5 → 22.6 (+1%) | no clear effect | As Markdown for the PR description: ```markdown ## Measurements **Verdict:** fail on igpu (2 reports): `market-and-kokiri screenshot.max_diff` failed. Hardware: 1: linux+amd+radv+igpu `AMD Radeon 890M Graphics (RADV STRIX1), 26.1.99` `AMD Ryzen Z2 Extreme, 32 GB RAM`; 2: linux+amd+radv+igpu `AMD Radeon 8060S Graphics (RADV STRIX_HALO), 26.99.99` `AMD RYZEN AI MAX+ 395 w/ Radeon 8060S, 64 GB RAM` Scene: market-and-kokiri, from the repository's save market-entrance; 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); market-and-kokiri: 2 game starts a side, market 20 s after 5 s warm-up, kokiri 20 s after 5 s warm-up; each number the median of the runs, then of 2 reports How to reproduce: the farm's plan above (`@Beanstalk` on this PR runs it again) | | Before: main @ 94cd0a2 | After: this PR @ 679e25d | |---|---|---| | market-and-kokiri · `RX_VK_TEX_CACHE= (PR only)` · longest load (s) | 5.8 | 5.6 (−3%) | | market-and-kokiri · `RX_VK_TEX_CACHE= (PR only)` · kokiri · frame time (p99) (ms) | 22.5 | 22.6 (+1%) | | market-and-kokiri · `RX_VK_TEX_CACHE= (PR only)` · market · frame time (p99) (ms) | 22.9 | 23.2 (+1%) | | market-and-kokiri · `RX_VK_TEX_CACHE= (PR only)` · worst frame time in the whole run (ms) | 1,983 | 1,789 (−10%) | | market-and-kokiri · `RX_VK_TEX_CACHE= (PR only)` · kokiri · frame time (worst 1%) (ms) | 27.1 | 23.2 (−14%) | | market-and-kokiri · `RX_VK_TEX_CACHE= (PR only)` · market · frame time (worst 1%) (ms) | 28.3 | 30.6 (+8%) | | market-and-kokiri · `RX_VK_TEX_CACHE=1 (PR only)` · longest load (s) | 5.3 | 5.1 (−4%) | | market-and-kokiri · `RX_VK_TEX_CACHE=1 (PR only)` · kokiri · frame time (p99) (ms) | 22.9 | 22.8 (−1%) | | market-and-kokiri · `RX_VK_TEX_CACHE=1 (PR only)` · market · frame time (p99) (ms) | 22.9 | 23.3 (+2%) | | market-and-kokiri · `RX_VK_TEX_CACHE=1 (PR only)` · worst frame time in the whole run (ms) | 1,686 | 1,787 (+6%) | | market-and-kokiri · `RX_VK_TEX_CACHE=1 (PR only)` · kokiri · frame time (worst 1%) (ms) | 25.5 | 23.5 (−8%) | | market-and-kokiri · `RX_VK_TEX_CACHE=1 (PR only)` · market · frame time (worst 1%) (ms) | 26.5 | 28.4 (+7%) | **Flags and settings** | Flag | What it is | Values tried | Before this PR | After this PR | Effect (frame time (p99)) | Helps / doesn't help / untested | |---|---|---|---|---|---|---| | `RX_VK_TEX_CACHE` | switch the PR adds (set on the PR side only) | ``, `1` | not in main | the PR's default | market-and-kokiri, main without it → the PR with : 22.5 → 22.6 (+1%) | no clear effect | ``` </details> <details><summary>The testers' hardware</summary> | Target | Report | Ran on | | --- | --- | --- | | `nvidia` | [1](https://beanstalk.magicbean.dev/reports/rp_23471421ff7a855a) | windows+nvidia+nvidia-proprietary+dgpu `NVIDIA GeForce RTX 3080 Ti, 621.24.0` `AMD Ryzen 9 5900X 12-Core Processor, 64 GB RAM` | | `nvidia` | [2](https://beanstalk.magicbean.dev/reports/rp_b096b57362880066) | linux+nvidia+nvidia-proprietary+dgpu `NVIDIA GeForce GTX 1660 Ti, 620.73.4` `Intel(R) Core(TM) i7-10750H CPU @ 2.60GHz, 16 GB RAM` | | `windows+amd` | [1](https://beanstalk.magicbean.dev/reports/rp_7eac6de30b54c44c) | windows+amd+amd-proprietary+dgpu `AMD Radeon RX 9070 XT, 2.0.416` `AMD Ryzen 7 5800X3D 8-Core Processor, 32 GB RAM` | | `windows+amd` | [2](https://beanstalk.magicbean.dev/reports/rp_37e223f4789568f4) | windows+amd+amd-proprietary+igpu `AMD Radeon Graphics, 2.0.388` `AMD Ryzen Z1 Extreme, 16 GB RAM` | | `linux+radv` | [1](https://beanstalk.magicbean.dev/reports/rp_666a988b1d3efc21) | linux+amd+radv+dgpu `AMD Radeon RX 580 Series (RADV POLARIS10), 26.2.7` `AMD Ryzen 5 5500F 6-Core Processor, 32 GB RAM` | | `linux+radv` | [2](https://beanstalk.magicbean.dev/reports/rp_09b2579ada653093) | linux+amd+radv+dgpu `AMD Radeon RX 7900 XTX (RADV NAVI31), 26.3.1` `AMD Ryzen 7 7800X3D 8-Core Processor, 32 GB RAM` | | `intel` | [1](https://beanstalk.magicbean.dev/reports/rp_6f07ac578a2a5416) | windows+intel+intel-proprietary+dgpu `Intel(R) Arc(TM) B580 Graphics, 0.406.983` `AMD Ryzen 5 9600X 6-Core Processor, 16 GB RAM` | | `intel` | [2](https://beanstalk.magicbean.dev/reports/rp_c483aaec85396f08) | windows+intel+intel-proprietary+dgpu+xess `Intel(R) Arc(TM) B580 Graphics, 0.406.983` `AMD Ryzen 5 9600X 6-Core Processor, 16 GB RAM` | | `steamdeck` | [1](https://beanstalk.magicbean.dev/reports/rp_5b9eba310f6e7da3) | linux+amd+radv+igpu+handheld `AMD Custom GPU 0405 (RADV VANGOGH), 26.1.99` `AMD Custom APU 0405, 12 GB RAM` | | `steamdeck` | [2](https://beanstalk.magicbean.dev/reports/rp_5d6bd429f0908764) | linux+amd+radv+igpu+handheld `AMD Custom GPU 0405 (RADV VANGOGH), 26.1.99` `AMD Custom APU 0405, 12 GB RAM` | | `igpu` | [1](https://beanstalk.magicbean.dev/reports/rp_cae4bade96c2fc86) | linux+amd+radv+igpu `AMD Radeon 890M Graphics (RADV STRIX1), 26.1.99` `AMD Ryzen Z2 Extreme, 32 GB RAM` | | `igpu` | [2](https://beanstalk.magicbean.dev/reports/rp_81395496252f07d1) | linux+amd+radv+igpu `AMD Radeon 8060S Graphics (RADV STRIX_HALO), 26.99.99` `AMD RYZEN AI MAX+ 395 w/ Radeon 8060S, 64 GB RAM` | </details>
BeanBot left a comment

Recommendation: Request changes. An inaccessible cache directory can terminate the game, and the enabled cost model uses a decoder rate the PR identifies as obsolete. The reported Raphael runs show substantially more slow-upload time with the warm cache; a gain for this implementation remains unproven.

The change optionally stores GPU-decoded ASTC textures on disk and reloads them on later runs. It adds a bounded store, validation and GPU copy tests, but also adds synchronous file reads, background I/O and read-back memory; the cache is off by default.

Blocking (2): must change before merging.

  1. L1 gpu/vk/tex_cache.cpp:123: The recovery path uses the throwing filesystem overload after directory creation fails, so a cache setup error can terminate the process. (more on the line) Do: Use the error-code overload of is_directory and treat any status error as an unavailable cache; add a store test for an inaccessible or otherwise failing directory.
  2. L2 gpu/vk/tex_cache.h:348: The integrated-GPU cost model still seeds decode speed from the old decoder, causing it to select file reads that are slower than the current decode. (more on the line) Do: Seed the model conservatively for the current decoder, or defer cache reads until representative decode and read rates have been learned; update the cost-model test for that behavior.

Should fix (1): not blocking, but worth doing before merging.

  • L3 tests/tex_cache_store_test.cpp:73: The store test constructs its Windows temporary path from narrow argv, so it does not reliably preserve Unicode paths. (more on the line) Do: Accept the Windows arguments as wide strings and construct the filesystem path from them; apply the same treatment to the GPU fixture's vector and cache paths.

Testing before merging (2) (runs on the systems it can change; it doesn't hold the recommendation)

  • L4 gpu/vk/tex_cache.h:373: The intended performance benefit has not been demonstrated for this implementation on the system where it is expected to help. (more on the line) Do: Run interleaved cache-off, cold and warm comparisons of this head on Steam Deck in the same scene and settings, including frame times, slow-frame counts, load time, cache size and RAM.
  • L5 gpu/vk/vk_texture.cpp:2285: The new image read-back and fill copies have not been exercised on Windows or the AMD Windows driver affected by uneven BC layers. (more on the line) Do: Build and run the enabled cache on Windows, including a warm Hyrule Field pass on an AMD RX 6000 or newer, checking the far ground and validation output.

@fix can do L1, L2 and L3.

Checks: Still running: 10 checks.

More: does it help, other systems, switches, what was read

Does it help: Unproven. On Raphael, the PR reports warm versus cache-off slow-upload time of 2850 ms versus 2125 ms in Kokiri Forest and 2848 ms versus 2573 ms in Hyrule Field. Its Deck gains of 42% fewer hitches and 51% fewer slow-frame seconds came from a separate implementation, not this head.

Other systems: The enabled path changes GPU copies, upload timing, host memory and disk I/O on Windows and Linux. Linux NVIDIA and RADV runs are reported; Steam Deck, Windows, AMD Windows uneven BC copies and slow storage remain untested on this head. Saves, audio and input are not directly changed.

Switches: RX_VK_TEX_CACHE defaults to off; its cost-model mode needs a current decoder rate before it is a safe enabled choice. RX_VK_TEX_CACHE_MB defaults to 4096 MB, subject to the disk-space cap; RX_VK_TEX_CACHE_VERIFY defaults on; RX_VK_TEX_CACHE_DIR defaults to cache/textures. All four have switch-table rows. The size and verification defaults are reasonable provisional choices, but the gain and costs of enabling the cache still need validation.

Reviewed: 679e25d900 against 94cd0a2042: Read AGENTS.md, CONTRIBUTING.md, docs/dev/standards.md, the PR template, the commits, the full cache store and header, the cache wiring and adjacent upload and memory code, and the new cache tests. Reviewed the remaining diffs and skimmed the larger surrounding renderer and fixture-runner files; did not read all of vk_texture.cpp in full. Tooling's adjacent AGENTS.md and docs/review-checklist.md were absent.; nothing run (a code review).

Checked and fine:

  • All three commits record AI assistance.
  • No generated shader headers, third-party files or game-derived files are added by the diff; the GPU fixture uses existing random ASTC vectors.
  • The producer stamp includes the decoder, active encoders and sRGB decode rule; the file header also checks stamp, key, shape and payload size.
  • The cache is disabled by default and its four switches have table entries.
  • Reported Linux in-game comparisons found no differing cached textures on the tested NVIDIA and RADV GPUs.

Testing: Read-only review; no builds, tests or project scripts were run. The supplied CI checks are still running.

Overlaps and merge order: No overlapping pull request was established from the supplied material; the described prerequisite PRs are reported merged.


Automated code review by BeanBot (gpt-6.1-terra), asked for by HumanBean. Nothing was run; a maintainer decides.

**Recommendation: Request changes.** An inaccessible cache directory can terminate the game, and the enabled cost model uses a decoder rate the PR identifies as obsolete. The reported Raphael runs show substantially more slow-upload time with the warm cache; a gain for this implementation remains unproven. The change optionally stores GPU-decoded ASTC textures on disk and reloads them on later runs. It adds a bounded store, validation and GPU copy tests, but also adds synchronous file reads, background I/O and read-back memory; the cache is off by default. **Blocking (2)**: must change before merging. 1. **L1** `gpu/vk/tex_cache.cpp:123`: The recovery path uses the throwing filesystem overload after directory creation fails, so a cache setup error can terminate the process. (more on the line) **Do:** Use the error-code overload of is_directory and treat any status error as an unavailable cache; add a store test for an inaccessible or otherwise failing directory. 2. **L2** `gpu/vk/tex_cache.h:348`: The integrated-GPU cost model still seeds decode speed from the old decoder, causing it to select file reads that are slower than the current decode. (more on the line) **Do:** Seed the model conservatively for the current decoder, or defer cache reads until representative decode and read rates have been learned; update the cost-model test for that behavior. **Should fix (1)**: not blocking, but worth doing before merging. - **L3** `tests/tex_cache_store_test.cpp:73`: The store test constructs its Windows temporary path from narrow argv, so it does not reliably preserve Unicode paths. (more on the line) **Do:** Accept the Windows arguments as wide strings and construct the filesystem path from them; apply the same treatment to the GPU fixture's vector and cache paths. **Testing before merging (2)** (runs on the systems it can change; it doesn't hold the recommendation) - **L4** `gpu/vk/tex_cache.h:373`: The intended performance benefit has not been demonstrated for this implementation on the system where it is expected to help. (more on the line) **Do:** Run interleaved cache-off, cold and warm comparisons of this head on Steam Deck in the same scene and settings, including frame times, slow-frame counts, load time, cache size and RAM. - **L5** `gpu/vk/vk_texture.cpp:2285`: The new image read-back and fill copies have not been exercised on Windows or the AMD Windows driver affected by uneven BC layers. (more on the line) **Do:** Build and run the enabled cache on Windows, including a warm Hyrule Field pass on an AMD RX 6000 or newer, checking the far ground and validation output. `@fix` can do L1, L2 and L3. **Checks:** Still running: 10 checks. <details> <summary>More: does it help, other systems, switches, what was read</summary> **Does it help:** Unproven. On Raphael, the PR reports warm versus cache-off slow-upload time of 2850 ms versus 2125 ms in Kokiri Forest and 2848 ms versus 2573 ms in Hyrule Field. Its Deck gains of 42% fewer hitches and 51% fewer slow-frame seconds came from a separate implementation, not this head. **Other systems:** The enabled path changes GPU copies, upload timing, host memory and disk I/O on Windows and Linux. Linux NVIDIA and RADV runs are reported; Steam Deck, Windows, AMD Windows uneven BC copies and slow storage remain untested on this head. Saves, audio and input are not directly changed. **Switches:** RX_VK_TEX_CACHE defaults to off; its cost-model mode needs a current decoder rate before it is a safe enabled choice. RX_VK_TEX_CACHE_MB defaults to 4096 MB, subject to the disk-space cap; RX_VK_TEX_CACHE_VERIFY defaults on; RX_VK_TEX_CACHE_DIR defaults to cache/textures. All four have switch-table rows. The size and verification defaults are reasonable provisional choices, but the gain and costs of enabling the cache still need validation. **Reviewed:** 679e25d900c2 against 94cd0a2042f3: Read AGENTS.md, CONTRIBUTING.md, docs/dev/standards.md, the PR template, the commits, the full cache store and header, the cache wiring and adjacent upload and memory code, and the new cache tests. Reviewed the remaining diffs and skimmed the larger surrounding renderer and fixture-runner files; did not read all of vk_texture.cpp in full. Tooling's adjacent AGENTS.md and docs/review-checklist.md were absent.; nothing run (a code review). **Checked and fine:** - All three commits record AI assistance. - No generated shader headers, third-party files or game-derived files are added by the diff; the GPU fixture uses existing random ASTC vectors. - The producer stamp includes the decoder, active encoders and sRGB decode rule; the file header also checks stamp, key, shape and payload size. - The cache is disabled by default and its four switches have table entries. - Reported Linux in-game comparisons found no differing cached textures on the tested NVIDIA and RADV GPUs. **Testing:** Read-only review; no builds, tests or project scripts were run. The supplied CI checks are still running. **Overlaps and merge order:** No overlapping pull request was established from the supplied material; the described prerequisite PRs are reported merged. </details> --- <sub>Automated code review by BeanBot (gpt-6.1-terra), asked for by HumanBean. Nothing was run; a maintainer decides.</sub>
@ -0,0 +120,4 @@
const auto t0 = std::chrono::steady_clock::now();
std::error_code ec;
fs::create_directories(cfg.dir / hex16(cfg.stamp), ec);
if (ec && !fs::is_directory(cfg.dir / hex16(cfg.stamp))) {
Member

L1 (blocking): The recovery path uses the throwing filesystem overload after directory creation fails, so a cache setup error can terminate the process.

When: With the cache enabled and a parent of the cache directory inaccessible, create_directories returns a permission error; is_directory can throw for the same error on the index thread, and the uncaught exception invokes std::terminate instead of disabling the cache.

Do: Use the error-code overload of is_directory and treat any status error as an unavailable cache; add a store test for an inaccessible or otherwise failing directory.

**L1** (blocking): The recovery path uses the throwing filesystem overload after directory creation fails, so a cache setup error can terminate the process. *When:* With the cache enabled and a parent of the cache directory inaccessible, create_directories returns a permission error; is_directory can throw for the same error on the index thread, and the uncaught exception invokes std::terminate instead of disabling the cache. **Do:** Use the error-code overload of is_directory and treat any status error as an unavailable cache; add a store test for an inaccessible or otherwise failing directory.
@ -0,0 +345,4 @@
/// microSD card's 90-160 MB a second excepted; the page cache gives several GB)
inline Rates seed(bool integrated) {
Rates r;
r.decode_bps[0] = r.decode_bps[1] = integrated ? 150e6 : 3e9;
Member

L2 (blocking): The integrated-GPU cost model still seeds decode speed from the old decoder, causing it to select file reads that are slower than the current decode.

When: With RX_VK_TEX_CACHE=1 on the measured Raphael, the model starts at 150 MB/s for decode and 500 MB/s for reads, while the PR reports about 500 MB/s decode and 380 MB/s reads. Its warm Kokiri Forest slow-upload time rises from 2125 ms to 2850 ms, about 34%, and Hyrule Field rises about 11%.

Do: Seed the model conservatively for the current decoder, or defer cache reads until representative decode and read rates have been learned; update the cost-model test for that behavior.

**L2** (blocking): The integrated-GPU cost model still seeds decode speed from the old decoder, causing it to select file reads that are slower than the current decode. *When:* With RX_VK_TEX_CACHE=1 on the measured Raphael, the model starts at 150 MB/s for decode and 500 MB/s for reads, while the PR reports about 500 MB/s decode and 380 MB/s reads. Its warm Kokiri Forest slow-upload time rises from 2125 ms to 2850 ms, about 34%, and Hyrule Field rises about 11%. **Do:** Seed the model conservatively for the current decoder, or defer cache reads until representative decode and read rates have been learned; update the cost-model test for that behavior.
@ -0,0 +370,4 @@
/// a warm cache gains no more than the run-to-run spread (Kokiri Forest's worst frame 1.2 s against 2.0 s, but its slow-upload time
/// 2.8 s against 2.1 s; Hyrule Field's the other way), as a file reads at 380 MB/s and the decode runs at about 500 MB/s. The integrated
/// seed below (150 MB/s) was measured before those two and is stale
inline bool default_on() { return false; }
Member

L4 (should fix): The intended performance benefit has not been demonstrated for this implementation on the system where it is expected to help.

When: The Deck results exercise a separate cache implementation, while this head adds its own cost model, capture, checksum and writer behavior; the reported Raphael runs do not show a gain beyond their spread.

Do: Run interleaved cache-off, cold and warm comparisons of this head on Steam Deck in the same scene and settings, including frame times, slow-frame counts, load time, cache size and RAM.

**L4** (should fix): The intended performance benefit has not been demonstrated for this implementation on the system where it is expected to help. *When:* The Deck results exercise a separate cache implementation, while this head adds its own cost model, capture, checksum and writer behavior; the reported Raphael runs do not show a gain beyond their spread. **Do:** Run interleaved cache-off, cold and warm comparisons of this head on Steam Deck in the same scene and settings, including frame times, slow-frame counts, load time, cache size and RAM.
@ -2125,0 +2282,4 @@
VkCommandBuffer cmd = upload_cmd();
full_barrier(cmd);
const std::vector<VkBufferImageCopy> c = tc_copies(s, 0);
vkCmdCopyImageToBuffer(cmd, tex.image, VK_IMAGE_LAYOUT_GENERAL, p.buf, (uint32_t)c.size(), c.data());
Member

L5 (should fix): The new image read-back and fill copies have not been exercised on Windows or the AMD Windows driver affected by uneven BC layers.

When: A warm cached multi-layer BC texture with an uneven mip extent takes the new per-layer capture and fill regions; the reported GPU and in-game runs are Linux-only.

Do: Build and run the enabled cache on Windows, including a warm Hyrule Field pass on an AMD RX 6000 or newer, checking the far ground and validation output.

**L5** (should fix): The new image read-back and fill copies have not been exercised on Windows or the AMD Windows driver affected by uneven BC layers. *When:* A warm cached multi-layer BC texture with an uneven mip extent takes the new per-layer capture and fill regions; the reported GPU and in-game runs are Linux-only. **Do:** Build and run the enabled cache on Windows, including a warm Hyrule Field pass on an AMD RX 6000 or newer, checking the far ground and validation output.
@ -0,0 +70,4 @@
std::fprintf(stderr, "usage: %s <empty folder>\n", argv[0]);
return 2;
}
const fs::path dir = fs::path(argv[1]) / "textures";
Member

L3 (should fix): The store test constructs its Windows temporary path from narrow argv, so it does not reliably preserve Unicode paths.

When: On Windows with a temporary directory containing characters outside the active ANSI code page, the CRT's narrow arguments can lose those characters and the test opens a different or nonexistent directory.

Do: Accept the Windows arguments as wide strings and construct the filesystem path from them; apply the same treatment to the GPU fixture's vector and cache paths.

**L3** (should fix): The store test constructs its Windows temporary path from narrow argv, so it does not reliably preserve Unicode paths. *When:* On Windows with a temporary directory containing characters outside the active ANSI code page, the CRT's narrow arguments can lose those characters and the test opens a different or nonexistent directory. **Do:** Accept the Windows arguments as wide strings and construct the filesystem path from them; apply the same treatment to the GPU fixture's vector and cache paths.
Member

@HumanBean — on BeanBot's note that the Deck numbers in this thread come from "a separate implementation": correct, and since those numbers are the largest gain quoted on this PR, it's worth spelling out exactly what they do and don't establish.

What was measured, where. The −42% (hitches >60 ms), −60% (>150 ms), −51% (slow-frame seconds) and −61% (staged texture MB) are paired interleaved boots on a Steam Deck LCD (Vangogh, 16 GB unified), our pilot implementation, post-#2194 code on both sides, cache-off control built from the same base. TrashPanda's Raphael table measures his head on a desktop iGPU. Different machines, different implementations — the two tables don't contradict each other, and neither is "faster" than the other on shared hardware, because none has been run head to head. What they show together is that this mechanism's value is hardware-dependent, and this PR's own description says where it matters: the integrated-GPU default.

Why the Deck gains big and Raphael gains nothing. The cache pays when a file read beats an ASTC decode. On TrashPanda's Raphael that's close to true even with the new decoder: ~500 MB/s decode against ~380 MB/s disk reads, so the cost model should (and does) mostly decline — BeanBot's L2 is right that the 150 MB/s seed is stale, and with a correct seed a well-behaved model declines nearly everything there. On the Deck the balance is different in two ways: file reads land in the page cache of the same 16 GB unified pool the game runs in, so after first touch they run at RAM speed rather than NVMe speed, and the decode we're skipping is the Vangogh decode. Direct evidence of the crossover on Deck hardware: when #2194 made the decoder 5.3× faster, our biggest-hitch margin shrank from −83% to −60% while the count/seconds/MB margins held — the win tracks the decode-vs-read race exactly. A 62-minute real-play run on Deck: 5,057 uploads served from file, zero failures, hitch density 1.37% over 60 ms; the folder sat near 1 GB after a day, inside this PR's 4 GB cap.

What our numbers actually support. On the hardware class this feature's default claims (16 GB iGPU handhelds), the disk-cache mechanism removes roughly half the slow-frame load. On desktop iGPU it removes nothing, which is precisely what TrashPanda measured and shipped as off. Both results are right; the default decision lives on the Deck, so BeanBot's L4 (Deck arms at this head) is the correct blocker, not a reason to discount the Deck data.

Offer, standing. This head (679e25d90) on our Deck LCD: cache-off / cold / warm interleaved Castle arms with the frame log — hitch thresholds, slow-frame seconds, staged MB, load time, cache size and RAM, per L4's wording. The Beanstalk farm can't run a Deck (its own notes say the hitch thresholds and warm-cache control are out of reach there), so this arm is ours. Running it needs the Deck back in desktop mode at my end; when it's posted here the table lands. If it holds at this head, the cost model should learn Deck rates at runtime rather than seed from Raphael's 380 MB/s — on Deck those reads are page-cache reads.

@HumanBean — on BeanBot's note that the Deck numbers in this thread come from "a separate implementation": correct, and since those numbers are the largest gain quoted on this PR, it's worth spelling out exactly what they do and don't establish. **What was measured, where.** The −42% (hitches >60 ms), −60% (>150 ms), −51% (slow-frame seconds) and −61% (staged texture MB) are paired interleaved boots on a Steam Deck LCD (Vangogh, 16 GB unified), our pilot implementation, post-#2194 code on both sides, cache-off control built from the same base. TrashPanda's Raphael table measures his head on a desktop iGPU. Different machines, different implementations — the two tables don't contradict each other, and neither is "faster" than the other on shared hardware, because none has been run head to head. What they show together is that this mechanism's value is hardware-dependent, and this PR's own description says where it matters: the integrated-GPU default. **Why the Deck gains big and Raphael gains nothing.** The cache pays when a file read beats an ASTC decode. On TrashPanda's Raphael that's close to true even with the new decoder: ~500 MB/s decode against ~380 MB/s disk reads, so the cost model should (and does) mostly decline — BeanBot's L2 is right that the 150 MB/s seed is stale, and with a correct seed a well-behaved model declines nearly everything there. On the Deck the balance is different in two ways: file reads land in the page cache of the same 16 GB unified pool the game runs in, so after first touch they run at RAM speed rather than NVMe speed, and the decode we're skipping is the Vangogh decode. Direct evidence of the crossover on Deck hardware: when #2194 made the decoder 5.3× faster, our biggest-hitch margin shrank from −83% to −60% while the count/seconds/MB margins held — the win tracks the decode-vs-read race exactly. A 62-minute real-play run on Deck: 5,057 uploads served from file, zero failures, hitch density 1.37% over 60 ms; the folder sat near 1 GB after a day, inside this PR's 4 GB cap. **What our numbers actually support.** On the hardware class this feature's default claims (16 GB iGPU handhelds), the disk-cache mechanism removes roughly half the slow-frame load. On desktop iGPU it removes nothing, which is precisely what TrashPanda measured and shipped as off. Both results are right; the default decision lives on the Deck, so BeanBot's L4 (Deck arms at this head) is the correct blocker, not a reason to discount the Deck data. **Offer, standing.** This head (`679e25d90`) on our Deck LCD: cache-off / cold / warm interleaved Castle arms with the frame log — hitch thresholds, slow-frame seconds, staged MB, load time, cache size and RAM, per L4's wording. The Beanstalk farm can't run a Deck (its own notes say the hitch thresholds and warm-cache control are out of reach there), so this arm is ours. Running it needs the Deck back in desktop mode at my end; when it's posted here the table lands. If it holds at this head, the cost model should learn Deck rates at runtime rather than seed from Raphael's 380 MB/s — on Deck those reads are page-cache reads.
Some checks reported errors
CI / Workflow lint (actionlint) (pull_request) Blocked by required conditions
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Blocked by required conditions
CI / Conventional Commit title (pull_request) Blocked by required conditions
Third-party parts / The same as upstream (pull_request) Blocked by required conditions
CI / Python source checks (ubuntu-24.04, part 1/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
Website / Website on Cloudflare (pull_request) Blocked by required conditions
CI / Website build and checks (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
PR description / Description follows the template (pull_request_target) Successful in 22s
Website / Website on Cloudflare (pull_request_target) Has been skipped
beanstalk/approval approved by HumanBean (reviewed)
beanstalk/nvidia 1/1 fail
beanstalk/linux+radv 1/1 fail
beanstalk/intel 0/1 pass, 2 error
Website / Website builds (pull_request_target) Has been skipped
Website / Website preview, build (pull_request_target) Has been skipped
Website / Website preview, upload (pull_request_target) Has been skipped
beanstalk/windows+amd 1/1 pass
beanstalk/steamdeck 1/1 fail
beanstalk/igpu 1/1 fail
This pull request is marked as a work in progress.
Some workflows are waiting to be reviewed.
This branch is out-of-date with the base branch
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u 'feat/tex-disk-cache:TrashPanda-feat/tex-disk-cache'
git switch 'TrashPanda-feat/tex-disk-cache'
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!2292
No description provided.