GPU: add unit tests for pipeline/host.rs offsets, defaults, formats, and subobject parsing #1207

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

@⁠geiyiliyabumo on GitHub · 2026-11-24 16:25 UTC · original
geiyiliyabumo:test/gpu-pipeline-host → main · +375 −0 · 1 files · 1 commits · closed without merging

Summary

Closes #1079

Full verification details and change notes are documented in #1079 (commit 649c6e5, based on main ffe310e).

 crates/victory-gpu/src/pipeline/host.rs | 680 ++++++++++++++++++++++++++++----
 1 file changed, 611 insertions(+), 69 deletions(-)

Verification (Windows 11 x64 MSVC)

  • rustfmt --edition 2024 --check on edited files: PASS
  • cargo xtask policy: PASS (zero game files/data)
  • cargo clippy --all-targets --locked -- -D warnings (default + --features diagnostics where applicable): PASS
  • Targeted & crate unit/GPU tests: PASS

AI-assisted; synthetic tests only, no game files.

**@⁠geiyiliyabumo** on GitHub · 2026-11-24 16:25 UTC · [original](https://github.com/Marvisak/VIctory/pull/1207) `geiyiliyabumo:test/gpu-pipeline-host` → `main` · +375 −0 · 1 files · 1 commits · closed without merging ### Summary Closes #1079 Full verification details and change notes are documented in #1079 (commit `649c6e5`, based on `main` `ffe310e`). ```text crates/victory-gpu/src/pipeline/host.rs | 680 ++++++++++++++++++++++++++++---- 1 file changed, 611 insertions(+), 69 deletions(-) ``` ### Verification (Windows 11 x64 MSVC) - `rustfmt --edition 2024 --check` on edited files: **PASS** - `cargo xtask policy`: **PASS** (zero game files/data) - `cargo clippy --all-targets --locked -- -D warnings` (default + `--features diagnostics` where applicable): **PASS** - Targeted & crate unit/GPU tests: **PASS** *AI-assisted; synthetic tests only, no game files.*
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:23:46 +00:00
github-bot closed this pull request 2026-11-26 04:23:46 +00:00
Author
Owner

@⁠Zipettte on GitHub · 2026-11-24 18:00 UTC · original

Tested on AMD Radeon RX 7700 XT (RDNA3, gfx1101), driver 32.0.32029.2010, Windows 11, Rust 1.98.1 MSVC at 649c6e5: cargo test -p victory-gpu passes, 64 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 18:00 UTC · [original](https://github.com/Marvisak/VIctory/pull/1207#issuecomment-7140012636) Tested on AMD Radeon RX 7700 XT (RDNA3, gfx1101), driver 32.0.32029.2010, Windows 11, Rust 1.98.1 MSVC at 649c6e5: `cargo test -p victory-gpu` passes, 64 passed / 0 failed. Workspace baseline on main (ffe310e) is green on the same machine (342 passed). _Tested with AI assistance (Claude)._
Author
Owner

@⁠Marvisak on GitHub · 2026-11-25 01:18 UTC · original · edited 2026-11-25 07:22 UTC

Automated triage for the maintainers.

Merge candidate. Update after your trim: the production code of crates/victory-gpu/src/pipeline/host.rs now matches main. The alignment change, the new refusals and the formatting hunks are gone, and the diff is one hunk in mod tests. I checked the expected values by hand against GraphicsState::read and elements. appended_inputs_respect_format_alignment_per_slot gives the right per-slot offsets for D3D12_APPEND_ALIGNED_ELEMENT (min(4, size) alignment, slots 0 and 31 kept apart). omitted_subobjects_use_d3d12_defaults matches the documented D3D12 defaults for blend, rasterizer and depth-stencil state. The DEPTH_STENCIL1 test confirms that the depth-bounds field is dropped, as the code's comment says. The subobject helper puts the payload at +4, or at +8 for the pointer-holding input layout, as read expects. The unaligned sample-mask case exercises the read_unaligned path. Merges cleanly.

CI: passing (check).


Generated by Claude Code

**@⁠Marvisak** on GitHub · 2026-11-25 01:18 UTC · [original](https://github.com/Marvisak/VIctory/pull/1207#issuecomment-7149415372) · edited 2026-11-25 07:22 UTC <!-- victory-triage v1 head=0a8bcd3889b78f37b46e37640f01895cea122405 verdict=merge-candidate at=2026-11-25T07:22:03Z --> Automated triage for the maintainers. **Merge candidate.** Update after your trim: the production code of `crates/victory-gpu/src/pipeline/host.rs` now matches `main`. The alignment change, the new refusals and the formatting hunks are gone, and the diff is one hunk in `mod tests`. I checked the expected values by hand against `GraphicsState::read` and `elements`. `appended_inputs_respect_format_alignment_per_slot` gives the right per-slot offsets for `D3D12_APPEND_ALIGNED_ELEMENT` (min(4, size) alignment, slots 0 and 31 kept apart). `omitted_subobjects_use_d3d12_defaults` matches the documented D3D12 defaults for blend, rasterizer and depth-stencil state. The `DEPTH_STENCIL1` test confirms that the depth-bounds field is dropped, as the code's comment says. The subobject helper puts the payload at +4, or at +8 for the pointer-holding input layout, as `read` expects. The unaligned sample-mask case exercises the `read_unaligned` path. Merges cleanly. CI: passing (`check`). --- _Generated by [Claude Code](https://claude.ai/code)_
Author
Owner

@⁠geiyiliyabumo on GitHub · 2026-11-25 02:20 UTC · original

Rebased cleanly onto \main\ (\ccfb029). \cargo test -p victory-gpu --locked pipeline::host::tests, \cargo clippy -p victory-gpu --all-targets --locked -- -D warnings, and \cargo xtask policy\ all pass.

**@⁠geiyiliyabumo** on GitHub · 2026-11-25 02:20 UTC · [original](https://github.com/Marvisak/VIctory/pull/1207#issuecomment-7150602408) Rebased cleanly onto \main\ (\ccfb029\). \cargo test -p victory-gpu --locked pipeline::host::tests\, \cargo clippy -p victory-gpu --all-targets --locked -- -D warnings\, and \cargo xtask policy\ all pass.
Author
Owner

@⁠geiyiliyabumo on GitHub · 2026-11-25 04:03 UTC · original

Rebased onto latest \main\ (\940d32f, head \6a76d2), preserving upstream view-write \marks\ tracking alongside the input-layout validation, aligned vertex offset handling, and tests. Verified \cargo xtask policy, \cargo clippy -p victory-gpu --tests -- -D warnings, and \pipeline::host::tests\ (16/16 passed).

**@⁠geiyiliyabumo** on GitHub · 2026-11-25 04:03 UTC · [original](https://github.com/Marvisak/VIctory/pull/1207#issuecomment-7152489133) Rebased onto latest \main\ (\940d32f\, head \6a76d2\), preserving upstream view-write \marks\ tracking alongside the input-layout validation, aligned vertex offset handling, and tests. Verified \cargo xtask policy\, \cargo clippy -p victory-gpu --tests -- -D warnings\, and \pipeline::host::tests\ (16/16 passed).
Author
Owner

@⁠geiyiliyabumo on GitHub · 2026-11-25 06:56 UTC · original

Trimmed this PR per triage feedback (head $sha): restored all production code in \crates/victory-gpu/src/pipeline/host.rs\ byte-for-byte to \main\ (\940d32f, dropping the redundant alignment change, refusal checks, and formatting hunks). Only a single hunk inside \mod tests\ remains, adding 8 tests pinning current behavior for offsets/alignment, D3D12 defaults, format conversion, subobject parsing, and bytecode/semantic-name ownership. Verified \cargo xtask policy, \cargo clippy -p victory-gpu --tests -- -D warnings, and \pipeline::host::tests\ (10/10 passed).

**@⁠geiyiliyabumo** on GitHub · 2026-11-25 06:56 UTC · [original](https://github.com/Marvisak/VIctory/pull/1207#issuecomment-7155318344) Trimmed this PR per triage feedback (head \$sha\): restored all production code in \crates/victory-gpu/src/pipeline/host.rs\ byte-for-byte to \main\ (\940d32f\, dropping the redundant alignment change, refusal checks, and formatting hunks). Only a single hunk inside \mod tests\ remains, adding 8 tests pinning current behavior for offsets/alignment, D3D12 defaults, format conversion, subobject parsing, and bytecode/semantic-name ownership. Verified \cargo xtask policy\, \cargo clippy -p victory-gpu --tests -- -D warnings\, and \pipeline::host::tests\ (10/10 passed).
Author
Owner

@⁠Marvisak on GitHub · 2026-11-25 21:59 UTC · original

Automated triage for the maintainers, second look (a review against current main, with builds and tests where they could change the verdict).

Closing because two of the eight tests fail on current main and the rest add little. translates_render_target_and_depth_formats and input_layout_owns_semantic_names_and_describes_their_values expect console formats 118/119/120 to map to the D24S8 family, but resource::pc_format now maps them to the D32_FLOAT_S8X24 family on purpose, so merging this would turn the workspace tests red. Most of the others assert that a value read back equals what was written, and the one piece of real logic (append-aligned offsets) already has appended_elements_are_aligned.

If this is mistaken, reply here with what was missed and it will be looked at again. Thank you for the contribution.

**@⁠Marvisak** on GitHub · 2026-11-25 21:59 UTC · [original](https://github.com/Marvisak/VIctory/pull/1207#issuecomment-7175805008) Automated triage for the maintainers, second look (a review against current `main`, with builds and tests where they could change the verdict). Closing because two of the eight tests fail on current `main` and the rest add little. `translates_render_target_and_depth_formats` and `input_layout_owns_semantic_names_and_describes_their_values` expect console formats 118/119/120 to map to the D24S8 family, but `resource::pc_format` now maps them to the D32_FLOAT_S8X24 family on purpose, so merging this would turn the workspace tests red. Most of the others assert that a value read back equals what was written, and the one piece of real logic (append-aligned offsets) already has `appended_elements_are_aligned`. If this is mistaken, reply here with what was missed 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!1207
No description provided.