Repository navigation
recomp/dxil: f16 signature packing, CFG v_interp modes, bounded movrel/M0[7:0], and MS barriers - #1975
recomp/dxil: f16 signature packing, CFG v_interp modes, bounded movrel/M0[7:0], and MS barriers#1975raylitebull wants to merge 3 commits into
Conversation
|
Update: verified the author's integration repair at 6 passed / 0 failed / 0 ignored, zero skips. The existing 20-dispatch compute-output regression passes all 1,280 words across Direct DXIL/per-lane and wave32/split-wave64, including inactive lanes. Both Direct DXIL movrel checks, the M0-bounds and bounded-switch checks, and the swaprel switch test also pass. Native Windows 10 19045 / Ryzen 7800X3D / RTX 3090 driver 591.74 / Rust 1.98.1 MSVC / DXC 1.8.2502.11, debug; Original reproducer, proposed patch and earlier resultsVerified the #1961 / #1890 interaction on Tested — native Windows 10 19045, Ryzen 7 7800X3D, RTX 3090 driver 591.74, Rust 1.98.1 MSVC, DXC 1.8.2502.11, debug;
The patch uses #1961's Integration patch on top of #1975 + #1961diff --git a/crates/xcl/src/gpu/dxil/lower_valu.rs b/crates/xcl/src/gpu/dxil/lower_valu.rs
index fb749a7..99b7b08 100644
--- a/crates/xcl/src/gpu/dxil/lower_valu.rs
+++ b/crates/xcl/src/gpu/dxil/lower_valu.rs
@@ -1360,17 +1360,6 @@ impl Lw {
}
}
- /// Highest VGPR touched so far (for relative VGPR indexing upper cap).
- fn touched_top_vgpr(&self) -> u64 {
- self.init
- .touched
- .iter()
- .filter(|&&v| (VAR_VGPR..VAR_VGPR + 256).contains(&v))
- .map(|&v| (v - VAR_VGPR) as u64)
- .max()
- .unwrap_or(0)
- }
-
/// Range-bounded `v_movrel*`: avoids touching/selecting across unrelated VGPRs when `M0`
/// is a compile-time constant or carries a provable `UMin`/SSA upper bound.
fn movrel_bounded(&mut self, d: &Decoded, name: &str) -> LResult<()> {
@@ -1381,7 +1370,7 @@ impl Lw {
let vdst = Self::fv(d, "VDST");
let m0 = self.sreg(124);
let m0_lo = self.andc(m0, 0xFF);
- let top = self.touched_top_vgpr().max(vdst).max(src_code.saturating_sub(256));
+ let top = self.max_vgpr.max(vdst).max(src_code.saturating_sub(256));
let (rd_idx, wr_idx) = match name {
"v_movrels_b32" => (Some(m0_lo), None),
"v_movreld_b32" => (None, Some(m0_lo)),
@@ -1458,7 +1447,7 @@ impl Lw {
return err(d, "swaprel: the source is not a VGPR");
}
let base = src_code - 256;
- let top = self.touched_top_vgpr().max(vdst).max(base);
+ let top = self.max_vgpr.max(vdst).max(base);
let m0 = self.sreg(124);
let m0_lo = self.andc(m0, 0xFF);
let a = self.act();Not tested: this PR's unrelated changes, the full combined workspace suite, retail smoke, AMD/native wave64, or compilation-time/memory improvements. This checks relative moves; it does not settle the separate swaprel destination-semantics issue in #803. No performance inference is made from a control producing incorrect output. AI use: Codex with GPT-6 Astra inspected the integration, prepared the small adjustment, ran the paired Windows tests and drafted this report. |
367982c to
b62e6e3
Compare
|
Thanks for catching the Updated Verified locally with |
|
Full-suite run, since this PR has no test report yet. Tested exact head Tested
Not tested
AI use
|
|
Tested Clean PR head cargo test --locked -p xcl --lib --no-run
cargo test --locked -p xcl --lib -- gpu::dxil::lower_valu::fidelity_tests::direct_dxil_movrel_masks_m0_low_byte --exact --test-threads=1 --show-outputThe build succeeded. The CPU test translated and validated a Direct DXIL compute kernel with nonzero upper M0 bits, then checked the disassembly for a low-byte mask. 1 passed, 0 failed, 0 ignored, 0 skips. $env:XCL_ADAPTER = 'A770'
$env:XCL_SPLIT_WAVE64 = '1'
$env:XCL_REQUIRE_GPU = 'wave64'
& 'L:/XclTooling/Invoke-ArcTest.ps1' -Test {
$env:XCL_DIRECT_DXIL = '0'
cargo test --locked -p xcl --lib -- gpu::recomp::tests::gpu_v_swaprel_b32 --exact --test-threads=1 --show-output
$env:XCL_DIRECT_DXIL = '1'
cargo test --locked -p xcl --lib -- gpu::recomp::tests::gpu_v_swaprel_b32 --exact --test-threads=1 --show-output
}Both locked A770 runs dispatched a split-wave64 compute test kernel. HLSL used DXC Not tested GPU output with nonzero upper M0 bits, the title compute pipeline, VS/PS/MS attribute and barrier changes, native wave64 hardware, integration with #1961, the full workspace suite, and retail smoke. AI use Codex ( |
…ing, and bounded movrel ranges
…n-uniform MS barriers
b62e6e3 to
a85fa25
Compare
|
Rebased
|
Fixes several shader fidelity issues across both the HLSL recompiler and the Direct DXIL translator:
v_interpmode tracking & pairedf16attributes (HIGHbit / packed inputs): tracks interpolation modes across copied, reused, and joinedv_interpregisters, supports 16-bit signature packing/unpacking (from_d3d/place/ps_attribute_slot_and_comp) for VS/MS/PS including compressed VS params and pairedf16PS attributes.v_movrel/v_swaprelranges &M0[7:0]masking: propagatesM0bounds across constants, masks, clamps, and counted loops (m0_bounds), emits bounded switch cases, and masksM0to the low byte (M0[7:0]) in both HLSL and Direct DXIL (Lw::movrel/Lw::swaprelinlower_wide.rsviaself.top_vgpr()).s_barrierusage in mesh shaders (has_non_uniform_barrier) in both backends.Part of #1269.
What is in it
crates/xcl/src/gpu/recomp/mod.rs&crates/xcl/src/gpu/recomp/emit.rs: addps_attribute_slot_and_compandf16paired-attribute unpacking, CFGv_interpmode tracking,m0_boundsanalysis andM0[7:0]masking forv_movrel/v_swaprel, bounded switch generation, and non-uniform mesh barrier handling (has_non_uniform_barrier), preserving#2008'sif let Some(e)EXP VMsurvival flow alongside 16-bitSV_Targetcomponent types.crates/xcl/src/gpu/dxil/graphics.rs,kernel.rs,lower.rs,lower_gfx.rs,lower_mem.rs,lower_valu.rs,lower_wide.rs: 16-bit signature row packing/unpacking in Direct DXIL (VS/MS/PS),M0[7:0]masking andconst_u64/value_upper_boundrange-narrowing insideLw::movrel/Lw::swaprel, and non-uniform MS barrier guarding.crates/xcl/src/gpu/recomp/tests.rs&fidelity_tests/attribute_tests: targeted tests acrossgpu::dxil::graphics::fidelity_tests,gpu::dxil::lower_valu::fidelity_tests,gpu::recomp::emit::fidelity_tests, andgpu::recomp::attribute_tests, plusv_swaprel_b32_uses_the_m0_relative_switch.Tested
rustc 1.99.1 (58cf8f9c3 2026-10-13), rebased cleanly ontoae0518c(a85fa25).a85fa25was rebased cleanly ontoae0518c(resolving#2008'sEXP VMrefactor inemit.rsvia pure git during a local test hold); queued for GitHub ActionsBuild and testand fresh AMD / NVIDIA verification (fidelity_tests,attribute_tests,v_swaprel_b32_uses_the_m0_relative_switch).b62e6e3(onto6567c5f) passedcargo check --workspace --tests,fidelity_tests(15/15),attribute_tests(4/4), andv_swaprel_b32_uses_the_m0_relative_switch(1/1).Regression run
scripts/smoke.ps1pair and tests on rebaseda85fa25vsae0518chave not been run yet. AMD and NVIDIA reviewers are invited to test ona85fa25vsae0518c(includingscripts/smoke.ps1,XCL_DIRECT_DXIL=1, and HLSL recompilation paths) and post results in the comments.Not tested
cargo check/fidelity_tests/attribute_testsand 60 sscripts/smoke.ps1pair on rebased heada85fa25, fullcargo test --workspacesuite, runtime GPU execution across AMD / NVIDIA / Intel hardware, and Linux/Wine/vkd3d-proton.AI use