recomp/dxil: straddling 16-bit LDS, XCL_SHADER_LOOP_LIMIT, and safe MS barriers #1976
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!1976
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-1976"
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:14 UTC · original
raylitebull:feat/recomp-ms32kb-lds-and-safe-barrier→main· +1589 −111 · 8 files · 2 commits · openStacked on #1975 (extends
#1975's72960386onc9ee916awith incremental commit2e7debd8,+401 / -40across 6 files).Adds three robustness and correctness improvements across the HLSL recompiler and Direct DXIL translator (both 32 KB
passthrough_splitdeferred to #304 and repeated-PS.zwf16interpolant packing deferred cleanly to@MacieGx'srecomp/f16-packed-interpolants— zero touch onrecomp/mod.rs):lower_mem.rs,emit.rs): splits 16-bit LDS loads/stores (ds_read_{u,i}16,ds_write_b16,ds_*_d16_*) at byte offset(addr & 3) == 3across(at >> 2)byte 3 and(at + 4) >> 2byte 0 in both Direct DXIL (lds_read_bits,lds_bits_store) and HLSL (InterlockedAnd/InterlockedOr), while preserving#134PRELUDE_PIXEL.kernel.rs,lower.rs): replaces Direct DXIL's non-uniform multi-wave mesh barrier fallback error with a bounded groupshared arrival barrier (xcl_barviasafe_barrier_init/safe_barrier_wait/safe_barrier_exit, reusing top 2 dwords ofxcl_ldswhen present so TGSM stays<= 32768bytes, gated byXCL_SAFE_BARRIER != 0, withVAR_BAR_ALIVE = VAR_BUDGET + 6disjoint from#2156'sVAR_IMG_WRITE = VAR_BUDGET + 8and both zero-initialized inInit::load).XCL_SHADER_LOOP_LIMIT(emit.rs,lower.rs,pso.rs): configurable shader loop limit (default65536, capped1 << 24, folded intopso.rstranslation identity), plusdirect_dxil_mixed_fp16_interp_preserves_half_across_ssa_phiupdated to usemain'sPsAttr.Part of #1269.
What is in it
2e7debd8on top of#1975(72960386):crates/xcl/src/gpu/dxil/kernel.rs,lower.rs,lower_mem.rs,lower_valu.rs,crates/xcl/src/gpu/recomp/emit.rs,pso.rs.lds_16bit_straddling_dword_boundary_hlsl,direct_dxil_lds_dword_straddling_16bit_validate,direct_dxil_infinite_loop_guarded_by_shader_loop_limit,direct_dxil_mixed_fp16_interp_preserves_half_across_ssa_phi, anddirect_dxil_mesh_non_uniform_barrier_guard(including full-32KB-LDS TGSM check).Tested
rustc 1.99.1 (58cf8f9c3 2026-10-13), DXCdxcompiler 1.8.2502.11/dxil 1.8.2502.11, stacked on#1975(72960386) overc9ee916a(2e7debd8).cargo check --workspace --tests: passed (0warnings in touched files).#1975+#1976: 14 passed, 0 failed (0.22s,dxil 1.8.2502.11validated).Regression run
scripts/smoke.ps1pair on2e7debd8vsc9ee916ahas not been run yet. AMD and NVIDIA reviewers are invited to test on2e7debd8vsc9ee916a(includingscripts/smoke.ps1,XCL_DIRECT_DXIL=1, and multi-wave mesh / straddling 16-bit LDS workloads) and post results in the comments.Not tested
scripts/smoke.ps1pair on2e7debd8, fullcargo test --workspacesuite on2e7debd8, runtime GPU execution across AMD / NVIDIA / Intel hardware, and Linux/Wine/vkd3d-proton.AI use
c9ee916a, trimming, and DXIL/recompiler validation tests; the author reviewed the diff and test output.@futurepro62 on GitHub · 2026-11-25 00:30 UTC · original · edited 2026-11-25 00:38 UTC
Full-suite run, since this PR has no test report yet. Tested exact head
fed1358(on its base80f4819).Tested
cargo build --workspace, thenXCL_REQUIRE_GPU=mesh cargo test --workspace -- --test-threads=4 --skip heap_window_out_of_memory_falls_back_to_the_switch_form --skip gpu::recomp::lower_dxil::tests::f16_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::f32_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::integer_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::f64_programs_on_the_gpu --skip gpu::recomp::lower_dxil::tests::const_and_null_mask_operands_agree_with_hlsl_on_the_gpu --skip gpu::dxil::fuzz_tests: 1003 passed, 0 failed, 43 ignored. SKIPPED (no wave64):a_2d_or_3d_group_agrees_with_the_hlsl_path_on_the_gpu,a_per_lane_2d_or_3d_group_runs_on_the_gpu,coalesced_guarded_runs_agree_with_the_hlsl_path_on_the_gpu,cross_lane_reads_agree_with_the_hlsl_path_on_the_gpu,gpu_geometry_wave32_prefix_count_over_a_mask,gpu_wave32_program_in_wave64_hardware,the_wave64_lowering_agrees_with_the_hlsl_path_on_the_gpu.from_d3d_supports_16bit_component_types,place_separates_16bit_and_32bit_rows_and_packs_16bit_together,mixed_mode_fixed_row_adopts_row_interp_mode,direct_dxil_vs_compr_and_ps_16bit_inputs_validate,direct_dxil_movrel_const_and_umin_bound_validate,direct_dxil_movrel_masks_m0_low_byte,direct_dxil_packed_f16_vs_ps_and_ms_validate,direct_dxil_mesh_non_uniform_barrier_guard,direct_dxil_lds_dword_straddling_16bit_validate,direct_dxil_infinite_loop_guarded_by_shader_loop_limit,direct_dxil_mixed_fp16_interp_preserves_half_across_ssa_phi,ps_attr_modes_follows_copied_reused_and_joined_interp_regs,m0_bounds_tracks_constants_masks_clamps_and_counted_loops,v_movrel_emits_bounded_switch_cases,vs_compr_param_and_16bit_sig_types_unpack_cleanly,ps_packed_f16_interp_high_bit_and_paired_attrs,vs_and_ms_packed_f16_param_unpack,v_movrel_and_swaprel_mask_m0_low_byte,mesh_passthrough_respects_32kb_align32_and_256_vert_limits,lds_16bit_straddling_dword_boundary_hlsl,fssm_16bit_packed_tables_and_slot_mapping.XCL_ADAPTER=radeon),cargo test --workspace -- --test-threads=4 --skip gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_1: 1013 passed, 0 failed, 45 ignored. SKIPPED:f16_programs_on_the_gpu(f16 arithmetic, wave32, per-lane form: refused (unsupported V_MUL_F16 (its #1426 semantics differ from the console's))),f16_programs_on_the_gpu(f16 arithmetic, wave64, per-lane form: refused (unsupported V_MUL_F16 (its #1426 semantics differ from the console's))),f16_programs_on_the_gpu(f16 packed, wave32, per-lane form: refused (unsupported V_PK_MUL_F16: VOP3 modifiers (its #1426 semantics differ from the console's))),f16_programs_on_the_gpu(f16 packed, wave64, per-lane form: refused (unsupported V_PK_MUL_F16: VOP3 modifiers (its #1426 semantics differ from the console's))),f32_programs_on_the_gpu(f32 conversions, wave32, per-lane form: refused (unsupported V_CVT_F16_F32 (its #1426 semantics differ from the console's))),f32_programs_on_the_gpu(f32 conversions, wave64, per-lane form: refused (unsupported V_CVT_F16_F32 (its #1426 semantics differ from the console's))),heap_window_out_of_memory_falls_back_to_the_switch_form(no heap windows).--skipleaves out tests that fail on main80f4819too, not because of this PR. On NVIDIA:heap_window_out_of_memory_falls_back_to_the_switch_form(#1651), the fourgpu::recomp::lower_dxil::tests::*_programs_on_the_gputests andconst_and_null_mask_operands_agree_with_hlsl_on_the_gpu(follow-up on #1651) fail becauserunner::skip_testturns their skips into failures underXCL_REQUIRE_GPU=mesh, andgpu::dxil::fuzz_testsseeds 70, 545, 1019 and 1507 failCreateComputePipelineStatewithE_OUTOFMEMORYon this card (drivers 616.64 and 621.40). On AMD:fuzz_validate_and_gpu_1fails on seed 540 (res[833]0x7 vs CPU 0x6). The AMD run does not setXCL_REQUIRE_GPU.Not tested
AI use
@raylitebull on GitHub · 2026-11-25 00:47 UTC · original
Stacking note: #1976 is currently stacked on top of #1975 (which carries the f16 signature packing, CFG
v_interpmodes, and boundedmovrel/M0[7:0]changes), while #1976 adds the mesh 32 KB split alignment, straddling 16-bit LDS reads/writes, safe multi-wave MS barriers (distinct from stale/conflicting #1793), andr0f16 attribute unpacking.We will rebase #1976 cleanly onto #1975's latest head (and trim down to only the 4 mesh/LDS/safe-barrier additions once #1975 lands) so reviewers see zero duplicated diff.
@raylitebull on GitHub · 2026-11-25 01:54 UTC · original
Rebased
#1976cleanly ontoae0518c+#1975(a85fa25) in commitec13a10:passthrough_splitadjustments inemit.rs(deferring cleanly to#304d3bd51d) and preserved#134'sPRELUDE_PIXELline.ec13a10cleanly stacked atop#1975'sa85fa25(#2008EXP VMrebase resolved).ec13a10for GitHub ActionsBuild and testand fresh AMD / NVIDIA verification (fidelity_tests,attribute_tests,v_swaprel_b32_uses_the_m0_relative_switch).@DavidM1911 on GitHub · 2026-11-25 03:19 UTC · original
Verification on RTX 3060 Ti (Windows 11): merge conflict with current
main(crates/xcl/src/gpu/recomp/emit.rs) — needs a rebase before it can be tested.@JJAutoCompare on GitHub · 2026-11-25 04:18 UTC · original
Tested
Independent STOR-WINLAB CPU verification of open PR #1976 at
ec13a10753ed792308a90d060093cc3254b6ab08. The checkout was clean and detached at that SHA before and after testing. The prior full-suite report covered an older head.Windows 11 Enterprise Evaluation 25H2 x64 (26200.9974), Ryzen 7 3800X, Rust and Cargo 1.100.0 (x86_64-pc-windows-msvc), unoptimized test profile with debug info and incremental compilation disabled. Intel Arc A770 driver 32.0.101.9175 was installed. The shader fixture loaded DXC/DXIL 1.9.2609.5. Both selected fixtures ran on the CPU.
Each exited 0 with 1 passed, 0 failed, 0 ignored, 0 skipped, and 1,082 filtered out (0.04 s and 0.01 s respectively).
phi i32,and i32, and the upper-half preservation mask0xFFFF0000.hi_register = Some(0)for the same-register r0 case,TEXCOORD0in slot 0 .xy andTEXCOORD8in slot 1 .zw. This fixture did not compile a shader.Not tested
GPU execution or pipeline creation, retail smoke, LDS, loop limits, relative moves, mesh barriers, and the workspace suite.
AI use
T3 Code / Codex (gpt-6.2-sol) inspected and ran the two checked-in fixtures and prepared this report from the logs.
@raylitebull on GitHub · 2026-11-25 10:38 UTC · original
Rebased
#1976cleanly onto568e7db+#1975(f6289cb) in commite5ddc4b(resolving#2034kernel.rsconflict while keeping 32 KBpassthrough_splitdeferred to#304and#134PRELUDE_PIXELpreserved).Pushed
e5ddc4bfor GitHub ActionsBuild and testand fresh AMD / NVIDIA verification.@raylitebull on GitHub · 2026-11-25 10:46 UTC · original
Rebased
#1976cleanly onto82e63982+#1975(1447d7e4) in commitadfcc9cd(#2174kernel.rsalignment, 32 KBpassthrough_splitdeferred to#304, and#134PRELUDE_PIXELpreserved).Verified locally (
fidelity_tests:19 passed, 0 failed,dxil 1.8.2502.11validated;attribute_tests:4 passed, 0 failed) and pushedadfcc9cd.@raylitebull on GitHub · 2026-11-25 10:55 UTC · original
Rebased
#1976cleanly onto1c17aa55+#1975(865350cc) in commit1447cf9f:crates/xcl/src/gpu/dxil/lower.rsconflict cleanly alongside#2156(03f8e572), keepingVAR_BAR_ALIVE = VAR_BUDGET + 6andVAR_IMG_WRITE = VAR_BUDGET + 8(+8..+24) disjoint and zero-initialized inInit::load(while keeping 32 KBpassthrough_splitdeferred to#304and#134PRELUDE_PIXELpreserved).cargo check --workspace --tests+fidelity_tests:19 passed, 0 failed,dxil 1.8.2502.11validated;attribute_tests:4 passed, 0 failed) and pushed1447cf9f.@Toons29 on GitHub · 2026-11-25 04:42 UTC · original · edited 2026-11-25 15:29 UTC
Regression run of
1447cf9fon the retail title, for this PR's Regression run section. Both blocks are fromscripts/smoke.ps1as printed, not edited:mainon1a0bbe3a, 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, 100 % 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; both blocks are exactly as printed, and I approved posting this.@raylitebull on GitHub · 2026-11-25 18:31 UTC · original
Rescoped and rebased
#1976cleanly ontoc9ee916a+#1975(72960386) in commit2e7debd8(+401 / -40across 6 files):.zwf16hunk (recomp/mod.rsis now untouched — zero overlap with@MacieGx'sMacieGx/xcl#recomp/f16-packed-interpolants) and updateddirect_dxil_mixed_fp16_interp_preserves_half_across_ssa_phito usemain'sPsAttr.#1976scoped cleanly to straddling 16-bit LDS ((addr & 3) == 3),XCL_SHADER_LOOP_LIMIT, and early-exit-safe Direct-DXIL multi-wave MS barriers (VAR_BAR_ALIVE).cargo check --workspace --testsPASS +14 passed, 0 failedin0.22s) and pushed2e7debd8.@DavidM1911 on GitHub · 2026-11-26 00:49 UTC · original
Re-verification on RTX 3060 Ti (Windows 11), new head merged with current
main:cargo test -p xcl --lib: all passed, 0 failed, 27 ignored. The earlier merge conflict is resolved.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.