mirror of
https://github.com/ubiquitarianism/leonida.git
synced 2026-11-26 21:30:53 +01:00
[PR #2382] world_archetypes: read a carved resource's continuation file too (WORLD-ARCHETYPES-FOLDER-CONTINUATION) #2384
Labels
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
starred/leonida#2384
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
📋 Pull Request Information
Original PR: https://github.com/ubiquitarianism/leonida/pull/2382
Author: @syfyra
Created: 11/26/2026
Status: 🔄 Open
Base:
main← Head:fix/world-archetypes-folder-continuation📝 Commits (1)
e801a13world_archetypes: read a carved resource's continuation file too (WORLD-ARCHETYPES-FOLDER-CONTINUATION)📊 Changes
2 files changed (+32 additions, -1 deletions)
View changed files
📝
tests/test_world_archetypes.py(+18 -0)📝
tools/world_archetypes.py(+14 -1)📄 Description
Claimed in the coordination issue as: WORLD-ARCHETYPES-FOLDER-CONTINUATION (https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7197984448)
What and why
tools/world_archetypes.pyreads archetype definitions (CMapTypes) and, with--check-extents, map entity blocks, from an RPF9 window, a carved file or a folder of carved streams.On a folder,
iter_resourcestakes the rows fromworld_index.scan_path, which joins a0DRPzresource whose blocks run past its stream with the carved file of the stream that followed it. It finds that file through rpf9_carve'sindex.json(_carve_successors, asscan_rpfdoes in an archive). The row then carries the joined length assizebut only the first file asfile.iter_resourcesre-read that first file alone, so every block stored in the continuation was lost without a warning:--check-extentscompares.The same two streams inside an RPF9 window are joined by
WC.assembleand read in full.docs/world_census.mdcounts 2,868 maps that join a continuation, and a large CMapTypes or interior resource runs past its first stream the same way.iter_resourcesnow joins the same files: it follows the carve's successors while the data is shorter than the row'ssize. Single carved files, folders withoutindex.jsonand resources that fit in one stream read exactly as before.Different topic from #1555 (identity quaternion, nameless definitions, atomic writes; same files); the two merge cleanly.
Tested
Windows 11, Python 3.14.7, synthetic resources only:
python -I tests/test_world_archetypes.py: 20 tests OK. Newtest_folder_joins_a_continuation_file_as_world_index_does: a carve folder as rpf9_carve writes it (<offset>.binper stream plusindex.json). The CMapTypes resource's last block runs 0x10 bytes into the next stream, and the map file is a separate stream. It asserts thatscan_pathjoins the two (row size = whole resource) and that the CLI then reports the same summary as the RPF9-window test (2 archetypes, extents checked). Onmainit gets(maptypes, archetypes, names) = (1, 0, 0).main, and 40 from both with the fix (review repro).python -m compileall;scripts/check_no_game_data.pyon both files.Not measured: how many archetypes this recovers from a real carve (no game files here).
GPUs tested: n/a (CPU-only tool)
AI-assisted: yes (Claude Code, Claude Opus 5.5)
Checklist
mainand merges cleanly (a conflicting pull request is labeledneeds rebase).docs/design.md, with how it was confirmed. (n/a: no translator change)🤖 Generated with Claude Code
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.