Scanner: join stored (uncompressed) 64 KiB chunks into their chunked entry #221
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/holdmysocks--SixNG!221
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/221/head"
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?
@holdmysocks on GitHub · 2026-11-24 23:02 UTC · original
holdmysocks:fix/raw-chunks→master· +229 −17 · 2 files · 1 commits · merged 2026-11-24 23:13 UTCWhat
In a chunked entry, a 64 KiB chunk that does not compress is stored raw: exactly 65,536 bytes, no zlib header, at the next 16-byte aligned offset. The chunk after it is zlib again. The scanner only followed back-to-back zlib chunks. It stopped at the first raw chunk, so the index got a truncated entry and later a stray
binentry for the tail.Change
scan::is_raw). A zlib stream is always larger than its output, so the two can't be confused.read_stream/read_entrycopy raw chunks as-is.INDEX_VERSION6 → 7. Segment cache file names now carry a scan version, so old segment results are not reused.Results
The three PSO entries in packs.rpf that showed the problem now index at their full lengths:
Whole install (22 indexed archives), version 6 index vs version 7:
binentries gone: 43 (2,511 → 2,468). No other entry disappeared or appeared. Total entries 1,175,601 → 1,175,558.Workspace tests pass.
Linear: SIX-159
@kaoru-maki on GitHub · 2026-11-24 23:40 UTC · original
Independent check of #221 on 11 affected entries in the dialogue pipeline (five Story, five Story Script, one audio). We reproduced all 11 extended entries and verified 20 stored chunks against the original bytes.
All nine PSIN payloads matched our earlier complete extraction byte for byte. The other two entries were DAT166. Recovered bytes restored parts of their hash tables, and all 50,885 direct wave declarations agreed with the earlier read. The check found zero additional GXT tables and zero new verified subtitle-to-stream links. The 16 hash intersections with subtitle keys remain ambiguous. Ten of those keys already had candidate streams in our catalog. Thanks for making these entries readable directly through the scanner.