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

Open
hmodymac8-droid wants to merge 3 commits from upstream-pr/497 into main
hmodymac8-droid commented 2026-11-24 01:02:48 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by hmodymac8-droid on 2026-11-24T01:02:48Z.


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

<!-- greyfinch-sync:ivall/xcl:issue:5464069556 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/497). Originally posted by [hmodymac8-droid](https://github.com/hmodymac8-droid) on 2026-11-24T01:02:48Z. --- `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)
Kalmarv commented 2026-11-24 07:05:27 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Kalmarv on 2026-11-24T02:02:39Z.


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

<!-- greyfinch-sync:ivall/xcl:comment:7119698634 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/pull/497#issuecomment-7119698634). Originally posted by [Kalmarv](https://github.com/Kalmarv) on 2026-11-24T02:02:39Z. --- 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
hmodymac8-droid commented 2026-11-24 07:05:28 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by hmodymac8-droid on 2026-11-24T02:04:04Z.


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).

<!-- greyfinch-sync:ivall/xcl:comment:7119721711 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/pull/497#issuecomment-7119721711). Originally posted by [hmodymac8-droid](https://github.com/hmodymac8-droid) on 2026-11-24T02:04:04Z. --- 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).
DavidM1911 commented 2026-11-25 14:10:11 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-25T13:53:48Z.


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

<!-- greyfinch-sync:ivall/xcl:comment:7164447897 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/497#issuecomment-7164447897). Originally posted by [DavidM1911](https://github.com/DavidM1911) on 2026-11-25T13:53:48Z. --- Verification on RTX 3060 Ti (Windows 11): **merge conflict with current `main`** — needs a rebase before it can be tested.
github-actions[bot] commented 2026-11-29 20:41:40 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by github-actions[bot] on 2026-11-29T20:41:40Z.


Nothing has happened on this PR for 3 days, so it is marked stale and will be closed in 4 days. A push or a comment takes the mark off: rebase it onto main if it conflicts, and say in one line what it still fixes. If it only waits for a maintainer, a comment saying so is enough.

<!-- greyfinch-sync:ivall/xcl:comment:7262283624 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/497#issuecomment-7262283624). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-11-29T20:41:40Z. --- Nothing has happened on this PR for 3 days, so it is marked `stale` and will be closed in 4 days. A push or a comment takes the mark off: rebase it onto `main` if it conflicts, and say in one line what it still fixes. If it only waits for a maintainer, a comment saying so is enough.
Foniass commented 2026-12-01 03:36:33 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T03:36:33Z.


Triage (#1607) – head 507c573

No open or merged PR changes runtime() in scripts/pr_check.py; main still has the substring test ("/tests" not in path and not path.endswith("tests.rs")). The new version matches whole path components only. On main's current crates/xcl/src files it classifies every file the same as before, so it changes nothing today and closes the contests.rs / tests_*.rs gap. No problems found in the diff.
The branch has a follow-up commit (0b4628e3) that should be squashed, and it conflicts with main.
Recommendation: keep open.

AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.

<!-- greyfinch-sync:ivall/xcl:comment:7299883107 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/497#issuecomment-7299883107). Originally posted by [Foniass](https://github.com/Foniass) on 2026-12-01T03:36:33Z. --- **Triage (#1607)** – head 507c573 No open or merged PR changes `runtime()` in `scripts/pr_check.py`; main still has the substring test (`"/tests" not in path and not path.endswith("tests.rs")`). The new version matches whole path components only. On main's current `crates/xcl/src` files it classifies every file the same as before, so it changes nothing today and closes the `contests.rs` / `tests_*.rs` gap. No problems found in the diff. The branch has a follow-up commit (0b4628e3) that should be squashed, and it conflicts with main. Recommendation: keep open. AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/497:upstream-pr/497'
git switch 'upstream-pr/497'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'upstream-pr/497'
git switch 'upstream-pr/497'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/497'
git switch 'upstream-pr/497'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/497'
git switch 'main'
git merge --squash 'upstream-pr/497'
git switch 'main'
git merge --ff-only 'upstream-pr/497'
git switch 'main'
git merge 'upstream-pr/497'
git push origin 'main'
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
xcl-dev/xcl!492
No description provided.