OLD-7750: restofworld_model_join: handle straddling page-map slots, sort loose hex dirs numerically, and harden index.json load #886
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/886"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from ubiquitarianism/leonida. Originally posted by narekshaghoyandev on 2026-11-24T14:56:29Z.
Reopening my original upstream PR #7750 (previously verified on WSL2 Py3.12/3.14 and Debian Py3.13 by
@hcampbell98and@azterixx), cleanly rebased ontomain:datResourceMapslot array straddling a 64 KiB system page boundary (_parse_page_map_header,ModelSystemPages.accept,join_streams): Validates the 16-byte header and any slot bytes already present in page 0 first so remaining declaredsystem_pagesare fetched before fullparse_page_map(sys_bytes), and preserves short (< 64-byte) final system pages when slots cross out of page 0.scan_dir): Sorts hex-offset filenames numerically (fixing mixed-width / mixed-case hex names) and matches.bin/.bk2case-insensitively.index.jsonBOM and deep nesting (_carve_rows): Readsindex.jsonasutf-8-sigand turnsRecursionErrorinto a cleanValueError.Verification
python3 -I tests/test_restofworld_model_join.py -v: 12/12 pass (all 3 new tests fail/error againstmain).python3 -I scripts/check_no_game_data.py tools/restofworld_model_join.py tests/test_restofworld_model_join.py: clean.python3 -m compileall -q tools/restofworld_model_join.py tests/test_restofworld_model_join.py: clean.Claimed in the coordination issue as: OLD-7750 (https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7135175513)
AI-assisted: yes (Gemini)
Imported from ubiquitarianism/leonida. Originally posted by PierreEbele on 2026-11-25T21:01:42Z.
Reviewed
e4cd0747c: I ran tests/test_restofworld_model_join.py (12/12 on the PR; the 3 new tests fail on origin/main as expected) and tests/test_carve_short_system_pages.py (11/11 on both trees; rpf9_carve shares ModelSystemPages). Probes with synthetic data: a straddling page-map slot array now joins (loose dir, sp=2/gp=1) where main rejected it, a non-zero slot in the straddled page stays rejected with the precise error, and a 50000-deep index.json exits rc=1 with "nesting is too deep" instead of the uncaught RecursionError main raises. check_no_game_data passes on both changed files. No findings. AI-assisted review.Recommendation: Merge
Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-11-28T13:06:39Z.
Red/green: tests/test_restofworld_model_join.py 3 failed on main, 12 passed with the PR.
Targeted batch of 30 PRs (their tests, the tests importing the changed modules, the docs tests, the translator suite) on main
a997a3c: no new failure, Windows 11 / Python.AI-assisted (Claude Code, Claude Opus 5.5)