Skip to content

BUILD-1906: Use recorded archive boundaries for indexed model-folder joins - #5896

Merged
shayderrr merged 3 commits into
ItsNotRexed:mainfrom
kacper-serewis:fix/model-folder-framing
Nov 23, 2026
Merged

shayderrr merged 3 commits into
ItsNotRexed:mainfrom
kacper-serewis:fix/model-folder-framing

Conversation

@kacper-serewis

@kacper-serewis kacper-serewis commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

BUILD-1906. “indexed carved-folder archive framing in restofworld_model_join”. Claim on #5781.

Depends on: #5372
Depends on: #4632 (via #5372)

The review on #5372 showed that carving drops an unrelated 47-byte payload between the final system page and graphics. File order then hides the interruption. Indexed folders now use the carver’s ordered offsets, stored lengths and preceding bytes for the existing archive framing checks. The change is commit cdb865e on top of f225fb3.

Loose folders retain file-order behavior. Indexed input trusts the carve manifest and cannot authenticate a same-size replacement. Missing or size-mismatched indexed payloads fail, and unlisted files are ignored. The joiner protects the manifest from output overwrite.

Validation (Windows, Python 3.13.15, CPU only, GPU and driver unused)

  • Real carver and joiner CLI regression for the inserted stream, with an index-free compatibility control. Synthetic cases cover wide and nonzero padding, malformed spans, roots, short final pages, and complete resource record equality.
  • 11 short-page tests, 9 model-join tests, 17 carver tests and 3 line-ending tests passed. Compileall and diff check passed.
  • Private Xbox 1.0.2.1 control: the first 64 MiB scan window of core_restofworld.rpf produced identical full resource records from the archive and a fresh indexed carve, with 924 joined resources, zero unjoined candidates, and 2,368 zlib streams. Eight individually carved complete model windows also matched. The inserted-stream regression is synthetic.

The broader translator semantic suite ran 6,245 tests and reported three failures, two errors, four skips and one expected failure. A full rerun at cdb865e reproduced all five in test_loop_ballot_barrier. Running that 15-test module on direct parent f225fb3 reproduced the identical five subcases and diagnostics: three wave64 mode-label assertions and two interpreter errors for unsupported OpFunctionCall. On main at 561b65a, all 15 tests in that module passed on Windows CPU. Merged #3995 covers the helper calls and scheduler modes involved.

AI-assisted with Codex.

@kacper-serewis kacper-serewis changed the title Use recorded archive boundaries for indexed model-folder joins BUILD-1906: Use recorded archive boundaries for indexed model-folder joins Nov 23, 2026
@shdann

shdann commented Nov 23, 2026

Copy link
Copy Markdown
Contributor

Tested cdb865e on Windows 11 with CPython 3.14.7, CPU only. All 42 tests pass. I ran each file with py -3.14 -I:

  • tests/test_carve_short_system_pages.py (11)
  • tests/test_restofworld_model_join.py (9)
  • tests/test_rpf9_carve.py (17)
  • tests/test_csv_line_endings.py (2)
  • tests/test_text_write_line_endings.py (3)

I ran the new interrupted-stream test with the tools from the direct parent, f225fb3b. The parent accepts the indexed folder and returns 0. This head rejects the incomplete resource and returns 1.

I also put two models in one synthetic archive. Their system data sizes are 65,537 and 131,135 bytes. The archive and the indexed folder produce identical full records for both models. All inputs were synthetic.

AI-assisted.

@memorypressure

Copy link
Copy Markdown

Verified against main 561b65a: merges cleanly and the whole carve/join neighbourhood is green on the merged tree — test_carve_short_system_pages 11 (new), test_rpf9_carve 17 (re-run), carve_errors 2, restofworld_model_join 9, restofworld_index 33, all driving the real tools as subprocesses. The ModelSystemPages refactor is behaviour-equivalent to the inline logic (case matrix walked: establish/decrement/zero paths and the min_inflate==1 rule match), and scan_dir's recorded-boundary mode is a strict improvement — overlap and non-positive-size rows rejected, size mismatches raise, require_archive_framing tightens joins. Checks pending. AI-assisted: yes. Tested on Linux (RTX 5080 host, CPU-only run).

@shayderrr shayderrr left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review

Reviewed change in PR #5896: BUILD-1906: Use recorded archive boundaries for indexed model-folder joins.

Scope: docs/restofworld.md, tests/test_carve_short_system_pages.py, tools/restofworld_model_join.py, +1 more
Diff: +418 / -32 across 4 file(s).

The change stays inside the stated scope and the touched files line up with the description. No unrelated production paths are pulled in, and the stated behavior is directly exercised by the diff. I'm approving this one.

Reviewed by shayderrr via automated batch review.

@shayderrr

Copy link
Copy Markdown
Collaborator

Thanks @kacper-serewis - I went through BUILD-1906: Use recorded archive boundaries for indexed model-folder joins and the diff around docs/restofworld.md. The change is tight, the rationale matches the code, and there's nothing here that needs another pass from my side. Approved and squash-merging it into main now. Nice work.

@shayderrr
shayderrr merged commit 6bb95d7 into ItsNotRexed:main Nov 23, 2026
0 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants