Add experimental delta calculation and custom topology support#2561
Open
HairlessVillager wants to merge 12 commits into
Open
Add experimental delta calculation and custom topology support#2561HairlessVillager wants to merge 12 commits into
HairlessVillager wants to merge 12 commits into
Conversation
717007d to
5ad6fee
Compare
`from_delta_ref` now accepts pre-compressed data and a separate `decompressed_size`, removing the redundant zlib round-trip. - `find_delta` returns `(&[u8], u64)` borrowing compressed bytes directly from the pack entry - "new delta" path compresses `diff()` output once via deflate::Write - `compute_delta` renamed to `diff`, encodes varint header + instructions into a single buffer - Feature gate `experimental-delta-create` now includes `dep:parking_lot` Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Covers three code paths: new delta (compute_delta), new base (from_data), and reuse delta (find_delta). Uses a dedicated `kind="delta-create"` to avoid modifying existing journey tests. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
The `from_delta_ref` function was a one-liner wrapper around `output::Entry` construction — too trivial to warrant its own function and `mod entry` block. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
ci-journey-tests
Contributor
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 937d69cbd1
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "Codex (@codex) review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "Codex (@codex) address that feedback".
The `count::objects()` API requires `Box<dyn Iterator + Send>` which implicitly has a `'static` lifetime bound. The previous implementation used `.inspect()` to populate the `topo` HashMap lazily within the iterator chain, allowing input parsing and counting to overlap. Boxing this iterator as `'static` conflicts with `topo`'s non-static borrow. As a workaround, eagerly collect all parsed input into a Vec first, populate `topo` in a separate pass, then create the boxed iterator from the collected data. This trades the lazy streaming for an extra allocation. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
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.
This PR introduces experimental delta calculation and custom delta relationship topology, exposed via the
gix free pack delta-createCLI for verification.As an experimental feature, I have aimed to reuse existing code as much as possible while maintaining patch cohesion. Some code has been copied from other modules or crates (marked with
NOTEin comments); however, these duplications can be easily resolved by adjusting function visibility or through simple refactoring.I'm not quite sure how to write test, and I think current test is not very graceful. Any feedback is welcome :)
Roadmap:
experimental-delta-createfeature ingitoxide-core/Cargo.tomlgitoxide-core/src/pack/delta_create.rsclapcommand-line arguments insrc/plumbing/options/free.rsgix free pack delta-createCLI insrc/plumbing/main.rstests/journey/gix.shCloses #2531