fix(vk): a start that compiled its noted pipelines writes the pipeline cache before the title #903

Merged
HumanBean merged 4 commits from zeldaootr/Longshot:precompile-save-before-title into main 2026-11-16 11:49:20 +00:00
Contributor

Type: fix · Risk: medium · Tested on: Linux game-free checks; Steam Deck OLED (SteamOS 3.9.5, RADV): a start that compiled for 1,454 s wrote the cache before the title, and the next start compiled nothing · Needs: Windows, any GPU (a start that compiles for 30 s or more: the write's time)

Why

A start that had to compile its noted pipelines should keep them, so the next start finds them. On a Steam Deck a start compiled all 32,438 of them for about 20 minutes and kept none in our pipeline cache, because in play the cache is written only once it has grown 64 MB, and those pipelines grew it by 4.3 MB (RADV keeps a pipeline as its key and its shaders' hashes, and the code was already there). The next start could find them only in the driver's own folder.

The compile in that case came from Game Mode's RADV_FORCE_VRS_CONFIG_FILE, which the sibling PR #900 removes. A start still compiles everything after a driver update, or with RX_VK_HALF_RATE_SHADING=1. #789 (a driver update warms the noted pipelines again under RX_VK_LOAD=create) is related; that path already writes the cache, and this PR covers the other one. No issue on the tracker covers it (searched: pipeline cache save, before the title, noted pipelines).

How to reproduce

Seen on: SteamOS 3.9.5 (Steam Deck OLED), RADV VANGOGH, Mesa 26.2.0-devel
Settings and switches: defaults; RADV_FORCE_VRS_CONFIG_FILE naming a file (as Game Mode does) on main, to make the start compile
Steps: prepare outside Game Mode, start with the variable set, wait through "Loading pipelines" to the title, quit, and start the same way again.
Expected: the second start finds the pipelines in our cache.
Actual: vk: pipeline cache 4303 KB larger in play: written once it is 64 MB larger, or by a forced save; the cache file is not written, and the second start depends on what the driver's folder kept.

What changed

A start whose noted pipelines took RX_VK_PRECOMPILE_SAVE_S (30 s) or more to build writes the pipeline cache before the title, with the start-up screen showing it as saving. The log says what the save did and how long it took. The warm pass under RX_VK_LOAD=create, which already wrote the cache, now reports the same way.

  • renderer: gpu/vk/precompile_save.h (new, standard library only): after_s reads the switch; due decides the save (the build took that long, the precompile reached its end, and this is a game start, since the preparation's process writes the cache anyway); said puts what a save did into words.
  • renderer: gpu/vk/vk_draw.cpp:
    • precompile_run: when due, it sets prepare_saving_now (the start-up screen's saving state, as precompile_warm does), calls pipeline_cache_save(true), and logs vk: precompile: its pipelines took N s (compiled, not found in the caches): the pipeline cache <what it did>, in T ms, before the title.
    • precompile_warm: its forced save logs the pipeline cache <what it did>, in T ms instead of an unconditional "written out".
    • pipeline_cache_save records how each save ended in pcache_save_outcome, thread-local: a forced save runs on its caller's thread.
  • docs: docs/development.md's row for RX_VK_PRECOMPILE_SAVE_S; docs/tested/2026-11-15-precompile-save-zeldaootr-deck02.md, the Deck run below.
  • tests: tests/test_precompile_save.py (cutting vk_draw.cpp's functions with tests/srccut.py's block) with tests/precompile_save_test.cpp. tests/pipeline_cache_save_test.cpp, which compiles the real pipeline_cache_save, also checks the recorded outcome: written with its size, nothing new, fetch failed, write failed.

This changes behaviour on every platform: after any precompile of 30 s or more (the first start after a driver update on Windows, for one) the whole cache is written before the title, only when it grew. That costs seconds once (821 ms for 439 MB on a Deck's internal storage), and what was compiled is no longer lost if the game is closed or crashes before play writes it.

Measurements

Verdict: fixed on the Deck: after a 1,454 s compile the pipeline cache (439.3 MB) was written before the title, in 821 ms, and the next start from that folder compiled nothing and reached the title in 46 s; on main the same kind of start left the cache unwritten. Starts that found their pipelines (12-21 s) did not save, as intended.

Baseline: the After column is the local integration vrs-verify (bfc69759): main @ aa95d35f with this PR and its two siblings (#900, #902), since the compiling start needs #900's RX_VK_HALF_RATE_SHADING=1. The Before column is an earlier build of main @ aa95d35f with other open PRs, the same Deck and caches. Since then this PR was rebased onto main @ a8a30c22 with its code unchanged (only the test's cutter moved to tests/srccut.py); main's changes in precompile_run (Linux notes built programs) and pipeline_cache_save (its background thread registered) do not touch the save before the title, so the numbers hold.
Hardware: Steam Deck OLED, AMD Custom GPU 0932 (RADV VANGOGH), Mesa 26.2.0-devel (git-5c65d4fc31), SteamOS 3.9.5 (20261023.100), 16 GB
Scene: the start-up, up to the title; scratch game folders; headless, defaults, the precompile at its default and RX_VK_PRECOMPILE_SAVE_S unset (30)
Method: the log's vk: precompile: and vk: pipeline cache lines, the time to the title and the cache file's size. Run deck01 (the starts that found their pipelines): 4 starts interleaved a, b, b, a, each from a fresh copy of the same warm caches. Run deck02 (the save): c1 from a fresh copy of those caches made without the variable, with RADV_FORCE_VRS_CONFIG_FILE naming a 1x1 file and RX_VK_HALF_RATE_SHADING=1, so every graphics pipeline is compiled again; then c2 from the folder c1 left, the same variables. One c1 and one c2: the fix is shown by its log lines and the next start, not by a timing comparison, and each time below is a single run.
How to reproduce: printf 1x1 > vrs-1x1.txt; restore the warm cache/; start to the title with RADV_FORCE_VRS_CONFIG_FILE=<that file> RX_VK_HALF_RATE_SHADING=1; quit and start again the same way without restoring.

Before: main @ aa95d35f (with other open PRs) After: this PR @ 53c0be91 (in vrs-verify bfc69759)
a start that found its pipelines (deck01) 22,350 ms; no save 12,481-20,670 ms over 4 starts; no save before the title (below 30 s)
a start that compiled them, the cache compiled 1,222 s; grew 4.3 MB, written once it is 64 MB larger: never written c1: compiled 1,454 s; written before the title, 439.3 MB in 821 ms; the file 456,050,920 to 460,608,696 bytes; title at 1,501 s
the start after that one depends on the driver's folder (not measured) c2: nothing compiled, precompile 13,355 ms, title at 46 s
the write's time before the title, Windows none not run
Before: vk: pipeline cache 4303 KB larger in play: written once it is 64 MB larger, or by a forced save
After, c1: vk: RADV_FORCE_VRS_CONFIG_FILE kept (RX_VK_HALF_RATE_SHADING=1): Steam's Half Rate Shading reaches the game, and RADV gives every graphics pipeline another key than the preparation's, so they are compiled again
After, c1: vk: precompile: 27660 programs, 32438 graphics and 3623 compute pipelines, 2284 mesh fallback programs in 1466663 ms (12701 ms of it the caches opened...)
After, c1: vk: pipeline cache saved (449813 KB)
After, c1: vk: precompile: its pipelines took 1454 s (compiled, not found in the caches): the pipeline cache written, 439.3 MB, in 821 ms, before the title (RX_VK_PRECOMPILE_SAVE_S=0: not)
After, c2: vk: precompile: ... in 13355 ms (12848 ms ...)
After, deck01 b2: vk: precompile: 27660 programs, 32438 graphics and 3623 compute pipelines, 2284 mesh fallback programs in 12481 ms (11974 ms of it the caches opened, the notes and programs read)

(The ... are parts of the lines not copied off the Deck in the run's notes; the logs stayed on it.)

Flags and settings

One new switch, on by default.

Flag What it is Before this PR After this PR Effect Helps / doesn't help / untested Recommendation
RX_VK_PRECOMPILE_SAVE_S=<s> the precompile build time from which a start writes the pipeline cache before the title none: written in play at 64 MB of growth 30 (0: never) after a long precompile, a write of the whole cache before the title, only if it grew helps on the Steam Deck (RADV): the next start finds what was compiled; untested on Windows 30
LONGSHOT_PREPARE_ONLY the preparation's own process (set by vk_main.cpp, not a switch) as is also read here: no early save there, the preparation writes the cache anyway none n/a leave as is

Testing

Tested:

  • Steam Deck OLED (SteamOS 3.9.5, RADV VANGOGH, Mesa 26.2.0-devel), headless, this PR's code in the integration build vrs-verify bfc69759 (main @ aa95d35f with #900 and #902), run deck02: c1 compiled every pipeline (1,454 s) and logged the save before the title (439.3 MB in 821 ms), title at 1,501 s; c2 from that folder compiled nothing, title at 46 s. Run deck01: 4 starts that found their pipelines (12-21 s), none saved before the title, as intended.
  • tests/test_precompile_save.py, with g++ 13.3 and clang 23.1: fails at the test commit (4aa2097c: vk_draw.cpp does not include precompile_save.h, gpu/vk/precompile_save.h is missing) and passes at the fix; its cuts compared with the old brace counter (SRCCUT_CHECK_NAIVE=1): the same.
  • The checks that read this PR's files, python -I -B tests/run_all.py --changed forge/main on Linux, 8 at once: with CXX=g++ 113 passed, 6 failed, 14 skipped; with CXX=clang++ 114 passed, 5 failed, 14 skipped. test_crash_dialog, test_pipeline_tour, test_vk_occlusion_queries, test_vk_pgo and test_walk_key fail the same way on main @ a8a30c22. The sixth with g++, test_pipeline_cache_save, timed out in its in-play case's 3 s wait (FAIL line 350: wait_until(play_saves, 3)) on a loaded PC (load average 50 on 16 threads); run alone, interleaved with main, it passed 3 of 3 here and 2 of 3 on main, whose failure is the same wait (line 341).
  • gpu/vk/precompile_save.h compiled alone (-std=c++20 -Wall -Wextra -Werror) with g++ (libstdc++), clang and llvm-mingw clang (Windows target).
  • gpu/vk/vk_draw.cpp whole-file syntax check with the build's renderer flags, Linux (clang) and Windows (llvm-mingw), before the rebase, on main @ f637b42d: the same as main (Linux 103 warnings and main's one narrowing error at an unchanged line; Windows 0 errors, 105 warnings). The rebase applied the same hunks without conflict; the names they use (built0, gone_on, prepare_stopped, prepare_saving_now, env_on) are all still in precompile_run on main @ a8a30c22.
  • The full python -I -B tests/run_all.py on Linux at this PR's head, 8 at once: 547 passed, 21 failed, 78 skipped (tools this PC lacks). The 21 fail the same way on main @ a8a30c22 run alone: test_appimage_player_build, test_bake_portability, test_bug_report and test_hardware_report (the Tooling checkout not beside the clone), test_crash_dialog, test_crt_options, test_env_on, test_lift_cache, test_lift_cleanup_error, test_linux_preflight, test_linux_update, test_make_game_cache, test_missing_nup, test_mods_size_table, test_options_budget_once, test_pipeline_tour, test_readback_late, test_run_all_changed, test_vk_occlusion_queries, test_vk_pgo, test_walk_key. test_precompile_save, test_pipeline_cache_save and test_tested_configurations passed in it.

Not tested: whether the start-up screen showed its "saving" state during the 821 ms (the run was headless); a real Game Mode start from Steam (the run set the variable by hand, as Game Mode does); the write's time on a microSD card and on Windows; a full renderer build and run on Windows (the change is platform-neutral code); this PR on its own, without #900 and #902, in the game.

Must be tested:

  • Windows, any GPU: move longshot_vk_pipelines.bin out of the cache folder (or start after a driver update), start the game to the title, expecting vk: precompile: its pipelines took N s (compiled, not found in the caches): the pipeline cache written, M MB, in T ms, before the title when the precompile took 30 s or more and no such line otherwise, the start-up screen showing it saves, and the next start finding the pipelines (by hand: report N, M and T and what the start-up screen showed).

Risks

What could break: a start that compiled for 30 s or more now writes the whole pipeline cache before the title, on every platform: 821 ms for 439 MB on a Deck's internal storage, more on a microSD card or a slow disk. A start that took 30 s while finding its pipelines (a slow disk) asks the driver for the cache's size and writes nothing when it didn't grow.

Turning it off: RX_VK_PRECOMPILE_SAVE_S=0.

Compatibility: nothing changes in the caches beyond longshot_vk_pipelines.bin being written earlier; saves, longshot_options.ini and the vk ABI are unchanged.

Checklist

Everyone

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

When it applies

  • AI assistance recorded with Assisted-by: / Co-Authored-By: trailers.
  • Switches documented (docs/development.md; the README for a menu row) and shipped at their recommended value.
  • A file in docs/tested/ for each new measured run (format in docs/tested-configurations.md).
  • A game-free test added for the fix, failing on main and passing here.
  • A check under tests/ that reads changed source updated in this PR, not weakened.
  • Host code builds on both Windows (llvm-mingw) and Linux, with UTF-8 paths.
  • Docs updated.
**Type:** fix · **Risk:** medium · **Tested on:** Linux game-free checks; Steam Deck OLED (SteamOS 3.9.5, RADV): a start that compiled for 1,454 s wrote the cache before the title, and the next start compiled nothing · **Needs:** Windows, any GPU (a start that compiles for 30 s or more: the write's time) ## Why A start that had to compile its noted pipelines should keep them, so the next start finds them. On a Steam Deck a start compiled all 32,438 of them for about 20 minutes and kept none in our pipeline cache, because in play the cache is written only once it has grown 64 MB, and those pipelines grew it by 4.3 MB (RADV keeps a pipeline as its key and its shaders' hashes, and the code was already there). The next start could find them only in the driver's own folder. The compile in that case came from Game Mode's `RADV_FORCE_VRS_CONFIG_FILE`, which the sibling PR https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/900 removes. A start still compiles everything after a driver update, or with `RX_VK_HALF_RATE_SHADING=1`. https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/789 (a driver update warms the noted pipelines again under `RX_VK_LOAD=create`) is related; that path already writes the cache, and this PR covers the other one. No issue on the tracker covers it (searched: pipeline cache save, before the title, noted pipelines). ## How to reproduce **Seen on:** SteamOS 3.9.5 (Steam Deck OLED), RADV VANGOGH, Mesa 26.2.0-devel **Settings and switches:** defaults; `RADV_FORCE_VRS_CONFIG_FILE` naming a file (as Game Mode does) on main, to make the start compile **Steps:** prepare outside Game Mode, start with the variable set, wait through "Loading pipelines" to the title, quit, and start the same way again. **Expected:** the second start finds the pipelines in our cache. **Actual:** `vk: pipeline cache 4303 KB larger in play: written once it is 64 MB larger, or by a forced save`; the cache file is not written, and the second start depends on what the driver's folder kept. ## What changed A start whose noted pipelines took `RX_VK_PRECOMPILE_SAVE_S` (30 s) or more to build writes the pipeline cache before the title, with the start-up screen showing it as saving. The log says what the save did and how long it took. The warm pass under `RX_VK_LOAD=create`, which already wrote the cache, now reports the same way. - renderer: `gpu/vk/precompile_save.h` (new, standard library only): `after_s` reads the switch; `due` decides the save (the build took that long, the precompile reached its end, and this is a game start, since the preparation's process writes the cache anyway); `said` puts what a save did into words. - renderer: `gpu/vk/vk_draw.cpp`: - `precompile_run`: when `due`, it sets `prepare_saving_now` (the start-up screen's saving state, as `precompile_warm` does), calls `pipeline_cache_save(true)`, and logs `vk: precompile: its pipelines took N s (compiled, not found in the caches): the pipeline cache <what it did>, in T ms, before the title`. - `precompile_warm`: its forced save logs `the pipeline cache <what it did>, in T ms` instead of an unconditional "written out". - `pipeline_cache_save` records how each save ended in `pcache_save_outcome`, thread-local: a forced save runs on its caller's thread. - docs: `docs/development.md`'s row for `RX_VK_PRECOMPILE_SAVE_S`; `docs/tested/2026-11-15-precompile-save-zeldaootr-deck02.md`, the Deck run below. - tests: `tests/test_precompile_save.py` (cutting `vk_draw.cpp`'s functions with `tests/srccut.py`'s `block`) with `tests/precompile_save_test.cpp`. `tests/pipeline_cache_save_test.cpp`, which compiles the real `pipeline_cache_save`, also checks the recorded outcome: written with its size, nothing new, fetch failed, write failed. **This changes behaviour on every platform:** after any precompile of 30 s or more (the first start after a driver update on Windows, for one) the whole cache is written before the title, only when it grew. That costs seconds once (821 ms for 439 MB on a Deck's internal storage), and what was compiled is no longer lost if the game is closed or crashes before play writes it. ## Measurements **Verdict:** fixed on the Deck: after a 1,454 s compile the pipeline cache (439.3 MB) was written before the title, in 821 ms, and the next start from that folder compiled nothing and reached the title in 46 s; on main the same kind of start left the cache unwritten. Starts that found their pipelines (12-21 s) did not save, as intended. Baseline: the After column is the local integration `vrs-verify` (bfc69759): main @ aa95d35f with this PR and its two siblings (https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/900, https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/902), since the compiling start needs #900's `RX_VK_HALF_RATE_SHADING=1`. The Before column is an earlier build of main @ aa95d35f with other open PRs, the same Deck and caches. Since then this PR was rebased onto main @ a8a30c22 with its code unchanged (only the test's cutter moved to `tests/srccut.py`); main's changes in `precompile_run` (Linux notes built programs) and `pipeline_cache_save` (its background thread registered) do not touch the save before the title, so the numbers hold. Hardware: Steam Deck OLED, AMD Custom GPU 0932 (RADV VANGOGH), Mesa 26.2.0-devel (git-5c65d4fc31), SteamOS 3.9.5 (20261023.100), 16 GB Scene: the start-up, up to the title; scratch game folders; headless, defaults, the precompile at its default and `RX_VK_PRECOMPILE_SAVE_S` unset (30) Method: the log's `vk: precompile:` and `vk: pipeline cache` lines, the time to the title and the cache file's size. Run deck01 (the starts that found their pipelines): 4 starts interleaved a, b, b, a, each from a fresh copy of the same warm caches. Run deck02 (the save): c1 from a fresh copy of those caches made without the variable, with `RADV_FORCE_VRS_CONFIG_FILE` naming a `1x1` file and `RX_VK_HALF_RATE_SHADING=1`, so every graphics pipeline is compiled again; then c2 from the folder c1 left, the same variables. One c1 and one c2: the fix is shown by its log lines and the next start, not by a timing comparison, and each time below is a single run. How to reproduce: `printf 1x1 > vrs-1x1.txt`; restore the warm `cache/`; start to the title with `RADV_FORCE_VRS_CONFIG_FILE=<that file> RX_VK_HALF_RATE_SHADING=1`; quit and start again the same way without restoring. | | Before: main @ aa95d35f (with other open PRs) | After: this PR @ 53c0be91 (in `vrs-verify` bfc69759) | |---|---|---| | a start that found its pipelines (deck01) | 22,350 ms; no save | 12,481-20,670 ms over 4 starts; no save before the title (below 30 s) | | a start that compiled them, the cache | compiled 1,222 s; grew 4.3 MB, `written once it is 64 MB larger`: never written | c1: compiled 1,454 s; written before the title, 439.3 MB in 821 ms; the file 456,050,920 to 460,608,696 bytes; title at 1,501 s | | the start after that one | depends on the driver's folder (not measured) | c2: nothing compiled, precompile 13,355 ms, title at 46 s | | the write's time before the title, Windows | none | not run | ``` Before: vk: pipeline cache 4303 KB larger in play: written once it is 64 MB larger, or by a forced save After, c1: vk: RADV_FORCE_VRS_CONFIG_FILE kept (RX_VK_HALF_RATE_SHADING=1): Steam's Half Rate Shading reaches the game, and RADV gives every graphics pipeline another key than the preparation's, so they are compiled again After, c1: vk: precompile: 27660 programs, 32438 graphics and 3623 compute pipelines, 2284 mesh fallback programs in 1466663 ms (12701 ms of it the caches opened...) After, c1: vk: pipeline cache saved (449813 KB) After, c1: vk: precompile: its pipelines took 1454 s (compiled, not found in the caches): the pipeline cache written, 439.3 MB, in 821 ms, before the title (RX_VK_PRECOMPILE_SAVE_S=0: not) After, c2: vk: precompile: ... in 13355 ms (12848 ms ...) After, deck01 b2: vk: precompile: 27660 programs, 32438 graphics and 3623 compute pipelines, 2284 mesh fallback programs in 12481 ms (11974 ms of it the caches opened, the notes and programs read) ``` (The `...` are parts of the lines not copied off the Deck in the run's notes; the logs stayed on it.) ### Flags and settings One new switch, on by default. | Flag | What it is | Before this PR | After this PR | Effect | Helps / doesn't help / untested | Recommendation | |---|---|---|---|---|---|---| | `RX_VK_PRECOMPILE_SAVE_S=<s>` | the precompile build time from which a start writes the pipeline cache before the title | none: written in play at 64 MB of growth | 30 (`0`: never) | after a long precompile, a write of the whole cache before the title, only if it grew | helps on the Steam Deck (RADV): the next start finds what was compiled; untested on Windows | 30 | | `LONGSHOT_PREPARE_ONLY` | the preparation's own process (set by `vk_main.cpp`, not a switch) | as is | also read here: no early save there, the preparation writes the cache anyway | none | n/a | leave as is | ## Testing **Tested:** - Steam Deck OLED (SteamOS 3.9.5, RADV VANGOGH, Mesa 26.2.0-devel), headless, this PR's code in the integration build `vrs-verify` bfc69759 (main @ aa95d35f with #900 and #902), run deck02: c1 compiled every pipeline (1,454 s) and logged the save before the title (439.3 MB in 821 ms), title at 1,501 s; c2 from that folder compiled nothing, title at 46 s. Run deck01: 4 starts that found their pipelines (12-21 s), none saved before the title, as intended. - `tests/test_precompile_save.py`, with g++ 13.3 and clang 23.1: fails at the test commit (4aa2097c: `vk_draw.cpp does not include precompile_save.h`, `gpu/vk/precompile_save.h is missing`) and passes at the fix; its cuts compared with the old brace counter (`SRCCUT_CHECK_NAIVE=1`): the same. - The checks that read this PR's files, `python -I -B tests/run_all.py --changed forge/main` on Linux, 8 at once: with `CXX=g++` 113 passed, 6 failed, 14 skipped; with `CXX=clang++` 114 passed, 5 failed, 14 skipped. `test_crash_dialog`, `test_pipeline_tour`, `test_vk_occlusion_queries`, `test_vk_pgo` and `test_walk_key` fail the same way on main @ a8a30c22. The sixth with g++, `test_pipeline_cache_save`, timed out in its in-play case's 3 s wait (`FAIL line 350: wait_until(play_saves, 3)`) on a loaded PC (load average 50 on 16 threads); run alone, interleaved with main, it passed 3 of 3 here and 2 of 3 on main, whose failure is the same wait (line 341). - `gpu/vk/precompile_save.h` compiled alone (`-std=c++20 -Wall -Wextra -Werror`) with g++ (libstdc++), clang and llvm-mingw clang (Windows target). - `gpu/vk/vk_draw.cpp` whole-file syntax check with the build's renderer flags, Linux (clang) and Windows (llvm-mingw), before the rebase, on main @ f637b42d: the same as main (Linux 103 warnings and main's one narrowing error at an unchanged line; Windows 0 errors, 105 warnings). The rebase applied the same hunks without conflict; the names they use (`built0`, `gone_on`, `prepare_stopped`, `prepare_saving_now`, `env_on`) are all still in `precompile_run` on main @ a8a30c22. - The full `python -I -B tests/run_all.py` on Linux at this PR's head, 8 at once: 547 passed, 21 failed, 78 skipped (tools this PC lacks). The 21 fail the same way on main @ a8a30c22 run alone: `test_appimage_player_build`, `test_bake_portability`, `test_bug_report` and `test_hardware_report` (the Tooling checkout not beside the clone), `test_crash_dialog`, `test_crt_options`, `test_env_on`, `test_lift_cache`, `test_lift_cleanup_error`, `test_linux_preflight`, `test_linux_update`, `test_make_game_cache`, `test_missing_nup`, `test_mods_size_table`, `test_options_budget_once`, `test_pipeline_tour`, `test_readback_late`, `test_run_all_changed`, `test_vk_occlusion_queries`, `test_vk_pgo`, `test_walk_key`. `test_precompile_save`, `test_pipeline_cache_save` and `test_tested_configurations` passed in it. **Not tested:** whether the start-up screen showed its "saving" state during the 821 ms (the run was headless); a real Game Mode start from Steam (the run set the variable by hand, as Game Mode does); the write's time on a microSD card and on Windows; a full renderer build and run on Windows (the change is platform-neutral code); this PR on its own, without #900 and #902, in the game. **Must be tested:** - Windows, any GPU: move `longshot_vk_pipelines.bin` out of the cache folder (or start after a driver update), start the game to the title, expecting `vk: precompile: its pipelines took N s (compiled, not found in the caches): the pipeline cache written, M MB, in T ms, before the title` when the precompile took 30 s or more and no such line otherwise, the start-up screen showing it saves, and the next start finding the pipelines (by hand: report N, M and T and what the start-up screen showed). ## Risks **What could break:** a start that compiled for 30 s or more now writes the whole pipeline cache before the title, on every platform: 821 ms for 439 MB on a Deck's internal storage, more on a microSD card or a slow disk. A start that took 30 s while finding its pipelines (a slow disk) asks the driver for the cache's size and writes nothing when it didn't grow. **Turning it off:** `RX_VK_PRECOMPILE_SAVE_S=0`. **Compatibility:** nothing changes in the caches beyond `longshot_vk_pipelines.bin` being written earlier; saves, `longshot_options.ini` and the vk ABI are unchanged. ## Checklist ### Everyone - [x] One topic. - [x] The title is a Conventional Commit (`type(scope): description`) of the status line's type. - [x] Why gives the reason plainly and links the issues that fit (the tracker searched). - [x] Measurements has a verdict, or one line saying why there is nothing to measure. - [x] Testing names what was tested, what wasn't, and what must still be tested, where and how. - [x] Rebased on current `main`. - [x] `python -I -B tests/run_all.py` passes (any failure that also fails on `main` is named). - [x] No game files, dumps, build output or generated files. - [x] `third_party/` untouched (a new folder with a `PROVENANCE.md` instead). - [x] The license is OK: GPL-3.0-or-later, nothing incompatible and nothing decompiled. ### When it applies - [x] AI assistance recorded with `Assisted-by:` / `Co-Authored-By:` trailers. - [x] Switches documented (docs/development.md; the README for a menu row) and shipped at their recommended value. - [x] A file in `docs/tested/` for each new measured run (format in `docs/tested-configurations.md`). - [x] A game-free test added for the fix, failing on `main` and passing here. - [x] A check under `tests/` that reads changed source updated in this PR, not weakened. - [x] Host code builds on both Windows (llvm-mingw) and Linux, with UTF-8 paths. - [x] Docs updated.
`tests/test_precompile_save.py` fails on main: a start whose noted
pipelines were compiled, not found, leaves them to the play save, which
waits for 64 MB of growth, and the warm pass's line says it wrote the
cache whatever the save did.

Assisted-by: Claude
fix(vk): a start that compiled its noted pipelines writes the pipeline cache before the title
Some checks failed
Website / Website on Cloudflare (pull_request_target) Has been skipped
PR description / Description follows the template (pull_request_target) Successful in 4s
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
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
53c0be913a
A Steam Deck start from Steam compiled its 32,438 noted pipelines for
20 minutes and grew the pipeline cache by 4.3 MB: RADV keeps a pipeline
as its key and its shaders' hashes, and the code was already there. In
play the cache is written only at 64 MB of growth, so none of it was
written and the next start had only the driver's own folder.

- `gpu/vk/precompile_save.h`: when it is due (the build took
  `RX_VK_PRECOMPILE_SAVE_S`, 30 s; 0 never; not when stopped, gone on
  or in the preparation's own process), and what a save did, in words.
- `precompile_run` writes it then, with the start-up screen's saving
  state on as `precompile_warm` has it, and logs written N MB / nothing
  new / not written and why, and the time. `precompile_warm`'s line
  (`RX_VK_LOAD=create`) says the same instead of "written out".
- `pipeline_cache_save` records how each save ended
  (`pcache_save_outcome`, thread-local: a forced save runs on its
  caller's thread). `tests/pipeline_cache_save_test.cpp` checks it.

On every platform: after any precompile of 30 s or more (a driver
update on Windows too) the write now happens before the title.

Assisted-by: Claude
zeldaootr force-pushed precompile-save-before-title from 53c0be913a
Some checks failed
Website / Website on Cloudflare (pull_request_target) Has been skipped
PR description / Description follows the template (pull_request_target) Successful in 4s
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
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
to 3ac77beb07
Some checks failed
beanstalk/approval waiting for a BigBean's 👍 on the request
Website / Website on Cloudflare (pull_request_target) Has been skipped
PR description / Description follows the template (pull_request_target) Successful in 4s
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
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-15 23:18:49 +00:00
Compare
Author
Contributor

Measured on a Steam Deck OLED (RADV, in the integration build vrs-verify bfc69759): with RX_VK_HALF_RATE_SHADING=1 a start compiled every pipeline for 1,454 s and wrote the pipeline cache before the title (439.3 MB in 821 ms), and the next start from that folder compiled nothing and reached the title in 46 s; the start-up screen's saving state was not seen, as the run was headless. Rebased onto main @ a8a30c22 with the code unchanged: the test now cuts vk_draw.cpp with tests/srccut.py's block, and the run is in docs/tested/2026-11-15-precompile-save-zeldaootr-deck02.md. Measurements, Testing and the checklist are updated; Windows is still to be tested.

Measured on a Steam Deck OLED (RADV, in the integration build `vrs-verify` bfc69759): with `RX_VK_HALF_RATE_SHADING=1` a start compiled every pipeline for 1,454 s and wrote the pipeline cache before the title (439.3 MB in 821 ms), and the next start from that folder compiled nothing and reached the title in 46 s; the start-up screen's saving state was not seen, as the run was headless. Rebased onto main @ a8a30c22 with the code unchanged: the test now cuts `vk_draw.cpp` with `tests/srccut.py`'s `block`, and the run is in `docs/tested/2026-11-15-precompile-save-zeldaootr-deck02.md`. Measurements, Testing and the checklist are updated; Windows is still to be tested.
zeldaootr changed title from WIP: fix(vk): a start that compiled its noted pipelines writes the pipeline cache before the title to fix(vk): a start that compiled its noted pipelines writes the pipeline cache before the title 2026-11-15 23:18:59 +00:00
Author
Contributor

@Beanstalk windows, any GPU: start from cold shader caches so the start compiles its pipelines for more than 30 seconds, and let it reach the title. Expecting the log line the pipeline cache written, ... before the title, and a second start from the same folder that reaches the title without compiling. On a start that compiles nothing, no change from main.

@Beanstalk windows, any GPU: start from cold shader caches so the start compiles its pipelines for more than 30 seconds, and let it reach the title. Expecting the log line `the pipeline cache written, ... before the title`, and a second start from the same folder that reaches the title without compiling. On a start that compiles nothing, no change from main.
Member

@zeldaootr only members of BigBeans can start the farm.

One of them can approve this request by reacting 👍 to it. This request was for 3ac77be, and the PR has changed since (ae5a2fa), so a 👍 no longer approves it. Comment @Beanstalk again to ask for the new commit.

@zeldaootr only members of `BigBeans` can start the farm. ~~One of them can approve this request by reacting 👍 to it.~~ This request was for `3ac77be`, and the PR has changed since (`ae5a2fa`), so a 👍 no longer approves it. Comment `@Beanstalk` again to ask for the new commit.
Contributor

A Windows run for Must be tested, by hand. In short: the save-before-title branch works on Windows, but only with the threshold lowered. This PC never reaches 30 s.

Hardware: Windows 11 Pro 26300, RTX 3080 10 GB (NVIDIA 621.14), i9-12900K, 64 GB
Build: this PR's head 3ac77beb merged onto main @ 1764fed2 (d3a106c4, local only, no conflict), a standalone build (llvm-mingw). It's a development build, so the precompile needs RX_VK_PRECOMPILE=1. Each start went to the title through the control bridge and quit there. longshot_vk_pipelines.bin and its stamp were moved out of the cache folder before each cold start. NVIDIA's own driver cache was left alone, since other games on this PC use it.

start switches what the log says
cold, default RX_VK_PRECOMPILE=1 (so RX_VK_LOAD=create, the default with mesh shaders) pipeline cache ... (0 KB); the warm path builds 1913 noted pipelines ... in 1.0 s and writes the pipeline cache written, 93.6 MB, in 69 ms. Your branch doesn't apply on this path
cold, the start path RX_VK_PRECOMPILE=1;RX_VK_LOAD=start with the default 30 s (not run separately: the build takes about 1 s here, far under 30 s, so no line is expected)
cold, the start path, threshold 1 s RX_VK_PRECOMPILE=1;RX_VK_LOAD=start;RX_VK_PRECOMPILE_SAVE_S=1 precompile: 1402 programs, 1913 graphics and 151 compute pipelines ... in 1137 ms, then pipeline cache saved (95873 KB) and vk: precompile: its pipelines took 1 s (compiled, not found in the caches): the pipeline cache written, 93.6 MB, in 71 ms, before the title (RX_VK_PRECOMPILE_SAVE_S=0: not)
the next start, default 30 s RX_VK_PRECOMPILE=1;RX_VK_LOAD=start pipeline cache ... (95873 KB) found; the precompile in 280 ms; no save line

So on Windows the new branch writes the cache before the title, and the next start finds every pipeline in it. The title came in 46-47 s on every start, and there was no device loss, VK_ERROR or FATAL line.

Not seen: the start-up screen's "saving" text. The write took 71 ms, and screenshots every 120 presents didn't catch it. Also not reached: a real precompile of 30 s or more. The driver's own cache makes this card's compile take about 1 s, so the "compiled, not found in the caches" wording held only because I lowered the threshold. A PC with an empty driver cache, after a driver update, is where the default 30 s path would show.

Posted by an AI agent (Claude Code) for d4nkn3ss.

A Windows run for *Must be tested*, by hand. In short: the save-before-title branch works on Windows, but only with the threshold lowered. This PC never reaches 30 s. Hardware: Windows 11 Pro 26300, RTX 3080 10 GB (NVIDIA 621.14), i9-12900K, 64 GB Build: this PR's head 3ac77beb merged onto main @ 1764fed2 (`d3a106c4`, local only, no conflict), a standalone build (llvm-mingw). It's a development build, so the precompile needs `RX_VK_PRECOMPILE=1`. Each start went to the title through the control bridge and quit there. `longshot_vk_pipelines.bin` and its stamp were moved out of the cache folder before each cold start. NVIDIA's own driver cache was left alone, since other games on this PC use it. | start | switches | what the log says | |---|---|---| | cold, default | `RX_VK_PRECOMPILE=1` (so `RX_VK_LOAD=create`, the default with mesh shaders) | `pipeline cache ... (0 KB)`; the warm path builds `1913 noted pipelines ... in 1.0 s` and writes `the pipeline cache written, 93.6 MB, in 69 ms`. Your branch doesn't apply on this path | | cold, the start path | `RX_VK_PRECOMPILE=1;RX_VK_LOAD=start` with the default 30 s | (not run separately: the build takes about 1 s here, far under 30 s, so no line is expected) | | cold, the start path, threshold 1 s | `RX_VK_PRECOMPILE=1;RX_VK_LOAD=start;RX_VK_PRECOMPILE_SAVE_S=1` | `precompile: 1402 programs, 1913 graphics and 151 compute pipelines ... in 1137 ms`, then `pipeline cache saved (95873 KB)` and `vk: precompile: its pipelines took 1 s (compiled, not found in the caches): the pipeline cache written, 93.6 MB, in 71 ms, before the title (RX_VK_PRECOMPILE_SAVE_S=0: not)` | | the next start, default 30 s | `RX_VK_PRECOMPILE=1;RX_VK_LOAD=start` | `pipeline cache ... (95873 KB)` found; the precompile in 280 ms; no save line | So on Windows the new branch writes the cache before the title, and the next start finds every pipeline in it. The title came in 46-47 s on every start, and there was no device loss, `VK_ERROR` or FATAL line. Not seen: the start-up screen's "saving" text. The write took 71 ms, and screenshots every 120 presents didn't catch it. Also not reached: a real precompile of 30 s or more. The driver's own cache makes this card's compile take about 1 s, so the "compiled, not found in the caches" wording held only because I lowered the threshold. A PC with an empty driver cache, after a driver update, is where the default 30 s path would show. *Posted by an AI agent (Claude Code) for d4nkn3ss.*
Author
Contributor

Thanks @d4nkn3ss. So on Windows the save before the title works and the next start finds every pipeline in it, and the default 30 s threshold is never reached on a card whose driver cache already holds the pipelines, which is the intended quiet case. The 30 s path with a cold driver cache is still shown only on the Steam Deck run in the description.

Thanks @d4nkn3ss. So on Windows the save before the title works and the next start finds every pipeline in it, and the default 30 s threshold is never reached on a card whose driver cache already holds the pipelines, which is the intended quiet case. The 30 s path with a cold driver cache is still shown only on the Steam Deck run in the description.
Member

Code-only review of 3ac77beb07; informational findings, with final approval left to another reviewer.

No new correctness defect found in the changed save path. The early forced save follows worker joins, excludes abandoned/stopped/preparation-only runs, and uses the existing atomic file publication and fetch synchronization. Its outcome is thread-local, matching the forced save's synchronous execution.

The Windows result provides useful coverage beyond the description: the 1 s override exercised publication and the following start reused the cache. It does not cover the listed default-threshold cold-driver case or the visible saving state; the Deck integration run covers the long-compile case. Those remaining observations are validation gaps, not a code defect established by this review.

The helper tests exercise the threshold and cancellation decisions, and the existing save fixture checks publication failures and outcomes. The new caller wiring check is textual: negating due(...) would retain its expected strings, so it does not independently prove the caller obeys that decision. A behavioral caller test would strengthen regression coverage.

Merge coordination: 789 handles cache invalidation for the separate load-at-create path; 902 adds environment diagnostics. Neither replaces this persistence change. Preserve 498's quit-marker handling when integrating startup changes.

Read the full diff, startup/cancellation/save callers, storage contract, tests and current discussion. No tests, builds or game runs performed.

Code-only review of 3ac77beb074ab403be8979b08a790a7a86903c9f; informational findings, with final approval left to another reviewer. No new correctness defect found in the changed save path. The early forced save follows worker joins, excludes abandoned/stopped/preparation-only runs, and uses the existing atomic file publication and fetch synchronization. Its outcome is thread-local, matching the forced save's synchronous execution. The [Windows result](https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/903#issuecomment-32931) provides useful coverage beyond the description: the 1 s override exercised publication and the following start reused the cache. It does not cover the listed default-threshold cold-driver case or the visible saving state; the Deck integration run covers the long-compile case. Those remaining observations are validation gaps, not a code defect established by this review. The helper tests exercise the threshold and cancellation decisions, and the existing save fixture checks publication failures and outcomes. The new caller wiring check is textual: negating `due(...)` would retain its expected strings, so it does not independently prove the caller obeys that decision. A behavioral caller test would strengthen regression coverage. Merge coordination: [789](https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/789) handles cache invalidation for the separate load-at-create path; [902](https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/902) adds environment diagnostics. Neither replaces this persistence change. Preserve [498](https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/498)'s quit-marker handling when integrating startup changes. Read the full diff, startup/cancellation/save callers, storage contract, tests and current discussion. No tests, builds or game runs performed.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e1soFohzgkXECzkbdR
test(vk): the quit check's fixture has what precompile_warm's save now names
Some checks failed
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been skipped
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been skipped
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been skipped
Third-party parts / The same as upstream (pull_request) Has been skipped
Website / Website on Cloudflare (pull_request) Has been skipped
PR description / Description follows the template (pull_request_target) Successful in 8s
CI / Conventional Commit title (pull_request) Successful in 9s
Guide screenshots / Guide images and local UI source review (pull_request) Failing after 12s
CI / Workflow lint (actionlint) (pull_request) Successful in 14s
Third-party parts / As their notes say (pull_request) Successful in 16s
beanstalk/approval changed since the request: ask again
ae5a2fa2d0
tests/test_quit_not_crash.py pastes precompile_warm's `if (all && !prepare_stopped())` block into its fixture. Since this
PR the block logs precompile_save::said(pcache_save_outcome), which the fixture did not declare, so it no longer compiled.
Both are added under __has_include, as crash_markers.h is, so --source still builds a checkout from before.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e1soFohzgkXECzkbdR
Owner

Tested in the game on Linux with NVIDIA, the start path with every pipeline compiled. In short: the save before the title works, and a start with nothing new to save costs 1 ms.

Hardware: RTX 3090 (NVIDIA 620.70.06), Ryzen 9 7900X, 30 GB, CachyOS (Linux 7.3)
Build: this PR's two commits on main @ 02903b04 (a renderer pack over a prepared base: only this PR's files differ from it), headless, through the PC's job queue (shared)
Switches: RX_VK_PRECOMPILE=1 RX_VK_LOAD=start. Before run 1, longshot_vk_pipelines.bin and its stamp moved out of the cache folder. Each run with its own empty NVIDIA shader cache (__GL_SHADER_DISK_CACHE_PATH), so nothing could come from the driver's folder.

start what the log says
run 1: no pipeline cache file (pipeline cache ... (0 KB)) precompile: 33375 programs, 32390 graphics and 9927 compute pipelines ... in 333177 ms, then pipeline cache saved (1426415 KB) and precompile: its pipelines took 327 s (compiled, not found in the caches): the pipeline cache written, 1393.0 MB, in 5148 ms, before the title. The file was on disk (1,460,649,748 bytes) before the first present
run 2: from the folder run 1 left, NVIDIA's cache empty again the file read (1426415 KB), the pipelines compiled again in 321652 ms, then the pipeline cache not written: nothing new since it was read or last written (1393.0 MB), in 1 ms, before the title

Run 2 compiled everything again because NVIDIA answers a new process from its own shader cache, not from VkPipelineCache data (development.md, RX_VK_LOAD), and that cache was empty on purpose. So the faster second start is RADV's, shown on the Deck run; what this run shows is the save itself, on a driver the Deck run didn't cover, and the save's no-op path.

Pushed to the branch (a merge of main, no rewrite), ae5a2fa2: tests/test_quit_not_crash.py, which came to main after this branched, pastes precompile_warm's if (all && !prepare_stopped()) block into its fixture. That block now names precompile_save::said and pcache_save_outcome, which the fixture didn't declare, so the check stopped compiling. Both are added under __has_include, as crash_markers.h is. No tests were run on this PC (a code read only); the other checks that cut precompile_run, precompile_warm or pipeline_cache_save were read and either compile stubs or match strings this PR leaves alone.

Tested in the game on Linux with NVIDIA, the start path with every pipeline compiled. In short: the save before the title works, and a start with nothing new to save costs 1 ms. Hardware: RTX 3090 (NVIDIA 620.70.06), Ryzen 9 7900X, 30 GB, CachyOS (Linux 7.3) Build: this PR's two commits on main @ 02903b04 (a renderer pack over a prepared base: only this PR's files differ from it), headless, through the PC's job queue (`shared`) Switches: `RX_VK_PRECOMPILE=1 RX_VK_LOAD=start`. Before run 1, `longshot_vk_pipelines.bin` and its stamp moved out of the cache folder. Each run with its own empty NVIDIA shader cache (`__GL_SHADER_DISK_CACHE_PATH`), so nothing could come from the driver's folder. | start | what the log says | |---|---| | run 1: no pipeline cache file (`pipeline cache ... (0 KB)`) | `precompile: 33375 programs, 32390 graphics and 9927 compute pipelines ... in 333177 ms`, then `pipeline cache saved (1426415 KB)` and `precompile: its pipelines took 327 s (compiled, not found in the caches): the pipeline cache written, 1393.0 MB, in 5148 ms, before the title`. The file was on disk (1,460,649,748 bytes) before the first present | | run 2: from the folder run 1 left, NVIDIA's cache empty again | the file read (`1426415 KB`), the pipelines compiled again in 321652 ms, then `the pipeline cache not written: nothing new since it was read or last written (1393.0 MB), in 1 ms, before the title` | Run 2 compiled everything again because NVIDIA answers a new process from its own shader cache, not from `VkPipelineCache` data (development.md, `RX_VK_LOAD`), and that cache was empty on purpose. So the faster second start is RADV's, shown on the Deck run; what this run shows is the save itself, on a driver the Deck run didn't cover, and the save's no-op path. Pushed to the branch (a merge of main, no rewrite), ae5a2fa2: `tests/test_quit_not_crash.py`, which came to main after this branched, pastes `precompile_warm`'s `if (all && !prepare_stopped())` block into its fixture. That block now names `precompile_save::said` and `pcache_save_outcome`, which the fixture didn't declare, so the check stopped compiling. Both are added under `__has_include`, as `crash_markers.h` is. No tests were run on this PC (a code read only); the other checks that cut `precompile_run`, `precompile_warm` or `pipeline_cache_save` were read and either compile stubs or match strings this PR leaves alone.
HumanBean approved these changes 2026-11-16 11:49:10 +00:00
HumanBean left a comment

Approving. The save before the title is right: pipeline_cache_save(true) runs on the precompile's thread, so the thread_local outcome is read where it was written; a forced save can't be put off (had is always true with wait_ms -1), so it never logs "did not run"; the 64 MB play rule applies only unforced, and pcache_saved_size moves with the write. Tested on an RTX 3090 (comment above): 1.39 GB written in 5.1 s after a 327 s compile, and 1 ms when nothing was new.

The one blocker I found, tests/test_quit_not_crash.py's fixture missing the two names precompile_warm now uses, is fixed on the branch (ae5a2fa2). Two nits inline, neither blocking.

Approving. The save before the title is right: `pipeline_cache_save(true)` runs on the precompile's thread, so the `thread_local` outcome is read where it was written; a forced save can't be put off (`had` is always true with `wait_ms` -1), so it never logs "did not run"; the 64 MB play rule applies only unforced, and `pcache_saved_size` moves with the write. Tested on an RTX 3090 (comment above): 1.39 GB written in 5.1 s after a 327 s compile, and 1 ms when nothing was new. The one blocker I found, `tests/test_quit_not_crash.py`'s fixture missing the two names `precompile_warm` now uses, is fixed on the branch (ae5a2fa2). Two nits inline, neither blocking.
@ -9601,6 +9604,19 @@ void precompile_run(void (*progress)(size_t done, size_t total)) {
cs_cached + cs_compiled, cs_cached, cs_compiled, cs_failed);
// (every note built, by a run that got to its end: RX_VK_LOAD=create may load them from the caches from the next start on)
if (!gone_on && !prepare_stopped()) precompile_built_write(graphics_n);
// (pipelines that took this long were compiled, not found: written before the title, the start-up screen saying so, as
Owner

Nit: precompile_warm writes the cache before its marker ("in the file before the marker says they are there"); here precompile_built_write runs just above, then a write that takes seconds (5 s for 1.4 GB on an RTX 3090). A start closed during that write leaves a marker saying the notes are in a cache that doesn't have them. Main has the same order with no save, so it's not new, but putting this save above that line would keep the two paths alike.

Nit: `precompile_warm` writes the cache before its marker ("in the file before the marker says they are there"); here `precompile_built_write` runs just above, then a write that takes seconds (5 s for 1.4 GB on an RTX 3090). A start closed during that write leaves a marker saying the notes are in a cache that doesn't have them. Main has the same order with no save, so it's not new, but putting this save above that line would keep the two paths alike.
@ -9604,0 +9613,4 @@
prepare_saving_now.store(true, std::memory_order_relaxed);
pipeline_cache_save(true);
prepare_saving_now.store(false, std::memory_order_relaxed);
logf("vk: precompile: its pipelines took %.0f s (compiled, not found in the caches): the pipeline cache %s, in %.0f ms, "
Owner

Nit: due goes by time alone, so a slow disk whose start found everything but took 30 s gets here too, and the line then says "compiled, not found in the caches". kSame makes it a no-op when the cache didn't grow, so only the words are off: "its pipelines took N s" would say just what's known.

Nit: `due` goes by time alone, so a slow disk whose start found everything but took 30 s gets here too, and the line then says "compiled, not found in the caches". `kSame` makes it a no-op when the cache didn't grow, so only the words are off: "its pipelines took N s" would say just what's known.
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!903
No description provided.