Skip to content

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

Open
hmodymac8-droid wants to merge 3 commits into
xcl-dev:mainfrom
hmodymac8-droid:scripts/pr-check-runtime-paths
Open

hmodymac8-droid wants to merge 3 commits into
xcl-dev:mainfrom
hmodymac8-droid:scripts/pr-check-runtime-paths

Conversation

@hmodymac8-droid

@hmodymac8-droid hmodymac8-droid commented Nov 24, 2026 •

Copy link
Copy Markdown

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 CI: allow reviewed test-only diffs without retail smoke #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 GPU test results: NVIDIA RTX 3080 (wave32) and AMD RDNA2 iGPU (no mesh shaders) #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

@Kalmarv

Kalmarv commented Nov 24, 2026

Copy link
Copy Markdown
Contributor

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. PR checks: a section with nothing under it is refused as empty #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 added a commit to hmodymac8-droid/xcl that referenced this pull request Nov 24, 2026
…eady counts requests.rs as runtime)

Review by Kalmarv on xcl-dev#497.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@hmodymac8-droid

Copy link
Copy Markdown
Author

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 and others added 3 commits November 24, 2026 06:02
…s a regression run

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 <noreply@anthropic.com>
…eady counts requests.rs as runtime)

Review by Kalmarv on xcl-dev#497.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…cl-dev#507)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

off-goal Does not bear on the current goal (world loading); waits until it is reached

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants