Repository navigation
Borrow target names during deduplication - #582
Merged
tinder-maxwellelliott merged 1 commit intoOct 27, 2026
Merged
tinder-maxwellelliott merged 1 commit into
tinder-maxwellelliott merged 1 commit into
Conversation
Record the keep decisions while the seen set can borrow the input names, then retain those targets in place. Exercise a nonadjacent duplicate and a target with no name in the order check.
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.
deduplicate_targetsclones each target name into its seen set, even though the input already owns the name. Borrow the names to record one keep flag per input, then retain the selected targets in place. The test puts a nameless target and a distinct target before the later duplicate and checks the complete first payload and output order.On the 160,000-target public mixed fixture, the old set copies 160,000 nonempty strings totaling 3,060,000 UTF-8 bytes. The new pass stores 160,000 one-byte flags and visits the vector a second time. All 14 full generations produced identical hash and edge files. Median process wall was 2.338 s before and 2.245 s after. Median peak RSS was 286.3 MiB before and 294.4 MiB after. Both differences were within run-to-run variation. Fixture and full-output reproduction
I also timed just the helper on those decoded targets in a release build on macOS. In two fresh processes the medians were 13.46 → 11.23 ms and 22.78 → 17.43 ms. All six pairs in each process favored borrowing. The second process had substantially wider variation. The 192 Rust tests, 21 CLI tests, formatting and Clippy checks passed.
Codex for Tamir.
Reproduce the helper comparison
Generate
mixed.pbwith the public fixture above. On this branch, add the following temporary test to the existingtestsmodule insrc/bazel.rs. It discards the first pair, places each implementation first in three of the six measured pairs, and times only the helper. Input cloning and complete output comparison are outside the interval.