Repository navigation
Direct DXIL: bound relative moves by max_vgpr and refuse in per-lane bridge - #2037
IAmTheSween wants to merge 1 commit into
Conversation
|
Coordination: this overlaps the existing #1961 ( Both changes replace the lowering-order-dependent The existing #1961 compute-entry regression and native results are available for consolidation: four move forms plus inactive lanes, Direct DXIL and per-lane, 20 RTX 3090 dispatches and 30 AMD iGPU dispatches including native wave64, all 64 words per dispatch. Its identical test-only baseline fails on both GPUs. The current full-suite comparison and remaining CLAMP failure are documented there; retail smoke is still absent, so #1961 remains draft. The two new tests here call No new implementation or duplicate test run from this coordination check. AI-assisted source comparison/report: Codex (GPT-6); the linked historical measurements retain their original attribution. |
|
Diff audit passed ( Note that |
|
Independent AMD check of Tested
Not tested Full workspace suite, retail smoke, or a before/after shader that reproduces the original register-bound issue. AI use OpenAI Codex (GPT-6.2 Sol) ran the tests, checked the logs and drafted this report. |
|
A run with vkd3d-proton as the host D3D12 (DXIL → SPIR-V through dxil-spirv, then the NVIDIA Vulkan driver), so the DXIL goes through a different compiler than the native-Windows runs here: this PR's 3 tests pass. Tested
Not tested
AI use
|
Thanks for reaching out! The choice here to refuse V_MOVREL* and V_SWAPREL_B32 in bridge() was intentional: bridging (0..=max_vgpr) transfers the entire register file across every dynamically indexed move, which inflates SSA inputs and outputs for instructions that usually only touch a small runtime offset. Routing these moves to the fallback keeps the per-lane bridge minimal and bounded to statically known operands. That said, your synthetic multi-dispatch compute regression in #1961 is very comprehensive. If the maintainers prefer retaining per-lane execution by bridging the whole range over falling back, I am glad to either pull in that bridging approach and compute test here, or help land #1961 with these retail smoke numbers. |
…bridge Fixes xcl-dev#1890. In direct DXIL, Lw::top_vgpr() computed the upper bound for v_movrel* and v_swaprel_b32 select loops from self.init.touched, which starts empty outside Entry::Kernel and is cleared before each instruction in XCL_PER_LANE=1. Any relative move with m0 > 0 targeting a VGPR not statically touched earlier in RPO order was silently truncated. Lw::max_vgpr now scans insts in Lw::new matching the HLSL emitter, and top_vgpr() returns self.max_vgpr. In the per-lane recompiler, bridge() refuses dynamically indexed relative moves upfront to route them through the fallback. Assisted-by: Antigravity (Gemini 3.8 Flash)
1c0407a to
4fc9719
Compare
Fixes #1890. In direct DXIL,
Lw::top_vgpr()computed the upper bound forv_movrel*andv_swaprel_b32select loops fromself.init.touched, which starts empty outsideEntry::Kerneland is cleared before each instruction inXCL_PER_LANE=1. Any relative move withm0 > 0targeting a VGPR not statically touched earlier in RPO order was silently truncated.Lw::max_vgprnow scansinstsinLw::newmatching the HLSL emitter, andtop_vgpr()returnsself.max_vgpr. In the per-lane recompiler,bridge()refuses dynamically indexed relative moves upfront to route them through the fallback.What is in it
crates/xcl/src/gpu/dxil/lower.rs:max_vgprfield onLwcrates/xcl/src/gpu/dxil/kernel.rs: scanmax_vgpracross program instructions inLw::newcrates/xcl/src/gpu/dxil/lower_wide.rs:top_vgpr()returnsself.max_vgprcrates/xcl/src/gpu/recomp/lower.rs: refuseV_MOVREL*andV_SWAPREL_B32inbridge()crates/xcl/src/gpu/dxil/core_tests.rs: tests forv_movrel*andv_swaprel_b32with non-static target VGPRscrates/xcl/src/gpu/recomp/lower.rs: test verifying refusal of dynamic moves in per-lane loweringTested
cargo test -p xcl --lib gpu::dxil::core_tests: 17 passed, 0 failed, 1 ignoredcargo test -p xcl --lib gpu_packed_math_dots_movrel: passedcargo test -p xcl --lib dynamically_indexed_vgpr_moves_are_refused_in_per_lane: passedpython scripts/test_pr_check.py: 13 passed, 0 failedRegression run
scripts/smoke.ps1onmain(8e87fc7b62a87ea589ccb9ea6182f514016cf7db) and on this PR's head commit (4fc971951041a6adf2f423633306049eadc9be53):Not tested
AI use
lower_wide.rs,kernel.rs, andlower.rs, authored regression tests, verified against D3D12 DXIL runner, and executed 60-second retail regression smoke runs on main and PR head.