Shaders: lower s_sext_i32_i8 and s_sext_i32_i16 in pure 32-bit DXIL #2075
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2077"
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:24:07Z.
Summary
s_sext_i32_i8(opcode0x19) ands_sext_i32_i16(opcode0x1a) incrates/victory-shader/src/emit/lower.rsusing pure 32-bit DXIL (shl+ashrby 24/16), without enablingInt64/WIDE_OPSand while preservingSCC.crates/victory-shader/src/emit/valu_tests.rscovering 10 boundary input vectors across both instructions with bothSCC = 0andSCC = 1, verifying single-dword operand/result widths and thatInt64is not set.Verification
cargo xtask policy: passedcargo clippy -p victory-shader --tests -- -D warnings: passedcargo test -p victory-shader --lib s_sext_i32with 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:31:07Z.
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_sext_i32_— 2 passed, 0 failed on both RTX 5090 hardware andVICTORY_D3D12_WARP=1(includings_sext_i32_lowers_without_int64_and_preserves_scc_on_gpu)cargo clippy -p victory-shader --all-targets— 0 warningscargo xtask policy— ok (183 files ok)Clean pure-32-bit DXIL lowering of
s_sext_i32_i8ands_sext_i32_i16preserving SCC, verified on hardware and WARP. Looks good.AI-assisted (Gemini 4 Neon).
Imported from Marvisak/VIctory. Originally posted by catminou4 on 2026-11-25T04:34:43Z.
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. s_sext_i32_i8/s_sext_i32_i16 lowered in pure 32-bit DXIL — sign-extension ops without i64.
Imported from Marvisak/VIctory. Originally posted by jeremygold02 on 2026-11-25T04:33:03Z.
Triage verdict — Keep the focused sign extension and reconcile #120’s overlap (
b92ae69)Evidence
mainstill lacks. Current patch · #120 patchChecks and limits
Next step
This verification was AI-assisted.
Imported from Marvisak/VIctory. Originally posted by upipibi on 2026-11-25T04:41:36Z.
Ran on Windows 11 with an RTX 3070 (Ampere, driver 616.56), debug build, at
b92ae69.victory-shader: 246 passed, 3 failed, 3 ignored; the news_sext_i32_has_single_dword_operands_and_preserves_scc_in_irands_sext_i32_lowers_without_int64_and_preserves_scc_on_gpupass. 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 sinan-cmyk on 2026-11-25T09:14:01Z.
Offline measurement on a retail dump
Result: no count change against
main.I merged head
b92ae691ontomain940d32f(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:29:29Z.
Automated triage for the maintainers.
This lowers
s_sext_i32_i8ands_sext_i32_i16inLower::sop(crates/victory-shader/src/emit/lower.rs) asshlfollowed byashrby 24 or 16. That matches the GFX10 ISA: the low byte or halfword is sign-extended and SCC is not written. Main already decodes both opcodes (0x19 and 0x1a ingfx10/opcodes.rs) but did not lower them. The new tests check operand widths and SCC flow in the IR, that the shader does not use the Int64 feature, and boundary values on the GPU and WARP. CI passes.This overlaps two arms of #120, which needs a rebase and only checks that lowering succeeds. If this merges first, #120 should drop those two arms. One retail census in the comments found no change in validated counts, so the title's benefit is not yet shown.
Generated by Claude Code
Imported from Marvisak/VIctory. Originally posted by fuzeofficlal on 2026-11-26T01:42:42Z.
Code review and RTX 5090 + WARP + DXIL verification at head
b92ae69133a0merged cleanly ontomain(63bcca43c6a0;emit/lower.rs=520,887B,3,401B under the 512 KiB cap):crates/victory-shader/src/emit/lower.rs:3995-4000):Shl(a, 24/16)followed byAShr(..., 24/16)cleanly masks dirty upper bits and sign-extends low 8/16-bit values without touchingSCCor requiringInt64.dxil.dll10.0.26100.0,VICTORY_D3D12_DEBUG=1, Rust 1.98.1):cargo xtask policy:191 files ok;cargo clippy(default +--features diagnostics): 0 warningss_sext_i32(2/2),emit::lower::tests(33/33), andemit::semantics_tests(34/34 on both RTX 5090 and WARP, 1 ignored) all passed.LGTM.
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.