Shaders: lower s_bitreplicate_b64_b32 in pure 32-bit DXIL #2081
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2083"
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 geiyiliyabumo on 2026-11-25T04:30:22Z.
Summary
s_bitreplicate_b64_b32(opcode0x3b) incrates/victory-shader/src/emit/lower.rsusing pure 32-bit DXIL (4-step 16-to-32 bit interleave +even | (even << 1)for low and high halves), writing the 2-dword scalar destination without enablingInt64/WIDE_OPSand while preservingSCC.crates/victory-shader/src/emit/valu_tests.rscovering 8 bit patterns across both halves with bothSCC = 0andSCC = 1, verifying destination width and thatInt64is not set.Verification
cargo xtask policy: passedcargo clippy -p victory-shader --tests -- -D warnings: passedcargo test -p victory-shader --lib s_bitreplicatewith Microsoftdxil.dll: 2/2 passed on AMD Radeon RX 9060 XT (RDNA4) and Microsoft Basic Render Driver (WARP)Imported from Marvisak/VIctory. Originally posted by DenRakEiw on 2026-11-25T04:36:22Z.
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 s_bitreplicate_b64_b32_— 2 passed, 0 failed on both RTX 5090 hardware andVICTORY_D3D12_WARP=1(s_bitreplicate_b64_b32_ir_and_dxilands_bitreplicate_b64_b32_replicates_both_halves_and_preserves_scc)cargo clippy -p victory-shader --all-targets— 0 warningscargo xtask policy— ok (183 files ok)Clean pure-32-bit DXIL lowering of
s_bitreplicate_b64_b32replicating both halves and preserving SCC, verified on RTX 5090 + WARP. Looks good.AI-assisted (Gemini 4 Neon).
Imported from Marvisak/VIctory. Originally posted by jeremygold02 on 2026-11-25T04:39:54Z.
Triage verdict — Confirmed duplicate of the bit-replicate change in #166 (
fd1f5fa)Evidence
mainand also adds three independent bit-set and reversal instructions. This lowering · #166 loweringChecks and limits
Next step
This verification was AI-assisted.
Imported from Marvisak/VIctory. Originally posted by upipibi on 2026-11-25T04:41:35Z.
Ran on Windows 11 with an RTX 3070 (Ampere, driver 616.56), debug build, at
fd1f5fa.victory-shader: 246 passed, 3 failed, 3 ignored; the news_bitreplicate_b64_b32_ir_and_dxilands_bitreplicate_b64_b32_replicates_both_halves_and_preserves_sccpass. The 3 failures are #1744's NVIDIA failures onmain. Same asmainon this hardware. Not run: a title.AI-assisted (Claude Code).
Imported from Marvisak/VIctory. Originally posted by catminou4 on 2026-11-25T05:09:19Z.
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_bitreplicate_b64_b32 lowered in pure 32-bit DXIL — bit-replicate without i64.
Imported from Marvisak/VIctory. Originally posted by sinan-cmyk on 2026-11-25T09:04:31Z.
Offline measurement on a retail dump
Result: no count change against
main.I merged head
fd1f5fa2ontomain940d32f(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:31:54Z.
Automated triage for the maintainers.
This lowering of
s_bitreplicate_b64_b32inLower(emit/lower.rs, the wide SOP1 arm) duplicates #166, which is still open. #166 makes the same change to thewidetest, uses the same four-mask 16-bit spread with the finalx | x << 1for each half, and writes both SGPRs without touching SCC or needing Int64. It also lowerss_bitset0/1_b64ands_brev_b64. I compared the two lowering hunks, and they match. The extra input patterns and the explicit SCC/no-Int64 assertions here would be welcome as test additions on #166. Reason for closing: duplicate of the broader open PR #166. the PR will be closed in 48 hours unless the author pushes a change or a maintainer removes the label. CI: passing.Generated by Claude Code
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.