Shaders: cover s_bfe_u32/s_bfe_i32 SCC, literal src1, dirty bits, and width>=32 in valu_tests #2058
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2060"
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:17:11Z.
Addresses #803.
Summary
Audited
Lower::bfeandLower::sopagainst RDNA2S_BFE_U32(0x27) /S_BFE_I32(0x28) semantics and expandedvalu_tests::bfe_signed_and_unsigned_match_rdna2to cover the remaining gaps beyond328eec1:s_bfe_u32&v_bfe_u32width wrapping: addss_bfe_u32GPU/WARP cases invalu_testsand verifies 5-bitwidth = 32 -> 0masking forv_bfe_u32alongsidev_bfe_i32.SCCcondition-code output (D != 0): verifiesSCCfor boths_bfe_i32(not previously checked viasop2_probe) ands_bfe_u32throughs_cselect_b32.src1(0xFF): exercises literaloffset | (width << 16)operands for both0x27and0x28(value andSCC).width = 64boundary: verifies hardware masking of unusedsrc1[15:5]andsrc1[31:23]bits (0xFF80_FFE0) andwidth = 64(wherewidth >= 32whilewidth & 31 == 0).Testing
cargo test -p victory-shader --locked bfe_signed_and_unsigned_match_rdna2across hardware D3D12 adapters (RTX 5090, RDNA2), WARP, anddxil.dllvalidation.cargo clippy --workspace --all-targets --all-features -- -D warningsandcargo xtask policy.Imported from Marvisak/VIctory. Originally posted by catminou4 on 2026-11-25T04:33:49Z.
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. s_bfe_u32/s_bfe_i32 SCC coverage, literal src1, dirty-bit handling — BFE opcode completeness.
Imported from Marvisak/VIctory. Originally posted by DenRakEiw on 2026-11-25T04:36:27Z.
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 bfe— 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
s_bfe_u32/s_bfe_i32SCC, literalsrc1, dirty upper bits, andwidth >= 32. Looks good.AI-assisted (Gemini 4 Neon).
Imported from Marvisak/VIctory. Originally posted by jeremygold02 on 2026-11-25T04:20:23Z.
Triage verdict — Keep the expanded coverage as a standalone test change (
a3479b2)Evidence
mainalready covers the unsigned scalar value and SCC cases described in #803. @fuzeofficlal’s additional cases cover signed SCC, literal operands, ignored packed bits, and the width-64 wrapping boundary. Those assertions add coverage beyond the original issue. Existing scalar coverage · Expanded fixtureChecks and limits
Next step
This verification was AI-assisted.
Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T09:25:09Z.
Automated triage for the maintainers.
Merge candidate.
This only adds tests. It extends
bfe_signed_and_unsigned_match_rdna2incrates/victory-shader/src/emit/valu_tests.rs(#803) with:s_bfe_u32valuess_cselect_b32src1, with the unused bits[15:5]and[31:23]setv_bfe_u32I checked the expected values by hand against the documented RDNA2 BFE formula,
(S0 >> S1[4:0]) & ((1 << S1[22:16]) - 1)with SCC = result != 0. The values follow that formula rather than just matchingLower::bfeinlower.rs. The width ≥ 32 → full-mask reading matches the width-32 casemainalready asserts. No other open PR adds these cases.CI: passing (
check).Recommending a look, not approving.
Generated by Claude Code
Imported from Marvisak/VIctory. Originally posted by sinan-cmyk on 2026-11-25T09:26:50Z.
Offline measurement on a retail dump
Result: no count change against
main.I merged head
a3479b25ontomain940d32f(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).