PR checks: a test-only change in a runtime file needs a regression run #447

Closed
opened 2026-11-24 00:31:09 +00:00 by TheHoracio · 3 comments
TheHoracio commented 2026-11-24 00:31:09 +00:00 (Migrated from github.com)
Contributor

Imported from ivall/xcl. Originally posted by TheHoracio on 2026-11-24T00:31:09Z.


scripts/pr_check.py treats every file under crates/xcl/src/ as runtime unless its path contains /tests or ends in tests.rs. A change that only touches #[cfg(test)] code in a runtime file therefore needs an xcl-smoke run on a retail title, even though the built xcl.exe does not change.

Example: the fix for #343 that @PHeitor1 posted in the issue. It is one #[cfg(test)] line in hle/d3d12x/vram.rs (pub(super) → pub(crate) on VRAM_TEST_LOCK) and a guard in gpu/recomp/tests.rs. It has been tested on NVIDIA and AMD RDNA3, but nobody has opened a PR because pr_check asks for a regression run. The lock cannot be reached from a tests.rs file without touching vram.rs or d3d12x/mod.rs.

Plan (a small PR to scripts/pr_check.py and .github/workflows/pr-check.yml, no runtime change):

  • A PR with the label test-only does not need the Regression run blocks. The workflow passes the PR's labels to the checker, and the workflow also runs on labeled and unlabeled.
  • Only people with triage rights can set labels, so a contributor cannot skip the check alone. The label is the maintainer's call after a look at the diff.
  • All the other checks stay the same (sections, AI use, game data, binaries).
  • Tests: local runs of pr_check.py --local with and without the label on a runtime-path PR.

I also considered detecting #[cfg(test)]-only hunks automatically. That needs a Rust-aware parse of both sides of each file inside a pull_request_target gate, and a mistake would let runtime changes through without a regression run. A label is simpler and keeps the decision with the maintainer.

Does this direction work for you, or would you rather apply test-only fixes like #343's yourself? If the label is fine, I'll open the PR.

AI use: Claude Code (Claude Opus 5.5) helped read the checker and draft this; I checked it before posting.

<!-- greyfinch-sync:ivall/xcl:issue:6571816260 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/issues/452). Originally posted by [TheHoracio](https://github.com/TheHoracio) on 2026-11-24T00:31:09Z. --- `scripts/pr_check.py` treats every file under `crates/xcl/src/` as runtime unless its path contains `/tests` or ends in `tests.rs`. A change that only touches `#[cfg(test)]` code in a runtime file therefore needs an `xcl-smoke` run on a retail title, even though the built `xcl.exe` does not change. Example: the fix for #343 that @PHeitor1 posted in the issue. It is one `#[cfg(test)]` line in `hle/d3d12x/vram.rs` (`pub(super)` → `pub(crate)` on `VRAM_TEST_LOCK`) and a guard in `gpu/recomp/tests.rs`. It has been tested on NVIDIA and AMD RDNA3, but nobody has opened a PR because `pr_check` asks for a regression run. The lock cannot be reached from a `tests.rs` file without touching `vram.rs` or `d3d12x/mod.rs`. **Plan (a small PR to `scripts/pr_check.py` and `.github/workflows/pr-check.yml`, no runtime change):** - A PR with the label `test-only` does not need the **Regression run** blocks. The workflow passes the PR's labels to the checker, and the workflow also runs on `labeled` and `unlabeled`. - Only people with triage rights can set labels, so a contributor cannot skip the check alone. The label is the maintainer's call after a look at the diff. - All the other checks stay the same (sections, AI use, game data, binaries). - Tests: local runs of `pr_check.py --local` with and without the label on a runtime-path PR. I also considered detecting `#[cfg(test)]`-only hunks automatically. That needs a Rust-aware parse of both sides of each file inside a `pull_request_target` gate, and a mistake would let runtime changes through without a regression run. A label is simpler and keeps the decision with the maintainer. Does this direction work for you, or would you rather apply test-only fixes like #343's yourself? If the label is fine, I'll open the PR. AI use: Claude Code (Claude Opus 5.5) helped read the checker and draft this; I checked it before posting.
PHeitor1 commented 2026-11-24 07:05:07 +00:00 (Migrated from github.com)
Author
Contributor

Imported from ivall/xcl. Originally posted by PHeitor1 on 2026-11-24T00:57:14Z.


A second case for the label, from #264: @Mayzkl found the same captured SKIPPED lines in title_textures.rs (7 skip paths) and kernelx.rs:1789. All are #[cfg(test)] code, and they were kept out of #264 only because runtime() would then ask for an xcl-smoke run. A maintainer-set test-only label would cover both this and #343's VRAM_TEST_LOCK change.

Edited: this comment first said #343's test failure was a race in runtime code (real::init()). That was wrong. I disproved the init() lock in https://github.com/ivall/xcl/issues/343#issuecomment-7118831203, and the causes found since (https://github.com/ivall/xcl/issues/343#issuecomment-7119667197) are in the tests.

Written with Claude Code (Claude Opus 5.5).

<!-- greyfinch-sync:ivall/xcl:comment:7118604999 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/issues/452#issuecomment-7118604999). Originally posted by [PHeitor1](https://github.com/PHeitor1) on 2026-11-24T00:57:14Z. --- A second case for the label, from #264: @Mayzkl found the same captured `SKIPPED` lines in `title_textures.rs` (7 skip paths) and `kernelx.rs:1789`. All are `#[cfg(test)]` code, and they were kept out of #264 only because `runtime()` would then ask for an `xcl-smoke` run. A maintainer-set `test-only` label would cover both this and #343's `VRAM_TEST_LOCK` change. **Edited:** this comment first said #343's test failure was a race in runtime code (`real::init()`). That was wrong. I disproved the `init()` lock in https://github.com/ivall/xcl/issues/343#issuecomment-7118831203, and the causes found since (https://github.com/ivall/xcl/issues/343#issuecomment-7119667197) are in the tests. _Written with Claude Code (Claude Opus 5.5)._
Diskuss commented 2026-11-24 10:04:47 +00:00 (Migrated from github.com)
Author
Contributor

Imported from ivall/xcl. Originally posted by Diskuss on 2026-11-24T09:34:48Z.


This looks resolved by #507 (merged as b74867b, "CI: allow reviewed test-only diffs without retail smoke (#452)"). scripts/pr_check.py now takes --test-only, and CONTRIBUTING.md item 3 documents the test-only label. #507 didn't link this issue as closing, so it is still open. The automatic #[cfg(test)]-hunk detection was set aside in favour of the label, as discussed above.

AI use: checked with Claude Code (Claude Opus 5.5).

<!-- greyfinch-sync:ivall/xcl:comment:7127608035 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/issues/452#issuecomment-7127608035). Originally posted by [Diskuss](https://github.com/Diskuss) on 2026-11-24T09:34:48Z. --- This looks resolved by #507 (merged as b74867b, "CI: allow reviewed test-only diffs without retail smoke (#452)"). `scripts/pr_check.py` now takes `--test-only`, and CONTRIBUTING.md item 3 documents the `test-only` label. #507 didn't link this issue as closing, so it is still open. The automatic `#[cfg(test)]`-hunk detection was set aside in favour of the label, as discussed above. AI use: checked with Claude Code (Claude Opus 5.5).
ivall commented 2026-11-24 11:06:02 +00:00 (Migrated from github.com)
Author
Contributor

Imported from ivall/xcl. Originally posted by ivall on 2026-11-24T11:03:04Z.


Resolved by #507: reviewed test-only changes can use the test-only label.

<!-- greyfinch-sync:ivall/xcl:comment:7129589230 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/issues/452#issuecomment-7129589230). Originally posted by [ivall](https://github.com/ivall) on 2026-11-24T11:03:04Z. --- Resolved by #507: reviewed test-only changes can use the test-only label.
Sign in to join this conversation.
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#447
No description provided.