Repository navigation
Evaluate all segment pairs when selecting next best merge. - #284
Merged
Merged
Conversation
- Adds new AllPairsMerger which tracks all pairs merging specific state. - Does not yet include invalidation logic.
…in group sizes. - Updates per base merging to utilize all pair's segment ordering if present (since all pairs merging can invalidate the input segment ordering).
Some patches have their condition changed without changing the corresponding patch, thus the new patch has the same size. The delta contribution for these is then (Pnew - Pold) * (patch_size + k) where Pnew >= Pold. As a result we can estimate a best case contribution of 0 without having to calculate Pnew or Pold. Furthermore there are some cases where a condition change, but is effectively the same condition. Which means Pnew = Pold. In this case we can immediately calculate the delta as 0 in non best case analysis without evaluating sizes or probabilities. This updates ComputeCostDelta() to detect these cases and skip probability/size calcs when possible.
- Uses bytes as the normalization divisor. - All pairs merging is not kept separate from min group enforcement merging. This particular configuration demonstrated significant segmenter time and cost reductions in batch testing.
…non-dep graph modes. These are deprecated and will be removed in the future.
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.
Use all-pairs best-first selection for cost-based segment merging.
Replaces single-base greedy cost-reducing segment merging with global all-pairs best-first selection (
AllPairsMerger). Previously, evaluating and applying merges for one base segment until exhaustion could cause a high-probability segment to absorb a lower-probability segment for a marginal cost reduction, preventing a much stronger merge between that lower-probability segment and another partner.Key changes:
AllPairsMerger.CandidateMerge::ComputeCostDelta()(ActivationCondition::IsUnchangedByMerge()), along with per-segment aggregate probability and exclusive patch size caching onMerger.Benchmark Results (Google Fonts corpus):
57.94h->54.36h(-6.18% /-3.58htotal, median -2.62%, mean -7.05%)208.40M->206.16M(-1.07% /-2.24Mtotal, median -0.33%, mean -1.31%)252->241).