fix(mods)!: dev mode stops reloading the map, and the restart line and held layers keep up with file changes #3193

Merged
HumanBean merged 9 commits from HumanBean/Longshot:fix/mods-restart-note into main 2026-12-04 21:51:40 +00:00
Owner

Summary

Follows #3151. Three fixes to what happens when mod files change while the game runs.

1. Dev mode no longer reloads the map. The reload entered the map through its destination's entrance, which played a story cutscene in a run and then failed. The game's map change takes a named start point, and we know no way to reload where Link stands. Dev mode now shows the players' line, Parts of this change may need a restart to show. Fixes #3148.

2. That line now covers files loaded on an earlier map. Every map load forgot which files the game had opened, though the game keeps many of them across maps. With no reload, nothing needs to forget them.

3. A removed file no longer stays served while the layers are held. While the mods' order or a waiting switch differs from the start's, the layers are not built again, so a removed mod folder left paths pointing at nothing until a restart. Those paths are now the game's own at once. When a removed file went into a merged one (a member, a patch, one copy of a shared archive), every merged file is the game's own until the layers are built again. The look for removed files runs once a change, not each frame.

Breaking: longshot/mods-host's tab().reload has only later, and the edit reloadMap is gone.

Read first: game/crates/api/src/services/restart_note.rs (replaces reload.rs), drop_gone in game/crates/api/src/loader/hot.rs and in game/crates/content/src/layers.rs.

Known gaps:

  • Which merged file holds what of which mod is not kept, so losing one input reverts all merged files, other mods' too, until the layers are built again.
  • A content mod's stage outputs live in the cache and are not looked through when its folder is removed.
  • Past 12,288 opened files in one session every changed file counts, so the line can show for a file never loaded.
  • A removed file is served as the game's own even where another mod has a copy of the path, until the layers are built again.
  • Mod authors lose the automatic reload, though no run had seen a file change show through it.

Testing

Tested: headless game runs on Linux, NVIDIA RTX 3090, driver 620.70.06, kokiri-start, sandbox off.

On a2a62dc91eed, outside dev mode (the head, rebased onto main with one test added, has not been run):

  • a mod of one new member of Pack/Actor/Dm_Npc_Navi.pack.zs (the pack made in modcache/) and a mod of 237 texture files switched on in play (228 changed paths were loaded by the game);
  • with the layers held, deleting the member mod's folder logged 3 paths of removed files, or made with them (Pack and others): the game's own files are served, 0 ms; deleting the texture mod's folder logged the same for 238 paths, 0 ms;
  • the frame rate window after each removal was 60 fps; two map changes followed, and 2 minutes more at 60 fps for most readings (dips to 42 and 46 while the PC's load average was 11 to 22 from other jobs); no crash line or validation message.

On fe679f0eba9d (before the review fixes), dev mode, started with the image named before --mod-dev: a texture mod switched on in Hyrule Field, after leaving Kokiri Forest, logged 231 changed paths were loaded by the game, the Mods tab showed the line, and no map was reloaded. A run there ended with the frame rate near 1 fps in its last seconds; the run on the head did not show that.

Checks on Linux, before the last rebase: the tests of api, content and longshot-game, clippy with warnings as errors, cargo fmt --check, schema-gen --check, ffi-gen --check, test_sandbox_linux, test_i18n_complete and test_menu_i18n pass. The removed-file test fails without its fix and passes with it. After the review fixes (a2a62dc91eed): the tests of api, content and longshot-game, clippy of the three, cargo fmt --check and schema-gen --check pass; the merged-file test fails without its fix, and the map-load test, with its seam put on main @ 3b3ea2cb33e0, fails there. On the head (ad3874ddf604): the tests of api, content and longshot-game, cargo fmt --check and schema-gen --check pass, and test_no_map_reload passes and fails on main. Clippy of the three passes with large_const_arrays and needless_range_loop allowed, both from files this does not touch. On the head (9e6efbd43c93), with one more test and the loader holding its restart note: the tests and clippy of api (same two lints allowed) and cargo fmt --check pass. Of modtool, only the Mods tab's tests were run: one, a mod's long description and the lines after it fit the help card (#3101), fails here and on main @ b77c2f4b.

Still to test:

  • The sandbox on (started by the builder): remove a mod folder while the layers are held, expecting the log's paths of removed files line (by hand).
  • Windows: the same, and a file mod switched after a map change, expecting the line in the Mods tab (by hand).
  • Dev mode on this head (by hand).

Measurements

Nothing to measure: no change aims at speed.

Risks

  • Mod authors: dev mode no longer reloads the map; restart the game to see all of a file change.
  • Mods using longshot/mods-host: the breaking change above. Only Longshot's own mods may hold its permission.
  • Players: the line can now show for a file the game would have read again by itself.
  • No switch; reverting is enough.

Checklist

Ready for review

  • One topic, on current main; the title is a Conventional Commit. (Three related fixes 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 (any failure that also fails on main is named). (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 fix: a game-free test that fails on main and passes here. (The map-load and map-change tests fail on main. The two removed-file tests were run without their fixes on this branch, not on main.)
  • 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 #3151. Three fixes to what happens when mod files change while the game runs. **1. Dev mode no longer reloads the map.** The reload entered the map through its destination's entrance, which played a story cutscene in a run and then failed. The game's map change takes a named start point, and we know no way to reload where Link stands. Dev mode now shows the players' line, **Parts of this change may need a restart to show**. Fixes #3148. **2. That line now covers files loaded on an earlier map.** Every map load forgot which files the game had opened, though the game keeps many of them across maps. With no reload, nothing needs to forget them. **3. A removed file no longer stays served while the layers are held.** While the mods' order or a waiting switch differs from the start's, the layers are not built again, so a removed mod folder left paths pointing at nothing until a restart. Those paths are now the game's own at once. When a removed file went into a merged one (a member, a patch, one copy of a shared archive), every merged file is the game's own until the layers are built again. The look for removed files runs once a change, not each frame. **Breaking:** `longshot/mods-host`'s `tab().reload` has only `later`, and the edit `reloadMap` is gone. Read first: `game/crates/api/src/services/restart_note.rs` (replaces `reload.rs`), `drop_gone` in `game/crates/api/src/loader/hot.rs` and in `game/crates/content/src/layers.rs`. Known gaps: - Which merged file holds what of which mod is not kept, so losing one input reverts all merged files, other mods' too, until the layers are built again. - A content mod's stage outputs live in the cache and are not looked through when its folder is removed. - Past 12,288 opened files in one session every changed file counts, so the line can show for a file never loaded. - A removed file is served as the game's own even where another mod has a copy of the path, until the layers are built again. - Mod authors lose the automatic reload, though no run had seen a file change show through it. ## Testing **Tested:** headless game runs on Linux, NVIDIA RTX 3090, driver 620.70.06, `kokiri-start`, sandbox off. On `a2a62dc91eed`, outside dev mode (**the head, rebased onto `main` with one test added, has not been run**): - a mod of one new member of `Pack/Actor/Dm_Npc_Navi.pack.zs` (the pack made in `modcache/`) and a mod of 237 texture files switched on in play (`228 changed paths were loaded by the game`); - with the layers held, deleting the member mod's folder logged `3 paths of removed files, or made with them (Pack and others): the game's own files are served, 0 ms`; deleting the texture mod's folder logged the same for 238 paths, 0 ms; - the frame rate window after each removal was 60 fps; two map changes followed, and 2 minutes more at 60 fps for most readings (dips to 42 and 46 while the PC's load average was 11 to 22 from other jobs); no crash line or validation message. On `fe679f0eba9d` (before the review fixes), dev mode, started with the image named before `--mod-dev`: a texture mod switched on in Hyrule Field, after leaving Kokiri Forest, logged `231 changed paths were loaded by the game`, the Mods tab showed the line, and no map was reloaded. A run there ended with the frame rate near 1 fps in its last seconds; the run on the head did not show that. Checks on Linux, before the last rebase: the tests of `api`, `content` and `longshot-game`, clippy with warnings as errors, `cargo fmt --check`, `schema-gen --check`, `ffi-gen --check`, `test_sandbox_linux`, `test_i18n_complete` and `test_menu_i18n` pass. The removed-file test fails without its fix and passes with it. After the review fixes (`a2a62dc91eed`): the tests of `api`, `content` and `longshot-game`, clippy of the three, `cargo fmt --check` and `schema-gen --check` pass; the merged-file test fails without its fix, and the map-load test, with its seam put on `main` @ `3b3ea2cb33e0`, fails there. On the head (`ad3874ddf604`): the tests of `api`, `content` and `longshot-game`, `cargo fmt --check` and `schema-gen --check` pass, and `test_no_map_reload` passes and fails on `main`. Clippy of the three passes with `large_const_arrays` and `needless_range_loop` allowed, both from files this does not touch. On the head (`9e6efbd43c93`), with one more test and the loader holding its restart note: the tests and clippy of `api` (same two lints allowed) and `cargo fmt --check` pass. Of `modtool`, only the Mods tab's tests were run: one, `a mod's long description and the lines after it fit the help card` (#3101), fails here and on `main` @ `b77c2f4b`. **Still to test:** - The sandbox on (started by the builder): remove a mod folder while the layers are held, expecting the log's `paths of removed files` line (by hand). - Windows: the same, and a file mod switched after a map change, expecting the line in the Mods tab (by hand). - Dev mode on this head (by hand). ## Measurements Nothing to measure: no change aims at speed. ## Risks - **Mod authors:** dev mode no longer reloads the map; restart the game to see all of a file change. - **Mods using `longshot/mods-host`:** the breaking change above. Only Longshot's own mods may hold its permission. - **Players:** the line can now show for a file the game would have read again by itself. - No switch; reverting is enough. ## Checklist ### Ready for review - [ ] One topic, on current `main`; the title is a Conventional Commit. (Three related fixes 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 (any failure that also fails on `main` is named). (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 - [ ] A fix: a game-free test that fails on `main` and passes here. (The map-load and map-change tests fail on `main`. The two removed-file tests were run without their fixes on this branch, not on `main`.) - [ ] 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
The reload entered the map through its destination's entrance, which started a story cutscene in a run (#3148), and
no run saw a file change show through it. Dev mode now gets the players' line: parts of the change may need a restart.
With nothing reloading the map, nothing forgets the opened files at a map load any more, so a change to a file the game
keeps from an earlier map is said too.

BREAKING CHANGE: longshot/mods-host's tab().reload has only `later`, and the edit `reloadMap` is gone.

Closes #3148

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e1rSeTzGtqzZNG1YZH
Fails: while the layers are held the removed file's path stays in them.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e1rSeTzGtqzZNG1YZH
fix(mods): a file removed while the layers are held is served as the game's own at once
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
2d08a21f0f
While the Mods tab's order or a waiting switch differs from what the layers serve they are not built again, so a removed
mod folder left them serving paths with nothing there until a restart.

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

Tested in game: Tested in game on fe679f0eba9d: Linux, NVIDIA RTX 3090, driver 620.70.06, headless, kokiri-start, dev mode, sandbox off. A texture mod switched on after leaving Kokiri Forest logged 231 changed paths loaded by the game and the Mods tab showed the restart line, with no map reload. With the layers held, deleting the mod's folder logged 238 paths served as the game's own; two map changes followed with no crash.

🤖 Generated with Claude Code

https://claude.ai/code/session_017vw8e1rSeTzGtqzZNG1YZH

Tested in game: Tested in game on `fe679f0eba9d`: Linux, NVIDIA RTX 3090, driver 620.70.06, headless, `kokiri-start`, dev mode, sandbox off. A texture mod switched on after leaving Kokiri Forest logged 231 changed paths loaded by the game and the Mods tab showed the restart line, with no map reload. With the layers held, deleting the mod's folder logged 238 paths served as the game's own; two map changes followed with no crash. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_017vw8e1rSeTzGtqzZNG1YZH
Author
Owner
@review
BeanBot requested changes 2026-12-04 18:40:22 +00:00
Dismissed
BeanBot left a comment

Recommendation: Request changes. Removing a mod while layers are held can leave its cached merged content active, and the two restart-note fixes lack the game-free regression tests required by the repository. The reported run also leaves the cause of a late frame-rate collapse unresolved.

The change stops dev mode from re-entering the map, keeps the restart note aware of files opened on earlier maps, and falls back to game files when held layers point to removed files. It removes the risky automatic reload, but the removal handling does not account for cached merged outputs.

Blocking (2): must change before merging.

  1. L1 game/crates/content/src/layers.rs:495: Checking only the served cache file misses removed inputs to a merged file. (more on the line) Do: Track the source files or mods used by each made file and invalidate affected outputs when an input disappears; add a held-layers test with a merged archive.
  2. L2 game/crates/api/src/loader/tests.rs:1811: The tests do not exercise either the removal of automatic travel or the preservation of opened paths across a map load. (more on the line) Do: Add game-free regression tests that open a path, simulate a map transition and change it, and that verify a dev-mode change does not request travel. Make each fail on the base for its respective bug.

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

  • L3 game/crates/api/src/loader/hot.rs:470: The new held-layer scan runs filesystem metadata checks and copies the layer table on the game thread; its effect on frame pacing is unknown. (more on the line) Do: Repeat the held-layer deletion on an otherwise idle machine, comparing frame times before and after the change, and investigate the late slowdown. (@fix does its part first: Move the scan and table preparation off the game thread, or limit checks to paths affected by the notification.)
  • L4 game/crates/api/src/loader/hot.rs:467: The removal path has not been exercised on Windows or with the builder's sandbox enabled. (more on the line) Do: Run the held-folder removal with the sandbox enabled and on Windows, checking the fallback and subsequent file loads.

@fix can do L1, L2 and L3.

Checks: Still running: 11 checks.

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

Does it help: Unproven as a complete fix. A Linux run showed the restart line after a map change and no reload, and a removed texture folder was followed by two map changes without a crash. The run did not cover cached merged content, and the branch lacks game-free tests for the first two fixes.

Other systems: The changed loader runs on Windows and Linux, with and without the sandbox, and serves ordinary files, merged archives and content-stage outputs. The reported run covered Linux with the sandbox off and ordinary texture files; Windows, the sandbox and cached merged content remain unverified.

Switches: None added, changed or removed.

Reviewed: 2d08a21f0f against 3b3ea2cb33: Read the repository rules and PR template, commit log, loader and layers changes and their relevant callers, restart-note service, API and Mods tab changes, tests and schema changes. Skimmed translations and generated documentation. The complete large diff and every changed code file were not read in full; docs/review-checklist.md was absent.; nothing run (a code review).

Checked and fine:

  • The commits record AI assistance.
  • No new or changed switch is apparent in the diff.
  • The reported removed-file test exercises deletion of both a folder and an individual ordinary file.

Testing: Read-only review; no code, scripts or tests were run. The PR reports a Linux game run and pre-rebase checks; head CI is still running.

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


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

**Recommendation: Request changes.** Removing a mod while layers are held can leave its cached merged content active, and the two restart-note fixes lack the game-free regression tests required by the repository. The reported run also leaves the cause of a late frame-rate collapse unresolved. The change stops dev mode from re-entering the map, keeps the restart note aware of files opened on earlier maps, and falls back to game files when held layers point to removed files. It removes the risky automatic reload, but the removal handling does not account for cached merged outputs. **Blocking (2)**: must change before merging. 1. **L1** `game/crates/content/src/layers.rs:495`: Checking only the served cache file misses removed inputs to a merged file. (more on the line) **Do:** Track the source files or mods used by each made file and invalidate affected outputs when an input disappears; add a held-layers test with a merged archive. 2. **L2** `game/crates/api/src/loader/tests.rs:1811`: The tests do not exercise either the removal of automatic travel or the preservation of opened paths across a map load. (more on the line) **Do:** Add game-free regression tests that open a path, simulate a map transition and change it, and that verify a dev-mode change does not request travel. Make each fail on the base for its respective bug. **Testing before merging (2)** (runs on the systems it can change; it doesn't hold the recommendation) - **L3** `game/crates/api/src/loader/hot.rs:470`: The new held-layer scan runs filesystem metadata checks and copies the layer table on the game thread; its effect on frame pacing is unknown. (more on the line) **Do:** Repeat the held-layer deletion on an otherwise idle machine, comparing frame times before and after the change, and investigate the late slowdown. *(`@fix` does its part first: Move the scan and table preparation off the game thread, or limit checks to paths affected by the notification.)* - **L4** `game/crates/api/src/loader/hot.rs:467`: The removal path has not been exercised on Windows or with the builder's sandbox enabled. (more on the line) **Do:** Run the held-folder removal with the sandbox enabled and on Windows, checking the fallback and subsequent file loads. `@fix` can do L1, L2 and L3. **Checks:** Still running: 11 checks. <details> <summary>More: does it help, other systems, switches, what was read</summary> **Does it help:** Unproven as a complete fix. A Linux run showed the restart line after a map change and no reload, and a removed texture folder was followed by two map changes without a crash. The run did not cover cached merged content, and the branch lacks game-free tests for the first two fixes. **Other systems:** The changed loader runs on Windows and Linux, with and without the sandbox, and serves ordinary files, merged archives and content-stage outputs. The reported run covered Linux with the sandbox off and ordinary texture files; Windows, the sandbox and cached merged content remain unverified. **Switches:** None added, changed or removed. **Reviewed:** 2d08a21f0f04 against 3b3ea2cb33e0: Read the repository rules and PR template, commit log, loader and layers changes and their relevant callers, restart-note service, API and Mods tab changes, tests and schema changes. Skimmed translations and generated documentation. The complete large diff and every changed code file were not read in full; docs/review-checklist.md was absent.; nothing run (a code review). **Checked and fine:** - The commits record AI assistance. - No new or changed switch is apparent in the diff. - The reported removed-file test exercises deletion of both a folder and an individual ordinary file. **Testing:** Read-only review; no code, scripts or tests were run. The PR reports a Linux game run and pre-rebase checks; head 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>
@ -460,0 +464,4 @@
/// While the layers are held (the list's order or a waiting switch differs), a file of theirs that is no more (its
/// mod's folder removed) is served as the game's own, so no open is given a path with nothing there. Only while no
/// rebuild runs.
fn drop_gone(&mut self, host: &dyn LayersHost) {
Member

L4 (should fix): The removal path has not been exercised on Windows or with the builder's sandbox enabled.

When: Players on those configurations can delete a held mod folder, but the reported run only establishes the fallback on Linux with the sandbox off.

Do: Run the held-folder removal with the sandbox enabled and on Windows, checking the fallback and subsequent file loads.

**L4** (should fix): The removal path has not been exercised on Windows or with the builder's sandbox enabled. *When:* Players on those configurations can delete a held mod folder, but the reported run only establishes the fallback on Linux with the sandbox off. **Do:** Run the held-folder removal with the sandbox enabled and on Windows, checking the fallback and subsequent file loads.
@ -460,0 +467,4 @@
fn drop_gone(&mut self, host: &dyn LayersHost) {
let Ok(mut b) = host.layers().rebuild() else { return };
let disk = &self.cfg.disk;
let gone = b.drop_gone(|p| disk.kind(p).is_none());
Member

L3 (should fix): The new held-layer scan runs filesystem metadata checks and copies the layer table on the game thread; its effect on frame pacing is unknown.

When: A change while layers are held scans the served paths synchronously. The reported deletion run fell from about 60 fps to 1 fps later in the session, and the reported competing CPU load does not establish the cause.

Do: Repeat the held-layer deletion on an otherwise idle machine, comparing frame times before and after the change, and investigate the late slowdown.

**L3** (should fix): The new held-layer scan runs filesystem metadata checks and copies the layer table on the game thread; its effect on frame pacing is unknown. *When:* A change while layers are held scans the served paths synchronously. The reported deletion run fell from about 60 fps to 1 fps later in the session, and the reported competing CPU load does not establish the cause. **Do:** Repeat the held-layer deletion on an otherwise idle machine, comparing frame times before and after the change, and investigate the late slowdown.
@ -1812,3 +1809,3 @@
assert_eq!(served(&LAYERS, &disk, "UI/x.bin").as_deref(), Some(&b"three"[..]), "served anew from its next load");
assert_eq!(served(&LAYERS, &disk, "UI/new.bin").as_deref(), Some(&b"added"[..]));
assert!(crate::services::reload::RELOAD.offer().later, "said, with no reload offered");
assert!(crate::services::restart_note::RESTART_NOTE.due(), "said");
Member

L2 (blocking): The tests do not exercise either the removal of automatic travel or the preservation of opened paths across a map load.

When: The existing assertion checks a process-wide restart flag after a file change, without a map transition; it can pass even if map loading starts clearing opened paths again. No test would fail if dev mode resumed requesting the map reload.

Do: Add game-free regression tests that open a path, simulate a map transition and change it, and that verify a dev-mode change does not request travel. Make each fail on the base for its respective bug.

**L2** (blocking): The tests do not exercise either the removal of automatic travel or the preservation of opened paths across a map load. *When:* The existing assertion checks a process-wide restart flag after a file change, without a map transition; it can pass even if map loading starts clearing opened paths again. No test would fail if dev mode resumed requesting the map reload. **Do:** Add game-free regression tests that open a path, simulate a map transition and change it, and that verify a dev-mode change does not request travel. Make each fail on the base for its respective bug.
@ -487,0 +492,4 @@
self.table = Table::clone(base);
self.table.served.retain(|s| !gone(&s.host));
for p in self.table.paths.values_mut() {
if p.made.as_deref().or(p.copies.last().map(|c| c.host.as_path())).is_some_and(&gone) {
Member

L1 (blocking): Checking only the served cache file misses removed inputs to a merged file.

When: When two mods contribute to an archive, the merge serves a file under modcache. If one contributing mod is deleted while layers are held, that cached file still exists, so this condition leaves it live and subsequent opens continue to include the deleted mod's content.

Do: Track the source files or mods used by each made file and invalidate affected outputs when an input disappears; add a held-layers test with a merged archive.

**L1** (blocking): Checking only the served cache file misses removed inputs to a merged file. *When:* When two mods contribute to an archive, the merge serves a file under modcache. If one contributing mod is deleted while layers are held, that cached file still exists, so this condition leaves it live and subsequent opens continue to include the deleted mod's content. **Do:** Track the source files or mods used by each made file and invalidate affected outputs when an input disappears; add a held-layers test with a merged archive.
Fails: the file made in the cache is still there, so it stays served with the removed mod's member in it.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e1rSeTzGtqzZNG1YZH
A merged file lives in the cache, so deleting its mod left it served. Which made file holds what of which mod's file is
not kept, so when any file the merge read is gone every made file is the game's own until the layers are built again.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e1rSeTzGtqzZNG1YZH
Every frame the Mods tab refreshed while a mod switched off or removed was still served copied the layer table and
looked at every served file on the game's thread.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017vw8e1rSeTzGtqzZNG1YZH
test(mods): a map load keeps the opened files noted
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
a2a62dc91e
The map events' dispatch is a function of its own so a test can run it. Put on main it fails: each map load forgot the
opened files.

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

Pushed a2a62dc91eed, four commits on top of 2d08a21f0f04. Not run in the game.

  • L1 fixed. The table now keeps the member, patch and pack-spec files the merge read. When one of them, or a copy of a merged archive, is gone, every merged file is served as the game's own: which merged file holds what of which mod is not kept, so this is coarser than asked. Test: a_merged_file_of_a_removed_mod_leaves_the_held_layers (fails without the fix).
  • L2 part done. a_map_load_keeps_the_opened_files_noted runs the map events' dispatch (now a function of its own) and fails when that seam is put on main. For dev mode's travel there is nothing left to drive: the reload code is gone, and longshot/mods-host's tests assert the reloadMap edit is refused, which it was not on main.
  • L3 part done. The sweep ran on every Mods tab refresh while a removed mod was still served; it now runs once a change, and the log gives its time. It is still on the game's thread. The frame rate on an idle PC and the late slowdown are not looked into yet.
  • L4 not done: Windows and the sandbox are still under Still to test.

🤖 Generated with Claude Code

https://claude.ai/code/session_017vw8e1rSeTzGtqzZNG1YZH

Pushed `a2a62dc91eed`, four commits on top of `2d08a21f0f04`. Not run in the game. - **L1** fixed. The table now keeps the member, patch and pack-spec files the merge read. When one of them, or a copy of a merged archive, is gone, every merged file is served as the game's own: which merged file holds what of which mod is not kept, so this is coarser than asked. Test: `a_merged_file_of_a_removed_mod_leaves_the_held_layers` (fails without the fix). - **L2** part done. `a_map_load_keeps_the_opened_files_noted` runs the map events' dispatch (now a function of its own) and fails when that seam is put on `main`. For dev mode's travel there is nothing left to drive: the reload code is gone, and `longshot/mods-host`'s tests assert the `reloadMap` edit is refused, which it was not on `main`. - **L3** part done. The sweep ran on every Mods tab refresh while a removed mod was still served; it now runs once a change, and the log gives its time. It is still on the game's thread. The frame rate on an idle PC and the late slowdown are not looked into yet. - **L4** not done: Windows and the sandbox are still under Still to test. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_017vw8e1rSeTzGtqzZNG1YZH
Author
Owner
@review
BeanBot requested changes 2026-12-04 20:14:57 +00:00
Dismissed
BeanBot left a comment

Recommendation: Request changes. The tests still do not exercise removal of automatic travel.

The change stops dev mode from reloading the map, preserves the restart notice across maps, and removes missing files from held layers. The merged-file fix is deliberately coarse, and the new scan suppression misses some later deletions.

Blocking (1): must change before merging.

  1. L2 game/crates/api/src/loader/tests.rs:1811: The tests do not exercise either the removal of automatic travel or the preservation of opened paths across a map load. When: The existing assertion checks a process-wide restart flag after a file change, without a map transition; it can pass even if map loading starts clearing opened paths again. No test would fail if dev mode resumed requesting the map reload. Do: Add game-free regression tests that open a path, simulate a map transition and change it, and that verify a dev-mode change does not request travel. Make each fail on the base for its respective bug.

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

  • L3 game/crates/api/src/loader/hot.rs:470: The new held-layer scan runs filesystem metadata checks and copies the layer table on the game thread; its effect on frame pacing is unknown. When: A change while layers are held scans the served paths synchronously. The reported deletion run fell from about 60 fps to 1 fps later in the session, and the reported competing CPU load does not establish the cause. Do: Repeat the held-layer deletion on an otherwise idle machine, comparing frame times before and after the change, and investigate the late slowdown. (@fix does its part first: Move the scan and table preparation off the game thread, or limit checks to paths affected by the notification.)
  • L4 game/crates/api/src/loader/hot.rs:467: The removal path has not been exercised on Windows or with the builder's sandbox enabled. When: Players on those configurations can delete a held mod folder, but the reported run only establishes the fallback on Linux with the sandbox off. Do: Run the held-folder removal with the sandbox enabled and on Windows, checking the fallback and subsequent file loads.

@fix can do L2 and L3.

Since the last review (on 2d08a21f0f)
Resolved: L1 (Checking only the served cache file misses removed inputs to a merged file.)
Still open: L2 (The tests do not exercise either the removal of automatic travel or the preservation of op…); L3 (The new held-layer scan runs filesystem metadata checks and copies the layer table on the…); L4 (The removal path has not been exercised on Windows or with the builder's sandbox enabled.)

Checks: Still running: 11 checks.

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

Does it help: Unproven on the current head. An earlier Linux run showed the restart notice without a map reload and removed a mod folder from held layers; the current head has not been run in the game.

Other systems: The removal path also runs on Windows and under the builder sandbox; neither has been exercised on this head. Merged files from other mods revert to the game's own files when any recorded merge input disappears.

Switches: No switches added, changed, or removed.

Reviewed: a2a62dc91e against 3b3ea2cb33: Read the repository rules and pull request template, the changes since the ledger head, and the code and tests around the changed scan, merge inputs, and map event dispatch. The full base-to-head code diff, all changed files, generated files, and translations were not read in full.; nothing run (a code review).

Checked and fine:

  • The merged-file test covers a removed archive member while an unrelated direct file remains served.
  • The map-load test dispatches both loading and loaded events and checks that an opened path remains recorded.

Testing: No commands that build or run the project were executed. The author reports passing targeted checks on this head; the in-game runs were on an earlier head, and CI is still running.

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


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

**Recommendation: Request changes.** The tests still do not exercise removal of automatic travel. The change stops dev mode from reloading the map, preserves the restart notice across maps, and removes missing files from held layers. The merged-file fix is deliberately coarse, and the new scan suppression misses some later deletions. **Blocking (1)**: must change before merging. 1. **L2** `game/crates/api/src/loader/tests.rs:1811`: The tests do not exercise either the removal of automatic travel or the preservation of opened paths across a map load. *When:* The existing assertion checks a process-wide restart flag after a file change, without a map transition; it can pass even if map loading starts clearing opened paths again. No test would fail if dev mode resumed requesting the map reload. **Do:** Add game-free regression tests that open a path, simulate a map transition and change it, and that verify a dev-mode change does not request travel. Make each fail on the base for its respective bug. **Testing before merging (2)** (runs on the systems it can change; it doesn't hold the recommendation) - **L3** `game/crates/api/src/loader/hot.rs:470`: The new held-layer scan runs filesystem metadata checks and copies the layer table on the game thread; its effect on frame pacing is unknown. *When:* A change while layers are held scans the served paths synchronously. The reported deletion run fell from about 60 fps to 1 fps later in the session, and the reported competing CPU load does not establish the cause. **Do:** Repeat the held-layer deletion on an otherwise idle machine, comparing frame times before and after the change, and investigate the late slowdown. *(`@fix` does its part first: Move the scan and table preparation off the game thread, or limit checks to paths affected by the notification.)* - **L4** `game/crates/api/src/loader/hot.rs:467`: The removal path has not been exercised on Windows or with the builder's sandbox enabled. *When:* Players on those configurations can delete a held mod folder, but the reported run only establishes the fallback on Linux with the sandbox off. **Do:** Run the held-folder removal with the sandbox enabled and on Windows, checking the fallback and subsequent file loads. `@fix` can do L2 and L3. **Since the last review** (on 2d08a21f0f04) Resolved: L1 (Checking only the served cache file misses removed inputs to a merged file.) Still open: L2 (The tests do not exercise either the removal of automatic travel or the preservation of op…); L3 (The new held-layer scan runs filesystem metadata checks and copies the layer table on the…); L4 (The removal path has not been exercised on Windows or with the builder's sandbox enabled.) **Checks:** Still running: 11 checks. <details> <summary>More: does it help, other systems, switches, what was read</summary> **Does it help:** Unproven on the current head. An earlier Linux run showed the restart notice without a map reload and removed a mod folder from held layers; the current head has not been run in the game. **Other systems:** The removal path also runs on Windows and under the builder sandbox; neither has been exercised on this head. Merged files from other mods revert to the game's own files when any recorded merge input disappears. **Switches:** No switches added, changed, or removed. **Reviewed:** a2a62dc91eed against 3b3ea2cb33e0: Read the repository rules and pull request template, the changes since the ledger head, and the code and tests around the changed scan, merge inputs, and map event dispatch. The full base-to-head code diff, all changed files, generated files, and translations were not read in full.; nothing run (a code review). **Checked and fine:** - The merged-file test covers a removed archive member while an unrelated direct file remains served. - The map-load test dispatches both loading and loaded events and checks that an opened path remains recorded. **Testing:** No commands that build or run the project were executed. The author reports passing targeted checks on this head; the in-game runs were on an earlier head, and CI is still running. **Overlaps and merge order:** Not checked; network access is closed. </details> --- <sub>Automated code review by BeanBot (gpt-6.1-terra), asked for by HumanBean. Nothing was run; a maintainer decides.</sub>
Author
Owner

Tested in game on a2a62dc91eed (headless, Linux, NVIDIA RTX 3090, driver 620.70.06, outside dev mode, sandbox off), for L1 and L3:

  • With the layers held, a removed mod whose member had gone into a made pack: its 3 paths, the pack among them, went back to the game's own. A removed 237-file texture mod: 238 paths. Both sweeps logged 0 ms.
  • The frame rate window after each removal was 60 fps, and the end-of-run slowdown of the earlier run did not recur. The PC was not idle (load average 11 to 22), so this is not L3's idle-PC comparison.

🤖 Generated with Claude Code

https://claude.ai/code/session_017vw8e1rSeTzGtqzZNG1YZH

Tested in game on `a2a62dc91eed` (headless, Linux, NVIDIA RTX 3090, driver 620.70.06, outside dev mode, sandbox off), for **L1** and **L3**: - With the layers held, a removed mod whose member had gone into a made pack: its 3 paths, the pack among them, went back to the game's own. A removed 237-file texture mod: 238 paths. Both sweeps logged 0 ms. - The frame rate window after each removal was 60 fps, and the end-of-run slowdown of the earlier run did not recur. The PC was not idle (load average 11 to 22), so this is not L3's idle-PC comparison. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_017vw8e1rSeTzGtqzZNG1YZH
Author
Owner
@review
BeanBot requested changes 2026-12-04 21:24:43 +00:00
Dismissed
BeanBot left a comment

Recommendation: Request changes. The map-load test covers retained opened paths, but there is still no game-free test that changes a file in dev mode and verifies that automatic travel does not occur. The held-layer scan also needs frame-pacing and platform testing.

Dev mode stops automatically reloading the map, restart notices retain knowledge of files opened on earlier maps, and held layers fall back to game files when mod files disappear. The fallback deliberately reverts all merged files when a merged input disappears, and the scan adds filesystem work on the game thread.

Blocking (1): must change before merging.

  1. L2 game/crates/api/src/loader/tests.rs:1811: The tests do not exercise either the removal of automatic travel or the preservation of opened paths across a map load. When: The existing assertion checks a process-wide restart flag after a file change, without a map transition; it can pass even if map loading starts clearing opened paths again. No test would fail if dev mode resumed requesting the map reload. Do: Add game-free regression tests that open a path, simulate a map transition and change it, and that verify a dev-mode change does not request travel. Make each fail on the base for its respective bug.

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

  • L3 game/crates/api/src/loader/hot.rs:470: The new held-layer scan runs filesystem metadata checks and copies the layer table on the game thread; its effect on frame pacing is unknown. When: A change while layers are held scans the served paths synchronously. The reported deletion run fell from about 60 fps to 1 fps later in the session, and the reported competing CPU load does not establish the cause. Do: Repeat the held-layer deletion on an otherwise idle machine, comparing frame times before and after the change, and investigate the late slowdown. (@fix does its part first: Move the scan and table preparation off the game thread, or limit checks to paths affected by the notification.)
  • L4 game/crates/api/src/loader/hot.rs:467: The removal path has not been exercised on Windows or with the builder's sandbox enabled. When: Players on those configurations can delete a held mod folder, but the reported run only establishes the fallback on Linux with the sandbox off. Do: Run the held-folder removal with the sandbox enabled and on Windows, checking the fallback and subsequent file loads.

@fix can do L2 and L3.

Since the last review (on a2a62dc91e)
Still open: L2 (The tests do not exercise either the removal of automatic travel or the preservation of op…); L3 (The new held-layer scan runs filesystem metadata checks and copies the layer table on the…); L4 (The removal path has not been exercised on Windows or with the builder's sandbox enabled.)

Checks: Still running: 11 checks.

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

Does it help: Unproven for the complete fix: the earlier dev-mode run showed the restart line without a map reload, and the head run showed removed files reverting, but dev mode has not been run on this head. This is not a claimed performance improvement; the head scan logged 0 ms in two removal cases, without an idle-PC frame-pacing comparison.

Other systems: Windows and the builder sandbox can affect file visibility and removal behavior and remain untested. Linux with sandbox off was exercised on the head; merged files fall back together, and cached content-stage outputs are not checked when their mod folder is removed.

Switches: No switches added, changed, or removed. The mods-host reloadMap edit and automatic dev-mode reload behavior are removed.

Reviewed: a2a62dc91e against 3b3ea2cb33: Read AGENTS.md, CONTRIBUTING.md, the pull request template, the ledger, description and reported runs; inspected the relevant diffs and code for map events, opened paths and held-layer removal. The remaining changed code, documentation, translations and generated material were not read in full. No review checklist was present at docs/review-checklist.md.; nothing run (a code review).

Checked and fine:

  • The map-event test checks that an opened path remains noted after loading and loaded events.
  • The reported head run exercised removal of both a merged member mod and a texture mod with held layers.

Testing: No commands that build, run tests, or execute project code were run for this review. The author reports passing targeted tests and checks; CI is still running.

Overlaps and merge order: Not checked.


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

**Recommendation: Request changes.** The map-load test covers retained opened paths, but there is still no game-free test that changes a file in dev mode and verifies that automatic travel does not occur. The held-layer scan also needs frame-pacing and platform testing. Dev mode stops automatically reloading the map, restart notices retain knowledge of files opened on earlier maps, and held layers fall back to game files when mod files disappear. The fallback deliberately reverts all merged files when a merged input disappears, and the scan adds filesystem work on the game thread. **Blocking (1)**: must change before merging. 1. **L2** `game/crates/api/src/loader/tests.rs:1811`: The tests do not exercise either the removal of automatic travel or the preservation of opened paths across a map load. *When:* The existing assertion checks a process-wide restart flag after a file change, without a map transition; it can pass even if map loading starts clearing opened paths again. No test would fail if dev mode resumed requesting the map reload. **Do:** Add game-free regression tests that open a path, simulate a map transition and change it, and that verify a dev-mode change does not request travel. Make each fail on the base for its respective bug. **Testing before merging (2)** (runs on the systems it can change; it doesn't hold the recommendation) - **L3** `game/crates/api/src/loader/hot.rs:470`: The new held-layer scan runs filesystem metadata checks and copies the layer table on the game thread; its effect on frame pacing is unknown. *When:* A change while layers are held scans the served paths synchronously. The reported deletion run fell from about 60 fps to 1 fps later in the session, and the reported competing CPU load does not establish the cause. **Do:** Repeat the held-layer deletion on an otherwise idle machine, comparing frame times before and after the change, and investigate the late slowdown. *(`@fix` does its part first: Move the scan and table preparation off the game thread, or limit checks to paths affected by the notification.)* - **L4** `game/crates/api/src/loader/hot.rs:467`: The removal path has not been exercised on Windows or with the builder's sandbox enabled. *When:* Players on those configurations can delete a held mod folder, but the reported run only establishes the fallback on Linux with the sandbox off. **Do:** Run the held-folder removal with the sandbox enabled and on Windows, checking the fallback and subsequent file loads. `@fix` can do L2 and L3. **Since the last review** (on a2a62dc91eed) Still open: L2 (The tests do not exercise either the removal of automatic travel or the preservation of op…); L3 (The new held-layer scan runs filesystem metadata checks and copies the layer table on the…); L4 (The removal path has not been exercised on Windows or with the builder's sandbox enabled.) **Checks:** Still running: 11 checks. <details> <summary>More: does it help, other systems, switches, what was read</summary> **Does it help:** Unproven for the complete fix: the earlier dev-mode run showed the restart line without a map reload, and the head run showed removed files reverting, but dev mode has not been run on this head. This is not a claimed performance improvement; the head scan logged 0 ms in two removal cases, without an idle-PC frame-pacing comparison. **Other systems:** Windows and the builder sandbox can affect file visibility and removal behavior and remain untested. Linux with sandbox off was exercised on the head; merged files fall back together, and cached content-stage outputs are not checked when their mod folder is removed. **Switches:** No switches added, changed, or removed. The mods-host reloadMap edit and automatic dev-mode reload behavior are removed. **Reviewed:** a2a62dc91eed against 3b3ea2cb33e0: Read AGENTS.md, CONTRIBUTING.md, the pull request template, the ledger, description and reported runs; inspected the relevant diffs and code for map events, opened paths and held-layer removal. The remaining changed code, documentation, translations and generated material were not read in full. No review checklist was present at docs/review-checklist.md.; nothing run (a code review). **Checked and fine:** - The map-event test checks that an opened path remains noted after loading and loaded events. - The reported head run exercised removal of both a merged member mod and a texture mod with held layers. **Testing:** No commands that build, run tests, or execute project code were run for this review. The author reports passing targeted tests and checks; CI is still running. **Overlaps and merge order:** Not checked. </details> --- <sub>Automated code review by BeanBot (gpt-6.1-terra), asked for by HumanBean. Nothing was run; a maintainer decides.</sub>
HumanBean added this to the v4 milestone 2026-12-04 21:30:56 +00:00
HumanBean force-pushed fix/mods-restart-note from a2a62dc91e
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 ad3874ddf6
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 21:39:06 +00:00
Compare
Author
Owner

Pushed ad3874ddf604: rebased onto current main (no conflicts), with one test added. The head has not been run in the game.

  • L2: tests/test_no_map_reload.py fails when anything in the mod API other than world.travel asks the game for a map change, and fails on main for dev mode's reload. It reads the sources rather than driving dev mode: the game's side of a map change needs game state that no game-free test has. The retained paths are covered by a_map_load_keeps_the_opened_files_noted.
  • L3: unchanged. The sweep runs once a change and logged 0 ms in both removals on a2a62dc91eed; an idle-PC comparison is still not done.
  • L4: unchanged; Windows and the sandbox are under Still to test.

🤖 Generated with Claude Code

https://claude.ai/code/session_017vw8e1rSeTzGtqzZNG1YZH

Pushed `ad3874ddf604`: rebased onto current `main` (no conflicts), with one test added. The head has not been run in the game. - **L2:** `tests/test_no_map_reload.py` fails when anything in the mod API other than `world.travel` asks the game for a map change, and fails on `main` for dev mode's reload. It reads the sources rather than driving dev mode: the game's side of a map change needs game state that no game-free test has. The retained paths are covered by `a_map_load_keeps_the_opened_files_noted`. - **L3:** unchanged. The sweep runs once a change and logged 0 ms in both removals on `a2a62dc91eed`; an idle-PC comparison is still not done. - **L4:** unchanged; Windows and the sandbox are under Still to test. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_017vw8e1rSeTzGtqzZNG1YZH
Author
Owner
@review
BeanBot requested changes 2026-12-04 21:40:58 +00:00
Dismissed
BeanBot left a comment

Recommendation: Request changes. The map-load test now checks retained paths, but the new source scan does not exercise a dev-mode file change or verify its effect on travel. Frame pacing and the Windows and sandbox removal paths also remain unmeasured.

The change stops dev mode from automatically reloading the map, retains the restart note across maps, and stops held layers serving removed files. It removes the reload machinery at the cost of requiring mod authors to restart for some changes and temporarily reverting affected merged files.

Blocking (1): must change before merging.

  1. L2 game/crates/api/src/loader/tests.rs:1811: The tests do not exercise either the removal of automatic travel or the preservation of opened paths across a map load. When: The existing assertion checks a process-wide restart flag after a file change, without a map transition; it can pass even if map loading starts clearing opened paths again. No test would fail if dev mode resumed requesting the map reload. Do: Add game-free regression tests that open a path, simulate a map transition and change it, and that verify a dev-mode change does not request travel. Make each fail on the base for its respective bug.

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

  • L3 game/crates/api/src/loader/hot.rs:470: The new held-layer scan runs filesystem metadata checks and copies the layer table on the game thread; its effect on frame pacing is unknown. When: A change while layers are held scans the served paths synchronously. The reported deletion run fell from about 60 fps to 1 fps later in the session, and the reported competing CPU load does not establish the cause. Do: Repeat the held-layer deletion on an otherwise idle machine, comparing frame times before and after the change, and investigate the late slowdown. (@fix does its part first: Move the scan and table preparation off the game thread, or limit checks to paths affected by the notification.)
  • L4 game/crates/api/src/loader/hot.rs:467: The removal path has not been exercised on Windows or with the builder's sandbox enabled. When: Players on those configurations can delete a held mod folder, but the reported run only establishes the fallback on Linux with the sandbox off. Do: Run the held-folder removal with the sandbox enabled and on Windows, checking the fallback and subsequent file loads.

@fix can do L2 and L3.

Since the last review (on a2a62dc91e)
Still open: L2 (The tests do not exercise either the removal of automatic travel or the preservation of op…); L3 (The new held-layer scan runs filesystem metadata checks and copies the layer table on the…); L4 (The removal path has not been exercised on Windows or with the builder's sandbox enabled.)

Checks: Still running: 11 checks.

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

Does it help: Unproven for the full fix. The reported Linux dev-mode run showed the restart line after a map change without reloading the map; held-layer removals logged 0 ms for 3 and 238 paths on an earlier head. The current head has not been run in game.

Other systems: The removal path affects filesystem access on Windows and under the builder sandbox; neither has been exercised. The held-layer scan runs on the game thread, so its frame-pacing cost remains unknown.

Switches: None added, changed or removed.

Reviewed: ad3874ddf6 against f7d6d3bf61: Read AGENTS.md, CONTRIBUTING.md, the pull request template, restart_note.rs and test_no_map_reload.py in full. Read the relevant hot.rs and game.rs diffs, travel call sites, and the view.ts diff; the remaining changed files and project standards were not read in full.; nothing run (a code review).

Checked and fine:

  • The map-event test checks that an opened path remains recorded after loading and loaded events.
  • The source scan detects the former direct travel calls outside the world service.

Testing: No commands from the project were run. The author reports passing game-free checks on HEAD and Linux game runs on earlier revisions; CI is still running.

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


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

**Recommendation: Request changes.** The map-load test now checks retained paths, but the new source scan does not exercise a dev-mode file change or verify its effect on travel. Frame pacing and the Windows and sandbox removal paths also remain unmeasured. The change stops dev mode from automatically reloading the map, retains the restart note across maps, and stops held layers serving removed files. It removes the reload machinery at the cost of requiring mod authors to restart for some changes and temporarily reverting affected merged files. **Blocking (1)**: must change before merging. 1. **L2** `game/crates/api/src/loader/tests.rs:1811`: The tests do not exercise either the removal of automatic travel or the preservation of opened paths across a map load. *When:* The existing assertion checks a process-wide restart flag after a file change, without a map transition; it can pass even if map loading starts clearing opened paths again. No test would fail if dev mode resumed requesting the map reload. **Do:** Add game-free regression tests that open a path, simulate a map transition and change it, and that verify a dev-mode change does not request travel. Make each fail on the base for its respective bug. **Testing before merging (2)** (runs on the systems it can change; it doesn't hold the recommendation) - **L3** `game/crates/api/src/loader/hot.rs:470`: The new held-layer scan runs filesystem metadata checks and copies the layer table on the game thread; its effect on frame pacing is unknown. *When:* A change while layers are held scans the served paths synchronously. The reported deletion run fell from about 60 fps to 1 fps later in the session, and the reported competing CPU load does not establish the cause. **Do:** Repeat the held-layer deletion on an otherwise idle machine, comparing frame times before and after the change, and investigate the late slowdown. *(`@fix` does its part first: Move the scan and table preparation off the game thread, or limit checks to paths affected by the notification.)* - **L4** `game/crates/api/src/loader/hot.rs:467`: The removal path has not been exercised on Windows or with the builder's sandbox enabled. *When:* Players on those configurations can delete a held mod folder, but the reported run only establishes the fallback on Linux with the sandbox off. **Do:** Run the held-folder removal with the sandbox enabled and on Windows, checking the fallback and subsequent file loads. `@fix` can do L2 and L3. **Since the last review** (on a2a62dc91eed) Still open: L2 (The tests do not exercise either the removal of automatic travel or the preservation of op…); L3 (The new held-layer scan runs filesystem metadata checks and copies the layer table on the…); L4 (The removal path has not been exercised on Windows or with the builder's sandbox enabled.) **Checks:** Still running: 11 checks. <details> <summary>More: does it help, other systems, switches, what was read</summary> **Does it help:** Unproven for the full fix. The reported Linux dev-mode run showed the restart line after a map change without reloading the map; held-layer removals logged 0 ms for 3 and 238 paths on an earlier head. The current head has not been run in game. **Other systems:** The removal path affects filesystem access on Windows and under the builder sandbox; neither has been exercised. The held-layer scan runs on the game thread, so its frame-pacing cost remains unknown. **Switches:** None added, changed or removed. **Reviewed:** ad3874ddf604 against f7d6d3bf611e: Read AGENTS.md, CONTRIBUTING.md, the pull request template, restart_note.rs and test_no_map_reload.py in full. Read the relevant hot.rs and game.rs diffs, travel call sites, and the view.ts diff; the remaining changed files and project standards were not read in full.; nothing run (a code review). **Checked and fine:** - The map-event test checks that an opened path remains recorded after loading and loaded events. - The source scan detects the former direct travel calls outside the world service. **Testing:** No commands from the project were run. The author reports passing game-free checks on HEAD and Linux game runs on earlier revisions; CI is still running. **Overlaps and merge order:** Not checked; network access is closed. </details> --- <sub>Automated code review by BeanBot (gpt-6.1-terra), asked for by HumanBean. Nothing was run; a maintainer decides.</sub>
test(mods): a file changed after a map load is noted and asks no map change
Some checks failed
CI / What the change needs (pull_request) Successful in 8s
CI / Third-party parts and guide screenshots (pull_request) Successful in 12s
PR description / Title and description (pull_request_target) Failing after 7s
CI / Lint (pre-commit, ShellCheck, actionlint) (pull_request) Successful in 17s
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Failing after 1m26s
CI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request) Failing after 13m38s
CI / Renderer build check (Windows, compile --only renderer, without and with FSR 4) (pull_request) Successful in 9m43s
CI / Renderer build check (Linux, compile --only renderer, without and with FSR 4) (pull_request) Successful in 12m44s
CI / Website build and checks (pull_request) Failing after 39s
CI / Game-free checks (run_all.py, part 2/2) (pull_request) Failing after 47m38s
CI / Game-free checks (run_all.py, part 1/2) (pull_request) Failing after 1h0m4s
9e6efbd43c
The loader holds its restart note, so a test has its own rather than the process's.

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

Pushed 9e6efbd43c93 for L2. Not run in the game.

a_file_changed_after_a_map_load_is_noted_and_takes_no_one_to_a_map opens a file, runs a map load, changes the file, and asserts that the change is noted (on a note of the test's own, not the process's) and that nothing asked the game for a map change in between.

On main, dev mode's reload asked for the change only with the game in play, which no game-free test here has, so this test is not claimed to fail there for the travel half. test_no_map_reload.py is the check that does fail on main. Faking a running game to drive it is left out on purpose, by the author's choice.

🤖 Generated with Claude Code

https://claude.ai/code/session_017vw8e1rSeTzGtqzZNG1YZH

Pushed `9e6efbd43c93` for **L2**. Not run in the game. `a_file_changed_after_a_map_load_is_noted_and_takes_no_one_to_a_map` opens a file, runs a map load, changes the file, and asserts that the change is noted (on a note of the test's own, not the process's) and that nothing asked the game for a map change in between. On `main`, dev mode's reload asked for the change only with the game in play, which no game-free test here has, so this test is not claimed to fail there for the travel half. `test_no_map_reload.py` is the check that does fail on `main`. Faking a running game to drive it is left out on purpose, by the author's choice. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_017vw8e1rSeTzGtqzZNG1YZH
Author
Owner
@review
BeanBot left a comment

Recommendation: Request changes. The new test covers retained opened paths, but it does not exercise the in-play dev-mode reload behavior that caused the unwanted travel. The platform and frame-pacing runs also remain outstanding.

The change stops dev mode from reloading the map, retains opened-file tracking across maps, and falls back to game files when held mod layers lose inputs. It removes a disruptive reload at the cost of requiring restarts for some changes and using coarse fallback for merged files.

Blocking (1): must change before merging.

  1. L2 game/crates/api/src/loader/tests.rs:1811: The new test covers the retained paths but does not exercise the in-play dev-mode automatic travel that caused the original bug. When: A file changes in dev mode while the game is in play; the former reload could ask for travel, but this test's setup does not put the game in that state and therefore would not detect that behavior. Do: Add a game-free behavioral test that drives the dev-mode change in an in-play state and verifies no automatic map-change request; it should fail with the former reload behavior.

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

  • L3 game/crates/api/src/loader/hot.rs:470: The new held-layer scan runs filesystem metadata checks and copies the layer table on the game thread; its effect on frame pacing is unknown. When: A change while layers are held scans the served paths synchronously. The reported deletion run fell from about 60 fps to 1 fps later in the session, and the reported competing CPU load does not establish the cause. Do: Repeat the held-layer deletion on an otherwise idle machine, comparing frame times before and after the change, and investigate the late slowdown. (@fix does its part first: Move the scan and table preparation off the game thread, or limit checks to paths affected by the notification.)
  • L4 game/crates/api/src/loader/hot.rs:467: The removal path has not been exercised on Windows or with the builder's sandbox enabled. When: Players on those configurations can delete a held mod folder, but the reported run only establishes the fallback on Linux with the sandbox off. Do: Run the held-folder removal with the sandbox enabled and on Windows, checking the fallback and subsequent file loads.

@fix can do L2 and L3.

Since the last review (on ad3874ddf6)
Still open: L2 (The new test covers the retained paths but does not exercise the in-play dev-mode automati…); L3 (The new held-layer scan runs filesystem metadata checks and copies the layer table on the…); L4 (The removal path has not been exercised on Windows or with the builder's sandbox enabled.)

Checks: Still running: 11 checks.

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

Does it help: Unproven on the current head: an earlier Linux run showed the restart line without a reload, and another showed removed paths reverting to game files; the current head has not been run in game.

Other systems: The held-layer removal path affects filesystem and sandbox behavior on Linux and Windows. Windows and builder-sandbox runs remain outstanding; the reported Linux runs used NVIDIA hardware with the sandbox off.

Switches: No switches added, changed, or removed.

Reviewed: 9e6efbd43c against f7d6d3bf61: Read the changes since ad3874ddf6, the new test and its setup, the travel queue interface, AGENTS.md, CONTRIBUTING.md, and the pull request template. The full pull request diff and all changed files were not read in full; docs/review-checklist.md was absent.; nothing run (a code review).

Checked and fine:

  • The new loader instance defaults to the process restart note, and both changed-file paths and the Mods tab read that same note.
  • The new test checks that an opened path remains noted after map-load events.

Testing: No code or tests were run for this review. The author reports passing API tests and clippy on the head, plus earlier Linux in-game runs; CI is still running.

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


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

**Recommendation: Request changes.** The new test covers retained opened paths, but it does not exercise the in-play dev-mode reload behavior that caused the unwanted travel. The platform and frame-pacing runs also remain outstanding. The change stops dev mode from reloading the map, retains opened-file tracking across maps, and falls back to game files when held mod layers lose inputs. It removes a disruptive reload at the cost of requiring restarts for some changes and using coarse fallback for merged files. **Blocking (1)**: must change before merging. 1. **L2** `game/crates/api/src/loader/tests.rs:1811`: The new test covers the retained paths but does not exercise the in-play dev-mode automatic travel that caused the original bug. *When:* A file changes in dev mode while the game is in play; the former reload could ask for travel, but this test's setup does not put the game in that state and therefore would not detect that behavior. **Do:** Add a game-free behavioral test that drives the dev-mode change in an in-play state and verifies no automatic map-change request; it should fail with the former reload behavior. **Testing before merging (2)** (runs on the systems it can change; it doesn't hold the recommendation) - **L3** `game/crates/api/src/loader/hot.rs:470`: The new held-layer scan runs filesystem metadata checks and copies the layer table on the game thread; its effect on frame pacing is unknown. *When:* A change while layers are held scans the served paths synchronously. The reported deletion run fell from about 60 fps to 1 fps later in the session, and the reported competing CPU load does not establish the cause. **Do:** Repeat the held-layer deletion on an otherwise idle machine, comparing frame times before and after the change, and investigate the late slowdown. *(`@fix` does its part first: Move the scan and table preparation off the game thread, or limit checks to paths affected by the notification.)* - **L4** `game/crates/api/src/loader/hot.rs:467`: The removal path has not been exercised on Windows or with the builder's sandbox enabled. *When:* Players on those configurations can delete a held mod folder, but the reported run only establishes the fallback on Linux with the sandbox off. **Do:** Run the held-folder removal with the sandbox enabled and on Windows, checking the fallback and subsequent file loads. `@fix` can do L2 and L3. **Since the last review** (on ad3874ddf604) Still open: L2 (The new test covers the retained paths but does not exercise the in-play dev-mode automati…); L3 (The new held-layer scan runs filesystem metadata checks and copies the layer table on the…); L4 (The removal path has not been exercised on Windows or with the builder's sandbox enabled.) **Checks:** Still running: 11 checks. <details> <summary>More: does it help, other systems, switches, what was read</summary> **Does it help:** Unproven on the current head: an earlier Linux run showed the restart line without a reload, and another showed removed paths reverting to game files; the current head has not been run in game. **Other systems:** The held-layer removal path affects filesystem and sandbox behavior on Linux and Windows. Windows and builder-sandbox runs remain outstanding; the reported Linux runs used NVIDIA hardware with the sandbox off. **Switches:** No switches added, changed, or removed. **Reviewed:** 9e6efbd43c93 against f7d6d3bf611e: Read the changes since ad3874ddf604, the new test and its setup, the travel queue interface, AGENTS.md, CONTRIBUTING.md, and the pull request template. The full pull request diff and all changed files were not read in full; docs/review-checklist.md was absent.; nothing run (a code review). **Checked and fine:** - The new loader instance defaults to the process restart note, and both changed-file paths and the Mods tab read that same note. - The new test checks that an opened path remains noted after map-load events. **Testing:** No code or tests were run for this review. The author reports passing API tests and clippy on the head, plus earlier Linux in-game runs; 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: fix(mods)!: dev mode stops reloading the map, and the restart line and held layers keep up with file changes to fix(mods)!: dev mode stops reloading the map, and the restart line and held layers keep up with file changes 2026-12-04 21:51:35 +00:00
HumanBean deleted branch fix/mods-restart-note 2026-12-04 21:51:41 +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!3193
No description provided.