Shaders: read explicit packed input padding as zero #621
No reviewers
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!621
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/621/head"
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?
@Halfect on GitHub · 2026-11-24 05:44 UTC · original
Halfect:fix/packed-input-explicit-row2→main· +143 −4 · 1 files · 2 commits · closed without mergingStacked on #592 at
35bf153; only7e5c7c8is new here. Once #592 merges, this is a one-commit follow-up.What
The six programs left by #592 explicitly name a second packed-input row (
row2 != row), but their input signature declares fewer halves in that row than the interpolation reads. Those trailing halves are packing padding.packed_input_halfnow distinguishes that case from a missing half under an inferred partner:Adds a synthetic regression test with four halves in the first row and two in the explicit second row. It checks the real second-row channel, both zero-padding positions, and that the same gap still fails with an inferred partner.
Offline title measurement
Local v1.0.2.1 shader archive,
translate --validate --list --jobs 1, comparing #59235bf153with this head7e5c7c8:Across 25,889 matched program labels, this revision has 0 DXIL validation gains and 0 losses. The six programs that previously gained validation against the older #592
7139712now stop earlier at the unrelateda scalar memory read as dataerror in both runs. That earlier failure masks this case at title level, so the synthetic regression is the direct behavioral check for this revision; the earlier +6 result is not claimed for this head.Checks
cargo test -p victory-shader: 91 passed, 0 failed, 1 benchmark ignored.cargo clippy -p victory-shader --all-targets -- -D warnings: clean.cargo xtask policy: 152 files ok.Offline translation and DXIL validation only; no title executable, world run, shader contents, or extracted data. AI-assisted (Kimi).
@slint6614-dev on GitHub · 2026-11-24 08:43 UTC · original
Measured on the full retail shader pack (26,503 containers) with
victory translate --validate --pipelines(pipelines created on an AMD RX 9070, Adrenalin, Windows 11; dxil.dll from SDK 10.0.26100), against main1f858b0. Counts are emitted / validated / pipelines.#621 clears all 172 (+123 validated pixel programs); #176 and #592 give identical results (+117, 6 left). CS and MS unchanged in all three.
@Halfect on GitHub · 2026-11-24 10:31 UTC · original
Rebased onto the updated #592
35bf153and pushed7e5c7c8after your review. Agit merge-tree --write-treecheck against current mainffe310ealso resolves cleanly.The non-f16 path cannot reach the new zero fallback:
packed_input_halfis called only underpack2 && f16, and the fallback itself is gated byf16 && explicit_second_row.Rebased checks: 91 passed, 0 failed, 1 ignored; Clippy,
cargo xtask policy(152 files), and the release build passed. The updated full-archive A/B is 0 gained / 0 lost because the previous six cases now stop earlier at the unrelateda scalar memory read as data; the PR body records that explicitly. Ready for another test run.@MichaelSmithAI on GitHub · 2026-11-24 10:42 UTC · original
Retested
7e5c7c8on its exact parent35bf153with the source-built pixel padding control. Microsoft DXV accepted the emitted pixel shader, and its DXIL was byte-identical to the priorfb6a9c1fixture output.On the RTX 4090 through Wine 11.22 and vkd3d-proton 3.1, the translated shader and independent DXC HLSL reference both returned
[0.125, -2.5, +0, +0]in all 64 pixels. The neighboring row carries[8, 16, 32, 64]to distinguish zero padding from reading that row. Both replays completed successfully. This is a source-built check of explicit row padding. The full-archive comparison and the six scalar-read refusals are covered by your separate run.@Halfect on GitHub · 2026-11-24 13:23 UTC · original
Thanks @MichaelSmithAI for the source-built retest on
7e5c7c8— good to have the DXV acceptance and the matching[0.125, -2.5, +0, +0]replays confirmed on both the translated shader and the DXC reference. Nothing further from my side on this head; ready for review.@Yaekai on GitHub · 2026-11-24 16:41 UTC · original
Independent verification on Windows 11 + NVIDIA RTX 3070 (Rust 1.98.1) at head
7e5c7c8:cargo test -p victory-shader --lib -- --skip valu_tests --skip waterfall_tests: 78 passed, 0 failed.cargo clippy -p victory-shader -- -D warnings: 0 warnings.1.0.2.1,--console series-s, 19-min world run): no regressions. Ready to merge once rebased onmain!@Halfect on GitHub · 2026-11-24 16:50 UTC · original
Thanks @Yaekai for the independent run — tests, clippy, and a 19-minute live world run with no regressions is a strong check.
On the rebase: this branch is stacked on #592 by design (its diff touches the explicit-second-row case that #592's inferred pairing leaves behind), so it can't move directly onto
mainwithout #592'shalf_input_partners. The moment #592 lands I'll rebase ontomainand it becomes the one-commit follow-up the body describes. Agit merge-tree --write-treecheck of the stack against currentmain(ffe310e) already resolves cleanly.@Marvisak on GitHub · 2026-11-25 00:26 UTC · original
Automated triage for the maintainers. Closing because this change is already in
main, ormainhas since replaced the code it patches.Stacked on #592; the 'padding' halves it reads as zero were an artifact of the row-pair rule. Main's first-fit rule maps every half read to a declared channel (4,773 of 4,773 pack2 pixel shaders).
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