Repository navigation
fix(shader): reject unlowered VALU modifiers on f16 interpolation halves - #3368
Open
reeledMarek wants to merge 1 commit into
Open
reeledMarek wants to merge 1 commit into
reeledMarek wants to merge 1 commit into
Conversation
Dukestar69
approved these changes
Nov 26, 2026
Dukestar69
left a comment
There was a problem hiding this comment.
LGTM — verified on Windows against origin/main (63bcca4).
- Rejecting unlowered modifiers on
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).
fuzeofficlal
approved these changes
Nov 26, 2026
fuzeofficlal
left a comment
Contributor
There was a problem hiding this comment.
LGTM — io::Halves::pair and io::raise cleanly reject modifiers on v_interp_p1ll_f16 and unlowered input/lane modifiers (abs, neg, opsel & 0x7, sdwa, dpp) on v_interp_p2_f16, while preserving v_interp_p2_f16's lowered clamp, omod, and op_sel[3].
Verified
- Cross-checked against
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 --locked