Recompiler: 2-D and 3-D compute groups take the direct DXIL route again #3189
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3189"
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 ivall/xcl. Originally posted by Royalflamejlh on 2026-11-28T17:16:15Z.
d9403543sends every compute program with a 2-D or 3-D thread group to the HLSL path ("multidimensional groups need the HLSL console-linear thread reorder"). The direct translator has had that reorder since746f7ddc:Lw::setup_lanes_compute(gpu/dxil/lanes.rs) hands each hardware wave the next console threads through a groupshared counter, as the HLSL entry'sXCL_WTblock does, and the split wave64 form numbers its threads asxcl_x_threaddoes. So the rule only keeps these programs off the direct route. Under Wine + vkd3d-proton, single driver builds of their HLSL-path DXIL from a retail title reached 43.8 and 45.9 GB and stopped every launch pass on our 62 GB Linux machine (4 runs).This removes the rule.
pso.rsis outside the translator source hash, soTRANSLATION_GLUE_REVISIONgoes topso-glue-v5; without it the translated-shader cache keeps serving the HLSL translations of these programs (one of our runs reused all 26,503 cached records in 10 s and built them again).It adds to #3154: most of these programs then hit the DispatchX prologue's "instruction after a terminator" that #3154 fixes (with both, 556 of the title's 751 multidimensional compute programs translate directly in the split wave64 form, 655 in the native form; 238 and 273 with this alone).
What is in it
crates/xcl/src/gpu/recomp/pso.rs:direct_compute_needs_hlsl, its call and its test removed.crates/xcl/build.rs:TRANSLATION_GLUE_REVISION=pso-glue-v5.crates/xcl/src/gpu/recomp/tests.rs:direct_compute_translates_2d_and_3d_groups(8x8x1 and 4x4x4 throughpso::direct_computeas wave32, wave64 and split wave64, validated under test; fails with the rule) andgpu_direct_compute_waves_take_consecutive_threads_of_2d_and_3d_groups(each lane holds the console's consecutive threads: lane = t % lanes andv_readfirstlane= t − lane, for 8x8x1, 4x4x4 and 8x8x4).Tested
x86_64-pc-windows-gnu:cargo test -p xcl --lib -- recomp:: gpu::dxil --test-threads=4: 654 passed, 1 failed, 23 ignored (maindb3921dc: 653 / 1 / 23; the failure isgpu::dxil::round_tests::directed_reference_basicson both); about 351 GPU tests SKIPPED ("no GPU").f12eb2fd(this commit before a rebase onto10d27297, same tree): the two new tests,gpu_compute_mode_dispatch_abi,gpu_split_wave64_waves_divergeanda_per_lane_2d_or_3d_group_runs_on_the_gpu: 5 passed (the last SKIPPED: no wave64). With the reorder disabled on purpose, the GPU test failed at 8x8x1 wave32 (thread 2 on lane 4), so the driver does pack 2-D groups out of order and the test catches it.xcl shaders <pack> --direct --sample 0 --validate, a retail title's 1,636 compute programs: 708 translated in the split wave64 form and 801 in the native form, 0 validator failures and 0 panics; this survey does not go throughpso.rs, so it is the same before and after.Regression run
scripts/smoke.ps1onmainand on this head.Not tested
scripts/smoke.ps1; a title run with this change alone (our Linux branch carries the same removal); the driver memory of the direct builds.AI use
Imported from ivall/xcl. Originally posted by fromthemoonx on 2026-11-28T18:10:31Z.
Whole suite on a GPU (listed under Not tested): passes on NVIDIA. With the native-wave reorder disabled, the new GPU test fails here as it did on your RTX 2070 SUPER.
Tested:
f4e0ab9(its base is currentmain10d2729, so head = merged). RTX 3060 12 GB (driver 610.88, wave32 only), Ryzen 7 5700X, Windows 11 Pro 26300, Rust 1.100.0 MSVC, debug.cargo test --workspace --no-fail-fast -- --test-threads=4SKIPPEDlines (no wave64, refused per-lane f16/f32 forms,heap_window_out_of_memory_falls_back_to_the_switch_form).main10d2729here: 2152 passed, 0 failed, 48 ignoreddirect_compute_translates_2d_and_3d_groups,gpu_direct_compute_waves_take_consecutive_threads_of_2d_and_3d_groupsaloneSKIPPED)y * z > 1branch insetup_lanes_compute(lanes.rs) disabled, so 2-D / 3-D groups in native waves useflattenedThreadIdInGroup[8, 8, 1] wave64 false: thread 2 (lane, the wave's first thread),left: (4, 0)So this driver also forms 2-D waves out of console order, and the test catches it on wave32. The split-wave64 cases ran in their split form (no native wave64 here).
Not tested: native wave64 (AMD),
scripts/smoke.ps1/ a title, a release build.AI use: Claude Code (Claude Opus 5.5) ran the tests and the scratch mutation and wrote this report.
Imported from ivall/xcl. Originally posted by bmjask on 2026-11-28T22:04:19Z.
Review: COMMENTED
Critical-review result: I found no concrete correctness defect in restoring the direct DXIL route for 2-D/3-D groups. The arrival-based lane assignment and added GPU validation are directionally appropriate.
The implementation is mergeable and Windows CI is green, but the PR description/regression evidence still needs to satisfy the repository gate before merge. Please update it from the exact current head and report any GPU skips separately from coverage.
Reviewed at
f4e0ab9259with Codex (GPT-5).Imported from ivall/xcl. Originally posted by Kalmarv on 2026-11-29T04:37:29Z.
merge-check
base:
fa204595a4head:
f4e0ab9259merge: clean, but it changes nothing: the trial merge's tree is main's own tree (
e79c9fb4, fromgit merge-tree --write-tree). The PR's one commit is already onmainasdaae0330b9: same author, same message, the same changes tobuild.rs,pso.rsandrecomp/tests.rs, differing only in line offsets. It came intomainwith #3203 (the nvidia-dev merge).build: not run for this PR, since its merge equals
main.tests: both tests this PR adds already run on
main. In a full suite on this machine (mainfa204595plus #2578, which touches onlytitle_textures.rs),direct_compute_translates_2d_and_3d_groupsandgpu_direct_compute_waves_take_consecutive_threads_of_2d_and_3d_groupspassed on this 32-lane GPU.review: nothing left to review; the changes are on
main.performance: none, because merging changes no file.
verdict: nothing to merge: the change is already on
main(daae0330via #3203), so this PR can be closed.hardware / tool and model: NVIDIA GeForce RTX 5070 Ti 16 GB (driver 610.74, wave32 only), AMD Ryzen 9 9950X, Windows 11 build 26200; rustc 1.99.0, debug test profile, DXC 1.9.2609 via XCL_DXC_DIR. Claude Code, Claude Opus 5.5: ancestry and patch comparison, merge-tree check; this report.
Imported from ivall/xcl. Originally posted by Royalflamejlh on 2026-11-30T02:14:17Z.
Closing:
mainhas this change in its own form sincedaae0330(#3203), and a trial merge of this head intomainchanges nothing.Pull request closed