Skip to content

PR checks: the main smoke baseline can be an old or dirty commit, not current main #2226

Backlog

Description

@itsonewi

pr_check.py accepts any xcl-smoke block whose commit: is an ancestor of main as the baseline (is_main_ancestor, lines 190-194; the main list at line 138). It does not require that commit to be current, that the run was clean, or that only one block matches. That leaves the baseline under the author's control in three ways:

  1. An old main commit. compare/{sha}...main returns ahead for any ancestor, so a block from a week-old main passes. If main's memory or frame rate has changed since then, the PR is compared with the old numbers, not the ones it will merge into.
  2. A dirty main run. base (line 134) does not filter "uncommitted" from the commit line, although clean does for the PR's block (line 133). smoke.ps1 writes commit: <sha> (uncommitted changes) when crates/, Cargo.toml or Cargo.lock are modified (lines 34 and 90), and is_main_ancestor only reads the first token. A run with local changes therefore counts as main.
  3. Several main blocks. m = next((b for b in main if ...), None) (line 151) takes the first block with the same title and time. A PR can paste a favorable main block first and the current one second; the check only looks at the first.

The 80% frames and 125% peak-commit checks are the only regression gate for runtime PRs. With the baseline under the author's control, a PR can pass them without being compared to current main.

Repro (by inspection)

  • Take an old main commit A and the current tip B. A block commit: A passes is_main_ancestor (compare/A...main is ahead).
  • A block commit: B (uncommitted changes) passes: b["commit"].split()[0] is B, and base never checks for "uncommitted".
  • With two main blocks for the same title/time, the first one is used; put the better one first.

I did not run the checker: this audit is read-only through the GitHub API at 568e7db.

Suggested fix

  • Require the main block's commit to be the current main tip at check time, or at least the PR's base commit. The pull_request_target event has the base SHA; pass it to the script and compare. Fetching repos/{repo}/commits/main is one API call.
  • Reject a main block whose commit line contains uncommitted, same as the PR's block.
  • If more than one main block matches the title and time, reject the ambiguity or use the newest, not the first.
  • Add tests to scripts/test_pr_check.py: an old ancestor, a dirty main block, and two matching main blocks.

Related

Scope

Read through the GitHub API at 568e7db; nothing was cloned, built or run.

Activity

  1. Creaa commented on Nov 25, 2026

    @Creaa
    Contributor

    Taking this one: part 2 as a fix with tests (a main block whose commit: line says (uncommitted changes) is not a baseline, the same rule the PR's block already has), and part 3 (when several main blocks match, the check uses the newest main commit among them, not the first pasted). For part 1 the PR will report how far behind current main the baseline is rather than pick a cut-off; the cut-off is the maintainer's call. scripts/ only.

    AI use: Claude Code (Claude Opus 5.5) drafted this.

  2. itsonewi commented on Nov 25, 2026

    @itsonewi
    Author

    Agreed on 2 and 3, and reporting the distance instead of choosing a cut-off is the right call.

    • On 3, paste order is not a signal: the blocks carry no timestamp, so "newest" has to come from the API (GET /repos/{repo}/commits/{sha} -> committer.date), not from the order in the description. If two blocks name commits with the same date (a squashed batch), reject as ambiguous instead of picking one.
    • On 1, one refinement worth doing in the same PR: print whether the commits the baseline is behind touch crates/xcl/src, Cargo.* or scripts/. A baseline 40 commits behind on README-only changes is a valid comparison, and "40 commits behind" alone would send authors to re-run for nothing. compare/{base}...main returns the file list.
    • Have the message name the SHA it used as the baseline, so a reader can see which block won without opening the script.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions