fix(game): what the game decided on this PC stays beside the settings, and a loose cache that cannot move is deleted #345

Open
lndf wants to merge 2 commits from lndf/Longshot:fix/game-layout-followup into main
Contributor

Type: fix · Risk: low · Tested on: Linux, RX 7800 XT (RADV); Windows · Needs: none

Why

#321 put longshot_driver_faults.txt in cache/, and the README says that folder can be deleted. A player who clears it to fix something loses the list of shaders their driver faulted on, and the game asks the driver for them again. On AMD's Windows driver one such shader froze the game (issue 996). This follow-up to #321's review also deletes a loose cache that can never move (several GB lying in the game folder for good), and fixes docs whose commands point at the old place.

See #321

How to reproduce

Seen on: any system, main with #321
Settings and switches: defaults
Steps: on a PC whose driver faulted on a shader (longshot_driver_faults.txt in the game folder's cache), delete cache as the README says you can, then start the game.
Expected: the faulted shaders stay left out, as the driver-faults list said.
Actual: the list went with cache, so the game asks the driver for those shaders again (on AMD's Windows driver, the freeze of issue 996). Likewise, a skipped preparation and the load mode's fallback are forgotten.

What changed

What the game decided on this PC goes back beside the settings, out of cache/, and a folder #321 already moved has it moved back out (copied out whole when cache/ won't give it up). A loose cache that can never move into cache/, because cache/ already has its own, is deleted instead of lying there for good. The docs and comments now give the right places.

  • The records beside the settings: longshot_driver_faults.txt, longshot_prepare_skipped and longshot_load_start.txt (with its .waited).
    • driver_faults_path and load_fallback_path in gpu/vk/vk_draw.cpp, and skipped_path in vk_main.cpp, give the game folder.
    • host/game_layout.c no longer moves them into cache/, and moves them back out of it (records). When the rename fails (a cache/ that takes no rename, a file held without delete sharing on Windows), the record is copied out whole through a .tmp renamed into place (copy_record), so the game, which reads only the game folder's, keeps it; the log says so, and names one that can't even be read.
  • A loose cache that can't move is deleted (host/game_layout.c move_as): when cache/ has its own of a cache file (the first move failed, the file held open, and the game then made a new one), the loose one is deleted and the log says how many and how many MB. A log is never deleted.
  • Docs:
    • assets/pipeline_states/README.md and docs/development.md give cache/longshot_pipeline_states.bin in the add command and steps, which failed with the old place.
    • The README says what cache holds besides caches (the pipeline list you can send in) and what stays out of it.
    • docs/development.md has the layout, and what switching one game folder between a build from before #321 and one after it costs.
    • The RX_VK_LOAD and RX_VK_DRIVER_FAULTS rows give the game folder.
  • Comments that said "beside the executable" name the folder: vk_progcache.cpp, vk_draw.cpp, driver_faults.h, vk_main.cpp.
  • Tests:
    • tests/test_game_layout.py: the records stay, and move back out of cache/; with a read-only cache/ they're copied out, the driver's faults whole (fails without the fix), and an unreadable one is logged; a loose cache with a cache/ copy is deleted; a loose log stays.
    • tests/test_load_default.py: the marker is in the game folder.

Measurements

Verdict: passes on Linux and Windows. There's no performance number to measure: files move between folders. The measure is the game folder after an update, below.

Hardware: Fedora Linux 45, AMD Radeon RX 7800 XT (RADV, Mesa 26.2.6); and a Windows PC
Scene: none (the game folder's files)
Method: a launcher-built game folder from main, its caches and logs loose beside the game, updated with this branch's builder (--cli --update), started, and its folder listed
Baseline: main @ aa95d35f is the launcher's nightly-189, the folder's build before the update. The run is on 4e5c009a, this change merged with main of 2026-11-15. 38e83bbf is the same change rebased onto main @ 7bacf846 (the same 11 files), so the folder's moves hold for it.
How to reproduce: copy a launcher-built game folder, run this branch's builder --cli --update <copy>, start the game from the copy, list the folder, cache/ and logs/

Before: main @ aa95d35f After: this PR @ 4e5c009a
Caches (program cache, pipeline notes and lists, prepare record, longshot_vk_pipelines.bin and stamp) loose beside the game in cache/
Logs loose beside the game in logs/: this run's longshot_log.txt (v3.0.0-rc.4-35-g4e5c009a), the run before as .1
Button prompts made from the controls cache/prompts/ cache/prompts/
Left loose beside the game the caches and logs nothing

Flags and settings

None.

Testing

Tested:

  • In the game, on 4e5c009a (this change on main of 2026-11-15; 38e83bbf is it rebased, the same 11 files):
    • Linux (Fedora 45, RX 7800 XT, RADV): a launcher-built folder from main (nightly-189-aa95d35f), updated with this branch's AppImage and started from the launcher. Everything moved into cache/ and logs/, nothing was left loose, the game wrote its log into logs/ with the run before rotated to .1, and the button prompts were made in cache/prompts/.
    • Windows: a launcher-built folder, updated with this branch's LongshotBuilder-v3.0.0-rc.4-35-g4e5c009a-windows-x64.zip (LongshotBuilder.exe --cli --update), then played. It works as on Linux.
  • python -I -B tests/run_all.py on Linux, on a7f436bb: 575 passed. The 18 failures fail on a clean main @ 71b1edd8 too, the same list.
  • The record copy fallback (a7f436bb, after the game runs above): tests/test_game_layout.py with a read-only cache/. host/game_layout.c builds with llvm-mingw 20261104 -Wall -Wextra -Werror.
  • Windows with llvm-mingw 20261104 (tools.lock's), cross-built on Linux:
    • longshot_vk.dll builds;
    • the host files this change touches compile (hos_main.c, game_layout.c, prompts.c; game_layout.c with -Wall -Wextra -Werror);
    • the Windows builder zip passes scripts/check_windows_files.py.

Not tested: in the game, a file held open while the game moves it (an antivirus scan): a loose cache that can't move (deleted at a later start), and a record copied out instead of moved (a7f436bb). tests/test_game_layout.py covers both; no run met them, and the runs above were before a7f436bb, which changes only that failure path.

Must be tested: none: Linux and Windows were both run.

Risks

What could break: a loose cache file is deleted only when cache/ has one of the same name. It's a cache, so the worst case is the game making it again (a shader preparation, minutes). A log is never deleted. The records move only out of cache/ into the game folder, never over a file there.

Turning it off: revert the commit (the records then go back into cache/ at the next start).

Compatibility: after updating, longshot_driver_faults.txt, longshot_prepare_skipped and longshot_load_start.txt are back beside the game. The shader and pipeline caches are kept, not translated again. Saves, longshot_options.ini and the vk ABI don't change.

Issues

See #321

Checklist

Everyone

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

When it applies

  • AI assistance recorded with Assisted-by: / Co-Authored-By: trailers.
  • A game-free test added for the fix, failing on main and passing here.
  • A check under tests/ that reads changed source updated in this PR, not weakened.
  • Host code builds on both Windows (llvm-mingw) and Linux, with UTF-8 paths.
  • Docs updated.
**Type:** fix · **Risk:** low · **Tested on:** Linux, RX 7800 XT (RADV); Windows · **Needs:** none ## Why #321 put `longshot_driver_faults.txt` in `cache/`, and the README says that folder can be deleted. A player who clears it to fix something loses the list of shaders their driver faulted on, and the game asks the driver for them again. On AMD's Windows driver one such shader froze the game (issue 996). This follow-up to #321's review also deletes a loose cache that can never move (several GB lying in the game folder for good), and fixes docs whose commands point at the old place. See #321 ## How to reproduce **Seen on:** any system, `main` with #321 **Settings and switches:** defaults **Steps:** on a PC whose driver faulted on a shader (`longshot_driver_faults.txt` in the game folder's `cache`), delete `cache` as the README says you can, then start the game. **Expected:** the faulted shaders stay left out, as the driver-faults list said. **Actual:** the list went with `cache`, so the game asks the driver for those shaders again (on AMD's Windows driver, the freeze of issue 996). Likewise, a skipped preparation and the load mode's fallback are forgotten. ## What changed What the game decided on this PC goes back beside the settings, out of `cache/`, and a folder #321 already moved has it moved back out (copied out whole when `cache/` won't give it up). A loose cache that can never move into `cache/`, because `cache/` already has its own, is deleted instead of lying there for good. The docs and comments now give the right places. - **The records beside the settings:** `longshot_driver_faults.txt`, `longshot_prepare_skipped` and `longshot_load_start.txt` (with its `.waited`). - `driver_faults_path` and `load_fallback_path` in `gpu/vk/vk_draw.cpp`, and `skipped_path` in `vk_main.cpp`, give the game folder. - `host/game_layout.c` no longer moves them into `cache/`, and moves them back out of it (`records`). When the rename fails (a `cache/` that takes no rename, a file held without delete sharing on Windows), the record is copied out whole through a `.tmp` renamed into place (`copy_record`), so the game, which reads only the game folder's, keeps it; the log says so, and names one that can't even be read. - **A loose cache that can't move is deleted** (`host/game_layout.c` `move_as`): when `cache/` has its own of a cache file (the first move failed, the file held open, and the game then made a new one), the loose one is deleted and the log says how many and how many MB. A log is never deleted. - **Docs:** - `assets/pipeline_states/README.md` and `docs/development.md` give `cache/longshot_pipeline_states.bin` in the `add` command and steps, which failed with the old place. - The README says what `cache` holds besides caches (the pipeline list you can send in) and what stays out of it. - `docs/development.md` has the layout, and what switching one game folder between a build from before #321 and one after it costs. - The `RX_VK_LOAD` and `RX_VK_DRIVER_FAULTS` rows give the game folder. - **Comments** that said "beside the executable" name the folder: `vk_progcache.cpp`, `vk_draw.cpp`, `driver_faults.h`, `vk_main.cpp`. - **Tests:** - `tests/test_game_layout.py`: the records stay, and move back out of `cache/`; with a read-only `cache/` they're copied out, the driver's faults whole (fails without the fix), and an unreadable one is logged; a loose cache with a `cache/` copy is deleted; a loose log stays. - `tests/test_load_default.py`: the marker is in the game folder. ## Measurements **Verdict:** passes on Linux and Windows. There's no performance number to measure: files move between folders. The measure is the game folder after an update, below. Hardware: Fedora Linux 45, AMD Radeon RX 7800 XT (RADV, Mesa 26.2.6); and a Windows PC Scene: none (the game folder's files) Method: a launcher-built game folder from `main`, its caches and logs loose beside the game, updated with this branch's builder (`--cli --update`), started, and its folder listed Baseline: `main` @ aa95d35f is the launcher's nightly-189, the folder's build before the update. The run is on 4e5c009a, this change merged with `main` of 2026-11-15. 38e83bbf is the same change rebased onto `main` @ 7bacf846 (the same 11 files), so the folder's moves hold for it. How to reproduce: copy a launcher-built game folder, run this branch's builder `--cli --update <copy>`, start the game from the copy, list the folder, `cache/` and `logs/` | | Before: main @ aa95d35f | After: this PR @ 4e5c009a | |---|---|---| | Caches (program cache, pipeline notes and lists, prepare record, `longshot_vk_pipelines.bin` and stamp) | loose beside the game | in `cache/` | | Logs | loose beside the game | in `logs/`: this run's `longshot_log.txt` (`v3.0.0-rc.4-35-g4e5c009a`), the run before as `.1` | | Button prompts made from the controls | `cache/prompts/` | `cache/prompts/` | | Left loose beside the game | the caches and logs | nothing | ### Flags and settings None. ## Testing **Tested:** - In the game, on 4e5c009a (this change on `main` of 2026-11-15; 38e83bbf is it rebased, the same 11 files): - **Linux** (Fedora 45, RX 7800 XT, RADV): a launcher-built folder from `main` (`nightly-189-aa95d35f`), updated with this branch's AppImage and started from the launcher. Everything moved into `cache/` and `logs/`, nothing was left loose, the game wrote its log into `logs/` with the run before rotated to `.1`, and the button prompts were made in `cache/prompts/`. - **Windows**: a launcher-built folder, updated with this branch's `LongshotBuilder-v3.0.0-rc.4-35-g4e5c009a-windows-x64.zip` (`LongshotBuilder.exe --cli --update`), then played. It works as on Linux. - `python -I -B tests/run_all.py` on Linux, on a7f436bb: 575 passed. The 18 failures fail on a clean `main` @ 71b1edd8 too, the same list. - The record copy fallback (a7f436bb, after the game runs above): `tests/test_game_layout.py` with a read-only `cache/`. `host/game_layout.c` builds with llvm-mingw 20261104 `-Wall -Wextra -Werror`. - Windows with llvm-mingw 20261104 (tools.lock's), cross-built on Linux: - `longshot_vk.dll` builds; - the host files this change touches compile (`hos_main.c`, `game_layout.c`, `prompts.c`; `game_layout.c` with `-Wall -Wextra -Werror`); - the Windows builder zip passes `scripts/check_windows_files.py`. **Not tested:** in the game, a file held open while the game moves it (an antivirus scan): a loose cache that can't move (deleted at a later start), and a record copied out instead of moved (a7f436bb). `tests/test_game_layout.py` covers both; no run met them, and the runs above were before a7f436bb, which changes only that failure path. **Must be tested:** none: Linux and Windows were both run. ## Risks **What could break:** a loose cache file is deleted only when `cache/` has one of the same name. It's a cache, so the worst case is the game making it again (a shader preparation, minutes). A log is never deleted. The records move only out of `cache/` into the game folder, never over a file there. **Turning it off:** revert the commit (the records then go back into `cache/` at the next start). **Compatibility:** after updating, `longshot_driver_faults.txt`, `longshot_prepare_skipped` and `longshot_load_start.txt` are back beside the game. The shader and pipeline caches are kept, not translated again. Saves, `longshot_options.ini` and the vk ABI don't change. ## Issues See #321 ## Checklist ### Everyone - [x] One topic. - [x] The title is a Conventional Commit (`type(scope): description`) of the status line's type. - [x] Why gives the reason plainly and links the issues that fit (the tracker searched). - [x] Measurements has a verdict, or one line saying why there is nothing to measure. - [x] Testing names what was tested, what wasn't, and what must still be tested, where and how. - [x] Rebased on current `main`. - [x] `python -I -B tests/run_all.py` passes (any failure that also fails on `main` is named). - [x] No game files, dumps, build output or generated files. - [x] `third_party/` untouched (a new folder with a `PROVENANCE.md` instead). - [x] The license is OK: GPL-3.0-or-later, nothing incompatible and nothing decompiled. ### When it applies - [x] AI assistance recorded with `Assisted-by:` / `Co-Authored-By:` trailers. - [x] A game-free test added for the fix, failing on `main` and passing here. - [x] A check under `tests/` that reads changed source updated in this PR, not weakened. - [x] Host code builds on both Windows (llvm-mingw) and Linux, with UTF-8 paths. - [x] Docs updated.
fix(game): what the game decided on this PC stays beside the settings, and a loose cache that cannot move is deleted
Some checks failed
PR description / Description follows the template (pull_request_target) Successful in 3s
Website / Website on Cloudflare (pull_request_target) Has been skipped
beanstalk/approval approved by HumanBean (reviewed)
beanstalk/linux 1/1 fail
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
Third-party parts / As their notes say (pull_request) Has been cancelled
Third-party parts / The same as upstream (pull_request) Has been cancelled
d82f2026a9
Review of #321. longshot_driver_faults.txt, longshot_prepare_skipped and
longshot_load_start.txt are no caches: the programs the driver faulted
on (re-asked, one froze AMD's Windows driver, issue 996), the player's
skipped preparation and the load mode this PC fell back to. In cache/,
which the README says can be deleted, a player clearing it would meet
the fault again. They are back in the game folder, and a folder #321
already moved has them moved back out (host/game_layout.c records).

A loose cache whose cache/ has its own could never move (its first move
failed, say a 7.8 GB longshot_programs.bin held open by an antivirus,
and the game then made a new one in cache/): it is deleted, and the log
says how much. A loose log is never deleted.

The docs whose commands named the state list's old place
(assets/pipeline_states/README.md, docs/development.md) give cache/;
the README says what cache/ holds besides caches and what stays out of
it; docs/development.md says what switching one game folder between a
build before #321 and one after it costs. Comments that still said
"beside the executable" name the folder.

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

@Beanstalk

@Beanstalk
Member

Beanstalk test farm

Commit a7f436b · tier untrusted · approved by nobody yet · dashboard

A member of BigBeans can review this commit and comment @Beanstalk to test it.

<!-- beanstalk:sticky --> ### Beanstalk test farm Commit `a7f436b` · tier **untrusted** · approved by nobody yet · [dashboard](https://beanstalk.magicbean.dev/prs/345) A member of `BigBeans` can review this commit and comment `@Beanstalk` to test it.
Merge remote-tracking branch 'origin/main' into fix/game-layout-followup
Some checks failed
beanstalk/approval not approved yet
PR description / Description follows the template (pull_request_target) Successful in 6s
CI / Conventional Commit title (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been cancelled
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been cancelled
CI / Workflow lint (actionlint) (pull_request) Has been cancelled
Guide screenshots / Guide images and local UI source review (pull_request) Has been cancelled
Third-party parts / As their notes say (pull_request) Has been cancelled
Third-party parts / The same as upstream (pull_request) Has been cancelled
Website / Website on Cloudflare (pull_request) Has been cancelled
4e5c009abf
HumanBean force-pushed fix/game-layout-followup from 4e5c009abf
Some checks failed
beanstalk/approval not approved yet
PR description / Description follows the template (pull_request_target) Successful in 6s
CI / Conventional Commit title (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been cancelled
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been cancelled
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been cancelled
CI / Workflow lint (actionlint) (pull_request) Has been cancelled
Guide screenshots / Guide images and local UI source review (pull_request) Has been cancelled
Third-party parts / As their notes say (pull_request) Has been cancelled
Third-party parts / The same as upstream (pull_request) Has been cancelled
Website / Website on Cloudflare (pull_request) Has been cancelled
to 38e83bbf8b
Some checks failed
Website / Website on Cloudflare (pull_request) Has been skipped
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_target) Has been skipped
PR description / Description follows the template (pull_request_target) Successful in 5s
CI / Workflow lint (actionlint) (pull_request) Successful in 6s
CI / Conventional Commit title (pull_request) Successful in 4s
Third-party parts / As their notes say (pull_request) Successful in 9s
Guide screenshots / Guide images and local UI source review (pull_request) Failing after 5s
beanstalk/approval not approved yet
2026-11-15 18:49:27 +00:00
Compare
Owner

Rebased onto main @ 7bacf846. The merge of main into the branch is dropped (the one commit now sits on main); one conflict in docs/development.md, the RX_VK_DRIVER_FAULTS row, where this PR's "(not in cache)" wording is kept and main's neighbouring rows stay as main has them. The diff is the same 11 files and line counts as before. No tests were run here; the test boxes stay yours.

Rebased onto `main` @ 7bacf846. The merge of main into the branch is dropped (the one commit now sits on main); one conflict in `docs/development.md`, the `RX_VK_DRIVER_FAULTS` row, where this PR's "(not in `cache`)" wording is kept and main's neighbouring rows stay as main has them. The diff is the same 11 files and line counts as before. No tests were run here; the test boxes stay yours.
Author
Contributor

Tested in the game on Linux and Windows, on 4e5c009a, this change on main of 2026-11-15. 38e83bbf is it rebased: thanks for the rebase. Both pass:

  • Linux (Fedora 45, RX 7800 XT, RADV): I updated a launcher-built folder from main (nightly-189) with this branch's AppImage and started it from the launcher.
    • Everything moved into cache/ and logs/, and nothing was left loose.
    • The game wrote its own log into logs/longshot_log.txt, with the run before rotated to .1.
    • The button prompts were made in cache/prompts/.
  • Windows: I updated a launcher-built folder with this branch's LongshotBuilder-…-windows-x64.zip (--cli --update) and played it. It works as on Linux.

The description now has both runs, and the Testing and Measured boxes are ticked.

Tested in the game on Linux and Windows, on 4e5c009a, this change on `main` of 2026-11-15. 38e83bbf is it rebased: thanks for the rebase. Both pass: - **Linux** (Fedora 45, RX 7800 XT, RADV): I updated a launcher-built folder from `main` (nightly-189) with this branch's AppImage and started it from the launcher. - Everything moved into `cache/` and `logs/`, and nothing was left loose. - The game wrote its own log into `logs/longshot_log.txt`, with the run before rotated to `.1`. - The button prompts were made in `cache/prompts/`. - **Windows**: I updated a launcher-built folder with this branch's `LongshotBuilder-…-windows-x64.zip` (`--cli --update`) and played it. It works as on Linux. The description now has both runs, and the Testing and Measured boxes are ticked.
lndf changed title from WIP: fix(game): what the game decided on this PC stays beside the settings, and a loose cache that cannot move is deleted to fix(game): what the game decided on this PC stays beside the settings, and a loose cache that cannot move is deleted 2026-11-15 20:30:46 +00:00
HumanBean left a comment

Read in full (code only, nothing run). The code does what the description says and I found no bug.

  • driver_faults_path, load_fallback_path and skipped_path now all resolve to game_folder_path(). The .waited strike goes through load_default::strike_*(load_fallback_path()), so it follows. state_list_prepare removes the same paths it used to, and the check in tests/test_load_default.py was updated rather than weakened.
  • hos_game_layout: records are moved back out of cache/ only when nothing is at the destination, so no file is overwritten. move_as deletes a loose cache only when cache/ has its own, and a log is never deleted. The kept and dropped counts match what tests/test_game_layout.py asserts. file_size is portable (GetFileAttributesExA / stat).
  • Linux and Windows in-game runs are posted by the author, so "Needs: none" holds.

One thing to fix before merge: the description says "the docs now give the right places", but four lines still send people to cache/ for the files this PR moves out of it (inline comments below). A player following the README would look in the wrong folder, and the shipped README would contradict the new "Where the files go" paragraph. I tried to push the four one-line fixes to the branch and the push was not allowed, so they are suggestions here.

Overlap: #737 and the other open progcache PRs touch only comment lines near this change in gpu/vk/vk_progcache.cpp, so expect trivial conflicts. #604 touches host/game_layout.c elsewhere.

Read in full (code only, nothing run). The code does what the description says and I found no bug. - `driver_faults_path`, `load_fallback_path` and `skipped_path` now all resolve to `game_folder_path()`. The `.waited` strike goes through `load_default::strike_*(load_fallback_path())`, so it follows. `state_list_prepare` removes the same paths it used to, and the check in `tests/test_load_default.py` was updated rather than weakened. - `hos_game_layout`: records are moved back out of `cache/` only when nothing is at the destination, so no file is overwritten. `move_as` deletes a loose cache only when `cache/` has its own, and a log is never deleted. The `kept` and `dropped` counts match what `tests/test_game_layout.py` asserts. `file_size` is portable (`GetFileAttributesExA` / `stat`). - Linux and Windows in-game runs are posted by the author, so "Needs: none" holds. One thing to fix before merge: the description says "the docs now give the right places", but four lines still send people to `cache/` for the files this PR moves out of it (inline comments below). A player following the README would look in the wrong folder, and the shipped README would contradict the new "Where the files go" paragraph. I tried to push the four one-line fixes to the branch and the push was not allowed, so they are suggestions here. Overlap: https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/737 and the other open progcache PRs touch only comment lines near this change in `gpu/vk/vk_progcache.cpp`, so expect trivial conflicts. https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/604 touches `host/game_layout.c` elsewhere.
Owner

Correction to my review above: the four stale lines are not in the diff, so they could not be inline comments. They are:

  • README.md line 363 (Intel steps): "If the game folder's cache folder has a longshot_prepare_skipped file" -> "If the game folder has a longshot_prepare_skipped file".
  • README.md line 367: "longshot_driver_faults.txt (in the cache folder)" -> "(in the game folder, not cache)".
  • README.md line 1143: "longshot_prepare_skipped file in its cache folder" -> "in the game folder".
  • docs/design.md line 267: "longshot_driver_faults.txt in the game folder's cache/" -> "in the game folder, not in cache/".
Correction to my review above: the four stale lines are not in the diff, so they could not be inline comments. They are: - `README.md` line 363 (Intel steps): "If the game folder's `cache` folder has a `longshot_prepare_skipped` file" -> "If the game folder has a `longshot_prepare_skipped` file". - `README.md` line 367: "`longshot_driver_faults.txt` (in the `cache` folder)" -> "(in the game folder, not `cache`)". - `README.md` line 1143: "`longshot_prepare_skipped` file in its `cache` folder" -> "in the game folder". - `docs/design.md` line 267: "longshot_driver_faults.txt in the game folder's cache/" -> "in the game folder, not in cache/".
Member

Review findings retained as an ordinary comment. I am following this PR as a watcher; another reviewer should make the final approval decision. The code findings and validation gaps below still need consideration.

Reviewed 38e83bbf8bfc2064a0eda53e3584d8eb91377a34. This keeps the PC's driver-fault decisions and preparation choices when caches are cleared, and removes obsolete loose caches. Request changes: the record migration needs a recoverable failure path.

  • [P1] Preserve the quarantine when moving its record fails — host/game_layout.c:148. On an update from the cache-folder layout, let cache/longshot_driver_faults.txt remain readable but make its rename fail (for example, deny rename through directory permissions, or hold it open without delete sharing on Windows). This loop silently continues. gpu/vk/vk_draw.cpp:1189–1202 now reads only the game-folder path, so the old record remains on disk but its keys are ignored and fault_quarantine() initializes empty. A known-faulting shader can therefore enter the driver again—the failure this PR intends to prevent. Preserve the readable record through a verified copy/publication fallback or have the reader use the old path until migration succeeds; report the failed migration. Add a fixture with a readable-but-unmovable record and verify that its keys still enter the quarantine. The new test currently covers successful migration only. The other three records also silently lose effect on a failed move.
  • [P2] Finish the troubleshooting path updates. HumanBean's four stale references remain at README.md:363, :367, :1143 and docs/design.md:267. There is also README.md:317, which tells players with a skipped preparation to delete the marker from cache/; after this change that action does not remove the marker the game actually reads, leaving shader preparation skipped. Update all five to the game folder.

The successful migration, loose-cache deletion and log-preservation paths otherwise match the description. Preparation removes both the fallback marker and its .waited companion through the relocated path.

Author-reported evidence includes Linux/RADV and Windows game runs on 4e5c009a, a Windows cross-build, and 511 game-free checks passing with 16 reported baseline failures. Those runs precede this rebase and do not exercise record-migration failure. Cached checks also show a failed guide/source-review check and pending Beanstalk approval; I have not diagnosed the CI failure.

The forge reports this head unmergeable. A read-only merge inspection confirms a conflict in the RX_VK_LOAD documentation row: retain current main's compute-fallback create default from PR 975 together with this PR's new marker location. PR 737 redirects pipeline notes to a shared shader store; retain this PR's explicit game-folder fallback path when combining them (land this fix first). PR 789, PR 902 and PR 903 change separate cache invalidation, diagnostics and saving paths, not this migration. No duplicate fix identified.

Code-only review: no builds, tests or runtime runs performed by this reviewer. No branch changes or fixes pushed.

Review findings retained as an ordinary comment. I am following this PR as a watcher; another reviewer should make the final approval decision. The code findings and validation gaps below still need consideration. Reviewed `38e83bbf8bfc2064a0eda53e3584d8eb91377a34`. This keeps the PC's driver-fault decisions and preparation choices when caches are cleared, and removes obsolete loose caches. **Request changes:** the record migration needs a recoverable failure path. - **[P1] Preserve the quarantine when moving its record fails — `host/game_layout.c:148`.** On an update from the cache-folder layout, let `cache/longshot_driver_faults.txt` remain readable but make its rename fail (for example, deny rename through directory permissions, or hold it open without delete sharing on Windows). This loop silently continues. `gpu/vk/vk_draw.cpp:1189–1202` now reads only the game-folder path, so the old record remains on disk but its keys are ignored and `fault_quarantine()` initializes empty. A known-faulting shader can therefore enter the driver again—the failure this PR intends to prevent. Preserve the readable record through a verified copy/publication fallback or have the reader use the old path until migration succeeds; report the failed migration. Add a fixture with a readable-but-unmovable record and verify that its keys still enter the quarantine. The new test currently covers successful migration only. The other three records also silently lose effect on a failed move. - **[P2] Finish the troubleshooting path updates.** HumanBean's four stale references remain at `README.md:363`, `:367`, `:1143` and `docs/design.md:267`. There is also `README.md:317`, which tells players with a skipped preparation to delete the marker from `cache/`; after this change that action does not remove the marker the game actually reads, leaving shader preparation skipped. Update all five to the game folder. The successful migration, loose-cache deletion and log-preservation paths otherwise match the description. Preparation removes both the fallback marker and its `.waited` companion through the relocated path. Author-reported evidence includes Linux/RADV and Windows game runs on `4e5c009a`, a Windows cross-build, and 511 game-free checks passing with 16 reported baseline failures. Those runs precede this rebase and do not exercise record-migration failure. Cached checks also show a failed guide/source-review check and pending Beanstalk approval; I have not diagnosed the CI failure. The forge reports this head unmergeable. A read-only merge inspection confirms a conflict in the `RX_VK_LOAD` documentation row: retain current main's compute-fallback `create` default from [PR 975](https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/975) together with this PR's new marker location. [PR 737](https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/737) redirects pipeline notes to a shared shader store; retain this PR's explicit game-folder fallback path when combining them (land this fix first). [PR 789](https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/789), [PR 902](https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/902) and [PR 903](https://git.magicbean.dev/MagicBeanDev/Longshot/pulls/903) change separate cache invalidation, diagnostics and saving paths, not this migration. No duplicate fix identified. Code-only review: no builds, tests or runtime runs performed by this reviewer. No branch changes or fixes pushed.
lndf force-pushed fix/game-layout-followup from 38e83bbf8b
Some checks failed
Website / Website on Cloudflare (pull_request) Has been skipped
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_target) Has been skipped
PR description / Description follows the template (pull_request_target) Successful in 5s
CI / Workflow lint (actionlint) (pull_request) Successful in 6s
CI / Conventional Commit title (pull_request) Successful in 4s
Third-party parts / As their notes say (pull_request) Successful in 9s
Guide screenshots / Guide images and local UI source review (pull_request) Failing after 5s
beanstalk/approval not approved yet
to a7f436bb61
Some checks are pending
CI / Conventional Commit title (pull_request) Blocked by required conditions
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Blocked by required conditions
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Blocked by required conditions
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Blocked by required conditions
CI / Workflow lint (actionlint) (pull_request) Blocked by required conditions
Guide screenshots / Guide images and local UI source review (pull_request) Blocked by required conditions
Third-party parts / As their notes say (pull_request) Blocked by required conditions
Third-party parts / The same as upstream (pull_request) Blocked by required conditions
Website / Website on Cloudflare (pull_request) Blocked by required conditions
beanstalk/approval not approved yet
PR description / Description follows the template (pull_request_target) Successful in 4s
2026-11-16 16:31:13 +00:00
Compare
Author
Contributor

Thanks both. Rebased onto main @ 71b1edd8, keeping PR 975's RX_VK_LOAD default with this PR's marker location.

bibiburl's P1 is fixed in a7f436bb. A record that can't be renamed out of cache/ is copied out whole (through a .tmp renamed into place) and logged, and one that can't be read either is named in the log. tests/test_game_layout.py covers it with a read-only cache/: without the fix the driver's faults never reach the game folder, with it they arrive whole.

The five stale doc lines (HumanBean's four and README.md:317) now name the game folder.

The Linux and Windows runs were on 4e5c009a, before this fix. The fix only touches the failure path, and I'll rerun once it's in.

Thanks both. Rebased onto `main` @ 71b1edd8, keeping PR 975's `RX_VK_LOAD` default with this PR's marker location. bibiburl's P1 is fixed in a7f436bb. A record that can't be renamed out of `cache/` is copied out whole (through a `.tmp` renamed into place) and logged, and one that can't be read either is named in the log. `tests/test_game_layout.py` covers it with a read-only `cache/`: without the fix the driver's faults never reach the game folder, with it they arrive whole. The five stale doc lines (HumanBean's four and `README.md:317`) now name the game folder. The Linux and Windows runs were on 4e5c009a, before this fix. The fix only touches the failure path, and I'll rerun once it's in.
Some checks are pending
CI / Conventional Commit title (pull_request) Blocked by required conditions
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Blocked by required conditions
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Blocked by required conditions
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Blocked by required conditions
CI / Workflow lint (actionlint) (pull_request) Blocked by required conditions
Guide screenshots / Guide images and local UI source review (pull_request) Blocked by required conditions
Third-party parts / As their notes say (pull_request) Blocked by required conditions
Third-party parts / The same as upstream (pull_request) Blocked by required conditions
Website / Website on Cloudflare (pull_request) Blocked by required conditions
beanstalk/approval not approved yet
PR description / Description follows the template (pull_request_target) Successful in 4s
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/game-layout-followup:lndf-fix/game-layout-followup'
git switch 'lndf-fix/game-layout-followup'
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
4 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!345
No description provided.