Review nits on #4035: the '?FPR' check still gives the data start for any RPF header, but +12 is a
measured trailer size only on RPF9, where it is a multiple of 16 in all 22 archives.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
movies.md says the bink_index counts for movies.rpf are derived, not a rerun, and names the 8 undecided
archives; rpf.md's small-block entropy wording; bink_index drops a redundant max().
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
In movies.rpf the 22,812 bytes after the last Bink stream are 3,884 zeros up to a 4 KiB boundary and then
exactly the header's u32 +12 (18,928) bytes to EOF. Over the package's 22 RPF9 archives the same holds in 14
(10 page-aligned after zero padding, 4 found by walking 16-byte-aligned zlib streams to the end); the other 8
end in a non-zlib file and can't be checked without the TOC. None contradicts it. bink_index.py counts the
trailer as rpf_trailer instead of unread.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Folds #1790's 22-archive run into rpf.md: 177,087 of 1,489,677 streams named (11.89%), coverage by stream
type, and its three findings (paths come from the payload, stream alignment differs per archive, anim.rpf
is the richest). Marked as reported there, not re-run; no paths or names copied.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Nine archive scanners sliced every gap out of the mmap to test whether it
was all zero (`gap = m[last:s]; gap.count(0) == len(gap)`). The slice is a
copy, so a gap of N bytes allocated N bytes at once; about half of
story000.rpf (~20 GB) is non-zlib, which ends in MemoryError on a 16 GB
machine.
tools/zero_span.py compares the gap with zeros 4 MiB at a time and stops at
the first non-zero window, with the same counts (all of a gap is padding
when every byte is zero, otherwise all of it is unread). rpf9_carve,
rpf9_names, bvh_index, navmesh_index, navmesh_decode, rbf0_index,
anim_index, restofworld_index and story_index use it.
tests/test_zero_span.py checks the counts against the old expression and
runs each scanner on a 48 MiB gap under tracemalloc: 50-51 MiB heap peak
on main, under 24 MiB with this change.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Re-measured against the local package: the RPF9 stream boundary that ends a system prefix (and the negative on the 8 MiB rule), the PRD0 member type codes, and the navmesh polygon +4 packing. The navmesh road/pavement bit labels did not reproduce and are recorded as such. 6stars is cited as independent corroboration; no code was copied and the repository has no licence.
docs/rpf.md said unread bytes "are recorded as a range", but the carve
only wrote the totals. The gap accounting, repeated before a Bink
stream, before a zlib stream and for the tail, moves into one helper.
It also appends every gap that is not all zero bytes to a top-level
`unread` list in index.json: off, size, and the Shannon entropy in
bits/byte of its first 1 MiB (`sampled`). summary.unread_ranges is the
count. Totals are unchanged; zero padding is not listed.
Measured on data.rpf: the same 20,268,240 unread bytes are 377 ranges;
278 of them (18,257,882 bytes, 90%) are at 7.5 bits/byte or more.
Counts only, in docs/rpf.md.
tests/test_rpf9_carve.py: ranges match the layout and the totals, a
uniform gap has entropy 0, a mostly-zero gap is one range, all-zero
gaps list nothing, and a range over 1 MiB samples its first MiB.
rpf9.hexpat names the measured header fields (magic, data offset at +4;
the u32s at +8 and +12 unnamed) and shows the rest of the header and the
TOC as one opaque range; it decodes nothing there. rbf0.hexpat follows
the grammar in docs/rbf0.md section 3: 1-byte descriptor index and type,
all record types including 0x50, 8- or 4-byte values from the prologue,
and it stops where the root closes, as rbf0_index.parse_rbf0 does.
tests/test_imhex_patterns.py builds synthetic wide and narrow RBF0
streams and RPF9 headers, checks them with parse_rbf0, and when ImHex
is installed runs each pattern through `imhex --pl format -f json` and
compares the result with the parser's.
Adds the #283 argparse validators to anim_index, rbf0_index, restofworld_index and rpf9_carve: --start >= 0, --limit >= 1 (decimal or 0x hex), and --max-inflate >= 1 in restofworld_index. Bad ranges now exit 2 before any scan or output instead of silently scanning everything, less, or nothing. Synthetic CLI tests in all four test files; docs notes for each tool.
New item claimed in #156. AI-assisted (OpenCode).
Add the full core_restofworld scan (1.21 GiB, 96% Bink 2 plus model/page data), re-measure story000_restofworld and story000_script, and cover the three small archives. Cross-check PSIN against script.rpf/story000 and core pages/models against packs.rpf/levels.rpf. Add a stdlib-only stream index tool and synthetic-header tests. No game data.
Measure the 0x60-byte header, the +0x38 table of {hash,size,pointer} resource records, and continuation streams. Correct the +0x60 key claim: it is payload on 29,297 of 29,298 pages. Add a stdlib page indexer with synthetic tests.
Index story000, shared_minigame000, and their script/restofworld/bvh4 companions with the fixed carver. Record the measured PSIN section chain, 0DRP page headers, RSC8 v8001 headers, nested RPF9 sub-archives, Bink 2 video and the bounded story000 layout. Add a stdlib story_index.py and synthetic-header tests; no game payload or name is committed.