Repository navigation
Price an upstream sync against the recorded base, not a merge-base - #400
Merged
Merged
Conversation
The sync merges with the recorded commit as base (CONTRIBUTING, "Syncing to a new upstream release"), but the canary priced it against merge-base(recorded, theirs). That only equals the recorded commit while theirs descends from it. The next release does not: v0.7.3 and v0.6.18 sit on separate release branches (merge-base 61a6c65), and upstream/main has the same shape. The 47 v0.6.18 release-branch commits were then counted as ours. Measured on 8764a46: --upstream-ref old base new base v0.7.3 61a6c, ~130 69ff11f, 30 conflicts (22 code) upstream/main 61a6c, ~130 69ff11f, 30 conflicts (22 code) v0.5.3 merge-base, 8 itself, nothing to merge (NOTE printed) v0.6.18 itself, clean itself, clean The new 30 are exactly the files the v0.7.3 sync has to resolve, including the pytest.ini and version.txt modify/delete pair. The old ~130 were mostly add/add conflicts on NVIDIA files the fork never touched. The rule lives in a new upstream_base.sync_base(), used by the canary only. select() and amd_coverage are unchanged, so --upstream-ref keeps its meaning there. The record wins wherever it applies: - theirs it contains is its own base; - theirs descending from it, or on a diverged line, is priced against it. That holds even when a `merge -s ours` has made theirs reachable. Such a merge adds no content, so treating it as absorbed would report a missing sync as clean. The one exception is a diverged theirs that ours already reaches, such as v0.5.3, which ours reaches through a merge. That is its own base, and the canary says so in a NOTE rather than silently, without claiming the content landed. Other changes: - The multiple-merge-base note now fires only on the ancestry fallback. - The position line reads "base", since the recorded commit need not be a merge-base. Co-Authored-By: Claude <noreply@anthropic.com>
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues are reported for the update to use the recorded sync base in the upstream canary.
No open issues 🎉
What changed in this PR
Updates the upstream sync canary to estimate conflicts against the recorded sync base rather than a merge-base, matching the documented sync procedure for diverged release branches.
Changes:
- Adds
sync_base()while preservingselect()semantics for coverage tooling. - Updates canary base selection, output labels, and reachability notices.
- Adds regression tests and clarifies the sync documentation.
| File | Description |
|---|---|
tests/rocm/test_upstream_canary.py |
Verifies that diverged upstream releases use the recorded base. |
tests/rocm/test_upstream_base.py |
Tests sync-base selection across release and ancestry scenarios. |
scripts/upstream_canary.py |
Uses sync_base() and adjusts base reporting and notices. |
scripts/upstream_base.py |
Adds sync-specific base selection without changing coverage selection. |
CONTRIBUTING.md |
Explains recorded-base merging and the commit-count caveat. |
Review effort: Balanced
Security scan found no critical or high findings on lines changed by this pull requestView the security scan run for complete reports. “New” means the finding is located in a changed file on an added or modified line; it is not a base-versus-head findings delta. |
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.
Summary
scripts/upstream_canary.pypriced an upstream sync againstmerge-base(recorded, theirs), but the sync itself merges against the recorded commit. The two differ whenever the target is on a diverged line, which is exactly the next sync: v0.7.3 and v0.6.18 sit on separate release branches. Against v0.7.3 the canary reported ~130 conflicts, mostlyadd/addon NVIDIA files the fork never touched; priced against the recorded base it reports the 30 the sync actually has to resolve.What changed
scripts/upstream_base.py— newsync_base(): the base a sync merges against.select()is unchanged, soamd_coverage --upstream-refkeeps its meaning.scripts/upstream_canary.py— usessync_base(); the position line readsbase(the recorded commit need not be a merge-base); the multiple-merge-base note fires only on the ancestry fallback.CONTRIBUTING.md— whygit mergeis wrong now names both failure modes, and theours-count caveat matches the new base.Architecture / design notes
theirsrelative to the recordtheirsmerge -s oursalready made it reachable, since that merge adds no contentupstream/main)merge-recursive $BASE -- HEAD theirsuses; a merge-base counts the recorded release's own commits as ourstheirs, with a NOTEMeasured on
8764a466b:--upstream-ref61a6c6518, ~130 conflicts69ff11fc4, 30 (22 code)61a6c6518, ~13069ff11fc4, 30 (22 code)The 30 are the files the v0.7.3 sync touches, including the
pytest.ini/version.txtmodify/delete pair.Benchmark results
Not applicable: repo tooling and docs only, no kernel or runtime path is reachable from this diff.
Test plan
pytest --noconftest tests/rocm/test_upstream_base.py tests/rocm/test_upstream_canary.py tests/rocm/test_amd_coverage.py tests/rocm/test_git_describe.py tests/rocm/test_repo_workflows.py— 230 passed, 9 skippedpre-commit run --from-ref origin/amd-integration --to-ref HEAD