Shaders: cover s_bfe_u32/s_bfe_i32 SCC, literal src1, dirty bits, and width>=32 in valu_tests #2060
No reviewers
Labels
No labels
accessibility
area: build
area: formats
area: gpu
area: loader
area: runtime
area: shader
bug
documentation
duplicate
enhancement
good first issue
gpu: amd
gpu: intel
gpu: nvidia
help wanted
host: wine
invalid
out of scope
question
request
run report
triage: confirmed
triage: has patch
triage: merge candidate
triage: needs info
triage: needs rebase
triage: needs work
triage: proposed close
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Marvisak--VIctory!2060
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/2060/head"
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?
@fuzeofficlal on GitHub · 2026-11-25 04:17 UTC · original
fuzeofficlal:test/shader-sbfe-valu-803→main· +126 −12 · 1 files · 1 commits · merged 2026-11-25 21:54 UTCAddresses #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.@jeremygold02 on GitHub · 2026-11-25 04:20 UTC · original
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.
@Marvisak on GitHub · 2026-11-25 09:25 UTC · original
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
@sinan-cmyk on GitHub · 2026-11-25 09:26 UTC · original
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).