You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Recompiler: v_ldexp_f16 returns NaN for ±0 / ±inf with large exponents #658
v_ldexp_f16 is emitted as HLSL ldexp(x, (float)n), which DXC computes as x * exp2(n). For |n| beyond the f32 exponent range, exp2(n) is inf or 0, so ±0 with a large positive n and ±inf with a large negative n give 0 · inf = NaN; the ISA keeps ±0 / ±inf for any exponent. v_ldexp_f32 doesn't have this: it uses the exact ldexp_f helper.
Measured on maincb868b2 (RTX 4070 Ti 616.56 wave32; AMD RDNA2 iGPU, 26.11.2, wave64 + wave32), new test gpu_ldexp_f16_zero_inf_and_large_exponents:
input
RTX 4070 Ti
RDNA2
ISA
ldexp(0x0000, 200)
0x7fff
0xfe00
0x0000
ldexp(0x8000, 300)
0x7fff
0xfe00
0x8000
ldexp(0x0000, 32767)
0x7fff
0xfe00
0x0000
ldexp(0x8000, -32768)
ok
0x0000
0x8000
ldexp(0x7c00, -200)
0x7fff
0xfe00
0x7c00
ldexp(0xfc00, -300)
0x7fff
0xfe00
0xfc00
ldexp(0x7c00, -32768)
0x7fff
0xfe00
0x7c00
NaN in, overflow to ±inf and underflow to 0 already come out right.
Fix, one line in emit.rs: "v_ldexp_f16" => fr(format!("ldexp_f({}, {})", fh(0), si(1))). With it the test passes on both GPUs (wave64 and wave32), and the random v_ldexp_f16 results in #111's census still round to nearest even (with that fix applied). Full suite: RTX 4070 Ti 687 passed, 0 failed; RDNA2 686 passed, 1 failed (frame::tests::origin_events_issue_tokens_and_flips_have_statistics, a timing test that failed under load and passes 3/3 alone and on main).
Not tested: a regression run (I have no title); whether a retail title hits these inputs.
I can open a PR with the test and fix if someone with a title can add the xcl-smoke runs.
AI use: Claude Code (Claude Opus 5.5) found the bug, wrote the test, the fix and this issue; the numbers are from the runs described.
@joeypercia I have the retail title and can make the two xcl-smoke runs for this, as for #580 (#587). Open the PR with your test and fix. I'll run scripts/smoke.ps1 on its head commit and on the main it is based on, and post both blocks in the PR for you to paste into Regression run. Since pr_check.py reads them from the description, it is simplest if you paste them. Rerun after every push.
Thanks @requiemsnkrp. The PR is #672, and @Anon64 has already posted the two xcl-smoke runs there (head 6ec4036, base dd2ae9a), now in the description, so no need to run them unless the head changes.
Activity
requiemsnkrp commentedon Nov 24, 2026
@joeypercia I have the retail title and can make the two
xcl-smokeruns for this, as for #580 (#587). Open the PR with your test and fix. I'll runscripts/smoke.ps1on its head commit and on themainit is based on, and post both blocks in the PR for you to paste into Regression run. Sincepr_check.pyreads them from the description, it is simplest if you paste them. Rerun after every push.Written with Claude Code (Claude Opus 5.5).
joeypercia commentedon Nov 24, 2026
Thanks @requiemsnkrp. The PR is #672, and @Anon64 has already posted the two
xcl-smokeruns there (head6ec4036, basedd2ae9a), now in the description, so no need to run them unless the head changes.Written with Claude Code (Claude Opus 5.5).
DirectStorage: unpack BCPack BC1, BC3, BC4, BC5, BC6H and BC7 streams
DirectStorage: unpack BCPack BC1, BC3, BC4, BC5, BC6H and BC7 streams
DirectStorage: unpack BCPack BC1, BC3, BC4, BC5, BC6H and BC7 streams
DirectStorage: unpack BCPack BC1, BC3, BC4, BC5, BC6H and BC7 streams
DirectStorage: unpack BCPack BC1, BC3, BC4, BC5, BC6H and BC7 streams
DirectStorage: unpack BCPack BC1, BC3, BC4, BC5, BC6H and BC7 streams
DirectStorage: unpack BCPack BC1, BC3, BC4, BC5, BC6H and BC7 streams
Recompiler: v_ldexp_f16 keeps ±0 and ±inf for any exponent (xcl-dev#658)
Recompiler: v_ldexp_f16 keeps ±0 and ±inf for any exponent (xcl-dev#658)