feat(mods)!: texture packs and mods of game files load while the game runs #3151

Merged
HumanBean merged 5 commits from HumanBean/Longshot:feat/mods-live-files into main 2026-12-04 16:05:23 +00:00
Owner

Summary

Follows #3105. Two more kinds of mod are added, switched and removed while the game runs, and the map reload is kept to mod development.

1. Texture packs (textures/). Packs are read again off the game's threads, and textures already loaded are looked up again over a few frames. Folder packs reload as their images change. Packs with a recipe.json still wait for the next start.

2. Mods of game files (romfs/, patches/, including emulator-layout mods with only romfs/). The file layers are rebuilt, and a file is served anew from the next time the game loads it. A mod with a file the running game has no room for stays out whole until the next start, with the restart offered. Mods with code, their own saves, a game language, a content module, or moved in the list still wait.

3. The map reload is dev mode only. "Reload the map to see the change" enters the map through its destination's entrance, which started a story cutscene in a run (#3148). Players now see "Parts of this change may need a restart to show", for edited and switched mods alike, until the next start.

4. The layers are rebuilt off the game's thread (lsmod-layers), one rebuild at a time. The main thread takes what the build reads, runs a changed content module's stage and takes the outcome in at a later frame.

Read first: gpu/vk/vk_texture.cpp (the table swap and the sweep), game/crates/longshot-game/src/textures.rs, game/crates/api/src/loader/hot.rs, game/crates/api/src/services/reload.rs. MKWVK_API_VERSION is 93.

Known gaps:

  • File mods have shown no visible change in a run. The game does not read again what it already holds; after leaving an area and returning it read only a few of a mod's files again.
  • Many file mods will still need a restart: a new file, or one larger than the game's, usually has no room.
  • A mod folder removed while the layers are held leaves paths on deleted files until the hold clears or a restart.
  • The restart line stays until the next start, even where a later map load has already shown the change.
  • The strings in 13 languages are unchecked.
  • The game's file calls from the rebuild's thread have run unconfined only: nothing has run it with the sandbox on.
  • The restart line counts only the paths opened since the map began loading. Switches after a teleport counted 2 of the mod's paths, so a change to files held from an earlier map could count none and show no line (an inference from those counts).
  • The count for the same first switch was 200 in one run and 1 in the next. The likely cause is when the map watch sees the first load relative to the game's opens; not shown. Change 4 touches neither.
  • A content mod's new declarations apply a frame or more after its new layers: until then a script can read an old declaration over new files.
  • Quitting during a rebuild drops its thread, possibly during a write to modcache/.

Testing

Tested: headless game runs on Linux, NVIDIA RTX 3090, from a repository save (kokiri-start).

On the head, ee31b40215ec (runtime built from it), driver 620.70.06, sandbox off:

  • a texture pack added during play showed on screen, and so did editing its images, switching it off and on, and removing it;
  • a mod of recoloured copies of 237 of the game's texture files, switched on or off eight times in play, each time logged rebuilt off the game's thread in N ms, M ms of work on it: N from 0 to 84 ms, M 1 ms the first time and 0 ms after (the log's own count, not frame times);
  • the first switch logged 1 changed path is loaded in this map, later ones 2, and the Mods tab showed Parts of this change may need a restart to show;
  • three switches 0.35 s apart ended off, but were seen as one change, so a switch during a rebuild did not happen in the game;
  • two teleports with the mod on; no crash line or validation message.

On 9d0d0605, before the rebuild moved off the game's thread: the first switch of that mod logged 200 changed paths are loaded in this map, its rebuild took 150 ms on the main thread, and the Mods tab still showed its line after teleporting to Hyrule Field and back (not looked at again on the head).

Earlier, on fdc17832 (before the rebases and the review fixes): mods of game files (made-up files the area does not load) were switched on, overlapped, switched off and removed with the paths the log named, the oversized one was held with Restart now offered, and an emulator-layout one was switched on and removed.

Three runs on earlier builds of this branch (before the last rebase and the final wording):

  • a texture pack added during play replaced the textures on screen; editing its images, switching it off and on, and removing its folder each showed, at 60 fps through the later cycles;
  • file mods: switching on, two overlapping, switching off and removing served the files the log named; a mod too large for the size table was held whole with the restart offered; an emulator-layout mod switched on and was removed;
  • file mods: after teleporting away and back, the game read some of the mod's files from the mod (log lines), with no visible change;
  • outside dev mode no map reload happened and the Mods tab showed its line.

Checks, Linux, no full suite: see the comments below.

A second agent reviewed changes 1 and 2, and BeanBot reviewed the whole pull request; the fixes to both have not been reviewed again, and nobody has reviewed change 4.

Still to test:

  • With the sandbox on (started by the builder): texture pack and file mod switches (by hand).
  • A switch made while a rebuild runs, in the game (by hand).
  • Mods of game files overlapping, too large and in the emulators' layout, on this head (by hand).
  • Windows, AMD, Steam Deck (by hand).
  • A file mod that visibly changes the game, with and without leaving the area (by hand).
  • Dev mode's reload (mod run) (by hand).
  • Frame times while a large pack or file mod is switched (by hand).

Measurements

Nothing to measure: no change aims at speed.

Risks

  • Players: swapping game files mid-play carries more risk than presets or textures. "Reload the map to see the change" is gone outside dev mode.
  • Renderer: the pack table is swapped under a running renderer; the sweep assumes only the render thread touches textures at a frame's end.
  • Mod authors: a hand-edited file no longer offers a map reload outside dev mode.
  • No switch turns the live loading off beyond HOS_MODS_WATCH=0; reverting is enough.

Checklist

Ready for review

  • One topic, on current main; the title is a Conventional Commit. (Three related changes 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 runtime built from the head; for Windows only an llvm-mingw syntax check of vk_texture.cpp.)
  • 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 Follows #3105. Two more kinds of mod are added, switched and removed while the game runs, and the map reload is kept to mod development. **1. Texture packs** (`textures/`). Packs are read again off the game's threads, and textures already loaded are looked up again over a few frames. Folder packs reload as their images change. Packs with a `recipe.json` still wait for the next start. **2. Mods of game files** (`romfs/`, `patches/`, including emulator-layout mods with only `romfs/`). The file layers are rebuilt, and a file is served anew from the next time the game loads it. A mod with a file the running game has no room for stays out whole until the next start, with the restart offered. Mods with code, their own saves, a game language, a content module, or moved in the list still wait. **3. The map reload is dev mode only.** "Reload the map to see the change" enters the map through its destination's entrance, which started a story cutscene in a run (#3148). Players now see "Parts of this change may need a restart to show", for edited and switched mods alike, until the next start. **4. The layers are rebuilt off the game's thread** (`lsmod-layers`), one rebuild at a time. The main thread takes what the build reads, runs a changed content module's stage and takes the outcome in at a later frame. Read first: `gpu/vk/vk_texture.cpp` (the table swap and the sweep), `game/crates/longshot-game/src/textures.rs`, `game/crates/api/src/loader/hot.rs`, `game/crates/api/src/services/reload.rs`. `MKWVK_API_VERSION` is 93. Known gaps: - **File mods have shown no visible change in a run.** The game does not read again what it already holds; after leaving an area and returning it read only a few of a mod's files again. - Many file mods will still need a restart: a new file, or one larger than the game's, usually has no room. - A mod folder removed while the layers are held leaves paths on deleted files until the hold clears or a restart. - The restart line stays until the next start, even where a later map load has already shown the change. - The strings in 13 languages are unchecked. - The game's file calls from the rebuild's thread have run unconfined only: nothing has run it with the sandbox on. - The restart line counts only the paths opened since the map began loading. Switches after a teleport counted 2 of the mod's paths, so a change to files held from an earlier map could count none and show no line (an inference from those counts). - The count for the same first switch was 200 in one run and 1 in the next. The likely cause is when the map watch sees the first load relative to the game's opens; not shown. Change 4 touches neither. - A content mod's new declarations apply a frame or more after its new layers: until then a script can read an old declaration over new files. - Quitting during a rebuild drops its thread, possibly during a write to `modcache/`. ## Testing **Tested:** headless game runs on Linux, NVIDIA RTX 3090, from a repository save (`kokiri-start`). On the head, `ee31b40215ec` (runtime built from it), driver 620.70.06, sandbox off: - a texture pack added during play showed on screen, and so did editing its images, switching it off and on, and removing it; - a mod of recoloured copies of 237 of the game's texture files, switched on or off eight times in play, each time logged `rebuilt off the game's thread in N ms, M ms of work on it`: N from 0 to 84 ms, M 1 ms the first time and 0 ms after (the log's own count, not frame times); - the first switch logged `1 changed path is loaded in this map`, later ones `2`, and the Mods tab showed **Parts of this change may need a restart to show**; - three switches 0.35 s apart ended off, but were seen as one change, so a switch during a rebuild did not happen in the game; - two teleports with the mod on; no crash line or validation message. On `9d0d0605`, before the rebuild moved off the game's thread: the first switch of that mod logged `200 changed paths are loaded in this map`, its rebuild took 150 ms on the main thread, and the Mods tab still showed its line after teleporting to Hyrule Field and back (not looked at again on the head). Earlier, on `fdc17832` (before the rebases and the review fixes): mods of game files (made-up files the area does not load) were switched on, overlapped, switched off and removed with the paths the log named, the oversized one was held with **Restart now** offered, and an emulator-layout one was switched on and removed. Three runs on earlier builds of this branch (before the last rebase and the final wording): - a texture pack added during play replaced the textures on screen; editing its images, switching it off and on, and removing its folder each showed, at 60 fps through the later cycles; - file mods: switching on, two overlapping, switching off and removing served the files the log named; a mod too large for the size table was held whole with the restart offered; an emulator-layout mod switched on and was removed; - file mods: after teleporting away and back, the game read some of the mod's files from the mod (log lines), with no visible change; - outside dev mode no map reload happened and the Mods tab showed its line. Checks, Linux, no full suite: see the comments below. A second agent reviewed changes 1 and 2, and BeanBot reviewed the whole pull request; the fixes to both have not been reviewed again, and nobody has reviewed change 4. **Still to test:** - With the sandbox on (started by the builder): texture pack and file mod switches (by hand). - A switch made while a rebuild runs, in the game (by hand). - Mods of game files overlapping, too large and in the emulators' layout, on this head (by hand). - Windows, AMD, Steam Deck (by hand). - A file mod that visibly changes the game, with and without leaving the area (by hand). - Dev mode's reload (`mod run`) (by hand). - Frame times while a large pack or file mod is switched (by hand). ## Measurements Nothing to measure: no change aims at speed. ## Risks - **Players:** swapping game files mid-play carries more risk than presets or textures. "Reload the map to see the change" is gone outside dev mode. - **Renderer:** the pack table is swapped under a running renderer; the sweep assumes only the render thread touches textures at a frame's end. - **Mod authors:** a hand-edited file no longer offers a map reload outside dev mode. - No switch turns the live loading off beyond `HOS_MODS_WATCH=0`; reverting is enough. ## Checklist ### Ready for review - [ ] One topic, on current `main`; the title is a Conventional Commit. (Three related changes 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 runtime built from the head; for Windows only an llvm-mingw syntax check of `vk_texture.cpp`.) - [ ] 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 of textures (or of textures and ReShade presets) with no script and no recipe now joins, leaves and switches with
no restart, and an edit under its textures/ folder shows. The game side works the packs out again on a thread of its
own; each replacement has an id kept for the process, so the renderer's decode thread and images are never moved under.
The renderer reads the new list into a new table and looks the uploaded textures up again, 1 ms a frame at most.

A pack with a recipe.json still waits for the next start, as does any pack with HOS_MODS_WATCH=0.

BREAKING CHANGE: MKWVK_API_VERSION is 93 (game_texture_replacements_generation; game_texture_replacement_image takes
the replacement's id).

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e1rSeTzGtqzZNG1YZH
A mod of romfs/ files or typed patches alone, a manifest mod or an emulators' layout one with only romfs/, now joins,
leaves and switches with no restart: the file layers are rebuilt and what changed is served from the next time the game
reads it. A file the game already holds is not read again. All or nothing: when a file of it needs a larger entry in
the resource size table than the game read at its start, none of it is served and the tab offers the restart. With no
mod of files at the start the check is against the game's own table.

A mod moved in the Mods tab still holds every file change to the next start, as does HOS_MODS_WATCH=0.

BREAKING CHANGE: an emulators' layout mod of romfs/ alone switches at once instead of at the next start.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e1rSeTzGtqzZNG1YZH
The reload enters the map through its destination's entrance. In a game run that started a story cutscene, then failed
with Link not in play: on a real save it could advance the story. Both tests fail: the reload is offered to every
player, and the Mods tab has no unpressable line saying a restart may be needed.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e1rSeTzGtqzZNG1YZH
fix(mods): the map is reloaded after a file change in dev mode alone
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
fdc1783206
The reload enters the map through its destination's entrance, which can start a story event: in a game run it started a
cutscene and then failed with Link not in play, and on a player's save it could advance the story. Outside dev mode
nothing is offered or can be made now, for edited and switched mods alike: when the map had loaded a changed file, the
Mods tab says parts of the change may need a restart to show, until a map load begins, and the log says the same. Dev
mode reloads as before.

The docs say plainly that a file the game already holds is not read again, and that no game run has seen a visible
change from a file mod changed while the game runs.

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

Tested in game: Linux, NVIDIA RTX 3090, headless, kokiri-start repository save, on earlier builds of this branch (before the last rebase and the final wording), not on this head. Texture packs added, edited, switched and removed in play showed on screen. Mods of game files: the log matched the bookkeeping, but no visible change was seen. Outside dev mode no map reload happened.

Tested in game: Linux, NVIDIA RTX 3090, headless, kokiri-start repository save, on earlier builds of this branch (before the last rebase and the final wording), not on this head. Texture packs added, edited, switched and removed in play showed on screen. Mods of game files: the log matched the bookkeeping, but no visible change was seen. Outside dev mode no map reload happened.
Author
Owner

Checks on fdc17832 (Linux, no full suite): the runtime builds; cargo test of api (573), content (260) and longshot-game (223) passes; test_texture_pack, test_program_hooks, i18n_complete and test_menu_ini_keys pass; vk_texture.cpp passes an llvm-mingw syntax check with -Wno-c++11-narrowing (without it, it stops at a line that is the same on main). rx_backend.c was not checked for Windows.

🤖 Generated with Claude Code

https://claude.ai/code/session_017vw8e1rSeTzGtqzZNG1YZH

Checks on `fdc17832` (Linux, no full suite): the runtime builds; `cargo test` of `api` (573), `content` (260) and `longshot-game` (223) passes; `test_texture_pack`, `test_program_hooks`, `i18n_complete` and `test_menu_ini_keys` pass; `vk_texture.cpp` passes an llvm-mingw syntax check with `-Wno-c++11-narrowing` (without it, it stops at a line that is the same on `main`). `rx_backend.c` was not checked for Windows. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_017vw8e1rSeTzGtqzZNG1YZH
Author
Owner
@rebase
Member

I rebased this pull request onto main (1c8c2634c7): the new head is e1a23bcbf8.

Conflicts resolved

  • docs/modding/permissions.md: Kept the combined permission table and updated the schema hash.
  • docs/modding/reference.md: Kept both sides’ reference changes and updated the schema hash.
  • docs/modding/scripting.md: Kept both sides’ guide changes and updated the schema hash.

Nothing was built or run: read the resolution before merging.


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

I rebased this pull request onto `main` (1c8c2634c715): the new head is e1a23bcbf8de. **Conflicts resolved** - docs/modding/permissions.md: Kept the combined permission table and updated the schema hash. - docs/modding/reference.md: Kept both sides’ reference changes and updated the schema hash. - docs/modding/scripting.md: Kept both sides’ guide changes and updated the schema hash. Nothing was built or run: read the resolution before merging. --- <sub>Automated rebase by BeanBot (gpt-6.1-terra), asked for by HumanBean. Nothing was run; a maintainer decides.</sub>
BeanBot force-pushed feat/mods-live-files from fdc1783206
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 e1a23bcbf8
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-04 06:27:07 +00:00
Compare
BeanBot left a comment

Recommendation: Request changes. The texture sweep can match a replacement against bytes that no longer belong to the uploaded texture, producing the wrong image. A failed decoder-thread start also leaves the pack unavailable for the rest of that generation.

This adds live texture-pack and game-file changes and restricts map reloads to development mode. Texture changes have been seen on screen, but file changes have not yet produced a visible result, and the frame-time cost of rebuilding layers and sweeping textures is unmeasured.

Blocking (2): must change before merging.

  1. L1 gpu/vk/vk_texture.cpp:3099: The sweep identifies an already uploaded texture by reading its guest storage again, rather than by the bytes used for its upload. (more on the line) Do: Retain the signature and full hash of the bytes used for each upload and use those saved values when a pack change sweeps an existing texture.
  2. L7: It conflicts with its base branch: bring it up to date (@​fix or @​rebase try first). (for the author)

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

  • L2 gpu/vk/vk_texture.cpp:2752: The generation is marked seen before the decoder thread has successfully started. (more on the line) Do: Only advance pack_seen after the thread has started and the table can be published, or otherwise arrange a retry after the failure.
  • L3 game/crates/api/src/services/reload.rs:244: Starting any map load clears the restart notice even when the changed resource remains held by the game. (more on the line) Do: Keep the notice until restart, or clear it only when the affected resources are known to have been reloaded.

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

  • L4 game/crates/api/src/loader/hot.rs:164: The synchronous layer rebuild can interrupt a frame, and its cost with real mods has not been measured. (more on the line) Do: Measure frame times while adding, switching and removing representative large file mods, including on Steam Deck, and compare with the base. (@fix does its part first: Move or prepare the layer rebuild off the frame thread and publish the completed table at a safe point.)
  • L5 gpu/vk/vk_texture.cpp:3077: The live texture path has not been measured for frame pacing or checked across the supported Tier 1 systems. (more on the line) Do: Compare base and head frame times with packs absent and while switching a large pack, and exercise visible replacement and removal on Windows, AMD and Steam Deck. (@fix does its part first: Incrementally build the sweep and use saved upload hashes so a single lookup does not reread and hash texture storage.)
  • L6: The file-mod feature and the final map-reload behavior have not yet been demonstrated with a visible game change. When: The reported file-mod runs confirmed paths in logs, but no changed file produced a visible result; the final notice and development-mode reload were also not exercised on this head. Do: On this head, switch a visibly changing file mod on and off, check before and after leaving the area, and verify the restart notice and development-mode reload.

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

Checks: Still running: PR description / Title and description (pull_request_target).

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

Does it help: Unproven for file mods: the reported runs served changed paths but showed no visible change. Texture packs were seen changing on Linux with an RTX 3090; no comparable frame-time measurements against the base were reported.

Other systems: The renderer sweep can affect all GPUs and both supported OSes; only Linux/NVIDIA was exercised. File-layer rebuilding and map reload affect game loading independently of GPU. Windows, AMD, Steam Deck, a visible file mod, development-mode reload, and the new restart notice remain untested according to the PR.

Switches: No switch added or removed. HOS_MODS_WATCH defaults to watching and now also controls live file and texture changes; RX_VK_TEX_PACKS retains its existing default.

Reviewed: e1a23bcbf8 against 1c8c2634c7: Read repository rules, standards, the PR template, commit log, loader hot-rebuild and arrival code, texture publication and reload code, and the renderer sweep and lookup paths. Reviewed the diffs for the remaining files; translations, documentation, tests, schemas and generated-facing changes were skimmed. The full contents and all callers of every changed code file were not read.; nothing run (a code review).

Checked and fine:

  • MKWVK_API_VERSION is bumped to 93 and the new host callback is wired in rx_backend.c.
  • The listed commits include AI-assistance trailers.
  • The map reload entry point rejects requests outside development mode.

Testing: No code or tests were run for this review. The author reports partial Linux checks and game runs; the full suite and the runs listed above remain outstanding.

Overlaps and merge order: The PR identifies #3137 as overlapping the loader; its merge order was not established from the available checkout.


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

**Recommendation: Request changes.** The texture sweep can match a replacement against bytes that no longer belong to the uploaded texture, producing the wrong image. A failed decoder-thread start also leaves the pack unavailable for the rest of that generation. This adds live texture-pack and game-file changes and restricts map reloads to development mode. Texture changes have been seen on screen, but file changes have not yet produced a visible result, and the frame-time cost of rebuilding layers and sweeping textures is unmeasured. **Blocking (2)**: must change before merging. 1. **L1** `gpu/vk/vk_texture.cpp:3099`: The sweep identifies an already uploaded texture by reading its guest storage again, rather than by the bytes used for its upload. (more on the line) **Do:** Retain the signature and full hash of the bytes used for each upload and use those saved values when a pack change sweeps an existing texture. 2. **L7**: It conflicts with its base branch: bring it up to date (`@​fix` or `@​rebase` try first). *(for the author)* **Should fix (2)**: not blocking, but worth doing before merging. - **L2** `gpu/vk/vk_texture.cpp:2752`: The generation is marked seen before the decoder thread has successfully started. (more on the line) **Do:** Only advance pack_seen after the thread has started and the table can be published, or otherwise arrange a retry after the failure. - **L3** `game/crates/api/src/services/reload.rs:244`: Starting any map load clears the restart notice even when the changed resource remains held by the game. (more on the line) **Do:** Keep the notice until restart, or clear it only when the affected resources are known to have been reloaded. **Testing before merging (3)** (runs on the systems it can change; it doesn't hold the recommendation) - **L4** `game/crates/api/src/loader/hot.rs:164`: The synchronous layer rebuild can interrupt a frame, and its cost with real mods has not been measured. (more on the line) **Do:** Measure frame times while adding, switching and removing representative large file mods, including on Steam Deck, and compare with the base. *(`@fix` does its part first: Move or prepare the layer rebuild off the frame thread and publish the completed table at a safe point.)* - **L5** `gpu/vk/vk_texture.cpp:3077`: The live texture path has not been measured for frame pacing or checked across the supported Tier 1 systems. (more on the line) **Do:** Compare base and head frame times with packs absent and while switching a large pack, and exercise visible replacement and removal on Windows, AMD and Steam Deck. *(`@fix` does its part first: Incrementally build the sweep and use saved upload hashes so a single lookup does not reread and hash texture storage.)* - **L6**: The file-mod feature and the final map-reload behavior have not yet been demonstrated with a visible game change. *When:* The reported file-mod runs confirmed paths in logs, but no changed file produced a visible result; the final notice and development-mode reload were also not exercised on this head. **Do:** On this head, switch a visibly changing file mod on and off, check before and after leaving the area, and verify the restart notice and development-mode reload. `@fix` can do L1, L2, L3, L4 and L5. **Checks:** Still running: `PR description / Title and description (pull_request_target)`. <details> <summary>More: does it help, other systems, switches, what was read</summary> **Does it help:** Unproven for file mods: the reported runs served changed paths but showed no visible change. Texture packs were seen changing on Linux with an RTX 3090; no comparable frame-time measurements against the base were reported. **Other systems:** The renderer sweep can affect all GPUs and both supported OSes; only Linux/NVIDIA was exercised. File-layer rebuilding and map reload affect game loading independently of GPU. Windows, AMD, Steam Deck, a visible file mod, development-mode reload, and the new restart notice remain untested according to the PR. **Switches:** No switch added or removed. HOS_MODS_WATCH defaults to watching and now also controls live file and texture changes; RX_VK_TEX_PACKS retains its existing default. **Reviewed:** e1a23bcbf8de against 1c8c2634c715: Read repository rules, standards, the PR template, commit log, loader hot-rebuild and arrival code, texture publication and reload code, and the renderer sweep and lookup paths. Reviewed the diffs for the remaining files; translations, documentation, tests, schemas and generated-facing changes were skimmed. The full contents and all callers of every changed code file were not read.; nothing run (a code review). **Checked and fine:** - MKWVK_API_VERSION is bumped to 93 and the new host callback is wired in rx_backend.c. - The listed commits include AI-assistance trailers. - The map reload entry point rejects requests outside development mode. **Testing:** No code or tests were run for this review. The author reports partial Linux checks and game runs; the full suite and the runs listed above remain outstanding. **Overlaps and merge order:** The PR identifies #3137 as overlapping the loader; its merge order was not established from the available checkout. </details> --- <sub>Automated code review by BeanBot (gpt-6.1-terra), asked for by BeanBot, after its rebase. Nothing was run; a maintainer decides.</sub>
@ -75,0 +161,4 @@
}
if !done {
self.files_from = kept;
let left = if removed {
Member

L4 (should fix): The synchronous layer rebuild can interrupt a frame, and its cost with real mods has not been measured.

When: Switching a large file mod rebuilds and fits the layers on the main thread before the frame can complete; the reported runs do not include frame times for that operation.

Do: Measure frame times while adding, switching and removing representative large file mods, including on Steam Deck, and compare with the base.

**L4** (should fix): The synchronous layer rebuild can interrupt a frame, and its cost with real mods has not been measured. *When:* Switching a large file mod rebuilds and fits the layers on the main thread before the frame can complete; the reported runs do not include frame times for that operation. **Do:** Measure frame times while adding, switching and removing representative large file mods, including on Steam Deck, and compare with the base.
@ -223,6 +241,7 @@ impl MapReload {
/// A map load begins: the paths opened from now are the new map's (`layers`' notes forgotten).
pub fn map_loading(&self, layers: &content::layers::Layers) {
layers.opens_new_map();
lock(&self.shared).later = false;
Member

L3 (should fix): Starting any map load clears the restart notice even when the changed resource remains held by the game.

When: A player changes a file that was already loaded, sees the notice, and travels to another map. map_loading clears later even if the game retains that resource across the transition, so the Mods tab no longer explains why the change has not appeared.

Do: Keep the notice until restart, or clear it only when the affected resources are known to have been reloaded.

**L3** (should fix): Starting any map load clears the restart notice even when the changed resource remains held by the game. *When:* A player changes a file that was already loaded, sees the notice, and travels to another map. map_loading clears later even if the game retains that resource across the transition, so the Mods tab no longer explains why the change has not appeared. **Do:** Keep the notice until restart, or clear it only when the affected resources are known to have been reloaded.
@ -2720,1 +2749,4 @@
}
pack_seen.store(listed, std::memory_order_release);
if (!table->empty() && !decoding) {
try {
Member

L2 (should fix): The generation is marked seen before the decoder thread has successfully started.

When: If creating the decoder thread throws, pack_load returns without publishing the table, but subsequent frames see the same generation in pack_seen and never retry. The enabled pack therefore remains absent until another pack change or restart.

Do: Only advance pack_seen after the thread has started and the table can be published, or otherwise arrange a retry after the failure.

**L2** (should fix): The generation is marked seen before the decoder thread has successfully started. *When:* If creating the decoder thread throws, pack_load returns without publishing the table, but subsequent frames see the same generation in pack_seen and never retry. The enabled pack therefore remains absent until another pack change or restart. **Do:** Only advance pack_seen after the thread has started and the table can be published, or otherwise arrange a retry after the failure.
@ -3027,0 +3074,4 @@
pack_sweep.clear();
pack_failed_stale = true;
for (const auto& [key, tex] : textures)
if (tex->pack) pack_sweep.push_back(key);
Member

L5 (should fix): The live texture path has not been measured for frame pacing or checked across the supported Tier 1 systems.

When: A pack change scans the texture collection and then hashes uploaded textures over subsequent frames; the 1 ms loop limit excludes the initial scan and cannot bound one large lookup.

Do: Compare base and head frame times with packs absent and while switching a large pack, and exercise visible replacement and removal on Windows, AMD and Steam Deck.

**L5** (should fix): The live texture path has not been measured for frame pacing or checked across the supported Tier 1 systems. *When:* A pack change scans the texture collection and then hashes uploaded textures over subsequent frames; the 1 ms loop limit excludes the initial scan and cannot bound one large lookup. **Do:** Compare base and head frame times with packs absent and while switching a large pack, and exercise visible replacement and removal on Windows, AMD and Steam Deck.
@ -3027,0 +3096,4 @@
Texture& tex = *it->second;
PackImage* const had = tex.pack;
if (tex.uploaded || had) pack_reupload(tex, tex.guest_size);
came |= tex.pack && tex.pack != had;
Member

L1 (blocking): The sweep identifies an already uploaded texture by reading its guest storage again, rather than by the bytes used for its upload.

When: If the game has reused or rewritten the texture's guest address after the upload, pack_reupload calls pack_lookup and guest_bytes on the current storage. The shadow only covers captured pages, so the sweep can attach the replacement for those newer bytes to the still-existing GPU image, or remove the correct replacement.

Do: Retain the signature and full hash of the bytes used for each upload and use those saved values when a pack change sweeps an existing texture.

**L1** (blocking): The sweep identifies an already uploaded texture by reading its guest storage again, rather than by the bytes used for its upload. *When:* If the game has reused or rewritten the texture's guest address after the upload, pack_reupload calls pack_lookup and guest_bytes on the current storage. The shadow only covers captured pages, so the sweep can attach the replacement for those newer bytes to the still-existing GPU image, or remove the correct replacement. **Do:** Retain the signature and full hash of the bytes used for each upload and use those saved values when a pack change sweeps an existing texture.
HumanBean force-pushed feat/mods-live-files from e1a23bcbf8
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 9d0d0605ea
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-04 06:59:42 +00:00
Compare
Author
Owner

Pushed 9d0d0605eae7: rebased onto current main (after #3137 and #3095) with the review fixes folded into their commits. The head before was e1a23bcbf8de.

  • L1 (sweep matching other bytes): fixed. A replaced texture is now decided by the size and hash its upload matched, kept on it, so nothing is read for it. A texture without a replacement is read only while its storage is unchanged since its upload; one written since is looked up at its next upload.
  • L2 (decoder thread): the generation is marked seen only once the thread has started; a failed start is tried again 5 s on. Not covered by a test.
  • L3 (restart line): it now stays until the next start.
  • L5 (sweep cost): textures with a replacement are no longer reread, and an ASTC one still holding its upload reuses its saved hash. Others are hashed only when the signature matches. The list is still built in one pass.
  • L4 (layer rebuild on the frame thread): not changed. I'd measure it first; each rebuild logs its milliseconds.
  • L6 and the measurements in L4 and L5: still to do, they need game runs.
  • L7: rebased.

Also: the test #3137 added for moving a mod failed after the rebase, as it skipped publishing the file layers, which the game does after every start. It now does that.

Checks, Linux, no full suite:

  • On the head before the last rebase (no conflicts): cargo test of api (579), content (260) and longshot-game (223), cargo clippy -D warnings and cargo fmt --check; test_program_hooks, test_i18n_complete, test_menu_ini_keys.
  • On this head: test_texture_pack, schema-gen --check, an llvm-mingw syntax check of vk_texture.cpp.
  • The new sweep checks fail with the old sweep and pass now.
  • The runtime was not built and the game was not run with these fixes.

🤖 Generated with Claude Code

https://claude.ai/code/session_017vw8e1rSeTzGtqzZNG1YZH

Pushed `9d0d0605eae7`: rebased onto current `main` (after #3137 and #3095) with the review fixes folded into their commits. The head before was `e1a23bcbf8de`. - **L1** (sweep matching other bytes): fixed. A replaced texture is now decided by the size and hash its upload matched, kept on it, so nothing is read for it. A texture without a replacement is read only while its storage is unchanged since its upload; one written since is looked up at its next upload. - **L2** (decoder thread): the generation is marked seen only once the thread has started; a failed start is tried again 5 s on. Not covered by a test. - **L3** (restart line): it now stays until the next start. - **L5** (sweep cost): textures with a replacement are no longer reread, and an ASTC one still holding its upload reuses its saved hash. Others are hashed only when the signature matches. The list is still built in one pass. - **L4** (layer rebuild on the frame thread): **not changed.** I'd measure it first; each rebuild logs its milliseconds. - **L6** and the measurements in L4 and L5: still to do, they need game runs. - **L7**: rebased. Also: the test #3137 added for moving a mod failed after the rebase, as it skipped publishing the file layers, which the game does after every start. It now does that. Checks, Linux, no full suite: - On the head before the last rebase (no conflicts): `cargo test` of `api` (579), `content` (260) and `longshot-game` (223), `cargo clippy -D warnings` and `cargo fmt --check`; `test_program_hooks`, `test_i18n_complete`, `test_menu_ini_keys`. - On this head: `test_texture_pack`, `schema-gen --check`, an llvm-mingw syntax check of `vk_texture.cpp`. - The new sweep checks fail with the old sweep and pass now. - **The runtime was not built and the game was not run** with these fixes. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_017vw8e1rSeTzGtqzZNG1YZH
Author
Owner

Tested in game on 9d0d0605eae7: Linux, NVIDIA RTX 3090, driver 620.70.06, headless, kokiri-start.

  • A texture pack added, edited, switched off and on and removed in play showed each time on screen.
  • A mod of recoloured copies of 238 texture files, switched on in play: the Mods tab said Parts of this change may need a restart to show, before and after teleporting to Hyrule Field and back (L3).
  • No visible change from that file mod was seen, as before.
  • L4: rebuilding the file layers for it took 150 ms on the main thread, so there is a hitch. Frame times were not otherwise measured.
  • No crash line or validation message.

🤖 Generated with Claude Code

https://claude.ai/code/session_017vw8e1rSeTzGtqzZNG1YZH

Tested in game on `9d0d0605eae7`: Linux, NVIDIA RTX 3090, driver 620.70.06, headless, `kokiri-start`. - A texture pack added, edited, switched off and on and removed in play showed each time on screen. - A mod of recoloured copies of 238 texture files, switched on in play: the Mods tab said **Parts of this change may need a restart to show**, before and after teleporting to Hyrule Field and back (L3). - No visible change from that file mod was seen, as before. - **L4:** rebuilding the file layers for it took **150 ms** on the main thread, so there is a hitch. Frame times were not otherwise measured. - No crash line or validation message. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_017vw8e1rSeTzGtqzZNG1YZH
perf(mods): the file layers are rebuilt off the game's thread while it runs
Some checks failed
CI / What the change needs (pull_request) Successful in 9s
CI / Third-party parts and guide screenshots (pull_request) Successful in 14s
CI / Lint (pre-commit, ShellCheck, actionlint) (pull_request) Successful in 20s
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Failing after 1m28s
CI / Renderer build check (Windows, compile --only renderer, without and with FSR 4) (pull_request) Successful in 16m52s
CI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request) Failing after 21m13s
CI / Website build and checks (pull_request) Failing after 39s
CI / Renderer build check (Linux, compile --only renderer, without and with FSR 4) (pull_request) Successful in 13m43s
PR description / Title and description (pull_request_target) Failing after 7s
CI / Game-free checks (run_all.py, part 2/2) (pull_request) Successful in 48m21s
CI / Game-free checks (run_all.py, part 1/2) (pull_request) Failing after 1h0m4s
ee31b40215
Building the layers, checking them against the resource size table and publishing them took 150 ms on the game's
thread for a mod of 238 files. They run on their own thread (lsmod-layers) now: the main thread takes what the build
reads of the mods, runs a changed content module's stage, and takes the outcome in at a later frame. One rebuild runs
at a time; a switch or an edit made meanwhile is built after it.

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

Pushed ee31b40215ec on top of 9d0d0605eae7, for L4: the file layers are now built, checked against the size table and published on their own thread. The main thread only takes a snapshot, runs content stages and takes the outcome in.

Checks, Linux: cargo test --release of api (581, with 2 new threaded tests), content (260) and longshot-game (223); clippy -D warnings of api and longshot-game; cargo fmt --check; test_sandbox_linux, test_sandbox_save_folders.

Not done: the runtime was not built and the game was not run on this commit, and nobody has reviewed it.

🤖 Generated with Claude Code

https://claude.ai/code/session_017vw8e1rSeTzGtqzZNG1YZH

Pushed `ee31b40215ec` on top of `9d0d0605eae7`, for **L4**: the file layers are now built, checked against the size table and published on their own thread. The main thread only takes a snapshot, runs content stages and takes the outcome in. Checks, Linux: `cargo test --release` of `api` (581, with 2 new threaded tests), `content` (260) and `longshot-game` (223); `clippy -D warnings` of `api` and `longshot-game`; `cargo fmt --check`; `test_sandbox_linux`, `test_sandbox_save_folders`. **Not done:** the runtime was not built and the game was not run on this commit, and nobody has reviewed it. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_017vw8e1rSeTzGtqzZNG1YZH
Author
Owner

Tested in game on ee31b40215ec (headless, Linux, NVIDIA RTX 3090, driver 620.70.06, kokiri-start, sandbox off), for L4:

  • Switching a mod of 237 texture files on or off, eight switches: the rebuild took 0 to 84 ms on its own thread, with 1 ms of main-thread work the first time and 0 ms after. Before, on 9d0d0605, the first switch took 150 ms on the main thread. These are the log's own counts; frame times and Steam Deck are still unmeasured, so L4's "Do" is only partly met.
  • Texture pack add, edit, switch off and on, and remove showed on screen as before. No crash line or validation message.
  • The restart line showed after the switch. The loaded-path count was 1 here and 200 in the previous run's same step; see Known gaps.

🤖 Generated with Claude Code

https://claude.ai/code/session_017vw8e1rSeTzGtqzZNG1YZH

Tested in game on `ee31b40215ec` (headless, Linux, NVIDIA RTX 3090, driver 620.70.06, `kokiri-start`, sandbox off), for **L4**: - Switching a mod of 237 texture files on or off, eight switches: the rebuild took 0 to 84 ms on its own thread, with 1 ms of main-thread work the first time and 0 ms after. Before, on `9d0d0605`, the first switch took 150 ms on the main thread. These are the log's own counts; frame times and Steam Deck are still unmeasured, so L4's "Do" is only partly met. - Texture pack add, edit, switch off and on, and remove showed on screen as before. No crash line or validation message. - The restart line showed after the switch. The loaded-path count was 1 here and 200 in the previous run's same step; see Known gaps. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_017vw8e1rSeTzGtqzZNG1YZH
Author
Owner
@review
BeanBot left a comment

Recommendation: Approve. The code is ready: only testing is left. Texture pack switching has been shown working, and moving file-layer rebuilding off the game thread reduced the logged main-thread work in one run. The visible file-mod behavior, frame pacing, supported-system coverage, and mergeability still need confirmation. Recommend approval; not approved on the forge.

Texture packs and eligible file mods can change during play, while automatic map reloads are limited to development mode. The threaded rebuild reduces the observed main-thread work but adds concurrency and platform-specific paths that need further validation.

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

  • L4 game/crates/api/src/loader/hot.rs:164: The threaded rebuild's effect on frame pacing remains unmeasured. When: A large file mod is switched during play; the log reports worker and main-thread durations but does not show whether a frame hitches. Do: Measure frame times during repeated switches of a real mod, including on Steam Deck. (@fix does its part first: Move or prepare the layer rebuild off the frame thread and publish the completed table at a safe point.)
  • L5 gpu/vk/vk_texture.cpp:3077: The live texture path has not been measured for frame pacing or checked across the supported Tier 1 systems. When: A pack change scans the texture collection and then hashes uploaded textures over subsequent frames; the 1 ms loop limit excludes the initial scan and cannot bound one large lookup. Do: Compare base and head frame times with packs absent and while switching a large pack, and exercise visible replacement and removal on Windows, AMD and Steam Deck. (@fix does its part first: Incrementally build the sweep and use saved upload hashes so a single lookup does not reread and hash texture storage.)
  • L6: The file-mod feature and the final map-reload behavior have not yet been demonstrated with a visible game change. When: The reported file-mod runs confirmed paths in logs, but no changed file produced a visible result; the final notice and development-mode reload were also not exercised on this head. Do: On this head, switch a visibly changing file mod on and off, check before and after leaving the area, and verify the restart notice and development-mode reload.

@fix can do L4 and L5.

Since the last review (on e1a23bcbf8)
Resolved: L1 (The sweep identifies an already uploaded texture by reading its guest storage again, rathe…); L2 (The generation is marked seen before the decoder thread has successfully started.); L3 (Starting any map load clears the restart notice even when the changed resource remains hel…); L7 (It conflicts with its base branch: bring it up to date (@​fix or @​rebase try first).)
Still open: L4 (The threaded rebuild's effect on frame pacing remains unmeasured.); L5 (The live texture path has not been measured for frame pacing or checked across the support…); L6 (The file-mod feature and the final map-reload behavior have not yet been demonstrated with…)

Checks: Still running: 9 checks.

Also noticed (2; not asked for, not blocking)
  • The pull request records that a removed mod folder can leave deleted paths in held layers until the hold clears or the game restarts.
  • The restart notice can miss files retained from an earlier map because the opened-path count resets at map loading.
More: does it help, other systems, switches, what was read

Does it help: Unproven for file mods: no visible game change has been demonstrated. Texture pack add, edit, switch, and removal worked on Linux with an NVIDIA RTX 3090. For a 237-file mod, the head logged 0–84 ms off-thread and 0–1 ms of main-thread work, versus 150 ms on the main thread before threading; these are log counts, not comparable frame-time measurements against main.

Other systems: The renderer and file-layer paths can affect Windows, Linux, other GPU vendors, Steam Deck, sandboxed file access, and game file loads. The supplied runs cover Linux and NVIDIA with the sandbox off; the other systems and a switch during a rebuild remain untested.

Switches: No switch was added or changed. The existing HOS_MODS_WATCH=0 disables watching.

Reviewed: ee31b40215 against d6e819e084: Read AGENTS.md, CONTRIBUTING.md, the pull request template, loader/hot.rs and services/reload.rs; inspected the threaded rebuild diff and relevant texture sweep excerpts. The remaining changed code, documentation, generated files and tests were not read in full.; nothing run (a code review).

Checked and fine:

  • The restart notice remains set when a new map starts loading.
  • A failed texture decoder-thread start does not mark the generation seen.
  • A replacement sweep uses the saved match for an already replaced texture.

Testing: No commands that build or run the project were executed. The supplied head run covers texture packs and repeated file-mod switches on Linux/NVIDIA; CI is still running.

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


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

**Recommendation: Approve.** The code is ready: only testing is left. Texture pack switching has been shown working, and moving file-layer rebuilding off the game thread reduced the logged main-thread work in one run. The visible file-mod behavior, frame pacing, supported-system coverage, and mergeability still need confirmation. Recommend approval; not approved on the forge. Texture packs and eligible file mods can change during play, while automatic map reloads are limited to development mode. The threaded rebuild reduces the observed main-thread work but adds concurrency and platform-specific paths that need further validation. **Testing before merging (3)** (runs on the systems it can change; it doesn't hold the recommendation) - **L4** `game/crates/api/src/loader/hot.rs:164`: The threaded rebuild's effect on frame pacing remains unmeasured. *When:* A large file mod is switched during play; the log reports worker and main-thread durations but does not show whether a frame hitches. **Do:** Measure frame times during repeated switches of a real mod, including on Steam Deck. *(`@fix` does its part first: Move or prepare the layer rebuild off the frame thread and publish the completed table at a safe point.)* - **L5** `gpu/vk/vk_texture.cpp:3077`: The live texture path has not been measured for frame pacing or checked across the supported Tier 1 systems. *When:* A pack change scans the texture collection and then hashes uploaded textures over subsequent frames; the 1 ms loop limit excludes the initial scan and cannot bound one large lookup. **Do:** Compare base and head frame times with packs absent and while switching a large pack, and exercise visible replacement and removal on Windows, AMD and Steam Deck. *(`@fix` does its part first: Incrementally build the sweep and use saved upload hashes so a single lookup does not reread and hash texture storage.)* - **L6**: The file-mod feature and the final map-reload behavior have not yet been demonstrated with a visible game change. *When:* The reported file-mod runs confirmed paths in logs, but no changed file produced a visible result; the final notice and development-mode reload were also not exercised on this head. **Do:** On this head, switch a visibly changing file mod on and off, check before and after leaving the area, and verify the restart notice and development-mode reload. `@fix` can do L4 and L5. **Since the last review** (on e1a23bcbf8de) Resolved: L1 (The sweep identifies an already uploaded texture by reading its guest storage again, rathe…); L2 (The generation is marked seen before the decoder thread has successfully started.); L3 (Starting any map load clears the restart notice even when the changed resource remains hel…); L7 (It conflicts with its base branch: bring it up to date (`@​fix` or `@​rebase` try first).) Still open: L4 (The threaded rebuild's effect on frame pacing remains unmeasured.); L5 (The live texture path has not been measured for frame pacing or checked across the support…); L6 (The file-mod feature and the final map-reload behavior have not yet been demonstrated with…) **Checks:** Still running: 9 checks. <details> <summary>Also noticed (2; not asked for, not blocking)</summary> - The pull request records that a removed mod folder can leave deleted paths in held layers until the hold clears or the game restarts. - The restart notice can miss files retained from an earlier map because the opened-path count resets at map loading. </details> <details> <summary>More: does it help, other systems, switches, what was read</summary> **Does it help:** Unproven for file mods: no visible game change has been demonstrated. Texture pack add, edit, switch, and removal worked on Linux with an NVIDIA RTX 3090. For a 237-file mod, the head logged 0–84 ms off-thread and 0–1 ms of main-thread work, versus 150 ms on the main thread before threading; these are log counts, not comparable frame-time measurements against main. **Other systems:** The renderer and file-layer paths can affect Windows, Linux, other GPU vendors, Steam Deck, sandboxed file access, and game file loads. The supplied runs cover Linux and NVIDIA with the sandbox off; the other systems and a switch during a rebuild remain untested. **Switches:** No switch was added or changed. The existing HOS_MODS_WATCH=0 disables watching. **Reviewed:** ee31b40215ec against d6e819e08433: Read AGENTS.md, CONTRIBUTING.md, the pull request template, loader/hot.rs and services/reload.rs; inspected the threaded rebuild diff and relevant texture sweep excerpts. The remaining changed code, documentation, generated files and tests were not read in full.; nothing run (a code review). **Checked and fine:** - The restart notice remains set when a new map starts loading. - A failed texture decoder-thread start does not mark the generation seen. - A replacement sweep uses the saved match for an already replaced texture. **Testing:** No commands that build or run the project were executed. The supplied head run covers texture packs and repeated file-mod switches on Linux/NVIDIA; CI is still running. **Overlaps and merge order:** Not checked; the network is closed. </details> --- <sub>Automated code review by BeanBot (gpt-6.1-terra), asked for by HumanBean. Nothing was run; a maintainer decides.</sub>
HumanBean changed title from WIP: feat(mods)!: texture packs and mods of game files load while the game runs to feat(mods)!: texture packs and mods of game files load while the game runs 2026-12-04 16:05:08 +00:00
HumanBean deleted branch feat/mods-live-files 2026-12-04 16:05:23 +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!3151
No description provided.