GPU: zero graphics/mesh PSO padding bytes and deduplicate pipeline library stores #1041

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

@⁠gabrielcruzg3 on GitHub · 2026-11-24 15:15 UTC · original
gabrielcruzg3:fix/pipeline-library-padding → main · +169 −32 · 2 files · 1 commits · closed without merging

Addresses #264 (Finding #3): \ID3D12PipelineLibrary\ description mismatches (id=972) caused by uninitialized struct padding bytes, and redundant \StorePipeline\ calls across worker threads (id=970).

Changes

  • \crates/victory-gpu/src/pipeline/host.rs: Copy graphics and mesh PSO sub-descriptors (\D3D12_BLEND_DESC, \D3D12_RASTERIZER_DESC, \D3D12_DEPTH_STENCIL_DESC, \D3D12_INPUT_ELEMENT_DESC, \D3D12_RT_FORMAT_ARRAY, and mesh \Stream) field-by-field into zeroed memory so padding bytes are deterministic.
  • \crates/victory-gpu/src/pipeline/library.rs: Track pipeline names already stored in the current run to avoid duplicate \StorePipeline\ calls across worker threads.

Verification

  • Added synthetic unit test \cleaned_graphics_descs_zero_padding_bytes.
  • Passed \cargo clippy -- -D warnings, \cargo test -p victory-gpu, and \cargo xtask policy.
**@⁠gabrielcruzg3** on GitHub · 2026-11-24 15:15 UTC · [original](https://github.com/Marvisak/VIctory/pull/1041) `gabrielcruzg3:fix/pipeline-library-padding` → `main` · +169 −32 · 2 files · 1 commits · closed without merging Addresses #264 (Finding #3): \ID3D12PipelineLibrary\ description mismatches (id=972) caused by uninitialized struct padding bytes, and redundant \StorePipeline\ calls across worker threads (id=970). ### Changes - \crates/victory-gpu/src/pipeline/host.rs\: Copy graphics and mesh PSO sub-descriptors (\D3D12_BLEND_DESC\, \D3D12_RASTERIZER_DESC\, \D3D12_DEPTH_STENCIL_DESC\, \D3D12_INPUT_ELEMENT_DESC\, \D3D12_RT_FORMAT_ARRAY\, and mesh \Stream\) field-by-field into zeroed memory so padding bytes are deterministic. - \crates/victory-gpu/src/pipeline/library.rs\: Track pipeline names already stored in the current run to avoid duplicate \StorePipeline\ calls across worker threads. ### Verification - Added synthetic unit test \cleaned_graphics_descs_zero_padding_bytes\. - Passed \cargo clippy -- -D warnings\, \cargo test -p victory-gpu\, and \cargo xtask policy\.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:18:03 +00:00
github-bot closed this pull request 2026-11-26 04:18:03 +00:00
Author
Owner

@⁠Zipettte on GitHub · 2026-11-24 16:30 UTC · original

Tested on AMD Radeon RX 7700 XT (RDNA3, gfx1101), driver 32.0.32029.2010, Windows 11, Rust 1.98.1 MSVC at 4111946: cargo test -p victory-gpu passes, 44 passed / 0 failed. Workspace baseline on main (ffe310e) is green on the same machine (342 passed).

Tested with AI assistance (Claude).

**@⁠Zipettte** on GitHub · 2026-11-24 16:30 UTC · [original](https://github.com/Marvisak/VIctory/pull/1041#issuecomment-7137771657) Tested on AMD Radeon RX 7700 XT (RDNA3, gfx1101), driver 32.0.32029.2010, Windows 11, Rust 1.98.1 MSVC at 4111946: `cargo test -p victory-gpu` passes, 44 passed / 0 failed. Workspace baseline on main (ffe310e) is green on the same machine (342 passed). _Tested with AI assistance (Claude)._
Author
Owner

@⁠Bullet18x on GitHub · 2026-11-24 19:49 UTC · original

RTX 5090 A/B of the pipeline-library debug-layer messages, this PR vs #352 vs main, details and protocol in my comment on #352.

Build 972 (desc does not match) 970 (already exists)
main ffe310e 350 358
+ this PR (4111946) 288 211
+ #352 (f77bd28) 0 5

On this machine the remaining 972 / 970 pairs come from mesh pipelines stored without a topology (#352, #780); zeroing padding lowers the counts but does not remove them. The de-duplication of stores may still be worth keeping on top of #352 (the two conflict in pipeline/host.rs today).

AI use: Claude Code (Claude Opus 5.5) ran and counted; I checked the results.

**@⁠Bullet18x** on GitHub · 2026-11-24 19:49 UTC · [original](https://github.com/Marvisak/VIctory/pull/1041#issuecomment-7142642517) RTX 5090 A/B of the pipeline-library debug-layer messages, this PR vs #352 vs `main`, details and protocol in my comment on #352. | Build | 972 (desc does not match) | 970 (already exists) | |---|---|---| | `main` `ffe310e` | 350 | 358 | | + this PR (`4111946`) | 288 | 211 | | + #352 (`f77bd28`) | **0** | **5** | On this machine the remaining 972 / 970 pairs come from mesh pipelines stored without a topology (#352, #780); zeroing padding lowers the counts but does not remove them. The de-duplication of stores may still be worth keeping on top of #352 (the two conflict in `pipeline/host.rs` today). AI use: Claude Code (Claude Opus 5.5) ran and counted; I checked the results.
Author
Owner

@⁠Marvisak on GitHub · 2026-11-25 00:30 UTC · original

Automated triage for the maintainers. Closing because this change is already in main, or main has since replaced the code it patches.

If this is mistaken, reply here with what was missed (or push a change and say so) and it will be looked at again. Thank you for the contribution.

**@⁠Marvisak** on GitHub · 2026-11-25 00:30 UTC · [original](https://github.com/Marvisak/VIctory/pull/1041#issuecomment-7148585949) Automated triage for the maintainers. Closing because this change is already in `main`, or `main` has since replaced the code it patches. If this is mistaken, reply here with what was missed (or push a change and say so) and it will be looked at again. Thank you for the contribution.

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!1041
No description provided.