Build and test the portable crates on non-Windows hosts #2992

Open
github-bot wants to merge 1 commit from github-bot/gh-2992 into main AGit
Owner

@⁠0xkn0wh3r3 on GitHub · 2026-11-26 02:36 UTC · original
0xkn0wh3r3:macos-portable-build → main · +33 −4 · 10 files · 1 commits · open

The library crates and their tests don't compile on macOS or Linux, because some Windows-only code is referenced from places that aren't behind cfg(windows). This adds the missing gates so the portable parts of the workspace (shader translator, formats, pipeline, PE parsing, most HLE and GPU logic) can be built and tested on any host. Nothing changes on Windows.

Changes

  • victory-shader: three lowering tests call the DXIL validator without the #[cfg(windows)] that every other call site has.
  • victory-gpu: fallback_samplers and view_format are gated like the host module they use. IDLE_MS and IDLE_FRAMES are plain constants, so their gate is removed; the eviction logic (choose) and its test then build everywhere.
  • victory-hle: the xmem allocator hooks in d3d12x and the Win32 text-entry dialog in xgameui are Windows-only. Elsewhere an allocator refusal is logged as a warning and the text entry counts as cancelled.
  • Tests gated to Windows (15): those that need the host D3D12 device, the Windows file layer or Windows module paths, or that parse their own test executable as a PE image (it's Mach-O or ELF elsewhere).

The victory app is still Windows-only: translate and prebuild call the shader cache and pipeline library directly. Gating those can be a separate change.

Testing

  • macOS (aarch64): cargo test --workspace --exclude victory passes, with 446 passed, 0 failed, 9 ignored. Before this change, victory-gpu, victory-hle and victory-shader's tests didn't compile.
  • cargo check --workspace --all-targets --target x86_64-pc-windows-msvc passes (type-check only; I haven't run the Windows tests).
**@⁠0xkn0wh3r3** on GitHub · 2026-11-26 02:36 UTC · [original](https://github.com/Marvisak/VIctory/pull/2992) `0xkn0wh3r3:macos-portable-build` → `main` · +33 −4 · 10 files · 1 commits · open The library crates and their tests don't compile on macOS or Linux, because some Windows-only code is referenced from places that aren't behind `cfg(windows)`. This adds the missing gates so the portable parts of the workspace (shader translator, formats, pipeline, PE parsing, most HLE and GPU logic) can be built and tested on any host. Nothing changes on Windows. ## Changes - **victory-shader:** three lowering tests call the DXIL validator without the `#[cfg(windows)]` that every other call site has. - **victory-gpu:** `fallback_samplers` and `view_format` are gated like the `host` module they use. `IDLE_MS` and `IDLE_FRAMES` are plain constants, so their gate is removed; the eviction logic (`choose`) and its test then build everywhere. - **victory-hle:** the `xmem` allocator hooks in `d3d12x` and the Win32 text-entry dialog in `xgameui` are Windows-only. Elsewhere an allocator refusal is logged as a warning and the text entry counts as cancelled. - **Tests gated to Windows** (15): those that need the host D3D12 device, the Windows file layer or Windows module paths, or that parse their own test executable as a PE image (it's Mach-O or ELF elsewhere). The `victory` app is still Windows-only: `translate` and `prebuild` call the shader cache and pipeline library directly. Gating those can be a separate change. ## Testing - macOS (aarch64): `cargo test --workspace --exclude victory` passes, with 446 passed, 0 failed, 9 ignored. Before this change, `victory-gpu`, `victory-hle` and `victory-shader`'s tests didn't compile. - `cargo check --workspace --all-targets --target x86_64-pc-windows-msvc` passes (type-check only; I haven't run the Windows tests).
Some code that only exists on Windows was referenced from places that are
not gated, so the workspace's library crates and their tests did not
compile on macOS or Linux. Windows builds are unchanged.

- victory-shader: three lowering tests call the DXIL validator without
  the cfg(windows) every other call site has.
- victory-gpu: fallback_samplers and view_format follow the Windows-only
  host module; IDLE_MS and IDLE_FRAMES lose their gate so the portable
  eviction logic (choose) and its test build.
- victory-hle: the xmem allocator hooks and the Win32 text-entry dialog
  are Windows-only; elsewhere an allocator refusal is logged and the text
  entry is cancelled.
- Tests that need the host GPU, the Windows file layer, Windows module
  paths, or read their own executable as a PE image are gated to Windows.

cargo test --workspace --exclude victory now passes on macOS (446 passed),
and cargo check --workspace --all-targets for x86_64-pc-windows-msvc is
unchanged.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 05:19:35 +00:00
Author
Owner

@⁠futurepro62 on GitHub · 2026-11-26 04:12 UTC · original

Full-suite run on NVIDIA, since this PR has no test report yet. Tested exact head b252135 (on its base 63bcca4).

Tested

  • NVIDIA GeForce RTX 5070 Ti 16 GB (Blackwell, 32-lane waves only, mesh shaders), driver 621.40, Ryzen 7 9800X3D, Windows 11 Home 26300, Rust 1.98.1 MSVC (pinned), dxil.dll from Windows SDK 10.0.26100 (the loader's default), debug.
  • cargo build --workspace --locked, then cargo test --workspace --locked --no-fail-fast -- --test-threads=4 --skip emit::memory_tests::heap_direct_texture_reads_mark_their_heap_index --skip descriptor::host::tests::dynamic_slots_are_held_until_released --skip memory::tests::lists_share_a_table_and_copies_keep_their_views --skip emit::stride_tests::a_heap_buffer_read_by_element_takes_the_views_stride --skip emit::stride_tests::a_heap_buffer_read_where_no_buffer_view_is_reads_zeros --skip emit::synthetic_tests::gathers_at_a_level_match_the_hardware: 866 passed, 0 failed, 10 ignored.
  • No new #[test] functions in the diff.
  • --skip leaves out tests that fail on main 63bcca4 on this card too, not because of this PR: heap_direct_texture_reads_mark_their_heap_index ends the victory-shader test process with 0xc0000005 (#2571), so without the skip the rest of that crate never reports; dynamic_slots_are_held_until_released, lists_share_a_table_and_copies_keep_their_views and the two stride_tests hit the 1,000,000-view heap cap of NVIDIA drivers (#1835, #2317); gathers_at_a_level_match_the_hardware fails on lane 0 (#1744).

Not tested

  • AMD (the tests take the default adapter), a release build, the title (test run only).

AI use

  • Claude Code (Claude Opus 5.5) ran the tests and wrote this report. I checked it before posting.
**@⁠futurepro62** on GitHub · 2026-11-26 04:12 UTC · [original](https://github.com/Marvisak/VIctory/pull/2992#issuecomment-7182395679) Full-suite run on NVIDIA, since this PR has no test report yet. Tested exact head `b252135` (on its base `63bcca4`). **Tested** - NVIDIA GeForce RTX 5070 Ti 16 GB (Blackwell, 32-lane waves only, mesh shaders), driver 621.40, Ryzen 7 9800X3D, Windows 11 Home 26300, Rust 1.98.1 MSVC (pinned), `dxil.dll` from Windows SDK 10.0.26100 (the loader's default), debug. - `cargo build --workspace --locked`, then `cargo test --workspace --locked --no-fail-fast -- --test-threads=4 --skip emit::memory_tests::heap_direct_texture_reads_mark_their_heap_index --skip descriptor::host::tests::dynamic_slots_are_held_until_released --skip memory::tests::lists_share_a_table_and_copies_keep_their_views --skip emit::stride_tests::a_heap_buffer_read_by_element_takes_the_views_stride --skip emit::stride_tests::a_heap_buffer_read_where_no_buffer_view_is_reads_zeros --skip emit::synthetic_tests::gathers_at_a_level_match_the_hardware`: **866 passed, 0 failed, 10 ignored**. - No new `#[test]` functions in the diff. - `--skip` leaves out tests that fail on main `63bcca4` on this card too, not because of this PR: `heap_direct_texture_reads_mark_their_heap_index` ends the `victory-shader` test process with `0xc0000005` (#2571), so without the skip the rest of that crate never reports; `dynamic_slots_are_held_until_released`, `lists_share_a_table_and_copies_keep_their_views` and the two `stride_tests` hit the 1,000,000-view heap cap of NVIDIA drivers (#1835, #2317); `gathers_at_a_level_match_the_hardware` fails on lane 0 (#1744). **Not tested** - AMD (the tests take the default adapter), a release build, the title (test run only). **AI use** - Claude Code (Claude Opus 5.5) ran the tests and wrote this report. I checked it before posting.
Author
Owner

@⁠Marvisak on GitHub · 2026-11-26 05:26 UTC · original · edited 2026-11-26 07:19 UTC

Automated triage for the maintainers.

Thanks. No new push, so the verdict stays the same: whether to support non-Windows development hosts (and add a Linux CI job) is the maintainer's decision.

CI: passing.


Generated by Claude Code

**@⁠Marvisak** on GitHub · 2026-11-26 05:26 UTC · [original](https://github.com/Marvisak/VIctory/pull/2992#issuecomment-7183491954) · edited 2026-11-26 07:19 UTC <!-- victory-triage v1 head=b252135bb8f8f0f0047211dcc9b4619d603408d8 verdict=needs-work at=2026-11-26T07:19:32Z --> Automated triage for the maintainers. Thanks. No new push, so the verdict stays the same: whether to support non-Windows development hosts (and add a Linux CI job) is the maintainer's decision. CI: passing. --- _Generated by [Claude Code](https://claude.ai/code)_
Author
Owner

@⁠0xkn0wh3r3 on GitHub · 2026-11-26 06:43 UTC · original

Understood: supporting non-Windows development hosts is your scope call, and without a non-Windows CI job the gates would drift. If you want it, I'll add a Linux job with an explicit list of portable packages (a workflow change, so yours to approve). I'd also replace rejects_garbage_without_panicking's use of current_exe() with a small synthetic PE, so it tests truncation on every host (fuzeofficlal's point). The xgameui::ask and allocator-refusal stubs would be marked as build-only. If you'd rather not take on another host platform, I'll close this.

**@⁠0xkn0wh3r3** on GitHub · 2026-11-26 06:43 UTC · [original](https://github.com/Marvisak/VIctory/pull/2992#issuecomment-7184719472) Understood: supporting non-Windows development hosts is your scope call, and without a non-Windows CI job the gates would drift. If you want it, I'll add a Linux job with an explicit list of portable packages (a workflow change, so yours to approve). I'd also replace `rejects_garbage_without_panicking`'s use of `current_exe()` with a small synthetic PE, so it tests truncation on every host (fuzeofficlal's point). The `xgameui::ask` and allocator-refusal stubs would be marked as build-only. If you'd rather not take on another host platform, I'll close this.
This pull request can be merged automatically.
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/2992/head:github-bot/gh-2992'
git switch 'github-bot/gh-2992'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-2992'
git switch 'github-bot/gh-2992'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-2992'
git switch 'github-bot/gh-2992'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-2992'
git switch 'main'
git merge --squash 'github-bot/gh-2992'
git switch 'main'
git merge --ff-only 'github-bot/gh-2992'
git switch 'main'
git merge 'github-bot/gh-2992'
git push origin 'main'
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/Marvisak--VIctory!2992
No description provided.