feat(mods): the Mods tab says which archives are served as one, and a damaged cached archive is made again #3173

Merged
HumanBean merged 1 commit from snaildev99/Longshot:mods/archive-parity into main 2026-12-05 17:30:50 +00:00
Member

Summary

When two mods change the same archive (a pack, a layout archive, a language's texts), main already serves one
archive with each mod's changes in it, and the mod lower in the list wins only the files inside it that both changed.
But the player wasn't told: the counts stayed in the merge step. And the merged archive kept in the cache was served
again whenever its record parsed and the file existed, so a damaged or replaced cache file was served as it was.

With this change:

  • The Mods tab says how many of a mod's archives are served as one with other mods' copies, and how many files inside
    them a mod lower in the list takes. It counts what the layers serve, path by path: when hot reload holds a path back
    to the next start, the tab keeps the count of the file still served there.
  • The cache record holds the made file's size and a hash of its bytes, checked before it is served; a damaged one is
    made again (the record's version string moves on, so older entries are made again once). The hash reads the file a
    MiB at a time, so a cache hit holds no copy of the archive, and an archive near the 256 MiB limit, whose zstd frame
    on disk is a few KB larger than that, is still read back and recorded.
  • A clash whose member name has a control character is one log line (? in its place, at most 160 bytes), the same
    in the log and the record.
  • Whether a game file is an archive is decided from the head of its frame, not by reading the whole file.

This is the rest of #1089 (the size table entries of a pack's files are the pack PR, #3172).

Read first: game/crates/content/src/merge.rs (ArchiveRecord, Step::cached_file, Rom::host_hash,
clash_name), then game/crates/api/src/loader/mod.rs (push_archive, the tab's text) and
game/crates/api/src/loader/hot.rs (Inputs::rebuild: a held path's archive).

Testing

Tested: Windows 11 Pro, RTX 3090, NVIDIA 610.88, in the game, built by longshot-builder play --profile with
this PR and the other mod compatibility ports merged, then the same profile on main. Two test mods made on this PC
from the game's own Pack/Actor/Land_LonLon_WheelTrack_A_05.pack.zs (kept local): each grows a different file inside
the pack.

  • The log: Pack/Actor/Land_LonLon_WheelTrack_A_05.pack.zs: 2 mods' copies served as one archive, each file inside it from the mod that changed it (1 of local/archive-test-a, 1 of local/archive-test-b); 2 files in it, made now, and
    as made before at the next start.
  • The Mods tab: each mod's page says "1 of its archives is served as one with other mods' copies." On main the same
    pages say nothing of it (screenshots below).
  • The cache: one byte of the cached archive flipped, then a start. Here the log says made now (1 written now) and
    the file is written again. On main the damaged file is served (as made before).

Game-free: the seven tests below. The sentence for files a lower mod takes is the game-free test's alone (the two test
mods change different files). Three came with the review's fixes, on this PR rebased onto main @ 3a0f7d8f7:
an_archive_whose_frame_is_over_the_read_limit_is_served_and_found_made (content: an archive written as the host
writes it, a zstd frame of raw blocks, to a host whose whole read takes the archive's size but not the frame's; it is
recorded, served, and found made at the next start) and the_mods_tab_counts_the_archive_served_not_one_held_back
(api: a second mod's copy of a pack added while the game runs, held back to the next start, then served) each failed
on the rebased code before its fix, for the review's reason (the lowest mod's whole copy served; both pages saying
"served as one" while the held path still served one mod's copy), pass with it, and fail again with the fix's key line
undone. the_host_hashes_a_file_a_piece_at_a_time (content) checks the host's piece-at-a-time hash of a real file
against the hash of its whole bytes. cargo test -p content @ d5ba0289f: 278 passed; cargo test -p api: 593 passed, 1
failed (watch::tests::a_walked_reshade_folder_counts_a_change_once_two_walks_agree, in watch.rs, which this PR
doesn't touch; it fails the same way on main @ 3a0f7d8f7).

After the rebase and the review's fixes, the same profile again, built with this PR @ d5ba0289f and the other ports
merged (929bf025a): the log says 2 mods' copies served as one archive ... made now, each mod's page says "1 of its
archives is served as one with other mods' copies." (screenshot in the comments), and with one byte of the cached
archive flipped, the next start's fast check finds the game folder up to date and the archive is made now. A
start without the damage says as made before.

mise run test, run locally while CI's run waits for approval (Windows 11, tests/run_all.py --strict, 12 checks at
once), here @ d5ba0289f and on main @ 3a0f7d8f7: 841 passed, 18 failed, 52 skipped here; 845 passed, 14 failed, 52
skipped on main. 14 of the 18 also fail on main: test_dlssg, test_fsr4_tune, test_lifter, test_no_game_title,
test_no_map_reload, test_present_acquire_ahead, test_present_geometry_trace, test_present_held_image,
test_present_image_free, test_program_cache_store_record, test_rt_pin, test_sync_watch_event, test_turf_budget,
test_ui_renderer. The other four (test_dev_update, test_invalidate_vcore, test_prepare_stall, test_present_probe)
hit their timeouts under that load and pass here run alone (--exact, 4 passed); this PR touches none of the
sources they cut.

Still to test:

  • Windows and Linux: cold and warm starts with several shared archives, interleaved with main: the merge step's
    time and the cache's size (measurement, the review's L3)

Measurements

Verdict: It works: a damaged cached archive is made again, and the Mods tab names a shared archive, in the game
and in the tests. A start that serves the cached archive now reads and hashes the made file: 0.13 ms for this
132 KB archive and 24 ms for a 24 MiB one (the game's largest pack), the hash timed alone in a release build.

Setup: cargo test -p content and -p api on Windows 11, main's code with the new tests on the before side; then
the test profile above in the game, Windows 11 Pro, RTX 3090, the same profile copied for main. The game's After
column is the build with the other mod compatibility ports merged (72d64e92f), which holds this PR's commit. These
rows were measured before the rebase; the game's results are the same on this head (Tested).

Before: main @ f577a1aea After: this PR @ 8bbac75d3
a_damaged_cached_archive_is_made_again fails (the damaged cache file is served) passes
a_clash_whose_name_has_a_control_character_is_one_log_line fails (no line) passes
a_shared_file_that_is_no_archive_is_not_read_whole fails (read whole) passes
the_mods_tab_says_an_archive_is_served_as_one fails (empty note) passes
cargo test -p content (the three above fail) 276 passed; 278 @ d5ba0289f, with the review's two content tests
In the game: a start after one byte of the cached archive is flipped as made before (the damaged file served) made now, 1 written now
In the game: each test mod's Mods tab page no word of the archive "1 of its archives is served as one with other mods' copies."
In the game: the merge step at a start serving the cached archive 17, 17, 18 ms (3 starts) 28, 28, 29, 30 ms (4 starts)

The merge step's gap in the game (about 11 ms) is larger than what this PR adds to it: the cached path differs from
main's only in reading the made file (0.14 ms for 132 KB, read cold from a new process) and hashing it (0.13 ms), and
the step's timer and loop are main's. The game's build holds seven other ports, so the gap is not this PR's alone; it
is not broken down further.

The review's fixes, game-free (their tests test this PR's own code, so the before side is this PR rebased onto main
@ 3a0f7d8f7 without them, not main):

Before: this PR rebased, without the fixes After: this PR @ d5ba0289f
an_archive_whose_frame_is_over_the_read_limit_is_served_and_found_made fails (the lowest mod's whole copy served) passes
the_mods_tab_counts_the_archive_served_not_one_held_back fails (the pages say "served as one" while the path is held back) passes

Risks

  • The record's version moves on, so each archive in a player's mod cache is made again once, at the first start after
    updating; the old entries go with the cache's ~1 GiB sweep.
  • Hashing the made file costs a read of it on each start that serves it from the cache: about 1 ms per MiB of made
    archives (24 ms for the game's largest pack), on every start with mods that share an archive. It reads a MiB at a
    time, so it holds no copy of the archive.
  • Players: a new sentence on mods that share an archive. No save or setting changes. A revert is enough.

Checklist

Ready for review

  • One topic, on current main; the title is a Conventional Commit.
  • Tested on my own PC, in the game for a change the game runs, as Testing says.
  • mise run test passes (any failure that also fails on main is named). (run locally, Testing names them; CI's run waits for approval)
  • 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. (tests/test_parity_gates.py reads loader/mod.rs's log lines, which this keeps: it passes unchanged in the suite)
  • Screenshots of the same spot on main and here, for a change that shows on screen. (in the comments)
  • 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

## Summary When two mods change the same archive (a pack, a layout archive, a language's texts), `main` already serves one archive with each mod's changes in it, and the mod lower in the list wins only the files inside it that both changed. But the player wasn't told: the counts stayed in the merge step. And the merged archive kept in the cache was served again whenever its record parsed and the file existed, so a damaged or replaced cache file was served as it was. With this change: - The Mods tab says how many of a mod's archives are served as one with other mods' copies, and how many files inside them a mod lower in the list takes. It counts what the layers serve, path by path: when hot reload holds a path back to the next start, the tab keeps the count of the file still served there. - The cache record holds the made file's size and a hash of its bytes, checked before it is served; a damaged one is made again (the record's version string moves on, so older entries are made again once). The hash reads the file a MiB at a time, so a cache hit holds no copy of the archive, and an archive near the 256 MiB limit, whose zstd frame on disk is a few KB larger than that, is still read back and recorded. - A clash whose member name has a control character is one log line (`?` in its place, at most 160 bytes), the same in the log and the record. - Whether a game file is an archive is decided from the head of its frame, not by reading the whole file. This is the rest of #1089 (the size table entries of a pack's files are the pack PR, #3172). Read first: `game/crates/content/src/merge.rs` (`ArchiveRecord`, `Step::cached_file`, `Rom::host_hash`, `clash_name`), then `game/crates/api/src/loader/mod.rs` (`push_archive`, the tab's text) and `game/crates/api/src/loader/hot.rs` (`Inputs::rebuild`: a held path's archive). ## Testing **Tested:** Windows 11 Pro, RTX 3090, NVIDIA 610.88, in the game, built by `longshot-builder play --profile` with this PR and the other mod compatibility ports merged, then the same profile on `main`. Two test mods made on this PC from the game's own `Pack/Actor/Land_LonLon_WheelTrack_A_05.pack.zs` (kept local): each grows a different file inside the pack. - The log: `Pack/Actor/Land_LonLon_WheelTrack_A_05.pack.zs: 2 mods' copies served as one archive, each file inside it from the mod that changed it (1 of local/archive-test-a, 1 of local/archive-test-b); 2 files in it, made now`, and `as made before` at the next start. - The Mods tab: each mod's page says "1 of its archives is served as one with other mods' copies." On `main` the same pages say nothing of it (screenshots below). - The cache: one byte of the cached archive flipped, then a start. Here the log says `made now` (`1 written now`) and the file is written again. On `main` the damaged file is served (`as made before`). Game-free: the seven tests below. The sentence for files a lower mod takes is the game-free test's alone (the two test mods change different files). Three came with the review's fixes, on this PR rebased onto `main` @ 3a0f7d8f7: `an_archive_whose_frame_is_over_the_read_limit_is_served_and_found_made` (content: an archive written as the host writes it, a zstd frame of raw blocks, to a host whose whole read takes the archive's size but not the frame's; it is recorded, served, and found made at the next start) and `the_mods_tab_counts_the_archive_served_not_one_held_back` (api: a second mod's copy of a pack added while the game runs, held back to the next start, then served) each failed on the rebased code before its fix, for the review's reason (the lowest mod's whole copy served; both pages saying "served as one" while the held path still served one mod's copy), pass with it, and fail again with the fix's key line undone. `the_host_hashes_a_file_a_piece_at_a_time` (content) checks the host's piece-at-a-time hash of a real file against the hash of its whole bytes. `cargo test -p content` @ d5ba0289f: 278 passed; `cargo test -p api`: 593 passed, 1 failed (`watch::tests::a_walked_reshade_folder_counts_a_change_once_two_walks_agree`, in `watch.rs`, which this PR doesn't touch; it fails the same way on `main` @ 3a0f7d8f7). After the rebase and the review's fixes, the same profile again, built with this PR @ d5ba0289f and the other ports merged (929bf025a): the log says `2 mods' copies served as one archive ... made now`, each mod's page says "1 of its archives is served as one with other mods' copies." (screenshot in the comments), and with one byte of the cached archive flipped, the next start's fast check finds the game folder up to date and the archive is `made now`. A start without the damage says `as made before`. `mise run test`, run locally while CI's run waits for approval (Windows 11, `tests/run_all.py --strict`, 12 checks at once), here @ d5ba0289f and on `main` @ 3a0f7d8f7: 841 passed, 18 failed, 52 skipped here; 845 passed, 14 failed, 52 skipped on `main`. 14 of the 18 also fail on `main`: test_dlssg, test_fsr4_tune, test_lifter, test_no_game_title, test_no_map_reload, test_present_acquire_ahead, test_present_geometry_trace, test_present_held_image, test_present_image_free, test_program_cache_store_record, test_rt_pin, test_sync_watch_event, test_turf_budget, test_ui_renderer. The other four (test_dev_update, test_invalidate_vcore, test_prepare_stall, test_present_probe) hit their timeouts under that load and pass here run alone (`--exact`, 4 passed); this PR touches none of the sources they cut. **Still to test:** - Windows and Linux: cold and warm starts with several shared archives, interleaved with `main`: the merge step's time and the cache's size (measurement, the review's L3) ## Measurements **Verdict:** It works: a damaged cached archive is made again, and the Mods tab names a shared archive, in the game and in the tests. A start that serves the cached archive now reads and hashes the made file: 0.13 ms for this 132 KB archive and 24 ms for a 24 MiB one (the game's largest pack), the hash timed alone in a release build. Setup: `cargo test -p content` and `-p api` on Windows 11, `main`'s code with the new tests on the before side; then the test profile above in the game, Windows 11 Pro, RTX 3090, the same profile copied for `main`. The game's After column is the build with the other mod compatibility ports merged (72d64e92f), which holds this PR's commit. These rows were measured before the rebase; the game's results are the same on this head (Tested). | | Before: main @ f577a1aea | After: this PR @ 8bbac75d3 | |---|---|---| | `a_damaged_cached_archive_is_made_again` | fails (the damaged cache file is served) | passes | | `a_clash_whose_name_has_a_control_character_is_one_log_line` | fails (no line) | passes | | `a_shared_file_that_is_no_archive_is_not_read_whole` | fails (read whole) | passes | | `the_mods_tab_says_an_archive_is_served_as_one` | fails (empty note) | passes | | `cargo test -p content` | (the three above fail) | 276 passed; 278 @ d5ba0289f, with the review's two content tests | | In the game: a start after one byte of the cached archive is flipped | `as made before` (the damaged file served) | `made now`, `1 written now` | | In the game: each test mod's Mods tab page | no word of the archive | "1 of its archives is served as one with other mods' copies." | | In the game: the merge step at a start serving the cached archive | 17, 17, 18 ms (3 starts) | 28, 28, 29, 30 ms (4 starts) | The merge step's gap in the game (about 11 ms) is larger than what this PR adds to it: the cached path differs from `main`'s only in reading the made file (0.14 ms for 132 KB, read cold from a new process) and hashing it (0.13 ms), and the step's timer and loop are `main`'s. The game's build holds seven other ports, so the gap is not this PR's alone; it is not broken down further. The review's fixes, game-free (their tests test this PR's own code, so the before side is this PR rebased onto `main` @ 3a0f7d8f7 without them, not `main`): | | Before: this PR rebased, without the fixes | After: this PR @ d5ba0289f | |---|---|---| | `an_archive_whose_frame_is_over_the_read_limit_is_served_and_found_made` | fails (the lowest mod's whole copy served) | passes | | `the_mods_tab_counts_the_archive_served_not_one_held_back` | fails (the pages say "served as one" while the path is held back) | passes | ## Risks - The record's version moves on, so each archive in a player's mod cache is made again once, at the first start after updating; the old entries go with the cache's ~1 GiB sweep. - Hashing the made file costs a read of it on each start that serves it from the cache: about 1 ms per MiB of made archives (24 ms for the game's largest pack), on every start with mods that share an archive. It reads a MiB at a time, so it holds no copy of the archive. - Players: a new sentence on mods that share an archive. No save or setting changes. A revert is enough. ## Checklist ### Ready for review - [x] One topic, on current `main`; the title is a Conventional Commit. - [x] Tested on my own PC, in the game for a change the game runs, as Testing says. - [x] `mise run test` passes (any failure that also fails on `main` is named). (run locally, Testing names them; CI's run waits for approval) - [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. (`tests/test_parity_gates.py` reads `loader/mod.rs`'s log lines, which this keeps: it passes unchanged in the suite) - [x] Screenshots of the same spot on `main` and here, for a change that shows on screen. (in the comments) - [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)
feat(mods): the Mods tab says which archives are served as one, and a damaged cached archive is made again
Some checks failed
PR description / Title and description (pull_request_target) Successful in 6s
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
8bbac75d30
The rest of #1089 on the Rust loader (main already merges an archive several mods ship, member by member).

- The cache: the record beside a made archive now keeps the file's size and an FNV-1a hash of its bytes on disk
  (record version 2). A start serves the made file only when its size, then its hash, are the record's; a file that
  was damaged or replaced is made again. On a miss the archive is always written, read back, and only then recorded,
  so a record never stands for a file that is not there whole. Records of version 1 are not read: those archives are
  made once more.
- Clashes: a member whose name has a control character was left out of the log and the record. It is now named with
  each such byte as `?`, cut at 160 bytes, so a clash is always one log line and one record line.
- A file several mods ship whole that is no archive is no longer read whole to find that out: its first 4 bytes are
  (decoded from the head of a `.zs`).
- The Mods tab: each mod's note says how many of its archives are served as one with other mods' copies, and how many
  files inside them a mod lower in the list took.

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

Tested in game: Windows 11 Pro, RTX 3090, NVIDIA 610.88: built by longshot-builder play --profile with this PR and the other mod compatibility ports merged, then the same profile on main; adult Link in Kakariko. Two local test mods share one actor pack: the log serves it as one archive ('made now', then 'as made before'), and each mod's Mods tab page says '1 of its archives is served as one with other mods' copies.' (main says nothing). One byte of the cached archive flipped: the next start makes it again ('made now', '1 written now'); main serves the damaged file ('as made before').

Tested in game: Windows 11 Pro, RTX 3090, NVIDIA 610.88: built by longshot-builder play --profile with this PR and the other mod compatibility ports merged, then the same profile on main; adult Link in Kakariko. Two local test mods share one actor pack: the log serves it as one archive ('made now', then 'as made before'), and each mod's Mods tab page says '1 of its archives is served as one with other mods' copies.' (main says nothing). One byte of the cached archive flipped: the next start makes it again ('made now', '1 written now'); main serves the damaged file ('as made before').
Author
Member

Screenshots: Archive test A's page in the Mods tab, the same test profile on both sides (Windows 11, RTX 3090).

Before, main @ f577a1aea: the state says nothing of the archive the two test mods share.
main

After, this PR (the build with the other mod compatibility ports merged, 72d64e92f): "1 of its archives is served as one with other mods' copies."
this PR

Screenshots: Archive test A's page in the Mods tab, the same test profile on both sides (Windows 11, RTX 3090). **Before**, main @ f577a1aea: the state says nothing of the archive the two test mods share. ![main](https://git.magicbean.dev/attachments/4dfb191a-be2d-408a-892a-85ba99a5f3c9) **After**, this PR (the build with the other mod compatibility ports merged, 72d64e92f): "1 of its archives is served as one with other mods' copies." ![this PR](https://git.magicbean.dev/attachments/2eb38647-6630-4ebf-b880-c1cbe024f9cb)
Author
Member

mise run test, run locally while CI's run waits for approval: 824 passed, 21 failed, 51 skipped here @ 8bbac75d3; 16 of the 21 also fail on main @ f577a1aea (named in Testing), the other five timed out under load and pass here run alone (--exact): the two audio checks beside two other suites, the three renderer fixtures with nothing else running. test_parity_gates, which reads loader/mod.rs, passes unchanged. Box ticked.

mise run test, run locally while CI's run waits for approval: 824 passed, 21 failed, 51 skipped here @ 8bbac75d3; 16 of the 21 also fail on main @ f577a1aea (named in Testing), the other five timed out under load and pass here run alone (--exact): the two audio checks beside two other suites, the three renderer fixtures with nothing else running. test_parity_gates, which reads loader/mod.rs, passes unchanged. Box ticked.
snaildev99 changed title from WIP: feat(mods): the Mods tab says which archives are served as one, and a damaged cached archive is made again to feat(mods): the Mods tab says which archives are served as one, and a damaged cached archive is made again 2026-12-05 03:03:42 +00:00
BeanBot left a comment

Recommendation: Request changes. A valid large merged archive can be discarded after it is written, causing the game to serve only the lowest mod’s copy. The Mods tab can also report a hot-reload result that was held back rather than served.

The change reports shared archives in the Mods tab and verifies cached archives before reuse. The Windows run shows both features working for a small pack; verification adds a full read and hash on cache hits.

Blocking (2): must change before merging.

  1. L1 game/crates/content/src/merge.rs:811: The read-back applies the decoded archive limit to the larger on-disk zstd frame. (more on the line) Do: Hash the written frame with a bound that includes zstd framing overhead, or stream the hash without loading the entire frame; add a boundary test using the real framing semantics.
  2. L4: It conflicts with its base branch: bring it up to date (@​fix or @​rebase try first). (for the author)

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

  • L2 game/crates/api/src/loader/mod.rs:1224: The counts describe the rebuilt table before hot reload decides which paths can actually be published. (more on the line) Do: Retain per-path merge counts and publish counts corresponding to the paths actually kept or replaced by hot reload.

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

  • L3 game/crates/content/src/merge.rs:707: The startup cost of verifying all cached shared archives has not been isolated on the PR’s own build or checked on Linux. (more on the line) Do: Compare interleaved cold and warm starts on base and this head with a representative multi-archive profile, including Linux, and report total merge time and cache size. (@fix does its part first: Stream the hash in bounded chunks to avoid allocating a full archive on each cache hit.)

@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: Yes for the demonstrated cases: on Windows, a flipped cache byte caused a rebuild instead of reuse, and both test mods displayed the shared-archive note. The isolated cost was reported as 0.13 ms for 132 KB and 24 ms for 24 MiB; the measured 11 ms merge-step gap includes other changes and cannot isolate this PR.

Other systems: The cache and loader run on Windows and Linux and during hot reload. The reported game run covers Windows with NVIDIA; Linux behavior and startup cost with a larger set of shared archives remain unmeasured. No renderer, save, audio, or input code changes are apparent.

Switches: None.

Reviewed: 8bbac75d30 against f577a1aeab: Read the repository rules, PR template, standards, commit, changed diffs, and the relevant merge, SARC, loader, RomFS and hot-reload paths. The large loader and test files and the long reference documents were skimmed rather than read completely; no generated files or translations changed. Tooling’s adjacent AGENTS.md was unavailable.; nothing run (a code review).

Checked and fine:

  • The commit records AI assistance.
  • The changed files contain no committed game archive or generated output.
  • Cache records are versioned, and a size mismatch is rejected before hashing.
  • The reported game-free damaged-cache test covers both size changes and same-size byte changes.

Testing: No code or tests were run for this review. The author reports a Windows game run and game-free tests; CI is still running.

Overlaps and merge order: The description identifies #3172 as the related pack size-table work; merge order was not established.


Automated code review by BeanBot (gpt-6.1-terra), asked for by BeanBot, as snaildev99 took it out of WIP. Nothing was run; a maintainer decides.

**Recommendation: Request changes.** A valid large merged archive can be discarded after it is written, causing the game to serve only the lowest mod’s copy. The Mods tab can also report a hot-reload result that was held back rather than served. The change reports shared archives in the Mods tab and verifies cached archives before reuse. The Windows run shows both features working for a small pack; verification adds a full read and hash on cache hits. **Blocking (2)**: must change before merging. 1. **L1** `game/crates/content/src/merge.rs:811`: The read-back applies the decoded archive limit to the larger on-disk zstd frame. (more on the line) **Do:** Hash the written frame with a bound that includes zstd framing overhead, or stream the hash without loading the entire frame; add a boundary test using the real framing semantics. 2. **L4**: It conflicts with its base branch: bring it up to date (`@​fix` or `@​rebase` try first). *(for the author)* **Should fix (1)**: not blocking, but worth doing before merging. - **L2** `game/crates/api/src/loader/mod.rs:1224`: The counts describe the rebuilt table before hot reload decides which paths can actually be published. (more on the line) **Do:** Retain per-path merge counts and publish counts corresponding to the paths actually kept or replaced by hot reload. **Testing before merging (1)** (runs on the systems it can change; it doesn't hold the recommendation) - **L3** `game/crates/content/src/merge.rs:707`: The startup cost of verifying all cached shared archives has not been isolated on the PR’s own build or checked on Linux. (more on the line) **Do:** Compare interleaved cold and warm starts on base and this head with a representative multi-archive profile, including Linux, and report total merge time and cache size. *(`@fix` does its part first: Stream the hash in bounded chunks to avoid allocating a full archive on each cache hit.)* `@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:** Yes for the demonstrated cases: on Windows, a flipped cache byte caused a rebuild instead of reuse, and both test mods displayed the shared-archive note. The isolated cost was reported as 0.13 ms for 132 KB and 24 ms for 24 MiB; the measured 11 ms merge-step gap includes other changes and cannot isolate this PR. **Other systems:** The cache and loader run on Windows and Linux and during hot reload. The reported game run covers Windows with NVIDIA; Linux behavior and startup cost with a larger set of shared archives remain unmeasured. No renderer, save, audio, or input code changes are apparent. **Switches:** None. **Reviewed:** 8bbac75d3068 against f577a1aeabdb: Read the repository rules, PR template, standards, commit, changed diffs, and the relevant merge, SARC, loader, RomFS and hot-reload paths. The large loader and test files and the long reference documents were skimmed rather than read completely; no generated files or translations changed. Tooling’s adjacent AGENTS.md was unavailable.; nothing run (a code review). **Checked and fine:** - The commit records AI assistance. - The changed files contain no committed game archive or generated output. - Cache records are versioned, and a size mismatch is rejected before hashing. - The reported game-free damaged-cache test covers both size changes and same-size byte changes. **Testing:** No code or tests were run for this review. The author reports a Windows game run and game-free tests; CI is still running. **Overlaps and merge order:** The description identifies #3172 as the related pack size-table work; merge order was not established. </details> --- <sub>Automated code review by BeanBot (gpt-6.1-terra), asked for by BeanBot, as snaildev99 took it out of WIP. Nothing was run; a maintainer decides.</sub>
@ -1205,0 +1221,4 @@
for (layer, count) in &m.counts {
let Some(id) = names.get(*layer) else { continue };
if let Some(row) = self.rows.iter_mut().find(|r| r.id == *id) {
row.archives_merged = count.archives_merged;
Member

L2 (should fix): The counts describe the rebuilt table before hot reload decides which paths can actually be published.

When: When an edited shared archive needs a larger resource-size entry, hot_rebuild retains the previous path with Builder::keep, but these new counts are still published to the Mods tab. A mod can consequently be told its archive is merged, or that a file was taken, when the currently served archive has the old result.

Do: Retain per-path merge counts and publish counts corresponding to the paths actually kept or replaced by hot reload.

**L2** (should fix): The counts describe the rebuilt table before hot reload decides which paths can actually be published. *When:* When an edited shared archive needs a larger resource-size entry, hot_rebuild retains the previous path with Builder::keep, but these new counts are still published to the Mods tab. A mod can consequently be told its archive is merged, or that a file was taken, when the currently served archive has the old result. **Do:** Retain per-path merge counts and publish counts corresponding to the paths actually kept or replaced by hot reload.
@ -643,0 +704,4 @@
_ => return false,
}
self.rom.host(path, false).is_some_and(|raw| mix(SEED, &raw) == r.file_hash)
}
Member

L3 (should fix): The startup cost of verifying all cached shared archives has not been isolated on the PR’s own build or checked on Linux.

When: Players with several large shared archives read and hash each one on every cached start; the reported in-game comparison includes seven other ports, so it cannot show this change’s total startup cost.

Do: Compare interleaved cold and warm starts on base and this head with a representative multi-archive profile, including Linux, and report total merge time and cache size.

**L3** (should fix): The startup cost of verifying all cached shared archives has not been isolated on the PR’s own build or checked on Linux. *When:* Players with several large shared archives read and hash each one on every cached start; the reported in-game comparison includes seven other ports, so it cannot show this change’s total startup cost. **Do:** Compare interleaved cold and warm starts on base and this head with a representative multi-archive profile, including Linux, and report total merge time and cache size.
@ -748,0 +808,4 @@
let Some(raw) = self.rom.host(&path, false) else {
host_sys::log::warn(&whole);
return Archive::Kept;
};
Member

L1 (blocking): The read-back applies the decoded archive limit to the larger on-disk zstd frame.

When: A merged archive near the permitted 256 MiB limit is written as raw zstd blocks. Frame headers make the disk file larger than PART_MAX, so HostRom::host rejects the read-back and this returns Kept, serving only the lowest mod’s whole archive even though the merge succeeded.

Do: Hash the written frame with a bound that includes zstd framing overhead, or stream the hash without loading the entire frame; add a boundary test using the real framing semantics.

**L1** (blocking): The read-back applies the decoded archive limit to the larger on-disk zstd frame. *When:* A merged archive near the permitted 256 MiB limit is written as raw zstd blocks. Frame headers make the disk file larger than PART_MAX, so HostRom::host rejects the read-back and this returns Kept, serving only the lowest mod’s whole archive even though the merge succeeded. **Do:** Hash the written frame with a bound that includes zstd framing overhead, or stream the hash without loading the entire frame; add a boundary test using the real framing semantics.
snaildev99 force-pushed mods/archive-parity from 8bbac75d30
Some checks failed
PR description / Title and description (pull_request_target) Successful in 6s
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 d5ba0289f1
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-05 08:28:43 +00:00
Compare
Author
Member

Rebased onto main @ 3a0f7d8f7 for the base conflict; here @ d5ba0289f. Tested (the game again on this head), mise run test (against main @ 3a0f7d8f7: four timeouts under load, each passing alone; the rest also fail on main) and Measurements are updated. Answers to the review below.

Rebased onto main @ 3a0f7d8f7 for the base conflict; here @ d5ba0289f. Tested (the game again on this head), `mise run test` (against main @ 3a0f7d8f7: four timeouts under load, each passing alone; the rest also fail on main) and Measurements are updated. Answers to the review below.
Author
Member

L1 (the read-back applies the archive limit to the larger zstd frame): fixed in d5ba0289f. The host writes a made
archive as a frame of raw blocks, 10 bytes of head and 3 before each 128 KB block, so an archive of 256 MiB is about
6 KB larger on disk, and HostRom::host refused to read it back whole. The made file is now hashed a piece at a time:
Rom::host_hash gives its size and FNV-1a hash, and HostRom's reads 1 MiB at a time with no limit of a whole read.
Both the read-back after a write and Step::cached_file at a later start use it. The test
an_archive_whose_frame_is_over_the_read_limit_is_served_and_found_made writes the archive in that framing to a host
whose whole read takes the archive's size and not the frame's. Before the fix, it served the lowest mod's whole copy;
now the archive is recorded, served, and found made at the next start with nothing written.
the_host_hashes_a_file_a_piece_at_a_time checks the host's reader against the hash of the whole bytes, across the
pieces' edges, on a real file.

L2 (the Mods tab counts a rebuild's archives before hot reload decides what is published): fixed in d5ba0289f. It still
held after the rebase: #3151 moved the rebuild off the game's thread but kept Builder::keep for a path held back.
The loader now keeps the archives served as one path by path (Merged::archives, by the mods' ids), and the tab counts
from them. A rebuild takes the new build's entry for each path it serves anew, the previous one for a path it keeps,
and none for a path that goes back to the game's own file. A file of the held layers that leaves takes its entry with
it. the_mods_tab_counts_the_archive_served_not_one_held_back adds a second mod's copy of a pack while the game runs,
with the size table unchecked. Before the fix, both mods' pages said the archive was served as one while the first
mod's whole copy was still served; now they say nothing of it until the archive is served, and then both say so.

L3 (the startup cost of checking cached archives): the code part is done in d5ba0289f with L1. A cache hit no longer
reads the whole archive into memory: it holds 1 MiB at a time while it hashes. The measurement (interleaved cold and
warm starts on main and this head with several shared archives, Windows and Linux, the merge step's time and the
cache's size) is still to run.

L4 (conflicts with main): rebased onto main @ 3a0f7d8f7. The rebuild while the game runs is #3151's now: the
layers are built off the game's thread from sources taken on it. So the tab's counts come back with the rebuild's
outcome and are taken in on the game's thread. docs/user/using-mods.md keeps both new paragraphs: archives served as
one, then mods that load last.

**L1** (the read-back applies the archive limit to the larger zstd frame): fixed in d5ba0289f. The host writes a made archive as a frame of raw blocks, 10 bytes of head and 3 before each 128 KB block, so an archive of 256 MiB is about 6 KB larger on disk, and `HostRom::host` refused to read it back whole. The made file is now hashed a piece at a time: `Rom::host_hash` gives its size and FNV-1a hash, and `HostRom`'s reads 1 MiB at a time with no limit of a whole read. Both the read-back after a write and `Step::cached_file` at a later start use it. The test `an_archive_whose_frame_is_over_the_read_limit_is_served_and_found_made` writes the archive in that framing to a host whose whole read takes the archive's size and not the frame's. Before the fix, it served the lowest mod's whole copy; now the archive is recorded, served, and found made at the next start with nothing written. `the_host_hashes_a_file_a_piece_at_a_time` checks the host's reader against the hash of the whole bytes, across the pieces' edges, on a real file. **L2** (the Mods tab counts a rebuild's archives before hot reload decides what is published): fixed in d5ba0289f. It still held after the rebase: #3151 moved the rebuild off the game's thread but kept `Builder::keep` for a path held back. The loader now keeps the archives served as one path by path (`Merged::archives`, by the mods' ids), and the tab counts from them. A rebuild takes the new build's entry for each path it serves anew, the previous one for a path it keeps, and none for a path that goes back to the game's own file. A file of the held layers that leaves takes its entry with it. `the_mods_tab_counts_the_archive_served_not_one_held_back` adds a second mod's copy of a pack while the game runs, with the size table unchecked. Before the fix, both mods' pages said the archive was served as one while the first mod's whole copy was still served; now they say nothing of it until the archive is served, and then both say so. **L3** (the startup cost of checking cached archives): the code part is done in d5ba0289f with L1. A cache hit no longer reads the whole archive into memory: it holds 1 MiB at a time while it hashes. The measurement (interleaved cold and warm starts on `main` and this head with several shared archives, Windows and Linux, the merge step's time and the cache's size) is still to run. **L4** (conflicts with `main`): rebased onto `main` @ 3a0f7d8f7. The rebuild while the game runs is #3151's now: the layers are built off the game's thread from sources taken on it. So the tab's counts come back with the rebuild's outcome and are taken in on the game's thread. `docs/user/using-mods.md` keeps both new paragraphs: archives served as one, then mods that load last.
Author
Member

In the game on this head (929bf025a, with the other ports merged): Archive test B's page.

integ-page-archive-b.png

In the game on this head (929bf025a, with the other ports merged): Archive test B's page. ![integ-page-archive-b.png](https://git.magicbean.dev/attachments/de94dfc8-cf56-4429-8332-00d3bc7ff9e6)
Author
Member

Still to test now lists the measurement the review asked for, which the answers above say is still to run.

Still to test now lists the measurement the review asked for, which the answers above say is still to run.
Owner
@review
BeanBot left a comment

Recommendation: Approve. The code is ready: only testing is left. The archive read-back and hot-reload count fixes address the reported cases. Startup cost with several shared archives still needs measurement on Windows and Linux. Recommend approval; not approved on the forge.

The Mods tab reports shared archives and lost member changes, and damaged cached archives are rebuilt. Cache hits now require a file read and hash; the fix bounds hashing memory to 1 MiB.

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

  • L3 game/crates/content/src/merge.rs:707: The startup cost of verifying several cached shared archives remains unmeasured on the PR's own build and on Linux. When: A player starts with several shared archives; every cache hit reads and hashes its made file, but the combined startup cost is unknown. Do: Measure interleaved cold and warm starts against main on Windows and Linux, recording merge-step time and cache size. (@fix does its part first: Stream the hash in bounded chunks to avoid allocating a full archive on each cache hit.)

@fix can do L3.

Since the last review (on 8bbac75d30)
Resolved: L1 (The read-back applies the decoded archive limit to the larger on-disk zstd frame.); L2 (The counts describe the rebuilt table before hot reload decides which paths can actually b…); L4 (It conflicts with its base branch: bring it up to date (@​fix or @​rebase try first).)
Still open: L3 (The startup cost of verifying several cached shared archives remains unmeasured on the PR'…)

Checks: Still running: 11 checks.

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

Does it help: Yes for the reported behavior: the author reports that a damaged cache was rebuilt and both mod pages showed the shared archive in game on Windows. The author measured hashing alone at 0.13 ms for 132 KB and 24 ms for 24 MiB; the combined startup cost remains unisolated.

Other systems: The cache and loader paths run on Windows and Linux. The reported in-game run covers Windows; Linux behavior and startup cost with several shared archives remain unmeasured.

Switches: None.

Reviewed: d5ba0289f1 against 3a0f7d8f7f: Read AGENTS.md, CONTRIBUTING.md, the pull request template, the supplied review history and the changed loader and merge excerpts. The full changed files, remaining diff, referenced standards and dependent code were not read in full; docs/review-checklist.md is absent.; nothing run (a code review).

Checked and fine:

  • The hash read retries interrupted reads and checks the byte count as well as the hash.
  • The author reports game-free tests for the oversized frame and held archive counts, and an in-game cache-damage check on this head.

Testing: No code or tests were run during this review. The author reports 278 content tests passing and 593 API tests passing with one failure also present on main; CI remains 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: Approve.** The code is ready: only testing is left. The archive read-back and hot-reload count fixes address the reported cases. Startup cost with several shared archives still needs measurement on Windows and Linux. Recommend approval; not approved on the forge. The Mods tab reports shared archives and lost member changes, and damaged cached archives are rebuilt. Cache hits now require a file read and hash; the fix bounds hashing memory to 1 MiB. **Testing before merging (1)** (runs on the systems it can change; it doesn't hold the recommendation) - **L3** `game/crates/content/src/merge.rs:707`: The startup cost of verifying several cached shared archives remains unmeasured on the PR's own build and on Linux. *When:* A player starts with several shared archives; every cache hit reads and hashes its made file, but the combined startup cost is unknown. **Do:** Measure interleaved cold and warm starts against main on Windows and Linux, recording merge-step time and cache size. *(`@fix` does its part first: Stream the hash in bounded chunks to avoid allocating a full archive on each cache hit.)* `@fix` can do L3. **Since the last review** (on 8bbac75d3068) Resolved: L1 (The read-back applies the decoded archive limit to the larger on-disk zstd frame.); L2 (The counts describe the rebuilt table before hot reload decides which paths can actually b…); L4 (It conflicts with its base branch: bring it up to date (`@​fix` or `@​rebase` try first).) Still open: L3 (The startup cost of verifying several cached shared archives remains unmeasured on the PR'…) **Checks:** Still running: 11 checks. <details> <summary>More: does it help, other systems, switches, what was read</summary> **Does it help:** Yes for the reported behavior: the author reports that a damaged cache was rebuilt and both mod pages showed the shared archive in game on Windows. The author measured hashing alone at 0.13 ms for 132 KB and 24 ms for 24 MiB; the combined startup cost remains unisolated. **Other systems:** The cache and loader paths run on Windows and Linux. The reported in-game run covers Windows; Linux behavior and startup cost with several shared archives remain unmeasured. **Switches:** None. **Reviewed:** d5ba0289f1f5 against 3a0f7d8f7f34: Read AGENTS.md, CONTRIBUTING.md, the pull request template, the supplied review history and the changed loader and merge excerpts. The full changed files, remaining diff, referenced standards and dependent code were not read in full; docs/review-checklist.md is absent.; nothing run (a code review). **Checked and fine:** - The hash read retries interrupted reads and checks the byte count as well as the hash. - The author reports game-free tests for the oversized frame and held archive counts, and an in-game cache-damage check on this head. **Testing:** No code or tests were run during this review. The author reports 278 content tests passing and 593 API tests passing with one failure also present on main; CI remains 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>
Owner
@rebase
Member

I rebased this pull request onto main (e813a37f63): the new head is 3e947e8546.

Conflicts resolved

  • game/crates/api/src/loader/mod.rs: Kept the base branch’s combined note and added the pull request’s archive information to it.

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` (e813a37f6366): the new head is 3e947e85463e. **Conflicts resolved** - game/crates/api/src/loader/mod.rs: Kept the base branch’s combined note and added the pull request’s archive information to it. 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 mods/archive-parity from d5ba0289f1
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 3e947e8546
Some checks failed
PR description / Title and description (pull_request_target) Failing after 7s
CI / What the change needs (pull_request) Successful in 8s
CI / Lint (pre-commit, ShellCheck, actionlint) (pull_request) Waiting to run
CI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request) Waiting to run
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Waiting to run
CI / Renderer build check (Windows, compile --only renderer, without and with FSR 4) (pull_request) Waiting to run
CI / Renderer build check (Linux, compile --only renderer, without and with FSR 4) (pull_request) Waiting to run
CI / Game-free checks (run_all.py, part 1/2) (pull_request) Waiting to run
CI / Game-free checks (run_all.py, part 2/2) (pull_request) Waiting to run
CI / Website build and checks (pull_request) Waiting to run
CI / Third-party parts and guide screenshots (pull_request) Successful in 13s
2026-12-05 17:30:09 +00:00
Compare
BeanBot left a comment

Recommendation: Approve. The code is ready: only testing is left. The cache check and Mods tab behavior have reported in-game and game-free coverage, but the startup cost with several shared archives is still unmeasured on the PR’s own build and on Linux. Recommend approval; not approved on the forge.

The Mods tab reports shared archives and files taken by lower mods, and damaged cached archives are rebuilt. Cache hits now read and hash each made archive, adding startup work in exchange for detecting damage.

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

  • L3 game/crates/content/src/merge.rs:707: The startup cost of verifying several cached shared archives remains unmeasured on the PR's own build and on Linux. When: A player starts with several shared archives; every cache hit reads and hashes its made file, but the combined startup cost is unknown. Do: Measure interleaved cold and warm starts against main on Windows and Linux, recording merge-step time and cache size. (@fix does its part first: Stream the hash in bounded chunks to avoid allocating a full archive on each cache hit.)

@fix can do L3.

Since the last review (on d5ba0289f1)
Still open: L3 (The startup cost of verifying several cached shared archives remains unmeasured on the PR'…)

Checks: they run again on this head; a failure shows on the pull request.

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

Does it help: Yes for the reported fix: on Windows, a flipped cache byte caused the archive to be rebuilt, while main served it unchanged. The reported hash time was 0.13 ms for 132 KB and 24 ms for 24 MiB; the total startup cost with several archives remains unproven.

Other systems: The cache check runs on Windows and Linux; Linux startup cost remains unmeasured. Hot reload retains counts for held paths, with a reported game-free test; GPU behavior is not directly changed.

Switches: None.

Reviewed: 3e947e8546 against e813a37f63: Read AGENTS.md, CONTRIBUTING.md, the pull request template, the loader diff and surrounding changed line, the cache hash and read-back paths, and the documentation and hot-reload diffs. The remaining changed code and tests were not read in full; recorded runs were skimmed. docs/review-checklist.md and the adjacent Tooling AGENTS.md were absent.; nothing run (a code review).

Checked and fine:

  • The rebased loader line appends archive information to the same note returned for emulator-layout mods.
  • Cache validation checks the recorded size and streamed hash before serving the made file.

Testing: No commands that build or run the project were executed. The author reports Windows in-game checks and game-free tests; CI has not run on this head.

Overlaps and merge order: The description identifies #3172 as the related pack size-table work; merge order was not established.


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

**Recommendation: Approve.** The code is ready: only testing is left. The cache check and Mods tab behavior have reported in-game and game-free coverage, but the startup cost with several shared archives is still unmeasured on the PR’s own build and on Linux. Recommend approval; not approved on the forge. The Mods tab reports shared archives and files taken by lower mods, and damaged cached archives are rebuilt. Cache hits now read and hash each made archive, adding startup work in exchange for detecting damage. **Testing before merging (1)** (runs on the systems it can change; it doesn't hold the recommendation) - **L3** `game/crates/content/src/merge.rs:707`: The startup cost of verifying several cached shared archives remains unmeasured on the PR's own build and on Linux. *When:* A player starts with several shared archives; every cache hit reads and hashes its made file, but the combined startup cost is unknown. **Do:** Measure interleaved cold and warm starts against main on Windows and Linux, recording merge-step time and cache size. *(`@fix` does its part first: Stream the hash in bounded chunks to avoid allocating a full archive on each cache hit.)* `@fix` can do L3. **Since the last review** (on d5ba0289f1f5) Still open: L3 (The startup cost of verifying several cached shared archives remains unmeasured on the PR'…) **Checks:** they run again on this head; a failure shows on the pull request. <details> <summary>More: does it help, other systems, switches, what was read</summary> **Does it help:** Yes for the reported fix: on Windows, a flipped cache byte caused the archive to be rebuilt, while main served it unchanged. The reported hash time was 0.13 ms for 132 KB and 24 ms for 24 MiB; the total startup cost with several archives remains unproven. **Other systems:** The cache check runs on Windows and Linux; Linux startup cost remains unmeasured. Hot reload retains counts for held paths, with a reported game-free test; GPU behavior is not directly changed. **Switches:** None. **Reviewed:** 3e947e85463e against e813a37f6366: Read AGENTS.md, CONTRIBUTING.md, the pull request template, the loader diff and surrounding changed line, the cache hash and read-back paths, and the documentation and hot-reload diffs. The remaining changed code and tests were not read in full; recorded runs were skimmed. docs/review-checklist.md and the adjacent Tooling AGENTS.md were absent.; nothing run (a code review). **Checked and fine:** - The rebased loader line appends archive information to the same note returned for emulator-layout mods. - Cache validation checks the recorded size and streamed hash before serving the made file. **Testing:** No commands that build or run the project were executed. The author reports Windows in-game checks and game-free tests; CI has not run on this head. **Overlaps and merge order:** The description identifies #3172 as the related pack size-table work; merge order was not established. </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>
HumanBean deleted branch mods/archive-parity 2026-12-05 17:30:50 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
3 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
MagicBeanDev/Longshot!3173
No description provided.