Recompiler: allow inline-constant and NULL mask operands in the per-lane form #1864
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!1864
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/1864/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?
@emirduran707 on GitHub · 2026-11-24 22:06 UTC · original
emirduran707:recomp-per-lane-const-mask-operands→main· +109 −29 · 2 files · 1 commits · merged 2026-11-24 23:54 UTCIn the per-lane direct DXIL backend (#1745):
bridge()rejectedV_CNDMASK_B32,V_ADD_CO_CI_U32,V_SUB_CO_CI_U32, andV_SUBREV_CO_CI_U32whenever the mask operand was not an SGPR (m > 127, such as inline carry-in0=128or-1=193, orNULL=125), even thoughdxil::Lw::read64already decodes non-SGPR mask operands without reading any SGPR.src_bit()accepted only SGPRs,128(0), and193(-1), refusingNULL(125), inline integer masks (129..=192,194..=208), and 32-bit literals (255).src()andsrc64()missed125(NULL).Part of #1269.
bridge()now skips SGPR injection whenm > 127 || m == 125,src_bit()extracts the lane's bit fromNULL, inline integers (sign-extended to 64 bits for negative values), and 32-bit literals, andsrc()/src64()handle125.What is in it
crates/xcl/src/gpu/recomp/lower.rs: handle125(NULL) insrc()/src64(), extendsrc_bit()for125,129..=192,194..=208, and255, and skip SGPR injection inbridge()whenm > 127 || m == 125.crates/xcl/src/gpu/recomp/lower_dxil.rs: GPU parity testconst_and_null_mask_operands_agree_with_hlsl_on_the_gpu(wave32 and wave64,V_ADD_CO_CI_U32with128/193/125,V_CNDMASK_B32with inline positive/negative/NULL masks, and mask SALU with inline mask).Tested
cargo test --workspace -- --test-threads=4on15fff3b: 960 passed, 0 failed, 43 ignored; 8 SKIPPED (6 inlower_dxil::tests::{f16,f32}_programs_on_the_gpu;heap_window_out_of_memory_falls_back_to_the_switch_form;pso_measurement_compiles_an_exact_synthetic_record)const_and_null_mask_operands_agree_with_hlsl_on_the_gpubefore the change failed (wave32: unsupported V_ADD_CO_CI_U32 (V_ADD_CO_CI_U32: mask operand 128)); passes on both wave32 and native wave64 afterRegression run
main:
this PR:
Not tested
WaveSize(32)) GPUs (NVIDIA / Intel / wave32-only).AI use
@upipibi on GitHub · 2026-11-24 22:20 UTC · original
NVIDIA counterpart to the RX 9060 XT run: RTX 3070 8 GB (32-lane waves, no native wave64), driver 616.56, Windows 11, debug,
15fff3bmerged ontomain689f2db.const_and_null_mask_operands_agree_with_hlsl_on_the_gpu: the wave32 form passes, 2 of 2 runs. The wave64 form skips ("no wave64"), so your AMD run is the wave64 coverage.gpu::recomp::lower(lower, lower_dxil, lower::wave): 47 passed, 0 failed.AI-assisted (Claude Code). Synthetic tests only.
@frenziedcoder on GitHub · 2026-11-24 22:13 UTC · original · edited 2026-11-24 22:26 UTC
NVIDIA test report for
15fff3b: full suite green, its own GPU test skipped here (no wave64), and a clean smoke pair on the retail title (1656 vs 1654 frames).Tested
stable-x86_64-pc-windows-msvc, DXC 1.8.2502.11 (SDK 10.0.26100.0). Exact head15fff3b4fb528add77a5d81e583aa626130c15f7, no local changes.cargo build --workspace && cargo test --workspace -- --test-threads=4(debug): 960 passed, 0 failed, 43 ignored; the PR's own testconst_and_null_mask_operands_agree_with_hlsl_on_the_gpuSKIPPED here. SKIPPED:gpu::recomp::lower::tests::a_2d_or_3d_group_agrees_with_the_hlsl_path_on_the_gpu(no wave64),gpu::recomp::lower::tests::coalesced_guarded_runs_agree_with_the_hlsl_path_on_the_gpu(no wave64),gpu::recomp::lower::tests::cross_lane_reads_agree_with_the_hlsl_path_on_the_gpu(no wave64),gpu::recomp::lower::tests::the_wave64_lowering_agrees_with_the_hlsl_path_on_the_gpu(no wave64),gpu::recomp::lower_dxil::tests::a_per_lane_2d_or_3d_group_runs_on_the_gpu(no wave64),gpu::recomp::lower_dxil::tests::const_and_null_mask_operands_agree_with_hlsl_on_the_gpu(const_mask, wave64: no wave64),gpu::recomp::lower_dxil::tests::f16_programs_on_the_gpu(f16 arithmetic, wave32, per-lane form: refused (unsupported V_MUL_F16 (its #1426 semantics differ from the console's))),gpu::recomp::lower_dxil::tests::f16_programs_on_the_gpu(f16 arithmetic, wave64: no wave64),gpu::recomp::lower_dxil::tests::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))),gpu::recomp::lower_dxil::tests::f16_programs_on_the_gpu(f16 packed, wave64: no wave64),gpu::recomp::lower_dxil::tests::f32_programs_on_the_gpu(f32 arithmetic, wave64: no wave64),gpu::recomp::lower_dxil::tests::f32_programs_on_the_gpu(f32 compares, wave64: no wave64),gpu::recomp::lower_dxil::tests::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))),gpu::recomp::lower_dxil::tests::f32_programs_on_the_gpu(f32 conversions, wave64: no wave64),gpu::recomp::lower_dxil::tests::f32_programs_on_the_gpu(f32 rounding, wave64: no wave64),gpu::recomp::lower_dxil::tests::f32_programs_on_the_gpu(f32 three-source, wave64: no wave64),gpu::recomp::lower_dxil::tests::f32_programs_on_the_gpu(f32 transcendentals, wave64: no wave64),gpu::recomp::lower_dxil::tests::f64_programs_on_the_gpu(f64, wave64: no wave64),gpu::recomp::lower_dxil::tests::integer_programs_on_the_gpu(integer arithmetic, wave64: no wave64),gpu::recomp::lower_dxil::tests::integer_programs_on_the_gpu(integer carries, wave64: no wave64),gpu_geometry_wave32_prefix_count_over_a_mask(no wave64),gpu_wave32_program_in_wave64_hardware(no wave64),heap_window_out_of_memory_falls_back_to_the_switch_form(no heap windows).const_and_null_mask_operands_agree_with_hlsl_on_the_gpuSKIPPED on this card (no wave64: NVIDIA runs 32-lane waves only), so the change itself is not exercised by its test here; this report covers the rest of the suite and the smoke pair.test_title_draws_with_a_root_signature_under_the_debug_layerreports ok, but this machine has no D3D12 debug layer (debug layer requested but unavailable … (0x887A002D)), so it ran without the layer and is no evidence either way.Regression run (
scripts/smoke.ps1 -Seconds 60, release, the retail title of #505 at its start screen;XCL_PSO_PRELOAD=0for both builds, because this machine's preload list holds the program of #1307)base (
1d027e5, this PR's merge base withmain):this PR:
Not tested: this code in the title: it is on the opt-in direct-DXIL path (
XCL_PER_LANE=1withXCL_DIRECT_DXIL), which the smoke runs leave unset (default HLSL backend), so they show only that nothing else regressed; the world load (the smoke runs stop at the start screen, so code that only runs later is not exercised there); AMD.AI use: Claude Code (Claude Opus 5.5) built and ran the tests and smoke runs on my machine and wrote this report; I checked it.
@DavidM1911 on GitHub · 2026-11-25 01:38 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!