Repository navigation
Recompiler: 2-D and 3-D compute groups take the direct DXIL route again - #3189
Royalflamejlh wants to merge 1 commit into
Conversation
d940354 sent every compute program with a 2-D or 3-D group from `pso::direct_compute` to the HLSL path ("multidimensional groups need the HLSL console-linear thread reorder"). The direct translator has had that reorder since 746f7dd: `Lw::setup_lanes_compute` hands each hardware wave the next console threads as it arrives through a groupshared counter (the top LDS word when the program has LDS, else `xcl_wt`; a partial wave takes the last ones), as the HLSL entry's `XCL_WT` block does, and the split wave64 form numbers its threads as `xcl_x_thread` does. The rule only kept these programs off the direct route, including the huge and enormous ones that take it by default. Under Wine + vkd3d-proton, single driver builds of such programs' HLSL-path DXIL from a retail title reached 43.8 and 45.9 GB. In that title's shader pack 751 of the 1636 compute programs have such groups; `xcl shaders --direct --validate` translates and validates 238 of them in the split wave64 form and 273 without it (no validator failures, no panics). The CPU test translates 8x8x1 and 4x4x4 groups through `pso::direct_compute` (wave32, wave64, split wave64), which validates them under test; it fails with the rule. The GPU test checks that each lane of such a group holds the console's consecutive threads. `pso.rs` is outside the translator source hash: TRANSLATION_GLUE_REVISION goes to pso-glue-v5, or the translated-shader cache keeps serving the HLSL translations of these programs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…e reorder (xcl-dev#3189) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
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:
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), AI use: Claude Code (Claude Opus 5.5) ran the tests and the scratch mutation and wrote this report. |
bmjask
left a comment
There was a problem hiding this comment.
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 f4e0ab9 with Codex (GPT-5).
|
merge-check |
main has merged nvidia-dev (xcl-dev#3203): its two-pass mesh, sparse and upload paths now submit through real::native_queue_execute / _signal / _wait. Those already carry xcl-dev#867's UnadoptGuard and unwrap_fence; the conflicts and the main-only submit paths were resolved as follows. Taken from main, the stack's version dropped (main does the same): - recomp/dxc.rs (3): xcl-dev#688's private DXC heaps; main's form (3842807) falls back on any failure and never destroys a heap. - device_x.rs (10): xcl-dev#3091 (cherry-pick 511a297); main's 7e24237 keeps interned shader copies for base pipelines. xcl-dev#3091's tests and its real.rs test counter (GRAPHICS_FALLBACK_ATTEMPTS) and README line go; xcl-dev#2753's console_bytes is re-applied on main's file. - bind.rs (16): the stack's only change there was xcl-dev#1803, merged in main. main's file, plus the xcl-dev#2816 feedback-copy UnadoptGuard in poll_two_pass_feedback (ed887d2, from linux/stack-nvidia-dev). - pso.rs: main has daae033 (multidimensional groups take direct DXIL, xcl-dev#3189's change), so the stack-only commit is in main; translate calls take main's translate_compute_rodata / translate_entry_rodata_rt32. - list_x.rs tests: xcl-dev#3090's barrier tests were in twice (cherry-pick and main's merge); the cherry-picked copy goes. - runner.rs device(), xbox.rs Fssm::rodata: added on both sides; one copy. - README.md: the precompile-wrapper paragraph was added on both sides; one copy. Both kept: - build.rs (2): TRANSLATION_GLUE_REVISION "pso-glue-v5-linux-multidimensional- direct" (main's v5 + the stack suffix); translator sources keep xcl-dev#2229's cfg.rs and code_loads.rs, drop dxc.rs as main does. - dxil/kernel.rs (6): TRANSLATOR_VERSION 13 (main 12; the stack's xcl-dev#2229 head output differs, as on linux/stack-nvidia-dev); main's rt32 entry points with xcl-dev#2229's code_loads. - dxil/lower.rs (4), lower_mem.rs (3), lower_window.rs (1), recomp/emit.rs (11), recomp/mod.rs (3), recomp/tests.rs (1), core_tests.rs: main has an earlier copy of xcl-dev#2229 (41f1a85); xcl-dev#2229's head (code_loads, xcl_cload / xcl_gload(hi, a)) is kept over it, as on linux/stack-nvidia-dev; main's loop_ids, IO slots, ps_mask_live_scc and rt32 mask kept beside it, and main's duplicate core_tests copy of the rodata test goes. lower_mem.rs keeps the stack's scratch_ptr insert-before-terminator line. - real.rs (6): the class scan keeps `own` with main's release_through_its_own_vtable; xcl-dev#2477's in-place patch after main's two-pass defer hooks; q_signal_pc / q_wait_pc beside main's page mappings; the title ExecuteCommandLists keeps xcl-dev#867's list guards inside main's watch::in_driver scope; test modules of both. - list_x.rs (1): xcl-dev#867's allocator / PSO guards with main's `on = pc_alloc`. - sparse.rs (1): main's new_state, with xcl-dev#867's raw fences for the sparse and readback fences and the async readback fence pairs (as on linux/stack-nvidia-dev); pc_execute (main's texture_upload submit path) unadopts its list for the submit. - title_textures.rs (1): main's early fence creation, as a raw fence. - dstorage.rs (4): xcl-dev#2864's unpack cache on main's Cow source and stage buffers. - xg.rs (2): main's copy_args (adccb7d) covers xcl-dev#684's argument fix; xcl-dev#684's destination guard kept. - present.rs (1), gpu_compute_e2e.rs (1), README.md (2): tests and text of both. linux/README.md: main line updated; xcl-dev#1599, xcl-dev#2082, xcl-dev#1803, xcl-dev#3090, xcl-dev#688, xcl-dev#3091 and the stack-only multidimensional row leave the table. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Closing: |
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