Skip to content

PR checks: a smoke block can omit the crash, device-removal, exit and peak-commit lines and still pass #2213

Backlog

Description

@itsonewi

scripts/pr_check.py only requires three lines in an xcl-smoke block: title, seconds and frames shown (SMOKE_FIELDS, line 38). The four lines that carry the safety part of the regression run - device removals, crashes, exit and peak commit - are read with dict.get() and a missing value is treated as clean:

  • device removals / crashes - (number(pr.get(key)) or 0) > 0 (lines 145-147). A missing line gives None or 0 = 0, and a non-numeric value (none, n/a, ?) also gives None or 0 = 0. Only a number greater than zero is a problem.
  • exit - pr.get("exit", "").startswith("killed") (line 148). A missing line gives "", and any other value passes: 0xc0000005, error, even killed later (only the prefix counts).
  • peak commit - pc, mc = number(...), number(...) (line 160). If either side is missing or n/a, the 125% check is skipped entirely (line 161).

CONTRIBUTING.md, item 3, requires the PR's run to "show no device removal and no crash ... and at most 125 % of its peak commit" (lines 24-26). The gate cannot enforce any of that when the line is absent.

This is the same class of bug as #1133 (merged), which added title, seconds and frames shown after blocks with only a commit line passed. It stopped at those three; the counters and the exit code were left as "checked where they are used", but where they are used they are optional.

Why it matters

scripts/smoke.ps1 always prints all of these lines (lines 94-99), so a block that lacks one was edited by hand, truncated by a copy/paste, or produced by a modified script. Deleting one line turns a failing run into a passing one:

  • crashes: 1 -> delete the line -> pass
  • device removals: 1 -> delete the line -> pass
  • exit: killed (no exit) -> delete the line -> pass
  • peak commit: 9000 MB on main's 3000 MB -> delete the line (or leave smoke.ps1's own peak commit: n/a MB) -> pass
  • exit: 0xc0000005 -> already passes, even with every line present

The last one matters on its own: a title can log frames, then die with 0xc0000005; smoke.ps1 reports exit: 0xc0000005, crashes: 0 (its regex did not match a log line), and pr_check.py accepts it. A non-zero exit that is not killed is never treated as a crash.

Repro (by inspection, not run here)

With a runtime file in files.tsv and a complete main block, this PR block passes with zero problems:

xcl-smoke v1
commit: <head sha>
title: <same title as main>
seconds: 60
frames shown: 900 (PresentX 900)

field_problems() sees all three required lines; device removals, crashes and exit are missing, so lines 145-148 see 0/0/""; peak commit is missing on the PR side, so lines 160-162 skip the memory check. The expected result is three or four problems, one per missing line.

I did not run it: this audit was done through the GitHub API at 568e7db without cloning the repository. The code path is small enough to follow directly.

Suggested fix

  • Add device removals, crashes, exit and peak commit to the PR block's required lines (a separate tuple, since peak commit is <n> MB and exit is not a count).
  • Parse the counters strictly: a value that is not a decimal number is a problem, not zero. Same for peak commit (n/a means the run never logged memory - that should be reported, not skipped).
  • Require exit: 0x0 for the PR's block; keep killed (no exit) as its own message, and treat any other non-zero exit as a failure or at least print it in the check output.
  • Add fixtures to scripts/test_pr_check.py: a block with each line removed, a block with crashes: none, and a block with exit: 0xc0000005.

Related

Scope

Found by reading the repository through the GitHub API at 568e7db; nothing was cloned, built or run.

Activity

  1. fromthemoonx commented on Nov 25, 2026

    @fromthemoonx

    I'll take this. Plan, scripts/pr_check.py only:

    • The PR's block must have device removals, crashes, exit and peak commit lines.
    • device removals, crashes and peak commit must be numbers there. none or n/a is a problem, not 0 or a skipped check.
    • Any exit other than 0x0 is a problem: killed (no exit) keeps its own message, and 0xc0000005 gets "ended with exit 0xc0000005".
    • Main's block stays as it is, since its run may crash (PR checks: a PR that fixes a crash is refused when main's run crashed before its end #1506). When main's peak commit is not a number, the memory comparison is still skipped.

    Tests in scripts/test_pr_check.py: one for each missing line, crashes: none, peak commit: n/a MB and exit: 0xc0000005. Each fails on 568e7db. I'll also update the existing fixtures that leave these lines out. #1229, #1750 and #2039 have fixtures without them, so whichever merges second needs a small fixture update.

    AI use: Claude Code (Claude Opus 5.5) is writing the change and the tests.

  2. itsonewi commented on Nov 25, 2026

    @itsonewi
    Author

    Plan is right. Three details:

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