Scripts: pr_check compares smoke runs only on the same GPU (#2232) #2235

Open
github-bot wants to merge 2 commits from github-bot/gh-2235 into main AGit
Owner

@⁠Creaa on GitHub · 2026-11-25 10:56 UTC · original
Creaa:scripts/pr-check-same-gpu → main · +116 −14 · 2 files · 2 commits · open

Stacked on #2230; only the top commit (5d1b0a0) belongs here.

pr_check.py matched the PR's xcl-smoke block with a main block on title and seconds only. The gpu: line was neither required nor compared, so a PR run on one GPU could be held against main on another, and the 80 % frames and 125 % peak-commit limits then compare two machines. Fixes the GPU part of #2232; recording the driver and debug/release in the block needs smoke.ps1 to write them and is left for a follow-up.

What is in it

  • scripts/pr_check.py: gpu joins SMOKE_FIELDS (a block without it is incomplete, as without title); the baseline is a main block with the PR's title, time and GPU (compared without case and extra whitespace, as #2232 suggests); when main blocks of that title and time exist only on other GPUs, the check says "the main and PR regression runs are not on the same GPU (… against …): run both on one machine". smoke.ps1 already writes gpu:, so blocks it made are unaffected.
  • scripts/test_pr_check.py: test_runs_on_different_gpus_are_not_compared (main only on another GPU is refused even when the PR's numbers would pass against it; with main blocks on both GPUs the one on the PR's GPU is used; the same name in other case or spacing matches; a block without gpu: is incomplete); the existing fixtures get a gpu: line and test_blocks_with_only_commit_lines_fail checks for it too.

Tested

  • Windows 11 build 26300, Python 3.14.2.
  • python -m unittest discover -s scripts -p "test_pr_check.py": 16 tests, OK. With pr_check.py from #2230's head the GPU test and the extended field test fail; without the case/whitespace step only the GPU test fails.

Regression run

  • None: only scripts/ changes, not the runtime.

Not tested

  • #2232's other points, left for follow-ups: driver:, cpu:, windows: and build: lines in the block (needs smoke.ps1), comparing driver and build, and an explicit way to mark an intended GPU mismatch. PR_SMOKE_FIELDS from #2219 is not on main yet; whichever lands second adds gpu to it.
  • Open PRs whose blocks were written by hand without a gpu: line would now be asked for it; blocks from smoke.ps1 have it.

AI use

  • Claude Code (Claude Opus 5.5) wrote the change and the tests, ran them, and drafted this description; I checked it.

🤖 Generated with Claude Code

**@⁠Creaa** on GitHub · 2026-11-25 10:56 UTC · [original](https://github.com/xcl-dev/xcl/pull/2235) `Creaa:scripts/pr-check-same-gpu` → `main` · +116 −14 · 2 files · 2 commits · open Stacked on #2230; only the top commit (`5d1b0a0`) belongs here. `pr_check.py` matched the PR's `xcl-smoke` block with a main block on `title` and `seconds` only. The `gpu:` line was neither required nor compared, so a PR run on one GPU could be held against main on another, and the 80 % frames and 125 % peak-commit limits then compare two machines. Fixes the GPU part of #2232; recording the driver and debug/release in the block needs `smoke.ps1` to write them and is left for a follow-up. **What is in it** - `scripts/pr_check.py`: `gpu` joins `SMOKE_FIELDS` (a block without it is incomplete, as without `title`); the baseline is a main block with the PR's title, time **and** GPU (compared without case and extra whitespace, as #2232 suggests); when main blocks of that title and time exist only on other GPUs, the check says "the main and PR regression runs are not on the same GPU (… against …): run both on one machine". `smoke.ps1` already writes `gpu:`, so blocks it made are unaffected. - `scripts/test_pr_check.py`: `test_runs_on_different_gpus_are_not_compared` (main only on another GPU is refused even when the PR's numbers would pass against it; with main blocks on both GPUs the one on the PR's GPU is used; the same name in other case or spacing matches; a block without `gpu:` is incomplete); the existing fixtures get a `gpu:` line and `test_blocks_with_only_commit_lines_fail` checks for it too. **Tested** - Windows 11 build 26300, Python 3.14.2. - `python -m unittest discover -s scripts -p "test_pr_check.py"`: 16 tests, OK. With `pr_check.py` from #2230's head the GPU test and the extended field test fail; without the case/whitespace step only the GPU test fails. **Regression run** - None: only `scripts/` changes, not the runtime. **Not tested** - #2232's other points, left for follow-ups: `driver:`, `cpu:`, `windows:` and `build:` lines in the block (needs `smoke.ps1`), comparing driver and build, and an explicit way to mark an intended GPU mismatch. `PR_SMOKE_FIELDS` from #2219 is not on main yet; whichever lands second adds `gpu` to it. - Open PRs whose blocks were written by hand without a `gpu:` line would now be asked for it; blocks from `smoke.ps1` have it. **AI use** - Claude Code (Claude Opus 5.5) wrote the change and the tests, ran them, and drafted this description; I checked it. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
The PR's own smoke block already had to be free of "(uncommitted changes)",
but a main block with local changes counted as main. When several main blocks
had the PR's title and time, the first pasted one was the baseline, so an
older, more favourable run could be put first.

- A main block whose commit line says "(uncommitted changes)" is not a
  baseline; when it is the only one, the check says to rerun on a clean main.
- With the commit distance known (`main_behind`: git rev-list locally,
  compare/...main ahead_by on GitHub), the baseline is the matching block of
  the newest main commit; without it, the first block as before.
- How many commits behind main each main block is gets printed, not judged:
  the cut-off for an old baseline is the maintainer's call.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The PR's smoke block was matched with a main block on title and time only;
the gpu line was neither required nor compared, so a PR run on one GPU could
be held against main on another and the 80 % frames and 125 % commit limits
said nothing. smoke.ps1 already writes the gpu line, so blocks it made pass
as before.

- `gpu` joins the lines a block must have.
- The baseline is a main block with the PR's title, time and GPU (case and
  runs of whitespace do not count); when main blocks of that title and time
  exist only on other GPUs the check says so.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 05:24:04 +00:00
Author
Owner

@⁠raylitebull on GitHub · 2026-11-25 11:03 UTC · original

Code review on 7a5b2a2 (scripts/pr_check.py, scripts/test_pr_check.py):

  • Adding "gpu" to SMOKE_FIELDS and normalizing gpu_name (casefold() + collapsed whitespace) in same_run cleanly ensures pr_check.py never compares frames shown or peak commit across mismatched GPUs, while preserving #2230's main_baseline distance ordering.
  • Diff audited and CI workflow approved (45600104173). (Note: if #2230 merges first, this PR will need a quick rebase to drop the shared #2230 hunks.)
**@⁠raylitebull** on GitHub · 2026-11-25 11:03 UTC · [original](https://github.com/xcl-dev/xcl/pull/2235#issuecomment-7160524054) Code review on `7a5b2a2` (`scripts/pr_check.py`, `scripts/test_pr_check.py`): - Adding `"gpu"` to `SMOKE_FIELDS` and normalizing `gpu_name` (`casefold()` + collapsed whitespace) in `same_run` cleanly ensures `pr_check.py` never compares `frames shown` or `peak commit` across mismatched GPUs, while preserving `#2230`'s `main_baseline` distance ordering. - Diff audited and CI workflow approved (`45600104173`). (Note: if `#2230` merges first, this PR will need a quick rebase to drop the shared `#2230` hunks.)
Author
Owner

@⁠RavenCurseBurg on GitHub · 2026-11-25 14:05 UTC · original · edited 2026-11-25 14:11 UTC

Verified 5d1b0a0fa7a9b86cbeba9ccafe8ec2aa08023296 via python -B scripts/pr_check.py --local --body <body> --files <files> --head <sha> from a temporary Git repo with two main commits one commit apart. I varied the adapter name, frames and block order in synthetic input. All six CLI cases matched expectations.

  • A newer RTX 4060 Ti block and an older RTX 4060 block selected the older matching GPU in both paste orders. Mixed case, extra spaces and a tab in its name still matched.
  • When only the older matching GPU had 200 frames, the checker failed 110 against 200 and reported that the baseline was one commit behind. When both GPUs matched, the newer 200-frame baseline was selected.
  • A Ti-only baseline produced the GPU mismatch diagnostic. A baseline with an empty adapter produced the missing-gpu diagnostic.

python -B -m unittest discover -s scripts -p test_pr_check.py passed all 16 tests on Windows 11 26100.9711, i7-13700, RTX 4060, Python 3.14.3. No physical adapter comparisons, retail runs or Rust suite. OpenAI Codex (GPT-6) ran the fixtures and wrote this report.

**@⁠RavenCurseBurg** on GitHub · 2026-11-25 14:05 UTC · [original](https://github.com/xcl-dev/xcl/pull/2235#issuecomment-7164748718) · edited 2026-11-25 14:11 UTC Verified `5d1b0a0fa7a9b86cbeba9ccafe8ec2aa08023296` via `python -B scripts/pr_check.py --local --body <body> --files <files> --head <sha>` from a temporary Git repo with two main commits one commit apart. I varied the adapter name, frames and block order in synthetic input. All six CLI cases matched expectations. - A newer `RTX 4060 Ti` block and an older `RTX 4060` block selected the older matching GPU in both paste orders. Mixed case, extra spaces and a tab in its name still matched. - When only the older matching GPU had 200 frames, the checker failed 110 against 200 and reported that the baseline was one commit behind. When both GPUs matched, the newer 200-frame baseline was selected. - A Ti-only baseline produced the GPU mismatch diagnostic. A baseline with an empty adapter produced the missing-`gpu` diagnostic. `python -B -m unittest discover -s scripts -p test_pr_check.py` passed all 16 tests on Windows 11 26100.9711, i7-13700, RTX 4060, Python 3.14.3. No physical adapter comparisons, retail runs or Rust suite. OpenAI Codex (GPT-6) ran the fixtures and wrote this report.
Author
Owner

@⁠DavidM1911 on GitHub · 2026-11-25 16:41 UTC · original

Verification on RTX 3060 Ti (Windows 11), branch merged with current main:

  • cargo test -p xcl --lib: 2 real failures, deterministic (also fail --test-threads=1):
gpu::recomp::pso::shader_cache_tests::rerouted_disk_entries_follow_the_direct_translator
  assertion failed — left: 68, right: 1 (pso.rs:1360)
hle::d3d12x::device_x::tests::pc_resource_desc_strips_uav_on_unsupported_formats_and_msaa
  assertion failed: format 85 kept — left: 28, right: 85 (device_x.rs:1376)

Same pair of failures across this batch of PRs — looks like a shared feature area with two broken assertions. Needs fixes before merge.

— Devin

**@⁠DavidM1911** on GitHub · 2026-11-25 16:41 UTC · [original](https://github.com/xcl-dev/xcl/pull/2235#issuecomment-7168394740) Verification on RTX 3060 Ti (Windows 11), branch merged with current `main`: - `cargo test -p xcl --lib`: **2 real failures**, deterministic (also fail `--test-threads=1`): ``` gpu::recomp::pso::shader_cache_tests::rerouted_disk_entries_follow_the_direct_translator assertion failed — left: 68, right: 1 (pso.rs:1360) hle::d3d12x::device_x::tests::pc_resource_desc_strips_uav_on_unsupported_formats_and_msaa assertion failed: format 85 kept — left: 28, right: 85 (device_x.rs:1376) ``` Same pair of failures across this batch of PRs — looks like a shared feature area with two broken assertions. Needs fixes before merge. — Devin
Author
Owner

@⁠Creaa on GitHub · 2026-11-25 16:46 UTC · original

These two are the main breakage from #2242 (fixed by #2245, merged before this PR was rebased), not this PR: head 5d1b0a0 is on main 06c9f55 and has the fix (pso.rs reads .dxil[67]), and CI passed on it. A local main older than #2245 shows them for every PR in the batch.

AI use: Claude Code (Claude Opus 5.5) checked this and drafted the reply.

**@⁠Creaa** on GitHub · 2026-11-25 16:46 UTC · [original](https://github.com/xcl-dev/xcl/pull/2235#issuecomment-7168509799) These two are the `main` breakage from #2242 (fixed by #2245, merged before this PR was rebased), not this PR: head `5d1b0a0` is on `main` `06c9f55` and has the fix (`pso.rs` reads `.dxil[67]`), and CI passed on it. A local `main` older than #2245 shows them for every PR in the batch. AI use: Claude Code (Claude Opus 5.5) checked this and drafted the reply.
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/2235/head:github-bot/gh-2235'
git switch 'github-bot/gh-2235'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-2235'
git switch 'github-bot/gh-2235'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-2235'
git switch 'github-bot/gh-2235'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-2235'
git switch 'main'
git merge --squash 'github-bot/gh-2235'
git switch 'main'
git merge --ff-only 'github-bot/gh-2235'
git switch 'main'
git merge 'github-bot/gh-2235'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.