WI-151: emit IFSC slice checksums in the PAR2 test fixture - #143
Merged
Merged
Conversation
…-151) The synthesised PAR2 index only carried Main + FileDesc packets, so a fixture set had no per-slice checksums and rust_par2 reported every file as damaged. Emit IFSC (Input File Slice Checksum) packets too: per file, the File ID followed by (MD5[16] + CRC32[4]) for each slice, with the final partial slice zero-padded to the slice size exactly as PAR2 and rust_par2's verifier compute them. This is the first piece of the WI-151 deterministic PAR2 fixtures and is what the in-flight slice verifier (WI-144) will check decoded slices against. Two tests prove the checksums are byte-exact: an intact file verifies through the slice checksums, and a single corrupted slice is pinpointed by its block index (which only works if the per-slice MD5/CRC are correct). Full nzb-postproc suite stays green. RecoverySlice packets remain out of scope here (they need the encoder and only matter for repair fixtures, WI-146/148). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TpoFnScdkRq7qxQLQZe1we
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.
First piece of the WI-151 deterministic PAR2 damage fixtures (parity-in-flight initiative). Independent of the WI-143/#140 and WI-144/#141 branches.
What
The synthesised PAR2 index (
crates/nzb-postproc/tests/support/par2_fixture.rs) only carried Main + FileDesc packets, so fixtures had no per-slice checksums andrust_par2reported every file as damaged. This adds IFSC (Input File Slice Checksum) packets: per file, the File ID followed by(MD5[16] + CRC32[4])per slice, with the final partial slice zero-padded to the slice size — exactly as PAR2 andrust_par2's verifier compute them. Adds acrc32fastdev-dependency.This is what the in-flight slice verifier (WI-144, #141) will check decoded slices against.
Proof it's byte-exact (
tests/par2_slice_fixture.rs)rust_par2::verify(...).all_correct().damaged_block_indices == [1]after flipping a byte in slice 1, which only holds if the per-slice MD5/CRC32 are correct.Full nzb-postproc suite stays green (59 unit + existing fixture/deobfuscation tests unaffected);
fmt+clippy -D warningsclean.Out of scope (remaining WI-151, follow-ups)
🤖 Generated with Claude Code
https://claude.ai/code/session_01TpoFnScdkRq7qxQLQZe1we