GPU: add unit tests for pipeline/host.rs offsets, defaults, formats, and subobject parsing #1207
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1207"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from Marvisak/VIctory. Originally posted by geiyiliyabumo on 2026-11-24T16:25:48Z.
Summary
Closes #1079
Full verification details and change notes are documented in #1079 (commit
649c6e5, based onmainffe310e).Verification (Windows 11 x64 MSVC)
rustfmt --edition 2024 --checkon edited files: PASScargo xtask policy: PASS (zero game files/data)cargo clippy --all-targets --locked -- -D warnings(default +--features diagnosticswhere applicable): PASSAI-assisted; synthetic tests only, no game files.
Imported from Marvisak/VIctory. Originally posted by Zipettte on 2026-11-24T18:00:05Z.
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-gpupasses, 64 passed / 0 failed. Workspace baseline on main (ffe310e) is green on the same machine (342 passed).Tested with AI assistance (Claude).
Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T01:18:33Z.
Automated triage for the maintainers.
Merge candidate. Update after your trim: the production code of
crates/victory-gpu/src/pipeline/host.rsnow matchesmain. The alignment change, the new refusals and the formatting hunks are gone, and the diff is one hunk inmod tests. I checked the expected values by hand againstGraphicsState::readandelements.appended_inputs_respect_format_alignment_per_slotgives the right per-slot offsets forD3D12_APPEND_ALIGNED_ELEMENT(min(4, size) alignment, slots 0 and 31 kept apart).omitted_subobjects_use_d3d12_defaultsmatches the documented D3D12 defaults for blend, rasterizer and depth-stencil state. TheDEPTH_STENCIL1test 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, asreadexpects. The unaligned sample-mask case exercises theread_unalignedpath. Merges cleanly.CI: passing (
check).Generated by Claude Code
Imported from Marvisak/VIctory. Originally posted by geiyiliyabumo on 2026-11-25T02:20:41Z.
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.Imported from Marvisak/VIctory. Originally posted by geiyiliyabumo on 2026-11-25T04:03:29Z.
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).[PR #1207] GPU: validate input layouts and aligned vertex offsets in pipeline/host.rs with unit teststo [PR #1207] GPU: add unit tests for pipeline/host.rs offsets, defaults, formats, and subobject parsingImported from Marvisak/VIctory. Originally posted by geiyiliyabumo on 2026-11-25T06:56:30Z.
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).Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T21:59:50Z.
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
mainand the rest add little.translates_render_target_and_depth_formatsandinput_layout_owns_semantic_names_and_describes_their_valuesexpect console formats 118/119/120 to map to the D24S8 family, butresource::pc_formatnow 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 hasappended_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