Repository navigation
Slice-level in-memory repair API (WI-153) - #13
Merged
Merged
Conversation
Add `Repair`, an I/O-free builder over the existing D×D approach: load recovery rows, `feed`/`feed_batch` present slices (short last slices are zero-padded without copying), then `solve` for the missing ones. Errors cover too few recovery rows (InsufficientRecovery), singular matrices, out-of-range/too-long/duplicate slices, and slices neither fed nor missing. Peak memory is rows × slice_size plus the solved output; `truncate_rows` drops rows solve will not use. The file-based repair functions now read intact slices and feed them to `Repair`, so there is one fold. `BlockMap`, `BlockFile`, `SliceLocation` and `build_block_map` are public, with `global_to_file` returning an Option. New `slice` module: `SliceHasher` (IFSC MD5 + CRC32, zero-padded) and `Par2File::slice_matches` for verifying slices before feeding. Tests use a new par2cmdline 1.0.0 fixture (3 files, 12 slices, 8 recovery blocks): 1..=8 missing slices, too many missing, file-based vs builder equivalence, a random-layout property test, and corrupt-feed behaviour. WI-153 Co-Authored-By: Claude Opus 5.5 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds a slice-level in-memory repair API: feed the slices you have, solve for the missing ones, with no file I/O. Reviewed CLEAN at d4fe1fa. No version bump; the 0.2 release is WI-154.
🤖 Generated with Claude Code