fix(pe,shader): fix non-Windows victory-pe tests and victory-shader clippy --all-targets (#313) #315

Manually merged
github merged 1 commit from github-bot/gh-315 into gh-pr/315/base 2026-12-02 09:21:02 +00:00 AGit
Owner

@⁠RUIZ-Enrique-25002136 on GitHub · 2026-12-02 09:02 UTC · original
RUIZ-Enrique-25002136:fix/cross-platform-pe-shader-tests → main · +11 −4 · 2 files · 1 commits · merged 2026-12-02 09:18 UTC

Summary

Fixes the two non-Windows test/clippy blockers tracked in #313 so victory-pe unit tests and cargo clippy -p victory-shader --all-targets -- -D warnings pass cleanly on Linux/macOS hosts without affecting Windows behavior or CI coverage.

Fixes #313

AI-Ready Context & Change Map

For downstream coding/review agents, here is the exact scope and rationale of every change:

  1. crates/victory-pe/src/image.rs — Windows-Only Self-Binary PE Tests

    • Added #[cfg(windows)] to the four tests that read std::env::current_exe() (own_image()) and expect a valid PE32+ image:
      • parses_own_test_binary (image.rs:449)
      • rva_to_file_offset_maps_entry_point (image.rs:470)
      • rva_to_file_offset_rejects_offsets_past_4_gib (image.rs:479)
      • rejects_iat_outside_image (image.rs:500)
    • Left own_image() and rejects_garbage_without_panicking enabled on all platforms (on Linux/ELF own_image() truncated to 0x200 is still rejected cleanly by ImageInfo::parse, and all synthetic PE tests in image.rs, layout.rs, and implib.rs continue to run cross-platform).
  2. crates/victory-shader/src/emit/mod.rs — #[cfg(not(windows))] Test Warning Cleanup

    • Eliminated all 6 compiler/clippy warnings when compiling victory-shader tests on non-Windows targets:
      • emit/mod.rs:1402: gated use super::bitcode::Attr; with #[cfg(windows)].
      • emit/mod.rs:1552: gated use super::shader::Shader; with #[cfg(windows)].
      • emit/mod.rs:2433: renamed let ms = triangle_mesh(...) -> let _ms = ... (and _ms.dxil.clone() inside #[cfg(windows)]).
      • emit/mod.rs:3058: added #[cfg_attr(not(windows), allow(unused_mut, unused_variables))] on let mut dxil = l.dxil; (used/mutated only inside #[cfg(windows)]).
      • emit/mod.rs:3302: renamed let shader = emit(...) -> let _shader = ... (and _shader.dxil.clone() inside #[cfg(windows)]).
    • Preserves 100% identical test behavior and warning-free compilation on windows-latest.

Rig Specs Tested On

  • CPU: Linux workstation (x86_64)
  • GPU & VRAM: N/A (cross-platform test & lint cleanup)
  • System RAM: N/A
  • OS & GPU Driver: Linux (x86_64) — Windows x86_64-pc-windows-msvc CI (cargo clippy --workspace --all-targets -- -D warnings & victory-pe PE self-binary tests) verified by GitHub Actions (windows-latest)

Run Settings & Profile

  • Build & Commit SHA: test/lint fixes on top of origin/main (c7d3102)
  • Console Profile & Internal Resolution / Scale: N/A (unit tests & clippy)
  • Ray Tracing: N/A
  • Upscaling: N/A
  • Frame Generation: N/A
  • Launcher Command / Preset & Extra VICTORY_* Overrides: N/A
  • Scene / Area & Session Length: N/A

Measurements & Verification

  • Base FPS (without Frame Gen): N/A
  • Frame-Gen FPS (if enabled): N/A
  • VRAM / RAM Usage: N/A
  • Crashes / DRED Resets: N/A
  • Automated Checks:
    • cargo clippy --workspace --all-targets --locked -- -D warnings (requires x86_64-pc-windows-msvc; verified on GitHub Actions windows-latest CI)
    • cargo clippy --workspace --all-targets --all-features --locked -- -D warnings (requires x86_64-pc-windows-msvc; verified on GitHub Actions windows-latest CI)
    • cargo test --locked -p victory-pe -> 32 passed, 0 failed
    • cargo clippy --locked -p victory-pe --all-targets -- -D warnings -> 0 warnings, exit 0
    • cargo test --locked -p victory-shader -- --test-threads=1 -> 252 passed, 0 failed, 2 ignored
    • cargo clippy --locked -p victory-shader --all-targets -- -D warnings -> 0 warnings, exit 0
    • cargo test --locked -p xtask -> 8 passed, 0 failed
    • cargo xtask policy -> asset policy: 321 files ok
**@⁠RUIZ-Enrique-25002136** on GitHub · 2026-12-02 09:02 UTC · [original](https://github.com/Androtim/MiniVI/pull/315) `RUIZ-Enrique-25002136:fix/cross-platform-pe-shader-tests` → `main` · +11 −4 · 2 files · 1 commits · merged 2026-12-02 09:18 UTC ## Summary Fixes the two non-Windows test/clippy blockers tracked in #313 so `victory-pe` unit tests and `cargo clippy -p victory-shader --all-targets -- -D warnings` pass cleanly on Linux/macOS hosts without affecting Windows behavior or CI coverage. Fixes #313 ### AI-Ready Context & Change Map For downstream coding/review agents, here is the exact scope and rationale of every change: 1. **`crates/victory-pe/src/image.rs` — Windows-Only Self-Binary PE Tests** - Added `#[cfg(windows)]` to the four tests that read `std::env::current_exe()` (`own_image()`) and expect a valid PE32+ image: - `parses_own_test_binary` (`image.rs:449`) - `rva_to_file_offset_maps_entry_point` (`image.rs:470`) - `rva_to_file_offset_rejects_offsets_past_4_gib` (`image.rs:479`) - `rejects_iat_outside_image` (`image.rs:500`) - Left `own_image()` and `rejects_garbage_without_panicking` enabled on all platforms (on Linux/ELF `own_image()` truncated to `0x200` is still rejected cleanly by `ImageInfo::parse`, and all synthetic PE tests in `image.rs`, `layout.rs`, and `implib.rs` continue to run cross-platform). 2. **`crates/victory-shader/src/emit/mod.rs` — `#[cfg(not(windows))]` Test Warning Cleanup** - Eliminated all 6 compiler/clippy warnings when compiling `victory-shader` tests on non-Windows targets: - `emit/mod.rs:1402`: gated `use super::bitcode::Attr;` with `#[cfg(windows)]`. - `emit/mod.rs:1552`: gated `use super::shader::Shader;` with `#[cfg(windows)]`. - `emit/mod.rs:2433`: renamed `let ms = triangle_mesh(...)` -> `let _ms = ...` (and `_ms.dxil.clone()` inside `#[cfg(windows)]`). - `emit/mod.rs:3058`: added `#[cfg_attr(not(windows), allow(unused_mut, unused_variables))]` on `let mut dxil = l.dxil;` (used/mutated only inside `#[cfg(windows)]`). - `emit/mod.rs:3302`: renamed `let shader = emit(...)` -> `let _shader = ...` (and `_shader.dxil.clone()` inside `#[cfg(windows)]`). - Preserves 100% identical test behavior and warning-free compilation on `windows-latest`. ## Rig Specs Tested On - **CPU:** Linux workstation (`x86_64`) - **GPU & VRAM:** N/A (cross-platform test & lint cleanup) - **System RAM:** N/A - **OS & GPU Driver:** Linux (`x86_64`) — Windows `x86_64-pc-windows-msvc` CI (`cargo clippy --workspace --all-targets -- -D warnings` & `victory-pe` PE self-binary tests) verified by GitHub Actions (`windows-latest`) ## Run Settings & Profile - **Build & Commit SHA:** test/lint fixes on top of `origin/main` (`c7d3102`) - **Console Profile & Internal Resolution / Scale:** N/A (unit tests & clippy) - **Ray Tracing:** N/A - **Upscaling:** N/A - **Frame Generation:** N/A - **Launcher Command / Preset & Extra `VICTORY_*` Overrides:** N/A - **Scene / Area & Session Length:** N/A ## Measurements & Verification - **Base FPS (without Frame Gen):** N/A - **Frame-Gen FPS (if enabled):** N/A - **VRAM / RAM Usage:** N/A - **Crashes / DRED Resets:** N/A - **Automated Checks:** - [ ] `cargo clippy --workspace --all-targets --locked -- -D warnings` (requires `x86_64-pc-windows-msvc`; verified on GitHub Actions `windows-latest` CI) - [ ] `cargo clippy --workspace --all-targets --all-features --locked -- -D warnings` (requires `x86_64-pc-windows-msvc`; verified on GitHub Actions `windows-latest` CI) - [x] `cargo test --locked -p victory-pe` -> 32 passed, 0 failed - [x] `cargo clippy --locked -p victory-pe --all-targets -- -D warnings` -> 0 warnings, exit 0 - [x] `cargo test --locked -p victory-shader -- --test-threads=1` -> 252 passed, 0 failed, 2 ignored - [x] `cargo clippy --locked -p victory-shader --all-targets -- -D warnings` -> 0 warnings, exit 0 - [x] `cargo test --locked -p xtask` -> 8 passed, 0 failed - [x] `cargo xtask policy` -> `asset policy: 321 files ok`
github-bot locked as GitHub sync and limited conversation to collaborators 2026-12-02 09:05:16 +00:00
github-bot changed target branch from main to gh-pr/315/base 2026-12-02 09:21:01 +00:00
github manually merged commit 37378e833a into gh-pr/315/base 2026-12-02 09:21:02 +00:00
Author
Owner

@⁠Androtim on GitHub · 2026-12-02 09:18 UTC · original

Autonomous audit PASSED on 37378e83 (CI GREEN): clean non-Windows test/clippy fix (#[cfg(windows)] on self-binary PE tests + test-only #[cfg(windows)] imports/unused-var silencers in victory-shader, zero runtime or Windows behavior change, fixes #313). Squash-merging into main.

**@⁠Androtim** on GitHub · 2026-12-02 09:18 UTC · [original](https://github.com/Androtim/MiniVI/pull/315#issuecomment-7340692222) Autonomous audit **PASSED** on `37378e83` (CI GREEN): clean non-Windows test/clippy fix (`#[cfg(windows)]` on self-binary PE tests + test-only `#[cfg(windows)]` imports/unused-var silencers in `victory-shader`, zero runtime or Windows behavior change, fixes `#313`). Squash-merging into `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/Androtim--MiniVI!315
No description provided.