GPU: give the root signature test the host's root parameter layout #95

Closed
github-bot wants to merge 1 commit from gh-pr/95/head into gh-pr/95/base
Owner

@⁠martingouv on GitHub · 2026-11-24 00:26 UTC · original
martingouv:fix-root-param-test → main · +15 −14 · 1 files · 1 commits · closed without merging

root::tests::host_serialized_blobs_create_root_signatures fails on a clean main (35b054e) on my machine with E_INVALIDARG from serialize.

Cause

The test built D3D12_ROOT_PARAMETER by hand as five packed u32s (20 bytes). The host's struct is 32 bytes: the union is 8-aligned (its descriptor-table arm holds a pointer), so it sits at offset 8, and ShaderVisibility at offset 24. The host therefore read register space 1, zero constants, and a visibility from 4 bytes past the end of the struct, so the test passed or failed depending on what was on the stack.

Fix

Use the windows crate's D3D12_ROOT_PARAMETER in the test. The test only; no runtime code changes.

Tested

cargo test --workspace passes on Windows 11, RTX 5060 Ti, NVIDIA driver 621.24 (the failure is a CPU-side serialization issue, not driver-specific). No game files involved.

AI-assisted (Claude Code).

🤖 Generated with Claude Code

**@⁠martingouv** on GitHub · 2026-11-24 00:26 UTC · [original](https://github.com/Marvisak/VIctory/pull/95) `martingouv:fix-root-param-test` → `main` · +15 −14 · 1 files · 1 commits · closed without merging `root::tests::host_serialized_blobs_create_root_signatures` fails on a clean `main` (35b054e) on my machine with `E_INVALIDARG` from `serialize`. ## Cause The test built `D3D12_ROOT_PARAMETER` by hand as five packed `u32`s (20 bytes). The host's struct is 32 bytes: the union is 8-aligned (its descriptor-table arm holds a pointer), so it sits at offset 8, and `ShaderVisibility` at offset 24. The host therefore read register space 1, zero constants, and a visibility from 4 bytes past the end of the struct, so the test passed or failed depending on what was on the stack. ## Fix Use the `windows` crate's `D3D12_ROOT_PARAMETER` in the test. The test only; no runtime code changes. ## Tested `cargo test --workspace` passes on Windows 11, RTX 5060 Ti, NVIDIA driver 621.24 (the failure is a CPU-side serialization issue, not driver-specific). No game files involved. AI-assisted (Claude Code). 🤖 Generated with [Claude Code](https://claude.com/claude-code)
The test built D3D12_ROOT_PARAMETER by hand as five packed u32s, but the
host's union sits at offset 8 and the visibility at 24. The host read the
register space as 1, zero constants and a visibility from past the end of
the struct, so the test passed or failed with whatever was on the stack
(E_INVALIDARG here). Use the windows crate's type instead.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 03:50:05 +00:00
github-bot closed this pull request 2026-11-26 03:50:05 +00:00
Author
Owner

@⁠lordon1a on GitHub · 2026-11-24 00:40 UTC · original

Verified f0d41db41 on Windows 11 (x86_64-pc-windows-gnullvm, rustc 1.100.0, applied cleanly to main@35b054ec0): pass (cargo xtask policy: 150 files ok; cargo test -p victory-gpu: 39 passed, 0 failed).

Heads-up: this makes the exact same change to crates/victory-gpu/src/root.rs as earlier open PR #36 (apart from the one-line comment). AI-assisted.

**@⁠lordon1a** on GitHub · 2026-11-24 00:40 UTC · [original](https://github.com/Marvisak/VIctory/pull/95#issuecomment-7118308858) Verified `f0d41db41` on Windows 11 (`x86_64-pc-windows-gnullvm`, `rustc 1.100.0`, applied cleanly to `main@35b054ec0`): **pass** (`cargo xtask policy`: 150 files ok; `cargo test -p victory-gpu`: **39 passed, 0 failed**). Heads-up: this makes the exact same change to `crates/victory-gpu/src/root.rs` as earlier open PR #36 (apart from the one-line comment). AI-assisted.
Author
Owner

@⁠DaviTostes on GitHub · 2026-11-24 00:50 UTC · original

Tested f0d41db under Wine 11.22 + vkd3d-proton 3.1 on Arch Linux x86_64 (AMD RX 9060 XT, RADV 26.3.1), Windows build with cargo xwin ... --target x86_64-pc-windows-msvc: pass, no regression.

  • victory_gpu: 36 passed, 3 failed; the three failures are the environment-only ones from main (argument_clamp_builds, a_rejected_blob_gives_an_empty_library, #128's VirtualQuery upload skip).
  • root::tests::host_serialized_blobs_create_root_signatures is ok here both before and after this change: vkd3d-proton accepts the malformed 20-byte parameter blob, so this environment cannot reproduce the E_INVALIDARG you see on Windows. The layout fix is still right; the failing case apparently needs a real driver's blob validation.

No game data used. AI-assisted (DeepSeek V4.1 Flash coding agent).

**@⁠DaviTostes** on GitHub · 2026-11-24 00:50 UTC · [original](https://github.com/Marvisak/VIctory/pull/95#issuecomment-7118489756) Tested `f0d41db` under **Wine 11.22 + vkd3d-proton 3.1** on Arch Linux x86_64 (AMD RX 9060 XT, RADV 26.3.1), Windows build with `cargo xwin ... --target x86_64-pc-windows-msvc`: **pass, no regression**. - `victory_gpu`: **36 passed, 3 failed**; the three failures are the environment-only ones from `main` (`argument_clamp_builds`, `a_rejected_blob_gives_an_empty_library`, #128's `VirtualQuery` upload skip). - `root::tests::host_serialized_blobs_create_root_signatures` is **ok here both before and after** this change: vkd3d-proton accepts the malformed 20-byte parameter blob, so this environment cannot reproduce the `E_INVALIDARG` you see on Windows. The layout fix is still right; the failing case apparently needs a real driver's blob validation. No game data used. AI-assisted (DeepSeek V4.1 Flash coding agent).

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/Marvisak--VIctory!95
No description provided.