Skip to content

Opt-in unverified output (UnverifiedOutput::Emit): what UnRAR p / x -kb and 7z x -so hand over of a failing member - #317

Merged
xbmc4lyfe merged 14 commits into
mainfrom
unverified-output
Nov 27, 2026
Merged

xbmc4lyfe merged 14 commits into
mainfrom
unverified-output

Conversation

@xbmc4lyfe

Copy link
Copy Markdown
Collaborator

Opt-in "unverified output": what UnRAR 7.30 and 7-Zip 26.06 hand over of a member that then fails (a missing volume, a CRC, a data error, a wrong password shown by its effect, an unsupported RAR VM filter). For Prybar's --compat-unverified-output and RustyGet's live extraction. Defaults are unchanged.

API (for Prybar)

One enum, zipfast::extract::UnverifiedOutput { Withhold (default), Emit }, in four places:

field route under Emit how the failure is still reported
extract::Options::unverified_output extract::run, run_with_password, run_rar_with_outcomes, dispatchers with keep_broken: a RAR member cut off by a missing volume keeps exactly what unrar x -kb keeps (without keep_broken it is removed, as unrar x does) the usual "missing volume" failure
same RarSession::extract_selected / _controlled with keep_broken: that member is written and kept (by default a session doesn't write it at all) RarOutcome::Failed(MissingVolume | Integrity{MissingSplitContinuation})
RarPrintOptions::unverified_output RarSession::print_selected (unrar p) a member failing on its own data (checksum, decoder error, missing volume) prints what was decoded of it; a cut-off member is decoded from the volumes that are there RarOutcome::Failed(..) plus RarEntryOutcome::unverified_bytes = Some(n) (new field)
sevenzip::SevenZipPrintOptions::unverified_output with new sevenzip::print_selected_with_options 7z x -so a failing 7z member streams what 7-Zip streams its line in Summary::errors plus Summary::unverified: Vec<UnverifiedMember { index, name, bytes }> (new field)
extract::SelectOptions::unverified_output (.unverified_output(..), copied by From<&Options>) SelectedEntry::open_cancelable_with_options / ..._zip_limit_and_options 7z: as above. RAR 3.x/4.x: an unsupported VM filter's block is streamed unfiltered (7-Zip x -so, "Unsupported Method") read returns Error::Io carrying extract::UnverifiedWritten { bytes, cause } (UnverifiedWritten::of(&err)); cause is the failure you'd get without Emit, Error::Unsupported(extract::UNFILTERED_SELECTED) for an unfiltered RAR member

New Options field: add unverified_output: Default::default(), to Options { .. } literals.

Behaviour against the reference tools (Linux x64 binaries, docker --network none)

  1. unrar p / x -kb, multi-volume RAR missing a later volume: multi_broken.part1.rar file2.txt: 6,198 bytes, identical to UnRAR (was nothing). UnRAR doesn't decode to the last bit. What we observed: RAR 3.x/4.x leaves out an LZ token starting in the last 30 bytes. RAR 5.0 leaves out a symbol starting in the last 128 bits, skips a block that has fewer than 1,024 bytes present, and then also drops the previous block's last symbols. This was fitted and checked against 50 cut points: 3 RAR 3.x sets, textvol.part1.rar (968,316 bytes), and text.rar made into a cut first volume at 46 places, including both sides of three block starts. All are byte-identical.
  2. 7z x -so on a failing 7z member: CRC failure: every byte decoded. LZMA/LZMA2 data error: the bytes before it. Folder cut short: the bytes decoded. Wrong password, LZMA: nothing. Wrong password, Copy: the garbage. Later member of a broken solid block: nothing. All byte-identical to 7-Zip; exit 2 is the caller's job. To get there, the LZMA readers now hand out what decoded before a data error, then the error. Default outcomes don't change.
  3. -so for RAR members with unsupported filters: generic_delta_padding_mutation.rar: 1,048,576 bytes, SHA-256 aff2543c…76c5, the same as Linux 7z x -so.

Not covered (documented in docs/compat-options.md):

  • A Copy folder whose header gives fewer packed than unpacked bytes is still refused as malformed headers.
  • Multi-threaded LZMA2 hands over only what its workers finished.
  • RAR5 blocks decoded on worker threads can't give back their last symbols. A cut under 16 bytes past such a block may give a few bytes more than UnRAR.
  • SelectedEntry doesn't imitate 7z x -so on a RAR member cut off by a missing volume. 7-Zip itself writes nothing for RAR4 and decodes RAR5 to the end.

Tests

tests/unverified_output.rs (fixtures and provenance in tests/fixtures/unverified-output/README.md):

  • whole_archive_runs_keep_what_unrar_decodes_of_a_member_cut_off_by_a_missing_volume
  • rar_session_print_prints_what_unrar_prints_of_a_member_cut_off
  • rar_session_extraction_keeps_what_unrar_decodes_of_a_member_cut_off
  • seven_zip_print_streams_failing_members_as_seven_zip_does
  • selected_entry_streams_a_failing_7z_member_as_seven_zip_does
  • selected_entry_streams_a_rar_member_with_an_unsupported_filter_unfiltered

Each test checks Withhold (unchanged), checks that Emit gives the reference tool's bytes (length and SHA-256), and checks that the failure is still reported. Revert check: with the behaviour disabled but the API kept, all 6 tests fail.

🤖 Generated with Claude Code

https://claude.ai/code/session_01LG44gZ63jJDJGeNcamsGrj

xbmc4lyfe and others added 2 commits November 26, 2026 17:05
…treams what UnRAR and 7-Zip hand over of a failing member

- Options::unverified_output (whole-archive RAR runners, RarSession extraction with keep_broken): a RAR member cut
  off by a missing volume keeps every byte UnRAR 7.30 `x -kb` keeps (RAR 3.x/4.x: LZ tokens starting in the last
  30 bytes left out; RAR 5.0: the partial block decoded, symbols in the last 128 bits left out, a block with under
  1024 bytes skipped; observed on 50 cut points).
- RarPrintOptions::unverified_output (`unrar p`): a member failing on its own data prints what was decoded of it;
  RarEntryOutcome::unverified_bytes says how many bytes went out.
- sevenzip::print_selected_with_options + SevenZipPrintOptions (`7z x -so`): a failing 7z member streams what
  7-Zip 26.06 streams (CRC failure: all; data error / cut folder: the bytes before it); Summary::unverified.
- SelectOptions::unverified_output (SelectedEntry): 7z as above; RAR 3.x/4.x unsupported VM filters streamed
  unfiltered; read fails with UnverifiedWritten { bytes, cause }.
- LZMA readers hand out the bytes decoded before a data error, then the error.

Defaults unchanged. tests/unverified_output.rs checks each route against the reference tools' output.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LG44gZ63jJDJGeNcamsGrj
@xbmc4lyfe

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 27, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-27T03:23:27.743412Z 54eacb6 New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: bdccd8db80

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/sevenzip/run.rs Resolved
Comment thread src/sevenzip/run.rs Resolved
Comment thread src/sevenzip/coders.rs Resolved
…s propagate, LZMA errors at the last byte stay

- A member failing behind ones held for the folder's CRC is queued behind them (printed in archive order).
- wrong_password() returns a result: an output error replaying held members ends the run.
- The LZMA readers put a data error off only when the caller asked for more than was made; one asking for exactly
  the bytes left never reads again, so the error is returned then (default outcomes unchanged).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LG44gZ63jJDJGeNcamsGrj
@xbmc4lyfe

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Keep it up!

Reviewed commit: 3b19f3d85c

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@xbmc4lyfe

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Can't wait for the next one!

Reviewed commit: 4f3ad0926f

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 4f3ad0926f

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/extract.rs Resolved
Comment thread src/rar5/session/selection/printing.rs Resolved
Comment thread src/extract.rs Resolved
xbmc4lyfe and others added 2 commits November 26, 2026 17:59
…ver buffered bytes, unfiltered prerequisites don't stop a selected read

- Run::emit_unverified returns a fault writing the flushed bytes as the run's terminal error.
- RarSession decoding under UnverifiedOutput::Emit flushes what a failing decoder still buffers before the failure
  (printing and keep_broken extraction get every byte decoded).
- SelectedEntry (Emit) goes on past a solid prerequisite written unfiltered; only the selected member's own
  unfiltered write fails the read.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LG44gZ63jJDJGeNcamsGrj
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LG44gZ63jJDJGeNcamsGrj
@xbmc4lyfe

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 1f487c1bb1

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/rar5/session/selection.rs Resolved
xbmc4lyfe and others added 2 commits November 26, 2026 18:18
…was decoded under Emit

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LG44gZ63jJDJGeNcamsGrj
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LG44gZ63jJDJGeNcamsGrj
@xbmc4lyfe

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Breezy!

Reviewed commit: 7f9cc370f4

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LG44gZ63jJDJGeNcamsGrj
@xbmc4lyfe

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Something went wrong. Try again later by commenting “@codex review”.

Unknown error
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LG44gZ63jJDJGeNcamsGrj
@xbmc4lyfe

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. You're on a roll.

Reviewed commit: 97a2adf733

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

xbmc4lyfe and others added 2 commits November 26, 2026 18:59
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LG44gZ63jJDJGeNcamsGrj
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LG44gZ63jJDJGeNcamsGrj
@xbmc4lyfe

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Keep them coming!

Reviewed commit: 0162c3d0e7

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

…rified_output)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LG44gZ63jJDJGeNcamsGrj
@xbmc4lyfe

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Chef's kiss.

Reviewed commit: 54eacb6ce3

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@xbmc4lyfe

Copy link
Copy Markdown
Collaborator Author

Local CI (/ci-local on rustyget-arm-b), exact head 54eacb6, up to date with origin/main:

zipfast local CI @ 54eacb6c (uncommitted tracked changes: 0)
==> fmt --check                                             ok (3s)
==> clippy -D warnings                                      ok (14s)
==> clippy -D warnings (persistent-partials)                ok (17s)
==> test (workspace)                                        ok (436s)
==> test (persistent-partials)                              ok (545s)
==> doctests                                                ok (2s)
==> doctests (persistent-partials)                          ok (3s)
ALL GATES PASSED @ 54eacb6c (full); log: /var/tmp/zipfast-ci.tSh2Bu

Codex review on this head: no findings; all review threads resolved.

@xbmc4lyfe
xbmc4lyfe merged commit e4c775c into main Nov 27, 2026
5 of 7 checks passed
@xbmc4lyfe
xbmc4lyfe deleted the unverified-output branch November 27, 2026 03:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant