Recompiler: translate v_div_fixup_f16 in both backends #1915
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!1915
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/1915/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?
@oni-swr on GitHub · 2026-11-24 23:03 UTC · original
oni-swr:recompiler/div-fixup-f16→main· +14 −1 · 4 files · 1 commits · merged 2026-11-25 02:01 UTCv_div_fixup_f16(VOP3: quotient, denominator, numerator as f16) had no case in the HLSL emitter or in the direct-DXIL lowering, so a program using it was reported unsupported. It isv_div_fixup_f32on half operands; both backends now reuse their existingdiv_fixuphelper and round through the normal f16 result path (modifiers, op_sel and MODE rounding come with it). No open or closed PR touches it (searcheddiv_fixup,f16); the neighbouringv_qsad/v_mqsad(#909, closed) ands_quadmask(#814, #1473) are not touched.What is in it
gpu/recomp/emit.rs:v_div_fixup_f16in the f16 rounded-op list and the f16 match arm.gpu/dxil/lower_wide.rs,gpu/dxil/lower.rs: the same in the direct-DXIL lowering and its f16 rounding list.gpu/recomp/tests.rs:div_fixup_f16_instruction– translation is complete and emitsdiv_fixupover the three f16 sources. It fails on main (t.complete()is false) and passes with the change.Tested
scripts/smoke.ps1).cargo test -p xcl --lib div_fixup_f16 -- --nocapture(XCL_ADAPTER="RX 7800 XT"): 1 passed, 0 failed (also verified on main with only the test added: 0 passed, 1 failed).cargo test -p xcl --lib gpu::recomp:: -- --test-threads=4 f16(XCL_ADAPTER="RX 7800 XT"): 266 passed, 0 failed, 18 ignored (6SKIPPEDlines: 4 inf16_programs_on_the_gpuand 2 inf32_programs_on_the_gpufor refused#1426per-lane ops).XCL_ADAPTER="RX 7800 XT"):cargo test --workspace --locked -- --test-threads=4(lib): 926 passed, 1 failed, 25 ignored (6SKIPPEDlines above). The 1 failure isgpu::dxil::fuzz_tests::fuzz_validate_and_gpu_1(seed 722: res[30] = 0x1, CPU 0x7fffffff, an unrelatedswitch/waveReadLaneFirstfuzz case).cargo test --workspace --locked --test '*' --bins -- --test-threads=4: 49 passed, 0 failed, 20 ignored (1SKIPPED:heap_window_out_of_memory_falls_back_to_the_switch_form: no heap windows; all e2e tests pass on hardware GPU).XCL_ADAPTER=warp, debug):cargo test --workspace --locked --no-fail-fast -- --test-threads=4: 974 passed, 2 failed (e2eWARP crashes), 45 ignored, 260SKIPPEDlines;cargo clippy -p xcl --all-targets --locked -- -D warningshad 732 pre-existing errors on main and with this change, none in the changed lines.Regression run
scripts/smoke.ps1 -Game <retail title> -Seconds 60withXCL_ADAPTER="RX 7800 XT", release builds from clean trees onmain(689f2db477c3) and PR head (74fe4c2b4935).main:
PR:
PR vs
main: 1575 / 1587 frames (99.2 %), peak commit 15090 / 14956 MB (100.9 %), 0 device removals, 0 crashes.Not tested
v_div_fixup_f16result values (the added test checks HLSL translation and completeness); whether the retail title in the smoke run executesv_div_fixup_f16was not verified.AI use
scripts/smoke.ps1regression pair, updated the description.@frenziedcoder on GitHub · 2026-11-25 01:22 UTC · original
NVIDIA test report for
74fe4c2: no new test failures (the 4 that fail also fail on689f2db), its own testdiv_fixup_f16_instructionpasses, and a clean smoke pair on the retail title (1652 vs 1657 frames).Tested
stable-x86_64-pc-windows-msvc, DXC 1.8.2502.11 (SDK 10.0.26100.0). Exact head74fe4c2b4935007dc6848176488d2d4508621145, no local changes.cargo build --workspace && cargo test --workspace --no-fail-fast -- --test-threads=4(debug): 972 passed, 4 failed, 45 ignored; the PR's own testdiv_fixup_f16_instructionpasses. 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_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).fuzz_validate_and_gpu_0,fuzz_validate_and_gpu_1,fuzz_validate_and_gpu_2,fuzz_validate_and_gpu_3ingpu::dxil::fuzz_tests. They fail the same way on the base689f2dbhere (0x8007000EfromCreateComputePipelineStateon seeds 70, 545, 1019 and 1507, the NVIDIA refusal @PHeitor1 reported on #1679), so this PR adds no failure.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 (
689f2db, this PR's merge base withmain):this PR:
Not tested: 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 02:24 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!