fix(host): drop Steam Fossilize and NVIDIA cache overrides on Windows #2883

Open
ImpulsiveOrange8114 wants to merge 1 commit from ImpulsiveOrange8114/Longshot:fix/win-steam-shader-cache into main
First-time contributor

Summary

On Windows with an NVIDIA GPU, launching a prepared Longshot install through a Steam non-Steam library shortcut (with Steam Shader Pre-Caching enabled, the Steam default) compiles all ~42k pipelines at ~46–126/s (~15+ minutes) instead of loading in seconds as a direct launch does.

How to see the bug on main:

  1. Prepare a Windows install on an NVIDIA GPU (so %LOCALAPPDATA%\NVIDIA\GLCache\<app-hash>.bin and longshot_vk_pipelines.bin are warm).
  2. Add the game as a Non-Steam Game in Steam with Steam → Settings → Downloads → Enable Shader Pre-Caching enabled and blank Launch Options, then launch it from Steam.
  3. longshot_log.txt logs Fossilize ERROR: Failed to parse ApplicationInfoFilter, letting recording go through. (serializing ~328 MB into steamapp_pipeline_cache.foz), and NVIDIA's Windows Vulkan driver honors Steam's __GL_SHADER_DISK_CACHE_PATH (.../steamapps/shadercache/<appid>/nvidiav1) and __GL_SHADER_DISK_CACHE_APP_NAME=steamapp_shader_cache0, ignoring the warm <app-hash>.bin in %LOCALAPPDATA%\NVIDIA\GLCache and compiling from scratch (texture pipelines 1,470 ms vs 3–4 ms; precompile ~46–126 pipelines/s). Even when __GL_SHADER_DISK_CACHE_PATH is unset, __GL_SHADER_DISK_CACHE_APP_NAME=steamapp_shader_cache0 still forces NVIDIA to create a cold steamapp_shader_cache0.bin beside the warm cache file.

What this changes:

  • host/steam_shader_env.h (new, stdlib-only helper): detects Steam Fossilize activation (ENABLE_VK_LAYER_VALVE_steam_fossilize_1) and Steam-injected NVIDIA cache overrides (__GL_SHADER_DISK_CACHE_APP_NAME / _READ_ONLY_APP_NAME starting with steamapp_, or SteamAppId/SteamGameId + shadercache in __GL_SHADER_DISK_CACHE_PATH). Player-configured non-Steam __GL_SHADER_DISK_CACHE_* settings are left untouched.
  • host/hos_main.c (win_steam_driver_env_choose, #ifdef _WIN32): runs after hos_profiling_env() and before Vulkan loads; sets DISABLE_VK_LAYER_VALVE_steam_fossilize_1=1, unsets ENABLE_VK_LAYER_VALVE_steam_fossilize_1 and Steam's __GL_SHADER_DISK_CACHE_* vars via both SetEnvironmentVariableA and _putenv, and records a vk: line in driver_env_said for driver_env_log().
  • gpu/vk/pcache_load.h (nvidia_cache_windows) and gpu/vk/vk_draw.cpp (pcache_load_off, driver_cache_bytes): honor __GL_SHADER_DISK_CACHE_PATH on Windows when set instead of always assuming %LOCALAPPDATA%\NVIDIA\GLCache.
  • tests/test_win_steam_shader_env.py and tests/test_pcache_load.py: unit + Win32 environment tests for Steam vs. player-chosen overrides and Windows __GL_SHADER_DISK_CACHE_PATH resolution.

Result: Launching from Steam with Shader Pre-Caching enabled now disables Fossilize, reuses the prepared NVIDIA GLCache, and matches direct-launch startup times.

Testing

Tested:

  • In-game (Windows 10 x64 19045, NVIDIA GeForce RTX 3060 Ti, driver 621.01 / 0x9b404000, 32 GB RAM, NVIDIA Shader Cache Size 100 GB): Built longshot.exe and longshot_vk.dll from this branch, hard-linked the prepared cache (translator_stamp=d1b6a64911547e0b), and launched directly via a Steam Non-Steam Game shortcut with Steam Shader Pre-Caching enabled and blank Launch Options:
    • Log printed: vk: Steam Fossilize layer disabled and Steam NVIDIA shader cache overrides dropped so NVIDIA reuses the prepared GLCache
    • Zero Fossilize INFO/ERROR lines in longshot_log.txt
    • texture pipelines made before the game in 4 ms (was 1,470 ms)
    • precompile: load at create (RX_VK_LOAD=create): 38772 noted pipelines found, none built ... in 36 ms (was ~15+ min)
  • Game-free checks (Windows, llvm-mingw clang/clang++):
    • python -I -B tests/test_win_steam_shader_env.py — failed on main, passed here (covers pure decision table, hos_main.c wiring, and real Win32 + CRT env clearing)
    • python -I -B tests/test_pcache_load.py — all 16 Windows cases passed, including new win-override-warm and win-override-cold
    • python -I -B tests/test_profiling_mode.py — passed
    • clang -x c-header -std=c11 -fsyntax-only -Wall -Wextra -Werror host/steam_shader_env.h — passed

Still to test:

  • Windows + AMD / Intel GPU: launch via Steam with Shader Pre-Caching enabled, expecting Fossilize disabled with normal warm startup (by hand)

Measurements

Verdict: Eliminates Steam-induced cold shader/pipeline recompilation on Windows + NVIDIA, cutting Steam launch shader startup from ~15+ minutes (aborted after 403.4 s at 18,735/42,193 pipelines) down to matching direct launch (4 ms texture pipelines, 36 ms to verify 38,772 noted pipelines with 0 compiled).

Setup: Windows 10 x64, NVIDIA GeForce RTX 3060 Ti (driver 621.01), 32 GB RAM, same warm 1.28 GB longshot_vk_pipelines.bin + 1,802 MB %LOCALAPPDATA%\NVIDIA\GLCache, launched via Steam Non-Steam shortcut with Steam Shader Pre-Caching enabled.

Before: main @ 6f5f99fc After: this PR @ 94099bec
Steam Fossilize layer Active (~328 MB .foz written) Disabled (0 Fossilize lines)
Texture pipelines at start 1,470 ms 4 ms
Noted pipelines startup 18,735 / 42,193 in 403.4 s (~46/s, ~15+ min) 38,772 / 38,772 found in 36 ms (0 built)

Risks

  • Low risk: dropping is narrowly scoped to Steam's Fossilize enable variable (ENABLE_VK_LAYER_VALVE_steam_fossilize_1) and Steam's own NVIDIA cache overrides (steamapp_* app names or Steam shadercache paths when SteamAppId/SteamGameId is set). Non-Steam player overrides are preserved.
  • No saves, longshot_options.ini, or existing shader caches change on update; players who previously launched via Steam with Shader Pre-Caching on will immediately reuse their prepared %LOCALAPPDATA%\NVIDIA\GLCache instead of Steam's duplicate per-AppID folder.
  • Fully reversible with a clean revert.

Checklist

Ready for review

  • One topic, on current main; the title is a Conventional Commit.
  • 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).
  • 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.
  • A check under tests/ that reads changed source is updated, not weakened.
  • Host code builds on Windows (llvm-mingw) and Linux, with UTF-8 paths.
  • 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 On Windows with an NVIDIA GPU, launching a prepared Longshot install through a Steam non-Steam library shortcut (with Steam Shader Pre-Caching enabled, the Steam default) compiles all ~42k pipelines at ~46–126/s (~15+ minutes) instead of loading in seconds as a direct launch does. **How to see the bug on `main`:** 1. Prepare a Windows install on an NVIDIA GPU (so `%LOCALAPPDATA%\NVIDIA\GLCache\<app-hash>.bin` and `longshot_vk_pipelines.bin` are warm). 2. Add the game as a Non-Steam Game in Steam with **Steam → Settings → Downloads → Enable Shader Pre-Caching** enabled and blank Launch Options, then launch it from Steam. 3. `longshot_log.txt` logs `Fossilize ERROR: Failed to parse ApplicationInfoFilter, letting recording go through.` (serializing ~328 MB into `steamapp_pipeline_cache.foz`), and NVIDIA's Windows Vulkan driver honors Steam's `__GL_SHADER_DISK_CACHE_PATH` (`.../steamapps/shadercache/<appid>/nvidiav1`) and `__GL_SHADER_DISK_CACHE_APP_NAME=steamapp_shader_cache0`, ignoring the warm `<app-hash>.bin` in `%LOCALAPPDATA%\NVIDIA\GLCache` and compiling from scratch (`texture pipelines` 1,470 ms vs 3–4 ms; precompile ~46–126 pipelines/s). Even when `__GL_SHADER_DISK_CACHE_PATH` is unset, `__GL_SHADER_DISK_CACHE_APP_NAME=steamapp_shader_cache0` still forces NVIDIA to create a cold `steamapp_shader_cache0.bin` beside the warm cache file. **What this changes:** - `host/steam_shader_env.h` (new, stdlib-only helper): detects Steam Fossilize activation (`ENABLE_VK_LAYER_VALVE_steam_fossilize_1`) and Steam-injected NVIDIA cache overrides (`__GL_SHADER_DISK_CACHE_APP_NAME` / `_READ_ONLY_APP_NAME` starting with `steamapp_`, or `SteamAppId`/`SteamGameId` + `shadercache` in `__GL_SHADER_DISK_CACHE_PATH`). Player-configured non-Steam `__GL_SHADER_DISK_CACHE_*` settings are left untouched. - `host/hos_main.c` (`win_steam_driver_env_choose`, `#ifdef _WIN32`): runs after `hos_profiling_env()` and before Vulkan loads; sets `DISABLE_VK_LAYER_VALVE_steam_fossilize_1=1`, unsets `ENABLE_VK_LAYER_VALVE_steam_fossilize_1` and Steam's `__GL_SHADER_DISK_CACHE_*` vars via both `SetEnvironmentVariableA` and `_putenv`, and records a `vk:` line in `driver_env_said` for `driver_env_log()`. - `gpu/vk/pcache_load.h` (`nvidia_cache_windows`) and `gpu/vk/vk_draw.cpp` (`pcache_load_off`, `driver_cache_bytes`): honor `__GL_SHADER_DISK_CACHE_PATH` on Windows when set instead of always assuming `%LOCALAPPDATA%\NVIDIA\GLCache`. - `tests/test_win_steam_shader_env.py` and `tests/test_pcache_load.py`: unit + Win32 environment tests for Steam vs. player-chosen overrides and Windows `__GL_SHADER_DISK_CACHE_PATH` resolution. **Result:** Launching from Steam with Shader Pre-Caching enabled now disables Fossilize, reuses the prepared NVIDIA `GLCache`, and matches direct-launch startup times. ## Testing **Tested:** - **In-game (Windows 10 x64 19045, NVIDIA GeForce RTX 3060 Ti, driver `621.01` / `0x9b404000`, 32 GB RAM, NVIDIA Shader Cache Size 100 GB):** Built `longshot.exe` and `longshot_vk.dll` from this branch, hard-linked the prepared cache (`translator_stamp=d1b6a64911547e0b`), and launched directly via a Steam Non-Steam Game shortcut with Steam Shader Pre-Caching **enabled** and blank Launch Options: - Log printed: `vk: Steam Fossilize layer disabled and Steam NVIDIA shader cache overrides dropped so NVIDIA reuses the prepared GLCache` - Zero `Fossilize INFO/ERROR` lines in `longshot_log.txt` - `texture pipelines made before the game in 4 ms` (was `1,470 ms`) - `precompile: load at create (RX_VK_LOAD=create): 38772 noted pipelines found, none built ... in 36 ms` (was ~15+ min) - **Game-free checks (Windows, `llvm-mingw` `clang`/`clang++`):** - `python -I -B tests/test_win_steam_shader_env.py` — failed on `main`, passed here (covers pure decision table, `hos_main.c` wiring, and real Win32 + CRT env clearing) - `python -I -B tests/test_pcache_load.py` — all 16 Windows cases passed, including new `win-override-warm` and `win-override-cold` - `python -I -B tests/test_profiling_mode.py` — passed - `clang -x c-header -std=c11 -fsyntax-only -Wall -Wextra -Werror host/steam_shader_env.h` — passed **Still to test:** - Windows + AMD / Intel GPU: launch via Steam with Shader Pre-Caching enabled, expecting Fossilize disabled with normal warm startup (`by hand`) ## Measurements **Verdict:** Eliminates Steam-induced cold shader/pipeline recompilation on Windows + NVIDIA, cutting Steam launch shader startup from ~15+ minutes (aborted after 403.4 s at 18,735/42,193 pipelines) down to matching direct launch (`4 ms` texture pipelines, `36 ms` to verify 38,772 noted pipelines with 0 compiled). Setup: Windows 10 x64, NVIDIA GeForce RTX 3060 Ti (driver `621.01`), 32 GB RAM, same warm `1.28 GB` `longshot_vk_pipelines.bin` + `1,802 MB` `%LOCALAPPDATA%\NVIDIA\GLCache`, launched via Steam Non-Steam shortcut with Steam Shader Pre-Caching enabled. | | Before: main @ 6f5f99fc | After: this PR @ 94099bec | |---|---|---| | Steam Fossilize layer | Active (~328 MB `.foz` written) | Disabled (`0` Fossilize lines) | | Texture pipelines at start | 1,470 ms | 4 ms | | Noted pipelines startup | 18,735 / 42,193 in 403.4 s (~46/s, ~15+ min) | 38,772 / 38,772 found in 36 ms (0 built) | ## Risks - Low risk: dropping is narrowly scoped to Steam's Fossilize enable variable (`ENABLE_VK_LAYER_VALVE_steam_fossilize_1`) and Steam's own NVIDIA cache overrides (`steamapp_*` app names or Steam `shadercache` paths when `SteamAppId`/`SteamGameId` is set). Non-Steam player overrides are preserved. - No saves, `longshot_options.ini`, or existing shader caches change on update; players who previously launched via Steam with Shader Pre-Caching on will immediately reuse their prepared `%LOCALAPPDATA%\NVIDIA\GLCache` instead of Steam's duplicate per-AppID folder. - Fully reversible with a clean revert. ## Checklist ### Ready for review - [x] One topic, on current `main`; the title is a Conventional Commit. - [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). - [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. - [x] A check under `tests/` that reads changed source is updated, not weakened. - [x] Host code builds on Windows (llvm-mingw) and Linux, with UTF-8 paths. - [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.
fix(host): drop Steam Fossilize and NVIDIA cache overrides on Windows
Some checks failed
PR description / Title and description (pull_request_target) Failing after 7s
CI / What the change needs (pull_request) Has been cancelled
CI / Lint (pre-commit, ShellCheck, actionlint) (pull_request) Has been cancelled
CI / Third-party parts and guide screenshots (pull_request) Has been cancelled
CI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request) Has been cancelled
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Has been cancelled
CI / Renderer build check (Windows, compile --only renderer, without and with FSR 4) (pull_request) Has been cancelled
CI / Renderer build check (Linux, compile --only renderer, without and with FSR 4) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 1/2) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 2/2) (pull_request) Has been cancelled
CI / Website build and checks (pull_request) Has been cancelled
4ba438f5b2
On Windows with Shader Pre-Caching enabled, Steam injects ENABLE_VK_LAYER_VALVE_steam_fossilize_1=1 and NVIDIA __GL_SHADER_DISK_CACHE_PATH / __GL_SHADER_DISK_CACHE_APP_NAME=steamapp_shader_cache0, causing NVIDIA's Vulkan driver to ignore the prepared GLCache and recompile ~42k pipelines (~15 min vs ~5 s direct).

Drop Steam's Fossilize activation and Steam-injected __GL_SHADER_DISK_CACHE_* overrides before Vulkan loads on Windows (leaving user-configured non-Steam values intact), and honor __GL_SHADER_DISK_CACHE_PATH in Windows GLCache measurement.

Assisted-by: Antigravity
Member

Possibly related, for context:

  • PR #2751 fix(dev): the queue names no NVIDIA cache folder for a game the Windows sandbox confines — Related Windows NVIDIA cache-path handling in dev queue
Possibly related, for context: - PR #2751 fix(dev): the queue names no NVIDIA cache folder for a game the Windows sandbox confines — Related Windows NVIDIA cache-path handling in dev queue
Merge branch 'main' into fix/win-steam-shader-cache
Some checks failed
PR description / Title and description (pull_request_target) Failing after 7s
CI / What the change needs (pull_request) Has been cancelled
CI / Lint (pre-commit, ShellCheck, actionlint) (pull_request) Has been cancelled
CI / Third-party parts and guide screenshots (pull_request) Has been cancelled
CI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request) Has been cancelled
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Has been cancelled
CI / Renderer build check (Windows, compile --only renderer, without and with FSR 4) (pull_request) Has been cancelled
CI / Renderer build check (Linux, compile --only renderer, without and with FSR 4) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 1/2) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 2/2) (pull_request) Has been cancelled
CI / Website build and checks (pull_request) Has been cancelled
1b4513828c
ImpulsiveOrange8114 force-pushed fix/win-steam-shader-cache from 1b4513828c
Some checks failed
PR description / Title and description (pull_request_target) Failing after 7s
CI / What the change needs (pull_request) Has been cancelled
CI / Lint (pre-commit, ShellCheck, actionlint) (pull_request) Has been cancelled
CI / Third-party parts and guide screenshots (pull_request) Has been cancelled
CI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request) Has been cancelled
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Has been cancelled
CI / Renderer build check (Windows, compile --only renderer, without and with FSR 4) (pull_request) Has been cancelled
CI / Renderer build check (Linux, compile --only renderer, without and with FSR 4) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 1/2) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 2/2) (pull_request) Has been cancelled
CI / Website build and checks (pull_request) Has been cancelled
to 94099becfe
Some checks failed
PR description / Title and description (pull_request_target) Successful in 5s
CI / What the change needs (pull_request) Has been cancelled
CI / Lint (pre-commit, ShellCheck, actionlint) (pull_request) Has been cancelled
CI / Third-party parts and guide screenshots (pull_request) Has been cancelled
CI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request) Has been cancelled
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Has been cancelled
CI / Renderer build check (Windows, compile --only renderer, without and with FSR 4) (pull_request) Has been cancelled
CI / Renderer build check (Linux, compile --only renderer, without and with FSR 4) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 1/2) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 2/2) (pull_request) Has been cancelled
CI / Website build and checks (pull_request) Has been cancelled
2026-11-30 07:24:40 +00:00
Compare
ImpulsiveOrange8114 changed title from fix(host): drop Steam Fossilize and NVIDIA cache overrides on Windows to WIP: fix(host): drop Steam Fossilize and NVIDIA cache overrides on Windows 2026-11-30 07:25:35 +00:00
ImpulsiveOrange8114 changed title from WIP: fix(host): drop Steam Fossilize and NVIDIA cache overrides on Windows to fix(host): drop Steam Fossilize and NVIDIA cache overrides on Windows 2026-11-30 07:27:00 +00:00
Member
@review
BeanBot requested changes 2026-11-30 07:50:49 +00:00
Dismissed
BeanBot left a comment

Recommendation: Request changes. The environment cleanup can discard player-selected NVIDIA cache settings and can turn a warm Steam cache into a cold cache after an update. The reported NVIDIA result is promising, but it does not cover those cases or the other Windows GPUs affected by disabling Fossilize.

On Windows, the change disables Steam Fossilize and redirects Steam-injected NVIDIA shader caches to the normal driver cache. It also makes the pipeline-cache policy inspect an overridden NVIDIA cache path; this can avoid a long Steam startup when the normal cache is already warm, but changes cache selection for existing users.

Blocking (2): must change before merging.

  1. L1 host/hos_main.c:1008: Detecting any one Steam cache value removes every NVIDIA cache override, including unrelated player-selected values. (more on the line) Do: Classify and remove the Steam-injected values individually, preserving custom path and app-name settings, and add mixed Steam/player environment cases to the test.
  2. L2 host/hos_main.c:1001: The unconditional cache switch discards a previously warm Steam driver cache even when the normal NVIDIA cache is cold. (more on the line) Do: Preserve or migrate the warm cache when switching locations, or arrange preparation of the destination before relying on it; cover an upgrade from a Steam-only warm cache.

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

  • L3 tests/test_win_steam_shader_env.py:186: The Windows test's environment filter compares mixed-case prefixes against environment keys that Python normalizes to uppercase on Windows. (more on the line) Do: Compare normalized uppercase keys against uppercase prefixes before constructing each test environment.

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

  • L4: The reported startup improvement needs a repeatable comparison against the supplied merge base, including both warm and cold caches. When: The table compares different pipeline counts and identifies a different before commit; it gives one run per side and does not measure a user whose existing Steam cache is warm and default cache cold. Do: Run at least two interleaved comparisons per side on the merge base and head, with the same build and cache state, reporting startup time and cache sizes for warm and cold cases.
  • L5: Disabling Fossilize also changes Windows Steam launches on AMD and Intel, which have not been run. When: Those GPUs enter the same Fossilize-disable branch even though the reported in-game result covers only NVIDIA. Do: Test a Steam launch and warm startup on Windows AMD and Intel, recording the outcome and startup time against the base.

@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. The author reports texture-pipeline creation falling from 1,470 ms to 4 ms and a warm pipeline lookup taking 36 ms instead of a precompile aborted at 403.4 seconds. Those are single reported runs with different pipeline counts, and the stated before commit is not the supplied merge base; repeated comparisons and cold-cache results are missing.

Other systems: The host change disables Fossilize on Windows regardless of GPU, so AMD and Intel Steam launches also change; the PR lists them as untested. Linux is excluded from the host change. Windows NVIDIA systems with a player-selected cache or a cache warmed only under Steam can take different paths. The cache-size policy affects NVIDIA systems with at most 20 GB RAM and load-at-create enabled.

Switches: No Longshot switch is added. On Windows the change sets the Vulkan loader's DISABLE_VK_LAYER_VALVE_steam_fossilize_1 to 1 and removes its ENABLE counterpart when enabled; it also removes selected NVIDIA cache environment variables when it detects a Steam marker. These defaults need the cache-preservation fixes and cross-GPU validation described below.

Reviewed: 94099becfe against 28cb22b9ed: Read the repository rules, PR template, commit and complete diff; read host/steam_shader_env.h, gpu/vk/pcache_load.h and the new test in full, and inspected the changed functions and callers in host/hos_main.c, gpu/vk/vk_draw.cpp and tests/test_pcache_load.py. The remainder of the large host and renderer files and builder code was skimmed, not read in full. docs/review-checklist.md and the adjacent Tooling checkout were absent. No recorded runs, translations or generated files were changed.; nothing run (a code review).

Checked and fine:

  • The commit records AI assistance.
  • No game-derived output, generated file, shader, renderer API definition or third-party file appears in the diff.
  • The new helper makes no shared mutable state; its environment changes run before the Windows game and renderer initialization.
  • The supplied CI report has no head-only failures, although checks are still running.

Testing: Read-only review; no builds, scripts or tests were run. The author reports Windows game and game-free checks; CI is still running.

Overlaps and merge order: Not checked; network access is closed.


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

**Recommendation: Request changes.** The environment cleanup can discard player-selected NVIDIA cache settings and can turn a warm Steam cache into a cold cache after an update. The reported NVIDIA result is promising, but it does not cover those cases or the other Windows GPUs affected by disabling Fossilize. On Windows, the change disables Steam Fossilize and redirects Steam-injected NVIDIA shader caches to the normal driver cache. It also makes the pipeline-cache policy inspect an overridden NVIDIA cache path; this can avoid a long Steam startup when the normal cache is already warm, but changes cache selection for existing users. **Blocking (2)**: must change before merging. 1. **L1** `host/hos_main.c:1008`: Detecting any one Steam cache value removes every NVIDIA cache override, including unrelated player-selected values. (more on the line) **Do:** Classify and remove the Steam-injected values individually, preserving custom path and app-name settings, and add mixed Steam/player environment cases to the test. 2. **L2** `host/hos_main.c:1001`: The unconditional cache switch discards a previously warm Steam driver cache even when the normal NVIDIA cache is cold. (more on the line) **Do:** Preserve or migrate the warm cache when switching locations, or arrange preparation of the destination before relying on it; cover an upgrade from a Steam-only warm cache. **Should fix (1)**: not blocking, but worth doing before merging. - **L3** `tests/test_win_steam_shader_env.py:186`: The Windows test's environment filter compares mixed-case prefixes against environment keys that Python normalizes to uppercase on Windows. (more on the line) **Do:** Compare normalized uppercase keys against uppercase prefixes before constructing each test environment. **Testing before merging (2)** (runs on the systems it can change; it doesn't hold the recommendation) - **L4**: The reported startup improvement needs a repeatable comparison against the supplied merge base, including both warm and cold caches. *When:* The table compares different pipeline counts and identifies a different before commit; it gives one run per side and does not measure a user whose existing Steam cache is warm and default cache cold. **Do:** Run at least two interleaved comparisons per side on the merge base and head, with the same build and cache state, reporting startup time and cache sizes for warm and cold cases. - **L5**: Disabling Fossilize also changes Windows Steam launches on AMD and Intel, which have not been run. *When:* Those GPUs enter the same Fossilize-disable branch even though the reported in-game result covers only NVIDIA. **Do:** Test a Steam launch and warm startup on Windows AMD and Intel, recording the outcome and startup time against the base. `@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. The author reports texture-pipeline creation falling from 1,470 ms to 4 ms and a warm pipeline lookup taking 36 ms instead of a precompile aborted at 403.4 seconds. Those are single reported runs with different pipeline counts, and the stated before commit is not the supplied merge base; repeated comparisons and cold-cache results are missing. **Other systems:** The host change disables Fossilize on Windows regardless of GPU, so AMD and Intel Steam launches also change; the PR lists them as untested. Linux is excluded from the host change. Windows NVIDIA systems with a player-selected cache or a cache warmed only under Steam can take different paths. The cache-size policy affects NVIDIA systems with at most 20 GB RAM and load-at-create enabled. **Switches:** No Longshot switch is added. On Windows the change sets the Vulkan loader's DISABLE_VK_LAYER_VALVE_steam_fossilize_1 to 1 and removes its ENABLE counterpart when enabled; it also removes selected NVIDIA cache environment variables when it detects a Steam marker. These defaults need the cache-preservation fixes and cross-GPU validation described below. **Reviewed:** 94099becfe86 against 28cb22b9ed23: Read the repository rules, PR template, commit and complete diff; read host/steam_shader_env.h, gpu/vk/pcache_load.h and the new test in full, and inspected the changed functions and callers in host/hos_main.c, gpu/vk/vk_draw.cpp and tests/test_pcache_load.py. The remainder of the large host and renderer files and builder code was skimmed, not read in full. docs/review-checklist.md and the adjacent Tooling checkout were absent. No recorded runs, translations or generated files were changed.; nothing run (a code review). **Checked and fine:** - The commit records AI assistance. - No game-derived output, generated file, shader, renderer API definition or third-party file appears in the diff. - The new helper makes no shared mutable state; its environment changes run before the Windows game and renderer initialization. - The supplied CI report has no head-only failures, although checks are still running. **Testing:** Read-only review; no builds, scripts or tests were run. The author reports Windows game and game-free checks; CI is still running. **Overlaps and merge order:** Not checked; network access is closed. </details> --- <sub>Automated code review by BeanBot (gpt-6.1-terra), asked for by llun. Nothing was run; a maintainer decides.</sub>
host/hos_main.c Outdated
@ -977,0 +998,4 @@
_putenv("DISABLE_VK_LAYER_VALVE_steam_fossilize_1=1");
win_unset_env("ENABLE_VK_LAYER_VALVE_steam_fossilize_1");
}
if (plan.drop_nv_cache) {
Member

L2 (blocking): The unconditional cache switch discards a previously warm Steam driver cache even when the normal NVIDIA cache is cold.

When: A player who prepared and played through Steam before updating can have the pipelines in Steam's cache but none in the default GLCache. This code removes the Steam path and app name, so the next launch uses the cold default and recompiles work that previously hit the warm cache.

Do: Preserve or migrate the warm cache when switching locations, or arrange preparation of the destination before relying on it; cover an upgrade from a Steam-only warm cache.

**L2** (blocking): The unconditional cache switch discards a previously warm Steam driver cache even when the normal NVIDIA cache is cold. *When:* A player who prepared and played through Steam before updating can have the pipelines in Steam's cache but none in the default GLCache. This code removes the Steam path and app name, so the next launch uses the cold default and recompiles work that previously hit the warm cache. **Do:** Preserve or migrate the warm cache when switching locations, or arrange preparation of the destination before relying on it; cover an upgrade from a Steam-only warm cache.
host/hos_main.c Outdated
@ -977,0 +1005,4 @@
"__GL_SHADER_DISK_CACHE_READ_ONLY_APP_NAME",
"__GL_SHADER_DISK_CACHE_READ_ONLY_APP_NAME_2",
};
for (size_t i = 0; i < sizeof nv_vars / sizeof *nv_vars; i++) win_unset_env(nv_vars[i]);
Member

L1 (blocking): Detecting any one Steam cache value removes every NVIDIA cache override, including unrelated player-selected values.

When: A Steam launch with its steamapp_ app name and a player-selected __GL_SHADER_DISK_CACHE_PATH=D:\MyNvCache sets drop_nv_cache, then unsets the custom path as well. The driver uses a different cache and the player's configured location is ignored.

Do: Classify and remove the Steam-injected values individually, preserving custom path and app-name settings, and add mixed Steam/player environment cases to the test.

**L1** (blocking): Detecting any one Steam cache value removes every NVIDIA cache override, including unrelated player-selected values. *When:* A Steam launch with its steamapp_ app name and a player-selected __GL_SHADER_DISK_CACHE_PATH=D:\MyNvCache sets drop_nv_cache, then unsets the custom path as well. The driver uses a different cache and the player's configured location is ignored. **Do:** Classify and remove the Steam-injected values individually, preserving custom path and app-name settings, and add mixed Steam/player environment cases to the test.
@ -0,0 +183,4 @@
raise SystemExit("FAIL: win harness exited %d\n%s" % (out.returncode, out.stderr))
return dict(line.split("=", 1) for line in out.stdout.splitlines()), out.stderr
base = {k: v for k, v in os.environ.items()
Member

L3 (should fix): The Windows test's environment filter compares mixed-case prefixes against environment keys that Python normalizes to uppercase on Windows.

When: If the test is started with Fossilize enabled, the inherited ENABLE_VK_LAYER_VALVE_STEAM_FOSSILIZE_1 survives the filter. The custom-cache case then disables Fossilize and fails even though that case intended a clean environment.

Do: Compare normalized uppercase keys against uppercase prefixes before constructing each test environment.

**L3** (should fix): The Windows test's environment filter compares mixed-case prefixes against environment keys that Python normalizes to uppercase on Windows. *When:* If the test is started with Fossilize enabled, the inherited ENABLE_VK_LAYER_VALVE_STEAM_FOSSILIZE_1 survives the filter. The custom-cache case then disables Fossilize and fails even though that case intended a clean environment. **Do:** Compare normalized uppercase keys against uppercase prefixes before constructing each test environment.
fix(host): address review L1-L3 (per-var Steam env, warm cache preservation, uppercase test filter)
Some checks failed
beanstalk/approval waiting for a BigBean's 👍 on the request
PR description / Title and description (pull_request_target) Successful in 9s
CI / What the change needs (pull_request) Has been cancelled
CI / Lint (pre-commit, ShellCheck, actionlint) (pull_request) Has been cancelled
CI / Third-party parts and guide screenshots (pull_request) Has been cancelled
CI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request) Has been cancelled
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Has been cancelled
CI / Renderer build check (Windows, compile --only renderer, without and with FSR 4) (pull_request) Has been cancelled
CI / Renderer build check (Linux, compile --only renderer, without and with FSR 4) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 1/2) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 2/2) (pull_request) Has been cancelled
CI / Website build and checks (pull_request) Has been cancelled
f4fea4a828
- L1: classify and unset Steam-injected __GL_SHADER_DISK_CACHE_* variables individually so player-selected custom path or app-name settings are preserved alongside Steam env vars.
- L2: measure destination non-steamapp GLCache vs Steam cache (bounded Win32 walk up to 512 MiB) and keep Steam's NVIDIA cache overrides when Steam's cache is warm while the destination GLCache is cold, avoiding cold recompiles on upgrade for Steam-only users.
- L3: normalize environment keys to uppercase when scrubbing inherited Windows env vars in tests/test_win_steam_shader_env.py, and add mixed Steam/player and warm-Steam-upgrade test cases.

Assisted-by: Antigravity
Author
First-time contributor

Addressed L1, L2, and L3 from review #2884 in f4fea4a8:

  • L1 (per-variable classification): steam_shader_env_classify() in host/steam_shader_env.h and win_steam_driver_env_choose() in host/hos_main.c now classify and unset __GL_SHADER_DISK_CACHE_PATH, _APP_NAME, _READ_ONLY_APP_NAME, and _READ_ONLY_APP_NAME_2 individually so player-configured custom paths or app names are preserved alongside Steam env vars. Added mixed Steam/player test cases.
  • L2 (warm Steam-only cache preservation): Added a bounded Win32 FindFirstFileW check (depth ≤ 4, entries ≤ 4096, stops at 512 MiB matching pcache_load::kWarmMb, separating steamapp_* from non-steamapp_* files) plus steam_shader_env_apply_cache(). When Steam's NVIDIA cache is warm (>= 512 MiB) and the destination GLCache is cold (< 512 MiB), Steam's NVIDIA cache overrides are preserved (while Fossilize is still disabled) and logged. Added sparse-file upgrade test cases covering both Steam's nvidiav1 folder and steamapp_* inside the default GLCache.
  • L3 (case-insensitive Windows test filter): tests/test_win_steam_shader_env.py now normalizes env keys with .upper() against uppercase prefixes and verifies inherited ENABLE_VK_LAYER_VALVE_STEAM_FOSSILIZE_1 / STEAMAPPID are stripped before each test case.

Verified locally (Windows, llvm-mingw clang/clang++):

  • python -I -B tests/test_win_steam_shader_env.py (run with ENABLE_VK_LAYER_VALVE_steam_fossilize_1=1 set in the parent env) — passed
  • python -I -B tests/test_pcache_load.py (all 16 Windows cases) — passed
  • python -I -B tests/test_profiling_mode.py — passed
  • clang -x c -std=c11 -fsyntax-only -Wall -Wextra -Werror on host/steam_shader_env.h — passed

Remaining before merge (L4 & L5):

  • L4: Interleaved A/B startup comparison on 28cb22b9 vs f4fea4a8 covering warm default and warm Steam-only caches.
  • L5: Windows AMD/Intel Steam launch check (will need a tester with AMD/Intel hardware or @Beanstalk).
Addressed **L1**, **L2**, and **L3** from review #2884 in `f4fea4a8`: - **L1 (per-variable classification):** `steam_shader_env_classify()` in `host/steam_shader_env.h` and `win_steam_driver_env_choose()` in `host/hos_main.c` now classify and unset `__GL_SHADER_DISK_CACHE_PATH`, `_APP_NAME`, `_READ_ONLY_APP_NAME`, and `_READ_ONLY_APP_NAME_2` individually so player-configured custom paths or app names are preserved alongside Steam env vars. Added mixed Steam/player test cases. - **L2 (warm Steam-only cache preservation):** Added a bounded Win32 `FindFirstFileW` check (depth ≤ 4, entries ≤ 4096, stops at `512 MiB` matching `pcache_load::kWarmMb`, separating `steamapp_*` from non-`steamapp_*` files) plus `steam_shader_env_apply_cache()`. When Steam's NVIDIA cache is warm (`>= 512 MiB`) and the destination `GLCache` is cold (`< 512 MiB`), Steam's NVIDIA cache overrides are preserved (while Fossilize is still disabled) and logged. Added sparse-file upgrade test cases covering both Steam's `nvidiav1` folder and `steamapp_*` inside the default `GLCache`. - **L3 (case-insensitive Windows test filter):** `tests/test_win_steam_shader_env.py` now normalizes env keys with `.upper()` against uppercase prefixes and verifies inherited `ENABLE_VK_LAYER_VALVE_STEAM_FOSSILIZE_1` / `STEAMAPPID` are stripped before each test case. **Verified locally (Windows, `llvm-mingw` `clang`/`clang++`):** - `python -I -B tests/test_win_steam_shader_env.py` (run with `ENABLE_VK_LAYER_VALVE_steam_fossilize_1=1` set in the parent env) — passed - `python -I -B tests/test_pcache_load.py` (all 16 Windows cases) — passed - `python -I -B tests/test_profiling_mode.py` — passed - `clang -x c -std=c11 -fsyntax-only -Wall -Wextra -Werror` on `host/steam_shader_env.h` — passed **Remaining before merge (L4 & L5):** - **L4:** Interleaved A/B startup comparison on `28cb22b9` vs `f4fea4a8` covering warm default and warm Steam-only caches. - **L5:** Windows AMD/Intel Steam launch check (will need a tester with AMD/Intel hardware or `@Beanstalk`).
Member

@ImpulsiveOrange8114 only members of BigBeans can start the farm.

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

@ImpulsiveOrange8114 only members of `BigBeans` can start the farm. ~~One of them can approve this request by reacting 👍 to it or to this comment.~~ This request was for `f4fea4a`, and the PR has changed since (`399643a`), so a 👍 no longer approves it. Comment `@Beanstalk` again to ask for the new commit.
ImpulsiveOrange8114 changed title from fix(host): drop Steam Fossilize and NVIDIA cache overrides on Windows to WIP: fix(host): drop Steam Fossilize and NVIDIA cache overrides on Windows 2026-11-30 08:42:24 +00:00
ImpulsiveOrange8114 changed title from WIP: fix(host): drop Steam Fossilize and NVIDIA cache overrides on Windows to fix(host): drop Steam Fossilize and NVIDIA cache overrides on Windows 2026-11-30 08:51:30 +00:00
Owner
@review
BeanBot requested changes 2026-12-01 00:33:10 +00:00
Dismissed
BeanBot left a comment

Recommendation: Request changes. The warm-cache safeguard can still discard a player's warm Steam cache when other applications make the default NVIDIA cache appear warm. The startup comparison and AMD/Intel runs also remain outstanding.

The change disables Steam Fossilize and can reuse the prepared NVIDIA cache for faster Windows Steam launches. The follow-up preserves individual player overrides and attempts to retain a warm Steam-only cache, at the cost of a bounded cache-directory scan at startup.

Blocking (1): must change before merging.

  1. L2 host/hos_main.c:1001: The unconditional cache switch discards a previously warm Steam driver cache even when the normal NVIDIA cache is cold. When: A player who prepared and played through Steam before updating can have the pipelines in Steam's cache but none in the default GLCache. This code removes the Steam path and app name, so the next launch uses the cold default and recompiles work that previously hit the warm cache. Do: Preserve or migrate the warm cache when switching locations, or arrange preparation of the destination before relying on it; cover an upgrade from a Steam-only warm cache.

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

  • L4: The reported startup improvement needs a repeatable comparison against the supplied merge base, including both warm and cold caches. When: The table compares different pipeline counts and identifies a different before commit; it gives one run per side and does not measure a user whose existing Steam cache is warm and default cache cold. Do: Run at least two interleaved comparisons per side on the merge base and head, with the same build and cache state, reporting startup time and cache sizes for warm and cold cases.
  • L5: Disabling Fossilize also changes Windows Steam launches on AMD and Intel, which have not been run. When: Those GPUs enter the same Fossilize-disable branch even though the reported in-game result covers only NVIDIA. Do: Test a Steam launch and warm startup on Windows AMD and Intel, recording the outcome and startup time against the base.

@fix can do L2.

Since the last review (on 94099becfe)
Resolved: L1 (Detecting any one Steam cache value removes every NVIDIA cache override, including unrelat…); L3 (The Windows test's environment filter compares mixed-case prefixes against environment key…)
Still open: L2 (The unconditional cache switch discards a previously warm Steam driver cache even when the…); L4 (The reported startup improvement needs a repeatable comparison against the supplied merge…); L5 (Disabling Fossilize also changes Windows Steam launches on AMD and Intel, which have not b…)

Checks: Still running: 10 checks.

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

Does it help: Unproven: the reported Windows NVIDIA run reduced texture-pipeline startup from 1,470 ms to 4 ms and avoided compilation of 38,772 noted pipelines, but it was not a repeated comparison against the supplied merge base and does not cover both cache states.

Other systems: The environment changes apply to Windows Steam launches on AMD and Intel as well as NVIDIA; AMD and Intel runs remain outstanding. The new cache scan affects Windows launches with detected Steam NVIDIA overrides. Linux does not execute that host path.

Switches: No player switch added. On Windows, the change sets DISABLE_VK_LAYER_VALVE_steam_fossilize_1 and removes Steam-classified environment overrides unless the warm-cache safeguard keeps them.

Reviewed: f4fea4a828 against 28cb22b9ed: Read AGENTS.md, CONTRIBUTING.md, the pull request template, the follow-up diff, host/steam_shader_env.h, the changed host code, and the Windows environment test. Skimmed the renderer diff and reported runs. The review checklist and sibling Tooling AGENTS.md were unavailable; the remaining changed files were not read in full.; nothing run (a code review).

Checked and fine:

  • The follow-up preserves unrelated player-selected NVIDIA environment values in its mixed-value cases.
  • The environment test filters inherited Windows keys case-insensitively.

Testing: No code or tests were run. The author reports Windows unit and environment checks passing; CI is still running.

Overlaps and merge order: none found


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

**Recommendation: Request changes.** The warm-cache safeguard can still discard a player's warm Steam cache when other applications make the default NVIDIA cache appear warm. The startup comparison and AMD/Intel runs also remain outstanding. The change disables Steam Fossilize and can reuse the prepared NVIDIA cache for faster Windows Steam launches. The follow-up preserves individual player overrides and attempts to retain a warm Steam-only cache, at the cost of a bounded cache-directory scan at startup. **Blocking (1)**: must change before merging. 1. **L2** `host/hos_main.c:1001`: The unconditional cache switch discards a previously warm Steam driver cache even when the normal NVIDIA cache is cold. *When:* A player who prepared and played through Steam before updating can have the pipelines in Steam's cache but none in the default GLCache. This code removes the Steam path and app name, so the next launch uses the cold default and recompiles work that previously hit the warm cache. **Do:** Preserve or migrate the warm cache when switching locations, or arrange preparation of the destination before relying on it; cover an upgrade from a Steam-only warm cache. **Testing before merging (2)** (runs on the systems it can change; it doesn't hold the recommendation) - **L4**: The reported startup improvement needs a repeatable comparison against the supplied merge base, including both warm and cold caches. *When:* The table compares different pipeline counts and identifies a different before commit; it gives one run per side and does not measure a user whose existing Steam cache is warm and default cache cold. **Do:** Run at least two interleaved comparisons per side on the merge base and head, with the same build and cache state, reporting startup time and cache sizes for warm and cold cases. - **L5**: Disabling Fossilize also changes Windows Steam launches on AMD and Intel, which have not been run. *When:* Those GPUs enter the same Fossilize-disable branch even though the reported in-game result covers only NVIDIA. **Do:** Test a Steam launch and warm startup on Windows AMD and Intel, recording the outcome and startup time against the base. `@fix` can do L2. **Since the last review** (on 94099becfe86) Resolved: L1 (Detecting any one Steam cache value removes every NVIDIA cache override, including unrelat…); L3 (The Windows test's environment filter compares mixed-case prefixes against environment key…) Still open: L2 (The unconditional cache switch discards a previously warm Steam driver cache even when the…); L4 (The reported startup improvement needs a repeatable comparison against the supplied merge…); L5 (Disabling Fossilize also changes Windows Steam launches on AMD and Intel, which have not b…) **Checks:** Still running: 10 checks. <details> <summary>More: does it help, other systems, switches, what was read</summary> **Does it help:** Unproven: the reported Windows NVIDIA run reduced texture-pipeline startup from 1,470 ms to 4 ms and avoided compilation of 38,772 noted pipelines, but it was not a repeated comparison against the supplied merge base and does not cover both cache states. **Other systems:** The environment changes apply to Windows Steam launches on AMD and Intel as well as NVIDIA; AMD and Intel runs remain outstanding. The new cache scan affects Windows launches with detected Steam NVIDIA overrides. Linux does not execute that host path. **Switches:** No player switch added. On Windows, the change sets DISABLE_VK_LAYER_VALVE_steam_fossilize_1 and removes Steam-classified environment overrides unless the warm-cache safeguard keeps them. **Reviewed:** f4fea4a8288c against 28cb22b9ed23: Read AGENTS.md, CONTRIBUTING.md, the pull request template, the follow-up diff, host/steam_shader_env.h, the changed host code, and the Windows environment test. Skimmed the renderer diff and reported runs. The review checklist and sibling Tooling AGENTS.md were unavailable; the remaining changed files were not read in full.; nothing run (a code review). **Checked and fine:** - The follow-up preserves unrelated player-selected NVIDIA environment values in its mixed-value cases. - The environment test filters inherited Windows keys case-insensitively. **Testing:** No code or tests were run. The author reports Windows unit and environment checks passing; CI is still running. **Overlaps and merge order:** none found </details> --- <sub>Automated code review by BeanBot (gpt-6.1-terra), asked for by HumanBean. Nothing was run; a maintainer decides.</sub>
Owner
@fix
Member

I didn't fix this pull request: its branch fix/win-steam-shader-cache is protected (or gone).


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

I didn't fix this pull request: its branch `fix/win-steam-shader-cache` is protected (or gone). --- <sub>Automated fix by BeanBot (gpt-6.1-terra), asked for by HumanBean. Nothing was run; a maintainer decides.</sub>
Author
First-time contributor

Fixed the remaining L2 edge case in 399643ae (BeanBot couldn't push to the fork branch directly):

  • gpu/vk/vk_draw.cpp (driver_env_note, called on Windows from precompile_warm, precompile_run, predict_run, and precompile_at_create) now atomically writes longshot_nv_cache_warm.txt in Longshot's shader cache folder whenever Longshot warms a non-Steam NVIDIA GLCache.
  • host/hos_main.c (win_nv_cache_noted) + host/steam_shader_env.h (steam_shader_env_apply_cache) now require both longshot_nv_cache_warm.txt matching the destination GLCache and >= 512 MiB of non-steamapp_* files there before dropping a warm (>= 512 MiB) Steam NVIDIA cache — so unrelated applications' files in %LOCALAPPDATA%\NVIDIA\GLCache can no longer trigger a switch away from a warm Steam cache, and a stale marker after the user clears the default cache still preserves a warm Steam cache.
  • Added regression cases in tests/test_win_steam_shader_env.py covering other apps' files in default GLCache, a matching Longshot marker, and an emptied default cache with a stale marker. Verified locally with test_win_steam_shader_env.py, test_profiling_mode.py, and C11 -Wall -Wextra -Werror syntax checks.
Fixed the remaining **L2** edge case in `399643ae` (BeanBot couldn't push to the fork branch directly): - `gpu/vk/vk_draw.cpp` (`driver_env_note`, called on Windows from `precompile_warm`, `precompile_run`, `predict_run`, and `precompile_at_create`) now atomically writes `longshot_nv_cache_warm.txt` in Longshot's shader cache folder whenever Longshot warms a non-Steam NVIDIA `GLCache`. - `host/hos_main.c` (`win_nv_cache_noted`) + `host/steam_shader_env.h` (`steam_shader_env_apply_cache`) now require **both** `longshot_nv_cache_warm.txt` matching the destination `GLCache` **and** `>= 512 MiB` of non-`steamapp_*` files there before dropping a warm (`>= 512 MiB`) Steam NVIDIA cache — so unrelated applications' files in `%LOCALAPPDATA%\NVIDIA\GLCache` can no longer trigger a switch away from a warm Steam cache, and a stale marker after the user clears the default cache still preserves a warm Steam cache. - Added regression cases in `tests/test_win_steam_shader_env.py` covering other apps' files in default `GLCache`, a matching Longshot marker, and an emptied default cache with a stale marker. Verified locally with `test_win_steam_shader_env.py`, `test_profiling_mode.py`, and C11 `-Wall -Wextra -Werror` syntax checks.
fix(host): require Longshot-owned warm-cache marker before replacing warm Steam GLCache (L2)
Some checks failed
beanstalk/approval changed since the request: ask again
PR description / Title and description (pull_request_target) Successful in 6s
CI / What the change needs (pull_request) Has been cancelled
CI / Lint (pre-commit, ShellCheck, actionlint) (pull_request) Has been cancelled
CI / Third-party parts and guide screenshots (pull_request) Has been cancelled
CI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request) Has been cancelled
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Has been cancelled
CI / Renderer build check (Windows, compile --only renderer, without and with FSR 4) (pull_request) Has been cancelled
CI / Renderer build check (Linux, compile --only renderer, without and with FSR 4) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 1/2) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 2/2) (pull_request) Has been cancelled
CI / Website build and checks (pull_request) Has been cancelled
399643ae8f
Unrelated applications share %LOCALAPPDATA%\NVIDIA\GLCache and can make it exceed 512 MiB even when Longshot only ever warmed Steam's per-AppID cache.

Record the destination GLCache path in longshot_nv_cache_warm.txt from gpu/vk/vk_draw.cpp driver_env_note() on Windows NVIDIA non-Steam starts/preparations, and require both that marker matching the destination GLCache and >= 512 MiB of non-steamapp files there before dropping a warm (>= 512 MiB) Steam NVIDIA cache.

Added regression tests covering other apps' files in default GLCache, valid Longshot markers, and cleared default caches with stale markers.

Assisted-by: Antigravity
Author
First-time contributor

I have also updated my profile visibility so BeanBot can make any further changes if necessary

I have also updated my profile visibility so BeanBot can make any further changes if necessary
Owner
@review
BeanBot requested changes 2026-12-01 15:22:50 +00:00
Dismissed
BeanBot left a comment

Recommendation: Request changes. The cache marker can be written without establishing that Longshot’s destination driver cache is warm, so unrelated applications’ files can still cause a warm Steam cache to be discarded. The repeated startup comparison and Windows AMD/Intel runs also remain outstanding.

The change disables Steam Fossilize on Windows and tries to reuse a prepared NVIDIA cache while preserving a warm Steam-only cache. It adds cache detection and marker bookkeeping, but the marker does not yet establish the warmth it represents.

Blocking (1): must change before merging.

  1. L2 host/hos_main.c:1001: The unconditional cache switch discards a previously warm Steam driver cache even when the normal NVIDIA cache is cold. When: A player who prepared and played through Steam before updating can have the pipelines in Steam's cache but none in the default GLCache. This code removes the Steam path and app name, so the next launch uses the cold default and recompiles work that previously hit the warm cache. Do: Preserve or migrate the warm cache when switching locations, or arrange preparation of the destination before relying on it; cover an upgrade from a Steam-only warm cache.

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

  • L4: The reported startup improvement needs a repeatable comparison against the supplied merge base, including both warm and cold caches. When: The table compares different pipeline counts and identifies a different before commit; it gives one run per side and does not measure a user whose existing Steam cache is warm and default cache cold. Do: Run at least two interleaved comparisons per side on the merge base and head, with the same build and cache state, reporting startup time and cache sizes for warm and cold cases.
  • L5: Disabling Fossilize also changes Windows Steam launches on AMD and Intel, which have not been run. When: Those GPUs enter the same Fossilize-disable branch even though the reported in-game result covers only NVIDIA. Do: Test a Steam launch and warm startup on Windows AMD and Intel, recording the outcome and startup time against the base.

@fix can do L2.

Since the last review (on f4fea4a828)
Still open: L2 (The unconditional cache switch discards a previously warm Steam driver cache even when the…); L4 (The reported startup improvement needs a repeatable comparison against the supplied merge…); L5 (Disabling Fossilize also changes Windows Steam launches on AMD and Intel, which have not b…)

Checks: Still running: 10 checks.

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

Does it help: Unproven: the reported RTX 3060 Ti run reduced texture-pipeline startup from 1,470 ms to 4 ms and noted-pipeline work from an interrupted 403.4 seconds to 36 ms, but repeated comparisons against the supplied merge base for both cache states are missing.

Other systems: Windows AMD and Intel Steam launches also lose Fossilize and have not been reported. Linux does not take the Windows environment path; the new Windows marker is also written by several renderer precompile paths.

Switches: No switches added, changed, or removed.

Reviewed: 399643ae8f against 28cb22b9ed: Read AGENTS.md, CONTRIBUTING.md, host/steam_shader_env.h and gpu/vk/vk_paths.h in full; inspected the fix diff, marker writer and reader, and their relevant callers. Other changed files, the full base diff, repository checklist and template were not read in full.; nothing run (a code review).

Checked and fine:

  • A warm Steam cache is preserved when no matching destination marker exists, even if unrelated default-cache files exceed the threshold.
  • Fossilize is still disabled when a warm Steam NVIDIA cache is preserved.

Testing: Author reports Windows game-free checks and one NVIDIA in-game run; no commands or tests were run in this review. CI is still running.

Overlaps and merge order: Not checked; network access is closed.


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

**Recommendation: Request changes.** The cache marker can be written without establishing that Longshot’s destination driver cache is warm, so unrelated applications’ files can still cause a warm Steam cache to be discarded. The repeated startup comparison and Windows AMD/Intel runs also remain outstanding. The change disables Steam Fossilize on Windows and tries to reuse a prepared NVIDIA cache while preserving a warm Steam-only cache. It adds cache detection and marker bookkeeping, but the marker does not yet establish the warmth it represents. **Blocking (1)**: must change before merging. 1. **L2** `host/hos_main.c:1001`: The unconditional cache switch discards a previously warm Steam driver cache even when the normal NVIDIA cache is cold. *When:* A player who prepared and played through Steam before updating can have the pipelines in Steam's cache but none in the default GLCache. This code removes the Steam path and app name, so the next launch uses the cold default and recompiles work that previously hit the warm cache. **Do:** Preserve or migrate the warm cache when switching locations, or arrange preparation of the destination before relying on it; cover an upgrade from a Steam-only warm cache. **Testing before merging (2)** (runs on the systems it can change; it doesn't hold the recommendation) - **L4**: The reported startup improvement needs a repeatable comparison against the supplied merge base, including both warm and cold caches. *When:* The table compares different pipeline counts and identifies a different before commit; it gives one run per side and does not measure a user whose existing Steam cache is warm and default cache cold. **Do:** Run at least two interleaved comparisons per side on the merge base and head, with the same build and cache state, reporting startup time and cache sizes for warm and cold cases. - **L5**: Disabling Fossilize also changes Windows Steam launches on AMD and Intel, which have not been run. *When:* Those GPUs enter the same Fossilize-disable branch even though the reported in-game result covers only NVIDIA. **Do:** Test a Steam launch and warm startup on Windows AMD and Intel, recording the outcome and startup time against the base. `@fix` can do L2. **Since the last review** (on f4fea4a8288c) Still open: L2 (The unconditional cache switch discards a previously warm Steam driver cache even when the…); L4 (The reported startup improvement needs a repeatable comparison against the supplied merge…); L5 (Disabling Fossilize also changes Windows Steam launches on AMD and Intel, which have not b…) **Checks:** Still running: 10 checks. <details> <summary>More: does it help, other systems, switches, what was read</summary> **Does it help:** Unproven: the reported RTX 3060 Ti run reduced texture-pipeline startup from 1,470 ms to 4 ms and noted-pipeline work from an interrupted 403.4 seconds to 36 ms, but repeated comparisons against the supplied merge base for both cache states are missing. **Other systems:** Windows AMD and Intel Steam launches also lose Fossilize and have not been reported. Linux does not take the Windows environment path; the new Windows marker is also written by several renderer precompile paths. **Switches:** No switches added, changed, or removed. **Reviewed:** 399643ae8f1a against 28cb22b9ed23: Read AGENTS.md, CONTRIBUTING.md, host/steam_shader_env.h and gpu/vk/vk_paths.h in full; inspected the fix diff, marker writer and reader, and their relevant callers. Other changed files, the full base diff, repository checklist and template were not read in full.; nothing run (a code review). **Checked and fine:** - A warm Steam cache is preserved when no matching destination marker exists, even if unrelated default-cache files exceed the threshold. - Fossilize is still disabled when a warm Steam NVIDIA cache is preserved. **Testing:** Author reports Windows game-free checks and one NVIDIA in-game run; no commands or tests were run in this review. CI is still running. **Overlaps and merge order:** Not checked; network access is closed. </details> --- <sub>Automated code review by BeanBot (gpt-6.1-terra), asked for by HumanBean. Nothing was run; a maintainer decides.</sub>
fix(vk): gate Windows warm-cache marker on positive driver-only pipeline probe (L2)
Some checks failed
beanstalk/approval changed since the request: ask again
PR description / Title and description (pull_request_target) Successful in 6s
CI / What the change needs (pull_request) Has been cancelled
CI / Lint (pre-commit, ShellCheck, actionlint) (pull_request) Has been cancelled
CI / Third-party parts and guide screenshots (pull_request) Has been cancelled
CI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request) Has been cancelled
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Has been cancelled
CI / Renderer build check (Windows, compile --only renderer, without and with FSR 4) (pull_request) Has been cancelled
CI / Renderer build check (Linux, compile --only renderer, without and with FSR 4) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 1/2) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 2/2) (pull_request) Has been cancelled
CI / Website build and checks (pull_request) Has been cancelled
a9754d97ec
Replace the Windows driver_env_note() arm with a dedicated win_nv_cache_warm_note() helper that only writes longshot_nv_cache_warm.txt after a driver-only scratch-cache probe (notes_lost_by_driver / last_driver_probe_warm: >= kSample/3 pipelines probed and >= 75% hit without compiling) positively confirms Longshot's noted pipelines reside in the destination non-Steam NVIDIA GLCache.

- Never written from predict_run(), empty note lists, Compile shaders: Off, interrupted runs, or when NVIDIA's driver cache fails the probe.
- Also require LONGSHOT_SHADER_CACHE to be an absolute path in host/hos_main.c win_nv_cache_noted(), matching gpu/vk/vk_paths.h.
- Guard last_driver_probe_warm under #ifdef _WIN32 so Linux builds stay warning-free.

Assisted-by: Antigravity
Author
First-time contributor

Closed the marker-writer loophole on L2 in a9754d97:

  • Replaced the Windows arm of driver_env_note() with a dedicated #ifdef _WIN32 win_nv_cache_warm_note() helper in gpu/vk/vk_draw.cpp.
  • longshot_nv_cache_warm.txt is now written only after a driver-only scratch-cache probe (notes_lost_by_driver() / last_driver_probe_warm, using VK_PIPELINE_CREATE_FAIL_ON_PIPELINE_COMPILE_REQUIRED_BIT) positively confirms that at least kSample / 3 (16) sampled Longshot noted pipelines were probed and >= 75% hit directly in the non-Steam NVIDIA driver cache without compiling.
  • Removed writing the marker from predict_run(), empty note lists, Compile shaders: Off, interrupted runs, or runs where the driver cache probe does not positively confirm warmth.
  • Also added win_is_abs_wpath() in host/hos_main.c win_nv_cache_noted() so LONGSHOT_SHADER_CACHE is only honored when absolute (matching gpu/vk/vk_paths.h), and verified test_win_steam_shader_env.py, test_cold_cache_check.py, test_driver_cache_env.py, test_profiling_mode.py, and test_note_refs_once.py.
Closed the marker-writer loophole on **L2** in `a9754d97`: - Replaced the Windows arm of `driver_env_note()` with a dedicated `#ifdef _WIN32` `win_nv_cache_warm_note()` helper in `gpu/vk/vk_draw.cpp`. - `longshot_nv_cache_warm.txt` is now written **only** after a driver-only scratch-cache probe (`notes_lost_by_driver()` / `last_driver_probe_warm`, using `VK_PIPELINE_CREATE_FAIL_ON_PIPELINE_COMPILE_REQUIRED_BIT`) positively confirms that at least `kSample / 3` (16) sampled Longshot noted pipelines were probed and `>= 75%` hit directly in the non-Steam NVIDIA driver cache without compiling. - Removed writing the marker from `predict_run()`, empty note lists, `Compile shaders: Off`, interrupted runs, or runs where the driver cache probe does not positively confirm warmth. - Also added `win_is_abs_wpath()` in `host/hos_main.c` `win_nv_cache_noted()` so `LONGSHOT_SHADER_CACHE` is only honored when absolute (matching `gpu/vk/vk_paths.h`), and verified `test_win_steam_shader_env.py`, `test_cold_cache_check.py`, `test_driver_cache_env.py`, `test_profiling_mode.py`, and `test_note_refs_once.py`.
ImpulsiveOrange8114 force-pushed fix/win-steam-shader-cache from a9754d97ec
Some checks failed
beanstalk/approval changed since the request: ask again
PR description / Title and description (pull_request_target) Successful in 6s
CI / What the change needs (pull_request) Has been cancelled
CI / Lint (pre-commit, ShellCheck, actionlint) (pull_request) Has been cancelled
CI / Third-party parts and guide screenshots (pull_request) Has been cancelled
CI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request) Has been cancelled
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Has been cancelled
CI / Renderer build check (Windows, compile --only renderer, without and with FSR 4) (pull_request) Has been cancelled
CI / Renderer build check (Linux, compile --only renderer, without and with FSR 4) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 1/2) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 2/2) (pull_request) Has been cancelled
CI / Website build and checks (pull_request) Has been cancelled
to 9a871d69cb
Some checks failed
beanstalk/approval changed since the request: ask again
PR description / Title and description (pull_request_target) Successful in 6s
CI / What the change needs (pull_request) Has been cancelled
CI / Lint (pre-commit, ShellCheck, actionlint) (pull_request) Has been cancelled
CI / Third-party parts and guide screenshots (pull_request) Has been cancelled
CI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request) Has been cancelled
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Has been cancelled
CI / Renderer build check (Windows, compile --only renderer, without and with FSR 4) (pull_request) Has been cancelled
CI / Renderer build check (Linux, compile --only renderer, without and with FSR 4) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 1/2) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 2/2) (pull_request) Has been cancelled
CI / Website build and checks (pull_request) Has been cancelled
2026-12-02 03:46:35 +00:00
Compare
Owner
@review
BeanBot requested changes 2026-12-02 17:41:59 +00:00
Dismissed
BeanBot left a comment

Recommendation: Request changes. A stale marker can still cause Longshot to discard a warm Steam cache after its own destination cache files have been cleared. The startup gain also needs repeated comparisons, and the Windows AMD and Intel paths remain untested.

The change disables Steam Fossilize and selectively removes Steam’s NVIDIA cache overrides on Windows to reuse a prepared driver cache. It adds a probe and marker to protect existing warm Steam caches, but the marker can outlive the cache it describes.

Blocking (1): must change before merging.

  1. L2 host/hos_main.c:1001: The unconditional cache switch discards a previously warm Steam driver cache even when the normal NVIDIA cache is cold. When: A player who prepared and played through Steam before updating can have the pipelines in Steam's cache but none in the default GLCache. This code removes the Steam path and app name, so the next launch uses the cold default and recompiles work that previously hit the warm cache. Do: Preserve or migrate the warm cache when switching locations, or arrange preparation of the destination before relying on it; cover an upgrade from a Steam-only warm cache.

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

  • L4: The reported startup improvement needs a repeatable comparison against the supplied merge base, including both warm and cold caches. When: The table compares different pipeline counts and identifies a different before commit; it gives one run per side and does not measure a user whose existing Steam cache is warm and default cache cold. Do: Run at least two interleaved comparisons per side on the merge base and head, with the same build and cache state, reporting startup time and cache sizes for warm and cold cases.
  • L5: Disabling Fossilize also changes Windows Steam launches on AMD and Intel, which have not been run. When: Those GPUs enter the same Fossilize-disable branch even though the reported in-game result covers only NVIDIA. Do: Test a Steam launch and warm startup on Windows AMD and Intel, recording the outcome and startup time against the base.

@fix can do L2.

Since the last review (on 399643ae8f)
Still open: L2 (The unconditional cache switch discards a previously warm Steam driver cache even when the…); L4 (The reported startup improvement needs a repeatable comparison against the supplied merge…); L5 (Disabling Fossilize also changes Windows Steam launches on AMD and Intel, which have not b…)

Checks: Still running: 10 checks.

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

Does it help: Unproven by the requested comparison. The reported NVIDIA run reduced texture-pipeline startup from 1,470 ms to 4 ms and found 38,772 pipelines in 36 ms, versus an aborted baseline at 18,735 of 42,193 after 403.4 seconds. Repeated interleaved runs against the supplied merge base for both warm and cold cache states are still missing.

Other systems: The environment changes affect Windows Steam launches on NVIDIA, AMD and Intel; AMD and Intel runs have not been reported. Linux does not take the Windows environment path. The new marker depends on the NVIDIA driver-only pipeline probe and on the cache files remaining present afterwards.

Switches: No player switch added or changed. On Windows, Steam’s Fossilize enable variable is cleared and its disable variable is set to 1; Steam-classified NVIDIA cache variables are conditionally cleared or retained.

Reviewed: 9a871d69cb against 56823e27a1: Read the repository rules, pull request template, changed host helper and cache-selection code, the marker and probe changes, and their surrounding callers. Skimmed the test changes and recorded runs. The large renderer and host files were read around the affected paths, not in full; the full review checklist and developer standards were not read.; nothing run (a code review).

Checked and fine:

  • The new marker writer requires a positive driver-only probe before recording a destination.
  • The host ignores a relative LONGSHOT_SHADER_CACHE when locating the marker.

Testing: No commands from the project were run. The author reports a Windows NVIDIA game run and game-free checks; CI is still running.

Overlaps and merge order: Not checked; the network is closed.


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

**Recommendation: Request changes.** A stale marker can still cause Longshot to discard a warm Steam cache after its own destination cache files have been cleared. The startup gain also needs repeated comparisons, and the Windows AMD and Intel paths remain untested. The change disables Steam Fossilize and selectively removes Steam’s NVIDIA cache overrides on Windows to reuse a prepared driver cache. It adds a probe and marker to protect existing warm Steam caches, but the marker can outlive the cache it describes. **Blocking (1)**: must change before merging. 1. **L2** `host/hos_main.c:1001`: The unconditional cache switch discards a previously warm Steam driver cache even when the normal NVIDIA cache is cold. *When:* A player who prepared and played through Steam before updating can have the pipelines in Steam's cache but none in the default GLCache. This code removes the Steam path and app name, so the next launch uses the cold default and recompiles work that previously hit the warm cache. **Do:** Preserve or migrate the warm cache when switching locations, or arrange preparation of the destination before relying on it; cover an upgrade from a Steam-only warm cache. **Testing before merging (2)** (runs on the systems it can change; it doesn't hold the recommendation) - **L4**: The reported startup improvement needs a repeatable comparison against the supplied merge base, including both warm and cold caches. *When:* The table compares different pipeline counts and identifies a different before commit; it gives one run per side and does not measure a user whose existing Steam cache is warm and default cache cold. **Do:** Run at least two interleaved comparisons per side on the merge base and head, with the same build and cache state, reporting startup time and cache sizes for warm and cold cases. - **L5**: Disabling Fossilize also changes Windows Steam launches on AMD and Intel, which have not been run. *When:* Those GPUs enter the same Fossilize-disable branch even though the reported in-game result covers only NVIDIA. **Do:** Test a Steam launch and warm startup on Windows AMD and Intel, recording the outcome and startup time against the base. `@fix` can do L2. **Since the last review** (on 399643ae8f1a) Still open: L2 (The unconditional cache switch discards a previously warm Steam driver cache even when the…); L4 (The reported startup improvement needs a repeatable comparison against the supplied merge…); L5 (Disabling Fossilize also changes Windows Steam launches on AMD and Intel, which have not b…) **Checks:** Still running: 10 checks. <details> <summary>More: does it help, other systems, switches, what was read</summary> **Does it help:** Unproven by the requested comparison. The reported NVIDIA run reduced texture-pipeline startup from 1,470 ms to 4 ms and found 38,772 pipelines in 36 ms, versus an aborted baseline at 18,735 of 42,193 after 403.4 seconds. Repeated interleaved runs against the supplied merge base for both warm and cold cache states are still missing. **Other systems:** The environment changes affect Windows Steam launches on NVIDIA, AMD and Intel; AMD and Intel runs have not been reported. Linux does not take the Windows environment path. The new marker depends on the NVIDIA driver-only pipeline probe and on the cache files remaining present afterwards. **Switches:** No player switch added or changed. On Windows, Steam’s Fossilize enable variable is cleared and its disable variable is set to 1; Steam-classified NVIDIA cache variables are conditionally cleared or retained. **Reviewed:** 9a871d69cb6f against 56823e27a13a: Read the repository rules, pull request template, changed host helper and cache-selection code, the marker and probe changes, and their surrounding callers. Skimmed the test changes and recorded runs. The large renderer and host files were read around the affected paths, not in full; the full review checklist and developer standards were not read.; nothing run (a code review). **Checked and fine:** - The new marker writer requires a positive driver-only probe before recording a destination. - The host ignores a relative LONGSHOT_SHADER_CACHE when locating the marker. **Testing:** No commands from the project were run. The author reports a Windows NVIDIA game run and game-free checks; CI is still running. **Overlaps and merge order:** Not checked; the network is closed. </details> --- <sub>Automated code review by BeanBot (gpt-6.1-terra), asked for by HumanBean. Nothing was run; a maintainer decides.</sub>
Author
First-time contributor

Rebased onto latest main (9a926c2e, resolving the host/hos_main.c conflict from #2822) and simplified L2 in 7dcdb568 by removing the pre-Vulkan GLCache directory walk, longshot_nv_cache_warm.txt marker, and Windows scratch-probe feedback loop (keeping L1 per-variable Steam env classification, L3 uppercase test env scrubbing, Fossilize disable, and Windows __GL_SHADER_DISK_CACHE_PATH cache measurement).

Why: As BeanBot's latest review (#3093) itself showed, any pre-Vulkan heuristic or sidecar marker over NVIDIA's shared, driver-managed %LOCALAPPDATA%\NVIDIA\GLCache can outlive the cache after a driver update or eviction by other apps, and Steam's steamapp_* cache files cannot be migrated because NVIDIA's GLCache format is proprietary. Dropping Steam's conflicting override unconditionally before Vulkan loads matches how Linux's driver_env_choose() handles RADV_FORCE_VRS_CONFIG_FILE and ensures Steam launches consistently reuse LongshotLauncher's prepared GLCache rather than staying split.

Verified locally (Windows, llvm-mingw clang/clang++):

  • python -I -B tests/test_win_steam_shader_env.py — passed
  • python -I -B tests/test_pcache_load.py (all 16 Windows cases) — passed
  • python -I -B tests/test_profiling_mode.py — passed
  • clang -x c-header -std=c11 -fsyntax-only -Wall -Wextra -Werror host/steam_shader_env.h — passed

@HumanBean @llun — could a maintainer weigh in on whether this simpler Linux-style approach is preferred over trying to guess pre-Vulkan GLCache ownership?

Rebased onto latest `main` (`9a926c2e`, resolving the `host/hos_main.c` conflict from `#2822`) and simplified **L2** in `7dcdb568` by removing the pre-Vulkan `GLCache` directory walk, `longshot_nv_cache_warm.txt` marker, and Windows scratch-probe feedback loop (keeping L1 per-variable Steam env classification, L3 uppercase test env scrubbing, Fossilize disable, and Windows `__GL_SHADER_DISK_CACHE_PATH` cache measurement). **Why:** As BeanBot's latest review (#3093) itself showed, any pre-Vulkan heuristic or sidecar marker over NVIDIA's shared, driver-managed `%LOCALAPPDATA%\NVIDIA\GLCache` can outlive the cache after a driver update or eviction by other apps, and Steam's `steamapp_*` cache files cannot be migrated because NVIDIA's GLCache format is proprietary. Dropping Steam's conflicting override unconditionally before Vulkan loads matches how Linux's `driver_env_choose()` handles `RADV_FORCE_VRS_CONFIG_FILE` and ensures Steam launches consistently reuse `LongshotLauncher`'s prepared GLCache rather than staying split. **Verified locally (Windows, `llvm-mingw` `clang`/`clang++`):** - `python -I -B tests/test_win_steam_shader_env.py` — passed - `python -I -B tests/test_pcache_load.py` (all 16 Windows cases) — passed - `python -I -B tests/test_profiling_mode.py` — passed - `clang -x c-header -std=c11 -fsyntax-only -Wall -Wextra -Werror host/steam_shader_env.h` — passed @HumanBean @llun — could a maintainer weigh in on whether this simpler Linux-style approach is preferred over trying to guess pre-Vulkan `GLCache` ownership?
refactor(host): remove fragile pre-Vulkan warm-cache heuristic for Windows Steam overrides
Some checks failed
beanstalk/approval changed since the request: ask again
PR description / Title and description (pull_request_target) Has been cancelled
CI / What the change needs (pull_request) Has been cancelled
CI / Lint (pre-commit, ShellCheck, actionlint) (pull_request) Has been cancelled
CI / Third-party parts and guide screenshots (pull_request) Has been cancelled
CI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request) Has been cancelled
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Has been cancelled
CI / Renderer build check (Windows, compile --only renderer, without and with FSR 4) (pull_request) Has been cancelled
CI / Renderer build check (Linux, compile --only renderer, without and with FSR 4) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 1/2) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 2/2) (pull_request) Has been cancelled
CI / Website build and checks (pull_request) Has been cancelled
ec8db3c446
Drop the startup GLCache directory walk, longshot_nv_cache_warm.txt marker, and Windows Vulkan scratch-probe feedback loop added for L2.

Before Vulkan loads, no filesystem size check or sidecar marker can guarantee that NVIDIA's shared, driver-managed %LOCALAPPDATA%\NVIDIA\GLCache still holds valid pipelines for this build and driver (driver updates or eviction by other apps outlive any marker, and Steam-only caches cannot be migrated because NVIDIA's GLCache format is proprietary).

Keep the clean per-variable Steam env classification (L1) and uppercase Windows test env scrubbing (L3), matching Linux's driver_env_choose() approach of dropping Steam's conflicting override directly before Vulkan loads.

Assisted-by: Antigravity
ImpulsiveOrange8114 force-pushed fix/win-steam-shader-cache from ec8db3c446
Some checks failed
beanstalk/approval changed since the request: ask again
PR description / Title and description (pull_request_target) Has been cancelled
CI / What the change needs (pull_request) Has been cancelled
CI / Lint (pre-commit, ShellCheck, actionlint) (pull_request) Has been cancelled
CI / Third-party parts and guide screenshots (pull_request) Has been cancelled
CI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request) Has been cancelled
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Has been cancelled
CI / Renderer build check (Windows, compile --only renderer, without and with FSR 4) (pull_request) Has been cancelled
CI / Renderer build check (Linux, compile --only renderer, without and with FSR 4) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 1/2) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 2/2) (pull_request) Has been cancelled
CI / Website build and checks (pull_request) Has been cancelled
to 7dcdb56885
Some checks are pending
beanstalk/approval changed since the request: ask again
CI / Game-free checks (run_all.py, part 2/2) (pull_request) Blocked by required conditions
CI / Website build and checks (pull_request) Blocked by required conditions
CI / What the change needs (pull_request) Blocked by required conditions
CI / Lint (pre-commit, ShellCheck, actionlint) (pull_request) Blocked by required conditions
CI / Third-party parts and guide screenshots (pull_request) Blocked by required conditions
CI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request) Blocked by required conditions
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Blocked by required conditions
CI / Renderer build check (Windows, compile --only renderer, without and with FSR 4) (pull_request) Blocked by required conditions
CI / Renderer build check (Linux, compile --only renderer, without and with FSR 4) (pull_request) Blocked by required conditions
CI / Game-free checks (run_all.py, part 1/2) (pull_request) Blocked by required conditions
PR description / Title and description (pull_request_target) Successful in 5s
2026-12-03 07:20:46 +00:00
Compare
Author
First-time contributor
@review
Owner
@review
BeanBot left a comment

Recommendation: Request changes. The change drops a warm Steam NVIDIA cache even when the destination cache is cold, potentially forcing an existing Steam player through a long shader recompilation. The reported improvement also needs repeated comparisons, and Windows AMD and Intel launches remain untested.

Windows Steam launches disable Fossilize and remove NVIDIA cache overrides classified as Steam-owned, allowing a prepared default cache to be reused. This simplifies the earlier cache-preservation design but can sacrifice an already-warm Steam cache.

Blocking (1): must change before merging.

  1. L2 host/hos_main.c:1001: The Steam NVIDIA cache overrides are removed without preserving an already-warm Steam cache when the destination is cold. When: A player who has only launched through Steam has a warm Steam driver cache but a cold default GLCache. The classified Steam path and app names are cleared before Vulkan loads, so the driver uses the cold destination and recompiles the pipelines. Do: Preserve access to the warm Steam cache when switching would leave the player with a cold destination, without relying on a stale ownership marker.

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

  • L4: The reported startup improvement needs a repeatable comparison against the supplied merge base, including both warm and cold caches. When: The table compares different pipeline counts and identifies a different before commit; it gives one run per side and does not measure a user whose existing Steam cache is warm and default cache cold. Do: Run at least two interleaved comparisons per side on the merge base and head, with the same build and cache state, reporting startup time and cache sizes for warm and cold cases.
  • L5: Disabling Fossilize also changes Windows Steam launches on AMD and Intel, which have not been run. When: Those GPUs enter the same Fossilize-disable branch even though the reported in-game result covers only NVIDIA. Do: Test a Steam launch and warm startup on Windows AMD and Intel, recording the outcome and startup time against the base.

@fix can do L2.

Since the last review (on 9a871d69cb)
Still open: L2 (The Steam NVIDIA cache overrides are removed without preserving an already-warm Steam cach…); L4 (The reported startup improvement needs a repeatable comparison against the supplied merge…); L5 (Disabling Fossilize also changes Windows Steam launches on AMD and Intel, which have not b…)

Checks: Still running: 10 checks.

Also noticed (1; not asked for, not blocking)
  • The PR description says players immediately reuse a prepared default cache, but a Steam-only player may not have one.
More: does it help, other systems, switches, what was read

Does it help: Unproven as a repeatable gain. The PR reports one Windows RTX 3060 Ti comparison: texture pipeline startup fell from 1,470 ms to 4 ms, and 38,772 noted pipelines were found in 36 ms after the change; the before run was stopped at 18,735 of 42,193 after 403.4 seconds. The comparison used different commits and pipeline counts, and repeated interleaved runs against the supplied merge base are missing.

Other systems: The environment changes apply to Windows Steam launches on NVIDIA, AMD and Intel; AMD and Intel hardware runs have not been reported. Linux does not call the Windows helper. Windows cache measurement also follows a retained NVIDIA path override.

Switches: On Windows, the change sets DISABLE_VK_LAYER_VALVE_steam_fossilize_1=1 and clears the corresponding enable variable when active; it also clears NVIDIA cache path and app-name variables classified as Steam-owned. There is no new player switch. Unconditional removal of a warm Steam cache override is not a safe default for a cold destination cache.

Reviewed: 7dcdb56885 against 9a926c2e93: Read the pull request diff, commit log, repository rules, template, Steam environment helper and its tests; inspected the host and renderer call sites and prior cache-preservation implementation. The large renderer and host files were skimmed around relevant changes rather than read in full.; nothing run (a code review).

Checked and fine:

  • The Windows helper runs after profiling environment setup and before Vulkan initialization.
  • The helper classifies NVIDIA variables individually, preserving custom values that do not match its Steam patterns.
  • The test environment scrub handles uppercase Windows environment keys.

Testing: No commands from the project were run. The author reports Windows game and game-free checks; CI checks are still running.

Overlaps and merge order: none found


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

**Recommendation: Request changes.** The change drops a warm Steam NVIDIA cache even when the destination cache is cold, potentially forcing an existing Steam player through a long shader recompilation. The reported improvement also needs repeated comparisons, and Windows AMD and Intel launches remain untested. Windows Steam launches disable Fossilize and remove NVIDIA cache overrides classified as Steam-owned, allowing a prepared default cache to be reused. This simplifies the earlier cache-preservation design but can sacrifice an already-warm Steam cache. **Blocking (1)**: must change before merging. 1. **L2** `host/hos_main.c:1001`: The Steam NVIDIA cache overrides are removed without preserving an already-warm Steam cache when the destination is cold. *When:* A player who has only launched through Steam has a warm Steam driver cache but a cold default GLCache. The classified Steam path and app names are cleared before Vulkan loads, so the driver uses the cold destination and recompiles the pipelines. **Do:** Preserve access to the warm Steam cache when switching would leave the player with a cold destination, without relying on a stale ownership marker. **Testing before merging (2)** (runs on the systems it can change; it doesn't hold the recommendation) - **L4**: The reported startup improvement needs a repeatable comparison against the supplied merge base, including both warm and cold caches. *When:* The table compares different pipeline counts and identifies a different before commit; it gives one run per side and does not measure a user whose existing Steam cache is warm and default cache cold. **Do:** Run at least two interleaved comparisons per side on the merge base and head, with the same build and cache state, reporting startup time and cache sizes for warm and cold cases. - **L5**: Disabling Fossilize also changes Windows Steam launches on AMD and Intel, which have not been run. *When:* Those GPUs enter the same Fossilize-disable branch even though the reported in-game result covers only NVIDIA. **Do:** Test a Steam launch and warm startup on Windows AMD and Intel, recording the outcome and startup time against the base. `@fix` can do L2. **Since the last review** (on 9a871d69cb6f) Still open: L2 (The Steam NVIDIA cache overrides are removed without preserving an already-warm Steam cach…); L4 (The reported startup improvement needs a repeatable comparison against the supplied merge…); L5 (Disabling Fossilize also changes Windows Steam launches on AMD and Intel, which have not b…) **Checks:** Still running: 10 checks. <details> <summary>Also noticed (1; not asked for, not blocking)</summary> - The PR description says players immediately reuse a prepared default cache, but a Steam-only player may not have one. </details> <details> <summary>More: does it help, other systems, switches, what was read</summary> **Does it help:** Unproven as a repeatable gain. The PR reports one Windows RTX 3060 Ti comparison: texture pipeline startup fell from 1,470 ms to 4 ms, and 38,772 noted pipelines were found in 36 ms after the change; the before run was stopped at 18,735 of 42,193 after 403.4 seconds. The comparison used different commits and pipeline counts, and repeated interleaved runs against the supplied merge base are missing. **Other systems:** The environment changes apply to Windows Steam launches on NVIDIA, AMD and Intel; AMD and Intel hardware runs have not been reported. Linux does not call the Windows helper. Windows cache measurement also follows a retained NVIDIA path override. **Switches:** On Windows, the change sets DISABLE_VK_LAYER_VALVE_steam_fossilize_1=1 and clears the corresponding enable variable when active; it also clears NVIDIA cache path and app-name variables classified as Steam-owned. There is no new player switch. Unconditional removal of a warm Steam cache override is not a safe default for a cold destination cache. **Reviewed:** 7dcdb56885e8 against 9a926c2e938d: Read the pull request diff, commit log, repository rules, template, Steam environment helper and its tests; inspected the host and renderer call sites and prior cache-preservation implementation. The large renderer and host files were skimmed around relevant changes rather than read in full.; nothing run (a code review). **Checked and fine:** - The Windows helper runs after profiling environment setup and before Vulkan initialization. - The helper classifies NVIDIA variables individually, preserving custom values that do not match its Steam patterns. - The test environment scrub handles uppercase Windows environment keys. **Testing:** No commands from the project were run. The author reports Windows game and game-free checks; CI checks are still running. **Overlaps and merge order:** none found </details> --- <sub>Automated code review by BeanBot (gpt-6.1-terra), asked for by HumanBean. Nothing was run; a maintainer decides.</sub>
Author
First-time contributor

Ok, well this works in practice on multiple builds , and the automated check caring about warm steam cache on windows is just an endless loop. Feel free to pull this in and merge, but I'm not going to argue with a bot after asking for direct review.

Ok, well this works in practice on multiple builds , and the automated check caring about warm steam cache on windows is just an endless loop. Feel free to pull this in and merge, but I'm not going to argue with a bot after asking for direct review.
Owner

@ImpulsiveOrange8114 I'll take a manual look

@ImpulsiveOrange8114 I'll take a manual look
Some checks are pending
beanstalk/approval changed since the request: ask again
CI / Game-free checks (run_all.py, part 2/2) (pull_request) Blocked by required conditions
CI / Website build and checks (pull_request) Blocked by required conditions
CI / What the change needs (pull_request) Blocked by required conditions
CI / Lint (pre-commit, ShellCheck, actionlint) (pull_request) Blocked by required conditions
CI / Third-party parts and guide screenshots (pull_request) Blocked by required conditions
CI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request) Blocked by required conditions
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Blocked by required conditions
CI / Renderer build check (Windows, compile --only renderer, without and with FSR 4) (pull_request) Blocked by required conditions
CI / Renderer build check (Linux, compile --only renderer, without and with FSR 4) (pull_request) Blocked by required conditions
CI / Game-free checks (run_all.py, part 1/2) (pull_request) Blocked by required conditions
PR description / Title and description (pull_request_target) Successful in 5s
This pull request doesn't have enough approvals yet. 0 of 1 approvals granted.
Some workflows are waiting to be reviewed.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u 'fix/win-steam-shader-cache:ImpulsiveOrange8114-fix/win-steam-shader-cache'
git switch 'ImpulsiveOrange8114-fix/win-steam-shader-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!2883
No description provided.