Recompiler: translate v_trig_preop_f64 in both backends #2315
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!2315
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-2315"
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?
@NWProgramming00 on GitHub · 2026-11-25 13:39 UTC · original
NWProgramming00:recomp/trig-preop→main· +260 −2 · 4 files · 1 commits · openBoth backends refused
v_trig_preop_f64. This translates it as RDNA2 hardware runs it. I measured the hardware first, then checked xcl against it bit for bit.What the hardware does (gfx1036, 2,072 measured rows, MODE with f64 denormals kept)
shiftbits below b1200, times 2^(−53 − shift).shift = S1[4:0] × 53, plusexp(S0) − 1077when the S0 exponent is above 1077.What is in it
crates/xcl/src/gpu/recomp/emit.rs:trig_preop()helper and the 37-word table (TRIG_PREOP_2_OVER_PI);crates/xcl/src/gpu/dxil/lower_wide.rs: the same computation in the direct DXIL translator. It reads the table with a chain of selects, because that translator has no constant arrays.crates/xcl/src/gpu/dxil/lower.rsandemit.rs:v_trig_preop_f64leaves the list of f64 ops that follow the f64 round mode (it does not round).OMOD/CLAMP) is refused, because I did not measure it.crates/xcl/src/gpu/recomp/tests.rs:gpu_trig_preop_f64_matches_rdna2checks both backends against 64 rows measured on the gfx1036.trig_preop_f64_with_omod_is_refusedchecks the OMOD refusal in both backends.Tested
XCL_ADAPTER=radeon). Rust 1.100 MSVC, release.cargo build --release --workspace, thencargo test --release --workspace --no-fail-fast -- --test-threads=4, with and withoutXCL_DIRECT_DXIL=all, against base1a0bbe3on the same machine:1a0bbe344455fe)XCL_DIRECT_DXIL=allXCL_DIRECT_DXIL=allThe +2 are the new tests. The failing tests are the same on base and PR, and all are tracked:
fuzz_validate_and_gpu_0..3on NVIDIA (#1905),fuzz_validate_and_gpu_1on RDNA2 (#2115, #2170) andoffline_compute_pipeline_is_reused_by_a_second_processwith direct DXIL (#1674).Regression run
Base (
main06c9f55), NVIDIA GeForce RTX 5070 Ti:This PR (
44455fe), same card:Earlier runs here ended at about 44 s on
mainand on this PR alike. The cause was #695: this PC had no active playback device. With one active, both runs reach their end.Not tested
OMOD/CLAMPon this instruction (refused).AI use
🤖 Generated with Claude Code
@nnonno91 on GitHub · 2026-11-25 14:04 UTC · original
Independent focused check of
44455fe9109fed47598714ecc1a464c96d1012c8on Radeon integrated graphics and RTX 5090.Tested
cargo test --locked -p xcl --lib trig_preop_f64 -- --nocapture --test-threads=1in separate processes withXCL_ADAPTER=AMD RadeonorXCL_ADAPTER=NVIDIA GeForce RTX 5090(XCL_REQUIRE_GPU=wave64on Radeon). Each run gave 2 passed, 0 failed, 0 ignored and no skips.Not tested
The larger hardware capture, retail smoke, and the full workspace suite.
AI use
OpenAI Codex (GPT-6.2 Sol) ran the tests, checked the logs and wrote this report.
@SlopTart on GitHub · 2026-11-25 14:10 UTC · original
RDNA3 confirmation: the new f64 trig translation is bit-exact on gfx1100 too.
The fix is calibrated against gfx1036 hardware measurements; here it is on RDNA3 (RX 7900 XT, NAVI31) under RADV, which the PR does not list as tested.
Tested:
origin/main379725ae+ PR head44455fe9(mergec7785944, no conflicts, mergeable clean onto current main). Linux (Arch, kernel 7.2.15), Mesa 26.2.5 RADV, Radeon RX 7900 XT, cargo targetx86_64-pc-windows-gnurun under wine-11.0 (Proton), rustc 1.94.0, official MS DXC (binaries 2026-09-29).gpu_suite (--release --locked,--test-threads=2): 143 passed / 3 failed / 1 ignored, versus 142 / 3 on plainorigin/mainon this rig. The pass delta is exactly this PR's added test, and the 3 failures are the rig's known baseline, unchanged: fuzz seed 1003 (posted on #2115),gpu_nonfused_mad_and_mac_prevent_fma_contraction,gpu_depth_buffer_created_for_unordered_access_is_placed.v_trig_preop_f64matches what the test expects bit for bit, same as on the gfx1036 measurements.Not tested: Windows on this card; gfx103x native Linux (native target, not Wine).
AI use: Hermes agent (local Qwen-class) ran both machines and drafted this; I checked it before posting.
@DavidM1911 on GitHub · 2026-11-25 17:52 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!
@raylitebull on GitHub · 2026-11-25 18:41 UTC · original
Diff review, CI, and both AMD and NVIDIA checks passed on
44455fe, but recentorigin/mainmerges turned this branchCONFLICTING/DIRTY. Please rebase ontoorigin/mainso it becomes mergeable again.View command line instructions
Manual merge helper
Use this merge commit message when completing the merge manually.
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.