Recompiler: lower S_FF0_I32 and S_FLBIT_I32 on mask registers in the per-lane form #1865
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!1865
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/1865/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-mask-ff0-flbit→main· +134 −21 · 2 files · 1 commits · merged 2026-11-25 01:33 UTCwave_saluin the per-lane direct DXIL backend (#1745) loweredS_BCNT1,S_BCNT0, andS_FF1on mask registers, butS_FF0_I32_B32,S_FF0_I32_B64,S_FLBIT_I32_B32, andS_FLBIT_I32_B64fell through tobridge()and failed with"a mask read as a number". Part of #1269.wave_salunow lowersS_FF0_I32_B32/B64viafirst_seton the inverted mask words andS_FLBIT_I32_B32/B64via leading-zero count (returning0xFFFFFFFFwhen the input is 0, matchingemit.rsand the RDNA2 ISA).What is in it
crates/xcl/src/gpu/recomp/lower/wave.rs: addclz32helper and handleS_FF0_I32_B32/B64andS_FLBIT_I32_B32/B64inwave_salu.crates/xcl/src/gpu/recomp/lower_dxil.rs: GPU parity testmask_ff0_and_flbit_agree_with_hlsl_on_the_gpu(wave32 and wave64 across partial, all-ones, and all-zeros masks, plus B32 onEXEC).Tested
cargo build --workspace, thencargo test --workspace --no-fail-fast -- --test-threads=4on2c1102d(rebased ontomainde36462): 1003 passed, 2 failed, 45 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)gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_1,gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_3) fail identically on unmodifiedmainde36462on this GPU (seeds 722 and 1599).mask_ff0_and_flbit_agree_with_hlsl_on_the_gpubefore the change failed (wave32: unsupported S_FF0_I32_B32 (s106: a mask read as a number)); passes on both wave32 and native wave64 afterRegression run
main:
this PR:
Not tested
WaveSize(32)) GPUs (NVIDIA / Intel / wave32-only).AI use
mainde36462(a conflict in the tests ofcrates/xcl/src/gpu/recomp/lower_dxil.rs; both tests kept) and reran the suite and smoke runs above.@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,
dfddc79merged ontomain689f2db.mask_ff0_and_flbit_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:15 UTC · original · edited 2026-11-24 22:26 UTC
NVIDIA test report for
dfddc79: full suite green, its own GPU test skipped here (no wave64), and a clean smoke pair on the retail title (1654 vs 1654 frames).Tested
stable-x86_64-pc-windows-msvc, DXC 1.8.2502.11 (SDK 10.0.26100.0). Exact headdfddc79a5a69fd3d7a3dc5a352c75d1764f39281, no local changes.cargo build --workspace && cargo test --workspace -- --test-threads=4(debug): 960 passed, 0 failed, 43 ignored; the PR's own testmask_ff0_and_flbit_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::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::recomp::lower_dxil::tests::mask_ff0_and_flbit_agree_with_hlsl_on_the_gpu(mask_ff0_flbit, 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).mask_ff0_and_flbit_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.
@raylitebull on GitHub · 2026-11-25 01:07 UTC · original
Both AMD and NVIDIA verification look good on
dfddc79. This is currentlyDIRTYwith merge conflicts againstmain— please rebase ontomainand letBuild and test (Windows, no GPU)run cleanly so we can merge.@DavidM1911 on GitHub · 2026-11-25 01:38 UTC · original
Verification on RTX 3060 Ti (Windows 11): merge conflict with current
main— needs a rebase before it can be tested.@DavidM1911 on GitHub · 2026-11-26 00:34 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