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

Open
0xkn0wh3r3 wants to merge 1 commit from upstream-pr/2992 into main
0xkn0wh3r3 commented 2026-11-26 02:36:47 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by 0xkn0wh3r3 on 2026-11-26T02:36:47Z.


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).
<!-- greyfinch-sync:Marvisak/VIctory:issue:6618282428 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2992). Originally posted by [0xkn0wh3r3](https://github.com/0xkn0wh3r3) on 2026-11-26T02:36:47Z. --- 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).
kotekompotek commented 2026-11-26 03:04:56 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by kotekompotek on 2026-11-26T02:39:05Z.

Review: COMMENTED


Verified: the gating is precise in both directions — windows-only surfaces (fallback_samplers, view_format, xmem hooks, the dialog module, own-binary PE tests, dxil-validator tests) get cfg(windows), while the platform-free IDLE_MS/IDLE_FRAMES consts are correctly un-gated. The non-Windows ask() stub returning None (cancel) is the right semantic, and audio's warn fallback preserves the diagnostic. A cancelled entry rather than a stub dialog is the honest behavior off Windows.

<!-- greyfinch-sync:Marvisak/VIctory:review:6067827272 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2992#pullrequestreview-6067827272). Originally posted by [kotekompotek](https://github.com/kotekompotek) on 2026-11-26T02:39:05Z. **Review:** COMMENTED --- Verified: the gating is precise in both directions — windows-only surfaces (fallback_samplers, view_format, xmem hooks, the dialog module, own-binary PE tests, dxil-validator tests) get cfg(windows), while the platform-free IDLE_MS/IDLE_FRAMES consts are correctly un-gated. The non-Windows ask() stub returning None (cancel) is the right semantic, and audio's warn fallback preserves the diagnostic. A cancelled entry rather than a stub dialog is the honest behavior off Windows.
fuzeofficlal commented 2026-11-26 04:05:54 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by fuzeofficlal on 2026-11-26T03:07:58Z.

Review: CHANGES_REQUESTED


Code review on b252135b (static source inspection):

  • Medium — rejects_garbage_without_panicking no longer tests PE truncation off Windows (crates/victory-pe/src/image.rs:444-496):
    • rejects_garbage_without_panicking remains un-gated and truncates std::env::current_exe(). On Linux/macOS that returns an ELF/Mach-O binary, so ImageInfo::parse exits at the initial MZ check and never exercises deeper PE truncation paths. Using a minimal synthetic valid PE fixture (verified to parse before truncating) keeps the test meaningful on all hosts.
  • Medium — No non-Windows CI check for the portable crate set (.github/workflows/ci.yml:20, apps/victory/src/prebuild.rs:24, crates/victory-gpu/src/pipeline.rs:595):
    • The workflow still runs only on Windows, and workspace-wide commands on non-Windows also select apps/victory, whose prebuild.rs imports Windows-only Prebuild/use_pipeline_cache. Adding a Linux/non-Windows CI job with an explicit portable package list (-p ...) will keep portable builds from regressing.
<!-- greyfinch-sync:Marvisak/VIctory:review:6068018580 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2992#pullrequestreview-6068018580). Originally posted by [fuzeofficlal](https://github.com/fuzeofficlal) on 2026-11-26T03:07:58Z. **Review:** CHANGES_REQUESTED --- Code review on `b252135b` (static source inspection): - **Medium — `rejects_garbage_without_panicking` no longer tests PE truncation off Windows (`crates/victory-pe/src/image.rs:444-496`)**: - `rejects_garbage_without_panicking` remains un-gated and truncates `std::env::current_exe()`. On Linux/macOS that returns an ELF/Mach-O binary, so `ImageInfo::parse` exits at the initial `MZ` check and never exercises deeper PE truncation paths. Using a minimal synthetic valid PE fixture (verified to parse before truncating) keeps the test meaningful on all hosts. - **Medium — No non-Windows CI check for the portable crate set (`.github/workflows/ci.yml:20`, `apps/victory/src/prebuild.rs:24`, `crates/victory-gpu/src/pipeline.rs:595`)**: - The workflow still runs only on Windows, and workspace-wide commands on non-Windows also select `apps/victory`, whose `prebuild.rs` imports Windows-only `Prebuild`/`use_pipeline_cache`. Adding a Linux/non-Windows CI job with an explicit portable package list (`-p ...`) will keep portable builds from regressing.
futurepro62 commented 2026-11-26 05:04:04 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by futurepro62 on 2026-11-26T04:12:50Z.


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.
<!-- greyfinch-sync:Marvisak/VIctory:comment:7182395679 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2992#issuecomment-7182395679). Originally posted by [futurepro62](https://github.com/futurepro62) on 2026-11-26T04:12:50Z. --- 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.
Marvisak commented 2026-11-26 06:03:42 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-26T05:26:46Z.


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

<!-- greyfinch-sync:Marvisak/VIctory:comment:7183491954 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2992#issuecomment-7183491954). Originally posted by [Marvisak](https://github.com/Marvisak) on 2026-11-26T05:26:46Z. --- <!-- 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)_
0xkn0wh3r3 commented 2026-11-26 07:01:53 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by 0xkn0wh3r3 on 2026-11-26T06:43:34Z.


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.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7184719472 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2992#issuecomment-7184719472). Originally posted by [0xkn0wh3r3](https://github.com/0xkn0wh3r3) on 2026-11-26T06:43:34Z. --- 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 cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/2992:upstream-pr/2992'
git switch 'upstream-pr/2992'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'upstream-pr/2992'
git switch 'upstream-pr/2992'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/2992'
git switch 'upstream-pr/2992'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/2992'
git switch 'main'
git merge --squash 'upstream-pr/2992'
git switch 'main'
git merge --ff-only 'upstream-pr/2992'
git switch 'main'
git merge 'upstream-pr/2992'
git push origin 'main'
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!2990
No description provided.