Shaders: cover v_cmp_class_f32 VOPC SGPR/literal, mask bits, and v_cmpx_class_* EXEC narrowing #2079
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2081"
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 fuzeofficlal on 2026-11-25T04:27:17Z.
Addresses #799.
Summary
Audited
Lower::compare("class") andlane_bits_for(v_cmpx_*) against RDNA2V_CMP_CLASS_F32/V_CMPX_CLASS_*semantics and added hardware + WARP tests invalu_tests::v_cmp_and_cmpx_class_f32_match_rdna2covering the paths not exercised by328eec1:v_cmpx_class_f32(0x098) &v_cmpx_class_f16(0x09f)EXECnarrowing: verifies directEXECmasking across matching and non-matching lanes without flushing denormals or quietingsNaN.v_cmp_class_f32_e32): covers SGPRsrc0(s0) and 32-bit literalsrc0(0xFFfollowed by raw+sNaNand-denormalbit patterns).src1[31:10]) & combined masks: verifies0xFFFF_FC00is ignored by hardware and exercises combined class masks across all 10 IEEE-754 binary32 class min/max boundaries.Testing
cargo test -p victory-shader --locked v_cmp_and_cmpx_class_f32_match_rdna2 -- --test-threads=1on hardware GPU (RTX 5090), WARP, anddxil.dllvalidation.cargo clippy --workspace --all-targets --all-features -- -D warningsandcargo xtask policy.Imported from Marvisak/VIctory. Originally posted by DenRakEiw on 2026-11-25T04:31:03Z.
Review: APPROVED
Verified locally merged onto
origin/main(940d32f, Windows 11 x64, NVIDIA GeForce RTX 5090 + WARP, Rust 1.98.1 MSVC, withdxil.dllvalidator):cargo test -p victory-shader --lib v_cmp_and_cmpx_class_f32_match_rdna2— passed on both RTX 5090 hardware andVICTORY_D3D12_WARP=1cargo clippy -p victory-shader --all-targets— 0 warningscargo xtask policy— ok (183 files ok)Thorough end-to-end GPU+WARP test coverage for
v_cmp_class_f32VOPC SGPR/literal operands, mask bits, andv_cmpx_class_*EXEC narrowing. Looks good.AI-assisted (Gemini 4 Neon).
Imported from Marvisak/VIctory. Originally posted by catminou4 on 2026-11-25T05:09:18Z.
Review: APPROVED
Tested locally: macOS arm64, rustc 1.98.1, PR head merged into main
940d32f69b,cargo test -p victory-shader --locked.144 passed / 0 failed / 2 ignored. v_cmp_class_f32 VOPC SGPR/literal coverage, mask bits — compare-class opcode completeness.
Imported from Marvisak/VIctory. Originally posted by sinan-cmyk on 2026-11-25T09:08:47Z.
Offline measurement on a retail dump
Result: no count change against
main.I merged head
616de417ontomain940d32f(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 Marvisak on 2026-11-25T10:30:58Z.
Automated triage for the maintainers.
This adds
valu_tests::v_cmp_and_cmpx_class_f32_match_rdna2. It is test-only and covers the"class"arm ofLower::compareinemit/lower.rsthrough the VOPC e32 form with an SGPR and a literalsrc0, mask bits above bit 9, andv_cmpx_class_f32/v_cmpx_class_f16narrowing EXEC. I decoded the hand-assembled VOPC words (0x088, 0x098, 0x09f; s0, v1, v2, literal 0xFF), and they match the comments. The expected values follow the class table thatsemantics_tests::classalready uses. The per-bit e64 cases mostly repeatsemantics_tests::class_compares_match_the_hardware. The new parts are the cmpx, SGPR and literal cases. CI: passing.Generated by Claude Code
Imported from Marvisak/VIctory. Originally posted by andrewpozdnakov7-jpg on 2026-11-28T13:58:45Z.
I combined your exact test commit
616de417and #374254c11a6on currentmainin3bf1e5d. Both PR commits are direct parents. The new comparison against current main plus your tests differs only in the class calculation.On Microsoft WARP 1.0.22 with Agility 1.620.2, your VOPC mask and CMPX EXEC regressions passed with the new lowering. The existing f16 and f32 classification tests also passed. A separate generated fixture checked 1,030,258 outputs against an exponent-and-fraction model on both trees, including every half bit pattern. The outputs matched exactly and both emitted class shaders used five fewer DXIL instructions. Strict all-feature shader Clippy and the asset policy passed.
@fuzeofficlal, the combined tree is available for merge coordination. Please retain Git authorship on cherry-pick or rebase. If folding #3742 into another commit, please add
Co-authored-by: andrewpozdnakov7-jpg <[email protected]>.AI-assisted with OpenAI Codex.
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.