Skip to content

Receipt: recorded against the branch's merge-base, not origin/<base> - #381

Merged
rmrsk merged 2 commits into
mainfrom
receipt-merge-base
Nov 27, 2026
Merged

rmrsk merged 2 commits into
mainfrom
receipt-merge-base

Conversation

@rmrsk

@rmrsk rmrsk commented Nov 26, 2026 •

Copy link
Copy Markdown
Owner

Summary

Background

A receipt must measure a pull request against the commit its branch starts from (its merge-base with main); CI
rejects a receipt for any other base. The receipt skill, CLAUDE.md and PerformanceTesting.rst all gave the
command as Scripts/run-performance.sh compare origin/<base> --record. That is right only while main has not
moved since the branch was made. Once another pull request has merged, origin/main holds code the branch does not,
and the comparison reports that pull request's changes, reversed, as this one's. This happened when the receipt of
#380 was recorded again after #361 merged: a red report, with #361's kernels listed as gone.

The skill also told the reader to rebase the branch onto origin/<base> before recording, which contradicts
CLAUDE.md ("Merging": a branch is rebased only for a conflict, and a receipt stands on the PR's own base).

Solution

  • .claude/skills/receipt/SKILL.md: the two receipt commands compare against $(git merge-base HEAD origin/<base>),
    with the reason; the instruction to rebase first is replaced by a pointer to the rule.
  • CLAUDE.md: the receipt command in "Vetting every pull request for performance" names the merge-base, with the
    reason.
  • Docs/Sphinx/source/PerformanceTesting.rst: the same command, and a short paragraph on why the base is the
    merge-base.

Side-effects

None in code. The quick-look commands (compare origin/<base> '<glob>' --rounds 1) are unchanged: they record
nothing, and a developer may want to compare with the current main.

Alternative solutions

  • run-performance.sh --record could take the merge-base itself when given origin/<base>. That changes
    Performance/ and the receipt fingerprint, so every open PR would need its receipt recorded again; not done here.
  • CheckReceipt.cmake's hint ("Record it again: ...") already uses the base CI passes it, so it is left as is.

Performance

Documentation only: no library or probe change, so the receipt inherited from main stands.

Where to look

  • .claude/skills/receipt/SKILL.md, step 1 and its commands.
  • Verified: pre-commit (format, REUSE, codespell, check-docs) on all files.
  • Verified: the Sphinx HTML build (9.1.1) with warnings as errors.

Reviewer checklist (to be completed by a human)

  • The test suite compiles and runs to completion without warnings or errors.
  • All relevant new features are documented in the user documentation (Sphinx).
  • This contribution does not break existing sections in the user documentation.
  • All relevant APIs are documented in the doxygen documentation.
  • Appropriate labels have been assigned to this PR.
  • New or revised proper licensing and copyright information is in place.
  • A PR review has been run using @claude review.
  • The continuous integration and testing hooks at GitHub run to completion.
  • The performance receipt is current (CI's Performance-receipt passes), and every regression in it is explained.

🤖 Generated with Claude Code

https://claude.ai/code/session_012mR37bzMSJWYPpFgLhy9sk

Once another pull request has merged, origin/<base> holds code the branch
does not; a comparison against it reports that PR's changes as this one's.
The receipt skill also no longer asks for a rebase before recording.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012mR37bzMSJWYPpFgLhy9sk
@rmrsk rmrsk added documentation Improvements or additions to documentation performance Addresses performance issues or the performance test suite CI & testing Affects continuous integration and testing labels Nov 26, 2026
@rmrsk

rmrsk commented Nov 26, 2026

Copy link
Copy Markdown
Owner Author

@claude review

@github-actions

github-actions Bot commented Nov 26, 2026 •

Copy link
Copy Markdown

Claude finished @rmrsk's task in 17s —— View job


Review of #381: record the receipt against the merge-base

No blocking findings. The change is documentation only, and the reasoning matches the "Merging" rule in CLAUDE.md: a receipt stands on the PR's own base, and a branch is rebased only for a conflict. I read the diff and grepped for other uses of the command. I did not run run-performance.sh.

Correct

  • The $(git merge-base HEAD origin/<base>) form is right for both receipt commands in .claude/skills/receipt/SKILL.md. The second command, with <pr-branch>, still compares the base with the branch head.
  • Removing "rebase first" from the skill fixes a contradiction with CLAUDE.md.
  • Leaving the quick-look commands on origin/<base> is fine, since they record nothing.

Minor, non-blocking

  1. CLAUDE.md (the receipt bullet, ~line 403): the inserted parenthetical comes before "which also deletes the receipts of earlier PRs". The "which" now reads as if it refers to the merge-base commit instead of the command. It also makes the line much longer than the 120-column wrapping used elsewhere. Suggested wording:
    `Scripts/run-performance.sh compare $(git merge-base HEAD origin/<base>) --record` on the committed branch (against the commit the branch starts from: once another PR has merged, `origin/<base>` holds code the branch does not). It also deletes the receipts of earlier PRs there, and adds a device section when the PR touches code a device runs.

  2. PerformanceTesting.rst (~line 429): the command line is longer than the others in that block. That is cosmetic. Setting base=$(git merge-base HEAD origin/<base>) on a separate line, as the skill does, would be tidier.

  3. Other origin/<base> uses that a reader could follow into the same trap:

    • CLAUDE.md:383 says to run compare origin/<base> before committing, in the "Performance cases" section.
    • PerformanceTesting.rst:260-267 has the general compare examples, including --smoke, --gpu and --no-cache.

    These are not receipt recordings, so they are arguably fine. A one-line note saying that the receipt itself uses the merge-base would stop them being copied into a --record run.

  4. The PR body's "Where to look": it mentions only the skill's step 1. The CLAUDE.md and .rst edits are in the Solution list, so this is fine.

Docs-audit view: no renamed identifiers, no Doxygen links, and no literalinclude added. The American English and no-history rules hold. The sentence "reports that pull request's changes, reversed" in the .rst states current behavior, which is what the rules ask for.
· branch receipt-merge-base

…te under the comparison examples)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012mR37bzMSJWYPpFgLhy9sk
@rmrsk

rmrsk commented Nov 27, 2026

Copy link
Copy Markdown
Owner Author

@claude review

@github-actions

github-actions Bot commented Nov 27, 2026 •

Copy link
Copy Markdown

Claude finished @rmrsk's task in 13s —— View job


Review of #381: record the receipt against the merge-base

No blocking findings. The change is documentation only. I read the final diff (git diff origin/main...HEAD); I did not run run-performance.sh.

The previous round's wording points are addressed:

  • The CLAUDE.md receipt bullet now reads correctly: "It also deletes the receipts of earlier PRs there" no longer hangs off the merge-base commit.
  • The .rst and skill commands set base=$(git merge-base HEAD origin/<base>) on its own line.
  • The .rst has a note under the general compare examples saying a receipt uses the merge-base instead, which covers the earlier concern about those examples being copied into a --record run.

Correct

  • $(git merge-base HEAD origin/<base>) is right for both receipt commands. The second form, compare $base <pr-branch> --gpu ..., still compares the base with the branch head.
  • The skill no longer says "rebase first", which matches CLAUDE.md "Merging": a branch is rebased only for a conflict.
  • The quick-look commands are left on origin/<base>, which is fine because they record nothing.

Minor, non-blocking

  1. CLAUDE.md (receipt bullet): the second line break leaves "It is committed to the PR" followed by a short wrapped line, branch; pushing it needs.... The paragraph could be rewrapped to the 120-column style used elsewhere. This is cosmetic.
  2. CLAUDE.md (~line 383, the "Performance cases" section) still says to run Scripts/run-performance.sh compare origin/<base> before committing. That is a quick look, so it is fine. Writing "(not the receipt, which uses the merge-base)" would remove any doubt.
  3. PerformanceTesting.rst: the added note uses the `The performance receipt`_ section reference. Your Sphinx 9.1.1 build with warnings as errors passed, so I assume the target resolves.

Docs-audit view: no renamed identifiers, no Doxygen links, no literalinclude, American English throughout, and the new sentences describe current behavior rather than history. The PR is ready as far as this review goes.
· branch receipt-merge-base

@rmrsk
rmrsk marked this pull request as ready for review November 27, 2026 07:01
@rmrsk rmrsk self-assigned this Nov 27, 2026
@rmrsk rmrsk mentioned this pull request Nov 27, 2026
34 of 51 tasks
@rmrsk
rmrsk merged commit dc4de15 into main Nov 27, 2026
46 of 59 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CI & testing Affects continuous integration and testing documentation Improvements or additions to documentation performance Addresses performance issues or the performance test suite

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant