Adds the full levels.rpf pass (1,116,073 streams / 188,449 pages / 465,611 q38 / 3,281 continuations, 17.7 min) and the finding that only 52,776 of its pages start the first q38 payload at +0x60. Restacked on #3388, which already carries the full data/nav/anim pass and the q28 parser fix.
_q28 stopped a +0x28 table at the first record whose pointer is not
0x50000000-based. Over all of anim.rpf that is a zero pointer on 3,672
records (3,511 of 22,823 pages), and 116,277 ordinary records after them
were left out of the report. Such a record is now kept with target null
and the table is read on; any other non-base pointer still ends it.
A q28 table that ends past the streams read for q38 (1,355 anim.rpf,
225 navmeshes.rpf, 1 data.rpf pages) came back empty with no reason; it
now says so in q28_error. The summary gains q28_declared,
q28_null_targets and q28_tables_unread.
docs/page_directory.md: navmeshes.rpf and anim.rpf read to the end
(9,603 and 22,823 pages) next to the 64 MiB / 256 MiB samples, with the
header ranges and the two q28 statements the samples did not show.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
The +0x20 count is the only field that looked like a grouping unit, so it was tested against
every stream boundary reading on story000.rpf before being used: a directory is followed by one
non-directory stream in 16,128 of 16,977 cases regardless of the count, and the best page-size
reading matches 9,622 pages (56.7%). The boundary comes from the q38 table, so each page now
reports the streams that make up its resource and whether the declared count agrees with the
64 KiB units they occupy.
bvh_index, page_index, story_index, navmesh_index and psin_index:
- --limit 0 meant "no limit" (0 is falsy) and a negative --limit scanned
nothing and still exited 0 with an empty index. --limit must now be at
least 1 and --start 0 or more; argparse rejects anything else (rc 2).
- An empty .rpf crashed in mmap ("cannot mmap an empty file") and a file
shorter than the header word crashed in struct.unpack_from. bvh, page and
story now treat both as an archive with no streams.
- bvh_index directory mode: one bad archive no longer aborts the scan and
loses the results of the others; it is reported and skipped.
- A --start past the end of the archive is a one-line error (rc 2) instead
of a traceback (bvh also checked nothing and reported a negative span).
- page_index checks the output extension before the scan, not after it.
Docs: the accepted ranges and the empty-archive behaviour are written next
to each tool's usage in docs/{bvh,navmesh,page_directory,psin,story}.md.
Tests: synthetic cases for each tool; they fail on main and pass here.
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.