GPU: validate pipeline stream input layouts #3557

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

@⁠pablogonz12 on GitHub · 2026-11-27 17:28 UTC · original
pablogonz12:upstream/input-layout-validation → main · +79 −1 · 2 files · 1 commits · open

Summary

pipeline input layout
  -> reject more than 32 elements, a slot above 31 or a null semantic
  -> reject a null or misaligned array when the count is nonzero
  -> copy valid elements and names

Invalid layouts now return E_INVALIDARG instead of clamping a slot or dereferencing a null name. Empty layouts clear the previous elements. I credit @⁠geiyiliyabumo for identifying these cases in #1079.

Part of #1079; this covers stream input-layout validation, not all the originally proposed tests.

Evidence

  • Before: the 33-element regression returned success. After: four synthetic stream tests pass under Wine: 33 elements, slot 32 and a null semantic return E_INVALIDARG; 32 elements including slot 31 are accepted.
  • Windows-target workspace Clippy passes with and without all features (-D warnings); Windows-target workspace tests compile; xtask policy passes.
  • I ran the library tests under Wine in isolated processes. The GPU suite had four failures, the shader suite two, HLE two and loader two. All ten also failed on the same 63bcca43c6a00a758510398fa43096ce7e4f7df0 main control. Core, formats, game, PE and pipeline library tests had no failures. Workspace integration tests were compiled but not run.
  • Tested on RX 9070 XT / RADV under Proton; not tested on NVIDIA hardware. The new tests exercise CPU-side descriptor parsing; they do not render or run a game.

Merge Danger

Door: two-way; the validation can be reverted.

Blast Radius: pipeline creation for malformed input-layout streams.

**@⁠pablogonz12** on GitHub · 2026-11-27 17:28 UTC · [original](https://github.com/Marvisak/VIctory/pull/3557) `pablogonz12:upstream/input-layout-validation` → `main` · +79 −1 · 2 files · 1 commits · open ## Summary ```text pipeline input layout -> reject more than 32 elements, a slot above 31 or a null semantic -> reject a null or misaligned array when the count is nonzero -> copy valid elements and names ``` Invalid layouts now return `E_INVALIDARG` instead of clamping a slot or dereferencing a null name. Empty layouts clear the previous elements. I credit @⁠geiyiliyabumo for identifying these cases in #1079. Part of #1079; this covers stream input-layout validation, not all the originally proposed tests. ## Evidence - Before: the 33-element regression returned success. After: four synthetic stream tests pass under Wine: 33 elements, slot 32 and a null semantic return `E_INVALIDARG`; 32 elements including slot 31 are accepted. - Windows-target workspace Clippy passes with and without all features (`-D warnings`); Windows-target workspace tests compile; `xtask policy` passes. - I ran the library tests under Wine in isolated processes. The GPU suite had four failures, the shader suite two, HLE two and loader two. All ten also failed on the same `63bcca43c6a00a758510398fa43096ce7e4f7df0` main control. Core, formats, game, PE and pipeline library tests had no failures. Workspace integration tests were compiled but not run. - Tested on RX 9070 XT / RADV under Proton; not tested on NVIDIA hardware. The new tests exercise CPU-side descriptor parsing; they do not render or run a game. ## Merge Danger **Door:** two-way; the validation can be reverted. **Blast Radius:** pipeline creation for malformed input-layout streams.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-27 17:38:17 +00:00
Author
Owner

@⁠oni-swr on GitHub · 2026-11-27 18:11 UTC · original

Independent verification of cf6a9c2d (base main 63bcca43; the PR is a single branch off that base). AI-assisted (Claude Sonnet 5.5); claim: #1633.

  • Host: Windows 11 build 26200, WARP 10.0.26100.9818 (VICTORY_WARP=1, VICTORY_D3D12_WARP=1, --features diagnostics), dxil.dll from Windows SDK 10.0.26100.0. No physical GPU used.
  • cargo test -p victory-gpu --lib: main 63bcca43 = 246 passed, 0 failed, 1 ignored. PR head = 250 passed, 0 failed, 1 ignored. The four new input_layout_* tests all pass (33 elements, slot 32 and null semantic give E_INVALIDARG; 32 elements with slot 31 give S_OK).
  • cargo clippy -p victory-gpu --all-targets --features diagnostics -- -D warnings: clean.

Review notes (no blockers found):

  • The new tests only exercise the create_stream path. invalid_input_layout stays set once raised, even if a later layout subobject in the same stream is valid. I'd expect that to be intended, but it is unproven either way.
  • I did not check whether any other creation path (non-stream CreateGraphicsPipelineState) parses input layouts and needs the same checks. Unproven.
**@⁠oni-swr** on GitHub · 2026-11-27 18:11 UTC · [original](https://github.com/Marvisak/VIctory/pull/3557#issuecomment-7225223570) Independent verification of `cf6a9c2d` (base `main` 63bcca43; the PR is a single branch off that base). AI-assisted (Claude Sonnet 5.5); claim: #1633. - Host: Windows 11 build 26200, WARP 10.0.26100.9818 (`VICTORY_WARP=1`, `VICTORY_D3D12_WARP=1`, `--features diagnostics`), dxil.dll from Windows SDK 10.0.26100.0. No physical GPU used. - `cargo test -p victory-gpu --lib`: main 63bcca43 = 246 passed, 0 failed, 1 ignored. PR head = 250 passed, 0 failed, 1 ignored. The four new `input_layout_*` tests all pass (33 elements, slot 32 and null semantic give `E_INVALIDARG`; 32 elements with slot 31 give `S_OK`). - `cargo clippy -p victory-gpu --all-targets --features diagnostics -- -D warnings`: clean. Review notes (no blockers found): - The new tests only exercise the `create_stream` path. `invalid_input_layout` stays set once raised, even if a later layout subobject in the same stream is valid. I'd expect that to be intended, but it is unproven either way. - I did not check whether any other creation path (non-stream `CreateGraphicsPipelineState`) parses input layouts and needs the same checks. Unproven.
Author
Owner

@⁠futurepro62 on GitHub · 2026-11-27 21:45 UTC · original

NVIDIA full-suite run, to go with the reports above by oni-swr, since none of them names a GPU run. Tested exact head cf6a9c2 (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: 870 passed, 0 failed, 10 ignored.
  • The new tests ran and passed: input_layout_rejects_more_than_32_elements, input_layout_rejects_slot_32, input_layout_rejects_null_semantic, input_layout_accepts_32_elements_and_slot_31.
  • --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-27 21:45 UTC · [original](https://github.com/Marvisak/VIctory/pull/3557#issuecomment-7228726581) NVIDIA full-suite run, to go with the reports above by oni-swr, since none of them names a GPU run. Tested exact head `cf6a9c2` (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`: **870 passed, 0 failed, 10 ignored**. - The new tests ran and passed: `input_layout_rejects_more_than_32_elements`, `input_layout_rejects_slot_32`, `input_layout_rejects_null_semantic`, `input_layout_accepts_32_elements_and_slot_31`. - `--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.
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/3557/head:github-bot/gh-3557'
git switch 'github-bot/gh-3557'

Merge

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