Cover VOP3 conversion modifiers #2157
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2159"
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 Halfect on 2026-11-25T06:35:20Z.
Refs #1249 (
VIC-BT-028).Both conversions are intercepted by
valu16beforevalu_op's main match, so the shared implementation already applies VOP3 modifiers. The two low-half conversion arms later in that match are unreachable. Remove those arms and their now-unused helper, leaving one modifier-aware path.Add portable lowering coverage for VOP1/VOP3 parity and for
clamp,abs, andnegaffecting the generated DXIL. Add hardware/WARP probes for low-half f16 source modifiers, f32 clamp before narrowing, ordinary conversion controls, and preservation of the destination's high half.Validation on macOS:
cargo test --locked -p victory-shader --lib— 145 passed, 2 ignoredcargo xtask policygit diff --checkWindows CI passed for head
7b952ec: run45561725699, including clippy for all targets/features andcargo test --workspace --locked. The conversion probe test is included in that workspace test command; this does not by itself establish that a physical GPU rather than WARP executed it.The portable modifier regression also passes on the base revision, confirming that this is coverage plus dead-code cleanup rather than a claim to fix a still-reproducible modifier bug.
Imported from Marvisak/VIctory. Originally posted by DenRakEiw on 2026-11-25T06:45:57Z.
Review: APPROVED
Verified locally merged onto
origin/main(940d32f, Windows 11 x64, Rust 1.98.1 MSVC):cargo test -p victory-shader --lib vop3_conversion_modifiers— passedcargo clippy -p victory-shader --all-targets— 0 warningscargo xtask policy— ok (183 files ok)Clean test coverage and handling of VOP3 conversion modifiers. Looks good.
AI-assisted (Gemini 4 Neon).
Imported from Marvisak/VIctory. Originally posted by catminou4 on 2026-11-25T06:54:17Z.
Review: APPROVED
Tested locally: macOS arm64, rustc 1.98.1, PR head merged into main
940d32f69b,cargo test -p victory-shader --locked.145 passed / 0 failed / 2 ignored. VOP3 conversion modifiers covered (+1 test) — test coverage for VOP3 cvt modifier encodings.
Imported from Marvisak/VIctory. Originally posted by Dathinel on 2026-11-25T06:42:44Z.
Ran the Windows-only conversion probes on an RTX 3050 Laptop (driver 32.0.16.1062) and WARP. I tested both
7b952ecand its parent940d32fwith only the PR'ssemantics_tests.rscopied onto the parent.The seven added probes covered 94 input/modifier combinations per backend on each revision: 5 × 16 for widening and 2 × 7 for narrowing. Both revisions had zero model mismatches and zero hardware/WARP differences in those records. The narrowing checks also compare the preserved upper half of the destination. This supports the coverage-only interpretation for these inputs.
Command:
cargo test --frozen -p victory-shader --lib emit::semantics_tests::conversions_match_the_hardware -- --exact --nocapture --test-threads=1. AI-assisted.Imported from Marvisak/VIctory. Originally posted by sinan-cmyk on 2026-11-25T08:06:12Z.
Offline measurement on a retail dump
Result: no count change against
main.I merged head
7b952eceontomain940d32f(clean merge) and ranvictory translate --validate --listonshaders.rpf(1.0.2.1), with dxil.dll 1.8.2502.11. I compared the result withmainprogram by program (25,889 programs). Validated: 23,918 onmain, 23,918 with this PR.No program changes its failure reason. The count shows that the change rejects nothing on this data. It does not show whether the output is right.
No shader names or data are included, per the asset policy. AI-assisted (Claude Code).
Imported from Marvisak/VIctory. Originally posted by Halfect on 2026-11-25T09:22:40Z.
Thanks @Dathinel for the hardware/WARP probe runs and @sinan-cmyk for the full-archive A/B.
Both results line up with the coverage-only claim of this PR: the modifier regression passes identically on the base revision (zero model mismatches and zero hardware/WARP differences across your 94-combination probes on both revisions), and the archive comparison shows no count change (23,918 validated on both
mainand this head) with no program changing its failure reason. That is exactly the intent here — remove the two unreachable duplicate arms and pin the VOP3 modifier behavior with portable tests, without changing any emitted output on the title data. Nothing further from my side; ready for review.Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T11:26:19Z.
Automated triage for the maintainers.
Merge candidate. Dead-code removal plus test coverage, with no behaviour change. Recommending a look, not approving.
mainthatvalu16incrates/victory-shader/src/emit/lower.rsreturnsSomeforv_cvt_f16_f32andv_cvt_f32_f16every time (the explicitmatches!guard), andvalu_opcalls it before its main match. The twoopsel == 0conversion arms this PR removes from that match were therefore unreachable.low_halfhad no other caller. The live path,valu16_op, already applies the source modifiers (half_fsrc) and clamp beforenarrow16.vop3_conversion_modifiers_affect_the_loweringchecks that VOP3 without modifiers lowers exactly like VOP1, and thatclamp,absandnegchange the DXIL. The newconversion_probesinsemantics_tests.rscheck f16 source modifiers before widening, clamp before narrowing, and that the destination's high half is kept. As the PR says, they pass on the base revision as well. The thread reports them matching on an NVIDIA card and WARP, and no validation change over the title's shaders.CI:
checkpassing.Generated by Claude Code