shader: lower the 16-bit integer to binary16 conversions in pixel_aot #914
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/921"
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?
Imported from R0Y00/Xbox2Windows. Originally posted by JB2WIN on 2026-11-23T17:10:39Z.
Change
This is the third binary16 slice from #839.
tools/pixel_aot.pynow lowersv_cvt_f16_i16andv_cvt_f16_u16in the plain,_e32and_e64spellings. It follows the scope set in #839.v_cvt_f16_i16accepts runtime sources. The source goes through the existing audited low-16 integer reader (int16_operand, signed), which sign-extends bits 15:0. Every i16 value converts to a finite binary16, so no constant proof is needed. A runtime result has no known value, so the #854/#881 finite-proof ops refuse it as an operand. A control covers this.v_cvt_f16_u16needs a proven value below 65520. A runtime source is refused withbinary16 conversion source lacks a range proof: <tok>. A proven value of 65520 or more is refused withbinary16 result overflows: v_cvt_f16_u16. This includes the inline constants -16…-1, which read as 0xfff0…0xffff. 65519 becomes 65504 (0x7bff).narrow16then gives round-to-nearest-even. The source is LLVM 15.0.7VOP1Instructions.tdL432-433:uint_to_fpandsint_to_fp.half_denorm="preserve\"entry profile. The result is ahalf16low half that only the audited readers may read. Modifiers,clamp, omod,op_sel, DPP and SDWA are refused.check_int16_vop3_formslisted("VOP3","v_cvt_f16_u16_e64")as a refused neighbour. It is replaced by("VOP3","v_cvt_i16_f16_e64"), which is still refused.Refs #839. AI-assisted (Claude Code).
Verification
Environment: Windows 11 10.0.26200.9974, NVIDIA GeForce RTX 3080 (driver 32.0.16.2124) and WARP, at
da9bc9c.Draw
draw-f16-cvt-int16(pixel_aot_f16_cvt_int16_{hardware,warp}):0x0000), halfway values in several binades (4098, 4102, 16392, 16408, 32760 and their negatives) and the non-ties 4097 and 4099. One value appears under four different high halves.structformateover all 65,536 values of both kinds.Mutations. Each must mismatch, and each did on both adapters:
A check before the GPU run confirms that each mutation changes an expected row.
Dev-time check (not committed). With the new branch disabled, the new controls fail inside
check_controls.Commands:
ctest --preset dev --no-tests=error -R "^pixel_aot_f16_cvt_int16_": 2/2 passed (4.7 s on hardware).ctest --preset dev --no-tests=error -j4: 478/478 passed. Only capability skips occurred.02 a3 02 7e(i16 e32),02 a1 02 7e(u16 e32) and01 80 d1 d5 …(e64 clamp, which is refused).llvm-mcruns locally through aclang -cc1asshim.form_coverage_check.py,rdna2_tools_check.py,pso_readiness_check.pyanddocs_links_check.pypass.🤖 Generated with Claude Code
Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-23T17:26:32Z.
1591a01resolves the test-runner conflict and keeps the SMEM and i16-to-binary16 draw modes. WARP passed all four cases in the combined tree: the new conversion, half arithmetic, half rounding and SMEM pointers. The zero-extension, ties-away and high-half readback mutations fired. The signed runtime path stays low-half-only, and the unsigned overflow/unproven-source refusals remain in the fixture. Fresh CI is running.