Commit Graph

10 Commits

Author SHA1 Message Date
4c8cc5ddf3 Merge pull request #3861 from Kam471
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 23:09:00 -05:00
207cecb2fa docs: name the sampled windows on the remaining cross-check claims 2026-11-23 00:07:01 +00:00
04d89e491b docs: full levels.rpf page-directory counts (ASSET-292)
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.
2026-11-22 22:17:31 +00:00
40cb3089a1 Merge pull request #3581 from Kacper Serewis 2026-11-22 17:02:49 -05:00
ca028b50c0 Identify story000.rpf as the measured q38 export source 2026-11-22 22:05:21 +01:00
269d2a834e Document the single missing q38 tag in the ASSET-286 sample 2026-11-22 21:58:55 +01:00
575a49b029 page_index: keep q28 records after a null pointer; whole-archive counts for page_directory.md
_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>
2026-11-22 20:22:59 +00:00
e73aaca078 page_index: report 0DRP resource groups and the +0x20 disagreement (ASSET-150)
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.
2026-11-22 16:40:07 +00:00
76b7b5b329 Index tools: refuse --limit/--start values that scan nothing, survive empty archives
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.
2026-11-21 23:21:29 +01:00
950e599577 Docs: decode the RPF9 0DRP page directory
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.
2026-11-21 19:56:46 +00:00