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

Closed
github-bot wants to merge 15 commits from github-bot/gh-3687 into main AGit
Owner

@⁠davemathews12 on GitHub · 2026-11-30 03:54 UTC · original
davemathews12:build/victory-gpu-non-windows → main · +363 −11 · 28 files · 15 commits · closed without merging

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: #
**@⁠davemathews12** on GitHub · 2026-11-30 03:54 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3687) `davemathews12:build/victory-gpu-non-windows` → `main` · +363 −11 · 28 files · 15 commits · closed without merging 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: #
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.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01W67fFrGqDDmsv2nC1VE8mS
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-30 03:59:55 +00:00
Author
Owner

@⁠davemathews12 on GitHub · 2026-11-30 03:59 UTC · original

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)

**@⁠davemathews12** on GitHub · 2026-11-30 03:59 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3687#issuecomment-7268368907) 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)
github-bot force-pushed github-bot/gh-3687 from a0c86ebade to 5a32381ef0 2026-11-30 04:05:39 +00:00 Compare
The re-export line is now untouched: off Windows a one-function `watch`
module stands in, instead of a cfg on that line and a second function.
The open CI fixes (#3530, #3385, #3560, #2682) move that same line above
the test module, so editing it made this branch conflict with all of
them; now it merges cleanly with each, and with #3501.

Checked again: Linux, every target builds and `cargo test --workspace`
gives 903 passed and main's 4 failures; Windows target, clippy
(default and --all-features) gives main's diagnostics line for line.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Author
Owner

@⁠edge2labs on GitHub · 2026-11-30 04:59 UTC · original

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

**@⁠edge2labs** on GitHub · 2026-11-30 04:59 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3687#issuecomment-7269254805) 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
Author
Owner

@⁠davemathews12 on GitHub · 2026-11-30 05:07 UTC · original

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!

**@⁠davemathews12** on GitHub · 2026-11-30 05:07 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3687#issuecomment-7269375122) 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!
Author
Owner

@⁠davemathews12 on GitHub · 2026-11-30 05:56 UTC · original

@⁠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!

**@⁠davemathews12** on GitHub · 2026-11-30 05:56 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3687#issuecomment-7270149425) @⁠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!
Merging main (519 commits) brought three things that only build on
Windows into code every target compiles:
- `descriptor::shape_cache` reads its switch with `asked_for!`, which is
  Windows-only: off Windows a stand-in answers false, the switch's
  default.
- `kernel::spread_mask` calls `remap_mask`, which builds for Windows and
  tests only: it does the same.
- `resource`'s `a_small_copy_keeps_only_the_small_levels` uses the
  Windows-only `small_base`/`base_level`: a Windows test.

Linux: every target builds; `cargo test --workspace` 985 passed, 1
failed (`repository_passes_policy`, which fails on main too, on
`victory-shader/src/native.rs`). On Windows every change is a cfg that
is true there, so the code is main's; the msvc clippy check could not
run here, as main's new mimalloc dependency needs the Windows SDK.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
# Conflicts:
#	apps/victory/src/play.rs
#	crates/victory-hle/src/modules/xmem.rs
Author
Owner

@⁠trustno1-coder on GitHub · 2026-12-01 18:49 UTC · original

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.

**@⁠trustno1-coder** on GitHub · 2026-12-01 18:49 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3687#issuecomment-7321632512) 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.
github-bot closed this pull request 2026-12-01 18:58:02 +00:00

Pull request closed

This discussion has been locked. Commenting is limited to contributors.
No reviewers
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.

Dependencies

No dependencies set

Reference
github/trustno1-coder--VIctory-NVIDIA!3687
No description provided.