shader: lower the binary64 conversion forms #3630
No reviewers
Labels
No labels
accessibility
awaiting author
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
priority: P0
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/R0Y00--Xbox2Windows!3630
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-3628"
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?
@lambirou on GitHub · 2026-11-30 17:21 UTC · original
lambirou:shader/f64-conversions→main· +681 −156 · 7 files · 4 commits · merged 2026-12-03 12:22 UTCPart of the f64 slice (P5).
This adds the five binary64 conversion forms:
v_cvt_f64_i32_e64,v_cvt_f64_u32_e64,v_cvt_i32_f64_e64,v_cvt_u32_f64_e64andv_cvt_f32_f64_e64.uintoperations (sign bit, magnitude, exponent 1023 + highest-set-bit index, fraction bits), with nodouble,asdoubleor rounding mode. Zero gives +0.0 and INT_MIN gives 0xc1e00000_00000000.Tests
pixel_aot_cvt_f64_e64_warpand_hardwarepass on WARP and the AMD Radeon RX 9060 XT (driver 32.0.32029.2010).R32G32B32A32_UINTreadback and compares them with Pythonstruct.pack('<d', ...); sentinels around the pair catch writes outside it. The rows cover 0, INT_MIN/MAX, -1, UINT_MAX and neighbours, 2^24 ± 1, 0x3f800000/0xbf800000 and the f64→f32 tie/overflow/subnormal cases; the mutations mismatch on both adapters.form_coverage_check.pypins exactly the five forms and keeps the other f64 forms uncovered; the neighbouringdraw-cvt-f64-*tests still pass.Limits
The desktop draws prove the translated shaders, not gfx1013 or the console. Binary64 arithmetic beyond these conversions remains unsupported. The high half of a 32-bit destination is not observed. No console measurement was made.
AI-assisted.
Merge with origin/main (2026-12-01)
Merged
origin/mainata3bfd019into this branch; head isc3e464d0. The shared CMake and test files keep both the #3609/#3623 additions and the PR additions. Local post-merge:pixel_aot_check.py,form_coverage_check.pyandrdna2_tools_check.pypass (163 tests, 19 skips); CTestpixel_aot_cvt_f64_e64_warpandpixel_aot_f64_minmax_ldexp_warppass.5afe42ed6bto781883a2cc@lukaslw-lab on GitHub · 2026-11-30 20:32 UTC · original · reviewed
Reviewed
781883a2by reading the diff; not built or run.Verdict: comment. No MUST. The arithmetic is right. Two SHOULDs on the new rounding slice of
v_cvt_f32_f64are worth settling before merge, because they change what #1606 approved.cvt_f32_f64_rne_bitsrefuses a nonzero binary32 subnormal result because MODE[5:4] has no declared profile (tools/pixel_aot.py:2872). It still accepts a value just below 2^-126 that rounds up to the smallest normal (:2910, e.g. 2^-126 − 2^-150). Whether that case gives0x00800000or a flushed zero depends on the same unmodelled binary32 denormal/flush mode, and on when the hardware detects tininess. For consistency with the docstring's reason, refuse it as well, or state the no-flush assumption in the docs.:4787) refuses anyv_*_f64form under round-toward-zero in MODE[3:2]. Please state that dependency. #1606 approved an exact-only slice, so widening it to rounding needs the maintainer's own sign-off rather than being described as already approved.cvt_int_f64_bits: truncation toward zero, with NaN/Inf and out-of-range values refused.f64_conversion_source: proven records, two statically known words, or an aligned SGPR pair (_e64only). Modifiers fall through to the refusal.Tests: the unit asserts pin the midpoints listed above. The draw compares the pair words against
struct.pack, with sentinels around the pair. The controls run in the Linux LLVM job (passed).pixel_aot_cvt_f64_e64_{warp,hardware}are not in the Windowsprpreset filter, so the draw has only the author's WARP + RX 9060 XT run. All results are translation-time constants, so the draw checks the emitted words, not a runtime path.@R0Y00 on GitHub · 2026-12-02 23:56 UTC · original · requested changes
The green Linux check is misleading on
e4dcf15f9. I ranpython -B tests/form_coverage_check.pyfrom that exact head and got exit 0 with no output. The file no longer has a module-level entry point. Its coverage call list and success print are indented insidecheck_f16_pack_cndmask_forms, and the list includes a call to that same function. Nine existing check definitions also disappear relative to main, including the f64 FMA/round, SMEM atomics and multiply-literal coverage. Please retain main's existing registrations, wire the new f64 conversion check into the actual entry point, and rerun the whole coverage script. A deliberately failing existing assertion is a useful negative control for the restored entry point.e4dcf15f9etobe4f47497abe4f47497atoeb8336252a@R0Y00 on GitHub · 2026-12-03 01:49 UTC · original · reviewed
I rechecked the new head against current main. The module-level entry point and the previously missing function definitions are back, and the binary64 cases are in the active call list. The list still drops check_mullit_coverage even though that function remains defined. Please restore that call and rerun the full test directly before re-review.
@R0Y00 on GitHub · 2026-12-03 12:22 UTC · original · approved these changes
Re-reviewed
ab623577. The module-level coverage entry point includes the binary64 conversions and retains MULLIT. The full form coverage script passed in the project Python environment. Injecting a failure inside check_mullit_coverage failed the entry point at that exact assertion. Independent MSVC Debug with SDK DXC on Windows build 26300: draw-cvt-f64-e64 passed on WARP 10.0.26100.9818 and RTX 4060 Laptop 32.0.16.1656 with no skips. This resolves my previous changes request.