PR checks: a runtime file whose name only contains "tests" still needs a regression run #497

Open
github-bot wants to merge 3 commits from github-bot/gh-497 into main AGit
Owner

@⁠hmodymac8-droid on GitHub · 2026-11-24 01:02 UTC · original
hmodymac8-droid:scripts/pr-check-runtime-paths → main · +31 −2 · 2 files · 3 commits · open

scripts/pr_check.py decides which files are runtime code (and so need a Regression run) with runtime(). It treats any path under crates/xcl/src/ that contains /tests or ends in tests.rs as a test file. Those are substring checks, so a runtime module whose name only contains "tests", e.g. hle/contests.rs, hle/testsupport/mod.rs or gpu/tests_layout.rs, would be waved through without a regression run, accidentally or on purpose. Now only whole names count: a tests.rs or *_tests.rs module, or a file under a tests/ directory.

Nothing changes for today's tree: I classified all 181 tracked files with the old and the new runtime(), and none differs. The three test files there (gpu/recomp/tests.rs, gpu/adapter_tests.rs, gpu/agility_tests.rs) stay test files. This is separate from #452, which is about a label for test-only changes to runtime files; the two don't overlap.

What is in it

  • scripts/pr_check.py: runtime() matches whole file and directory names
  • scripts/test_pr_check.py (from #507): a RuntimePathTests class with test files, runtime files including the names above, paths outside the crate, and check() asking for a regression run for hle/contests.rs but not for gpu/recomp/tests.rs

Tested

  • Windows 11 Pro 26200, Python 3.13, AMD Radeon RX 7700 XT (driver 32.0.32029.2010), Rust 1.100.0
  • python test_pr_check.py (in scripts/): OK. Against main's pr_check.py: 4 failures (contests.rs, testsupport/mod.rs, and tests_layout.rs, plus check() asking for no regression run for contests.rs)
  • python scripts/pr_check.py --local on this description: description ok
  • cargo test --workspace -- --test-threads=4 at 2997c9a: 676 passed, 0 failed, 41 ignored, no SKIPPED (results in #42)

Regression run

  • not needed: no file under crates/xcl/src changes

Not tested

  • the GitHub Actions run of pr-check.yml itself (it runs this file from main, so it takes effect after merge);

AI use

  • Claude Code (Claude Opus 5.5) found the substring match, wrote the fix and the tests, and checked all tracked files.

🤖 Generated with Claude Code

**@⁠hmodymac8-droid** on GitHub · 2026-11-24 01:02 UTC · [original](https://github.com/xcl-dev/xcl/pull/497) `hmodymac8-droid:scripts/pr-check-runtime-paths` → `main` · +31 −2 · 2 files · 3 commits · open `scripts/pr_check.py` decides which files are runtime code (and so need a **Regression run**) with `runtime()`. It treats any path under `crates/xcl/src/` that contains `/tests` or ends in `tests.rs` as a test file. Those are substring checks, so a runtime module whose name only contains "tests", e.g. `hle/contests.rs`, `hle/testsupport/mod.rs` or `gpu/tests_layout.rs`, would be waved through without a regression run, accidentally or on purpose. Now only whole names count: a `tests.rs` or `*_tests.rs` module, or a file under a `tests/` directory. Nothing changes for today's tree: I classified all 181 tracked files with the old and the new `runtime()`, and none differs. The three test files there (`gpu/recomp/tests.rs`, `gpu/adapter_tests.rs`, `gpu/agility_tests.rs`) stay test files. This is separate from #452, which is about a label for test-only changes to runtime files; the two don't overlap. **What is in it** - `scripts/pr_check.py`: `runtime()` matches whole file and directory names - `scripts/test_pr_check.py` (from #507): a `RuntimePathTests` class with test files, runtime files including the names above, paths outside the crate, and `check()` asking for a regression run for `hle/contests.rs` but not for `gpu/recomp/tests.rs` **Tested** - Windows 11 Pro 26200, Python 3.13, AMD Radeon RX 7700 XT (driver 32.0.32029.2010), Rust 1.100.0 - `python test_pr_check.py` (in `scripts/`): OK. Against `main`'s `pr_check.py`: 4 failures (`contests.rs`, `testsupport/mod.rs`, and `tests_layout.rs`, plus `check()` asking for no regression run for `contests.rs`) - `python scripts/pr_check.py --local` on this description: `description ok` - `cargo test --workspace -- --test-threads=4` at `2997c9a`: 676 passed, 0 failed, 41 ignored, no `SKIPPED` (results in #42) **Regression run** - not needed: no file under `crates/xcl/src` changes **Not tested** - the GitHub Actions run of `pr-check.yml` itself (it runs this file from `main`, so it takes effect after merge); **AI use** - Claude Code (Claude Opus 5.5) found the substring match, wrote the fix and the tests, and checked all tracked files. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
runtime() treated any path under crates/xcl/src containing "/tests" or ending in
"tests.rs" as a test file, so a runtime module such as requests.rs, contests.rs or
hle/testsupport/mod.rs would have skipped the regression run. Only a tests.rs or
*_tests.rs module, or a file under a tests/ directory, counts as test code now.
No file in the tree is classified differently. Adds scripts/pr_check_tests.py.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Review by Kalmarv on #497.

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

@⁠Kalmarv on GitHub · 2026-11-24 02:02 UTC · original

I ran 9d4845b's check() and main's (508a0c7) on 33 PRs: 13 open ones and the 20 most recently merged, with their file lists. They give the same result on all 33. None of the 103 files under crates/xcl/src on main changes class. The three test-named files there (gpu/adapter_tests.rs, gpu/agility_tests.rs, gpu/recomp/tests.rs) are still not runtime. Your 5 tests pass, and 3 of their subtests fail against main's runtime() (contests.rs, testsupport/mod.rs, tests_layout.rs). It merges cleanly with #527, and both test files pass on the merge.

  1. requests.rs is not an example of this change. Main already counts it as runtime, because "requests.rs".endswith("tests.rs") is False. So the docstring's example doesn't show the fix, and the crates/xcl/src/net/requests.rs case in the tests (lines 24 and 35) passes on main too. contests.rs, which the tests already use, would be a better example in the docstring.
  2. Question: no workflow runs scripts/pr_check_tests.py, because pr-check.yml checks out only pr_check.py. #527 adds its tests as scripts/pr_check.tests.py, so if both merge there will be two test files with different names. Should they be one file?

🤖 Claude Opus 5.5

**@⁠Kalmarv** on GitHub · 2026-11-24 02:02 UTC · [original](https://github.com/xcl-dev/xcl/pull/497#issuecomment-7119698634) I ran 9d4845b's `check()` and main's (508a0c7) on 33 PRs: 13 open ones and the 20 most recently merged, with their file lists. They give the same result on all 33. None of the 103 files under `crates/xcl/src` on main changes class. The three test-named files there (`gpu/adapter_tests.rs`, `gpu/agility_tests.rs`, `gpu/recomp/tests.rs`) are still not runtime. Your 5 tests pass, and 3 of their subtests fail against main's `runtime()` (`contests.rs`, `testsupport/mod.rs`, `tests_layout.rs`). It merges cleanly with #527, and both test files pass on the merge. 1. `requests.rs` is not an example of this change. Main already counts it as runtime, because `"requests.rs".endswith("tests.rs")` is False. So the docstring's example doesn't show the fix, and the `crates/xcl/src/net/requests.rs` case in the tests (lines 24 and 35) passes on main too. `contests.rs`, which the tests already use, would be a better example in the docstring. 2. Question: no workflow runs `scripts/pr_check_tests.py`, because pr-check.yml checks out only `pr_check.py`. #527 adds its tests as `scripts/pr_check.tests.py`, so if both merge there will be two test files with different names. Should they be one file? 🤖 Claude Opus 5.5
Author
Owner

@⁠hmodymac8-droid on GitHub · 2026-11-24 02:04 UTC · original

Thanks @⁠Kalmarv, a thorough check, and you're right about requests.rs: it doesn't end in tests.rs, so main already counts it as runtime. Pushed af06a78: the docstring and the check() test now use hle/contests.rs, so that test fails on main too (against main's runtime(): contests.rs, testsupport/mod.rs, tests_layout.rs, and the check() case). requests.rs stays in the list as a runtime control. I fixed the description to match.

On the test files: yes, one file is better. #527's scripts/pr_check.tests.py name matches scripts/test-native-stderr.tests.ps1. Whichever of the two lands second should move its cases into that file. If #527 merges first, I'll rebase this one and put these tests there. AI-assisted (Claude Code).

**@⁠hmodymac8-droid** on GitHub · 2026-11-24 02:04 UTC · [original](https://github.com/xcl-dev/xcl/pull/497#issuecomment-7119721711) Thanks @⁠Kalmarv, a thorough check, and you're right about `requests.rs`: it doesn't end in `tests.rs`, so `main` already counts it as runtime. Pushed af06a78: the docstring and the `check()` test now use `hle/contests.rs`, so that test fails on `main` too (against `main`'s `runtime()`: `contests.rs`, `testsupport/mod.rs`, `tests_layout.rs`, and the `check()` case). `requests.rs` stays in the list as a runtime control. I fixed the description to match. On the test files: yes, one file is better. #527's `scripts/pr_check.tests.py` name matches `scripts/test-native-stderr.tests.ps1`. Whichever of the two lands second should move its cases into that file. If #527 merges first, I'll rebase this one and put these tests there. AI-assisted (Claude Code).
Author
Owner

@⁠DavidM1911 on GitHub · 2026-11-25 13:53 UTC · original

Verification on RTX 3060 Ti (Windows 11): merge conflict with current main — needs a rebase before it can be tested.

**@⁠DavidM1911** on GitHub · 2026-11-25 13:53 UTC · [original](https://github.com/xcl-dev/xcl/pull/497#issuecomment-7164447897) Verification on RTX 3060 Ti (Windows 11): **merge conflict with current `main`** — needs a rebase before it can be tested.
This pull request has changes conflicting with the target branch.
  • scripts/test_pr_check.py
View command line instructions

Manual merge helper

Use this merge commit message when completing the merge manually.

Checkout

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

Merge

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