GPU: validate input layouts and aligned vertex offsets in pipeline/host.rs with unit tests #1079
Labels
No labels
accessibility
area: build
area: formats
area: gpu
area: loader
area: runtime
area: shader
bug
documentation
duplicate
enhancement
good first issue
gpu: amd
gpu: intel
gpu: nvidia
help wanted
host: wine
invalid
out of scope
question
request
run report
triage: confirmed
triage: has patch
triage: merge candidate
triage: needs info
triage: needs rebase
triage: needs work
triage: proposed close
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Marvisak--VIctory#1079
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
@geiyiliyabumo on GitHub · 2026-11-24 15:32 UTC · original
Summary
Fixes input-layout validation and appended vertex-offset calculation bugs in
crates/victory-gpu/src/pipeline/host.rs(previously 0 unit tests) and adds 14 deterministic synthetic unit tests.Because external PR creation is currently restricted (
collaborators_only), the CI-green branch is ready on my fork for cherry-pick / review:geiyiliyabumo/VIctory@test/gpu-pipeline-hostgeiyiliyabumo/VIctory@649c6e5(based onmainffe310e)Changes (
crates/victory-gpu/src/pipeline/host.rs)> 32, input slots outside0..=31, nullSemanticName, and null/misaligned element arrays with nonzero counts.D3D12_APPEND_ALIGNED_ELEMENT) vertex offsets now account for per-slot format alignment and reject arithmetic overflow.Verification (Windows 11 x64 MSVC)
rustfmt --edition 2024 --check crates/victory-gpu/src/pipeline/host.rs: PASScargo xtask policy: PASS (154 files ok)cargo clippy -p victory-gpu --all-targets --locked -- -D warnings(default +--features diagnostics): PASS (0 warnings)cargo test -p victory-gpu --locked -- pipeline::host::: 14 passed, 0 failedAI-assisted; synthetic tests only, no game files.
@MichaelSmithAI on GitHub · 2026-11-24 15:40 UTC · original
The alignment change fixes an observable attribute value in VIctory’s CPU rectangle expansion, even with a single input slot. We tested an 8-byte vertex with R8_UINT at offset 0 and an appended R32_FLOAT at offset 4. With input floats 1.0, 3.0 and 7.0, the generated fourth vertex contained the expected 5.0. Restoring just the previous offset calculation produced 1.0 with the same input.
All 14 authored tests passed on the gstack integration. The full GPU crate run under Wine had 99 passes, one ignored test and the existing empty-pipeline-library failure. The rectangle control inspected the expanded vertex bytes. Native triangle input assembly resolves append offsets independently, and title use of this CPU expansion layout is still open.
@Marvisak on GitHub · 2026-11-25 10:01 UTC · original
Automated triage for the maintainers.
The appended-offset part is already in
main.GraphicsState::elementsincrates/victory-gpu/src/pipeline/host.rsnow places aD3D12_APPEND_ALIGNED_ELEMENTat the next multiple of min(4, its size) on its input slot. That came from PR #618, merged 2026-11-25, and covers the R8_UINT then R32_FLOAT case tested in the comment.These parts are not in
main:These checks guard against malformed descriptions from the title, not against a failure seen in a run. Open PR #1207, from the same author, adds tests for this file. Please carry the remaining validation there, or in a new pull request (now open to everyone), rebased on #618 so the maintainers can review it.
Generated by Claude Code