fix(vk): a load marker left by caches that lacked pipelines is not followed on PCs with 20 GB of RAM or less #2256

Merged
HumanBean merged 4 commits from Apollyon/Longshot:fix/load-marker-small-ram into main 2026-11-23 15:59:20 +00:00
Contributor

Summary

On a 16 GB PC, one settings change can leave a game folder unplayable for good. A changed graphics or audio setting
makes the game restart, and a session after a change like that can find over 500 listed pipelines in no cache. That
writes cache/longshot_load_start.txt. From then on, every start of that folder loads every listed program before the
title (start mode). The comment in load_default.h already measures start mode at 19 GB of private memory at the
title on a 16 GB PC. On an Arc A750 with 16 GB it took 25.8 GB, its working set was paged out to 3.3 GB, and the window
stayed on a dim "Starting the game" for over ten minutes. The marker never expires: only preparing the shaders again
(or a fresh copy of the folder) gives the game back. Players see this as "any setting change breaks the game until I
reinstall".

The marker has two writers. They mean different things:

  • waits (marker_write): first uses waited seconds for their loads. That is the PC start mode is for (an RX 580,
    16 GB), and start is what makes it playable.
  • lacked (marker_write_lacked): loads found listed pipelines in no cache. On a small-RAM PC, compiling those in
    play costs far less than start mode does.

This change:

  • load_default::marker_kind tells the two apart by the marker's text. Any other text (a marker by hand) counts as
    waits, as every marker did before.
  • load_default::marker_counts: a lacked marker is not followed on a PC with 20 GB of RAM or less
    (kStartRamMb, the same line as pcache_load.h's kSmallRamMb). A waits marker is followed on any RAM, and so is
    any marker where the RAM is not known. RX_VK_LOAD still wins over both.
  • programs_load_decide (vk_programs.cpp) reads the PC's RAM and logs once when it does not follow a lacked marker.
  • programs_frames_note, which writes the lacked marker, no longer logs "the next start loads every listed program
    before the title again" on a PC with 20 GB of RAM or less, where that is no longer true (third commit).

Read first: marker_kind and marker_counts in gpu/vk/load_default.h, then programs_load_decide in
gpu/vk/vk_programs.cpp.

See #869 and #933 (start mode on a 16 GB RX 6600, cited in load_default.h). Hookshot reported the same marker written
after NVIDIA's driver cache was evicted, then loading everything before the title at every start:
https://git.notrexed.dev/Hookshot/Hookshot/issues/3069. #2193 (open) also touches the marker's writers, but only under
RX_VK_PRECOMPILE=0; this change does not overlap it.

Testing

Tested: Windows 11 (build 26300), Intel Arc A750 (driver 32.0.101.8974), i3-10105F, 16 GB RAM, on nightly-745
(a2dc5385, this branch's parent). The in-game runs swap only the nightly's renderer: main's (a2dc5385) against
this branch's, both built here. Four runs through the PC's job queue, alternating, 7 minutes each, each started with the
same real lacked marker ("517 listed pipelines were in no cache", left by a graphics settings change), no
longshot_env.txt, warm caches.

  • Before (main), both runs: "programs are loaded before the title (start): ... (longshot_load_start.txt)". Private
    memory climbed to 24.1 GB on the 16 GB PC (24.6 GB in the game's own vk: memory line), so most of it was paged
    out: the working set fell to 5.7 to 6.2 GB. Both reached the title within the run on this nightly.
  • After (this change), both runs: "longshot_load_start.txt (listed pipelines in no cache) not followed: 16279 MB of RAM,
    20480 MB or less ...", then "programs are loaded when the game makes them (create)". Both reached the title; private
    memory 9.5 GB.
  • Earlier, on v3.0.0 with the same PC and a folder in daily play, the same marker gave 25.8 to 26.0 GB private and the
    window stayed on a dim "Starting the game" for over ten minutes, at every start after a settings change, until the
    folder was replaced. That is how this was found; nightly-745 reaches the title, but still commits half again the
    PC's RAM.
  • Game-free, two commits: the test alone, then the fix. tests/test_load_marker_small_ram.py cuts
    programs_load_decide out of vk_programs.cpp and runs it with stand-ins for the RAM, the marker and the host. On
    main it fails for the bug ("a marker left by loads that found listed pipelines in no cache took a 16 GB PC's start
    to start mode"); with the fix it passes. load_default_test.cpp adds the unit checks of marker_kind and
    marker_counts. With the fix's key line switched off (if (false && ...)), both fail. On Windows (llvm-mingw) both
    pass twice with the fix, and the new test fails on the test commit alone.
  • Compiled: the renderer whole on Windows (llvm-mingw) on both sides; load_default.h alone with clang++ -Wall -Wextra. Both tests also with g++ 16.2 (-Wall -Wextra -Werror): the new test fails on main with the same
    reason and passes with the fix; load_default_test.cpp passes.
  • The third commit (the log line only): test_load_marker_small_ram.py and test_load_default.py pass on Windows, and
    the renderer builds. One more 7-minute run on nightly-745 with the same marker: "not followed", create mode, 9.5 GB,
    the title. That session found too few pipelines missing from the warm caches to write the marker again, so the new
    line itself was not printed; the test checks that it asks marker_counts.
  • mise run test on Windows: 35 failures, every one also failing on main on the same PC (main 866 passed / 36
    failed, this branch 864 / 39; the extra ones were test_prepare_stall, test_present_semaphores and
    test_stack_commit, which passed twice each on a rerun, and the new test, since fixed; main's extra one,
    test_display_startup_failure, passes on a rerun too). The shared failures: test_import_windows, test_auto_handheld, test_close_waits_for_save, test_compile_zero_byte, test_crash_dialog, test_damaged_rom_files, test_dev_ab, test_dev_build, test_dev_migrate, test_dev_packs, test_draw_stream_visibility, test_fs_save_commit, test_fsr_uniform_ownership, test_game_menu_mouse_buttons, test_guest_copies, test_hold_toggle, test_input_movie, test_linux_preflight, test_longshot_ctl, test_lower_atomg_cas, test_menu_i18n, test_menu_keys, test_menu_slider_ends, test_mise_build, test_pads_after_menu, test_perf_report, test_recording_admission, test_sampler_admission, test_sdiv_overflow, test_seed_reader, test_sim_turf_pools, test_switch_table, test_tls_objects, test_vibration_menu.
    mise run lint passes on the changed files.

Still to test:

  • Steam Deck (16 GB): with a lacked marker in the folder, the start logs "not followed" and reaches play in create mode
    (@Beanstalk steam-deck).
  • Windows, RX 580 or another GPU where loads at create wait seconds, 16 GB: a waits marker still takes the start to
    start mode (by hand).

Measurements

Verdict: private memory with a lacked marker on a 16 GB PC: 24.1 GB -> 9.5 GB, and the start no longer commits more
than the PC has. Not a performance change: the start-up's shader time is unchanged.

Setup: the PC above, nightly-745, the same folder and the same lacked marker each run, warm caches; two runs each of
main's renderer and this branch's, alternating (before, after, before, after), through the job queue in timing mode,
7 minutes each, memory read every 20 s and the game's own log. Medians of two.

Before: main @ a2dc5385 After: this PR @ 7a8917d2
Load mode start (the marker), 2 of 2 create (marker not followed), 2 of 2
Shaders at the start (log) 254 s (281, 226) 236 s (234, 237)
Pipelines made, time in the log's count 37639, 108 s (121, 95) 39191 and 39299, 33 s (32, 33)
Reaches the title yes, 2 of 2 yes, 2 of 2
Private memory, peak 24.1 GB (24.1, 24.1) 9.5 GB (9.5, 9.5)
Working set at the end 6.0 GB (5.7, 6.2) 4.9 GB (4.9, 4.8)
v3.0.0, same PC, earlier 25.8 to 26.0 GB, stuck on "Starting the game" 10.7 GB, plays

Risks

  • What could break: a PC with 20 GB of RAM or less whose lacked marker was right. It now compiles those
    pipelines in play: draws left out for a moment, not a folder that won't start. A PC where loads at create really
    are slow writes the waits marker, which is still followed.
  • Turning it off: RX_VK_LOAD=start gives start mode as before. A revert is enough.
  • After updating: a 16 GB PC whose folder had a lacked marker starts in create mode again. The marker file stays
    where it is; nothing else changes.

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. Windows (llvm-mingw) built whole; Linux not
    built here. The new ram_total_mb's POSIX branch (sysconf) compiles and runs with clang++ and g++ 16.2 on macOS
    (-Wall -Wextra -Werror); no paths changed.
  • AI assistance recorded with Assisted-by: / Co-Authored-By: trailers.

🤖 Generated with Claude Code

https://claude.ai/code/session_01KzPJVjoMBCBdaoMa7qptMJ

## Summary On a 16 GB PC, one settings change can leave a game folder unplayable for good. A changed graphics or audio setting makes the game restart, and a session after a change like that can find over 500 listed pipelines in no cache. That writes `cache/longshot_load_start.txt`. From then on, every start of that folder loads every listed program before the title (start mode). The comment in `load_default.h` already measures start mode at 19 GB of private memory at the title on a 16 GB PC. On an Arc A750 with 16 GB it took 25.8 GB, its working set was paged out to 3.3 GB, and the window stayed on a dim "Starting the game" for over ten minutes. The marker never expires: only preparing the shaders again (or a fresh copy of the folder) gives the game back. Players see this as "any setting change breaks the game until I reinstall". The marker has two writers. They mean different things: - **waits** (`marker_write`): first uses waited seconds for their loads. That is the PC start mode is for (an RX 580, 16 GB), and start is what makes it playable. - **lacked** (`marker_write_lacked`): loads found listed pipelines in no cache. On a small-RAM PC, compiling those in play costs far less than start mode does. This change: - `load_default::marker_kind` tells the two apart by the marker's text. Any other text (a marker by hand) counts as waits, as every marker did before. - `load_default::marker_counts`: a lacked marker is not followed on a PC with 20 GB of RAM or less (`kStartRamMb`, the same line as `pcache_load.h`'s `kSmallRamMb`). A waits marker is followed on any RAM, and so is any marker where the RAM is not known. `RX_VK_LOAD` still wins over both. - `programs_load_decide` (`vk_programs.cpp`) reads the PC's RAM and logs once when it does not follow a lacked marker. - `programs_frames_note`, which writes the lacked marker, no longer logs "the next start loads every listed program before the title again" on a PC with 20 GB of RAM or less, where that is no longer true (third commit). Read first: `marker_kind` and `marker_counts` in `gpu/vk/load_default.h`, then `programs_load_decide` in `gpu/vk/vk_programs.cpp`. See #869 and #933 (start mode on a 16 GB RX 6600, cited in `load_default.h`). Hookshot reported the same marker written after NVIDIA's driver cache was evicted, then loading everything before the title at every start: https://git.notrexed.dev/Hookshot/Hookshot/issues/3069. #2193 (open) also touches the marker's writers, but only under `RX_VK_PRECOMPILE=0`; this change does not overlap it. ## Testing **Tested:** Windows 11 (build 26300), Intel Arc A750 (driver 32.0.101.8974), i3-10105F, 16 GB RAM, on nightly-745 (`a2dc5385`, this branch's parent). The in-game runs swap only the nightly's renderer: `main`'s (`a2dc5385`) against this branch's, both built here. Four runs through the PC's job queue, alternating, 7 minutes each, each started with the same real lacked marker ("517 listed pipelines were in no cache", left by a graphics settings change), no `longshot_env.txt`, warm caches. - Before (`main`), both runs: "programs are loaded before the title (start): ... (longshot_load_start.txt)". Private memory climbed to 24.1 GB on the 16 GB PC (24.6 GB in the game's own `vk: memory` line), so most of it was paged out: the working set fell to 5.7 to 6.2 GB. Both reached the title within the run on this nightly. - After (this change), both runs: "longshot_load_start.txt (listed pipelines in no cache) not followed: 16279 MB of RAM, 20480 MB or less ...", then "programs are loaded when the game makes them (create)". Both reached the title; private memory 9.5 GB. - Earlier, on v3.0.0 with the same PC and a folder in daily play, the same marker gave 25.8 to 26.0 GB private and the window stayed on a dim "Starting the game" for over ten minutes, at every start after a settings change, until the folder was replaced. That is how this was found; nightly-745 reaches the title, but still commits half again the PC's RAM. - Game-free, two commits: the test alone, then the fix. `tests/test_load_marker_small_ram.py` cuts `programs_load_decide` out of `vk_programs.cpp` and runs it with stand-ins for the RAM, the marker and the host. On `main` it fails for the bug ("a marker left by loads that found listed pipelines in no cache took a 16 GB PC's start to start mode"); with the fix it passes. `load_default_test.cpp` adds the unit checks of `marker_kind` and `marker_counts`. With the fix's key line switched off (`if (false && ...)`), both fail. On Windows (llvm-mingw) both pass twice with the fix, and the new test fails on the test commit alone. - Compiled: the renderer whole on Windows (llvm-mingw) on both sides; `load_default.h` alone with clang++ `-Wall -Wextra`. Both tests also with g++ 16.2 (`-Wall -Wextra -Werror`): the new test fails on `main` with the same reason and passes with the fix; `load_default_test.cpp` passes. - The third commit (the log line only): `test_load_marker_small_ram.py` and `test_load_default.py` pass on Windows, and the renderer builds. One more 7-minute run on nightly-745 with the same marker: "not followed", create mode, 9.5 GB, the title. That session found too few pipelines missing from the warm caches to write the marker again, so the new line itself was not printed; the test checks that it asks `marker_counts`. - `mise run test` on Windows: 35 failures, every one also failing on `main` on the same PC (`main` 866 passed / 36 failed, this branch 864 / 39; the extra ones were `test_prepare_stall`, `test_present_semaphores` and `test_stack_commit`, which passed twice each on a rerun, and the new test, since fixed; `main`'s extra one, `test_display_startup_failure`, passes on a rerun too). The shared failures: `test_import_windows`, `test_auto_handheld`, `test_close_waits_for_save`, `test_compile_zero_byte`, `test_crash_dialog`, `test_damaged_rom_files`, `test_dev_ab`, `test_dev_build`, `test_dev_migrate`, `test_dev_packs`, `test_draw_stream_visibility`, `test_fs_save_commit`, `test_fsr_uniform_ownership`, `test_game_menu_mouse_buttons`, `test_guest_copies`, `test_hold_toggle`, `test_input_movie`, `test_linux_preflight`, `test_longshot_ctl`, `test_lower_atomg_cas`, `test_menu_i18n`, `test_menu_keys`, `test_menu_slider_ends`, `test_mise_build`, `test_pads_after_menu`, `test_perf_report`, `test_recording_admission`, `test_sampler_admission`, `test_sdiv_overflow`, `test_seed_reader`, `test_sim_turf_pools`, `test_switch_table`, `test_tls_objects`, `test_vibration_menu`. `mise run lint` passes on the changed files. **Still to test:** - Steam Deck (16 GB): with a lacked marker in the folder, the start logs "not followed" and reaches play in create mode (@Beanstalk steam-deck). - Windows, RX 580 or another GPU where loads at create wait seconds, 16 GB: a waits marker still takes the start to start mode (by hand). ## Measurements **Verdict:** private memory with a lacked marker on a 16 GB PC: 24.1 GB -> 9.5 GB, and the start no longer commits more than the PC has. Not a performance change: the start-up's shader time is unchanged. Setup: the PC above, nightly-745, the same folder and the same lacked marker each run, warm caches; two runs each of `main`'s renderer and this branch's, alternating (before, after, before, after), through the job queue in timing mode, 7 minutes each, memory read every 20 s and the game's own log. Medians of two. | | Before: `main` @ a2dc5385 | After: this PR @ 7a8917d2 | |---|---|---| | Load mode | start (the marker), 2 of 2 | create (marker not followed), 2 of 2 | | Shaders at the start (log) | 254 s (281, 226) | 236 s (234, 237) | | Pipelines made, time in the log's count | 37639, 108 s (121, 95) | 39191 and 39299, 33 s (32, 33) | | Reaches the title | yes, 2 of 2 | yes, 2 of 2 | | Private memory, peak | 24.1 GB (24.1, 24.1) | 9.5 GB (9.5, 9.5) | | Working set at the end | 6.0 GB (5.7, 6.2) | 4.9 GB (4.9, 4.8) | | v3.0.0, same PC, earlier | 25.8 to 26.0 GB, stuck on "Starting the game" | 10.7 GB, plays | ## Risks - **What could break:** a PC with 20 GB of RAM or less whose lacked marker was right. It now compiles those pipelines in play: draws left out for a moment, not a folder that won't start. A PC where loads at create really are slow writes the waits marker, which is still followed. - **Turning it off:** `RX_VK_LOAD=start` gives start mode as before. A revert is enough. - **After updating:** a 16 GB PC whose folder had a lacked marker starts in create mode again. The marker file stays where it is; nothing else changes. ## 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. - [ ] Host code builds on Windows (llvm-mingw) and Linux, with UTF-8 paths. Windows (llvm-mingw) built whole; Linux not built here. The new `ram_total_mb`'s POSIX branch (`sysconf`) compiles and runs with clang++ and g++ 16.2 on macOS (`-Wall -Wextra -Werror`); no paths changed. - [x] AI assistance recorded with `Assisted-by:` / `Co-Authored-By:` trailers. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01KzPJVjoMBCBdaoMa7qptMJ
The load default's programs_load_decide, cut from vk_programs.cpp and run with
stand-ins for the RAM, the marker and the host: on main a caches-lacked marker
on a 16 GB PC chooses start mode, which held 26 GB of private memory on a 16 GB
Arc A750 and left the window on "Starting the game". Fails on main for that
reason; the fix follows.

Assisted-by: Claude Code
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01KzPJVjoMBCBdaoMa7qptMJ
fix(vk): a load marker left by caches that lacked pipelines is not followed on PCs with 20 GB of RAM or less
Some checks failed
Website / Website on Cloudflare (pull_request_target) Has been skipped
PR description / Description follows the template (pull_request_target) Failing after 2m8s
CI / Conventional Commit title (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been cancelled
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been cancelled
CI / Workflow lint (actionlint) (pull_request) Has been cancelled
CI / Website build and checks (pull_request) Has been cancelled
Guide screenshots / Guide images and local UI source review (pull_request) Has been cancelled
Third-party parts / As their notes say (pull_request) Has been cancelled
Third-party parts / The same as upstream (pull_request) Has been cancelled
7a8917d29a
A settings change can leave a session with over 500 listed pipelines in no
cache, which writes longshot_load_start.txt. From then on every start loaded
every listed program before the title: 25.8-26.0 GB of private memory on a
16 GB Arc A750 PC, where the window then stayed on "Starting the game". The
marker never expired, so the folder stayed unplayable until it was prepared
again or replaced.

The marker's two writers mean different things. load_default::marker_kind
tells them apart by its text; marker_counts follows the caches-lacked one
only above 20 GB of RAM (pcache_load.h's small-RAM line) or where the RAM is
not known. The waits marker, for a PC where loads at create wait seconds, is
followed on any RAM as before, and RX_VK_LOAD still wins over both.

Assisted-by: Claude Code
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01KzPJVjoMBCBdaoMa7qptMJ
Author
Contributor

Tested in game: Windows 11 (26300), Intel Arc A750 (32.0.101.8974), 16 GB RAM, nightly-745 with only the renderer swapped, a real lacked marker from a graphics settings change: main's renderer went to start mode and 24.1 GB private (2 of 2 runs); this branch's logged 'not followed: 16279 MB of RAM', ran in create mode at 9.5 GB private and reached the title (2 of 2). On v3.0.0 the same marker left the window on 'Starting the game' for 10+ minutes.

Tested in game: Windows 11 (26300), Intel Arc A750 (32.0.101.8974), 16 GB RAM, nightly-745 with only the renderer swapped, a real lacked marker from a graphics settings change: main's renderer went to start mode and 24.1 GB private (2 of 2 runs); this branch's logged 'not followed: 16279 MB of RAM', ran in create mode at 9.5 GB private and reached the title (2 of 2). On v3.0.0 the same marker left the window on 'Starting the game' for 10+ minutes.
Apollyon changed title from WIP: fix(vk): a load marker left by caches that lacked pipelines is not followed on PCs with 20 GB of RAM or less to fix(vk): a load marker left by caches that lacked pipelines is not followed on PCs with 20 GB of RAM or less 2026-11-22 14:24:01 +00:00
Member

Possibly related, for context:

  • PR #1188 perf(vk): a start whose driver lost its shader cache builds the pipelines again before the title, not with draws left out in play — Merged fix addresses lost driver cache leading to persistent start-mode marker behavior.
  • PR #789 fix(vk): a driver update warms the noted pipelines again before the game, not in play — Merged fix clears a stale pipeline marker when driver rejects its cache.
Possibly related, for context: - PR #1188 perf(vk): a start whose driver lost its shader cache builds the pipelines again before the title, not with draws left out in play — Merged fix addresses lost driver cache leading to persistent start-mode marker behavior. - PR #789 fix(vk): a driver update warms the noted pipelines again before the game, not in play — Merged fix clears a stale pipeline marker when driver rejects its cache.
fix(vk): the lacked marker's log line no longer promises start mode on PCs with 20 GB of RAM or less
Some checks failed
PR description / Description follows the template (pull_request_target) Failing after 10s
CI / Conventional Commit title (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been cancelled
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been cancelled
CI / Workflow lint (actionlint) (pull_request) Has been cancelled
CI / Website build and checks (pull_request) Has been cancelled
Guide screenshots / Guide images and local UI source review (pull_request) Has been cancelled
Third-party parts / As their notes say (pull_request) Has been cancelled
Third-party parts / The same as upstream (pull_request) Has been cancelled
731cc5075f
programs_frames_note said "the next start loads every listed program before the title again" on every PC, but
programs_load_decide does not follow that marker at 20 GB of RAM or less. It now says what the next start does on
this PC's RAM. test_load_marker_small_ram.py checks the line asks marker_counts.

Assisted-by: Claude Code
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01KzPJVjoMBCBdaoMa7qptMJ
Owner
@review
BeanBot left a comment

Recommendation: Request changes. The change reduces startup memory on the tested 16 GB Arc PC, but a lacked marker can suppress the waits marker that is supposed to restore start mode on slow-loading PCs. The affected Linux and Tier 1 hardware paths also need game runs.

A lacked-cache marker no longer forces start mode on PCs with 20 GB of RAM or less. This avoids the measured startup memory spike, at the cost of compiling missing pipelines during play; the two marker writers need separate handling so the existing slow-load safety net remains effective.

Blocking (2): must change before merging.

  1. L1 gpu/vk/vk_programs.cpp:489: The lacked writer shares its one-shot flag with the waits writer, although the two markers now have different effects. (more on the line) Do: Give the writers separate state and ensure a waits verdict can replace a lacked marker without a later lacked write overwriting it; test both ordering cases.
  2. L5: It conflicts with its base branch: bring it up to date (@​fix or @​rebase try first). (for the author)

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

  • L2 tests/test_load_marker_small_ram.py:72: The new test inherits the compressed-cache switch from the environment. (more on the line) Do: Clear RX_VK_PROGRAM_CACHE_ZSTD in the test process before the cases, and set it explicitly if testing compressed-cache behavior.

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

  • L3 gpu/vk/load_default.h:99: The new default moves missing pipeline compilation into play on affected Tier 1 systems, but the reported runs stop at the title on an Arc PC. (more on the line) Do: Run the lacked-marker case through representative play on Steam Deck and affected Windows/Linux Tier 1 hardware, recording correctness, skipped draws and frame times against the base.
  • L4 gpu/vk/vk_programs.cpp:384: The waits-marker fallback has not been exercised in game on the low-RAM hardware it is intended to protect. (more on the line) Do: After fixing the writer ordering, run a slow-load case on the RX 580 or comparable PC and verify that the next launch selects start mode.

@fix can do L1 and L2.

Checks: Failing on this head, which is behind its base, where it passes: PR description / Description follows the template (pull_request_target). @rebase (or @fix) brings it up to date and runs it again; not held against it. Still running: 9 checks.

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

Does it help: Yes, for the tested startup case: two interleaved runs per side on Windows with an Arc A750 and 16 GB RAM showed peak private memory falling from 24.1 GB to 9.5 GB, with both versions reaching the title. The cost during play with cold or missing pipelines has not been measured.

Other systems: The decision affects Windows and Linux on every GPU when a lacked marker is present and RAM is at most 20 GB. Only Windows Arc startup was tested in game; Steam Deck, other affected Tier 1 GPUs and the slow-waits fallback remain untested.

Switches: No switches added, changed or removed. RX_VK_LOAD remains available; the compressed-cache setting also forces start mode.

Reviewed: 731cc5075f against a2dc538590: Read AGENTS.md, CONTRIBUTING.md, docs/dev/standards.md, the pull request template, the diff and commit messages, load_default.h, both changed tests, and vk_programs.cpp in sections. Read the marker writers, callers and related source checks; skimmed the reported runs. docs/review-checklist.md and the adjacent Tooling AGENTS.md were absent. No generated files or translations changed.; nothing run (a code review).

Checked and fine:

  • Each commit records AI assistance.
  • No game-derived files, generated files, API changes or third-party changes appear in the diff.
  • The marker classification retains unknown marker text as a waits marker, and the unit checks cover the RAM boundary.

Testing: Read-only review; no builds, tests or project scripts were run. The author reports Windows game runs and game-free tests; Linux renderer build and the listed hardware runs remain outstanding. CI is still running.

Overlaps and merge order: The description identifies #2193 as touching the marker writers under RX_VK_PRECOMPILE=0; its diff was unavailable for independent comparison.


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

**Recommendation: Request changes.** The change reduces startup memory on the tested 16 GB Arc PC, but a lacked marker can suppress the waits marker that is supposed to restore start mode on slow-loading PCs. The affected Linux and Tier 1 hardware paths also need game runs. A lacked-cache marker no longer forces start mode on PCs with 20 GB of RAM or less. This avoids the measured startup memory spike, at the cost of compiling missing pipelines during play; the two marker writers need separate handling so the existing slow-load safety net remains effective. **Blocking (2)**: must change before merging. 1. **L1** `gpu/vk/vk_programs.cpp:489`: The lacked writer shares its one-shot flag with the waits writer, although the two markers now have different effects. (more on the line) **Do:** Give the writers separate state and ensure a waits verdict can replace a lacked marker without a later lacked write overwriting it; test both ordering cases. 2. **L5**: It conflicts with its base branch: bring it up to date (`@​fix` or `@​rebase` try first). *(for the author)* **Should fix (1)**: not blocking, but worth doing before merging. - **L2** `tests/test_load_marker_small_ram.py:72`: The new test inherits the compressed-cache switch from the environment. (more on the line) **Do:** Clear RX_VK_PROGRAM_CACHE_ZSTD in the test process before the cases, and set it explicitly if testing compressed-cache behavior. **Testing before merging (2)** (runs on the systems it can change; it doesn't hold the recommendation) - **L3** `gpu/vk/load_default.h:99`: The new default moves missing pipeline compilation into play on affected Tier 1 systems, but the reported runs stop at the title on an Arc PC. (more on the line) **Do:** Run the lacked-marker case through representative play on Steam Deck and affected Windows/Linux Tier 1 hardware, recording correctness, skipped draws and frame times against the base. - **L4** `gpu/vk/vk_programs.cpp:384`: The waits-marker fallback has not been exercised in game on the low-RAM hardware it is intended to protect. (more on the line) **Do:** After fixing the writer ordering, run a slow-load case on the RX 580 or comparable PC and verify that the next launch selects start mode. `@fix` can do L1 and L2. **Checks:** Failing on this head, which is behind its base, where it passes: `PR description / Description follows the template (pull_request_target)`. `@rebase` (or `@fix`) brings it up to date and runs it again; not held against it. Still running: 9 checks. <details> <summary>More: does it help, other systems, switches, what was read</summary> **Does it help:** Yes, for the tested startup case: two interleaved runs per side on Windows with an Arc A750 and 16 GB RAM showed peak private memory falling from 24.1 GB to 9.5 GB, with both versions reaching the title. The cost during play with cold or missing pipelines has not been measured. **Other systems:** The decision affects Windows and Linux on every GPU when a lacked marker is present and RAM is at most 20 GB. Only Windows Arc startup was tested in game; Steam Deck, other affected Tier 1 GPUs and the slow-waits fallback remain untested. **Switches:** No switches added, changed or removed. RX_VK_LOAD remains available; the compressed-cache setting also forces start mode. **Reviewed:** 731cc5075f8e against a2dc53859018: Read AGENTS.md, CONTRIBUTING.md, docs/dev/standards.md, the pull request template, the diff and commit messages, load_default.h, both changed tests, and vk_programs.cpp in sections. Read the marker writers, callers and related source checks; skimmed the reported runs. docs/review-checklist.md and the adjacent Tooling AGENTS.md were absent. No generated files or translations changed.; nothing run (a code review). **Checked and fine:** - Each commit records AI assistance. - No game-derived files, generated files, API changes or third-party changes appear in the diff. - The marker classification retains unknown marker text as a waits marker, and the unit checks cover the RAM boundary. **Testing:** Read-only review; no builds, tests or project scripts were run. The author reports Windows game runs and game-free tests; Linux renderer build and the listed hardware runs remain outstanding. CI is still running. **Overlaps and merge order:** The description identifies #2193 as touching the marker writers under RX_VK_PRECOMPILE=0; its diff was unavailable for independent comparison. </details> --- <sub>Automated code review by BeanBot (gpt-6.1-terra), asked for by HumanBean. Nothing was run; a maintainer decides.</sub>
@ -71,0 +96,4 @@
/// Whether the marker takes this start to start mode. ram_mb: the PC's RAM (0: not known, and the marker is followed as before)
inline bool marker_counts(Marker m, uint32_t ram_mb) {
if (m == Marker::kNone) return false;
if (m == Marker::kLacked && ram_mb && ram_mb <= kStartRamMb) return false;
Member

L3 (should fix): The new default moves missing pipeline compilation into play on affected Tier 1 systems, but the reported runs stop at the title on an Arc PC.

When: A Steam Deck or a 16 GB NVIDIA or AMD PC with a lacked marker now enters create mode and can encounter missing pipelines during play; the extent of skipped draws and frame-time impact is unknown.

Do: Run the lacked-marker case through representative play on Steam Deck and affected Windows/Linux Tier 1 hardware, recording correctness, skipped draws and frame times against the base.

**L3** (should fix): The new default moves missing pipeline compilation into play on affected Tier 1 systems, but the reported runs stop at the title on an Arc PC. *When:* A Steam Deck or a 16 GB NVIDIA or AMD PC with a lacked marker now enters create mode and can encounter missing pipelines during play; the extent of skipped draws and frame-time impact is unknown. **Do:** Run the lacked-marker case through representative play on Steam Deck and affected Windows/Linux Tier 1 hardware, recording correctness, skipped draws and frame times against the base.
@ -367,0 +381,4 @@
// (a marker left by loads that found listed pipelines in no cache is not followed where RAM cannot hold start: load_default.h)
const load_default::Marker kind = load_default::marker_kind(load_fallback_path());
const uint32_t ram_mb = ram_total_mb();
const bool marker = load_default::marker_counts(kind, ram_mb);
Member

L4 (should fix): The waits-marker fallback has not been exercised in game on the low-RAM hardware it is intended to protect.

When: A low-RAM PC whose create loads wait seconds relies on a waits marker to select start mode after a session with slow loads; the reported testing has not verified that end-to-end behavior.

Do: After fixing the writer ordering, run a slow-load case on the RX 580 or comparable PC and verify that the next launch selects start mode.

**L4** (should fix): The waits-marker fallback has not been exercised in game on the low-RAM hardware it is intended to protect. *When:* A low-RAM PC whose create loads wait seconds relies on a waits marker to select start mode after a session with slow loads; the reported testing has not verified that end-to-end behavior. **Do:** After fixing the writer ordering, run a slow-load case on the RX 580 or comparable PC and verify that the next launch selects start mode.
@ -465,9 +488,13 @@ void programs_frames_note() {
const long long lacked = census.load_pipes_cold.load(std::memory_order_relaxed) + census.load_computes_cold.load(std::memory_order_relaxed);
if (!load_default::caches_lacked(lacked) || wait_marked.exchange(true)) return;
Member

L1 (blocking): The lacked writer shares its one-shot flag with the waits writer, although the two markers now have different effects.

When: On a PC with at most 20 GB RAM, if more than 500 missing pipelines are counted before long first-use waits reach the waits threshold, this function sets wait_marked and writes a lacked marker. load_wait_note then cannot replace it with a waits marker, so the next launch ignores the marker and repeats create mode despite the slow waits.

Do: Give the writers separate state and ensure a waits verdict can replace a lacked marker without a later lacked write overwriting it; test both ordering cases.

**L1** (blocking): The lacked writer shares its one-shot flag with the waits writer, although the two markers now have different effects. *When:* On a PC with at most 20 GB RAM, if more than 500 missing pipelines are counted before long first-use waits reach the waits threshold, this function sets wait_marked and writes a lacked marker. load_wait_note then cannot replace it with a waits marker, so the next launch ignores the marker and repeats create mode despite the slow waits. **Do:** Give the writers separate state and ensure a waits verdict can replace a lacked marker without a later lacked write overwriting it; test both ordering cases.
@ -0,0 +69,4 @@
programs_load_decide(true);
return load_mode.load() == 1; // (create)
}
int main(int argc, char** argv) {
Member

L2 (should fix): The new test inherits the compressed-cache switch from the environment.

When: With RX_VK_PROGRAM_CACHE_ZSTD=1, programs_load_decide forces start mode even with no marker, so the first create-mode assertion fails although the marker fix is correct.

Do: Clear RX_VK_PROGRAM_CACHE_ZSTD in the test process before the cases, and set it explicitly if testing compressed-cache behavior.

**L2** (should fix): The new test inherits the compressed-cache switch from the environment. *When:* With RX_VK_PROGRAM_CACHE_ZSTD=1, programs_load_decide forces start mode even with no marker, so the first create-mode assertion fails although the marker fix is correct. **Do:** Clear RX_VK_PROGRAM_CACHE_ZSTD in the test process before the cases, and set it explicitly if testing compressed-cache behavior.
Owner
@fix
BeanBot force-pushed fix/load-marker-small-ram from 731cc5075f
Some checks failed
PR description / Description follows the template (pull_request_target) Failing after 10s
CI / Conventional Commit title (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been cancelled
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been cancelled
CI / Workflow lint (actionlint) (pull_request) Has been cancelled
CI / Website build and checks (pull_request) Has been cancelled
Guide screenshots / Guide images and local UI source review (pull_request) Has been cancelled
Third-party parts / As their notes say (pull_request) Has been cancelled
Third-party parts / The same as upstream (pull_request) Has been cancelled
to badb8ad601
Some checks failed
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been skipped
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been skipped
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been skipped
Third-party parts / The same as upstream (pull_request) Has been skipped
Website / Website on Cloudflare (pull_request) Has been skipped
CI / Conventional Commit title (pull_request) Successful in 7s
PR description / Description follows the template (pull_request_target) Failing after 9s
Guide screenshots / Guide images and local UI source review (pull_request) Failing after 12s
CI / Workflow lint (actionlint) (pull_request) Successful in 13s
Third-party parts / As their notes say (pull_request) Successful in 16s
CI / Website build and checks (pull_request) Failing after 20m1s
2026-11-23 15:55:40 +00:00
Compare
BeanBot left a comment

Recommendation: Approve. The code is ready: only testing is left. The fix preserves a waits marker when both writers trigger, and the reported Arc runs show substantially lower startup memory use. Gameplay with missing pipelines and the waits fallback still need the runs requested in the ledger. Recommend approval; not approved on the forge.

What @fix changed
I changed this pull request: the new head is badb8ad601. I rebased it onto main (897d6d3fe7).

Conflicts resolved

  • gpu/vk/vk_programs.cpp: Kept the RAM-aware marker handling and the base branch’s shader preparation argument.

Changed

  • Marker writer ordering in gpu/vk/vk_programs.cpp:405: Gave the writers separate state and serialized their file writes so waits takes precedence. Added coverage for both orderings in tests/test_load_marker_small_ram.py:99 and updated the source-cut test in tests/test_saveload_warm_cache.py:310. Tests were not run, as requested.
  • Compressed-cache environment in tests/test_load_marker_small_ram.py:80: Cleared RX_VK_PROGRAM_CACHE_ZSTD before the test cases so inherited settings cannot change their load mode.

Nothing was built or run: the checks run again on the new head.

On PCs with 20 GB of RAM or less, a marker caused by missing cached pipelines no longer forces all listed programs to load before the title. This reduces startup memory use but moves compilation of missing pipelines into play; the writer fix also preserves the fallback for slow loads.

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

  • L3 gpu/vk/load_default.h:99: The new default moves missing pipeline compilation into play on affected Tier 1 systems, but the reported runs stop at the title on an Arc PC. When: A Steam Deck or a 16 GB NVIDIA or AMD PC with a lacked marker now enters create mode and can encounter missing pipelines during play; the extent of skipped draws and frame-time impact is unknown. Do: Run the lacked-marker case through representative play on Steam Deck and affected Windows/Linux Tier 1 hardware, recording correctness, skipped draws and frame times against the base.
  • L4 gpu/vk/vk_programs.cpp:384: The waits-marker fallback has not been exercised in game on the low-RAM hardware it is intended to protect. When: A low-RAM PC whose create loads wait seconds relies on a waits marker to select start mode after a session with slow loads; the reported testing has not verified that end-to-end behavior. Do: After fixing the writer ordering, run a slow-load case on the RX 580 or comparable PC and verify that the next launch selects start mode.

Checks: they run again on this head (PR description / Description follows the template (pull_request_target) failed on the last one); a failure shows on the pull request.

Also noticed (2; not asked for, not blocking)
  • The PR is reported as not mergeable.
  • Linux renderer build and Steam Deck behavior are not reported.
More: does it help, other systems, switches, what was read

Does it help: Yes for startup memory on the tested Windows Arc A750 with 16 GB RAM: two alternating runs per version reported peak private memory of 24.1 GB before and 9.5 GB after. The effect during play remains unmeasured.

Other systems: The policy also affects low-RAM Linux and Steam Deck systems and other GPU vendors. The reported game runs cover Windows on Intel Arc; the ledger's gameplay and waits-fallback runs remain outstanding.

Switches: No switches added or removed. RX_VK_LOAD remains an override; compressed-cache and disabled-precompilation behavior remain controlled by their existing switches.

Reviewed: badb8ad601 against 897d6d3fe7: Read AGENTS.md, CONTRIBUTING.md, load_default.h, test_load_marker_small_ram.py, the relevant writer and caller code, the fix diff, and the current PR diff for the renderer and unit test. Skimmed the remaining portions of vk_programs.cpp and test_saveload_warm_cache.py; the full changed code files were not all read in full.; nothing run (a code review).

Checked and fine:

  • The marker mutex covers both file writes and both flags, so either writer ordering leaves waits as the final verdict.
  • The source-cut test covers both writer orderings and clears the compressed-cache environment variable.
  • The fix retains the small-RAM lacked-marker policy.

Testing: No commands that build or run tests were executed. The author reports Windows renderer builds and game runs on the earlier implementation; CI has not run on this head.

Overlaps and merge order: PR #2193 also touches the marker writers under RX_VK_PRECOMPILE=0; the rebased code retains the precompile guard.


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

**Recommendation: Approve.** The code is ready: only testing is left. The fix preserves a waits marker when both writers trigger, and the reported Arc runs show substantially lower startup memory use. Gameplay with missing pipelines and the waits fallback still need the runs requested in the ledger. Recommend approval; not approved on the forge. **What `@fix` changed** I changed this pull request: the new head is badb8ad601cf. I rebased it onto `main` (897d6d3fe795). **Conflicts resolved** - gpu/vk/vk_programs.cpp: Kept the RAM-aware marker handling and the base branch’s shader preparation argument. **Changed** - **Marker writer ordering in gpu/vk/vk_programs.cpp:405**: Gave the writers separate state and serialized their file writes so waits takes precedence. Added coverage for both orderings in tests/test_load_marker_small_ram.py:99 and updated the source-cut test in tests/test_saveload_warm_cache.py:310. Tests were not run, as requested. - **Compressed-cache environment in tests/test_load_marker_small_ram.py:80**: Cleared RX_VK_PROGRAM_CACHE_ZSTD before the test cases so inherited settings cannot change their load mode. Nothing was built or run: the checks run again on the new head. On PCs with 20 GB of RAM or less, a marker caused by missing cached pipelines no longer forces all listed programs to load before the title. This reduces startup memory use but moves compilation of missing pipelines into play; the writer fix also preserves the fallback for slow loads. **Testing before merging (2)** (runs on the systems it can change; it doesn't hold the recommendation) - **L3** `gpu/vk/load_default.h:99`: The new default moves missing pipeline compilation into play on affected Tier 1 systems, but the reported runs stop at the title on an Arc PC. *When:* A Steam Deck or a 16 GB NVIDIA or AMD PC with a lacked marker now enters create mode and can encounter missing pipelines during play; the extent of skipped draws and frame-time impact is unknown. **Do:** Run the lacked-marker case through representative play on Steam Deck and affected Windows/Linux Tier 1 hardware, recording correctness, skipped draws and frame times against the base. - **L4** `gpu/vk/vk_programs.cpp:384`: The waits-marker fallback has not been exercised in game on the low-RAM hardware it is intended to protect. *When:* A low-RAM PC whose create loads wait seconds relies on a waits marker to select start mode after a session with slow loads; the reported testing has not verified that end-to-end behavior. **Do:** After fixing the writer ordering, run a slow-load case on the RX 580 or comparable PC and verify that the next launch selects start mode. **Checks:** they run again on this head (`PR description / Description follows the template (pull_request_target)` failed on the last one); a failure shows on the pull request. <details> <summary>Also noticed (2; not asked for, not blocking)</summary> - The PR is reported as not mergeable. - Linux renderer build and Steam Deck behavior are not reported. </details> <details> <summary>More: does it help, other systems, switches, what was read</summary> **Does it help:** Yes for startup memory on the tested Windows Arc A750 with 16 GB RAM: two alternating runs per version reported peak private memory of 24.1 GB before and 9.5 GB after. The effect during play remains unmeasured. **Other systems:** The policy also affects low-RAM Linux and Steam Deck systems and other GPU vendors. The reported game runs cover Windows on Intel Arc; the ledger's gameplay and waits-fallback runs remain outstanding. **Switches:** No switches added or removed. RX_VK_LOAD remains an override; compressed-cache and disabled-precompilation behavior remain controlled by their existing switches. **Reviewed:** badb8ad601cf against 897d6d3fe795: Read AGENTS.md, CONTRIBUTING.md, load_default.h, test_load_marker_small_ram.py, the relevant writer and caller code, the fix diff, and the current PR diff for the renderer and unit test. Skimmed the remaining portions of vk_programs.cpp and test_saveload_warm_cache.py; the full changed code files were not all read in full.; nothing run (a code review). **Checked and fine:** - The marker mutex covers both file writes and both flags, so either writer ordering leaves waits as the final verdict. - The source-cut test covers both writer orderings and clears the compressed-cache environment variable. - The fix retains the small-RAM lacked-marker policy. **Testing:** No commands that build or run tests were executed. The author reports Windows renderer builds and game runs on the earlier implementation; CI has not run on this head. **Overlaps and merge order:** PR #2193 also touches the marker writers under RX_VK_PRECOMPILE=0; the rebased code retains the precompile guard. </details> --- <sub>Automated code review by BeanBot (gpt-6.1-terra), asked for by BeanBot, after its fix. Nothing was run; a maintainer decides.</sub>
HumanBean deleted branch fix/load-marker-small-ram 2026-11-23 15:59:22 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
3 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
MagicBeanDev/Longshot!2256
No description provided.