Recompiler & D3D12.X: mask 9-bit EXP PRIM vertex indices and map newer DispatchMesh to slot #129 #1984
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!1984
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/1984/head"
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?
@raylitebull on GitHub · 2026-11-25 00:22 UTC · original
raylitebull:feat/dispatch-mesh-9bit-v2→main· +43 −3 · 3 files · 1 commits · merged 2026-11-25 10:40 UTCMasks
EXP PRIMvertex indices to 9 bits (0x1FFu) in RDNA2 mesh-shader pass-through lowering and maps newer-layout command listDispatchMeshcalls at slot#129to older slot#126(two-passDispatchMesh/ExecuteIndirectexecution paths have been split out of this PR and deferred cleanly to #724 and #1887).Part of #1833.
What is in it
crates/xcl/src/gpu/recomp/emit.rs: maskEXP PRIMvertex indices with0x1FFuin both unsplit and#304-split mesh pass-through emission paths to strip RDNA2 per-edge flags at bits[9],[19], and[29].crates/xcl/src/gpu/recomp/tests.rs: addmesh_passthrough_strips_rdna2_edge_flag_bitsunit test.crates/xcl/src/hle/d3d12x/real.rs: map(129, 126)inNEWER_LIST_SLOTSfor newer-layoutDispatchMeshand addnewer_layout_maps_dispatch_mesh_to_slot_129_not_128.Tested
rustc 1.99.1 (58cf8f9c3 2026-10-13), rebased cleanly ontoaa9ab8a(3eab40a).mesh_passthrough_strips_rdna2_edge_flag_bitsandnewer_layout_maps_dispatch_mesh_to_slot_129_not_128): 2 passed, 0 failed (0new warnings).scripts/smoke.ps1regression pair on AMD Radeon RX 9070 (@Toons29): passed (0 device removals, 0 crashes).Regression run
60 s
scripts/smoke.ps1pair on exact head3eab40avsmain(AMD Radeon RX 9070, driver 32.0.32029.2010, Windows 11 26300, release,XCL_NETWORK=0on a retail title), contributed by@Toons29:main:
this PR:
Not tested
scripts/smoke.ps1pair on3eab40a, fullcargo test --workspacesuite, runtime GPU execution across AMD / NVIDIA / Intel hardware, and Linux/Wine/vkd3d-proton.AI use
@upipibi on GitHub · 2026-11-25 00:27 UTC · original
Overlap note, from reading the descriptions and file lists (not run):
DispatchMesh/ExecuteIndirectexecution is #724 (Cattn). It changes the samebind.rs,console_list.rs,device_x.rsandreal.rs. Its review points have been worked into a rebased branch, PracticalStudios/xclmesh/two-pass-execution; see the last comments there, including measured mesh user-SGPR layouts from 9,282 shaders. Two implementations of the same path would conflict, so comparing against that branch first would save work.DISPATCH_MESHmapping forCreateCommandSignatureis #1887.The parts that look independent of both are the
NEWER_LIST_SLOTSDispatchMeshslot (129 rather than 128) and the 9-bit (0x1FF) vertex index mask in mesh passthrough. Each could go in a small PR of its own, with the evidence for it.AI-assisted (Claude Code).
@eizispark on GitHub · 2026-11-25 00:32 UTC · original
Hardware test report — commit
ffcf056Verified
ffcf056f0f41757e90c93f7becd6790b81e32656(based on8c4a46a3c2d50498691cbda79cbbf4fadb45fbe8; clean merge with currentmain6567c5f): pass (0new failures vsmain; all 4 new unit tests and live RDNA4 mesh-shader GPU tests pass).Tested
32.0.32015.16001), 32 GB RAM,rustc 1.100.0 (0ef1bc386 2026-11-09)(stable-x86_64-pc-windows-msvc), debug tests + release smokecargo test --workspace --no-fail-fast -- --test-threads=4:997 passed, 2 failed, 45 ignored(8 skipped) —0new failures:gpu::recomp::tests::mesh_passthrough_strips_rdna2_edge_flag_bits,hle::d3d12x::bind::tests::dispatch_mesh_signature_tracking_returns_companion_and_clears,hle::d3d12x::console_list::tests::mesh_arguments_go_in_user_sgprs_from_s16,hle::d3d12x::real::queue_tests::newer_layout_maps_dispatch_mesh_to_slot_129_not_128) passedgpu::recomp::tests::gpu_mesh_mode_two_passeswith the0x1FFu9-bit vertex index mask,gpu_mesh_mode_reads_memory_windows,hle::d3d12x::real::passthrough_mesh_stream_accepts_a_triangle_driver_blob,retail_mesh_pipelines_through_the_hook,mesh_dispatch::tests::*,gpu_geometry_wave32_prefix_count_over_a_mask,gpu_wave32_program_in_wave64_hardware,console_wave64_compute_through_the_pso_hook_dispatch_and_read_back) all executed on the GPU (0skips) and passedgpu::dxil::fuzz_tests::fuzz_validate_and_gpu_1seed722andfuzz_validate_and_gpu_3seed1599) are pre-existing onmain(#1679);8 skipped= 6lower_dxilf16/f32#1426-semantics sub-cases,pso_measurement_compiles_an_exact_synthetic_record(0x887A002D), andheap_window_out_of_memory_falls_back_to_the_switch_form: no heap windowsRegression run
main(8e87fc7b62a87ea589ccb9ea6182f514016cf7db):PR (
ffcf056f0f41757e90c93f7becd6790b81e32656):Not tested
DispatchMesh/ExecuteIndirect(DispatchMesh)draws (the 60 s menu smoke run did not logDispatchMeshcalls), NVIDIA/Intel GPUs, Wine/vkd3d-protonAI use
@raylitebull on GitHub · 2026-11-25 00:38 UTC · original
@eizispark Thank you for the thorough RX 9070 XT verification (997 passed,
@raylitebull on GitHub · 2026-11-25 00:47 UTC · original
Thanks for the overlap breakdown, @upipibi! Full credit to #724 (@Cattn) on the two-pass
DispatchMesh/ExecuteIndirectexecution architecture and #1887 (@Diskuss) on indirect argument107 -> DispatchMesh.For context on why #1984 is open:
mainand open review items on2624f00(such asIO_UMA_BASE_HIinbind_two_pass_stage, record buffer upper bounds, scaled-indirect lifetime cleanup, and clearingdispatch_mesh_signatureon root-changing signatures), which #1984 includes.NEWER_LIST_SLOTSslot#129mapping inreal.rsand the 9-bit (0x1FF) primitive index mask inemit.rs.If #724 (or #1887) is updated and lands first, we will gladly rebase and trim #1984 down to only the remaining non-overlapping pieces.
@gsucristo on GitHub · 2026-11-25 00:57 UTC · original
Technical review findings:
Blocking
INDIRECT_ARGUMENT -> NON_PIXEL_SHADER_RESOURCEtransition (bind.rs,make_scaled_args_buffer): Transitionssrcunconditionally fromINDIRECT_ARGUMENTtoNON_PIXEL_SHADER_RESOURCEand back. Indirect argument buffers are frequently inGENERIC_READ(mandatory forUPLOADheaps, where transitioning away fromGENERIC_READis invalid),COMMON, or combined read states.ExecuteIndirect(DispatchMesh)(max > 1) races onres_buf(bind.rs,execute_indirect): Runs allmaxcompute dispatches intores_bufstarting at offset0without per-command offsets or intermediate UAV barriers, then runs allmaxmesh dispatches reading from offset0.res_buf(bind.rs,dispatch_mesh&execute_indirect):clear_groupsis clamped tores_cap / rec_bytes, butlist.Dispatch(groups, 1, 1),pc_dm(...), andcompanion_dispatchare not clamped/rejected whengroups * rec_bytes > res_cap.ID3D12CommandSignature(device_x.rs,create_command_signature_x;bind.rs,DISPATCH_MESH_SIGS):companionis stored as a rawusizeand neverRelease()d on map overwrite,clear_dispatch_mesh_signature, or signature destruction.Major
let groups = x.saturating_mul(y.max(1)).saturating_mul(z.max(1))turns a zero-workDispatchMesh(N, 0, 1)intoNgroups instead of returning early, and flattening 3D(x, y, z)to(groups, 1, 1)breaks console MS shaders readingSV_GroupID.y/z.make_scaled_args_bufferallocates a new committed DEFAULT buffer ofmax * stridebytes on everyExecuteIndirectcall instead of pooling/reusing.clear_record_headers,emit_uav_barrier, andmake_scaled_args_bufferdon't guard againstD3D12_COMMAND_LIST_TYPE_BUNDLE, anddispatch_meshoverwrites the compute RS/PSO without restoring them.(The
#129NEWER_LIST_SLOTSfix and0x1FFu9-bitEXP PRIMmask look clean and would be great split out on their own.)@raylitebull on GitHub · 2026-11-25 01:15 UTC · original
Thanks for the review and split recommendation,
@upipibi,@gsucristo,@Cattn, and@Diskuss!Split and rebased
#1984cleanly ontoaa9ab8a(3eab40a,+43 / -3across 3 files):DispatchMesh/ExecuteIndirectexecution path (deferring cleanly to#724+#1887and removing all overlapping indirect-scaling code).EXP PRIM9-bit (0x1FFu) vertex index masking incrates/xcl/src/gpu/recomp/emit.rs(both unsplit and#304-split mesh pass-through paths) +mesh_passthrough_strips_rdna2_edge_flag_bits.NEWER_LIST_SLOTSmapping(129, 126)for newer-layoutDispatchMeshincrates/xcl/src/hle/d3d12x/real.rs+newer_layout_maps_dispatch_mesh_to_slot_129_not_128.Verified locally (
2 passed, 0 failed,0new warnings).@JJAutoCompare on GitHub · 2026-11-25 02:38 UTC · original
PR #1984 compatibility verification
Tested detached head
3eab40a4bb48c15d4b79ed3f756deba52eb89bdbfromorigin(refs/pull/1984/head). The tracked checkout was clean.Environment
26200.9974, AMD Ryzen 7 3800X, Intel Arc A770 16 GiB, driver32.0.101.9175.DoublePrecisionFloatShaderOps=0, wave range 8–32, andd3d12SDKLayers.dllabsent.rustc 1.100.0 (0ef1bc386 2026-11-09). DXC and DXIL1.9.2609.5. Cargo dev/test builds used no debug info or incremental compilation. The suite selectedXCL_ADAPTER=A770and used the assigned slot onL:for the Cargo target, temp directory, and DXIL cache.Build and focused tests
cargo build --workspaceandcargo test --workspace --no-runboth exited 0 outside the GPU lock.cargo test -p xcl --lib mesh_passthrough_strips_rdna2_edge_flag_bits -- --nocapture— 1 passed, 0 failed, 0 ignored, 0 skipped. The test checks that both mesh pass-through variants emit three0x1FFumasks at shifts 0, 10, and 20, excluding the packed EXP PRIM edge flags.cargo test -p xcl --lib newer_layout_maps_dispatch_mesh_to_slot_129_not_128 -- --nocapture— 1 passed, 0 failed, 0 ignored, 0 skipped. The test checks newer slot#129maps to the olderDispatchMeshhandler at#126and that the map has no entry for#128.Full workspace suite
cargo test --workspace --no-fail-fast -- --test-threads=4ran once underL:/XclTooling/Invoke-ArcTest.ps1. Cargo exited101after all 19 test binaries and the doc-test target reported results. Combined suite log (pr1984-suite.log)gpu::recomp::tests::gpu_mesh_mode_two_passesalso passed on the Arc without a skip notice. It checks that the synthetic unsplit and split draws produce identical pixels. Its EXP PRIM record has all edge flag bits clear.unittests src/lib.rs (xcl)unittests src/main.rs (xcl)tests/bcpack_parity.rstests/console_dlls_e2e.rstests/console_shaders.rstests/disasm_e2e.rstests/e2e.rstests/gpu_compute_e2e.rstests/gpu_pso_e2e.rstests/heap_probe.rstests/low_va.rstests/pls_quota.rstests/predication_e2e.rstests/rpf_e2e.rstests/shaders_e2e.rstests/sparse_reinit.rstests/texture_states.rstests/xg_oracle.rsunittests src/main.rs (xcl_testtitle)Doc-tests xclFailures
All 27 failures are outside the changed mesh pass-through and DispatchMesh paths. The 25 matching failures also appear in the earlier STOR-WINLAB PR #1982 log at
354ce0c7189d0820ddf7d05bc5c662013ff7a5f4, which has the former mask and lacks the slot mapping. The two remaining cases exercise direct-DXIL denormal rounding and split-wave64 compute reductions. Earlier Arc suite log (pr1982-suite.log)CreateComputePipelineStatereturned0x80070057in 22 tests.gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_0gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_1gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_2gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_3gpu::dxil::ops_tests::doubles_match_cpugpu::dxil::ops_tests::groupshared_barrier_and_atomics_rungpu::dxil::round_tests::gpu_direct_f32_round_modes_dynamic_and_denormalsgpu::dxil::round_tests::gpu_direct_f32_round_modes_staticgpu::dxil::round_tests::gpu_direct_f32_round_preserved_denormal_times_inf_is_infgpu::recomp::lower_dxil::tests::f64_programs_on_the_gpugpu::recomp::tests::gpu_clamp_and_omod_per_instructiongpu::recomp::tests::gpu_f64_class_comparegpu::recomp::tests::gpu_f64_compares_with_nangpu::recomp::tests::gpu_f64_literal_high_wordgpu::recomp::tests::gpu_f64_math_randomgpu::recomp::tests::gpu_f64_rootsgpu::recomp::tests::gpu_f64_rounding_and_conversionsgpu::recomp::tests::gpu_float_compares_randomgpu::recomp::tests::gpu_frexp_f64_exp_and_mantgpu::recomp::tests::gpu_ldexp_f64gpu::recomp::tests::gpu_rndne_f64gpu::recomp::tests::gpu_split_wave64_reduction_tailsFive additional tests failed assertions.
gpu::recomp::tests::gpu_nonfused_mad_and_mac_prevent_fma_contractionreturned 2139095040 for the fused overflow control, expected 1946157055.gpu::recomp::tests::gpu_ps_image_sample_offset_implicit_lod_between_mipsreturned 25.609375 at pixel (0,0), expected 26.gpu::recomp::tests::gpu_valu_16_and_64_bitfailed thev_add_f16high-half preservation assertion in lane 0.gpu::recomp::tests::gpu_wave64_ps_whole_wave_reductionsreturned[2, 217, 2]for the pixel 0 min/sum reduction, expected[2, 216, 2].e2e::test_title_runs_and_game_folder_is_untouchedfailed the synthetic title's dynamic depth-bias check atRSSetDepthBiasXslot#94. The top-right pixel was blue, expected green.Skips
The log contains exactly 23 lines beginning with
SKIPPEDacross 13 tests. The harness passed count includes tests that returned early or exercised only some subcases. Excluded from coverage were 18 wave64 cases, three refused wave32 DXIL lowering cases (V_MUL_F16,V_PK_MUL_F16,V_CVT_F16_F32), one driver-cache measurement (0x887A002D), and one heap-window OOM fallback.Not tested
#129, or a GPU draw with EXP PRIM edge flags set. The run used the synthetic mesh and title tests, andXCL_SAMPLE_*was unset.mainbaseline or retail smoke comparison, AMD and NVIDIA GPUs, and native wave64 hardware.AI use
T3 Code / Codex (gpt-6.2-sol, reasoningEffort: high) ran the build and verification. Coordinator #2 (T3 Code / Antigravity, gemini-4-neon) verified the counts against
pr1984-suite.logand published this report.@DavidM1911 on GitHub · 2026-11-25 03:31 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!
@Toons29 on GitHub · 2026-11-25 04:36 UTC · original
Regression run of
3eab40a4on the retail title, for this PR's Regression run section. Both blocks are fromscripts/smoke.ps1as printed, not edited:mainoncbc296ab, this PR on its head commit with no uncommitted changes, same title and time.Against the limits in CONTRIBUTING.md: 100 % of
main's frames, 101 % of its peak commit, no crash, no device removal.AMD Radeon RX 9070 (RDNA4, driver 32.0.32029.2010), Ryzen 7 7800X3D, 32 GB, Windows 11 build 26300, Rust 1.100.0,
cargo build --release -p xcl, 60 s,XCL_NETWORK=0. This is a regression check only: it does not show whether the run reaches the code this PR changes.AI use: Claude Code (Claude Opus 5.5) built both trees and ran
scripts/smoke.ps1; a script posted this right after the run, with both blocks exactly as printed.@raylitebull on GitHub · 2026-11-25 10:37 UTC · original
Thanks @Toons29 for running and sharing the exact-head 60 s
scripts/smoke.ps1pair on3eab40a(0 device removals, 0 crashes) — added to the PR description!