Skip to content

CI: build and test the host-independent crates on Linux - #1241

Open
MIchiel1234 wants to merge 1 commit into
Marvisak:mainfrom
MIchiel1234:ci/linux-host-independent-crates
Open

MIchiel1234 wants to merge 1 commit into
Marvisak:mainfrom
MIchiel1234:ci/linux-host-independent-crates

Conversation

@MIchiel1234

Copy link
Copy Markdown

Build and test the host-independent crates on Linux

Nothing checked that the crates carrying no Windows dependency still build off Windows, and they did not: on a Linux host seven tests failed and victory-gpu did not compile at all. CI runs only windows-latest, and rust-toolchain.toml lists only the MSVC target, so there was nowhere for this to show up.

After this change the six crates in the new job are clean: 50 tests pass, 0 fail on ubuntu-latest.

current_exe() is not a PE on other hosts

victory-pe and victory-loader read current_exe() when they needed a real PE32+ image:

/// The test binary itself is a real MSVC-linked PE32+ image.
fn own_image() -> Vec<u8> {
    std::fs::read(std::env::current_exe().unwrap()).unwrap()
}

That holds only when the tests are built for Windows. On any other host the test binary is an ELF, which ImageInfo::parse rightly rejects, so four tests in victory-pe and three in victory-loader failed for reasons unrelated to the code under test. The parser was never at fault.

They now use a PE32+ image assembled in a new victory-pe::fixtures module, behind a fixtures feature that victory-loader enables as a dev-dependency. It has two sections, an entry point, one KERNEL32 import with a real import name table and IAT, a TLS directory with no callbacks, and a one-entry exception table.

Building the image also pins down what the tests assert — the import count, the TLS directory RVA, an empty callback array — rather than depending on whatever the current linker emits. rejects_iat_outside_image still drives the real overflow path it was written for.

The one test that needs a genuinely loadable image, windows_assigns_static_tls_to_a_prepared_dll, stays cfg(windows) and keeps using current_exe(), now with a comment saying why.

A cfg(windows) function called from ungated code

resource::view_format in victory-gpu calls host_resource, which is #[cfg(windows)], from an ungated function — one E0425 that stopped the crate compiling anywhere else. Its only caller, host_desc, is already gated, so gating view_format too is a no-op on Windows and lets the crate build elsewhere.

Scope of the CI job

The job covers the six crates that are clean today. Deliberately not the whole workspace yet, and the job's comment records why so the list can be widened:

crate on Linux
victory-core, victory-pe, victory-formats, victory-pipeline, victory-game, victory-loader in the job: 50 tests pass, clippy -D warnings clean
victory-gpu, victory-shader compile and pass their tests (24 and 96) after the cfg fix, but still warn in this configuration
victory-hle needs its module tree gated (xmem, lifecycle, files referenced from ungated code)

Checks

  • cargo clippy -D warnings and cargo test on the six crates: clean, 50 passed
  • cargo test -p xtask (asset policy, incl. repository_passes_policy): 4 passed
  • .githooks/pre-commit (cargo xtask policy --staged): 8 files ok
  • victory-pe for x86_64-pc-windows-msvc, clippy -D warnings, default and --all-features: clean, so the fixture compiles on Windows too

No game files, no assets and no generated data are added. The full workspace could not be typechecked for the MSVC target from Linux because blake3's build script wants cl.exe; the victory-gpu change is inert on Windows by construction, as described above.

Nothing checked that the crates carrying no Windows dependency still
build off Windows, and they did not. Seven tests failed on a Linux host
and victory-gpu did not compile at all.

victory-pe and victory-loader read current_exe() when they needed a real
PE32+ image. That holds only when the tests are built for Windows: on
any other host the test binary is an ELF, which the parser rightly
rejects, so four tests in victory-pe and three in victory-loader failed
for reasons that had nothing to do with the code under test. They now
use a PE32+ image assembled in victory-pe's new fixtures module, behind
a `fixtures` feature that victory-loader enables as a dev-dependency.
Building the image also pins down what the tests assert -- the import
count, the TLS directory RVA, an empty callback array -- instead of
depending on whatever the current linker emits. The one test that needs
a genuinely loadable image stays Windows-only, now with a comment
saying why.

resource::view_format in victory-gpu called host_resource, which is
`cfg(windows)`, from an ungated function. Its only caller, host_desc,
is already gated, so gating view_format too is a no-op on Windows and
lets the crate compile elsewhere.

The new CI job covers the six crates that are clean today: 50 tests on
ubuntu-latest. victory-gpu and victory-shader now compile and pass
their tests on Linux as well, but still warn in that configuration, and
victory-hle needs its module tree gated; the job's comment records that
so the list can be widened as they are fixed.
@Zipettte

Copy link
Copy Markdown

Tested on AMD Radeon RX 7700 XT (RDNA3, gfx1101), driver 32.0.32029.2010, Windows 11, Rust 1.98.1 MSVC at f02c702: cargo test -p victory-gpu -p victory-loader -p victory-pe passes, 82 passed / 0 failed. Workspace baseline on main (ffe310e) is green on the same machine (342 passed).

Tested with AI assistance (Claude).

zhaibingye added a commit to zhaibingye/VIctory that referenced this pull request Nov 25, 2026
Keep both the fork's typed-float NaN test and the upstream branch-join regression. Gate the Windows-only view_format helper so the GPU crate can be tested off Windows; the same one-line gate is part of Marvisak#523 and Marvisak#1241.

Validated Linux formats, GPU, PE, and shader unit tests and Windows MSVC workspace test compilation (with a disposable Linux builder workaround).
@Headache3318

Copy link
Copy Markdown

Independent Linux verification at PR head f02c702 (not merged with main: unrelated histories, 93 add/add conflicts).

cargo check --workspace --all-targets: 10 errors, all in victory-hle. 4× E0433 missing windows_sys crate (imported in xgameui.rs but not in Cargo.toml); 6× E0433 non-gated references to cfg(windows) modules (xmem in d3d12x.rs, lifecycle in xgame.rs, files in storage.rs).

cargo test --workspace --locked: 0 tests run (build failed first). Same 9 compilation errors as check.

cargo clippy --workspace --all-targets -- -D warnings: 50 errors (23 in victory-gpu lib, 25 in victory-gpu lib test, 2 in victory-shader lib test) — unused imports/variables/unused_mut/dead_code. Build failed before reaching victory-hle.

Verdict: the workspace does not build or test on Linux as the title claims. victory-hle needs proper cross-platform guards and the missing windows_sys dependency. Clippy lints would fail even if compilation succeeded.

Arch Linux, kernel 7.3.5-arch1-1, 8 cores, rustc 1.98.1 (pinned), AI-assisted.

Copy link
Copy Markdown
Owner

Automated triage for the maintainers.

Needs work. Needs the maintainer's decision. This PR changes the CI workflow.

What it does:

  • Adds a linux job to .github/workflows/ci.yml that runs clippy and tests for six crates (core, pe, formats, pipeline, game, loader). It uses the same actions as the existing job.
  • Gates resource::view_format in victory-gpu with #[cfg(windows)]. Its only caller, host_desc, is already gated, so Windows builds are unchanged.
  • Replaces the current_exe() images in the victory-pe and victory-loader tests with a PE32+ image built by hand in the new victory_pe::fixtures module. It is plain header construction, with no copied bytes.

Points for the maintainer:

CI: no checks have run on this head.


Generated by Claude Code

Callimann8 pushed a commit to Callimann8/VIctory-fork that referenced this pull request Nov 26, 2026
… already uploaded that view from title memory (fork PR Marvisak#1241)

texture::alias took the view's first use in the list as the sign that its copy from the card-written source was still owed; an upload of the same view from title memory earlier in the list had used it already, and with no change of the source's state the copy was skipped: the shader read the uploaded bytes. Now the list remembers the last source copied into each such view. Its author read back zero before and the packed-light value after on an RTX 5080. Read whole, applied as it is (its device test returns early without a host). The views in question are those logged as 'a view placed in the memory of a texture the host writes, in another format'.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
notquiteog added a commit to notquiteog/victory-nvidia that referenced this pull request Nov 26, 2026
…ard wrote is copied from it even if the list already uploaded that view from title memory (fork PR Marvisak#1241)

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Steenax6 added a commit to Steenax6/VIctory-NVID that referenced this pull request Nov 26, 2026
…ter an upload from title memory in the same list

A view the title places, in another format, in the memory of a texture
the host writes is read from that texture by a copy on the host
(texture::alias; the title packs light as R9G9B9E5 into R32_UINT
textures and samples them through such views). The copy was skipped when
the list had used the view before: an upload of it from title memory (the
pass over textures picked by index) counts as such a use, so the shader
read the uploaded title bytes, which nothing writes, instead of what the
host wrote. Now the list notes per alias texture the host texture last
copied into it, and the copy is skipped only after a copy from that same
texture with nothing between.

Source: fxceless/victory-fork pull request Marvisak#1241 (kesku; on an RTX 5080
the packed light read back 0), with its test, which fails here without
the change.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
AntoninMichelq added a commit to AntoninMichelq/VIctory-forkAMD that referenced this pull request Nov 26, 2026
…ORY_CLAMP_MERGE, off by default, read live

texture::alias: the copy owed follows VICTORY_ALIAS_AFTER_UPLOAD (fork PR Marvisak#1241)
in both the batched (HoldAliases) and the direct path.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
AntoninMichelq added a commit to AntoninMichelq/VIctory-forkAMD that referenced this pull request Nov 26, 2026
…nal state and matches Alias::Copied (smallcmds' signature)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
AntoninMichelq added a commit to AntoninMichelq/VIctory-forkAMD that referenced this pull request Nov 26, 2026
…live)

cumul11b removed the device 1.5 to 4 minutes into the world in 3 runs of 3;
cumul11bx (cumul11b with ALIAS_AFTER_UPLOAD=0 and CBV_CAP=0, the latter never
triggered) held 7 minutes. The rule of fork PR Marvisak#1241 stays behind the switch
until the cause is found.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Bebrik229 pushed a commit to Bebrik229/VIctory that referenced this pull request Nov 26, 2026
…GAP + card_before runs, merge_under_writes prepass + batched dirty, reaper reset, WHY_READ diag, fallback_samplers Marvisak#1778, alias Marvisak#1241, VICTORY_STAGING_POOL
XFlawless1 pushed a commit to XFlawless1/VIctory that referenced this pull request Nov 26, 2026
… already uploaded that view from title memory (fork PR Marvisak#1241)

texture::alias took the view's first use in the list as the sign that its copy from the card-written source was still owed; an upload of the same view from title memory earlier in the list had used it already, and with no change of the source's state the copy was skipped: the shader read the uploaded bytes. Now the list remembers the last source copied into each such view. Its author read back zero before and the packed-light value after on an RTX 5080. Read whole, applied as it is (its device test returns early without a host). The views in question are those logged as 'a view placed in the memory of a texture the host writes, in another format'.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
(cherry picked from commit 19a45d1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants