Repository navigation
shader: lower s_bitcmp{0,1}_b{32,64} and s_sext_i32_i{8,16} - #142
n-romanovich wants to merge 3 commits into
Conversation
|
This overlaps two open PRs by tedin7: #117 adds A possible split: Static review, not built or run. |
|
Tested
No game data used. AI-assisted (DeepSeek V4.1 Flash coding agent). |
…8,16} Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
RDNA2 hardware check of the six instructions: all match. Setup. AMD Radeon iGPU of a Ryzen 7 9800X3D, gfx1036 (RDNA2), AMD driver 32.0.21042.62, Windows 11 Pro 26200. Hand-written instructions in a HIP kernel (assembled by the AMD driver's amd_comgr). RDNA2 desktop silicon, not the console's. No game data. 130 cases: sources from edge values (
AI use: Claude Code (Claude Opus 5.5) wrote the probes, ran them on the GPU above and drafted this comment; the numbers come from the hardware run. |
…p redundant sext from no-scc list
|
Thanks for the review! Addressed the feedback and resolved the compilation issue in the latest commit. All tests pass cleanly. |
|
Tested head Merged onto current There's no text conflict, so GitHub still shows the PR as mergeable, but merging it as it is would break With
AI-assisted (Claude Code). |
|
Merged onto Checked with CI's steps (both clippy runs with |
… to resource::track per 6638098
|
Thanks for the catch, @alexdeliu! Merged latest main, dropped the duplicate s_bitcmp matching arm (now present via #117), and updated resource::track in the test to pass Some(&st) per 6638098. Verified with Clippy (-D warnings) and tests on hardware — all pass cleanly. |
|
@n-romanovich rechecked |
|
Automated triage for the maintainers. Closing because another open pull request covers the same change. See #120. s_bitcmp0/1_b32/_b64 are already lowered in main (lower.rs sop(), strip_prefix("s_bitcmp")); the only new lowering, s_sext_i32_i8/i16, is identical to #120's, which covers more. Its GPU test builds HostShader with the old field set and does not compile on main. If this is mistaken, reply here with what was missed (or push a change and say so) and it will be looked at again. Thank you for the contribution. |
Merge PR Marvisak#142: Translate BVH prefix scans on wave32 GPUs. Their tests in wave64_tests.rs are left out (the file diverged); our victory-shader tests run instead. (cherry picked from commit 8eefadc) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01YZ2Pr8swD7jDUjEfVNNuKC
[cool/play-1b: its new unit test calls lane_uniform, which on cool_fox takes codec_d's ordered_lds as well (see the first commit of Marvisak#142 here): given true, as the test has no LDS.] (cherry picked from commit 9e24afa)
Check the previous destination of swaps and accumulators. A conditional select needs a proven uniform predicate, since a scalar bit pattern can select different inputs in different lanes. Leave relative register accesses and operations with an implicit VCC input outside the proof. [cool/play-1b: its new unit test calls lane_uniform, which on cool_fox takes codec_d's ordered_lds as well (see the first commit of Marvisak#142 here): given true, as the test has no LDS.]
Adapt the far early-out and deep scalar-copy parts of fxceless/victory-fork#1002. This tree already tracks parked scalar pairs by lifetime. Retain that implementation and bring across the synthetic regressions, including the hardware gate. Adapted from fxceless/victory-fork@eaeb8f1 [cool/play-2: picked onto cool_fox f4b48ad + Marvisak#66 + Marvisak#142; wave64_tests.rs conflicted only because both sides add tests at its end: resolved by hand, both kept.] Co-authored-by: Bruno Magalhães <19572425+brunofgmag@users.noreply.github.com>
Implements DXIL lowering for six scalar ALU instructions in
victory-shader:s_bitcmp0_b32,s_bitcmp1_b32: extracts bitsrc1 & 31fromsrc0and writesSCC(== 0/!= 0).s_bitcmp0_b64,s_bitcmp1_b64: selects the low or high 32-bit dword viasrc1 & 32(without requiring DXILINT64), extracts bitsrc1 & 31, and writesSCC.s_sext_i32_i8,s_sext_i32_i16: sign-extends the low 8 or 16 bits ofsrc0toi32viashl+ashr(24/16) without modifyingSCC.Testing
emit::tests::scalar_bitcmp_and_sext_execute_on_gpuincrates/victory-shader/src/emit/mod.rs, covering all six opcodes (bit index masking, high-dwordb64bits, inline-1sign extension, positive/negativesext, andSCCpreservation).dxil.dlland executed the compute shader on D3D12 (NVIDIA GeForce RTX 5060 Ti).cargo test -p victory-shader: 58 passed, 0 failed.cargo clippy -p victory-shader --all-targets -- -D warnings: passed with 0 warnings.cargo xtask policy: passed (asset policy: 150 files ok).cargo test --workspace: all active tests passed (3 tests invictory-formatsignored without external reference files).