Repository navigation
Conversation
… levels.rpf result (ASSET-261) Walks the fragment drawable array (u16 at +0x30 records, 0x110-byte stride) and scans the system pages for other drawable bodies, over any plain RPF9 archive, with --jobs/--start/--end. Synthetic tests only. docs/character_models.md: levels.rpf and data.rpf counts next to the packs.rpf ones.
|
Independent CPU review at
AI-assisted. |
|
Tested f3072c3 on Windows, CPython 3.14.7, CPU only (no GPU, no game files).
I found one defect. The archive scan does not find a drawable at the last aligned offset of a fragment. Run this script from the repository root. It uses only synthetic bytes: import runpy
t = runpy.run_path("tests/test_fragment_children.py")
for padding in (0, 16):
b = t["fragment"](strays=(0x1f50,)) + bytes(padding)
print(len(b), t["fc"].drawable_body(b, 0x1f50), t["TestFragmentChildren"]().scan(t["archive"](b))["stray_drawables"])Actual result: Expected result: the count is 1 in the two cases. The body check accepts the same bytes in the two cases. AI-assisted. |
sds-228
left a comment
There was a problem hiding this comment.
Code review of f3072c3: no issues found. The census tool and its synthetic tests stay at count level, and the docs update matches the measured totals. Targeted suite: 19 tests OK; compileall and diff check clean.
AI-assisted (OpenCode).
|
Pushed d84e735: thanks @shdann, |
|
Tested the current head
Also as in the description: |
|
Verified merged with main on Linux: tests/test_fragment_children.py passes (19/19) and the compliance suites (text_write_line_endings, docs_python_deps, docs_repo_paths, docs_cli_flags, docs_links, tool_startup) are green on the merged tree. The tool is stdlib-only, pins newline="\n" on every write, and all test bytes are synthetic. The archive census figures need a game copy and were not re-measured here. AI-assisted: yes. Tested on Linux (RTX 5080 host, CPU-only run). |
Claimed in the coordination issue as: ASSET-261
AI-assisted.
What and why
docs/character_models.mdsaid the 50,798levels.rpffragments were "not raw-walked for child arrays; that is the one bounded gap". This closes it.tools/fragment_children.pyreads any plain RPF9 archive in place (same carve asskin_streams.py, no manifest, no TOC) and counts, per fragment, the child drawables. Measured layout: the u16 at fragment+0x30is the drawable count and the records are 0x110 bytes apart starting at the main drawable, so records 1 and up are children. It also scans every other 16-byte offset of the system pages for drawable bodies, so a child outside the array would show up as a "stray". It handles page directories that sit past the first system page, takes--jobs/--start/--end, and can write a local per-fragment records file for a re-count.Counts (the same tool on the three archives, same package, 1.0.2.1):
packs.rpfdata.rpflevels.rpfThe
packs.rpfrow reproduces the existing "2,865, no child arrays" result, which is the control. Inlevels.rpfevery declared child (a - 1, 735) is found at the stride and nothing else is found. The tool counts 50,802 fragments against the 50,798 in the issue (the exporter's manifest); I did not chase the 4. Also recorded: 10,097 levels fragments have a null+0x10,+0x20or+0x28, whichskin_streams.resource_kindrejects today (#2379), and 6 have a main drawable that fails the embedded header test.Not reproduced: the
bus2_frag_hifigures already in the doc ("14 model structs, 11 children") come from a different walk. This one does not count them, and the doc now says so.Tested
python -I tests/test_fragment_children.py(19 tests, synthetic pages and archives only): Python 3.12.16 on Linux (WSL2) and Python 3.13.1 on Windows.python -m compileall -q make_game.py tools tests,tests/test_docs_list_items.py,tests/test_text_write_line_endings.py,tests/test_skin_streams.py: pass on Linux 3.12.16.test_non_finite_bounds_are_not_a_body; removing the model geometry-count check failstest_model_with_mismatched_geometry_counts_is_not_a_body.levels.rpftook 22 min with 12 workers over a WSL mount. Nothing from the archives is in the repo.Checklist