Repository navigation
odrp_7a: preserve pending continuations, join short tails, and classify 108-byte LRSC+CHKS tails - #7597
odrp_7a: preserve pending continuations, join short tails, and classify 108-byte LRSC+CHKS tails#7597mynzjerko wants to merge 1 commit into
Conversation
…fy 108-byte LRSC+CHKS tails
|
Tested 52808a5 merged with main dde82f2 on Linux/Python 3.12.16: pass Commands run ( Negative control (non-test files restored from main, tests kept): Without the tools/odrp_7a.py change the new tests in test_odrp_7a.py fail (failures=4 of 18); with it all 18 pass. Diff read: the psin tail check is factored into _parse_psin_tail and also tried when a blob starts with an LRSC tag but has the wrong size; scan_rpf no longer flushes a pending record up front (Consumer.feed already flushes it when the next stream cannot join) and accepts a 1-byte continuation stream. |
|
Checked on Linux: merged onto main dde82f2 (merges cleanly).
Read the diff as well; it looks right to me. |
|
Tested 52808a5 on Windows 11 (NTFS), Python 3.12.10 (CPU only, no GPU, no game files): pass What I ran:
Edge cases,
For the short tails,
Docs: Overlap: the other open AI-assisted (Claude Code). |
Summary
Fixes three continuation and tail-classification bugs in
tools/odrp_7a.py(no overlap with #7470):Premature pending flush on rejected zlib candidates (
scan_rpf):scan_rpf()calledconsumer._flush_pending()wheneverconsumer.pending["next_off"] != sbefore attempting to decompress and validate the candidate ats.78 01/5e/9c/da) in gap/padding bytes beforenext_offprematurely flushed and aborted the in-progress split standalone/PSIN resource beforezlib.errorrejected the candidate, preventing the real continuation atnext_offfrom joining.consumer.feed()(which already flushes pending state when an accepted stream does not matchnext_off) and setkeep_full = is_continuation.Short (
< 64-byte) continuation streams dropped inscan_rpf:scan_rpf()enforced a fixedtotal < 64cutoff even on a valid continuation stream sitting at the exact 16-byte-alignedconsumer.pending["next_off"], dropping short final chunks (e.g., a 12-byteCHKStail or 24-byte final standalone page) thatscan_dir()joins cleanly.min_size = 1whenis_continuationis true (keeping64for new standalone candidates).108-byte
LRSC + CHKStail streams falsely rejected as malformedlrsc_section(parse_psin_lrsc):parse_psin_lrsc()checkedblob[:4] == b"LRSC"withlen(blob) != 88before thepsin_tailcheck (len(blob) >= 108), so an unjoinedPSINcontinuation starting directly withLRSC(88 B) +CHKS(20 B) returnedframing="lrsc_section", complete=Falseinstead offraming="psin_tail", complete=True._parse_psin_tail()and check it before rejectinglen(blob) != LRSC_SECTION_SIZE; genuinely malformedLRSCsections without a validCHKStail still fail aslrsc_section.Testing (CPU-only, synthetic inputs, no game data)
python -I tests/test_odrp_7a.py: 18/18 OK (including 3 new synthetic regression tests / 4 cases).tools/odrp_7a.pyfromorigin/mainwith the new tests): FAILED (failures=4) — all 4 new cases fail cleanly before the fix.python -m compileall -q tools/odrp_7a.py tests/test_odrp_7a.py: pass.python -I scripts/check_no_game_data.py: pass.git diff --check: pass.Claimed in #7496. AI-assisted (Antigravity).