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

Closed
opened 2026-11-26 04:22:16 +00:00 by github-bot · 3 comments
Owner

@⁠TheHoracio on GitHub · 2026-11-24 00:31 UTC · original

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.

**@⁠TheHoracio** on GitHub · 2026-11-24 00:31 UTC · [original](https://github.com/xcl-dev/xcl/issues/452) `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.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:22:16 +00:00
Author
Owner

@⁠Diskuss on GitHub · 2026-11-24 09:34 UTC · original

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

**@⁠Diskuss** on GitHub · 2026-11-24 09:34 UTC · [original](https://github.com/xcl-dev/xcl/issues/452#issuecomment-7127608035) 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).
Author
Owner

@⁠ivall on GitHub · 2026-11-24 11:03 UTC · original

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

**@⁠ivall** on GitHub · 2026-11-24 11:03 UTC · [original](https://github.com/xcl-dev/xcl/issues/452#issuecomment-7129589230) Resolved by #507: reviewed test-only changes can use the test-only label.
Author
Owner

@⁠PHeitor1 on GitHub · 2026-11-24 00:57 UTC · original · edited 2026-11-24 17:19 UTC

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

**@⁠PHeitor1** on GitHub · 2026-11-24 00:57 UTC · [original](https://github.com/xcl-dev/xcl/issues/452#issuecomment-7118604999) · edited 2026-11-24 17:19 UTC 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)._
This discussion has been locked. Commenting is limited to contributors.
No description provided.