recomp/dxil: straddling 16-bit LDS, XCL_SHADER_LOOP_LIMIT, and safe MS barriers #1966

Open
raylitebull wants to merge 2 commits from upstream-pr/1976 into main
raylitebull commented 2026-11-25 00:14:52 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by raylitebull on 2026-11-25T00:14:52Z.


Stacked on #1975 (extends #1975's 72960386 on c9ee916a with incremental commit 2e7debd8, +401 / -40 across 6 files).

Adds three robustness and correctness improvements across the HLSL recompiler and Direct DXIL translator (both 32 KB passthrough_split deferred to #304 and repeated-PS .zw f16 interpolant packing deferred cleanly to @MacieGx's recomp/f16-packed-interpolants — zero touch on recomp/mod.rs):

  1. Dword-straddling 16-bit LDS reads/writes (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) == 3 across (at >> 2) byte 3 and (at + 4) >> 2 byte 0 in both Direct DXIL (lds_read_bits, lds_bits_store) and HLSL (InterlockedAnd / InterlockedOr), while preserving #134 PRELUDE_PIXEL.
  2. Early-exit-safe multi-wave mesh barriers (kernel.rs, lower.rs): replaces Direct DXIL's non-uniform multi-wave mesh barrier fallback error with a bounded groupshared arrival barrier (xcl_bar via safe_barrier_init / safe_barrier_wait / safe_barrier_exit, reusing top 2 dwords of xcl_lds when present so TGSM stays <= 32768 bytes, gated by XCL_SAFE_BARRIER != 0, with VAR_BAR_ALIVE = VAR_BUDGET + 6 disjoint from #2156's VAR_IMG_WRITE = VAR_BUDGET + 8 and both zero-initialized in Init::load).
  3. Configurable XCL_SHADER_LOOP_LIMIT (emit.rs, lower.rs, pso.rs): configurable shader loop limit (default 65536, capped 1 << 24, folded into pso.rs translation identity), plus direct_dxil_mixed_fp16_interp_preserves_half_across_ssa_phi updated to use main's PsAttr.

Part of #1269.

What is in it

  • Incremental commit 2e7debd8 on 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.
  • Targeted tests: 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, and direct_dxil_mesh_non_uniform_barrier_guard (including full-32KB-LDS TGSM check).

Tested

  • Toolchain: Windows 11 x64, rustc 1.99.1 (58cf8f9c3 2026-10-13), DXC dxcompiler 1.8.2502.11 / dxil 1.8.2502.11, stacked on #1975 (72960386) over c9ee916a (2e7debd8).
  • cargo check --workspace --tests: passed (0 warnings in touched files).
  • Targeted tests covering #1975 + #1976: 14 passed, 0 failed (0.22s, dxil 1.8.2502.11 validated).

Regression run

  • Standalone scripts/smoke.ps1 pair on 2e7debd8 vs c9ee916a has not been run yet. AMD and NVIDIA reviewers are invited to test on 2e7debd8 vs c9ee916a (including scripts/smoke.ps1, XCL_DIRECT_DXIL=1, and multi-wave mesh / straddling 16-bit LDS workloads) and post results in the comments.

Not tested

  • 60 s scripts/smoke.ps1 pair on 2e7debd8, full cargo test --workspace suite on 2e7debd8, runtime GPU execution across AMD / NVIDIA / Intel hardware, and Linux/Wine/vkd3d-proton.

AI use

  • Antigravity assisted with implementation, rebase onto c9ee916a, trimming, and DXIL/recompiler validation tests; the author reviewed the diff and test output.
<!-- greyfinch-sync:ivall/xcl:issue:5482609627 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1976). Originally posted by [raylitebull](https://github.com/raylitebull) on 2026-11-25T00:14:52Z. --- **Stacked on #1975** (extends `#1975`'s `72960386` on `c9ee916a` with incremental commit `2e7debd8`, `+401 / -40` across 6 files). Adds three robustness and correctness improvements across the HLSL recompiler and Direct DXIL translator *(both 32 KB `passthrough_split` deferred to #304 and repeated-PS `.zw` `f16` interpolant packing deferred cleanly to `@MacieGx`'s `recomp/f16-packed-interpolants` — zero touch on `recomp/mod.rs`)*: 1. **Dword-straddling 16-bit LDS reads/writes (`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) == 3` across `(at >> 2)` byte 3 and `(at + 4) >> 2` byte 0 in both Direct DXIL (`lds_read_bits`, `lds_bits_store`) and HLSL (`InterlockedAnd` / `InterlockedOr`), while preserving `#134` `PRELUDE_PIXEL`. 2. **Early-exit-safe multi-wave mesh barriers (`kernel.rs`, `lower.rs`):** replaces Direct DXIL's non-uniform multi-wave mesh barrier fallback error with a bounded groupshared arrival barrier (`xcl_bar` via `safe_barrier_init` / `safe_barrier_wait` / `safe_barrier_exit`, reusing top 2 dwords of `xcl_lds` when present so TGSM stays `<= 32768` bytes, gated by `XCL_SAFE_BARRIER != 0`, with `VAR_BAR_ALIVE = VAR_BUDGET + 6` disjoint from `#2156`'s `VAR_IMG_WRITE = VAR_BUDGET + 8` and both zero-initialized in `Init::load`). 3. **Configurable `XCL_SHADER_LOOP_LIMIT` (`emit.rs`, `lower.rs`, `pso.rs`):** configurable shader loop limit (default `65536`, capped `1 << 24`, folded into `pso.rs` translation identity), plus `direct_dxil_mixed_fp16_interp_preserves_half_across_ssa_phi` updated to use `main`'s `PsAttr`. Part of #1269. **What is in it** - Incremental commit `2e7debd8` on 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`. - Targeted tests: `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`, and `direct_dxil_mesh_non_uniform_barrier_guard` (including full-32KB-LDS TGSM check). **Tested** - Toolchain: Windows 11 x64, `rustc 1.99.1 (58cf8f9c3 2026-10-13)`, DXC `dxcompiler 1.8.2502.11` / `dxil 1.8.2502.11`, stacked on `#1975` (`72960386`) over `c9ee916a` (`2e7debd8`). - `cargo check --workspace --tests`: passed (`0` warnings in touched files). - Targeted tests covering `#1975` + `#1976`: **14 passed, 0 failed** (`0.22s`, `dxil 1.8.2502.11` validated). **Regression run** - Standalone `scripts/smoke.ps1` pair on `2e7debd8` vs `c9ee916a` has not been run yet. AMD and NVIDIA reviewers are invited to test on `2e7debd8` vs `c9ee916a` (including `scripts/smoke.ps1`, `XCL_DIRECT_DXIL=1`, and multi-wave mesh / straddling 16-bit LDS workloads) and post results in the comments. **Not tested** - 60 s `scripts/smoke.ps1` pair on `2e7debd8`, full `cargo test --workspace` suite on `2e7debd8`, runtime GPU execution across AMD / NVIDIA / Intel hardware, and Linux/Wine/vkd3d-proton. **AI use** - Antigravity assisted with implementation, rebase onto `c9ee916a`, trimming, and DXIL/recompiler validation tests; the author reviewed the diff and test output.
futurepro62 commented 2026-11-25 01:10:47 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by futurepro62 on 2026-11-25T00:30:02Z.


Full-suite run, since this PR has no test report yet. Tested exact head fed1358 (on its base 80f4819).

Tested

  • NVIDIA GeForce RTX 5070 Ti 16 GB (Blackwell, 32-lane waves only, mesh shaders), driver 621.40, Ryzen 7 9800X3D, Windows 11 Home 26300, Rust 1.100.0 MSVC, DXC + dxil.dll 1.9.2602.17 (Windows SDK 10.0.26100), debug, D3D12 debug layer installed.
  • cargo build --workspace, then XCL_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.
  • The new tests ran and passed: 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.
  • Same head on the AMD Radeon integrated GPU (iGPU) of the Ryzen 7 9800X3D (RDNA2, 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).
  • --skip leaves out tests that fail on main 80f4819 too, not because of this PR. On NVIDIA: heap_window_out_of_memory_falls_back_to_the_switch_form (#1651), the four gpu::recomp::lower_dxil::tests::*_programs_on_the_gpu tests and const_and_null_mask_operands_agree_with_hlsl_on_the_gpu (follow-up on #1651) fail because runner::skip_test turns their skips into failures under XCL_REQUIRE_GPU=mesh, and gpu::dxil::fuzz_tests seeds 70, 545, 1019 and 1507 fail CreateComputePipelineState with E_OUTOFMEMORY on this card (drivers 616.64 and 621.40). On AMD: fuzz_validate_and_gpu_1 fails on seed 540 (res[833] 0x7 vs CPU 0x6). The AMD run does not set XCL_REQUIRE_GPU.

Not tested

  • a release build, a game (test run only).

AI use

  • Claude Code (Claude Opus 5.5) ran the tests and wrote this report. I checked it before posting.
<!-- greyfinch-sync:ivall/xcl:comment:7148572780 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1976#issuecomment-7148572780). Originally posted by [futurepro62](https://github.com/futurepro62) on 2026-11-25T00:30:02Z. --- Full-suite run, since this PR has no test report yet. Tested exact head `fed1358` (on its base `80f4819`). **Tested** - NVIDIA GeForce RTX 5070 Ti 16 GB (Blackwell, 32-lane waves only, mesh shaders), driver 621.40, Ryzen 7 9800X3D, Windows 11 Home 26300, Rust 1.100.0 MSVC, DXC + dxil.dll 1.9.2602.17 (Windows SDK 10.0.26100), debug, D3D12 debug layer installed. - `cargo build --workspace`, then `XCL_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`. - The new tests ran and passed: `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`. - Same head on the AMD Radeon integrated GPU (iGPU) of the Ryzen 7 9800X3D (RDNA2, `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). - `--skip` leaves out tests that fail on main `80f4819` too, not because of this PR. On NVIDIA: `heap_window_out_of_memory_falls_back_to_the_switch_form` (#1651), the four `gpu::recomp::lower_dxil::tests::*_programs_on_the_gpu` tests and `const_and_null_mask_operands_agree_with_hlsl_on_the_gpu` ([follow-up on #1651](https://github.com/xcl-dev/xcl/issues/1651#issuecomment-7146069648)) fail because `runner::skip_test` turns their skips into failures under `XCL_REQUIRE_GPU=mesh`, and `gpu::dxil::fuzz_tests` seeds 70, 545, 1019 and 1507 fail `CreateComputePipelineState` with `E_OUTOFMEMORY` on this card (drivers 616.64 and 621.40). On AMD: `fuzz_validate_and_gpu_1` fails on seed 540 (`res[833]` 0x7 vs CPU 0x6). The AMD run does not set `XCL_REQUIRE_GPU`. **Not tested** - a release build, a game (test run only). **AI use** - Claude Code (Claude Opus 5.5) ran the tests and wrote this report. I checked it before posting.
raylitebull commented 2026-11-25 01:10:52 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by raylitebull on 2026-11-25T00:47:41Z.


Stacking note: #1976 is currently stacked on top of #1975 (which carries the f16 signature packing, CFG v_interp modes, and bounded movrel/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), and r0 f16 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.

<!-- greyfinch-sync:ivall/xcl:comment:7148881993 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1976#issuecomment-7148881993). Originally posted by [raylitebull](https://github.com/raylitebull) on 2026-11-25T00:47:41Z. --- Stacking note: #1976 is currently stacked on top of **#1975** (which carries the f16 signature packing, CFG `v_interp` modes, and bounded `movrel`/`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), and `r0` f16 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.
upstream-sync changed title from [PR #1976] recomp/dxil: align mesh 32KB split, straddling 16-bit LDS, safe MS barriers, and r0 f16 attrs to [PR #1976] recomp/dxil: straddling 16-bit LDS, r0 f16 attrs, loop limit, and safe MS barriers 2026-11-25 02:08:04 +00:00
raylitebull commented 2026-11-25 02:09:01 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by raylitebull on 2026-11-25T01:54:18Z.


Rebased #1976 cleanly onto ae0518c + #1975 (a85fa25) in commit ec13a10:

  • Trimmed the 32 KB passthrough_split adjustments in emit.rs (deferring cleanly to #304 d3bd51d) and preserved #134's PRELUDE_PIXEL line.
  • Updated the PR title/summary accordingly and kept ec13a10 cleanly stacked atop #1975's a85fa25 (#2008 EXP VM rebase resolved).
  • Pushed ec13a10 for GitHub Actions Build and test and fresh AMD / NVIDIA verification (fidelity_tests, attribute_tests, v_swaprel_b32_uses_the_m0_relative_switch).
<!-- greyfinch-sync:ivall/xcl:comment:7150094539 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1976#issuecomment-7150094539). Originally posted by [raylitebull](https://github.com/raylitebull) on 2026-11-25T01:54:18Z. --- Rebased `#1976` cleanly onto `ae0518c` + `#1975` (`a85fa25`) in commit `ec13a10`: - Trimmed the 32 KB `passthrough_split` adjustments in `emit.rs` (deferring cleanly to `#304` `d3bd51d`) and preserved `#134`'s `PRELUDE_PIXEL` line. - Updated the PR title/summary accordingly and kept `ec13a10` cleanly stacked atop `#1975`'s `a85fa25` (`#2008` `EXP VM` rebase resolved). - Pushed `ec13a10` for GitHub Actions `Build and test` and fresh AMD / NVIDIA verification (`fidelity_tests`, `attribute_tests`, `v_swaprel_b32_uses_the_m0_relative_switch`).
DavidM1911 commented 2026-11-25 04:10:24 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-25T03:19:52Z.


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.

<!-- greyfinch-sync:ivall/xcl:comment:7151813114 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1976#issuecomment-7151813114). Originally posted by [DavidM1911](https://github.com/DavidM1911) on 2026-11-25T03:19:52Z. --- 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 commented 2026-11-25 05:08:14 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by JJAutoCompare on 2026-11-25T04:18:46Z.


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.

cargo test --locked -p xcl --lib gpu::dxil::lower_valu::fidelity_tests::direct_dxil_mixed_fp16_interp_preserves_half_across_ssa_phi -- --exact --nocapture --test-threads=1
cargo test --locked -p xcl --lib gpu::recomp::attribute_tests::fssm_16bit_packed_tables_and_slot_mapping -- --exact --nocapture --test-threads=1

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).

  • The mixed-FP16 pixel shader passed DXIL validation and disassembly. The fixture found phi i32, and i32, and the upper-half preservation mask 0xFFFF0000.
  • The FSSM fixture checked packed PS and VS/MS metadata, including hi_register = Some(0) for the same-register r0 case, TEXCOORD0 in slot 0 .xy and TEXCOORD8 in 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.

<!-- greyfinch-sync:ivall/xcl:comment:7152727922 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1976#issuecomment-7152727922). Originally posted by [JJAutoCompare](https://github.com/JJAutoCompare) on 2026-11-25T04:18:46Z. --- **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. ```powershell cargo test --locked -p xcl --lib gpu::dxil::lower_valu::fidelity_tests::direct_dxil_mixed_fp16_interp_preserves_half_across_ssa_phi -- --exact --nocapture --test-threads=1 cargo test --locked -p xcl --lib gpu::recomp::attribute_tests::fssm_16bit_packed_tables_and_slot_mapping -- --exact --nocapture --test-threads=1 ``` 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). - The mixed-FP16 pixel shader passed DXIL validation and disassembly. The fixture found `phi i32`, `and i32`, and the upper-half preservation mask `0xFFFF0000`. - The FSSM fixture checked packed PS and VS/MS metadata, including `hi_register = Some(0)` for the same-register r0 case, `TEXCOORD0` in slot 0 .xy and `TEXCOORD8` in 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.
Toons29 commented 2026-11-25 05:08:25 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Toons29 on 2026-11-25T04:42:24Z.


Regression run of 1447cf9f on the retail title, for this PR's Regression run section. Both blocks are from scripts/smoke.ps1 as printed, not edited: main on 1a0bbe3a, this PR on its head commit with no uncommitted changes, same title and time.

xcl-smoke v1
commit: 1a0bbe3a2ba91ea8f5b6fc29130a053868d3c9e6
gpu: AMD Radeon RX 9070
title: 34df7c50
seconds: 60
exit: 0x0
frames shown: 1628 (PresentX 1628)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14561 MB
xcl-smoke v1
commit: 1447cf9f209c69f64b0c31570d37efd5372f2ad0
gpu: AMD Radeon RX 9070
title: 34df7c50
seconds: 60
exit: 0x0
frames shown: 1630 (PresentX 1630)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14561 MB

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.

<!-- greyfinch-sync:ivall/xcl:comment:7153089918 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1976#issuecomment-7153089918). Originally posted by [Toons29](https://github.com/Toons29) on 2026-11-25T04:42:24Z. --- Regression run of `1447cf9f` on the retail title, for this PR's **Regression run** section. Both blocks are from `scripts/smoke.ps1` as printed, not edited: `main` on `1a0bbe3a`, this PR on its head commit with no uncommitted changes, same title and time. ``` xcl-smoke v1 commit: 1a0bbe3a2ba91ea8f5b6fc29130a053868d3c9e6 gpu: AMD Radeon RX 9070 title: 34df7c50 seconds: 60 exit: 0x0 frames shown: 1628 (PresentX 1628) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14561 MB ``` ``` xcl-smoke v1 commit: 1447cf9f209c69f64b0c31570d37efd5372f2ad0 gpu: AMD Radeon RX 9070 title: 34df7c50 seconds: 60 exit: 0x0 frames shown: 1630 (PresentX 1630) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14561 MB ``` 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 commented 2026-11-25 11:09:13 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by raylitebull on 2026-11-25T10:38:29Z.


Rebased #1976 cleanly onto 568e7db + #1975 (f6289cb) in commit e5ddc4b (resolving #2034 kernel.rs conflict while keeping 32 KB passthrough_split deferred to #304 and #134 PRELUDE_PIXEL preserved).

Pushed e5ddc4b for GitHub Actions Build and test and fresh AMD / NVIDIA verification.

<!-- greyfinch-sync:ivall/xcl:comment:7159973113 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1976#issuecomment-7159973113). Originally posted by [raylitebull](https://github.com/raylitebull) on 2026-11-25T10:38:29Z. --- Rebased `#1976` cleanly onto `568e7db` + `#1975` (`f6289cb`) in commit `e5ddc4b` (resolving `#2034` `kernel.rs` conflict while keeping 32 KB `passthrough_split` deferred to `#304` and `#134` `PRELUDE_PIXEL` preserved). Pushed `e5ddc4b` for GitHub Actions `Build and test` and fresh AMD / NVIDIA verification.
raylitebull commented 2026-11-25 11:09:23 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by raylitebull on 2026-11-25T10:46:41Z.


Rebased #1976 cleanly onto 82e63982 + #1975 (1447d7e4) in commit adfcc9cd (#2174 kernel.rs alignment, 32 KB passthrough_split deferred to #304, and #134 PRELUDE_PIXEL preserved).

Verified locally (fidelity_tests: 19 passed, 0 failed, dxil 1.8.2502.11 validated; attribute_tests: 4 passed, 0 failed) and pushed adfcc9cd.

<!-- greyfinch-sync:ivall/xcl:comment:7160159589 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1976#issuecomment-7160159589). Originally posted by [raylitebull](https://github.com/raylitebull) on 2026-11-25T10:46:41Z. --- Rebased `#1976` cleanly onto `82e63982` + `#1975` (`1447d7e4`) in commit `adfcc9cd` (`#2174` `kernel.rs` alignment, 32 KB `passthrough_split` deferred to `#304`, and `#134` `PRELUDE_PIXEL` preserved). Verified locally (`fidelity_tests`: `19 passed, 0 failed`, `dxil 1.8.2502.11` validated; `attribute_tests`: `4 passed, 0 failed`) and pushed `adfcc9cd`.
raylitebull commented 2026-11-25 11:09:36 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by raylitebull on 2026-11-25T10:55:04Z.


Rebased #1976 cleanly onto 1c17aa55 + #1975 (865350cc) in commit 1447cf9f:

  • Resolved the crates/xcl/src/gpu/dxil/lower.rs conflict cleanly alongside #2156 (03f8e572), keeping VAR_BAR_ALIVE = VAR_BUDGET + 6 and VAR_IMG_WRITE = VAR_BUDGET + 8 (+8..+24) disjoint and zero-initialized in Init::load (while keeping 32 KB passthrough_split deferred to #304 and #134 PRELUDE_PIXEL preserved).
  • Verified locally (cargo check --workspace --tests + fidelity_tests: 19 passed, 0 failed, dxil 1.8.2502.11 validated; attribute_tests: 4 passed, 0 failed) and pushed 1447cf9f.
<!-- greyfinch-sync:ivall/xcl:comment:7160344998 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1976#issuecomment-7160344998). Originally posted by [raylitebull](https://github.com/raylitebull) on 2026-11-25T10:55:04Z. --- Rebased `#1976` cleanly onto `1c17aa55` + `#1975` (`865350cc`) in commit `1447cf9f`: - Resolved the `crates/xcl/src/gpu/dxil/lower.rs` conflict cleanly alongside `#2156` (`03f8e572`), keeping `VAR_BAR_ALIVE = VAR_BUDGET + 6` and `VAR_IMG_WRITE = VAR_BUDGET + 8` (`+8..+24`) disjoint and zero-initialized in `Init::load` (while keeping 32 KB `passthrough_split` deferred to `#304` and `#134` `PRELUDE_PIXEL` preserved). - Verified locally (`cargo check --workspace --tests` + `fidelity_tests`: `19 passed, 0 failed`, `dxil 1.8.2502.11` validated; `attribute_tests`: `4 passed, 0 failed`) and pushed `1447cf9f`.
upstream-sync changed title from [PR #1976] recomp/dxil: straddling 16-bit LDS, r0 f16 attrs, loop limit, and safe MS barriers to [PR #1976] recomp/dxil: straddling 16-bit LDS, XCL_SHADER_LOOP_LIMIT, and safe MS barriers 2026-11-25 19:07:32 +00:00
raylitebull commented 2026-11-25 19:09:08 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by raylitebull on 2026-11-25T18:31:14Z.


Rescoped and rebased #1976 cleanly onto c9ee916a + #1975 (72960386) in commit 2e7debd8 (+401 / -40 across 6 files):

  • Dropped the repeated-PS .zw f16 hunk (recomp/mod.rs is now untouched — zero overlap with @MacieGx's MacieGx/xcl#recomp/f16-packed-interpolants) and updated direct_dxil_mixed_fp16_interp_preserves_half_across_ssa_phi to use main's PsAttr.
  • Kept #1976 scoped 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).
  • Verified locally (cargo check --workspace --tests PASS + 14 passed, 0 failed in 0.22s) and pushed 2e7debd8.
<!-- greyfinch-sync:ivall/xcl:comment:7171018766 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1976#issuecomment-7171018766). Originally posted by [raylitebull](https://github.com/raylitebull) on 2026-11-25T18:31:14Z. --- Rescoped and rebased `#1976` cleanly onto `c9ee916a` + `#1975` (`72960386`) in commit `2e7debd8` (`+401 / -40` across 6 files): - Dropped the repeated-PS `.zw` `f16` hunk (`recomp/mod.rs` is now untouched — zero overlap with `@MacieGx`'s `MacieGx/xcl#recomp/f16-packed-interpolants`) and updated `direct_dxil_mixed_fp16_interp_preserves_half_across_ssa_phi` to use `main`'s `PsAttr`. - Kept `#1976` scoped 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`). - Verified locally (`cargo check --workspace --tests` PASS + `14 passed, 0 failed` in `0.22s`) and pushed `2e7debd8`.
bmjask commented 2026-11-25 21:52:35 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by bmjask on 2026-11-25T21:52:35Z.

Review: COMMENTED


P1: direct-DXIL safe mesh-barrier state aliases normal LDS. kernel reserves dwords 8190-8191 by lowering lds_top for mesh shader, but lower_mem applies lds_top only when split; non-split Direct-DXIL DS accesses can still address reserved dwords. Full-32KiB LDS shader can overwrite liveness/generation state, corrupt LDS and release/hang barrier. Reserve/remap in non-split path too or use separate storage; add DS access-at-reserved-address plus barrier behavior regression. Current full-32KiB test only validates TGSM size.

<!-- greyfinch-sync:ivall/xcl:review:6065485135 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1976#pullrequestreview-6065485135). Originally posted by [bmjask](https://github.com/bmjask) on 2026-11-25T21:52:35Z. **Review:** COMMENTED --- P1: direct-DXIL safe mesh-barrier state aliases normal LDS. kernel reserves dwords 8190-8191 by lowering lds_top for mesh shader, but lower_mem applies lds_top only when split; non-split Direct-DXIL DS accesses can still address reserved dwords. Full-32KiB LDS shader can overwrite liveness/generation state, corrupt LDS and release/hang barrier. Reserve/remap in non-split path too or use separate storage; add DS access-at-reserved-address plus barrier behavior regression. Current full-32KiB test only validates TGSM size.
DavidM1911 commented 2026-11-26 01:05:43 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-26T00:49:38Z.


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

<!-- greyfinch-sync:ivall/xcl:comment:7179152283 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1976#issuecomment-7179152283). Originally posted by [DavidM1911](https://github.com/DavidM1911) on 2026-11-26T00:49:38Z. --- 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
upipibi commented 2026-11-26 16:27:12 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by upipibi on 2026-11-26T16:27:12Z.


Part 3 here (XCL_SHADER_LOOP_LIMIT) is the same switch as #1284's XCL_LOOP_BUDGET (open since 2026-11-24, CI green, tested on RDNA4, NVIDIA and Arc): both rewrite the prelude's xcl_budget line and keep the default HLSL unchanged. Two variables for one budget would confuse users, so only one should land. #1284 covers the HLSL path only; part 3 also covers direct DXIL (LOOP_BUDGET in dxil/lower.rs) and caps the value at 1 << 24. Either way works for me: drop part 3 here and I add the direct-DXIL wiring and the cap to #1284, or keep it here and #1284 is closed. #2793 (per-region budgets) needs to follow whichever name lands.

AI-assisted (Claude Code, Claude Opus 5.5): read both diffs and wrote this.

<!-- greyfinch-sync:ivall/xcl:comment:7197665130 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1976#issuecomment-7197665130). Originally posted by [upipibi](https://github.com/upipibi) on 2026-11-26T16:27:12Z. --- Part 3 here (`XCL_SHADER_LOOP_LIMIT`) is the same switch as #1284's `XCL_LOOP_BUDGET` (open since 2026-11-24, CI green, tested on RDNA4, NVIDIA and Arc): both rewrite the prelude's `xcl_budget` line and keep the default HLSL unchanged. Two variables for one budget would confuse users, so only one should land. #1284 covers the HLSL path only; part 3 also covers direct DXIL (`LOOP_BUDGET` in dxil/lower.rs) and caps the value at 1 << 24. Either way works for me: drop part 3 here and I add the direct-DXIL wiring and the cap to #1284, or keep it here and #1284 is closed. #2793 (per-region budgets) needs to follow whichever name lands. AI-assisted (Claude Code, Claude Opus 5.5): read both diffs and wrote this.
Foniass commented 2026-12-01 06:32:52 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T06:32:52Z.


Review (head 2e7debd8, diff read, not a merge-check; it conflicts with main and CI / PR description are red, so not built or run). Stacked on #1975, so its diff carries #1975 too.

  • Partly superseded. The safe mesh barrier is replaced by main's f8c01769 (main deliberately uses slot VAR_BUDGET+7), and XCL_SHADER_LOOP_LIMIT by main's per-dispatch loop budget (dispatch_loop_budget, IO_LOOP_BUDGET).
  • Still missing on main: 16-bit LDS reads / writes that cross a dword (address & 3 == 3). Main keeps only the low byte there in both translators (lower_mem.rs ~2343-2360, emit.rs ~4858-4876: it shifts by 24 and masks 16 bits), so the high byte is lost if the console allows such an access. This PR's split read / write (lower_mem.rs ~2223-2268, emit.rs ~4608-4658) reads as correct, but the HLSL test only matches strings, the direct DXIL one only validates, nothing runs on a GPU, and every 16-bit LDS read now does a second load (cost not measured).
  • AI use names no model.

Recommendation: close and re-propose only the straddling 16-bit LDS fix as a small PR against main, with a GPU test that fails on main (and a note on whether RDNA2 allows that alignment).

AI review: Claude Code (Claude Opus 5.5), posted by Foniass without a human check of each point.

<!-- greyfinch-sync:ivall/xcl:comment:7302998203 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1976#issuecomment-7302998203). Originally posted by [Foniass](https://github.com/Foniass) on 2026-12-01T06:32:52Z. --- Review (head 2e7debd8, diff read, not a merge-check; it conflicts with main and CI / `PR description` are red, so not built or run). Stacked on #1975, so its diff carries #1975 too. - **Partly superseded.** The safe mesh barrier is replaced by main's f8c01769 (main deliberately uses slot `VAR_BUDGET+7`), and `XCL_SHADER_LOOP_LIMIT` by main's per-dispatch loop budget (`dispatch_loop_budget`, `IO_LOOP_BUDGET`). - **Still missing on main: 16-bit LDS reads / writes that cross a dword** (address & 3 == 3). Main keeps only the low byte there in both translators (`lower_mem.rs` ~2343-2360, `emit.rs` ~4858-4876: it shifts by 24 and masks 16 bits), so the high byte is lost if the console allows such an access. This PR's split read / write (`lower_mem.rs` ~2223-2268, `emit.rs` ~4608-4658) reads as correct, but the HLSL test only matches strings, the direct DXIL one only validates, nothing runs on a GPU, and every 16-bit LDS read now does a second load (cost not measured). - AI use names no model. Recommendation: close and re-propose only the straddling 16-bit LDS fix as a small PR against main, with a GPU test that fails on main (and a note on whether RDNA2 allows that alignment). AI review: Claude Code (Claude Opus 5.5), posted by Foniass without a human check of each point.
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/1976:upstream-pr/1976'
git switch 'upstream-pr/1976'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'upstream-pr/1976'
git switch 'upstream-pr/1976'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/1976'
git switch 'upstream-pr/1976'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/1976'
git switch 'main'
git merge --squash 'upstream-pr/1976'
git switch 'main'
git merge --ff-only 'upstream-pr/1976'
git switch 'main'
git merge 'upstream-pr/1976'
git push origin 'main'
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
xcl-dev/xcl!1966
No description provided.