Build: gate Windows-only paths so the workspace builds and tests on Linux #235

Closed
SkippySteve wants to merge 23 commits from upstream-pr/235 into main
SkippySteve commented 2026-11-24 01:41:01 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by SkippySteve on 2026-11-24T01:41:01Z.


Makes the workspace check, build and test on x86_64-unknown-linux-gnu. Closes #90.

Credit and context

This is the approach from #39 by @LaunchDoesntCode, rebased as a minimal change onto main (merged up to 58fed37). #39 was marked superseded by #112, which is the larger effort (Linux workspace, contributor setup, CI and a bulk cargo fmt). It currently conflicts with main. This PR doesn't replace #112. It only adds the cfg gates, so main builds and tests on Linux now and #112 can rebase onto it or drop the overlapping parts.

Changes

  • cfg(windows) gates on the remaining Windows-only paths:

    • view_format (D3D12 host copy) in victory-gpu
    • the xgameui host dialog
    • the xmem allocator hookup in D3D12XCreateDevice
    • XLaunchNewGame's relaunch
  • apps/victory/src/translate.rs: on non-Windows hosts, the validator and pipeline checks use an off-host stub that reports them as unavailable.

  • Tests that parse their own test binary as PE, or that depend on Windows path rules, run on Windows only.

  • No cfg-induced warnings on Linux. Once the host paths are gated, a Linux build warned about imports, helpers and console-side state that only those paths use:

    • victory-gpu: off Windows only, dead_code, unused_variables and unused_mut are allowed crate-wide, because the host halves of the objects are gated out there. The OnceLock import and the fence/root test modules (every test in them calls host D3D12) are gated.
    • victory-hle: gates the put import in display, the w test helper in kernel, and XLaunchNewGame's park loop (unreachable after exit off Windows). It also allows the Linux-only unused mut in modules::all and the unused host::function.
    • victory: gates the anyhow::Context import that only run uses.
  • Windows behaviour doesn't change. Every change is a cfg gate or a non-Windows stub. victory run on Linux still bails with "running titles requires Windows".

  • .github/workflows/ci.yml: a linux job on ubuntu-latest next to the Windows one. It runs cargo check --workspace --all-targets --all-features --locked and cargo test --workspace --locked, so a Windows-only path that leaks into shared code fails on the PR that adds it. It needs no titles or game files. It doesn't run clippy with -D warnings yet: two unused test imports in victory-shader/src/emit/mod.rs warn on Linux, and #326 already removes them.

Test plan

Arch Linux, x86_64-unknown-linux-gnu:

  • cargo check --workspace
  • cargo build --workspace
  • cargo test --workspace: 162 passed, 0 failed, 3 ignored
  • cargo clippy --workspace --all-targets (with or without --all-features) shows no errors and one warning: constant_color in victory-shader/src/emit/mod.rs is never used. This PR deliberately doesn't gate that helper. #326 (which folds in #262) keeps it on every host and adds the hermetic constant_color_is_a_well_formed_container test, which clears the warning. Before this PR, Linux showed about 30 warnings.
  • cargo xwin clippy --workspace --all-targets --target x86_64-pc-windows-msvc: no new warnings. The two that remain (gpu/host.rs safety comment, hle/xmem.rs field reassign) are in untouched files and are also on main.
  • cargo fmt --check fails on main in about 30 files that this PR doesn't touch. #112 does the bulk format, so this PR leaves them alone and adds no new drift.
  • Windows build: cargo xwin build --workspace and -p victory --release for x86_64-pc-windows-msvc pass with no warnings, and the workspace test binaries compile (--no-run). See the comment below.
  • Windows test binaries run under Wine (UMU-Proton 11.0): 257 passed, 7 failed, 4 ignored. That matches main exactly, and the 7 failures are Wine/vkd3d or harness gaps (#128, #170, among others). See https://github.com/Marvisak/VIctory/pull/235#issuecomment-7119471652
  • Native Windows or CI run (still not done)
<!-- greyfinch-sync:Marvisak/VIctory:issue:6572660314 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/235). Originally posted by [SkippySteve](https://github.com/SkippySteve) on 2026-11-24T01:41:01Z. --- Makes the workspace check, build and test on `x86_64-unknown-linux-gnu`. Closes #90. ## Credit and context This is the approach from #39 by @LaunchDoesntCode, rebased as a minimal change onto `main` (merged up to `58fed37`). #39 was marked superseded by #112, which is the larger effort (Linux workspace, contributor setup, CI and a bulk `cargo fmt`). It currently conflicts with `main`. This PR doesn't replace #112. It only adds the `cfg` gates, so `main` builds and tests on Linux now and #112 can rebase onto it or drop the overlapping parts. ## Changes - `cfg(windows)` gates on the remaining Windows-only paths: - `view_format` (D3D12 host copy) in `victory-gpu` - the xgameui host dialog - the xmem allocator hookup in `D3D12XCreateDevice` - `XLaunchNewGame`'s relaunch - `apps/victory/src/translate.rs`: on non-Windows hosts, the validator and pipeline checks use an off-host stub that reports them as unavailable. - Tests that parse their own test binary as PE, or that depend on Windows path rules, run on Windows only. - No `cfg`-induced warnings on Linux. Once the host paths are gated, a Linux build warned about imports, helpers and console-side state that only those paths use: - `victory-gpu`: off Windows only, `dead_code`, `unused_variables` and `unused_mut` are allowed crate-wide, because the host halves of the objects are gated out there. The `OnceLock` import and the fence/root test modules (every test in them calls host D3D12) are gated. - `victory-hle`: gates the `put` import in `display`, the `w` test helper in `kernel`, and `XLaunchNewGame`'s park loop (unreachable after `exit` off Windows). It also allows the Linux-only unused `mut` in `modules::all` and the unused `host::function`. - `victory`: gates the `anyhow::Context` import that only `run` uses. - Windows behaviour doesn't change. Every change is a `cfg` gate or a non-Windows stub. `victory run` on Linux still bails with "running titles requires Windows". - `.github/workflows/ci.yml`: a `linux` job on `ubuntu-latest` next to the Windows one. It runs `cargo check --workspace --all-targets --all-features --locked` and `cargo test --workspace --locked`, so a Windows-only path that leaks into shared code fails on the PR that adds it. It needs no titles or game files. It doesn't run clippy with `-D warnings` yet: two unused test imports in `victory-shader/src/emit/mod.rs` warn on Linux, and #326 already removes them. ## Test plan Arch Linux, x86_64-unknown-linux-gnu: - [x] `cargo check --workspace` - [x] `cargo build --workspace` - [x] `cargo test --workspace`: 162 passed, 0 failed, 3 ignored - [x] `cargo clippy --workspace --all-targets` (with or without `--all-features`) shows no errors and one warning: `constant_color` in `victory-shader/src/emit/mod.rs` is never used. This PR deliberately doesn't gate that helper. #326 (which folds in #262) keeps it on every host and adds the hermetic `constant_color_is_a_well_formed_container` test, which clears the warning. Before this PR, Linux showed about 30 warnings. - [x] `cargo xwin clippy --workspace --all-targets --target x86_64-pc-windows-msvc`: no new warnings. The two that remain (`gpu/host.rs` safety comment, `hle/xmem.rs` field reassign) are in untouched files and are also on `main`. - [ ] `cargo fmt --check` fails on `main` in about 30 files that this PR doesn't touch. #112 does the bulk format, so this PR leaves them alone and adds no new drift. - [x] Windows build: `cargo xwin build --workspace` and `-p victory --release` for `x86_64-pc-windows-msvc` pass with no warnings, and the workspace test binaries compile (`--no-run`). See the comment below. - [x] Windows test binaries run under Wine (UMU-Proton 11.0): 257 passed, 7 failed, 4 ignored. That matches `main` exactly, and the 7 failures are Wine/vkd3d or harness gaps (#128, #170, among others). See https://github.com/Marvisak/VIctory/pull/235#issuecomment-7119471652 - [ ] Native Windows or CI run (still not done)
catminou4 commented 2026-11-24 06:50:55 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by catminou4 on 2026-11-24T06:50:55Z.

Review: APPROVED


Verified on real Apple Silicon (macOS 26, arm64, rustc 1.98.1 pinned by rust-toolchain.toml). #438 is stacked on this head (16704a5), so its two CI-only commits don't affect the code under test — I ran the whole Apple Silicon workflow against this exact tree plus those commits, and everything the workflow does passes:

  • cargo xtask policy: 153 files ok
  • cargo check --workspace --all-targets --locked: clean (one pre-existing dead-code warning in victory-shader's lib test — constant_color, fixed separately in #685)
  • cargo test --workspace --locked: 162 passed, 0 failed, 3 ignored (the ignored ones are the PE-own-binary tests this PR gates off non-Windows)
  • cargo build --workspace --release --locked: ok; file target/release/victory → Mach-O 64-bit executable arm64
  • tests/offline-cli.sh target/release/victory: OFFLINE CLI SMOKE TEST: PASS

Also directly on this head: cargo test -p victory-loader --locked → the three prepare::tests that parse the test binary as a PE image are now ignored off Windows, exit 0 (they fail on main).

This is the PR that makes the workspace compile and test on macOS at all — approving.

<!-- greyfinch-sync:Marvisak/VIctory:review:6034873827 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/235#pullrequestreview-6034873827). Originally posted by [catminou4](https://github.com/catminou4) on 2026-11-24T06:50:55Z. **Review:** APPROVED --- Verified on real Apple Silicon (macOS 26, arm64, rustc 1.98.1 pinned by rust-toolchain.toml). #438 is stacked on this head (`16704a5`), so its two CI-only commits don't affect the code under test — I ran the whole Apple Silicon workflow against this exact tree plus those commits, and everything the workflow does passes: - `cargo xtask policy`: 153 files ok - `cargo check --workspace --all-targets --locked`: clean (one pre-existing dead-code warning in victory-shader's lib test — `constant_color`, fixed separately in #685) - `cargo test --workspace --locked`: **162 passed, 0 failed, 3 ignored** (the ignored ones are the PE-own-binary tests this PR gates off non-Windows) - `cargo build --workspace --release --locked`: ok; `file target/release/victory` → Mach-O 64-bit executable arm64 - `tests/offline-cli.sh target/release/victory`: OFFLINE CLI SMOKE TEST: PASS Also directly on this head: `cargo test -p victory-loader --locked` → the three `prepare::tests` that parse the test binary as a PE image are now `ignore`d off Windows, exit 0 (they fail on main). This is the PR that makes the workspace compile and test on macOS at all — approving.
SkippySteve commented 2026-11-24 06:55:03 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by SkippySteve on 2026-11-24T01:43:41Z.


Windows target check at head fb59109, cross-compiled from Arch Linux with cargo-xwin (MSVC CRT/SDK via xwin):

Command Result
cargo xwin build -p victory --release --target x86_64-pc-windows-msvc ✅ Finished, 0 warnings, produces a PE32+ x86-64 victory.exe
cargo xwin build --workspace --target x86_64-pc-windows-msvc ✅ Finished, 0 warnings, 0 errors
cargo xwin test --workspace --target x86_64-pc-windows-msvc --no-run ✅ All 13 test binaries compile, including the Windows-only tests this PR gates (victory-loader load_probe / no_dll_planting, victory-pe, victory-gpu, victory-hle)

So the Windows side of every cfg(windows) gate still compiles cleanly. I compiled the tests but didn't run them, because this machine has no Wine. A native Windows cargo test --workspace (or CI) would still be needed to confirm runtime behaviour, though the PR only adds cfg gates and doesn't change any Windows code paths.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7119388110 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/235#issuecomment-7119388110). Originally posted by [SkippySteve](https://github.com/SkippySteve) on 2026-11-24T01:43:41Z. --- Windows target check at head `fb59109`, cross-compiled from Arch Linux with `cargo-xwin` (MSVC CRT/SDK via xwin): | Command | Result | |---|---| | `cargo xwin build -p victory --release --target x86_64-pc-windows-msvc` | ✅ Finished, 0 warnings, produces a PE32+ x86-64 `victory.exe` | | `cargo xwin build --workspace --target x86_64-pc-windows-msvc` | ✅ Finished, 0 warnings, 0 errors | | `cargo xwin test --workspace --target x86_64-pc-windows-msvc --no-run` | ✅ All 13 test binaries compile, including the Windows-only tests this PR gates (`victory-loader` `load_probe` / `no_dll_planting`, `victory-pe`, `victory-gpu`, `victory-hle`) | So the Windows side of every `cfg(windows)` gate still compiles cleanly. I compiled the tests but didn't run them, because this machine has no Wine. A native Windows `cargo test --workspace` (or CI) would still be needed to confirm runtime behaviour, though the PR only adds `cfg` gates and doesn't change any Windows code paths.
SkippySteve commented 2026-11-24 06:55:04 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by SkippySteve on 2026-11-24T01:48:54Z.


Windows test binaries under Wine (UMU-Proton 11.0-2e)

I ran the x86_64-pc-windows-msvc workspace test binaries under Proton's Wine (wine-11.0). I ran the same binaries from main (d2a4bae) to compare. This is Wine, not native Windows, so it doesn't replace a native or CI run.

Setup: cargo xwin test --no-run --target x86_64-pc-windows-msvc --workspace on fb59109. Each .exe ran under files/bin/wine from its crate directory, in a fresh prefix. The bare Wine prefix has no D3D12 runtime, so I copied in the DLLs the Proton launcher normally installs: DXVK dxgi/d3d11/d3d10core, vkd3d-proton d3d12/d3d12core, and Wine's libvkd3d*. I ran with WINEDLLOVERRIDES=dxgi,d3d11,d3d10core,d3d12,d3d12core=n,b. GPU: RTX 2060 SUPER. No titles or game assets were used.

Result: 257 passed, 7 failed, 4 ignored, the same as main. The same 7 tests fail on both, so this PR adds no regressions under Wine.

binary PR #235 main
victory-core 8 ok 8 ok
victory-formats 20 ok, 3 ignored same
victory-game 2 ok same
victory-pe 7 ok same
victory-pipeline 3 ok same
victory-loader (lib) 18 ok same
victory-loader load_probe 1 ok, 1 fail same
victory-shader 68 ok, 1 fail same
victory-gpu 40 ok, 3 fail, 1 ignored same
victory-hle (lib) 85 ok, 1 fail same
victory-hle no_dll_planting 1 ok same
victory (app) 1 ok same
xtask 3 ok, 1 fail same

Failures. They come from Wine or the test harness, and none of them is in code this PR touches:

  • victory-gpu indirect::tests::argument_clamp_builds: #170, the argument clamp doesn't compile on vkd3d.
  • victory-gpu resource::tests::buffer_data_reaches_the_host_texture: reads back zeros. This looks like #128, where deferred uploads are skipped under Wine/vkd3d.
  • victory-gpu pipeline::library::tests::a_rejected_blob_gives_an_empty_library and victory-shader emit::tests::stub_pipeline_is_created: vkd3d-proton accepts blobs or digests that native D3D12 rejects, for example a zeroed DXIL digest.
  • victory-hle modules::net::tests::only_loopback_is_reachable: Wine's ws2_32.dll lacks WSAConnectByList.
  • victory-loader load_probe::loads_binds_and_calls_probe: the test runs cargo with a Linux CARGO_MANIFEST_DIR joined with \..\.., so the host cargo can't find the manifest. This only happens when cross-compiling.
  • xtask policy::tests::repository_passes_policy: there's no git on the Wine PATH.

I'm ticking the Windows-tests item with the note "under Wine". A native Windows or CI run is still worth doing before merge.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7119471652 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/235#issuecomment-7119471652). Originally posted by [SkippySteve](https://github.com/SkippySteve) on 2026-11-24T01:48:54Z. --- ## Windows test binaries under Wine (UMU-Proton 11.0-2e) I ran the `x86_64-pc-windows-msvc` workspace test binaries under Proton's Wine (`wine-11.0`). I ran the same binaries from `main` (`d2a4bae`) to compare. This is **Wine, not native Windows**, so it doesn't replace a native or CI run. **Setup:** `cargo xwin test --no-run --target x86_64-pc-windows-msvc --workspace` on `fb59109`. Each `.exe` ran under `files/bin/wine` from its crate directory, in a fresh prefix. The bare Wine prefix has no D3D12 runtime, so I copied in the DLLs the Proton launcher normally installs: DXVK `dxgi`/`d3d11`/`d3d10core`, vkd3d-proton `d3d12`/`d3d12core`, and Wine's `libvkd3d*`. I ran with `WINEDLLOVERRIDES=dxgi,d3d11,d3d10core,d3d12,d3d12core=n,b`. GPU: RTX 2060 SUPER. No titles or game assets were used. **Result: 257 passed, 7 failed, 4 ignored, the same as `main`.** The same 7 tests fail on both, so this PR adds no regressions under Wine. | binary | PR #235 | main | |---|---|---| | victory-core | 8 ok | 8 ok | | victory-formats | 20 ok, 3 ignored | same | | victory-game | 2 ok | same | | victory-pe | 7 ok | same | | victory-pipeline | 3 ok | same | | victory-loader (lib) | 18 ok | same | | victory-loader `load_probe` | 1 ok, 1 fail | same | | victory-shader | 68 ok, 1 fail | same | | victory-gpu | 40 ok, 3 fail, 1 ignored | same | | victory-hle (lib) | 85 ok, 1 fail | same | | victory-hle `no_dll_planting` | 1 ok | same | | victory (app) | 1 ok | same | | xtask | 3 ok, 1 fail | same | **Failures. They come from Wine or the test harness, and none of them is in code this PR touches:** - `victory-gpu indirect::tests::argument_clamp_builds`: #170, the argument clamp doesn't compile on vkd3d. - `victory-gpu resource::tests::buffer_data_reaches_the_host_texture`: reads back zeros. This looks like #128, where deferred uploads are skipped under Wine/vkd3d. - `victory-gpu pipeline::library::tests::a_rejected_blob_gives_an_empty_library` and `victory-shader emit::tests::stub_pipeline_is_created`: vkd3d-proton accepts blobs or digests that native D3D12 rejects, for example a zeroed DXIL digest. - `victory-hle modules::net::tests::only_loopback_is_reachable`: Wine's `ws2_32.dll` lacks `WSAConnectByList`. - `victory-loader load_probe::loads_binds_and_calls_probe`: the test runs `cargo` with a Linux `CARGO_MANIFEST_DIR` joined with `\..\..`, so the host cargo can't find the manifest. This only happens when cross-compiling. - `xtask policy::tests::repository_passes_policy`: there's no `git` on the Wine `PATH`. I'm ticking the Windows-tests item with the note "under Wine". A native Windows or CI run is still worth doing before merge.
CesarLopesO commented 2026-11-24 06:55:05 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by CesarLopesO on 2026-11-24T01:56:49Z.


Independent Linux validation — Debian 13

I tested this PR on a separate Debian 13 (Trixie) machine.

Environment

  • OS: Debian GNU/Linux 13 (Trixie)
  • rustc: 1.98.1 (48a229cea 2026-09-01)
  • cargo: 1.98.1 (797e8a9bc 2026-08-05)
  • Tested commit: fb59109

Command

cargo test --workspace --locked

Result: 162 passed, 0 failed, 3 ignored.

The workspace compiled and all runnable tests completed successfully. The build emitted compiler warnings, including unused/dead-code warnings and an unreachable-expression warning in crates/victory-hle/src/modules/xgame.rs:94, but no compilation errors.

No game files or game data were used.

Thanks for the Linux portability work!

<!-- greyfinch-sync:Marvisak/VIctory:comment:7119605395 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/235#issuecomment-7119605395). Originally posted by [CesarLopesO](https://github.com/CesarLopesO) on 2026-11-24T01:56:49Z. --- ## Independent Linux validation — Debian 13 I tested this PR on a separate Debian 13 (Trixie) machine. **Environment** - OS: Debian GNU/Linux 13 (Trixie) - rustc: 1.98.1 (48a229cea 2026-09-01) - cargo: 1.98.1 (797e8a9bc 2026-08-05) - Tested commit: `fb59109` **Command** ```sh cargo test --workspace --locked ``` **Result:** 162 passed, 0 failed, 3 ignored. The workspace compiled and all runnable tests completed successfully. The build emitted compiler warnings, including unused/dead-code warnings and an unreachable-expression warning in `crates/victory-hle/src/modules/xgame.rs:94`, but no compilation errors. No game files or game data were used. Thanks for the Linux portability work!
LazyHatGuy commented 2026-11-24 06:55:16 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by LazyHatGuy on 2026-11-24T02:54:31Z.


I have verified #235 on Garuda Linux

Environment

  • Commit: 16704a564b88d7e2b6b5f0e34c7c375c2b25b0c5
  • OS: Garuda Linux x86_64
  • Kernel: Linux 7.3.5-zen1-1-zen
rustc --version
rustc 1.100.0 (0ef1bc386 2026-11-09) (Arch Linux rust 1:1.100.0-1)
rustc --version
rustc 1.100.0 (0ef1bc386 2026-11-09) (Arch Linux rust 1:1.100.0-1)

Results

  • cargo fmt --all -- --check -> Reports format issues
  • cargo-summary test --workspace --locked -> TEST OK total=165 passed=162 failed=0 ignored=3 in 5.6s
  • cargo xtask policy -> asset policy: 151 files ok
  • cargo xtask policy --staged -> asset policy: 0 files ok
<!-- greyfinch-sync:Marvisak/VIctory:comment:7120591108 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/235#issuecomment-7120591108). Originally posted by [LazyHatGuy](https://github.com/LazyHatGuy) on 2026-11-24T02:54:31Z. --- I have verified #235 on Garuda Linux ### Environment - Commit: `16704a564b88d7e2b6b5f0e34c7c375c2b25b0c5` - OS: Garuda Linux x86_64 - Kernel: Linux 7.3.5-zen1-1-zen ```shell rustc --version rustc 1.100.0 (0ef1bc386 2026-11-09) (Arch Linux rust 1:1.100.0-1) ``` ```shell rustc --version rustc 1.100.0 (0ef1bc386 2026-11-09) (Arch Linux rust 1:1.100.0-1) ``` ### Results - `cargo fmt --all -- --check` -> Reports format issues - `cargo-summary test --workspace --locked` -> TEST OK total=165 passed=162 failed=0 ignored=3 in 5.6s - `cargo xtask policy` -> asset policy: 151 files ok - `cargo xtask policy --staged` -> asset policy: 0 files ok
pedrofort commented 2026-11-24 06:55:24 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by pedrofort on 2026-11-24T03:20:43Z.


Independent Apple Silicon validation

Tested on Apple M5, macOS 27.2.1, native ARM64, Rust 1.98.1.

Commit tested: 16704a5.

Check | Result -- | -- Main branch workspace check | FAIL PR workspace check | PASS Workspace build | PASS Workspace tests | 162 passed, 0 failed, 3 ignored Native CLI execution | PASS Empty-directory shader-info | PASS Empty-directory translate | PASS Asset policy | 151 files OK

The resulting executable is a native Mach-O 64-bit ARM64 binary.

This confirms that the portability changes also enable the offline tools and runnable workspace tests on Apple Silicon, without Rosetta, Wine or virtualization.

No game files were used. Title execution and GPU rendering were not tested.

Thanks for the portability work!

<!-- greyfinch-sync:Marvisak/VIctory:comment:7121000647 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/235#issuecomment-7121000647). Originally posted by [pedrofort](https://github.com/pedrofort) on 2026-11-24T03:20:43Z. --- <h2><span>Independent Apple Silicon validation</span></h2><p><span>Tested on Apple M5, macOS 27.2.1, native ARM64, Rust 1.98.1.</span></p><p><span>Commit tested: </span><code><span>16704a5</span></code><span>.</span></p> Check | Result -- | -- Main branch workspace check | FAIL PR workspace check | PASS Workspace build | PASS Workspace tests | 162 passed, 0 failed, 3 ignored Native CLI execution | PASS Empty-directory shader-info | PASS Empty-directory translate | PASS Asset policy | 151 files OK <p><span>The resulting executable is a native Mach-O 64-bit ARM64 binary.</span></p><p><span>This confirms that the portability changes also enable the offline tools and runnable workspace tests on Apple Silicon, without Rosetta, Wine or virtualization.</span></p><p><span>No game files were used. Title execution and GPU rendering were not tested.</span></p><p><span>Thanks for the portability work!</span></p>
0xKaji commented 2026-11-24 15:03:55 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by 0xKaji on 2026-11-24T14:14:52Z.


Found a deadlock + 3 test failures in victory-gpu::queue::host_free_tests when running cargo test --workspace on Linux (CachyOS x86_64, rustc 1.98.1, cargo test --workspace --no-fail-fast, no game data; PR #235 head=5d40ad817c).

Failure output

test queue::host_free_tests::fence_waits_complete_without_blocking_the_queue ... FAILED
test queue::host_free_tests::page_mapping_batches_run_through_the_runtime_mapper ... FAILED
test queue::host_free_tests::present_succeeds_without_copying_to_a_window ... FAILED
test queue::host_free_tests::timestamp_frequency_refuses_null_and_reports_the_rate has been running for over 60 seconds

Note: because device::tests::newer_device_levels_are_the_same_device sorts before queue::host_free_tests::* and mutates process-global state, parallel runs (cargo test) can trigger this depending on thread scheduling (which may explain why other Linux runs passed), whereas sequential execution (cargo test -p victory-gpu -- --test-threads=1) runs device::tests::* before queue::host_free_tests::*.

Root cause

  1. device::tests::newer_device_levels_are_the_same_device (crates/victory-gpu/src/device.rs:461) calls create_as(&LEVEL_IIDS[8]), which flips the process-global atomic device::NEWER (device.rs:153-155) to true.
  2. From that point on, queue::create (crates/victory-gpu/src/queue.rs:57-61) constructs queues with &NEWER_FUNCTIONS, shifting every method at slot >= 14 (0x70+) by +2 slots (+0x10 bytes):
    • signal: 0x70 -> 0x80
    • wait: 0x78 -> 0x88
    • timestamp_frequency: 0x80 -> 0x90
    • copy_page_mappings: 0xe8 -> 0xf8
    • present: 0xf0 -> 0x100
    • signal2_x: 0x100 -> 0x110
  3. queue::tests::queue_signals_complete_at_once already accounts for this with signal_slot(q) (queue.rs:472-480: "Another test may switch layouts while this one runs, so the queue's own table decides"), but queue::host_free_tests hardcodes the pre-newer vtable byte offsets:
    • In timestamp_frequency_refuses_null_and_reports_the_rate (queue.rs:576), slot::<Freq>(q, 0x80) dispatches to queue::signal(q, fence, value) instead of timestamp_frequency. freq(q, ptr::null_mut()) accidentally returns E_INVALIDARG (fence.is_null()), and then freq(q, &mut out) passes &mut out (a stack u64) as fence: This into crate::fence::signal, which dereferences &Fence on stack memory and locks fence.waiters (UB / infinite hang).
    • In the other three host_free_tests, 0x78 / 0xf0 / 0xe8 hit missing table slots (E_NOTIMPL) and 0x100 dispatches to present instead of signal2_x.

Suggested fix

Generalize queue::tests::signal_slot into a shared helper (e.g. slot_for(q: This, old_offset: usize) -> usize) that inspects q's own vtable pointer (table == NEWER_FUNCTIONS.0.as_ptr()) and shifts old_offset >= 0x70 by +0x10 bytes, and use it in queue::host_free_tests (0x80, 0x78, 0x100, 0xf0, 0xe8) — or invoke the queue's Rust handlers directly in host_free_tests.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7134068705 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/235#issuecomment-7134068705). Originally posted by [0xKaji](https://github.com/0xKaji) on 2026-11-24T14:14:52Z. --- Found a deadlock + 3 test failures in `victory-gpu::queue::host_free_tests` when running `cargo test --workspace` on Linux (`CachyOS x86_64`, `rustc 1.98.1`, `cargo test --workspace --no-fail-fast`, no game data; PR #235 `head=5d40ad817c`). ### Failure output ``` test queue::host_free_tests::fence_waits_complete_without_blocking_the_queue ... FAILED test queue::host_free_tests::page_mapping_batches_run_through_the_runtime_mapper ... FAILED test queue::host_free_tests::present_succeeds_without_copying_to_a_window ... FAILED test queue::host_free_tests::timestamp_frequency_refuses_null_and_reports_the_rate has been running for over 60 seconds ``` Note: because `device::tests::newer_device_levels_are_the_same_device` sorts before `queue::host_free_tests::*` and mutates process-global state, parallel runs (`cargo test`) can trigger this depending on thread scheduling (which may explain why other Linux runs passed), whereas sequential execution (`cargo test -p victory-gpu -- --test-threads=1`) runs `device::tests::*` before `queue::host_free_tests::*`. ### Root cause 1. `device::tests::newer_device_levels_are_the_same_device` (`crates/victory-gpu/src/device.rs:461`) calls `create_as(&LEVEL_IIDS[8])`, which flips the process-global atomic `device::NEWER` (`device.rs:153-155`) to `true`. 2. From that point on, `queue::create` (`crates/victory-gpu/src/queue.rs:57-61`) constructs queues with `&NEWER_FUNCTIONS`, shifting every method at `slot >= 14` (`0x70+`) by `+2` slots (`+0x10` bytes): - `signal`: `0x70 -> 0x80` - `wait`: `0x78 -> 0x88` - `timestamp_frequency`: `0x80 -> 0x90` - `copy_page_mappings`: `0xe8 -> 0xf8` - `present`: `0xf0 -> 0x100` - `signal2_x`: `0x100 -> 0x110` 3. `queue::tests::queue_signals_complete_at_once` already accounts for this with `signal_slot(q)` (`queue.rs:472-480`: *"Another test may switch layouts while this one runs, so the queue's own table decides"*), but `queue::host_free_tests` hardcodes the pre-`newer` vtable byte offsets: - In `timestamp_frequency_refuses_null_and_reports_the_rate` (`queue.rs:576`), `slot::<Freq>(q, 0x80)` dispatches to **`queue::signal(q, fence, value)`** instead of `timestamp_frequency`. `freq(q, ptr::null_mut())` accidentally returns `E_INVALIDARG` (`fence.is_null()`), and then `freq(q, &mut out)` passes `&mut out` (a stack `u64`) as `fence: This` into `crate::fence::signal`, which dereferences `&Fence` on stack memory and locks `fence.waiters` (UB / infinite hang). - In the other three `host_free_tests`, `0x78` / `0xf0` / `0xe8` hit missing table slots (`E_NOTIMPL`) and `0x100` dispatches to `present` instead of `signal2_x`. ### Suggested fix Generalize `queue::tests::signal_slot` into a shared helper (e.g. `slot_for(q: This, old_offset: usize) -> usize`) that inspects `q`'s own vtable pointer (`table == NEWER_FUNCTIONS.0.as_ptr()`) and shifts `old_offset >= 0x70` by `+0x10` bytes, and use it in `queue::host_free_tests` (`0x80`, `0x78`, `0x100`, `0xf0`, `0xe8`) — or invoke the queue's Rust handlers directly in `host_free_tests`.
elgreams commented 2026-11-24 16:05:02 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by elgreams on 2026-11-24T15:07:51Z.


Tested 5d40ad817 on Linux Mint 22.1, rustc 1.98.1: the workspace builds, and every crate passes except victory-gpu. There, 3 of the new queue::host_free_tests fail and timestamp_frequency_refuses_null_and_reports_the_rate hangs, but only when they run after device::tests::newer_device_levels_are_the_same_device. Each one passes alone.

That test creates the device as ID3D12Device11, which sets the global NEWER flag (device.rs:154). Queues created after it use the newer layout, so the fixed offsets in host_free_tests (0x78, 0x80, 0x100…) land on different methods. Going through newer_slot / crate::device::newer(), or not sharing the flag between tests, should fix it. Repro and the other Linux PRs' results: https://github.com/Marvisak/VIctory/issues/90#issuecomment-7135504524

<!-- greyfinch-sync:Marvisak/VIctory:comment:7135507787 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/235#issuecomment-7135507787). Originally posted by [elgreams](https://github.com/elgreams) on 2026-11-24T15:07:51Z. --- Tested `5d40ad817` on Linux Mint 22.1, rustc 1.98.1: the workspace builds, and every crate passes except `victory-gpu`. There, 3 of the new `queue::host_free_tests` fail and `timestamp_frequency_refuses_null_and_reports_the_rate` hangs, but only when they run after `device::tests::newer_device_levels_are_the_same_device`. Each one passes alone. That test creates the device as `ID3D12Device11`, which sets the global `NEWER` flag (`device.rs:154`). Queues created after it use the newer layout, so the fixed offsets in `host_free_tests` (0x78, 0x80, 0x100…) land on different methods. Going through `newer_slot` / `crate::device::newer()`, or not sharing the flag between tests, should fix it. Repro and the other Linux PRs' results: https://github.com/Marvisak/VIctory/issues/90#issuecomment-7135504524
ramenbellic commented 2026-11-24 18:05:52 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by ramenbellic on 2026-11-24T17:38:16Z.


Tested 5d40ad8 on Bazzite (kernel 7.3.4, Ryzen 5 5600X, rustc 1.98.1), no game data.

  • cargo check --workspace --all-targets --all-features --locked: passes, 0 warnings.
  • cargo test --workspace --locked --no-fail-fast: hangs in 3 of 3 runs. Everything except victory-gpu passes (226 passed, 0 failed, 5 ignored).
  • cargo test -p victory-gpu: hangs in 6 of 6 runs here (5 parallel, 1 with --test-threads=1), so on this machine it is not scheduling-dependent. 41 pass, the same three queue::host_free_tests fail as reported above, and timestamp_frequency_refuses_null_and_reports_the_rate never returns.
  • With --skip newer_device_levels_are_the_same_device: 44 passed, 0 failed, parallel and single-threaded. That supports @elgreams' reading that the global NEWER flag set by that test is the cause.

The new linux CI job runs cargo test --workspace --locked, so it would hang on this head as it stands.

Not tested: Windows, Wine, running a title. AI use: Claude Code (Claude Fable 5.2) ran the commands and drafted this; I checked the results.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7139486801 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/235#issuecomment-7139486801). Originally posted by [ramenbellic](https://github.com/ramenbellic) on 2026-11-24T17:38:16Z. --- Tested `5d40ad8` on Bazzite (kernel 7.3.4, Ryzen 5 5600X, rustc 1.98.1), no game data. - `cargo check --workspace --all-targets --all-features --locked`: passes, 0 warnings. - `cargo test --workspace --locked --no-fail-fast`: hangs in 3 of 3 runs. Everything except `victory-gpu` passes (226 passed, 0 failed, 5 ignored). - `cargo test -p victory-gpu`: hangs in 6 of 6 runs here (5 parallel, 1 with `--test-threads=1`), so on this machine it is not scheduling-dependent. 41 pass, the same three `queue::host_free_tests` fail as reported above, and `timestamp_frequency_refuses_null_and_reports_the_rate` never returns. - With `--skip newer_device_levels_are_the_same_device`: 44 passed, 0 failed, parallel and single-threaded. That supports @elgreams' reading that the global `NEWER` flag set by that test is the cause. The new `linux` CI job runs `cargo test --workspace --locked`, so it would hang on this head as it stands. Not tested: Windows, Wine, running a title. AI use: Claude Code (Claude Fable 5.2) ran the commands and drafted this; I checked the results.
elgreams commented 2026-11-24 19:04:25 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by elgreams on 2026-11-24T18:46:12Z.


@SkippySteve I opened SkippySteve/VIctory#2 against this branch with a fix for the order-dependent hang: the host_free_tests now find each method in the queue's own table, like tests::signal_slot does. On Linux, victory-gpu passes 45/45 in 15 parallel runs.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7141126414 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/235#issuecomment-7141126414). Originally posted by [elgreams](https://github.com/elgreams) on 2026-11-24T18:46:12Z. --- @SkippySteve I opened SkippySteve/VIctory#2 against this branch with a fix for the order-dependent hang: the `host_free_tests` now find each method in the queue's own table, like `tests::signal_slot` does. On Linux, `victory-gpu` passes 45/45 in 15 parallel runs.
upstream-sync closed this pull request 2026-11-25 00:05:21 +00:00
Marvisak commented 2026-11-25 00:06:56 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T00:01:01Z.


Automated triage for the maintainers. Closing because another open pull request covers the same change.

See #523. Linux build gating plus 2,000 lines of Linux-only test modules and a Linux CI job; #523 (clean, 100 lines) gates the same paths without them.

If this is mistaken, reply here with what was missed (or push a change and say so) and it will be looked at again. Thank you for the contribution.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7148043453 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/235#issuecomment-7148043453). Originally posted by [Marvisak](https://github.com/Marvisak) on 2026-11-25T00:01:01Z. --- Automated triage for the maintainers. Closing because another open pull request covers the same change. See #523. Linux build gating plus 2,000 lines of Linux-only test modules and a Linux CI job; #523 (clean, 100 lines) gates the same paths without them. If this is mistaken, reply here with what was missed (or push a change and say so) and it will be looked at again. Thank you for the contribution.

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
Marvisak/VIctory!235
No description provided.