Compile and test on Linux, and an Ubuntu CI run #41

Closed
LazyHatGuy wants to merge 7 commits from upstream-pr/41 into main
LazyHatGuy commented 2026-11-25 12:37:44 +00:00 (Migrated from github.com)

Imported from Belobug/VIctory-Belobug-AMD. Originally posted by LazyHatGuy on 2026-11-25T12:37:44Z.


What this does

The tree is Windows-first: victory-gpu, victory-shader, victory-hle and
victory-loader are written against Win32 and D3D12, and on Linux the
workspace did not compile at all. This branch makes it compile, test and run
its file-side commands natively, without changing what any of it does on
Windows:

  • Windows-only modules are cfg(windows)-gated at the module body, so the
    portable parts (config, logging, formats, the shader front end, the
    container and IR layers) still build here.
  • Windows-only dependencies moved under
    [target.'cfg(windows)'.dependencies] in each Cargo.toml, so Cargo does
    not try to resolve windows/windows-sys on a Linux host.
  • Unit tests that need a PE host binary, a host D3D12 device, or Windows path
    semantics are #[cfg(all(test, windows))]; the rest run here.
  • cargo xtask CI: the test job now runs on ubuntu-latest as well as
    windows-latest.
  • Format all files runs the pinned rustfmt (1.98.1, from
    rust-toolchain.toml) over the workspace, so the fmt gate in CI is
    meaningful from here on: the tree is reproducible with the pinned
    toolchain, which it was not before.

Running titles still needs Windows: the translate and run subcommands say
so and stop, as before. config, inspect, census and shader-info work.

Two fixes found on the way

  • queue::presented was gated to the diagnostics feature. It is not
    diagnostics-only: host::retire and bury read it in every Windows build.
    The gate is Windows alone now; cross-checking the Windows tree from Linux
    is what caught it.
  • The fork's own newer code leaks a few items on a host with no D3D12 (the
    query-heap types, the timeline's command-list step, the frame wait's
    measured length, the pr306 validator helper). Those are gated or given a
    no-op twin, so the shader tests still emit their shaders here and only the
    DXIL validation is skipped.

Checked on Linux (Arch, toolchain pinned to 1.98.1)

  • cargo check --workspace --all-targets --locked: no errors, no warnings.
    Same with --all-features.
  • cargo clippy --workspace --all-targets --locked: nothing new — the 10
    victory-shader lints it reports are on main too, and are what PR #3
    cleans up.
  • cargo test --workspace --locked: every test target passes except the
    pre-existing xtask policy test (below).
  • cargo run -p victory -- config prints the config and the cache and data
    directories.

CI status

main already fails two CI steps, and nothing here adds a failure:

  • Clippy (-D warnings) fails on the victory-shader lints mentioned
    above.
  • Check policy fails because crates/victory-shader/src/emit/lower.rs
    (630 kB) is over the 512 kB asset-size limit — listed under Known
    problems
    in the README. The same check inside cargo test -p xtask fails
    for the same reason, so the new Ubuntu test job shows that one failure
    too.

This PR was AI assisted.

No checks run on this PR until a maintainer approves the Actions run (the run
sits in action_required, like the other open PRs), so every number above is
from running those same commands locally.

<!-- greyfinch-sync:Belobug/VIctory-Belobug-AMD:issue:6604644085 --> Imported from [Belobug/VIctory-Belobug-AMD](https://github.com/Belobug/VIctory-Belobug-AMD/pull/41). Originally posted by [LazyHatGuy](https://github.com/LazyHatGuy) on 2026-11-25T12:37:44Z. --- ## What this does The tree is Windows-first: `victory-gpu`, `victory-shader`, `victory-hle` and `victory-loader` are written against Win32 and D3D12, and on Linux the workspace did not compile at all. This branch makes it compile, test and run its file-side commands natively, without changing what any of it does on Windows: - Windows-only modules are `cfg(windows)`-gated at the module body, so the portable parts (config, logging, formats, the shader front end, the container and IR layers) still build here. - Windows-only dependencies moved under `[target.'cfg(windows)'.dependencies]` in each `Cargo.toml`, so Cargo does not try to resolve `windows`/`windows-sys` on a Linux host. - Unit tests that need a PE host binary, a host D3D12 device, or Windows path semantics are `#[cfg(all(test, windows))]`; the rest run here. - `cargo xtask` CI: the test job now runs on `ubuntu-latest` as well as `windows-latest`. - `Format all files` runs the pinned rustfmt (1.98.1, from `rust-toolchain.toml`) over the workspace, so the fmt gate in CI is meaningful from here on: the tree is reproducible with the pinned toolchain, which it was not before. Running titles still needs Windows: the `translate` and `run` subcommands say so and stop, as before. `config`, `inspect`, `census` and `shader-info` work. ## Two fixes found on the way - `queue::presented` was gated to the diagnostics feature. It is not diagnostics-only: `host::retire` and `bury` read it in every Windows build. The gate is Windows alone now; cross-checking the Windows tree from Linux is what caught it. - The fork's own newer code leaks a few items on a host with no D3D12 (the query-heap types, the timeline's command-list step, the frame wait's measured length, the pr306 validator helper). Those are gated or given a no-op twin, so the shader tests still emit their shaders here and only the DXIL validation is skipped. ## Checked on Linux (Arch, toolchain pinned to 1.98.1) - `cargo check --workspace --all-targets --locked`: no errors, no warnings. Same with `--all-features`. - `cargo clippy --workspace --all-targets --locked`: nothing new — the 10 `victory-shader` lints it reports are on `main` too, and are what PR #3 cleans up. - `cargo test --workspace --locked`: every test target passes except the pre-existing `xtask` policy test (below). - `cargo run -p victory -- config` prints the config and the cache and data directories. ## CI status `main` already fails two CI steps, and nothing here adds a failure: - **Clippy** (`-D warnings`) fails on the `victory-shader` lints mentioned above. - **Check policy** fails because `crates/victory-shader/src/emit/lower.rs` (630 kB) is over the 512 kB asset-size limit — listed under *Known problems* in the README. The same check inside `cargo test -p xtask` fails for the same reason, so the new Ubuntu test job shows that one failure too. This PR was AI assisted. No checks run on this PR until a maintainer approves the Actions run (the run sits in `action_required`, like the other open PRs), so every number above is from running those same commands locally.
ntgata1-dotcom commented 2026-11-25 13:39:52 +00:00 (Migrated from github.com)

Imported from Belobug/VIctory-Belobug-AMD. Originally posted by ntgata1-dotcom on 2026-11-25T13:39:52Z.


Linux and the Windows target from Linux: works; the reformat left three // SAFETY: comments away from their blocks

Arch Linux, Rust 1.98.1 from rust-toolchain.toml, at d6a7269, compared with main 71652a2:

  • Linux, as you describe:

    • cargo fmt --all --check is clean.
    • cargo check --workspace --all-targets --locked, default and --all-features, gives no warnings.
    • cargo test --workspace --locked --no-fail-fast gives 316 passed, 1 failed (policy::tests::repository_passes_policy, the lower.rs size) and 12 ignored.
  • Windows target from Linux, with cargo-xwin 0.24.1: cargo xwin check --workspace --all-targets --locked, default and --all-features, passes.

  • The Windows exe still runs the same. That's a diagnostics build under Wine 11.22 on an RX 9070 XT, on the first-boot screens, with VICTORY_COPY_MEMORY=1 (for #19's black frames). The captured frame-2048.png is byte-identical to main's.

  • cargo xwin clippy --workspace --all-targets --locked (Windows target) has one warning fewer than main (frame.rs: unused wait). It also has three new "unsafe block missing a safety comment", all from 674a3c7 "Format all files". rustfmt broke each expression over several lines, so the unsafe block is no longer on the line under its // SAFETY: comment:

    • crates/victory-gpu/src/list.rs:1549 (blend_factor)
    • crates/victory-gpu/src/list.rs:2215 (a test)
    • crates/victory-gpu/src/watch.rs:1127 (a test)

    Moving each comment onto the line above its unsafe block clears all three, and cargo fmt --all --check stays clean (I tried it locally). Windows clippy then has one warning fewer than main and none new. For example:

    with_state(this, |list, s| {
        // SAFETY: the title passes four floats or null.
        s.set_blend_factor(list, unsafe { factor.as_ref() })
    });
    

Not run: Windows itself.

AI-assisted (Claude Code); numbers from my own runs.

<!-- greyfinch-sync:Belobug/VIctory-Belobug-AMD:comment:7164107694 --> Imported from [Belobug/VIctory-Belobug-AMD](https://github.com/Belobug/VIctory-Belobug-AMD/pull/41#issuecomment-7164107694). Originally posted by [ntgata1-dotcom](https://github.com/ntgata1-dotcom) on 2026-11-25T13:39:52Z. --- **Linux and the Windows target from Linux: works; the reformat left three `// SAFETY:` comments away from their blocks** Arch Linux, Rust 1.98.1 from `rust-toolchain.toml`, at `d6a7269`, compared with `main` `71652a2`: - Linux, as you describe: - `cargo fmt --all --check` is clean. - `cargo check --workspace --all-targets --locked`, default and `--all-features`, gives no warnings. - `cargo test --workspace --locked --no-fail-fast` gives 316 passed, 1 failed (`policy::tests::repository_passes_policy`, the `lower.rs` size) and 12 ignored. - Windows target from Linux, with cargo-xwin 0.24.1: `cargo xwin check --workspace --all-targets --locked`, default and `--all-features`, passes. - The Windows exe still runs the same. That's a diagnostics build under Wine 11.22 on an RX 9070 XT, on the first-boot screens, with `VICTORY_COPY_MEMORY=1` (for #19's black frames). The captured `frame-2048.png` is byte-identical to `main`'s. - `cargo xwin clippy --workspace --all-targets --locked` (Windows target) has one warning fewer than `main` (`frame.rs`: unused `wait`). It also has three new "unsafe block missing a safety comment", all from `674a3c7` "Format all files". rustfmt broke each expression over several lines, so the `unsafe` block is no longer on the line under its `// SAFETY:` comment: - `crates/victory-gpu/src/list.rs:1549` (`blend_factor`) - `crates/victory-gpu/src/list.rs:2215` (a test) - `crates/victory-gpu/src/watch.rs:1127` (a test) Moving each comment onto the line above its `unsafe` block clears all three, and `cargo fmt --all --check` stays clean (I tried it locally). Windows clippy then has one warning fewer than `main` and none new. For example: ```rust with_state(this, |list, s| { // SAFETY: the title passes four floats or null. s.set_blend_factor(list, unsafe { factor.as_ref() }) }); ``` Not run: Windows itself. AI-assisted (Claude Code); numbers from my own runs.
adrianmjim commented 2026-11-25 17:23:45 +00:00 (Migrated from github.com)

Imported from Belobug/VIctory-Belobug-AMD. Originally posted by adrianmjim on 2026-11-25T17:23:45Z.


Read through the diff against 71652a2 (not run on Linux here; Windows 11 + RX 7900 XT). Runtime-wise nothing changes on Windows: the dependency moves keep every Windows dependency, and the cfg gates only add non-Windows alternatives. Two CI points:

  • The Windows test job will likely go red. actions-rust-lang/setup-rust-toolchain@a188e68 (2.0.1) defaults build-warnings to deny, which exports CARGO_BUILD_WARNINGS=deny. main builds with one warning (method int_value is never used, victory-shader). Checked locally:

    CARGO_BUILD_WARNINGS=deny cargo test --workspace --locked --no-run
    error: `victory-shader` (lib) generated 1 warning
    error: warnings are denied by `build.warnings` configuration
    

    Either pass build-warnings: warn, or land #3 first (it removes int_value).

  • The lint job runs the asset-policy check before clippy, and the policy check already fails on main (crates/victory-shader/src/emit/lower.rs: 630652 bytes exceeds the 524288-byte limit), so clippy never runs there; the format commit makes lower.rs slightly larger (636,368 bytes). The job's timeout also drops from 60 to 15 minutes for two cold clippy runs on Windows.

The format-all commit (67 files) will conflict with most open PRs; landing it on its own, timed against them, may be easier.

<!-- greyfinch-sync:Belobug/VIctory-Belobug-AMD:comment:7169441314 --> Imported from [Belobug/VIctory-Belobug-AMD](https://github.com/Belobug/VIctory-Belobug-AMD/pull/41#issuecomment-7169441314). Originally posted by [adrianmjim](https://github.com/adrianmjim) on 2026-11-25T17:23:45Z. --- Read through the diff against `71652a2` (not run on Linux here; Windows 11 + RX 7900 XT). Runtime-wise nothing changes on Windows: the dependency moves keep every Windows dependency, and the `cfg` gates only add non-Windows alternatives. Two CI points: - **The Windows test job will likely go red.** `actions-rust-lang/setup-rust-toolchain@a188e68` (2.0.1) defaults `build-warnings` to `deny`, which exports `CARGO_BUILD_WARNINGS=deny`. `main` builds with one warning (`method int_value is never used`, victory-shader). Checked locally: ``` CARGO_BUILD_WARNINGS=deny cargo test --workspace --locked --no-run error: `victory-shader` (lib) generated 1 warning error: warnings are denied by `build.warnings` configuration ``` Either pass `build-warnings: warn`, or land #3 first (it removes `int_value`). - **The lint job runs the asset-policy check before clippy**, and the policy check already fails on `main` (`crates/victory-shader/src/emit/lower.rs: 630652 bytes exceeds the 524288-byte limit`), so clippy never runs there; the format commit makes `lower.rs` slightly larger (636,368 bytes). The job's timeout also drops from 60 to 15 minutes for two cold clippy runs on Windows. The format-all commit (67 files) will conflict with most open PRs; landing it on its own, timed against them, may be easier.

Pull request closed

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
Belobug/VIctory-Belobug-AMD!41
No description provided.