Repository navigation
Batch RAR 2.0 history compaction - #103
Merged
Merged
Conversation
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.
RAR 2.0 moved its retained 1 MiB window after every solid member, even when the member added only a few bytes. Batch those moves across small members for unlimited readers, trimming once the obsolete prefix reaches 64 KiB. Compact earlier if the next member would otherwise exhaust existing buffer capacity.
Unlimited checkpoints copy only the required window and adjust their absolute base position, so deferred bytes do not increase checkpoint allocations or affect restored buffer growth. Quota-limited readers retain the original eager trimming, clone allocation order, and failure prefixes. No ring buffer or additional decoder state is introduced.
Tests compare against the original eager policy across full-distance and overlapping matches, pending matches, irregular sizes, exact-fit capacity boundaries, checkpoint restoration, allocation refusals, sink failures, and cancellation. A 512-member test reduces window moves from 512 to eight while preserving bytes and backing capacity.
The benchmark now includes fresh-seeded solid sequences, owned and streaming output, and checkpoint/restore controls. Run it with
cargo bench -p rars --bench rar20_decode -- rar20_solid_history.Three alternating baseline/final measurement runs on synthetic repeated-byte data showed:
Validation:
claude -pplan, checkpoint-refinement, and final reviews: approved, no blocking findings.