DXIL split: prune piece-local features after optimize and transport f16/f64 #2344
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!2344
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-2344"
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?
@Decodere on GitHub · 2026-11-25 16:08 UTC · original
Decodere:fix-2080-split-features-f16-f64→main· +399 −25 · 1 files · 1 commits · openPart of #2088
Part of #1269
What is in it
Follow-up to #2080 in compute dispatch splitting (
crates/xcl/src/gpu/dxil/module/split.rs) fixing two classes of shaders that were previously refused during splitting and fell back to compiling whole:make_piece,infer_piece_features,trace_atomic64_handle):dst.m.optimize()beforedst.infer_piece_features()and emit pieces viadst.finish_optimized(threads, Some(32))instead of inferring flags before optimization and scanning deadself.m.instsentries.self.m.blocks.iter().flatten()and re-infer piece-local flags to match DXC 1.9 (DxilShaderFlags):ResourceHeapIndexing,SamplerHeapIndexing,WaveOps(dx.op.wave*/dx.op.quad*),TiledResources(dx.op.checkAccessFullyMappedand sample ops with a non-undef, non-zero-constant LOD clamp),TypedUavLoadAdditionalFormats(multi-component typed UAVdx.op.textureLoad*/dx.op.bufferLoad*viaannotateHandleproperties, with fallback),NativeLowPrecision(kept only when the whole shader used it and the piece has livehalf/i16instructions),DoubleExtensions(dx.op.tertiary.f64Fmaop 47 in addition tofinish_optimized'sinfer_type_features), and 64-bit atomics (AtomicInt64GroupSharedfor 64-bitAtomicRmw/CmpXchg, plus tracing livedx.op.atomicBinOp.i64/dx.op.atomicCompareExchange.i64handles throughannotateHandle,createHandleFromHeap,createHandleFromBinding,Phi, andSelectto restoreAtomicInt64Typed,AtomicInt64Heap, and per-bindingb.atomic64metadata with conservative fallback on unrecognized handles).f16andf64transport across cuts (transport_words,pack,unpack):TypeDef::Halfin 1 scratch word (bitcast half -> i16+zext i16 -> i32, restored viatrunc i32 -> i16+bitcast i16 -> half) andTypeDef::Doublein 2 scratch words (Shader::split_double/Shader::make_double).split::tests):dispatch_chain_prunes_piece_local_features_after_optimize: pure-CPU + DXC 1.9 validator test covering clampedsample_grad(0.5settingTiledResourcesand0.0clearing it per DXC 1.9hasSampleClamp) with a cross-cut heap handle, plus split-wave64 isolation ofWaveOps,NativeLowPrecision, andDoubleExtensions(Tertiary::Fmaop 47).dispatch_chain_restores_atomic64_typed_and_heap_features: pure-CPU + DXC 1.9 validator test covering split pieces with static typedi64UAV atomics (u4->AtomicInt64Typedand per-bindingi32 3, i32 1only onu4), static rawi64UAV atomics (u5-> per-bindingi32 3, i32 1only onu5, neither typed nor heap flag), heap rawi64UAV atomics (AtomicInt64Heaponly), and heap typedi64UAVatomicCompareExchange.i64(AtomicInt64Typed | AtomicInt64Heap), while asserting pieces withouti64atomics prune those flags and binding tags.dispatch_chain_transports_live_f16_and_f64_across_cuts: DXC 1.9 validation of a 3-piece chain where livef16(including-0.0f16) andf64cross cuts over an intermediate piece that uses neither type, plusskip_test-guarded bit-for-bit GPU readback against the unsplit shader and CPU reference.Tested
1.9.2609.5):0829441):dispatch_chain_prunes_piece_local_features_after_optimizerefused piece 1 of 2 (error: Flags must match usage.) anddispatch_chain_transports_live_f16_and_f64_across_cutsreturnedNonefromsplit_compute(transport_wordsrejectedHalf/Double).e26cba1):dispatch_chain_restores_atomic64_typed_and_heap_featuresfailed (piece 2 of 3 refused, the program stays whole: error: Flags must match usage.).cargo test --release -p xcl --lib gpu::dxil::module::split::tests -- --test-threads=1 --nocaptureon NVIDIA GeForce RTX 4060 (driver621.14, DXC1.9.2609.5):11 passed, 0 failed, 0 ignored(0.76 s,0skipped).XCL_ADAPTER=warpcargo test --release -p xcl --lib gpu::dxil::module::split::tests -- --test-threads=1 --nocapture:11 passed, 0 failed, 0 ignored(0.04 s); all 4 pure-CPU/DXC 1.9 tests (dispatch_chain_prunes_piece_local_features_after_optimize,dispatch_chain_restores_atomic64_typed_and_heap_features,dispatch_chain_declares_typed_uav_loads_only_where_they_are,oversized_loop_occupies_one_piece_up_to_the_hard_ceiling) ran with0skips, anddispatch_chain_transports_live_f16_and_f64_across_cutsvalidated all 3 split pieces + whole shader with DXC 1.9 before skipping GPU execution (SKIPPED: no wave32 GPU).CreateComputePipelineStatetimings (fresh-named.execopies per mode with unique bytecode salt, verified cold by immediate 2nd warm call, on synthetic 16-loop shaders that0829441refused to split):tiled_clamp(hasha1baa443fcac1d43,1,465DXIL insts,16,996B whole ->6pieces): whole cold53.78 ms(warm0.411 ms) vs parallel 6-piece cold wall28.23 ms(max piece27.54 ms, sum90.97 ms, max warm1.147 ms) —1.91xfaster cold wall (-47.5%).live_f16_f64(hash95eb3b58dad86457,1,470DXIL insts,17,008B whole ->6pieces): whole cold37.18 ms(warm0.375 ms) vs parallel 6-piece cold wall20.50 ms(max piece19.48 ms, sum87.19 ms, max warm0.359 ms) —1.81xfaster cold wall (-44.9%).cargo test --release --workspace --no-fail-fast -- --test-threads=4 --nocaptureon RTX 4060, atoporigin/main6d12f58a):37test binaries,1426 passed, 0 failed, 46 ignored(186/186gpu::dxil::*);29pre-existing hardware/debug-layerSKIPPEDlines (0insplit::tests):21no wave64(RTX 4060 is wave32-only),3per-lane form: refused(lower_dxil::testswave32 per-lane),3no D3D12 debug layer/no d3d12SDKLayers.dll,1cannot disable the driver cache(shaders::tests::pso_measurement_compiles_an_exact_synthetic_record),1no heap windows(heap_window_out_of_memory_falls_back_to_the_switch_form).Regression run
Base (
origin/main889ef3e8aa7f267323ab4879e735e65da6bcef10):PR head (
c24f3e9743cf43a3d61112da82201d06a05a691d):Not tested
Native16BitShaderOpsSupported.d3d12SDKLayers.dllis not installed on this host).AI use
Google Antigravity (Gemini 4 Neon) assisted with checking DXC 1.9
DxilShaderFlagsrules, implementing per-piece feature inference (including 64-bit resource atomic handle classification) andf16/f64transport insplit.rs, adding regression tests, and running the verification suite and cold-PSO benchmarks.@SlopTart on GitHub · 2026-11-25 16:22 UTC · original
Tested: current PR head merged onto current
origin/main(clean), Linux (Arch, kernel 7.2.15), Mesa 26.2.5 RADV, Radeon RX 7900 XT (NAVI31), cargo targetx86_64-pc-windows-gnurun under wine-11.0 (Proton), rustc 1.94.0, vkd3d-proton 3.1 with the XCL patch, official MS DXC (binaries 2026-09-29).One red on this lane: the new transports test crashes inside
d3d12core.dllunder Wine.gpu_suite (--release --locked,--test-threads=2): 144 passed / 3 failed / 1 ignored, same three baseline failures as plainorigin/mainon this rig (rig's known baseline: fuzz seed 1003 of #2115,gpu_nonfused_mad_and_mac_prevent_fma_contraction,gpu_depth_buffer_created_for_unordered_access_is_placed).dispatch_chain_prunes_piece_local_features_after_optimize: passes, targeted run.dispatch_chain_transports_live_f16_and_f64_across_cuts: deterministic crash, 4/4 runs, and it is not a Rust panic. WithWINEDEBUG=warn+seh(the default-allhides this), wine reportsEXCEPTION_ACCESS_VIOLATION(0xc0000005); the whole unwind is insided3d12core.dll(+0x1AB118, +0x1784EC, +0x1A1676, +0x1A7852, +0x1A9450, +0x0DF8DB) called from the test exe frame. Process exit status 5 (= 0xC0000005 truncated), which is why it looked silent at first.gpu_cvt_norm_f16_exact_rounding_and_edge_cases,gpu_f16_defaults_to_round_to_nearest_even,gpu_s_round_mode_controls_f16_rounding_across_modesare all among tonight's 144), so it is not blanket f16 breakage on RADV.offline_split_compute_pipeline_is_reused_by_a_second_processe2e from #2338 crashes at the samed3d12core.dlloffsets on this lane (also deterministic), while the pre-existingoffline_compute_pipeline_is_reused_by_a_second_processpasses inside the same test binary (4 passed / 1 failed / 1 skipped). Two different new split-chain pipeline paths AV at one site in the shim; native Windows lanes (author, Aniseto, DarkPanda69) do not see it.Reading: something in the new split-chain piece transport builds a pipeline shape this Linux stack (patched vkd3d-proton 3.1 + Mesa 26.2.5 + RADV) faults on inside the D3D12core shim. I cannot say from a stripped backtrace whether the faulting code is XCL's vkd3d-proton patch or upstream vkd3d-proton; a debug-pdb run on a Wine/Proton bot would pin it. Addresses are module-relative offsets into the vkd3d-proton 3.1 XCL-patched
d3d12core.dllas shipped on this lane.Not tested: retail titles (no title data on this lane, counts only).
AI use: Hermes agent (local Qwen-class) ran both machines and drafted this; I checked it before posting.
@amazedturnip on GitHub · 2026-11-25 16:26 UTC · original
Independent AMD Radeon (native wave64) verification of exact head
1f70e6796fbd0a8e893d264497135a8235607321(clean detached worktree, compared againstmain3f4495a2b325).Tested
AMD Radeon(TM) Graphics (driver 32.0.21043.19003, DXC 1.9.2609, native wave64)(XCL_ADAPTER=radeon, native wave64)cargo test -p xcl --lib gpu::dxil -- --test-threads=2— 158 passed, 1 failed, 3 ignored (exit 101); failed: gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_1Regression run (
scripts/smoke.ps1 -Seconds 60, release build,XCL_ADAPTER=radeon)main:
PR:
Not tested
AI use
@raylitebull on GitHub · 2026-11-25 18:24 UTC · original
Diff review on 1f70e67 (infer_piece_features after optimize + live 16/64 transport in split.rs): clean change on the compiler side and Windows native checks are green, but holding merge until the deterministic d3d12core.dll access violation reported on dispatch_chain_transports_live_f16_and_f64_across_cuts under Wine/vkd3d-proton is diagnosed and resolved.
@DavidM1911 on GitHub · 2026-11-25 18:25 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!
@SashaTun on GitHub · 2026-11-25 18:40 UTC · original · edited 2026-11-25 18:43 UTC
Test report on an NVIDIA card (Windows, retail title).
Tested
Commit:
1f70e6796fbd0a8e893d264497135a8235607321(fix-2080-split-features-f16-f64), clean checkout of the PR head, no uncommitted changes.Hardware: NVIDIA GeForce RTX 5060 (8 GB), driver
32.0.16.2101; 31.9 GB RAM; Windows 11 build 26200 x64.Toolchain: Rust
1.100.0(stable-x86_64-pc-windows-msvc); DXC 1.9 (Windows SDK10.0.26100.0); release profile; noXCL_SAMPLE_*variables.Command:
cargo test --release --workspace --no-fail-fast -- --test-threads=4→ 1270 passed, 4 failed, 46 ignored; 28
SKIPPEDlines (21 of themno wave64— this card runs 32-wide waves only).The 4 failures are
gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_{0,1,2,3}, all with the same error:CreateComputePipelineState: 0x8007000E(out of memory) — the 8 GB VRAM wall. The same 4 failures occur onmainon this card, so they are not from this PR.Regression run on a retail title (
scripts/smoke.ps1, 60 s, same title, same duration, same card, both runs from a clean data directory; themainblock is on the commit this branch forked from):The PR's run shows no device removal and no crash, 855 frames against
main's 912 (≥ 80 %) and a peak commit of 14 978 MB againstmain's 15 022 MB (≤ 125 %).Not tested
f16/f64cross a cut, so the wave32 path is where it is exercised here.f16/f64transport.main, so the tree tested here is the branch head as it stands.mainhas one further failure on this card that this branch does not contain:gpu::recomp::lower_dxil::tests::a_bridged_mask_write_where_one_half_is_elsewhere_meets_no_barrier, a test added after the branch point. It is not card-specific -main's own CI fails on it too - and I am reporting it separately.AI use
MiniMax Code (MiniMax-M3.1-Flash) built the commits, ran the test suite and the smoke runs, and wrote this report from the real output.
@Decodere on GitHub · 2026-11-25 18:44 UTC · original
@raylitebull@SlopTart— Checked the code paths behind#2344and#2338againstorigin/main:#2344nor#2338modifiespso::dispatch_chain_root_signature(u0, space2+b0, space28x 32-bit root constants) orsplit_compute'sSlab::new/Scratch::newbindings;#2338's failing test (offline_split_compute_pipeline_is_reused_by_a_second_process) does not touchsplit.rsor usef16/f64at all, yet crashes at the exact same 6d3d12core.dlloffsets (+0x1AB118, +0x1784EC, +0x1A1676, +0x1A7852, +0x1A9450, +0x0DF8DB) on Wine + vkd3d-proton 3.1.cargo test ... gpu_does not matchorigin/main's pre-existingdispatch_chain_*GPU tests (dispatch_chain_wave32_live_loops,dispatch_chain_payload_skips_middle_piece,dispatch_chain_divergent_forward_edges_3d), which also callrunner::dispatch_split.@SlopTartCould you runcargo test -p xcl --lib dispatch_chain_wave32_live_loopson unmodifiedorigin/mainto confirm whether those samed3d12core.dlloffsets reproduce onmain's existing split-chain path under vkd3d-proton 3.1?@thiagocalile on GitHub · 2026-11-25 18:49 UTC · original
Independent test and smoke report for head
1f70e6796fbd0a8e893d264497135a8235607321on an AMD Radeon RX 6600 (8 GB VRAM, RDNA2, native wave64).Tested
32.0.21045.29003,XCL_ADAPTER=radeon), AMD Ryzen 7 5700X3D, 47.9 GB RAM, Windows 11 (10.0.26200.0), Rust1.100.0(stable-x86_64-pc-windows-msvc), DXC1.8.2502.11.XCL_ADAPTER=radeon cargo test --no-fail-fast -p xcl --lib -- split --test-threads=4: 34 passed, 0 failed, 1 ignored (0skipped).Regression run (
scripts/smoke.ps1, release builds,XCL_ADAPTER=radeon)main(50a9fde):PR
#2344(1f70e67):Not tested: NVIDIA/Intel GPUs, Linux/Wine, or world load past the 60 s smoke window.
AI use: Antigravity (Gemini 4 Neon) ran the builds, tests, and smoke runs and drafted this report; the account owner reviewed and approved posting.
@Decodere on GitHub · 2026-11-25 21:39 UTC · original
@bmjaskGood catch — fixed inc24f3e97(and rebased onto6d12f58a):infer_piece_featuresnow traces livedx.op.atomicBinOp.i64/dx.op.atomicCompareExchange.i64handle operands throughannotateHandle,createHandleFromHeap,createHandleFromBinding,Phi, andSelect(trace_atomic64_handle) to restoreFeature::AtomicInt64Typed,Feature::AtomicInt64Heap, and per-bindingb.atomic64metadata (with conservative fallback on unrecognized handles), and clears them on pieces without those atomics.Added
dispatch_chain_restores_atomic64_typed_and_heap_featuresinsplit::testsvalidating 3-piece chains with DXC1.9.2609.5across static typed (u4), static raw (u5), heap raw, and heap typedatomicCompareExchange.i64cases (11/11split::testspass on both RTX 4060 and WARP; full workspace1426 passed, 0 failed; paired 60 s RTX 4060 smoke1550vs1530frames,0crashes/removals).@bmjask on GitHub · 2026-11-25 20:45 UTC · original · reviewed
P1: infer_piece_features removes AtomicInt64Typed and AtomicInt64Heap but never restores either for live resource i64 atomics. The atomicBinOp.i64/atomicCompareExchange.i64 match only sets has_i64_atomic; finish_optimized restores Int64Ops/Doubles, and only group atomics reinsert a feature. A split piece with typed static/heap i64 UAV atomic can therefore omit required DXIL SFI0 flags. Classify annotated handles and restore AtomicInt64Typed/AtomicInt64Heap, with split-piece typed/static and heap i64 atomic tests.
@DavidM1911 on GitHub · 2026-11-26 08:15 UTC · original
Re-verification on RTX 3060 Ti (Windows 11), new head merged with current
main:cargo test -p xcl --lib:hle::d3d12x::real::passthrough_mesh_stream_accepts_a_triangle_driver_blobfailed once under parallel scheduling; clean on--test-threads=1rerun (1309 passed, 0 failed, 27 ignored, 76s). The test is unchanged frommainand outside this PR's area (gpu/dxil/module/split.rs) — looks like the known parallel flake tracked in #1978.Thanks!
— Devin
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.