pixel_aot: lower 10 binary16 cvt_norm forms across VOP1/VOP3/DPP16/DPP8/SDWA #2849
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2857"
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 KomaGuy on 2026-11-26T14:37:11Z.
Summary
Adds 10 exact binary16 normalized integer conversion forms (
v_cvt_norm_i16_f16andv_cvt_norm_u16_f16) across all 5 encodings (VOP1,VOP3_e64,DPP16,DPP8,SDWA) intools/pixel_aot.py, advancing #839 and leaving only transcendentals +v_dot2c_f32_f16uncovered inDPP16/DPP8.Lowered Forms (+10 in both
docs/coverage/gfx1013.tsvanddocs/coverage/rdna2.tsv)v_cvt_norm_i16_f16:VOP1(_e32/bare),VOP3(_e64),DPP16,DPP8,SDWA(5 forms)v_cvt_norm_u16_f16:VOP1(_e32/bare),VOP3(_e64),DPP16,DPP8,SDWA(5 forms)Contract & Exact Semantics
half_denorm="preserve"and refusesHALF_RTZacross all 5 encodings.half16_arith_source/half16_dpp_source/half16_sdwa_source), refusingInf/NaNand unproven runtime sources.dst_sel:DWORDtag destinations as("low16", alu)(accepted by audited 16-bit integer readers, refused by binary16 and high-half readers). SDWAWORD_0/WORD_1withUNUSED_PAD/UNUSED_PRESERVEdefine all 32 bits and refuseUNUSED_SEXTandBYTE_*.cvt_norm_i16_f16,cvt_norm_u16_f16): Computesround_rne(clamp(x, -1, 1) * 32767)andround_rne(clamp(x, 0, 1) * 65535)directly in exactuintarithmetic (mant * scaleshifted by25 - expor24for subnormals), eliminating binary32 double-rounding errors on0x3801..0x3804/0xb801..0xb802and preserving subnormals under DXC-denorm ftz.Tests & Verification
F16_CVT_NORM_PROGRAMS(plain_e32,plain_e64,dpp16,dpp8,sdwa),f16_cvt_norm_reference(independentfractions.Fractionmodel verified exhaustively againstpixel_aot.f16_cvt_norm_resultacross all 63,488 finite binary16 inputs),check_f16_cvt_norm_controls,check_f16_cvt_norm_draw(default +-denorm ftz+ 4 mutations per program),pixel_aot_binaryregistration, CTest targetspixel_aot_f16_cvt_norm_{warp,hardware}, andform_coverage_check.check_f16_cvt_norm_forms.python3 tests/pixel_aot_check.py— pass (including exhaustive 63,488-value finite check)form_coverage_check(check_shader_records,check_f16_cvt_norm_forms, and all sibling binary16/SDWA/DPP checks) — passpython3 tests/docs_links_check.py— pass (28 files, 544 links)python3 tests/bidi_controls_check.py— pass (2044 files)python3 tests/rdna2_tools_check.py— pass (158 tests, 19 skipped)git diff --check origin/main— cleanpixel_aot_binaryround-trips and Windows WARP/hardwarepixel_aot_f16_cvt_norm_{warp,hardware}D3D12 draws.AI-assisted; all Linux checks listed above were executed locally.
Imported from R0Y00/Xbox2Windows. Originally posted by KelboLive on 2026-11-26T16:01:26Z.
Review: APPROVED
Review: pixel_aot: lower 10 binary16 cvt_norm forms
This PR is a solid addition — it brings complete coverage of
v_cvt_norm_i16_f16andv_cvt_norm_u16_f16across all 5 encodings (VOP1, VOP3, DPP16, DPP8, SDWA), which is exactly the kind of systematic work the project needs.What's good
F16_CVT_NORM_PROGRAMSexercise each form with realistic operands (subnormals, exact ties, clamping thresholds, double-rounding discriminators).fractions.Fractionfor exhaustive verification against all 63,488 finite binary16 inputs is thorough and gives strong guarantees about the implementation's correctness. The double-rounding discrimination on0x3801..0x3804 / 0xb801..0xb802is an important edge case.half_denorm="preserve", refusal ofHALF_RTZ, and the static finite-proof contract (half16_arith_source/half16_dpp_source/half16_sdwa_source) are all properly specified — consistent with the project's approach for transcendentals and f16 operations.check_f16_cvt_norm_forms()test inform_coverage_check.pycorrectly removes cvt_norm fromcvt_f32_excluded, adds appropriate neighbor forms (rcp, rsq, sin), and validates both inclusion and non-interference with neighboring forms.dst_sel:WORD_0/WORD_1withUNUSED_PAD/UNUSED_PRESERVEas expected, and the DPP fixtures use both|vN|(no modifier) and-vN(negate) variants.Minor notes
pixel_aot: lower 10 binary16 cvt_norm forms (VOP1/VOP3/DPP/SDWA).cvt_f32_excludedremoval is correct. For the review, just confirming thatv_rcp_f16_sdwa,v_rsq_f16_sdwabeing the new entries incvt_f32_excludedis intentional per their own implementation status.pixel_aot_f16_cvt_norm_{warp,hardware}CMake tests will validate end-to-end rendering under DXC — good that these are included.Verdict
This is ready to merge. The implementation is thorough, the tests are comprehensive, and the coverage bookkeeping is correct. Approving.
Imported from R0Y00/Xbox2Windows. Originally posted by thepatrickworld on 2026-11-26T15:23:29Z.
Independent AMD RDNA 4 result on
bd8f6f42: the twof16_cvt_normentries, and what the draw compiles toNot a code change; measurements only.
Environment
10.0.26200.9974x64, MSVC19.44.35230(VCToolsVersion14.44.35207), Windows SDK10.0.26100.0, DXC1.9.2602.17AMD Radeon RX 9070 XT(1002:7550), driver32.0.32029.2010debug_layer=unavailable(the D3D12 debug layer is not installed on this machine; nothing below is API validation)bd8f6f4215e2a1d6914eebc49c08151d4f53ccfe,git status --porcelain --untracked-files=noempty, presetdevCommands
Observed
Three identical runs (the
-Vlogs differ only in the per-test durations), exit status 0:The fixture does not surface the renderer identity (it captures the renderer output and only prints it on failure), so the lines below come from replaying
check_f16_cvt_norm_drawwithsubprocess.runlogged:The comparison is bit-level (
expected_bits != actual_bits,tests/pixel_aot_render.cpp:490), somax_absolute_error=0is exact word equality, not a tolerance. From the same replay, all twenty mutation draws (four per program) come backstatuses ['mismatch'], so the comparator is not vacuous on this adapter.What the five programs compile to
dxc -dumpbinon the unmutated programs, translated and compiled through the fixture's own flags (tests/pixel_aot_check.py:358:-Gis -denorm preserve -T ps_6_2):plain_e32,plain_e64,sdwa:mainis fourstoreOutputcalls with immediates andret void, no arithmetic. Forplain_e32the immediates are0x80004000,0x0000c000,0x801f400f,0x00040002, exactlyF16_CVT_NORM_EXPECTED['plain_e32']. DXC folds the emitted expression, so these draws store constants: the pass confirms the DXIL immediates equal the expected words and that the readback returns them unchanged. The folding itself is read off the disassembly, not off the test result.dpp16,dpp8: the integer path stays in the DXIL (mul,lshr,shl, the round-to-even branch), fed bydx.op.quadOp/dx.op.quadReadLaneAtanddx.op.waveGetLaneIndex. That is where the emitted conversion is really evaluated — but retention is a DXC choice, the operands are uniform literals, and a driver JIT is free to collapse them, so this is not proof of device evaluation either.plain_e32with-Odrestores the arithmetic (24lshr, 8mul, the same fourstoreOutput), so the removal is the optimiser's, in DXC1.9.2602.17.-denorm preserveand-denorm ftzgive byte-identicalmainbodies for all five programs (diff empty), so the fixture's ftz pass repeats the preserve run: with operands that are integer encodings, nothing reaches a binary32 denormal path.What these entries do not cover
0x0100 0x03ff 0x3800 0x3801 0x3802 0x4000 0x83ff 0xb800 0xb801 0xbc00 0xc000), plus the|v|/-vmodifiers. The exhaustive side — 63,488 finite encodings, thefor bits in range(0x10000)loop that skips exponent0x1fattests/pixel_aot_check.py:11771— is Python-side against afractions.Fractionmodel; none of it is replayed on the device.quad_perm/dpp8decoding error would not change a single word here; these words separate the source modifiers and the arithmetic, nothing else.half16_arith_source(tools/pixel_aot.py:2192) refuses any operand that is not statically known (binary16 operand lacks a finite proof,:2231), so no shader can drive these opcodes from a runtime value today, and the plain forms are measurable only at folding time.CI coverage on this head
The Windows job runs
ctest --preset pr, and that preset'sinclude.namefilter (CMakePresets.json) lists sixteen name patterns, none of thempixel_aot_*.Build and test on Windowsissuccessonbd8f6f42, so neither new entry ran there — flagging it only so that "left to CI" is not read as already covered.Limits
One machine, one adapter, one driver, no debug layer. The folded immediates and their identity are a property of DXC
1.9.2602.17; the-Odbuild shows the optimiser, not the translator, removes them. Three runs establish identical results, not determinism.Conclusion
bd8f6f42, three times, with all twenty mutation draws rejected.plain_e32,plain_e64andsdwa; what their pass establishes is that the emitted HLSL folds to the expected words under this DXC, with the readback returning them intact.dpp16/dpp8keep the integer path in the DXIL; that is the closest this fixture gets to evaluating the conversion, and it matches the table.AI-assisted.
Imported from R0Y00/Xbox2Windows. Originally posted by KomaGuy on 2026-11-26T17:59:02Z.
Thanks @thepatrickworld for the thorough RX 9070 XT / DXIL disassembly measurement and @KelboLive for the review!
Addressed the feedback in
3100f363:plain_e32/plain_e64/sdwa(@thepatrickworld): Added an optionalunoptimized=False(-Od) parameter tocompile_shaderintests/pixel_aot_check.pyand switched the second pass incheck_f16_cvt_norm_drawtocompile_shader(..., mode="ftz", unoptimized=True). That keeps the integer conversion arithmetic (mul/lshr/shl/RNE branch) in DXIL instead of folding to immediate stores while still checking-denorm ftzinvariance in the same pass.#839's static finite-proof contract intact (half16_dpp_sourcerequires statically known finite inputs, so per-lane values stay uniform in the draw fixture), and added static permutation-mutation checks incheck_f16_cvt_norm_controls(quad_perm:[1,0,3,2]→[2,3,0,1],dpp8:[1,2,3,0,5,6,7,4]→[3,0,1,2,7,4,5,6]) verifying that changing the quad permutation changes the emitted HLSL swizzle indices.docs/experiments.md(@thepatrickworld): Clarified thatpixel_aot_f16_cvt_norm_{warp,hardware}runs underdev/releasepresets andmainCI (notctest --preset pr), recorded the RX 9070 XT / WARP measurements frombd8f6f42with their limits (debug_layer=unavailable, uniform-operand DPP, Python-side exhaustive 63,488-value check).v_rcp_f16_sdwa/v_rsq_f16_sdwaincvt_f32_excludedare intentional (still unlowered transcendentals). Keptbd8f6f42intact as a normal follow-up commit rather than force-pushing; happy to shorten the squash title on merge if preferred.Re-verified locally on Linux (
tests/pixel_aot_check.py,form_coverage_check,tests/docs_links_check.py,tests/bidi_controls_check.py,tests/rdna2_tools_check.py,git diff --check origin/main).Imported from R0Y00/Xbox2Windows. Originally posted by thepatrickworld on 2026-11-26T18:46:56Z.
Independent AMD RDNA 4 result on
3100f363: the optimized and-Odcompile passes, and what the new permutation control pinsNot a code change; measurements only.
Environment
10.0.26200.9974x64, MSVC19.44.35230(VCToolsVersion14.44.35207), Windows SDK10.0.26100.0(the DXC used is the one fromWindows Kits\10\bin\10.0.26100.0\x64), DXC1.9.2602.17AMD Radeon RX 9070 XT(1002:7550), driver32.0.32029.2010, from the drawing invocation:adapter=AMD Radeon RX 9070 XT vendor=1002 device=7550,driver=32.0.32029.2010,backend=hardware,debug_layer=unavailable(the D3D12 debug layer is not installed here; nothing below is API validation)3100f363808bb67d154e8f9c850147bbf8b50ff5,git status --porcelain --untracked-files=noempty, presetdev;certutilSHA-256 of the checked-out files:tools/pixel_aot.pyfb813fae1b1a8b63f5df1e295b63d883835fed9ee8586ba56c9044f1bfa2436c,tests/pixel_aot_check.py84ebd57157689617bec74adc3f49c7aab6120040e2e205db5592d9afcae8bfe5Commands
Instruction counts below are
re.findall(r"\bmul\b", dump)over those dumps, sofmul/smulare not counted (checked: themul i32line count equals the\bmul\bcount). Fifteen dumps kept, one per program per variant (optimized,-Od -denorm preserve,-Od -denorm ftz).Observed: both entries on this head
Twenty mutation draws per entry,
statuses ['mismatch']for all twenty, on both backends.Observed: the
-Odpass is now a different measurement-denorm preserve-Od -denorm ftzplain_e32mul0,lshr0,shl0mul8,lshr24,shl24plain_e64mul0,lshr0,shl0mul3,lshr14,shl14sdwamul0,lshr0,shl0mul6,lshr17,shl19dpp16mul8,lshr16,shl20mul8,lshr24,shl24dpp8mul8,lshr24,shl20mul8,lshr32,shl24The decisive part is not the count but the operands, in
plain_e32:plain_e32holds fourv_cvt_norm_i16and fourv_cvt_norm_u16operations, and the-Oddump has fourmul i32 …, 32767and fourmul i32 …, 65535— one multiply per conversion. So the three programs whose optimized dump holds no arithmetic (plain_e32quoted above;plain_e64andsdwaby their zeromul/lshr/shl) now carry the integer conversion in the DXIL, and the five pass draws still returnF16_CVT_NORM_EXPECTED. The DXIL side of that review point is answered; which unit evaluates the arithmetic is not (see Limits).-Odis what changed the body, not the denorm flag:-Od -denorm preserveand-Od -denorm ftzgive the same instruction counts for all five programs, and the two dumps differ by exactly two lines — the; shader hashcomment andattributes #0 = { "fp32-denorm-mode"="preserve" }vs"ftz":Neither dump contains a single
fadd,fmul,fdiv,fptosi,fptruncorfpext; the lowering is the pure-uinthelper attools/pixel_aot.py:1088. With integer operands nothing can reach a binary32 denormal, so the second pass repeats the same words under-Od— it does not exercise-denorm ftz, and it is not evidence about ftz either way.Observed: what the new static permutation control pins
Two one-line mutants of the cvt_norm DPP handler, at
tools/pixel_aot.py:7177(emit_quad_swizzle_u32(lines, i, s0_val, perm)), each traced in the run log byfindstr /nof the edited line plusgit status --porcelain(M tools/pixel_aot.py), and restored withgit checkout --(SHA-256 back tofb813fae…afterwards). Python only: no rebuild, same binary and same tree otherwise.perm→[0, 1, 2, 3](the swizzle is dropped whatever the instruction says):AssertionError: ('dpp16', 'quad_perm:[1,0,3,2]', 'quad_perm:[2,3,0,1]'),0% tests passed, 2 tests failed out of 2, 1.12 s and 1.08 s. The control discriminates.perm→perm[1:] + perm[:1](permutation-dependent, wrong by construction:[1,0,3,2]becomes[0,3,2,1], a different lane pattern):CONTROLS_PASS, and both entries pass (100% tests passed out of 2, 11.65 s and 7.31 s), twenty mutations still rejected.The rotation is plainly visible in the emitted HLSL — it is the control that does not see it. Counts with the same
translate_f16:dpp16goes fromQuadReadAcrossX3,Y3,Diagonal2 to 0/0/0 plus 32QuadReadLaneAt;dpp8goes from 32QuadReadLaneAtto 8QuadReadAcrossY.So the added check pins that the emitted HLSL depends on
quad_perm/dpp8, not that the permutation applied is the one encoded in the instruction. The two neighbouring blocks (cvt_int16_dpp16attests/pixel_aot_check.py:10535,fmac_ldexp_dpp16at:10526) do assert that the three names appear (thefmac_ldexp_dpp16block also checks that its_1/_2lines carry noQuadRead), but neither pins a per-permutation count.:18581does exactly that for another handler ([1,0,3,2]→ oneQuadReadAcrossX, through thev_cndmask_b32_dpppath), andtests/startup_gfx2hlsl_dpp_quad_swap_check.pypins a permutation→intrinsic table (tools/startup/gfx2hlsl.py:1016) and mutatesX→Y,Y→Diagonalto prove it. Both assert more than the control added here.The doc sentence this PR adds at
docs/experiments.md:17544— "(permutation decoding is verified statically incheck_f16_cvt_norm_controls)" — is in the paragraph that concedes device readbacks cannot distinguish lane routing, so the static control is presented as the substitute for what the draw cannot see. Measured, it is a sensitivity check. Two options:dpp16fixture, asserting the exact counts (3/3/2) already kills the rotation — but not a swap ofXandY: both permutations occur three times, so the counts survive it (measured: identical 3/3/2, andcheck_f16_cvt_norm_controls()still passes). What pins the mapping is one instruction per permutation: a single-instruction program gives 1/0/0 for[1,0,3,2],[2,3,0,1]and[3,2,1,0], and the general path (quad_perm:[0,2,1,3]→QuadReadLaneAt×4). Thedpp16fixture cannot carry a 1/0/0 assertion: it uses three permutations in the same program, so all three names are emitted.Limits
rotateis wrong by construction, not a defect found in the PR. It shows what the control cannot see, not that the lowering is wrong.check_f16_cvt_norm_controls()runs before the draws, so under theignoremutant no draw happened at all — that failure is the control, not the pixels.tests/pixel_aot_check.py:11870callscompile_shaderwith nounoptimized), and the-OdCSO only runs the single pass case, so no mutant is exercised under-Od.dxc -dumpbin; what the AMD JIT then does with uniform literals is not observable with the tools here.:18581pins[1,0,3,2]→QuadReadAcrossXonce, through thev_cndmask_b32_dpppath (tools/pixel_aot.py:7334); nothing pins the mapping at thecvt_normcall sites, which is the gap the rotation above walks through.AI-assisted.
Imported from R0Y00/Xbox2Windows. Originally posted by KomaGuy on 2026-11-26T19:57:44Z.
Thanks @thepatrickworld for verifying the
-OdDXIL disassembly on3100f363and for the mutant analysis!Followed up with option 2 in
1c5f2ea6:tests/pixel_aot_check.py): Replaced the sensitivity-only check incheck_f16_cvt_norm_controlswith single-instruction-per-permutation checks for bothv_cvt_norm_i16_f16_dppandv_cvt_norm_u16_f16_dpp:quad_perm:[0,1,2,3]→(0, 0, 0, 0)(identity)quad_perm:[1,0,3,2]→(1, 0, 0, 0)(QuadReadAcrossX)quad_perm:[2,3,0,1]→(0, 1, 0, 0)(QuadReadAcrossY)quad_perm:[3,2,1,0]→(0, 0, 1, 0)(QuadReadAcrossDiagonal)quad_perm:[2,2,2,2]→(0, 0, 0, 1)(QuadReadLaneAt(..., 2))quad_perm:[0,2,1,3]anddpp8:[1,2,3,0,5,6,7,4]→(0, 0, 0, 4)plus regex-pinning the exact(l0, l1, l2, l3)lane selection order in the bitmask expression.emit_quad_swizzle_u32mutants (ignore,rotateperm[1:]+perm[:1],X<->Yswap, and general-lane swap): all 4 failcheck_f16_cvt_norm_controls().docs/experiments.md: Updated the wording to note that-denorm ftzemits the same pure-uintinstructions as-denorm preserve(no binary32 float ops incvt_norm_{i16,u16}_f16), recorded the3100f363RX 9070 XT /-OdDXIL disassembly result, and noted that mutation draws compile optimized rather than-Od.Re-verified locally on Linux:
tests/pixel_aot_check.py,form_coverage_check(check_shader_records,check_f16_cvt_norm_forms),tests/docs_links_check.py,tests/bidi_controls_check.py,tests/rdna2_tools_check.py, andgit diff --check origin/mainall pass.Imported from R0Y00/Xbox2Windows. Originally posted by thepatrickworld on 2026-11-26T20:36:05Z.
Independent replay of the
emit_quad_swizzle_u32mutants on1c5f2ea6Not a code change; measurements only.
Environment
python3 -B tests/pixel_aot_check.pywith no argument, which runscheck_controls()only (~13 s here); no device.10.0.26200.9974, DXC1.9.2602.17,backend=hardware debug_layer=unavailable,adapter=AMD Radeon RX 9070 XT vendor=1002 device=7550,driver=32.0.32029.2010, entrydraw-core-vector.Commands
tools/pixel_aot.pyis the same blob at both heads (cc12860c…, file sha2564595dc7c…on an LF checkout; the CRLF Windows copy hashes tofb813fae…), so the two columns differ only by the fixture.Mutants, one at a time,
check_controlsre-run each timeHow that reads against your 4/4
Rotation and lane swap are the two that go green-to-red on the runner, both at the lane-order regex. The Y-swap and identity mutants are red in both columns, at the pre-existing
dpp_ternarycount assert — so on the runner they do not witness the new block. Invoked directly, all four failcheck_f16_cvt_norm_controlsat1c5f2ea6(Y-swap and identity at the counts assert:11803, rotation and lane swap at the regex:11812): your 4/4 holds for the sub-check itself, and the runner only reports the older assert because_check_controls_inlineraises first and cancels the sub-check futures that were still pending. Also: the lane order is pinned for[2,2,2,2],[0,2,1,3]anddpp8:[1,2,3,0](the regex); the four other permutations are pinned by intrinsic counts only.The two mask derivations
evenandtop(tools/pixel_aot.py:2699-2700) are pinned by no static control: the new block matches the namesdpp\d+_even/_topand never the definitions, so either edit leavescheck_controlsgreen. Both are caught by a draw — on this adapterdraw-core-vectorgoesEXIT=1incheck_dpp_int32_draw(case=0..2 status=mismatch, channel 0expected_bits=42900000,actual_bits=424c0000forevenand42580000fortop), clean run on the same entryEXIT=0— but that is an int32 DPP fixture, not the f16 entries, whose draws cannot see lane routing under #839.pixel_aot_core_vector_*is not inctest --preset pr, so this PR's own CI never runs it; it runs on main CI as_warpand on a GPU machine as_hardware. No action requested: if you do want the masks pinned, the same block can assert the two definition strings, one line each.Limits
check_controlsrun only. The three mutant device runs (rotation,even,top) stop at the first failing batch, so the draw groups aftercheck_dpp_int32_drawwere not exercised there.debug_layer=unavailable.emit_quad_swizzle_u32; nothing here speaks about ops that do not go through it.AI-assisted.
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-27T18:15:23Z.
Review: COMMENTED
Review of
30d435a643(the change from1c5f2ea6, updated with main; the PR's own diff is unchanged). Comment only.The
cvt_norm_i16_f16/cvt_norm_u16_f16helpers compute round-to-nearest-even ofclamp(x) * 32767/* 65535in exact integer arithmetic (largest product 2047 * 65535 fits in 32 bits), and the Python reference uses the same exact method instead of binary32, which avoids the double rounding near 0.5. The newpixel_aot_f16_cvt_norm_<adapter>draws compare with that reference, and the DPP16/DPP8 permutation pinning added after the earlier independent replay is intests/pixel_aot_check.py.Non-blocking note: for a NaN input the helpers return 32767 (signed, with the sign of the NaN) or 0xffff (unsigned, positive NaN), because
mag >= 0x3c00also catches the exponent-31 encodings. If the hardware returns 0 for NaN, a follow-up could special-case exponent 31 with a nonzero mantissa. The reference raises on non-finite inputs, so the fixture does not cover it either way.Windows results are in the comment below.
Commands:
git diff origin/main...pull/2857/head(read), plus the Windows commands listed in the comment.AI-assisted; commands listed were executed locally.
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-27T18:15:24Z.
Windows Server 2025 verification of
30d435a643991bf447cd276e6134e080820cc800(D3D12 WARP, MSVC 14.44.35207):cmake --build --preset dev --target offscreen_check;ctest --preset dev -R '^pixel_aot_': 204/204 passed, includingpixel_aot_f16_cvt_norm_warpandpixel_aot_f16_cvt_norm_hardwarecmake --build --preset release --target offscreen_check;ctest --preset release -R '^pixel_aot_': 204/204 passedtools/pixel_aot.py(includingtests/form_coverage_check.py): all okAI-assisted; commands listed were executed locally.
Imported from R0Y00/Xbox2Windows. Originally posted by thepatrickworld on 2026-11-27T18:23:25Z.
Thanks for the Windows Server run. One caveat about what
204/204 passedcovers — measured here rather thanquoted, because this repo's CTest counts a skipped entry in that total.
Same entry, same tree (
6ee878d8), onlyXBOX2WINDOWS_ADAPTERset to a name that matches no adapter:With the filter removed, same entry:
Passed 1.09 sec, and the binary printsadapter=AMD Radeon RX 9070 XT.That is the same code path a host with only WARP hits: the renderer's
hardwarebackend returns 77 when nonon-software adapter is available (
tests/pixel_aot_check.py:3628, and the entry carriesSKIP_RETURN_CODE 77,CMakeLists.txt:10803). So on Windows Server 2025pixel_aot_f16_cvt_norm_hardwarecannot have drawn anything; what separates the two in a log is the
***Skippedmarker, the "did not run"section, or the fixture's own
adapter=line — not the204/204.That left the hardware half unmeasured, so I ran it: worktree at
30d435a6, dev preset,-DINTAKE_PYTHONborrowed from another checkout.Environment, from a direct invocation of the same binary with the same
hardwarebackend:Limits: one adapter (RDNA 4) and one driver, no debug layer, and
windows.ymlruns-E '_hardware$', sothis entry runs nowhere in CI — this is a one-off run, and the WARP half stays yours.
AI-assisted; runs executed on the machine above.
Imported from R0Y00/Xbox2Windows. Originally posted by pigalot on 2026-11-27T19:50:22Z.
Review: APPROVED
Independently reviewed
841e70c9integrated overmain0f3e8248(tree263f8473, clean merge).What I traced. For a normal binary16,
mant * 2^(exp-25)is the value. Soshift = 25 - exp(24 for subnormals) givesx * 32767/x * 65535exactly asprod >> shiftplus the remainder. The products stay under 2^27.mag >= 0x3c00is the |x| ≥ 1 clamp, and the signed path negates after rounding, so -1 maps to -32767.The HLSL helpers and
f16_cvt_norm_resultare the same arithmetic. On the DPP path,absapplies beforeneg. Every path calls the reference on the proven operand, so a non-finite operand is refused at translation time. The NaN behaviour in tedin7's note therefore can't reach a lowered shader.What I ran. I built
offscreen_checkindevandrelease, then ran:ctest --test-dir out/build/<preset> --no-tests=error -j 1 -V -R '^(pixel_aot_f16_cvt_norm_(warp|hardware)|pixel_aot_f16_exact_extra_(warp|hardware)|pixel_aot_sdwa_cvt_(warp|hardware)|form_coverage)$'/O2, with no skips._hardwareentries drew on an RTX 5090. None reported***Skipped, which matters given thepatrickworld's point that a skip counts toward thepassedtotal.python -B tests/pixel_aot_check.py(controls only) exits 0 in 8 s.Mutants (in the HLSL helpers in
tools/pixel_aot.py):if (false) q += 1u;incvt_norm_i16_f16): failspixel_aot_f16_cvt_norm_warpand_hardwareatexpected_bits=80004000 actual_bits=80003fff, the x = 0.5 input.rem >= mid, both helpers): passes, and no input can tell the two apart.v2(mant * 32767) = shift - 1, sov2(mant) = shift - 1 >= 10.mant = 1024,shift = 11).qis odd (16383 / 32767), so both rules round up.I restored the file after each mutant and confirmed with
git diff --quiet.git diff --checkis clean.Not checked. I have no RDNA2 hardware. The fixture compares the lowering against the PR's own reference,
round_rne(clamp(x) * 32767 | 65535)as the body states. Whether gfx1013 rounds exactly that way is not measured here.Verdict: approve on
841e70c9.Environment: NVIDIA GeForce RTX 5090, driver 32.0.16.1088; WARP 10.0.26100.9818; Windows 11 25H2 build 26200.9974; MSVC 19.52.37029; DXC 1.9.2602.17; Python 3.12.10; debug layer on.
CI:
Build and test on Windowspasses on841e70c9. There are no review threads.This reply was AI-assisted.
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-27T19:50:39Z.
Windows Server 2025 re-verification of
841e70c9b10ad4ca54181d11078014e6989ac1eb(the same change, updated with main again; D3D12 WARP, MSVC 14.44.35207):cmake --build --preset dev --target offscreen_check;ctest --preset dev -R '^pixel_aot_': 204/204 passed, includingpixel_aot_f16_cvt_norm_warpand_hardwarecmake --build --preset release --target offscreen_check;ctest --preset release -R '^pixel_aot_': 204/204 passedtools/pixel_aot.py: all okThe NaN note in my review stays a possible follow-up, not a blocker.
AI-assisted; commands listed were executed locally.