Direct DXIL: bound relative moves by max_vgpr and refuse in per-lane bridge #2037
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
goal:world-load
good first issue
help wanted
invalid
keep-open
off-goal
question
stale
test-only
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/xcl-dev--xcl!2037
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-2037"
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?
@IAmTheSween on GitHub · 2026-11-25 01:29 UTC · original
IAmTheSween:direct-dxil-movrel-vgpr-bound→main· +73 −1 · 5 files · 1 commits · openFixes #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.@WebIdentity1 on GitHub · 2026-11-25 01:32 UTC · original
Coordination: this overlaps the existing #1961 (
4b4c111098a3b22e21dce00d41bc95ab3c11da8e), also addressing #1890. I inspected this head1c0407a40e38a10cb5b585243efd8d5d3145e692; I have not run it and am not reporting test results for it.Both changes replace the lowering-order-dependent
init.touchedbound with a program-widemax_vgpr. #1961 additionally initializes register gaps and transfers the possible relative range through the per-lane bridge, retaining inactive lanes, rather than refusing relative instructions. It only scans operands for programs using relative indexing, and is based on main after the automatic Direct DXIL source-cache hash change.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
translate, which uses the test-kernel entry; #1961's regression callstranslate_compute/compute_withand writes output to memory, covering the compute-entry initialization issue directly. These are different coverage claims. I suggest consolidating around the existing compute regression and making the per-lane support-versus-fallback choice explicitly, rather than maintaining parallel fixes. Separate swaprel destination semantics remain tracked in #803.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.
@raylitebull on GitHub · 2026-11-25 01:34 UTC · original
Diff audit passed (
kernel.rsmax_vgprscan,lower_wide.rstop_vgpr(),recomp/lower.rsper-laneV_MOVREL*/V_SWAPREL_B32refusal, and tests) and CI has been approved.Note that
#1961also targets#1890(with full per-lane dynamic VGPR range transfer verified across RTX 3090 + AMD iGPU, currently draft pending retail smoke). For#2037, remaining items before merge are pairedxcl-smoke v1blocks (PR descriptionfailed), an independent AMD GPU verification pass on1c0407a, and confirming whether#2037(per-lane refusal) or#1961(per-lane transfer) should land.@nnonno91 on GitHub · 2026-11-25 01:58 UTC · original
Independent AMD check of
1c0407a40e38a10cb5b585243efd8d5d3145e692. The two new direct-DXIL GPU fixtures also pass against the parent, so those fixtures give AMD execution coverage but don't reproduce the earlier register-bound behavior.Tested
XCL_ADAPTER=AMD RadeonandXCL_REQUIRE_GPU=wave64.cargo test --locked -p xcl --lib gpu::dxil::core_tests -- --nocapture --test-threads=1gave 15 passed, 0 failed and 1 ignored (dump_dxc_lowering). Both new relative move/swap fixtures executed in wave32. I also ran the same command with the exact filtersgpu::recomp::tests::gpu_packed_math_dots_movrelandgpu::recomp::lower::tests::dynamically_indexed_vgpr_moves_are_refused_in_per_lane, adding--exactafter--. Each gave 1 passed, 0 failed and 0 ignored. The packed math/relative move test ran withXCL_DIRECT_DXIL=1and checked all 64 lanes. NoSKIPPEDlines.8e87fc7b62a87ea589ccb9ea6182f514016cf7db, I copied only the new test code and used the same command with the filterswith_non_static_target_vgpranddynamically_indexed_vgpr_moves_are_refused_in_per_lanewithout--exact. The GPU tests gave 2 passed and 0 failed. The per-lane test gave 0 passed and 1 failed because the parent already returnedunsupported V_MOVRELD_B32, while the PR returned the reason specific to dynamic indexing. Both runs had 0 ignored and no skips.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.
@JoaoPauluu on GitHub · 2026-11-25 02:20 UTC · original
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
x86_64-pc-windows-gnu.1c0407aas it is (merge base withmain8e87fc7), no uncommitted changes. The lib test binary runs under Wine, one test per process.v_movrel_with_non_static_target_vgpr: ok, not skippedv_swaprel_with_non_static_target_vgpr: ok, not skippeddynamically_indexed_vgpr_moves_are_refused_in_per_lane: ok, not skippedNot tested
AI use
@IAmTheSween on GitHub · 2026-11-25 02:25 UTC · original
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.
@DavidM1911 on GitHub · 2026-11-25 04:28 UTC · original
Verification on RTX 3060 Ti (Windows 11), branch merged with current
main:cargo test -p xcl --lib: all passed, 0 failed, ~26 ignored. (Intermittent single-test flake / 0xc0000005 abort under parallel scheduling — tracked in #1978; clean on single-threaded rerun.)Thanks!
View command line instructions
Manual merge helper
Use this merge commit message when completing the merge manually.
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.