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

Closed
github-bot wants to merge 7 commits from github-bot/gh-41 into main AGit
Owner

@⁠LazyHatGuy on GitHub · 2026-11-25 12:37 UTC · original
LazyHatGuy:linux → main · +4797 −1499 · 85 files · 7 commits · closed without merging

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.

**@⁠LazyHatGuy** on GitHub · 2026-11-25 12:37 UTC · [original](https://github.com/Belobug/VIctory-Belobug-AMD/pull/41) `LazyHatGuy:linux` → `main` · +4797 −1499 · 85 files · 7 commits · closed without merging ## 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.
The GPU and loader modules declared crash, texture and host reads
unconditionally, and hle's UI dialog, allocator hook and relaunch call
Windows items the modules no longer export here. Gate each; on Linux a
value wait is met as unmapped memory is, the host dialog and title
relaunch are dismissed, and the translate command says what it needs.

Co-Authored-By: Qwen 3.8 Flash Next <[email protected]>

🤖 Generated with [OpenCode](https://opencode.ai) (Qwen3.8 Flash)
The loader and PE tests parse the host's own test binary as PE, and two
kernel tests read image paths a Windows host keeps as given: on Linux
the binary is an ELF and a `C:\...` path is one relative name. Gate
those tests to Windows; the rest run on both.

Co-Authored-By: Qwen 3.8 Flash Next <[email protected]>

🤖 Generated with [OpenCode](https://opencode.ai) (Qwen3.8 Flash)
On a Linux host the Windows-only users of some items are compiled out,
so their imports and host-side bookkeeping stand unused: move the
dependencies that only the Windows modules use (anyhow, tracing,
miniz_oxide, opus-pure, victory-core, victory-pipeline, victory-shader)
under the existing cfg(windows) target sections, gate the remaining
Windows-only imports and one helper, allow the dead host-side bookkeeping
in the GPU files where it has no Linux caller, and keep the deprecated
fetch_update allowed until the pinned toolchain can take try_update.
No behaviour changes anywhere; the Windows build is untouched.

Co-Authored-By: Qwen 3.8 Flash Next <[email protected]>

🤖 Generated with [OpenCode](https://opencode.ai) (Qwen3.8 Flash)
`queue::presented` is only read from the capture and host code, all of it
Windows-side, so the diagnostics feature alone left it dead on Linux. It is
not diagnostics-only: `host::retire` and `bury` read it on every run, so the
gate is Windows alone (the cross check of the Windows tree without
`diagnostics` says so).

Co-Authored-By: Qwen 3.8 Flash Next <[email protected]>

🤖 Generated with [OpenCode](https://opencode.ai) (Qwen3.8 Flash)
🤖 Generated with [OpenCode](https://opencode.ai) (DeepSeek V4.1 Flash)
The Linux work was written against upstream's tree, and this fork's
own commits added more that only a Windows host runs. `OnceLock` and
the `E_NOTIMPL` import stay ungated, because the replaced-shader table
and the portable path use them here; the frame wait's measured length,
the queue's `this` and second plane, the query heap types and the
timeline's list step are gated or marked unused without a host; the
test that cuts a list at a wait needs a host GPU, so it is
Windows-only, and pr306's validator call runs as a no-op elsewhere so
its shaders are still emitted and used here.

Co-Authored-By: DeepSeek v4.1 Flash <[email protected]>

🤖 Generated with [OpenCode](https://opencode.ai) (DeepSeek V4.1 Flash)
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 03:34:19 +00:00
Author
Owner

@⁠ntgata1-dotcom on GitHub · 2026-11-25 13:39 UTC · original

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.

**@⁠ntgata1-dotcom** on GitHub · 2026-11-25 13:39 UTC · [original](https://github.com/Belobug/VIctory-Belobug-AMD/pull/41#issuecomment-7164107694) **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.
Author
Owner

@⁠adrianmjim on GitHub · 2026-11-25 17:23 UTC · original

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.

**@⁠adrianmjim** on GitHub · 2026-11-25 17:23 UTC · [original](https://github.com/Belobug/VIctory-Belobug-AMD/pull/41#issuecomment-7169441314) 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.
github-bot closed this pull request 2026-11-26 14:39:48 +00:00

Pull request closed

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