feat(mods)!: mods ship ReShade presets and load while the game runs, and copied mods start off #3105

Merged
HumanBean merged 3 commits from HumanBean/Longshot:feat/mods-reshade-live into main 2026-12-03 21:36:10 +00:00
Owner

Summary

Three related changes to mods.

1. Mods can ship ReShade presets. A mod with the gfx.shader permission and a reshade/ folder adds its presets to
the ReShade preset row, with no code. Longshot's 25 presets move out of C++ headers into the built-in mod
system/reshade-presets, in the same layout. Presets, shaders and textures reload while the game runs; an edit that
does not compile keeps the effect already on screen. The choice is saved by id; choices saved before are converted.

2. Mods of scripts or ReShade presets can be added and removed while the game runs. Mods with code, their own save
folder, a game language, game files, textures or the emulators' layout still apply at the next start, and the Mods tab
says why and offers Restart now.

3. A mod copied into mods/ by hand starts off. Emulator-layout mods used to start on. The first time Longshot goes
through a profile's mods, each one already there keeps its switch; only mods copied in after that start off. Installing
through Longshot still switches a mod on. The switch of a hand-copied mod is now written to profile.json, so it
survives a confined game, which used to drop it.

Read first: game/crates/api/src/reshade.rs, game/crates/api/src/loader/arrive.rs,
game/crates/modtool/src/record.rs, gpu/vk/reshade/fx_packs.cpp and fx_runtime.cpp. One commit per change.

Known gaps:

  • Mods copied into a new profile before its first build or play start as they did before (emulator-layout mods on).
  • On each change the game side still reads every preset pack's files again; the renderer keeps unchanged packs.
  • A switch is remembered by id or folder, so a different mod later put under the same name inherits it.
  • A preset picked in the instant the list changes can land on its neighbour.
  • Compare ReShade Preset is broken on main (the toolbar is still the old C++ drawing) and is not fixed here.
  • Possible overlap with open #2911 (live ReShade editor, also under gpu/vk/reshade/) and #3021 (profile.json
    writes under the edit lock).

Testing

Tested: one headless game run on the head (582d285dbb39, on main @ 76092c5e), Linux, NVIDIA RTX 3090, driver
620.70.06, from a repository save, with a test mod of presets alone:

  • its preset showed (a red tint); editing its shader turned the picture green; a broken edit logged error X3000 and
    kept the green effect; fixing it turned it blue;
  • switching the mod off in profile.json removed the tint and back on restored it; deleting its folder removed it and
    copying it back restored it, with no restart;
  • a second presets mod copied in during play was listed in the Mods tab as Off, with no restart offered; an
    emulator-layout folder copied in was listed as Off, with Restart now offered.

Checks, Linux, no full suite. After the rebase: cargo test of api, longshot-game, host-sys, schema,
build-compile, build-driver, launcher-profile and modtool passes (2 ignored), as do reshade_hot_reload,
i18n_complete and menu_ini_keys. cargo clippy and cargo fmt --check report only
builder/crates/build-core, which this PR does not touch. Before the rebase: cargo test of api, longshot-game, host-sys, schema, build-compile,
build-driver, launcher-profile and modtool (without its stand-in game tests); cargo clippy -D warnings of the
same; cargo fmt --check; schema-gen and ffi-gen --check; the Python checks that read the changed files
(reshade_hot_reload with g++ and clang++, reshade_fx, program_hooks, i18n_complete, menu_i18n and others);
the system mods' TypeScript tests except menu's; llvm-mingw syntax checks of the changed C and C++ files.
the_typescript_system_mods_pass_their_tests does not finish on main either (stuck in menu's tests after 10
minutes).

After the review fixes: the api crate's tests, modtool's record tests, build-driver's tests,
reshade_hot_reload (g++ and clang++) and a llvm-mingw syntax check of fx_packs.cpp and fx_runtime.cpp.

Still to test:

  • Windows, any GPU: add, edit, switch and remove a presets mod while the game runs, including files moved (not copied)
    into mods/, which may not inherit the sandbox's permission; expecting each to apply without a restart (by hand).
  • Linux, started with no mods/ folder: add one while the game runs; the sandbox may not grant it (by hand).
  • A store install and a .lsmod while the game runs; a mod switched from the Mods tab; a script mod's permission
    prompt for a late mod (by hand).
  • An existing profile with emulator-layout mods, updated: expecting each to keep its switch (by hand).
  • A full game build through the builder (by hand).

Measurements

Nothing to measure: no change aims at speed.

A preset list change recompiles the preset in use only when its own pack's files changed. No switch is added:
HOS_MOD_TESTS, which a new line reads, is the existing test mode's.

Risks

  • Players: a hand-copied emulator mod no longer switches itself on. profile.json gains mods_recorded and
    copied keys. After recording, mod remove mods/<folder> is refused for a recorded copy (remove it by id). The
    saved ReShade choice becomes an id, so going back to an older Longshot loses it.
  • Mod authors: mods can now appear after the game starts, so a script that looks for an optional dependency once
    does not see a late one. MKWVK_API_VERSION is 90.
  • Mod shaders run on the player's GPU with no time budget (gfx.effect has one); chosen deliberately for now.
  • A mod of presets alone is asked for no permission, as texture packs are not.
  • The last round of review fixes on changes 2 and 3 has not been reviewed again.
  • No switch turns this off; reverting is enough, apart from the keys and saved ids above.

Checklist

Ready for review

  • One topic, on current main; the title is a Conventional Commit. (Three related topics in one on purpose.)
  • Tested on my own PC, in the game for a change the game runs, as Testing says.
  • mise run test passes. (Not run on this branch.)
  • 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 check under tests/ that reads changed source is updated, not weakened.
  • MKWVK_API_VERSION bumped (MkwVkHost or MkwVkRenderer in gpu/vk/vk_api.h changed).
  • Host code builds on Windows (llvm-mingw) and Linux, with UTF-8 paths. (Linux built; Windows syntax-checked only.)
  • Screenshots of the same spot on main and here, for a change that shows on screen. (Not taken.)
  • Docs updated.
  • AI assistance recorded with Assisted-by: / Co-Authored-By: trailers.

Ready to merge

  • Everything in Still to test has run, its results in Tested.
  • Tier 1 hardware it can affect is tested (docs/dev/standards.md, "Hardware tiers").
  • Approved in review, every comment answered.
  • CI passes on the head; on current main, measured again or a comment says why the numbers still hold.

🤖 Generated with Claude Code

https://claude.ai/code/session_017vw8e1rSeTzGtqzZNG1YZH

## Summary Three related changes to mods. **1. Mods can ship ReShade presets.** A mod with the `gfx.shader` permission and a `reshade/` folder adds its presets to the **ReShade preset** row, with no code. Longshot's 25 presets move out of C++ headers into the built-in mod `system/reshade-presets`, in the same layout. Presets, shaders and textures reload while the game runs; an edit that does not compile keeps the effect already on screen. The choice is saved by id; choices saved before are converted. **2. Mods of scripts or ReShade presets can be added and removed while the game runs.** Mods with code, their own save folder, a game language, game files, textures or the emulators' layout still apply at the next start, and the Mods tab says why and offers **Restart now**. **3. A mod copied into `mods/` by hand starts off.** Emulator-layout mods used to start on. The first time Longshot goes through a profile's mods, each one already there keeps its switch; only mods copied in after that start off. Installing through Longshot still switches a mod on. The switch of a hand-copied mod is now written to `profile.json`, so it survives a confined game, which used to drop it. Read first: `game/crates/api/src/reshade.rs`, `game/crates/api/src/loader/arrive.rs`, `game/crates/modtool/src/record.rs`, `gpu/vk/reshade/fx_packs.cpp` and `fx_runtime.cpp`. One commit per change. Known gaps: - Mods copied into a new profile before its first build or play start as they did before (emulator-layout mods on). - On each change the game side still reads every preset pack's files again; the renderer keeps unchanged packs. - A switch is remembered by id or folder, so a different mod later put under the same name inherits it. - A preset picked in the instant the list changes can land on its neighbour. - Compare ReShade Preset is broken on `main` (the toolbar is still the old C++ drawing) and is not fixed here. - Possible overlap with open #2911 (live ReShade editor, also under `gpu/vk/reshade/`) and #3021 (`profile.json` writes under the edit lock). ## Testing **Tested:** one headless game run on the head (`582d285dbb39`, on `main` @ `76092c5e`), Linux, NVIDIA RTX 3090, driver 620.70.06, from a repository save, with a test mod of presets alone: - its preset showed (a red tint); editing its shader turned the picture green; a broken edit logged `error X3000` and kept the green effect; fixing it turned it blue; - switching the mod off in `profile.json` removed the tint and back on restored it; deleting its folder removed it and copying it back restored it, with no restart; - a second presets mod copied in during play was listed in the Mods tab as **Off**, with no restart offered; an emulator-layout folder copied in was listed as **Off**, with **Restart now** offered. Checks, Linux, no full suite. After the rebase: `cargo test` of `api`, `longshot-game`, `host-sys`, `schema`, `build-compile`, `build-driver`, `launcher-profile` and `modtool` passes (2 ignored), as do `reshade_hot_reload`, `i18n_complete` and `menu_ini_keys`. `cargo clippy` and `cargo fmt --check` report only `builder/crates/build-core`, which this PR does not touch. Before the rebase: `cargo test` of `api`, `longshot-game`, `host-sys`, `schema`, `build-compile`, `build-driver`, `launcher-profile` and `modtool` (without its stand-in game tests); `cargo clippy -D warnings` of the same; `cargo fmt --check`; `schema-gen` and `ffi-gen --check`; the Python checks that read the changed files (`reshade_hot_reload` with g++ and clang++, `reshade_fx`, `program_hooks`, `i18n_complete`, `menu_i18n` and others); the system mods' TypeScript tests except `menu`'s; llvm-mingw syntax checks of the changed C and C++ files. `the_typescript_system_mods_pass_their_tests` does not finish on `main` either (stuck in `menu`'s tests after 10 minutes). After the review fixes: the `api` crate's tests, `modtool`'s `record` tests, `build-driver`'s tests, `reshade_hot_reload` (g++ and clang++) and a llvm-mingw syntax check of `fx_packs.cpp` and `fx_runtime.cpp`. **Still to test:** - Windows, any GPU: add, edit, switch and remove a presets mod while the game runs, including files moved (not copied) into `mods/`, which may not inherit the sandbox's permission; expecting each to apply without a restart (by hand). - Linux, started with no `mods/` folder: add one while the game runs; the sandbox may not grant it (by hand). - A store install and a `.lsmod` while the game runs; a mod switched from the Mods tab; a script mod's permission prompt for a late mod (by hand). - An existing profile with emulator-layout mods, updated: expecting each to keep its switch (by hand). - A full game build through the builder (by hand). ## Measurements Nothing to measure: no change aims at speed. A preset list change recompiles the preset in use only when its own pack's files changed. No switch is added: `HOS_MOD_TESTS`, which a new line reads, is the existing test mode's. ## Risks - **Players:** a hand-copied emulator mod no longer switches itself on. `profile.json` gains `mods_recorded` and `copied` keys. After recording, `mod remove mods/<folder>` is refused for a recorded copy (remove it by id). The saved ReShade choice becomes an id, so going back to an older Longshot loses it. - **Mod authors:** mods can now appear after the game starts, so a script that looks for an optional dependency once does not see a late one. `MKWVK_API_VERSION` is 90. - **Mod shaders** run on the player's GPU with no time budget (`gfx.effect` has one); chosen deliberately for now. - A mod of presets alone is asked for no permission, as texture packs are not. - The last round of review fixes on changes 2 and 3 has not been reviewed again. - No switch turns this off; reverting is enough, apart from the keys and saved ids above. ## Checklist ### Ready for review - [ ] One topic, on current `main`; the title is a Conventional Commit. (Three related topics in one on purpose.) - [x] Tested on my own PC, in the game for a change the game runs, as Testing says. - [ ] `mise run test` passes. (Not run on this branch.) - [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 check under `tests/` that reads changed source is updated, not weakened. - [x] `MKWVK_API_VERSION` bumped (`MkwVkHost` or `MkwVkRenderer` in `gpu/vk/vk_api.h` changed). - [ ] Host code builds on Windows (llvm-mingw) and Linux, with UTF-8 paths. (Linux built; Windows syntax-checked only.) - [ ] Screenshots of the same spot on `main` and here, for a change that shows on screen. (Not taken.) - [x] Docs updated. - [x] AI assistance recorded with `Assisted-by:` / `Co-Authored-By:` trailers. ### Ready to merge - [ ] Everything in Still to test has run, its results in Tested. - [ ] Tier 1 hardware it can affect is tested (docs/dev/standards.md, "Hardware tiers"). - [ ] Approved in review, every comment answered. - [ ] CI passes on the head; on current `main`, measured again or a comment says why the numbers still hold. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_017vw8e1rSeTzGtqzZNG1YZH
A mod with gfx.shader and a reshade/ folder (presets, shaders, textures)
adds its presets to the ReShade preset row. Longshot's 25 presets move
from C++ headers into system/reshade-presets, in the same layout. The
game hands the files to the renderer from memory (MKWVK_API_VERSION 90).

Presets are read again while the game runs: an edit under a folder mod's
reshade/, a mod's switch, a folder removed. A mod of presets alone
switches with no restart. The preset in use is found by its id and
compiled again; until it is ready, or when it does not compile, the
effect before stays. A mod added to the game still shows at the next
start, as every mod does.

The choice is saved by id (reshade_preset=<mod>:<preset>, off, user);
numbers and names saved before are converted.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e1rSeTzGtqzZNG1YZH
A folder or .lsmod put in or taken out of the profile's mods/, and a store
pin added to or dropped from profile.json, joins or leaves the running game
when it brings only scripts or ReShade presets. Rows are appended and
dropped, never reordered, and the live ones count for no restart question.

Mods with code, their own saves, a game language, game files, textures or
the emulators' layout get a row too and wait for the next start, with
Restart now offered and the tab saying why.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e1rSeTzGtqzZNG1YZH
feat(mods)!: a mod copied in by hand starts off
Some checks failed
PR description / Title and description (pull_request_target) Has been cancelled
CI / What the change needs (pull_request) Has been cancelled
CI / Lint (pre-commit, ShellCheck, actionlint) (pull_request) Has been cancelled
CI / Third-party parts and guide screenshots (pull_request) Has been cancelled
CI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request) Has been cancelled
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Has been cancelled
CI / Renderer build check (Windows, compile --only renderer, without and with FSR 4) (pull_request) Has been cancelled
CI / Renderer build check (Linux, compile --only renderer, without and with FSR 4) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 1/2) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 2/2) (pull_request) Has been cancelled
CI / Website build and checks (pull_request) Has been cancelled
ed5522ef01
A mod put into a profile's mods/ by hand now starts off, in an emulator's
layout too, which used to start on, also when it is copied in while the
game runs. Installing through Longshot (mod add, mod import, a source)
switches it on as before.

The builder writes the mods the list does not name into profile.json
before a build or play, before mod enable, disable and order, and before
it takes the game's set_mods, so that a switch of one is kept: the
confined game's switch of a mod the list did not name was dropped. The
first time, in a profile that has been played (a game started, a save, or
a setting besides the language), each keeps the switch it had.

The messages that said every mod is on with an unreadable list now say
the switches are not read: manifest mods were off then.

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

Tested in game: RTX 3090, driver 620.70.06, Linux, headless, before the rebase: reached play, built-in presets loaded, mods switched, removed and added live. Mod presets not exercised.

Tested in game: RTX 3090, driver 620.70.06, Linux, headless, before the rebase: reached play, built-in presets loaded, mods switched, removed and added live. Mod presets not exercised.
HumanBean changed title from WIP: feat(mods)!: mods ship ReShade presets and load while the game runs, and copied mods start off to feat(mods)!: mods ship ReShade presets and load while the game runs, and copied mods start off 2026-12-03 19:45:25 +00:00
Author
Owner
@review
BeanBot left a comment

Recommendation: Approve. An unreadable preset folder can remove the active effect, and the profile migration can disable previously active mods. The new preset workflow also has not been exercised in game on this head. Nothing blocking is left: what remains is for the author before merging (below). Recommend approval; not approved on the forge.

The change adds mod-provided ReShade presets and live mod discovery, and records manually copied mods so their switches persist. It also changes migration and reload behavior across the builder, game and renderer, with correctness and validation gaps.

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

  • L1 game/crates/api/src/loader/mod.rs:3510: A directory read failure is treated as an empty directory, bypassing the path that preserves the previous presets. (more on the line) Do: Propagate directory listing errors to keep_presets, and distinguish an intentionally removed directory from an unreadable one.
  • L2 game/crates/modtool/src/record.rs:38: The migration guesses whether an existing profile was played and can permanently record previously enabled emulator-layout mods as off. (more on the line) Do: Use a reliable migration marker or preserve existing emulator mod behavior when the profile's history is ambiguous, while marking newly copied mods separately.
  • L3 tests/test_reshade_hot_reload.py:19: The new test forces g++ instead of using the compiler selected by the test runner. (more on the line) Do: Use the runner's {cxx} placeholder and honor CXX for direct invocation.

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

  • L4: The new mod-preset and live-loading paths need game runs on the current head and the supported systems they affect. When: The only reported run predates the rebase and its test preset mod was rejected, so it did not show a mod preset compiling, surviving a broken edit, or reloading after removal and reinstallation. Do: Run the listed live preset, script, store and migration scenarios on the current head, including Windows and the affected Tier 1 hardware; record results and screenshots.
  • L5: The cost of gathering and copying preset packs and recompiling the selected effect has not been measured. When: A large enabled preset pack is read and copied when the list changes, and the active preset is recompiled; the impact on frame pacing and memory is unknown. Do: Compare frame times and RAM on the base and this head during startup and a representative live preset edit, with repeated runs. (@fix does its part first: Avoid copying unchanged pack contents and avoid recompiling the active preset when its inputs did not change.)

@fix can do L1, L2, L3 and L5.

Checks: Still running: 11 checks.

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

Does it help: Unproven. The reported pre-rebase Linux run loaded built-in presets and exercised some live mod changes, but did not exercise mod presets; there is no game run on the current head and no performance measurements.

Other systems: The changes affect Windows and Linux file access, profile migration, builder launches, script permissions, renderer compilation and GPU resource lifetime. Windows, AMD, Steam Deck, store installs and live preset edits remain untested in the reported runs.

Switches: No switch added or changed. The new read of HOS_MOD_TESTS uses the existing test-mode switch.

Reviewed: ed5522ef01 against 0aeb685893: Read the repository rules, PR template, commit messages, key preset and mod-arrival paths, preset ABI, memory-backed file access, profile recording, relevant settings changes and the new hot-reload test. Skimmed the diff and standards. The full set of changed code, generated files, translations and preset assets was not completely reviewed; ../Tooling/AGENTS.md and docs/review-checklist.md were absent.; nothing run (a code review).

Checked and fine:

  • All three commits include AI assistance trailers.
  • The renderer API version is bumped for the changed host interface.
  • The reported CI has no failure specific to this head.

Testing: No code, scripts or tests were run, as requested. The author's reported run and checks are described in the pull request; CI is still running.

Overlaps and merge order: The description identifies possible overlaps with #2911 and #3021; their current diffs and merge order could not be checked offline.


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

**Recommendation: Approve.** An unreadable preset folder can remove the active effect, and the profile migration can disable previously active mods. The new preset workflow also has not been exercised in game on this head. Nothing blocking is left: what remains is for the author before merging (below). Recommend approval; not approved on the forge. The change adds mod-provided ReShade presets and live mod discovery, and records manually copied mods so their switches persist. It also changes migration and reload behavior across the builder, game and renderer, with correctness and validation gaps. **Should fix (3)**: not blocking, but worth doing before merging. - **L1** `game/crates/api/src/loader/mod.rs:3510`: A directory read failure is treated as an empty directory, bypassing the path that preserves the previous presets. (more on the line) **Do:** Propagate directory listing errors to keep_presets, and distinguish an intentionally removed directory from an unreadable one. - **L2** `game/crates/modtool/src/record.rs:38`: The migration guesses whether an existing profile was played and can permanently record previously enabled emulator-layout mods as off. (more on the line) **Do:** Use a reliable migration marker or preserve existing emulator mod behavior when the profile's history is ambiguous, while marking newly copied mods separately. - **L3** `tests/test_reshade_hot_reload.py:19`: The new test forces g++ instead of using the compiler selected by the test runner. (more on the line) **Do:** Use the runner's {cxx} placeholder and honor CXX for direct invocation. **Testing before merging (2)** (runs on the systems it can change; it doesn't hold the recommendation) - **L4**: The new mod-preset and live-loading paths need game runs on the current head and the supported systems they affect. *When:* The only reported run predates the rebase and its test preset mod was rejected, so it did not show a mod preset compiling, surviving a broken edit, or reloading after removal and reinstallation. **Do:** Run the listed live preset, script, store and migration scenarios on the current head, including Windows and the affected Tier 1 hardware; record results and screenshots. - **L5**: The cost of gathering and copying preset packs and recompiling the selected effect has not been measured. *When:* A large enabled preset pack is read and copied when the list changes, and the active preset is recompiled; the impact on frame pacing and memory is unknown. **Do:** Compare frame times and RAM on the base and this head during startup and a representative live preset edit, with repeated runs. *(`@fix` does its part first: Avoid copying unchanged pack contents and avoid recompiling the active preset when its inputs did not change.)* `@fix` can do L1, L2, L3 and L5. **Checks:** Still running: 11 checks. <details> <summary>More: does it help, other systems, switches, what was read</summary> **Does it help:** Unproven. The reported pre-rebase Linux run loaded built-in presets and exercised some live mod changes, but did not exercise mod presets; there is no game run on the current head and no performance measurements. **Other systems:** The changes affect Windows and Linux file access, profile migration, builder launches, script permissions, renderer compilation and GPU resource lifetime. Windows, AMD, Steam Deck, store installs and live preset edits remain untested in the reported runs. **Switches:** No switch added or changed. The new read of HOS_MOD_TESTS uses the existing test-mode switch. **Reviewed:** ed5522ef013b against 0aeb68589358: Read the repository rules, PR template, commit messages, key preset and mod-arrival paths, preset ABI, memory-backed file access, profile recording, relevant settings changes and the new hot-reload test. Skimmed the diff and standards. The full set of changed code, generated files, translations and preset assets was not completely reviewed; ../Tooling/AGENTS.md and docs/review-checklist.md were absent.; nothing run (a code review). **Checked and fine:** - All three commits include AI assistance trailers. - The renderer API version is bumped for the changed host interface. - The reported CI has no failure specific to this head. **Testing:** No code, scripts or tests were run, as requested. The author's reported run and checks are described in the pull request; CI is still running. **Overlaps and merge order:** The description identifies possible overlaps with #2911 and #3021; their current diffs and merge order could not be checked offline. </details> --- <sub>Automated code review by BeanBot (gpt-6.1-terra), asked for by HumanBean. Nothing was run; a maintainer decides.</sub>
@ -3307,0 +3507,4 @@
let mut folders = vec![String::from("reshade")];
let mut seen = 0usize;
while let Some(folder) = folders.pop() {
for e in disk.list(&root.join(&folder)).unwrap_or_default() {
Member

L1 (should fix): A directory read failure is treated as an empty directory, bypassing the path that preserves the previous presets.

When: If an enabled mod's reshade directory becomes temporarily unreadable during a reload, reshade_files returns an empty pack; the caller drops the pack and the selected effect is turned off instead of retaining its previous files.

Do: Propagate directory listing errors to keep_presets, and distinguish an intentionally removed directory from an unreadable one.

**L1** (should fix): A directory read failure is treated as an empty directory, bypassing the path that preserves the previous presets. *When:* If an enabled mod's reshade directory becomes temporarily unreadable during a reload, reshade_files returns an empty pack; the caller drops the pack and the selected effect is turned off instead of retaining its previous files. **Do:** Propagate directory listing errors to keep_presets, and distinguish an intentionally removed directory from an unreadable one.
@ -0,0 +35,4 @@
Err(_) => false,
})
})
}
Member

L2 (should fix): The migration guesses whether an existing profile was played and can permanently record previously enabled emulator-layout mods as off.

When: A player who used Longshot before the mod API, has no save and changed no setting has none of these markers. On the first build or play after updating, the existing emulator mods are recorded off and no longer apply.

Do: Use a reliable migration marker or preserve existing emulator mod behavior when the profile's history is ambiguous, while marking newly copied mods separately.

**L2** (should fix): The migration guesses whether an existing profile was played and can permanently record previously enabled emulator-layout mods as off. *When:* A player who used Longshot before the mod API, has no save and changed no setting has none of these markers. On the first build or play after updating, the existing emulator mods are recorded off and no longer apply. **Do:** Use a reliable migration marker or preserve existing emulator mod behavior when the profile's history is ambiguous, while marking newly copied mods separately.
@ -0,0 +16,4 @@
sys.path.insert(0, str(Path(__file__).resolve().parent)) # (python -I leaves the check's own folder off the path)
from srccut import block # noqa: E402
RUN_ALL_ARGS = ["--cxx", "g++"]
Member

L3 (should fix): The new test forces g++ instead of using the compiler selected by the test runner.

When: On a supported setup with only Clang or LLVM-MinGW, run_all cannot use its selected CXX for this check and skips or fails it because g++ is unavailable.

Do: Use the runner's {cxx} placeholder and honor CXX for direct invocation.

**L3** (should fix): The new test forces g++ instead of using the compiler selected by the test runner. *When:* On a supported setup with only Clang or LLVM-MinGW, run_all cannot use its selected CXX for this check and skips or fails it because g++ is unavailable. **Do:** Use the runner's {cxx} placeholder and honor CXX for direct invocation.
HumanBean force-pushed feat/mods-reshade-live from ed5522ef01
Some checks failed
PR description / Title and description (pull_request_target) Has been cancelled
CI / What the change needs (pull_request) Has been cancelled
CI / Lint (pre-commit, ShellCheck, actionlint) (pull_request) Has been cancelled
CI / Third-party parts and guide screenshots (pull_request) Has been cancelled
CI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request) Has been cancelled
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Has been cancelled
CI / Renderer build check (Windows, compile --only renderer, without and with FSR 4) (pull_request) Has been cancelled
CI / Renderer build check (Linux, compile --only renderer, without and with FSR 4) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 1/2) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 2/2) (pull_request) Has been cancelled
CI / Website build and checks (pull_request) Has been cancelled
to 35c9529d95
Some checks failed
PR description / Title and description (pull_request_target) Has been cancelled
CI / What the change needs (pull_request) Has been cancelled
CI / Lint (pre-commit, ShellCheck, actionlint) (pull_request) Has been cancelled
CI / Third-party parts and guide screenshots (pull_request) Has been cancelled
CI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request) Has been cancelled
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Has been cancelled
CI / Renderer build check (Windows, compile --only renderer, without and with FSR 4) (pull_request) Has been cancelled
CI / Renderer build check (Linux, compile --only renderer, without and with FSR 4) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 1/2) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 2/2) (pull_request) Has been cancelled
CI / Website build and checks (pull_request) Has been cancelled
2026-12-03 19:55:22 +00:00
Compare
Author
Owner

Review fixes pushed, folded into the commits they belong to.

  • L1: a reshade/ folder that is there and cannot be listed is now an error, so the presets before are kept. A test makes one unreadable (it failed before the fix).
  • L2: the guess about whether a profile was played is gone. The first time, every mod already there keeps its switch; only mods copied in later start off. The cost: mods copied into a new profile before its first build start as they did before.
  • L3: the test uses the runner's {cxx}, and CXX when run directly.
  • L4: still open. A game run on this head is waiting for the build queue. Windows, AMD and Steam Deck stay untested.
  • L5: the renderer keeps an unchanged pack's files and does not recompile the preset in use when its pack did not change, also when another mod moves its place. The game side still reads the packs' files again on each change. Not measured.

🤖 Generated with Claude Code

https://claude.ai/code/session_017vw8e1rSeTzGtqzZNG1YZH

Review fixes pushed, folded into the commits they belong to. - **L1**: a `reshade/` folder that is there and cannot be listed is now an error, so the presets before are kept. A test makes one unreadable (it failed before the fix). - **L2**: the guess about whether a profile was played is gone. The first time, every mod already there keeps its switch; only mods copied in later start off. The cost: mods copied into a new profile before its first build start as they did before. - **L3**: the test uses the runner's `{cxx}`, and `CXX` when run directly. - **L4**: still open. A game run on this head is waiting for the build queue. Windows, AMD and Steam Deck stay untested. - **L5**: the renderer keeps an unchanged pack's files and does not recompile the preset in use when its pack did not change, also when another mod moves its place. The game side still reads the packs' files again on each change. Not measured. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_017vw8e1rSeTzGtqzZNG1YZH
HumanBean force-pushed feat/mods-reshade-live from 35c9529d95
Some checks failed
PR description / Title and description (pull_request_target) Has been cancelled
CI / What the change needs (pull_request) Has been cancelled
CI / Lint (pre-commit, ShellCheck, actionlint) (pull_request) Has been cancelled
CI / Third-party parts and guide screenshots (pull_request) Has been cancelled
CI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request) Has been cancelled
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Has been cancelled
CI / Renderer build check (Windows, compile --only renderer, without and with FSR 4) (pull_request) Has been cancelled
CI / Renderer build check (Linux, compile --only renderer, without and with FSR 4) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 1/2) (pull_request) Has been cancelled
CI / Game-free checks (run_all.py, part 2/2) (pull_request) Has been cancelled
CI / Website build and checks (pull_request) Has been cancelled
to 582d285dbb
Some checks failed
CI / What the change needs (pull_request) Successful in 8s
CI / Third-party parts and guide screenshots (pull_request) Successful in 11s
PR description / Title and description (pull_request_target) Failing after 8s
CI / Lint (pre-commit, ShellCheck, actionlint) (pull_request) Successful in 21s
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Failing after 1m20s
CI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request) Failing after 10m41s
CI / Renderer build check (Linux, compile --only renderer, without and with FSR 4) (pull_request) Successful in 11m48s
CI / Renderer build check (Windows, compile --only renderer, without and with FSR 4) (pull_request) Successful in 12m13s
CI / Website build and checks (pull_request) Failing after 1m9s
CI / Game-free checks (run_all.py, part 2/2) (pull_request) Failing after 49m14s
CI / Game-free checks (run_all.py, part 1/2) (pull_request) Failing after 1h0m5s
2026-12-03 20:35:22 +00:00
Compare
Author
Owner
@review
BeanBot left a comment

Recommendation: Approve. The code is ready: only testing is left. The live-loading and mod-preset paths still need game runs on the current head, and the cost of rebuilding preset lists remains unmeasured. Recommend approval; not approved on the forge.

The change lets mods provide ReShade presets and load some content during play, while preserving existing emulator-mod switches during migration. The renderer now reuses unchanged packs, though the game still rereads them on each change.

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

  • L4: The new mod-preset and live-loading paths need game runs on the current head and the supported systems they affect. When: The only reported run predates the rebase and its test preset mod was rejected, so it did not show a mod preset compiling, surviving a broken edit, or reloading after removal and reinstallation. Do: Run the listed live preset, script, store and migration scenarios on the current head, including Windows and the affected Tier 1 hardware; record results and screenshots.
  • L5: The remaining cost of rebuilding the preset list has not been measured. When: A mod change rereads preset files on the game side and hashes each pack in the renderer; its effect on play-time latency is unknown. Do: Measure list-update time and frame pacing during representative mod and preset edits on the current head. (@fix does its part first: Avoid copying unchanged pack contents and avoid recompiling the active preset when its inputs did not change.)

@fix can do L5.

Since the last review (on ed5522ef01)
Resolved: L1 (A directory read failure is treated as an empty directory, bypassing the path that preserv…); L2 (The migration guesses whether an existing profile was played and can permanently record pr…); L3 (The new test forces g++ instead of using the compiler selected by the test runner.)
Still open: L4 (The new mod-preset and live-loading paths need game runs on the current head and the suppo…); L5 (The remaining cost of rebuilding the preset list has not been measured.)

Checks: Still running: 11 checks.

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

Does it help: Unproven. The reported Linux NVIDIA run predates the rebase and did not exercise a mod preset; there are no measurements of preset-list update cost.

Other systems: Windows, AMD and Steam Deck remain untested. The change affects renderer pack lifetime, shader compilation, mod loading and profile migration; the reported headless run does not cover those paths end to end on the current head.

Switches: No switch added or changed. The new read of HOS_MOD_TESTS uses the existing test mode.

Reviewed: 582d285dbb against 76092c5e5a: Read AGENTS.md, CONTRIBUTING.md, record.rs, fx_packs.cpp and fx_packs.h in full; inspected the relevant loader, runtime, test and profile-migration sections and the change summary. The remaining changed files, generated assets and translations were not read in full.; nothing run (a code review).

Checked and fine:

  • The compiler selection follows the test runner and respects CXX for direct invocation.
  • The migration preserves previously enabled emulator-layout mods on first recording.

Testing: No commands that build or run project code were executed. The author reports game-free checks after the fixes; CI is still running, and the current-head game runs remain outstanding.

Overlaps and merge order: The description identifies possible overlap with #2911 and #3021; merge order was not established.


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

**Recommendation: Approve.** The code is ready: only testing is left. The live-loading and mod-preset paths still need game runs on the current head, and the cost of rebuilding preset lists remains unmeasured. Recommend approval; not approved on the forge. The change lets mods provide ReShade presets and load some content during play, while preserving existing emulator-mod switches during migration. The renderer now reuses unchanged packs, though the game still rereads them on each change. **Testing before merging (2)** (runs on the systems it can change; it doesn't hold the recommendation) - **L4**: The new mod-preset and live-loading paths need game runs on the current head and the supported systems they affect. *When:* The only reported run predates the rebase and its test preset mod was rejected, so it did not show a mod preset compiling, surviving a broken edit, or reloading after removal and reinstallation. **Do:** Run the listed live preset, script, store and migration scenarios on the current head, including Windows and the affected Tier 1 hardware; record results and screenshots. - **L5**: The remaining cost of rebuilding the preset list has not been measured. *When:* A mod change rereads preset files on the game side and hashes each pack in the renderer; its effect on play-time latency is unknown. **Do:** Measure list-update time and frame pacing during representative mod and preset edits on the current head. *(`@fix` does its part first: Avoid copying unchanged pack contents and avoid recompiling the active preset when its inputs did not change.)* `@fix` can do L5. **Since the last review** (on ed5522ef013b) Resolved: L1 (A directory read failure is treated as an empty directory, bypassing the path that preserv…); L2 (The migration guesses whether an existing profile was played and can permanently record pr…); L3 (The new test forces g++ instead of using the compiler selected by the test runner.) Still open: L4 (The new mod-preset and live-loading paths need game runs on the current head and the suppo…); L5 (The remaining cost of rebuilding the preset list has not been measured.) **Checks:** Still running: 11 checks. <details> <summary>More: does it help, other systems, switches, what was read</summary> **Does it help:** Unproven. The reported Linux NVIDIA run predates the rebase and did not exercise a mod preset; there are no measurements of preset-list update cost. **Other systems:** Windows, AMD and Steam Deck remain untested. The change affects renderer pack lifetime, shader compilation, mod loading and profile migration; the reported headless run does not cover those paths end to end on the current head. **Switches:** No switch added or changed. The new read of HOS_MOD_TESTS uses the existing test mode. **Reviewed:** 582d285dbb39 against 76092c5e5a3b: Read AGENTS.md, CONTRIBUTING.md, record.rs, fx_packs.cpp and fx_packs.h in full; inspected the relevant loader, runtime, test and profile-migration sections and the change summary. The remaining changed files, generated assets and translations were not read in full.; nothing run (a code review). **Checked and fine:** - The compiler selection follows the test runner and respects CXX for direct invocation. - The migration preserves previously enabled emulator-layout mods on first recording. **Testing:** No commands that build or run project code were executed. The author reports game-free checks after the fixes; CI is still running, and the current-head game runs remain outstanding. **Overlaps and merge order:** The description identifies possible overlap with #2911 and #3021; merge order was not established. </details> --- <sub>Automated code review by BeanBot (gpt-6.1-terra), asked for by HumanBean. Nothing was run; a maintainer decides.</sub>
Author
Owner

L4: the game run on 582d285dbb39 has run (Linux, RTX 3090, driver 620.70.06, headless). A mod's preset showed, reloaded after an edit, kept the old effect through a broken edit, went with a switch off or a deleted folder and came back, all without a restart. Late copies were listed as Off, with Restart now for the emulator-layout one. Details in the description. Windows, AMD, Steam Deck, store installs and updating an existing profile are still untested.

🤖 Generated with Claude Code

https://claude.ai/code/session_017vw8e1rSeTzGtqzZNG1YZH

L4: the game run on `582d285dbb39` has run (Linux, RTX 3090, driver 620.70.06, headless). A mod's preset showed, reloaded after an edit, kept the old effect through a broken edit, went with a switch off or a deleted folder and came back, all without a restart. Late copies were listed as Off, with Restart now for the emulator-layout one. Details in the description. Windows, AMD, Steam Deck, store installs and updating an existing profile are still untested. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_017vw8e1rSeTzGtqzZNG1YZH
HumanBean deleted branch feat/mods-reshade-live 2026-12-03 21:36:10 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 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!3105
No description provided.