fix: compute RndneF32 with a single return so the RX 9070 XT keeps v_bfrev_b32 #341
No reviewers
Labels
No labels
accessibility
bloqué : binaire console
bug
chargeur
console-dll
cpu
documentation
duplicate
enhancement
good first issue
gpu
help wanted
invalid
performance
question
runtime-gdk
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/LooperSalty--AnyXboxX!341
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-341"
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?
@Cai-piroska on GitHub · 2026-11-26 09:12 UTC · original
Cai-piroska:fix/rndne-f32-single-return→main· +17 −6 · 2 files · 1 commits · openChange
#260 moved
v_rndne_f32to integer HLSL, with earlyreturns inRndneF32. On an RX 9070 XT (RDNA 4, driver 32.0.32029.2010), those early returns make the driver miscompile the neighbouringv_bfrev_b32intest_extended_alu_matches_interpreter_on_gpu: on all 32 lanes,v13(slot 9) comes back as0x60c04080where the interpreter gives0x20c04080, with bit 30 set.v_rndne_f32itself is right. #160 hit the same thing on this card and was fixed in 855e527, but #160 was closed for a conflict, so neither the fix nor its test reachedmain. I reported it on #260 before the merge.This PR keeps #260's integer algorithm and replaces the early returns with selects: each case is computed and the result chosen at the end.
shiftstays at 1 outside the range where it is used, so every shift stays defined. It also brings back #160'stest_rndne_helper_has_a_single_return.Linked issue: Refs #260, Refs #160, Refs #227
Verification
Windows 11 26300, Python 3.12.10, pytest 8.3.5, ruff 0.17.6, dxc 1.9.2602.17 (Windows SDK 10.0.26100). C++ runtime built with VS 2022 Build Tools from
9a06443;runtime/has not changed between9a06443andc4c93bd. Trees:mainc4c93bdand this branch on top of it.python -m pytest tests/test_rdna2*.py, 2 runs per adapter, the same result in both runs:mainc4c93bdANYXBOXX_GPU=RadeonANYXBOXX_GPU=NVIDIAANYXBOXX_GPU=warpThe failure on
mainistest_extended_alu_matches_interpreter_on_gpu; the only differing words are slot 9 (v_bfrev_b32), lanes 0-31: interpreter0x20c04080, GPU0x60c04080. #260'stest_v_rndne_f32_ties_to_even_and_specials_on_gpupasses on all three adapters on both trees.Oracle and test data
test_extended_alu_matches_interpreter_on_gpuandtest_v_rndne_f32_ties_to_even_and_specials_on_gpu(ties, signed zeros, subnormals, infinities, quiet and signalling NaNs).RndneF32source inHELPERS.test_rndne_helper_has_a_single_returnon every adapter (the helper onmainhas 4returns), andtest_extended_alu_matches_interpreter_on_gpuon the RX 9070 XT.Checklist
E_NOTIMPL), never a fake success. (No new function.)test_readme_sync.pychecks it). (No README change: 1,650 tests stays1600+.)AGENTS.mdallows (names, slots, argument shapes, flag values, HRESULTs, IIDs, counts), with how they were obtained; no address or RVA. (None: everything comes from the test suite.)THIRD_PARTY.md. (None. The test comes from #160 in this repository, credited withCo-authored-byto its author.)AI use: tests run, regression located and change written with Claude Code (Claude Opus 5.5) on my machine.
🤖 Generated with Claude Code
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.