perf(git): harden large repository maintenance and fetch - #75
Merged
Conversation
forhappy
force-pushed
the
codex/large-repo-hardening
branch
from
August 24, 2026 16:06
eb0e911 to
e54b9a4
Compare
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.
Current implementation head
The PR branch is
68ddf2fc(docs(plan): record visibility bitmap repair). Thecode fix is
01d588ea; the latest commit records its failure, invariant, andreleased-shape proof in the large-repository roadmap.
Summary
This PR hardens Crab for Kubernetes-scale history and sustained large-team Git
activity on object storage. It combines geometric pack maintenance, a
generation-bound object catalog, bitmap-native visibility planning, split
commit-graph metadata, delta-preserving response assembly, bounded maintenance,
cache-safe generated packs, crash recovery, and a real Kubernetes/RustFS
qualification harness.
The design borrows Git/GitHub’s large-repository ownership model—MIDX-like
object identity, multi-pack reachability bitmaps, split commit graphs,
geometric maintenance, and immutable response artifacts—without copying Git
implementation source or requiring a Git data server.
Latest correctness fix
The first released-shape run after active-marker recovery (
32914574732) founda real shared-state bug in the response-loss lifecycle:
GitVisibilityIndex::apply_editgrows one shared OID dictionary and resizedcurrent-ref and incremental-history bitmaps.
transitionsfor other refs.visibility closure bitmap length does not match its dictionary.01d588eafixes the invariant by resizing every retained transition bitmapwhenever the dictionary grows. The regression
unrelated_ref_transition_bitmaps_follow_dictionary_growthexercises a densetransition on one ref, grows the dictionary through an unrelated ref, and
requires catalog identity binding/validation to succeed.
Qualification proof
The fixed code head passed the complete Git protocol v2 qualification
workflow:
The final-head large-repository RustFS qualification workflow is green; its Kubernetes replay job is manual and skipped in pull-request CI, while the qualification-report contract passed. The earlier full Kubernetes replay remains historical evidence. The final head also passed the CI,
architecture,
replica,
cache,
GC, and
NFS gates.
The current Kubernetes full-profile report is
local-k8s-final-04655f3b-1000-20260825: Kubernetes revisionb3bc2ac58fa173967f27ade80f28cc5015b8c1c3, isolated external RustFS,status=ok,profile=full,replay_count=1000, 22/22 harness checks passed,1,001 pushes, matching refs and clone tips, full/incremental fsck success, and
1,000 sampled byte-identical objects. Its fingerprint is
7d97627cf1f4de8b87679dea53d99916df42c3152dc765399d4494c43af09624.That report predates the final handoff fixes and remains historical performance
evidence; the released-shape workflow above is the current correctness proof.
Local validation
cargo test -p crab-metadata --locked --features storage,remote-index: 240passed, 1 ignored, 0 failed.
cargo fmt --all -- --checkandgit diff --check: passed.Remaining production-readiness gates
These are explicit evidence gaps, not hidden claims:
comparison across multiple runs.
shallow differential proof.
cache fanout; the Kubernetes response pack is roughly 1.2 GB.
push/fetch, throttling, cache-server fanout, and owner-failover evidence.
and rollout evidence.
repair_requiredstate must be explained and clearedbefore production readiness; bucket-registry discovery is incomplete and
destructive bucket GC remains disabled.
needed to remove the remaining O(N) visibility dictionary load per
upload-pack process.
The detailed phased execution, acceptance criteria, evidence table, and STOP
conditions are maintained in
plans/001-large-repository-scale-roadmap.md.The PR remains draft until these operational gates are either proven or
explicitly accepted as follow-up release criteria.