Repository navigation
Conversation
With Options::restart_from_first_volume (what `pry extract` and `pry test` pass), every RAR run opened the volume it was given a second time, reading its 1 MiB signature window again, only to learn whether its first member continues from an earlier volume. A volume with none before it by name (part1, an old-style set's .rar) can never restart, so the name is checked first and the volume isn't reopened. A run from a later volume restarts as before. Covers run_with_zip_policy / run_with_policy, run_with_password and run_rar_with_outcomes, with and without a self-extractor prefix, and list_detailed_with_options. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LG44gZ63jJDJGeNcamsGrj
|
@codex review |
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex Review: Didn't find any major issues. You're on a roll. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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
|
@codex review |
|
Codex Review: Didn't find any major issues. Breezy! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
Why
After #313, Prybar's
pry extractof a 500 MB, 10-volume stored RAR5 set still read 1,048,590 bytes of part01 twice.pry extractandpry testsetOptions::restart_from_first_volume. With it,rar_run_shared_openopened the volume it was given, then calledrestart_volume. That ranstarts_with_continuation, which opened the same volume again throughVolume::open_with_passwordand read its wholeMAX_SFX + 8signature window a second time, just to see whether its first member continues from an earlier volume. The other 6 bytes are the ISO 9660 sniff at 32 KiB.What
restart_volumelooks at the name first. A volume with no earlier volume by name (part1, or the.rarof an old-style set) can never restart, so it is not reopened. Before, that case also returnedNone, but only after the probe, so the result is the same. A run given a later volume still probes it and restarts as before.All the dispatchers go through
rar_run_shared_open, so this one change coversrun_with_zip_policy/run_with_policy/run_with_context,run/run_with_password, andrun_rar_with_outcomes.list_detailed_with_optionsnever restarts. It already reads each header once and is now covered by a test.RarSession's own restart probe (Catalogue::restart_volume, budgeted and only withfollow_volumes) is unchanged.Measured
These numbers come from
strace -f -ff -yof a release build on rustyget-x86-d. The harness is an uncommitted example callingrun_with_zip_policywithrestart_from_first_volumeandreplace_placed_links, aspry extractdoes. The set is a 500 MB stored RAR5 set made byrar a -m0 -ma5 -v52428800b(part01–part10 at 50 MiB, plus a 1,858-byte part11). The output matches the input byte for byte in both runs.The "before" figure is exactly the 1,048,590 bytes Prybar saw. The 6 left on part01 are the ISO 9660 sniff at 32 KiB, as after #313. Every other volume is read once.
Tests
extract::read_once::every_dispatcher_reads_each_volume_once_when_it_may_restartrunsrun_with_zip_policy,run_with_passwordandrun_rar_with_outcomeswithrestart_from_first_volumeandreplace_placed_links(aspry extractdoes), and lists withlist_detailed_with_options. Each runs with and without a 100 KB SFX prefix, and every volume must be read once (VOLUME_READS). On main it fails withset.part1.rar: read (0, 1048584) with 1024 read so far.extract::read_once::a_run_from_a_later_volume_still_restartschecks that a run given part2 still extracts the whole set.Local: the
extract::read_oncetests andcargo nextestover the RAR and volume tests (987) pass. fmt and clippy are clean.Clean-room: no third-party code read or used.
🤖 Generated with Claude Code
https://claude.ai/code/session_01LG44gZ63jJDJGeNcamsGrj