CI: the crates that run anywhere are tested on Linux too #165

Closed
github-bot wants to merge 3 commits from github-bot/gh-165 into main AGit
Owner

@⁠illuminatedfellow on GitHub · 2026-11-25 18:12 UTC · original
illuminatedfellow:ci/linux-portable-tests → main · +21 −0 · 4 files · 3 commits · closed without merging

What

One commit, three files, 20 lines added:

  • .github/workflows/ci.yml: a second job, portable, on ubuntu-latest. It runs the tests of victory-core, victory-formats, victory-pipeline, victory-game and victory-shader, then those of victory-gpu one at a time (--test-threads=1). The Windows job is unchanged.
  • crates/victory-gpu/src/resource.rs: view_format is #[cfg(windows)]. It reads the host resource, which only Windows builds have, and its one caller (descriptor.rs, host_desc) is already Windows-only.
  • crates/victory-gpu/src/list.rs: the test lists_are_cut_at_waits_that_follow_work is #[cfg(windows)]. It calls crate::host, submitted and host_list, which are Windows-only.

Nothing changes in a Windows build: both items are only used from Windows-only code.

Why

victory-gpu did not build off Windows: those two places were the only errors (cargo check --workspace --all-targets on Linux). With them gated, the crate builds and 35 of its tests run on Linux. That covers the frame pacing, timeline, queue, descriptor and list code that is not behind cfg(windows).

The Linux job is quicker than the Windows one. It also catches Windows-only code that slips into these crates' portable parts, as these two did.

Why one at a time for victory-gpu

Run together on Linux, queue::tests::present_runs_after_a_queues_wait failed in 2 of 3 runs. This is the race described in #116: the tests' threads pump each other's queues. #132 addresses it. One at a time it passed 15 of 15 local runs and on GitHub Actions. Once #132 is in, --test-threads=1 can go.

Not included

  • victory-pe and victory-loader: their tests parse the test binary itself as a PE file, so they fail on Linux by design.
  • victory-hle and the app: they do not build off Windows yet (several cfg(windows) modules are used ungated). #41 covers that, along with much more. This PR is a smaller step that does not conflict with it.
  • xtask: repository_passes_policy fails on main everywhere (lower.rs is over the size limit).
  • Clippy on Linux: victory-gpu has about 40 dead-code warnings there (code only Windows uses), so -D warnings would fail.

Tested

  • Linux Mint, Rust 1.98.1 from rust-toolchain.toml: the job's two commands pass. 264 tests: core 11, formats 24 (4 ignored), pipeline 4, game 2, shader 185 + 3, gpu 35.
  • GitHub Actions on my fork, ubuntu-latest: the portable job passed with the same counts.
  • Windows: the Windows job on this branch stops at Clippy, as on main (the 10 victory-shader lints #3 fixes, and behind them about 47 more in victory-gpu). None of them are in the lines changed here. On a fork-only branch where clippy does not stop the job, cargo test --workspace gave: victory-gpu 113 passed, 0 failed, 4 ignored (this includes lists_are_cut_at_waits_that_follow_work, gated here, and frame::tests::statistics_return_none_and_are_counted), core 11, formats 24, game 2, the app 1. It then stopped at the five xmem tests in victory-hle that fail on main too (#2, #8), so the crates after it did not run on Windows; this change does not touch them. The run is main plus #3's clippy fix, both of my PRs, and clippy set not to stop the job.
  • cargo clippy --target x86_64-pc-windows-msvc with and without --all-features: no new warnings in the changed files.

No game files were used. The game was not run: nothing here reaches it.

**@⁠illuminatedfellow** on GitHub · 2026-11-25 18:12 UTC · [original](https://github.com/Belobug/VIctory-Belobug-AMD/pull/165) `illuminatedfellow:ci/linux-portable-tests` → `main` · +21 −0 · 4 files · 3 commits · closed without merging ## What One commit, three files, 20 lines added: - `.github/workflows/ci.yml`: a second job, `portable`, on `ubuntu-latest`. It runs the tests of `victory-core`, `victory-formats`, `victory-pipeline`, `victory-game` and `victory-shader`, then those of `victory-gpu` one at a time (`--test-threads=1`). The Windows job is unchanged. - `crates/victory-gpu/src/resource.rs`: `view_format` is `#[cfg(windows)]`. It reads the host resource, which only Windows builds have, and its one caller (`descriptor.rs`, `host_desc`) is already Windows-only. - `crates/victory-gpu/src/list.rs`: the test `lists_are_cut_at_waits_that_follow_work` is `#[cfg(windows)]`. It calls `crate::host`, `submitted` and `host_list`, which are Windows-only. Nothing changes in a Windows build: both items are only used from Windows-only code. ## Why `victory-gpu` did not build off Windows: those two places were the only errors (`cargo check --workspace --all-targets` on Linux). With them gated, the crate builds and 35 of its tests run on Linux. That covers the frame pacing, timeline, queue, descriptor and list code that is not behind `cfg(windows)`. The Linux job is quicker than the Windows one. It also catches Windows-only code that slips into these crates' portable parts, as these two did. ## Why one at a time for victory-gpu Run together on Linux, `queue::tests::present_runs_after_a_queues_wait` failed in 2 of 3 runs. This is the race described in #116: the tests' threads pump each other's queues. #132 addresses it. One at a time it passed 15 of 15 local runs and on GitHub Actions. Once #132 is in, `--test-threads=1` can go. ## Not included - `victory-pe` and `victory-loader`: their tests parse the test binary itself as a PE file, so they fail on Linux by design. - `victory-hle` and the app: they do not build off Windows yet (several `cfg(windows)` modules are used ungated). #41 covers that, along with much more. This PR is a smaller step that does not conflict with it. - `xtask`: `repository_passes_policy` fails on `main` everywhere (`lower.rs` is over the size limit). - Clippy on Linux: `victory-gpu` has about 40 dead-code warnings there (code only Windows uses), so `-D warnings` would fail. ## Tested - Linux Mint, Rust 1.98.1 from `rust-toolchain.toml`: the job's two commands pass. 264 tests: core 11, formats 24 (4 ignored), pipeline 4, game 2, shader 185 + 3, gpu 35. - GitHub Actions on my fork, `ubuntu-latest`: the `portable` job passed with the same counts. - Windows: the Windows job on this branch stops at Clippy, as on `main` (the 10 `victory-shader` lints #3 fixes, and behind them about 47 more in `victory-gpu`). None of them are in the lines changed here. On a fork-only branch where clippy does not stop the job, `cargo test --workspace` gave: `victory-gpu` 113 passed, 0 failed, 4 ignored (this includes `lists_are_cut_at_waits_that_follow_work`, gated here, and `frame::tests::statistics_return_none_and_are_counted`), core 11, formats 24, game 2, the app 1. It then stopped at the five `xmem` tests in `victory-hle` that fail on `main` too (#2, #8), so the crates after it did not run on Windows; this change does not touch them. [The run](https://github.com/illuminatedfellow/VIctory-Belobug-AMD/actions/runs/45671735105) is `main` plus #3's clippy fix, both of my PRs, and clippy set not to stop the job. - `cargo clippy --target x86_64-pc-windows-msvc` with and without `--all-features`: no new warnings in the changed files. No game files were used. The game was not run: nothing here reaches it.
A second job on ubuntu-latest runs the tests of victory-core,
victory-formats, victory-pipeline, victory-game, victory-shader and
victory-gpu. It is quicker than the Windows job and keeps these crates
free of Windows-only paths that slip in unnoticed.

victory-gpu did not build off Windows: `resource::view_format` reads the
host resource, which only Windows builds have, and
`lists_are_cut_at_waits_that_follow_work` calls host functions. Both are
now Windows-only, like their callers; nothing changes on Windows.

victory-gpu's tests run one at a time there: run together,
`present_runs_after_a_queues_wait` failed in 2 of 3 runs on Linux, the
race of issue #116 (tests pumping each other's queues). Run one at a
time it passed 15 of 15.
`readout` (50a9fa4) uses `windows::Win32::Foundation::RECT` and is only
called from `host.rs`, which is Windows-only, so victory-gpu stopped
building on Linux again. It is gated like `host`; nothing changes on
Windows.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 03:37:02 +00:00
Author
Owner

@⁠KernelSmoker on GitHub · 2026-11-25 18:29 UTC · original

Independent verification on PR head 3041798 (Bazzite Linux 45 x86_64, Rust 1.98.1):

  • Exact portable job commands (with --offline --locked):
    • cargo test --locked -p victory-core -p victory-formats -p victory-pipeline -p victory-game -p victory-shader: 229 passed, 0 failed, 11 ignored (victory-core 11, victory-formats 24 / 4 ignored, victory-game 2, victory-pipeline 4, victory-shader 185 / 6 ignored + resource_tracking 3 / 1 ignored).
    • cargo test --locked -p victory-gpu -- --test-threads=1: 35 passed, 0 failed, 1 ignored (5/5 serial runs passed; 5/5 parallel runs also passed here). Total: 264 passed, 0 failed, matching the PR description.
  • Excluded crates verified on Linux:
    • victory-pe (3 passed, 4 failed) and victory-loader (0 passed, 3 failed) compile cleanly on Linux and fail only the tests that parse current_exe() as PE (Malformed("Unknown file magic") on ELF).
    • xtask compiles cleanly on Linux (3 passed, 1 failed: policy::tests::repository_passes_policy on crates/victory-shader/src/emit/lower.rs, 630652 > 524288 bytes, matching main).
    • victory-hle and victory fail to compile on Linux due to ungated Windows modules.
  • Code & cross-target checks:
    • resource::view_format has a single caller (crates/victory-gpu/src/descriptor.rs, inside #[cfg(windows)] fn host_desc).
    • cargo check --workspace --all-targets --locked --target x86_64-pc-windows-gnu passed both with default features and with --all-features, with no new warnings in resource.rs or list.rs (cross-target check in the Fedora 45 container, not a native Windows/MSVC run).
    • Optional note: --features diagnostics also builds and passes all tests on Linux for victory-core (11), victory-shader (185 + 3), and victory-gpu (35 with --test-threads=1), in case you want portable to guard diagnostics-gated Linux paths as well.

No game files were used and the game was not launched.

**@⁠KernelSmoker** on GitHub · 2026-11-25 18:29 UTC · [original](https://github.com/Belobug/VIctory-Belobug-AMD/pull/165#issuecomment-7170986828) Independent verification on PR head `3041798` (Bazzite Linux 45 x86_64, Rust 1.98.1): - Exact `portable` job commands (with `--offline --locked`): - `cargo test --locked -p victory-core -p victory-formats -p victory-pipeline -p victory-game -p victory-shader`: **229 passed, 0 failed, 11 ignored** (`victory-core` 11, `victory-formats` 24 / 4 ignored, `victory-game` 2, `victory-pipeline` 4, `victory-shader` 185 / 6 ignored + `resource_tracking` 3 / 1 ignored). - `cargo test --locked -p victory-gpu -- --test-threads=1`: **35 passed, 0 failed, 1 ignored** (5/5 serial runs passed; 5/5 parallel runs also passed here). Total: **264 passed, 0 failed**, matching the PR description. - Excluded crates verified on Linux: - `victory-pe` (3 passed, 4 failed) and `victory-loader` (0 passed, 3 failed) compile cleanly on Linux and fail only the tests that parse `current_exe()` as PE (`Malformed("Unknown file magic")` on ELF). - `xtask` compiles cleanly on Linux (3 passed, 1 failed: `policy::tests::repository_passes_policy` on `crates/victory-shader/src/emit/lower.rs`, 630652 > 524288 bytes, matching `main`). - `victory-hle` and `victory` fail to compile on Linux due to ungated Windows modules. - Code & cross-target checks: - `resource::view_format` has a single caller (`crates/victory-gpu/src/descriptor.rs`, inside `#[cfg(windows)] fn host_desc`). - `cargo check --workspace --all-targets --locked --target x86_64-pc-windows-gnu` passed both with default features and with `--all-features`, with no new warnings in `resource.rs` or `list.rs` (cross-target check in the Fedora 45 container, not a native Windows/MSVC run). - Optional note: `--features diagnostics` also builds and passes all tests on Linux for `victory-core` (11), `victory-shader` (185 + 3), and `victory-gpu` (35 with `--test-threads=1`), in case you want `portable` to guard `diagnostics`-gated Linux paths as well. No game files were used and the game was not launched.
Author
Owner

@⁠illuminatedfellow on GitHub · 2026-11-25 19:03 UTC · original

Thank you for checking it on another machine and for the note on --features diagnostics. I'll leave the job as it is unless Belobug prefers it covered too; it is one more line if so.

**@⁠illuminatedfellow** on GitHub · 2026-11-25 19:03 UTC · [original](https://github.com/Belobug/VIctory-Belobug-AMD/pull/165#issuecomment-7171772684) Thank you for checking it on another machine and for the note on `--features diagnostics`. I'll leave the job as it is unless Belobug prefers it covered too; it is one more line if so.
Author
Owner

@⁠illuminatedfellow on GitHub · 2026-11-25 19:11 UTC · original

Updated for the current main: readout.rs (50a9fa4) uses windows::Win32::Foundation::RECT and is only called from host.rs, so victory-gpu stopped building on Linux again and this job would have failed. I merged main (000ffdd) into the branch and gated mod readout with #[cfg(windows)], like host (4a33b31). Nothing changes on Windows; the job's commands pass again locally (264 tests).

**@⁠illuminatedfellow** on GitHub · 2026-11-25 19:11 UTC · [original](https://github.com/Belobug/VIctory-Belobug-AMD/pull/165#issuecomment-7171953212) Updated for the current `main`: `readout.rs` (50a9fa4) uses `windows::Win32::Foundation::RECT` and is only called from `host.rs`, so `victory-gpu` stopped building on Linux again and this job would have failed. I merged `main` (000ffdd) into the branch and gated `mod readout` with `#[cfg(windows)]`, like `host` (4a33b31). Nothing changes on Windows; the job's commands pass again locally (264 tests).
Author
Owner

@⁠KernelSmoker on GitHub · 2026-11-25 19:15 UTC · original

Re-verified updated PR head 4a33b31 (after merging main 000ffdd and gating mod readout): both portable job commands pass on Bazzite Linux 45 (Rust 1.98.1) with 264 passed, 0 failed (victory-core 11, victory-formats 24 / 4 ignored, victory-game 2, victory-pipeline 4, victory-shader 185 + 3 / 7 ignored, victory-gpu 35 / 1 ignored with --test-threads=1).

**@⁠KernelSmoker** on GitHub · 2026-11-25 19:15 UTC · [original](https://github.com/Belobug/VIctory-Belobug-AMD/pull/165#issuecomment-7172045934) Re-verified updated PR head `4a33b31` (after merging `main` `000ffdd` and gating `mod readout`): both `portable` job commands pass on Bazzite Linux 45 (Rust 1.98.1) with **264 passed, 0 failed** (`victory-core` 11, `victory-formats` 24 / 4 ignored, `victory-game` 2, `victory-pipeline` 4, `victory-shader` 185 + 3 / 7 ignored, `victory-gpu` 35 / 1 ignored with `--test-threads=1`).
github-bot closed this pull request 2026-11-26 16:05:08 +00:00

Pull request closed

This discussion has been locked. Commenting is limited to contributors.
No description provided.