Repository navigation
Reuse completed dependency hashes across repository hubs - #564
Merged
tinder-maxwellelliott merged 3 commits intoOct 25, 2026
Merged
tinder-maxwellelliott merged 3 commits into
tinder-maxwellelliott merged 3 commits into
Conversation
Every imported hub from one module extension depends on the same unimported repositories. A large extension can therefore format, sort and traverse the same thousands of labels for hundreds of rules. Share the ordered sibling list when no module dependency or self-edge changes it. Once every child has a completed rule digest, reuse the ordered label bytes and transitive hash state. Each hub still hashes its own definition, and the ordinary traversal handles incomplete children and sources. Raw query results and edge files retain their expanded labels. Codex for Tamir.
A queried //external rule can share a label with a synthetic repository. Deduplication keeps the queried rule, so streamed hashing must use the same winner. Extend the existing extension fixture with that overlap and compare the streamed hash with hashing the deduplicated target list. On macOS, the focused Bazel case failed under a controlled change that kept the first prepared definition for a duplicate label, and passed with the current implementation. The Bazel format check passed. Codex for Tamir.
tamird
force-pushed
the
codex/bazel-diff-share-extension-inputs
branch
from
October 25, 2026 01:06
ceefb5a to
94f2b4f
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.
When a Bzlmod extension exposes several imported repository hubs, each can have the same ordered list of unimported siblings. Hash generation currently allocates that list and walks its child hashes once per hub.
Share the list for hubs with identical inputs. Once every child has a completed rule digest, each hub can reuse the ordered labels and SHA-256 state while hashing its own definition. A missing digest, an unfinished cycle, or a source input uses the usual traversal. The new cycle test compares both hashes and expanded edges against that traversal. The extension flow test also checks that streamed definition hashing uses the queried rule when target deduplication keeps it over a synthetic repository with the same label.
On the two-extension fixture from #562, six alternating runs per binary on macOS with eight Rayon threads reduced median elapsed time from 1.332 s to 0.982 s and median peak RSS from 834 MB to 658 MB. Every run wrote byte-identical hash and dependency-edge files. A separate 192,000-target ordinary graph took 0.730 s before and 0.722 s after across eight runs per binary.
To reproduce the two-extension result, build
bazel build --config=release //:bazel-diffat v66.0.0 and measured commit 2fb0c34. Pass those two executables to the existing benchmark script. Reproduction scriptCodex for Tamir.