Repository navigation
Conversation
5afe42e to
781883a
Compare
lukaslw-lab
left a comment
There was a problem hiding this comment.
Reviewed 781883a2 by 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_f64 are worth settling before merge, because they change what #1606 approved.
- SHOULD
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. - SHOULD The docs still call this a "mode-independent slice (the slice the maintainer approved in #1606 and the follow-up that added rounding)". It also says "the shader reads neither the rounding nor the denormal mode". Rounding makes the result depend on the rounding mode. It is correct only because every accepted MODE write keeps MODE[1:0] at nearest even, and because the existing check (
: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. - Checked, no finding:
- RNE narrowing to 24 bits with a carry into the exponent, overflow to ±Inf from the 2^128 − 2^103 midpoint, f64 subnormal inputs to a signed zero, and the 2^-150 tie to even zero.
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 Windows pr preset 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
left a comment
There was a problem hiding this comment.
The green Linux check is misleading on e4dcf15f9. I ran python -B tests/form_coverage_check.py from 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 inside check_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.
e4dcf15 to
be4f474
Compare
Lower the five VOP3 (_e64) binary64 conversions in the pixel AOT path: v_cvt_f64_i32_e64, v_cvt_f64_u32_e64, v_cvt_i32_f64_e64, v_cvt_u32_f64_e64 and v_cvt_f32_f64_e64. The integer widenings keep the exact uint lowering. The narrowings accept a proven VGPR pair, or an aligned SGPR pair of tracked words in the VOP3 spelling. v_cvt_i32_f64_e64 and v_cvt_u32_f64_e64 truncate toward zero and refuse NaN, infinity and out-of-range values. v_cvt_f32_f64_e64 rounds to nearest even with a new integer helper, overflows to a signed infinity and underflows to a signed zero; a nonzero binary32 subnormal result, NaN and infinity are refused. Modifiers, clamp, omod and malformed destination pairs are refused. The new draw-cvt-f64-e64 fixture covers 0, +-1, INT_MIN/MAX, UINT_MAX, 2^53, the range edges, truncation, rounding ties, overflow and subnormals with wrong references. tests/form_coverage_check.py pins exactly the five VOP3 forms and tests/rdna2_tools_check.py checks the scanner agreement. The tests pass on WARP and an AMD Radeon RX 9060 XT.
be4f474 to
eb83362
Compare
R0Y00
left a comment
There was a problem hiding this comment.
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.
Part 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 #3607/#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.