Build and test the workspace off Windows (and check it in CI) #3687

Closed
davemathews12 wants to merge 15 commits from upstream-pr/3687 into main
davemathews12 commented 2026-11-30 03:54:22 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by davemathews12 on 2026-11-30T03:54:22Z.


AGENTS.md said nothing fails to compile off Windows; in fact victory-gpu failed with 91 errors on Linux, and behind it victory-hle (33) and the victory app, so no test of those crates, nor of the app, had ever run off Windows. Modules added since were not given the #[cfg(windows)] the others carry.

What changes, by the crate's own patterns (cfg(windows) for Windows code and its tests, cfg(any(windows, test)) for the pure logic that Windows code calls, a cfg(not(windows)) stand-in where a portable caller needs one):

  • victory-gpu: ambient and mesh_rest (D3D12) are Windows-only; memguard and compilemem build for tests, without their memory queries and the compile gate's runtime; save_share keeps building everywhere with a UTC clock off Windows (civil, tested against Python's datetime). room_line and room_percent build for tests, so the first-upload decision tests run everywhere. Stand-ins: log_defrag_counters, set_range_lock, ValueWait::holds. The four examples print that they need Windows instead of failing to build.
  • victory-hle: the thread-priority chain, the Win32 dialogs, the allocator hooks and the frame-generation movie notes are Windows-only; image_watch reads and writes nothing off Windows.
  • victory: translate runs off Windows, with --validate and the pipeline checks saying they need Windows (empty-enum stand-ins: no value can be made, so nothing is faked); build.rs writes the D3D12 exports for Windows targets only (a Linux linker refused the .def). The load_mods() gate is the same line as open PR #2581.
  • Tests of Windows behaviour (events, process memory, module handles, PE parsing of the test binary itself) are #[cfg(windows)], as #1108 did for the loader's PE-fixture tests.
  • CI: a linux job runs cargo check --workspace --all-targets and cargo test --workspace. AGENTS.md says what holds now.

Checked:

  • Linux (x86_64-unknown-linux-gnu): every target builds; cargo test --workspace: 903 passed, 4 failed, 13 ignored. The 4 fail on Windows too and are main's: the three bcpack oracle_parity tests (open PRs #3263 and others) and repository_passes_policy on frame_users.rs.
  • Windows (x86_64-pc-windows-msvc, cargo clippy --workspace --all-targets, default and --all-features): the same diagnostics as main, line for line (35 and 40). Every change is a cfg that is true on Windows or code compiled only elsewhere. Not built or run on Windows itself: no linker or Windows host here.

Fixes #

What it changes

How it was tested

  • GPU and profile (Series X or S, resolution, DLSS, frame generation, ray tracing):
  • Before:
  • After:
  • For shader changes, the wave sizes tested (32 and/or 64 lanes):
  • cargo test passed for the crates it touches: yes / no

Checked for overlap

  • I searched the open pull requests for the same issue and for the files this touches. Related: #
<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:issue:5558672105 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3687). Originally posted by [davemathews12](https://github.com/davemathews12) on 2026-11-30T03:54:22Z. --- AGENTS.md said nothing fails to compile off Windows; in fact `victory-gpu` failed with 91 errors on Linux, and behind it `victory-hle` (33) and the `victory` app, so no test of those crates, nor of the app, had ever run off Windows. Modules added since were not given the `#[cfg(windows)]` the others carry. What changes, by the crate's own patterns (`cfg(windows)` for Windows code and its tests, `cfg(any(windows, test))` for the pure logic that Windows code calls, a `cfg(not(windows))` stand-in where a portable caller needs one): - victory-gpu: `ambient` and `mesh_rest` (D3D12) are Windows-only; `memguard` and `compilemem` build for tests, without their memory queries and the compile gate's runtime; `save_share` keeps building everywhere with a UTC clock off Windows (`civil`, tested against Python's datetime). `room_line` and `room_percent` build for tests, so the first-upload decision tests run everywhere. Stand-ins: `log_defrag_counters`, `set_range_lock`, `ValueWait::holds`. The four examples print that they need Windows instead of failing to build. - victory-hle: the thread-priority chain, the Win32 dialogs, the allocator hooks and the frame-generation movie notes are Windows-only; `image_watch` reads and writes nothing off Windows. - victory: `translate` runs off Windows, with `--validate` and the pipeline checks saying they need Windows (empty-enum stand-ins: no value can be made, so nothing is faked); `build.rs` writes the D3D12 exports for Windows targets only (a Linux linker refused the .def). The `load_mods()` gate is the same line as open PR #2581. - Tests of Windows behaviour (events, process memory, module handles, PE parsing of the test binary itself) are `#[cfg(windows)]`, as #1108 did for the loader's PE-fixture tests. - CI: a `linux` job runs `cargo check --workspace --all-targets` and `cargo test --workspace`. AGENTS.md says what holds now. Checked: - Linux (x86_64-unknown-linux-gnu): every target builds; `cargo test --workspace`: 903 passed, 4 failed, 13 ignored. The 4 fail on Windows too and are main's: the three bcpack oracle_parity tests (open PRs #3263 and others) and repository_passes_policy on frame_users.rs. - Windows (x86_64-pc-windows-msvc, cargo clippy --workspace --all-targets, default and --all-features): the same diagnostics as main, line for line (35 and 40). Every change is a cfg that is true on Windows or code compiled only elsewhere. Not built or run on Windows itself: no linker or Windows host here. <!-- Thanks for the pull request. Please label it (pr-fix, pr-feature, pr-performance, pr-diagnostics, pr-refactor, pr-docs or pr-tests, plus the area labels), or put the label in the title, like [pr-fix]. --> Fixes # ## What it changes <!-- What was wrong, and what this does about it. --> ## How it was tested - GPU and profile (Series X or S, resolution, DLSS, frame generation, ray tracing): - Before: - After: - For shader changes, the wave sizes tested (32 and/or 64 lanes): - `cargo test` passed for the crates it touches: yes / no ## Checked for overlap - [ ] I searched the open pull requests for the same issue and for the files this touches. Related: #
davemathews12 commented 2026-11-30 03:59:14 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by davemathews12 on 2026-11-30T03:59:14Z.


What it changes

AGENTS.md said nothing fails to compile off Windows. That was not true. On Linux, victory-gpu failed with 91 errors, and behind it victory-hle (33 errors) and the victory app also failed. So none of the tests of those crates, or of the app, had ever run off Windows. Modules added recently (ambient, mesh_rest, memguard, compilemem, save_share, …) never got the #[cfg(windows)] gate the others carry.

This PR fixes that using the crate's existing patterns:

  • cfg(windows) for Windows code and its tests.
  • cfg(any(windows, test)) for pure logic that Windows code calls, so its tests run everywhere.
  • A cfg(not(windows)) stand-in where a portable caller needs one.

victory-gpu

  • ambient and mesh_rest (D3D12) are now Windows-only.
  • memguard and compilemem are built for tests, without their memory queries and without the compile gate's runtime.
  • save_share still builds everywhere. Off Windows it uses a UTC clock (civil), tested against dates from Python's datetime.
  • room_line and room_percent are built for tests, so the first-upload decision tests now run on every platform.
  • New stand-ins: log_defrag_counters, set_range_lock and ValueWait::holds.
  • The four examples print "runs on Windows only" instead of failing to build.

victory-hle

  • These are now Windows-only: the thread-priority chain, the Win32 dialogs, the allocator hooks and the frame-generation movie notes.
  • Off Windows, image_watch reads and writes nothing.

victory (app)

  • victory translate now runs off Windows. --validate and the pipeline checks report that they need Windows. Their stand-ins are empty enums, so no value can exist and nothing is faked.
  • build.rs writes the D3D12 exports only for Windows targets. A Linux linker refused the .def file.
  • Overlap: the play::load_mods() gate is the same line as open PR #2581.

Tests and CI

  • Tests of Windows behaviour (events, process memory, module handles, PE parsing of the test binary itself) are now #[cfg(windows)], as #1108 did for the loader's PE-fixture tests.
  • A new linux CI job runs cargo check --workspace --all-targets and cargo test --workspace.
  • AGENTS.md now describes what actually holds.

This does not claim the title runs on Linux. cfg(not(windows)) paths are stubs, as before.

How it was tested

  • GPU and profile: n/a. This is a build and portability change with no runtime change on Windows.
  • Linux (x86_64-unknown-linux-gnu, Rust 1.98.1 from rust-toolchain.toml):
    • cargo check --workspace --all-targets --locked is clean.
    • cargo test --workspace --locked: 903 passed, 4 failed, 13 ignored. Before this PR, no test of victory-gpu, victory-hle or victory could build on Linux.
  • The 4 failures are already failing on main on every platform, not caused by this PR:
    • The three bcpack::tests::oracle_parity_* tests, after f9de61c5 left the in-test oracle on the old BC7 dictionary layout. Fixed in open #3263 and others.
    • xtask::policy::tests::repository_passes_policy, which trips on the hook-offset list in heap_sites/frame_users.rs.
  • Windows (x86_64-pc-windows-msvc, cargo clippy --workspace --all-targets, default and --all-features, cross-checked from Linux): the diagnostics are line for line the same as main (35 and 40). Every change is either a cfg that is true on Windows or code compiled only elsewhere.
    • I did not build, link or run this on a Windows machine: I had no Windows host or MSVC linker. The new CI job and the existing Windows job will show it.
  • For shader changes, the wave sizes tested: n/a. No translator code changed; only apps/victory/src/translate.rs gained the off-Windows stand-ins.
  • cargo test passed for the crates it touches: yes, except the 4 failures on main listed above.

Checked for overlap

  • I searched the open pull requests for the same issue and for the files this touches. Related: #2581 (gates the same play::load_mods() line; either can merge first). #1108 (merged) gated the loader's PE-fixture tests the same way. No open PR makes victory-gpu/victory-hle/victory build off Windows or adds a Linux CI job (searched: linux, non-windows, "cfg(windows)", ubuntu, portable, cross-platform, ambient, mesh_rest).

🤖 Generated with clause (I'm ready to burn tokens into this amazing project)

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7268368907 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3687#issuecomment-7268368907). Originally posted by [davemathews12](https://github.com/davemathews12) on 2026-11-30T03:59:14Z. --- What it changes `AGENTS.md` said nothing fails to compile off Windows. That was not true. On Linux, `victory-gpu` failed with 91 errors, and behind it `victory-hle` (33 errors) and the `victory` app also failed. So none of the tests of those crates, or of the app, had ever run off Windows. Modules added recently (`ambient`, `mesh_rest`, `memguard`, `compilemem`, `save_share`, …) never got the `#[cfg(windows)]` gate the others carry. This PR fixes that using the crate's existing patterns: - `cfg(windows)` for Windows code and its tests. - `cfg(any(windows, test))` for pure logic that Windows code calls, so its tests run everywhere. - A `cfg(not(windows))` stand-in where a portable caller needs one. **victory-gpu** - `ambient` and `mesh_rest` (D3D12) are now Windows-only. - `memguard` and `compilemem` are built for tests, without their memory queries and without the compile gate's runtime. - `save_share` still builds everywhere. Off Windows it uses a UTC clock (`civil`), tested against dates from Python's `datetime`. - `room_line` and `room_percent` are built for tests, so the first-upload decision tests now run on every platform. - New stand-ins: `log_defrag_counters`, `set_range_lock` and `ValueWait::holds`. - The four examples print "runs on Windows only" instead of failing to build. **victory-hle** - These are now Windows-only: the thread-priority chain, the Win32 dialogs, the allocator hooks and the frame-generation movie notes. - Off Windows, `image_watch` reads and writes nothing. **victory (app)** - `victory translate` now runs off Windows. `--validate` and the pipeline checks report that they need Windows. Their stand-ins are empty enums, so no value can exist and nothing is faked. - `build.rs` writes the D3D12 exports only for Windows targets. A Linux linker refused the `.def` file. - Overlap: the `play::load_mods()` gate is the same line as open PR #2581. **Tests and CI** - Tests of Windows behaviour (events, process memory, module handles, PE parsing of the test binary itself) are now `#[cfg(windows)]`, as #1108 did for the loader's PE-fixture tests. - A new `linux` CI job runs `cargo check --workspace --all-targets` and `cargo test --workspace`. - `AGENTS.md` now describes what actually holds. This does not claim the title runs on Linux. `cfg(not(windows))` paths are stubs, as before. ## How it was tested - GPU and profile: n/a. This is a build and portability change with no runtime change on Windows. - **Linux** (`x86_64-unknown-linux-gnu`, Rust 1.98.1 from `rust-toolchain.toml`): - `cargo check --workspace --all-targets --locked` is clean. - `cargo test --workspace --locked`: 903 passed, 4 failed, 13 ignored. Before this PR, no test of `victory-gpu`, `victory-hle` or `victory` could build on Linux. - **The 4 failures are already failing on `main` on every platform, not caused by this PR:** - The three `bcpack::tests::oracle_parity_*` tests, after f9de61c5 left the in-test oracle on the old BC7 dictionary layout. Fixed in open #3263 and others. - `xtask::policy::tests::repository_passes_policy`, which trips on the hook-offset list in `heap_sites/frame_users.rs`. - **Windows** (`x86_64-pc-windows-msvc`, `cargo clippy --workspace --all-targets`, default and `--all-features`, cross-checked from Linux): the diagnostics are **line for line the same as `main`** (35 and 40). Every change is either a `cfg` that is true on Windows or code compiled only elsewhere. - I did not build, link or run this on a Windows machine: I had no Windows host or MSVC linker. The new CI job and the existing Windows job will show it. - For shader changes, the wave sizes tested: n/a. No translator code changed; only `apps/victory/src/translate.rs` gained the off-Windows stand-ins. - `cargo test` passed for the crates it touches: yes, except the 4 failures on `main` listed above. ## Checked for overlap - [x] I searched the open pull requests for the same issue and for the files this touches. Related: #2581 (gates the same `play::load_mods()` line; either can merge first). #1108 (merged) gated the loader's PE-fixture tests the same way. No open PR makes `victory-gpu`/`victory-hle`/`victory` build off Windows or adds a Linux CI job (searched: linux, non-windows, "cfg(windows)", ubuntu, portable, cross-platform, ambient, mesh_rest). 🤖 Generated with clause (I'm ready to burn tokens into this amazing project)
edge2labs commented 2026-11-30 04:59:13 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by edge2labs on 2026-11-30T04:59:13Z.


Hi @davemathews12,

Thank you for referencing my BC7 fix in PR #3263.

I noticed that you haven’t been able to build and test your portability changes on Windows. I have a Windows machine with an i9-14900K, RTX 4080 Super and 64 GB of RAM, and I’d be happy to help validate your PR.

I’m also working on performance optimizations in PRs #3561 and #3694.

Your Linux portability improvements could be very useful for our future research. If there are specific Windows tests you would like me to run, please let me know.

— Edge2Labs

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7269254805 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3687#issuecomment-7269254805). Originally posted by [edge2labs](https://github.com/edge2labs) on 2026-11-30T04:59:13Z. --- Hi @davemathews12, Thank you for referencing my BC7 fix in PR #3263. I noticed that you haven’t been able to build and test your portability changes on Windows. I have a Windows machine with an i9-14900K, RTX 4080 Super and 64 GB of RAM, and I’d be happy to help validate your PR. I’m also working on performance optimizations in PRs #3561 and #3694. Your Linux portability improvements could be very useful for our future research. If there are specific Windows tests you would like me to run, please let me know. — Edge2Labs
davemathews12 commented 2026-11-30 05:07:26 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by davemathews12 on 2026-11-30T05:07:26Z.


Hi!. Thanks @edge2labs, that would really help. Windows is the one thing I couldn't check: I only cross-checked clippy for the msvc target from Linux. Its warnings matched main line for line, but nothing was built, linked or run on Windows.

If you have time, three checks on the PR branch (PowerShell, in your clone):

git fetch origin pull/3687/head:pr-3687
git checkout pr-3687
cargo test --workspace --locked
cargo build --release --locked -p victory
  1. Tests: the only expected failures are the four already failing on main: the three bcpack::tests::oracle_parity_* (your #3263 fixes those) and repository_passes_policy. Anything else failing would be my bug.
  2. Build: target\release\victory.exe should build and link. The PR touches apps/victory/build.rs; on Windows it should still export D3D12SDKVersion/D3D12SDKPath as before.
  3. A quick start of the game with that exe, just to the first frames, to confirm it starts as it does on main. On Windows every change in the PR should compile to the same code as before, so nothing should look different.

If any of it fails, the output is all I need. Thanks, and good luck with #3561 and #3694!

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7269375122 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3687#issuecomment-7269375122). Originally posted by [davemathews12](https://github.com/davemathews12) on 2026-11-30T05:07:26Z. --- Hi!. Thanks @edge2labs, that would really help. Windows is the one thing I couldn't check: I only cross-checked clippy for the msvc target from Linux. Its warnings matched `main` line for line, but nothing was built, linked or run on Windows. If you have time, three checks on the PR branch (PowerShell, in your clone): ```powershell git fetch origin pull/3687/head:pr-3687 git checkout pr-3687 cargo test --workspace --locked cargo build --release --locked -p victory ``` 1. **Tests:** the only expected failures are the four already failing on `main`: the three `bcpack::tests::oracle_parity_*` (your #3263 fixes those) and `repository_passes_policy`. Anything else failing would be my bug. 2. **Build:** `target\release\victory.exe` should build and link. The PR touches `apps/victory/build.rs`; on Windows it should still export `D3D12SDKVersion`/`D3D12SDKPath` as before. 3. **A quick start of the game** with that exe, just to the first frames, to confirm it starts as it does on `main`. On Windows every change in the PR should compile to the same code as before, so nothing should look different. If any of it fails, the output is all I need. Thanks, and good luck with #3561 and #3694!
davemathews12 commented 2026-11-30 05:56:26 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by davemathews12 on 2026-11-30T05:56:26Z.


@dyshay since you're testing PRs on a 4090 in janus-prs: could #3687 go in too? It's the one change here I couldn't build or run on Windows. It gates Windows-only code with cfg(windows) so the workspace builds and tests on Linux. On the msvc target its clippy diagnostics match main line for line, so on Windows it should compile to the same code. A Windows build plus a short start of the game would confirm that. It merges cleanly with #3530 and #3501. Thanks!

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7270149425 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3687#issuecomment-7270149425). Originally posted by [davemathews12](https://github.com/davemathews12) on 2026-11-30T05:56:26Z. --- @dyshay since you're testing PRs on a 4090 in `janus-prs`: could #3687 go in too? It's the one change here I couldn't build or run on Windows. It gates Windows-only code with `cfg(windows)` so the workspace builds and tests on Linux. On the msvc target its clippy diagnostics match `main` line for line, so on Windows it should compile to the same code. A Windows build plus a short start of the game would confirm that. It merges cleanly with #3530 and #3501. Thanks!
trustno1-coder commented 2026-12-01 18:49:55 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by trustno1-coder on 2026-12-01T18:49:55Z.


Closing this as part of moving main to the texture and video-memory rework (v2026.12.01.01-test). A lot of the code changed, and this pull request no longer applies cleanly to it; it would need to be rewritten against the new main rather than rebased. Thank you for the work. If the change is still needed, please open a new pull request based on the current main.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7321632512 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3687#issuecomment-7321632512). Originally posted by [trustno1-coder](https://github.com/trustno1-coder) on 2026-12-01T18:49:55Z. --- Closing this as part of moving main to the texture and video-memory rework (v2026.12.01.01-test). A lot of the code changed, and this pull request no longer applies cleanly to it; it would need to be rewritten against the new main rather than rebased. Thank you for the work. If the change is still needed, please open a new pull request based on the current main.

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
trustno1-coder/VIctory-NVIDIA!3687
No description provided.