fix(shader): reject unlowered VALU modifiers on f16 interpolation halves #3368
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3368"
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 reeledMarek on 2026-11-26T20:40:26Z.
Summary
Halves::pairacceptedv_interp_p1ll_f16without checking VALU modifiers (abs,neg,opsel,clamp,omod,sdwa,dpp), even though lowering skips P1 completely and silently drops any P1 modifiers.v_interp_p2_f16only lowers outputclamp,omod, andop_sel[3], while silently ignoring inputabs,neg, sourceop_sel[2:0],sdwa, anddpp.v_interp_p1ll_f16with"a modified first interpolation half"and unlowered input modifiers onv_interp_p2_f16with"a modified interpolation", while preserving P2's supportedclamp,omod, andop_sel[3].modified_f16_interpolation_halves_are_rejected.Verification
victory-shaderon Linuxcargo clippy -p victory-shader --all-targets --target x86_64-pc-windows-msvc --locked -- -D warningscargo test -p xtask --lockedImported from Marvisak/VIctory. Originally posted by Dukestar69 on 2026-11-26T20:49:27Z.
Review: APPROVED
LGTM — verified on Windows against
origin/main(63bcca4).v_interp_p1ll_f16(all modifiers) andv_interp_p2_f16(abs,neg, sourceop_sel,sdwa,dpp, while still permitting loweredclamp,omod, and destinationop_sel[3]) prevents silent miscompilation of modified f16 interpolation pairs.cargo test -p victory-shader --lib io:: -- --test-threads=1: 5 passed, 0 failed (includingmodified_f16_interpolation_halves_are_rejected).cargo clippy -p victory-shader --all-targets -- -D warnings: clean.cargo xtask policy: 191 files ok.Synthetic tests only (no game files used). AI-assisted (Gemini 4 Neon).
Imported from Marvisak/VIctory. Originally posted by fuzeofficlal on 2026-11-26T20:54:55Z.
Review: APPROVED
LGTM —
io::Halves::pairandio::raisecleanly reject modifiers onv_interp_p1ll_f16and unlowered input/lane modifiers (abs,neg,opsel & 0x7,sdwa,dpp) onv_interp_p2_f16, while preservingv_interp_p2_f16's loweredclamp,omod, andop_sel[3].Verified
emit/lower.rs:8066-8160andgfx10/{opcodes.rs, fields.rs}: no supported modifier is rejected and no other decodedv_interp_*opcode exposes unguarded VALU modifier fields.cargo clippy --locked -p victory-shader --all-targets -- -D warnings(default &--all-features): clean.rustfmt --edition 2024: clean acrosscrates/victory-shader/src/io.rs.cargo test --locked -p victory-shader --lib -- --test-threads=1 io:: emit::tests::(RTX 5090): 22 passed, 0 failed (includingmodified_f16_interpolation_halves_are_rejectedandinterpolated_f16_writes_the_op_sel_half_with_modifiers).Minor non-blocking note
modified_f16_interpolation_halves_are_rejectedcovers P1clamp/omod/abs/negand P2abs/neg/op_sel[1]; adding cases for P1op_seland P2op_sel[0]/op_sel[2]would guard every masked bit directly.Imported from Marvisak/VIctory. Originally posted by Jackster on 2026-11-26T22:36:56Z.
Windows 11,
63bcca4+ this PR:io::tests::modified_f16_interpolation_halves_are_rejectedby name: 1 passed.cargo test -p victory-shader --lib io::: green.cargo clippy -p victory-shader --all-targets -- -D warnings: clean.The rejection is at the decoder (
io.rs), so it runs without a device; the accepted forms are covered by the surroundingio::tests. Synthetic only. AI-assisted.View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.