Repository navigation
startup: lower level-zero D16 image_load in gfx2hlsl - #2139
Conversation
tedin7
left a comment
There was a problem hiding this comment.
Review of head 89d21632268bd3928ad5238c7453e58c2f8f4e84 (comment only, no approval).
Result: no P1. 1 P2, 2 nits.
State: CI green on this head (Linux Python checks, gfx1013 fixtures, Windows build and test). mergeable was UNKNOWN at review time. Title is neutral, body starts with Part of #2023. The diff is 10 files, +838/-8, and touches only startup/gfx2hlsl, tests, CMake, CI and docs.
Logic read (tools/startup/gfx2hlsl.py)
expected_addr(about line 1283) keeps the olda16(1 VGPR) andload_mip(axes+1) counts. It adds a plain-load count ofaxes, so plain 2D/3D/array loads now also check the address width. That is stricter than before, but correct.expected_dst = (popcount(dmask)+1)//2and thedst[2] > 255bound match the packed-D16 VGPR layout. Odd trailing channel: no<< 16term, so[31:16]is cleared as the PR says.pack16_rne, checked by hand:0x477ff000is the exact tie at 65520, which correctly overflows to inf.0x38800000is the normal/subnormal boundary.0x33000000(2^-25) is a tie that rounds to even, which gives 0.- Subnormal
shiftstays in 14..24, so1u << shiftis safe.
- The helper is emitted only when
uses_pack16_rneis set, so other stages are unchanged.
Commands run locally (worktree at the PR head)
python3 tests/startup_image_load_mip_check.py: passed.python3 tests/startup_image_load_d16_check.py: "Self-test passed".python3 tests/docs_links_check.py: 18 files, 395 links OK.python3 tests/bidi_controls_check.py: OK.git diff --check origin/main...HEAD: clean.
Mutations (each reverted with git checkout -- .)
expected_dst = popcount(dmask)(no halving): killed, withUnsupported ... d16 destination v4 for dmask 0x3.- Drop the odd-tail guard in
halves: killed (IndexError). - Remove the tie-to-even term
((shifted >> 13) & 1u)from the emitted HLSL: survived.startup_image_load_d16_check.pyexited 0.
P2: the Linux test does not guard the emitted pack16_rne body
tests/startup_image_load_d16_check.py:270-295(check_rounding_formula) re-implements the formula in Python and compares it tostruct.pack('<e'). It never parses or executes the HLSL text thatgfx2hlsl.pyemits. A regression inside the emitted helper (gfx2hlsl.py, thepack16_rneblock, about line 2183) is therefore invisible to the Linux job.- Only the WARP readback (
--startup-image-load-d16) can catch it. I did not run that on Win2025: CI's Windows job is green on this head, and I did not confirm that the data covers the RNE tie cases. - Suggestion: assert the helper lines are byte-identical to a golden copy, or generate the Python reference from the same emitted lines. Otherwise state in the docs that this check is WARP-only.
Nits
- NaN returns
0x7e00and drops the sign and payload (gfx2hlsl.py,pack16_rne). Hardware may keep both. Say in a comment that this is intentional, or preserve the sign. - The mip check swaps the
d16refusal case for string asserts onv4/v5. That is fine, but the refusal forimage_load_mip+ d16 now lives only in the new test file.
AI-assisted; commands listed were executed locally.
R0Y00
left a comment
There was a problem hiding this comment.
The RX 9070 XT exhaustive capture is useful: it separates two real R16_UNORM discrepancies at 0xffaf and 0xffef from the much larger WARP f32tof16 difference. The software helper fixes the latter, but still rounds an already-rounded binary32 texture load. Both known native mismatches should stay as double-rounding controls. Please either derive the half from the exact UNORM value with an independently verified conversion and rerun all 65,536 values, or limit the first slice to formats whose input is already a proven binary32 value. For a restricted slice, enforce the format before use and refuse unknown view formats. Please also compare the remaining scope against #2119 on #2023 so the same D16 implementation is reviewed once.
25c2229 to
c805fba
Compare
|
Pushed
AI-assisted. |
tedin7
left a comment
There was a problem hiding this comment.
Review of head c805fba3791a7b493319f5a6ee0388f23f97f193 (comment only, no approval). Previous review covered 89d21632; this covers the new commit c805fba3 (D16 SRV format validation and odd-dmask consumer guards).
Result: no P1. 1 P2, 1 nit.
P2: the branch conflicts with main
gh pr viewreportsmergeable: CONFLICTING.git merge-tree origin/main HEADshows a content conflict intools/startup/gfx2hlsl.py(the other files auto-merge).- No CI checks are reported on
startup/gfx2hlsl-image-load-d16for this head, so the Windows build and the C++ tests added inc805fba3(startup_d16_image_format_check.cpp,startup_address_srv.cpp,d3d12_draw.inlchanges) have no green run yet. Please rebase and re-run CI before Ready.
Logic read (tools/startup/gfx2hlsl.py, src/startup_stubs/d16_image_format.h)
- Odd-dmask tracking (
low16_only_v,pinned_low16_v,whole_read_v): a VGPR whose upper half is undefined is only accepted by low-16-bit consumers (v_cvt_f32_f16,v_cvt_f32_ubyte0/1,v_and_b32with a mask under 0x10000, SDWA byte/word selects,v_fma_mixhalf operands). Any other whole-word read,v_swap_b32, or a flag live across a block boundary is refused. The flags are never cleared under an unknown exec mask, so the tracking errs on the safe side. d16_float_norm_srv_formatrefuses UINT/SINT/typeless/unbound views. This is the right split, because the lowering doesLoadon float4 and narrows with RNE.- Nit:
u()usesgetattr(self, 'low16_only_v', ())andhasattrchecks to support unit probes that build aStagewithout__init__. A small helper or class-level defaults would read better.
Commands run locally (worktree at the PR head)
python3 tests/startup_image_load_d16_check.py: passed (47 float/norm formats match the header, 25 refused, 12 low-16 paths accepted, 18 leaks refused).python3 tests/startup_image_load_mip_check.py: passed.python3 tests/docs_links_check.py: 18 files, 395 links OK.python3 tests/bidi_controls_check.py: OK.git diff --check origin/main...HEAD: clean.python3 tests/startup_d16_srv_check.py: not run standalone. It needs the built consumer/backend arguments (CTest passes them), so it was not exercised on Linux.
Mutations (each reverted with git checkout -- .)
- Drop
low16_only=odd_tailon the odd trailingset_v: killed (odd dmask 0x1 direct export: unexpectedly accepted). - Replace the SRV format check
fmt not in D16_FLOAT_NORM_SRV_FORMATSwithFalse: killed (exit 1).
Windows proof
- I did not run
x2w_pipe.py win2025. The branch conflicts with main, so the run would not test what will merge. Please rebase, then a real WARP readback run (--startup-image-load-d16) on Win2025 is the proof still needed for the lowering and the newd3d12_draw.inlchecks.
AI-assisted; commands listed were executed locally.
|
The new bound-format and upper-half checks address separate gaps. The runtime allowlist still accepts R16_UNORM and its vector variants, so it still admits the two previously measured discrepancies. I reproduced the arithmetic on all 65,536 codes: a binary32 intermediate gives ffaf → 3bfe and ffef → 3c00, whereas direct ratio-to-half gives 3bfd and 3bff. A possible narrow fix for R16_UNORM is to recover the exact code first: round-to-integer on binary32(Load * 65535) recovered 65,536/65,536 in this CPU model. Then round the integer ratio directly to half and verify both GPU conversions against the existing native captures. The CPU result alone does not measure the D3D view. Otherwise keep the initial bound allowlist to the independently verified exact formats and retain these two UNORM cases for a follow-up. |
c805fba to
5f34447
Compare
|
Rebased onto
AI-assisted. |
Part of R0Y00#2023 (item D). On RDNA 2 (gfx1013; AMD RDNA 2 ISA section 8.2, LLVM 15 AMDGPU MIMGInstructions.td HasPackedD16VMem), MIMG image_load with d16=1 narrows each enabled dmask channel to IEEE binary16 (round to nearest even) and packs the resulting halves pairwise into ceil(popcount(dmask) / 2) consecutive destination VGPRs (low half in bits 15:0, second half in bits 31:16; an odd final channel clears bits 31:16). Accept d16 on level-zero image_load across 2D (plain, NSA and a16), 3D and 2D-array resources, validate both the address and destination tuple widths, and emit an integer round-to-nearest-even helper (pack16_rne) only when a stage uses image_load with d16. Using integer RNE avoids adapter-dependent f32tof16 rounding: WARP truncates f32tof16 toward zero, lowering 31,740 of the 65,536 DXGI_FORMAT_R16_UNORM depth values by 1 ULP relative to RDNA hardware's nearest-even result. Keep image_load_mip with d16, sampler MIMG operations with d16, 1D and cube loads, 3D/2D-array a16, tfe, lwe, r128, reserved bits and empty dmask refused. Add tests/startup_image_load_d16_check.py and offscreen_check --startup-image-load-d16 covering all 15 non-zero dmasks, llvm-mc and libLLVM encoding checks, R16_UNORM and R32G32B32A32_FLOAT 8x2 draws (DXC ps_6_0 and FXC ps_5_1) on WARP and AMD Radeon RX 9070 XT, and six negative mutation controls. AI-assisted.
tedin7
left a comment
There was a problem hiding this comment.
Re-review of head 5f344474dba46f0c81f46c07446c90f7b4e9fb8c (new commits since the last review: 350b00fc, 5f344474).
Blocker: PR is CONFLICTING with main. git merge-tree --write-tree origin/main HEAD reports a content conflict in src/startup_stubs/d3d12_xs_device.cpp. Please rebase on current main and re-run CI. gh pr checks reports no checks on the branch, so there is no CI result for this head yet.
Commands executed locally (Linux):
git diff --stat origin/main...HEAD: 18 files, +1953/-28python3 tests/docs_links_check.py: Self-test passed. Checked 18 Markdown files and 404 links.python3 tests/bidi_controls_check.py: no bidirectional controls in 1469 filesgit diff --check origin/main...HEAD: cleanpython3 tests/startup_image_load_d16_check.py: passes (14 exact SRV formats matchd16_image_format.h, 32 non-exact refused; 12 low-16-bit consumer paths accepted, 18 whole-word/control-flow leaks refused; unsupported layouts refused)python3 tests/startup_image_load_mip_check.py: passestests/startup_d16_srv_check.pytakes CTest arguments, so I did not run it standalone.
Mutations (both reverted with git checkout -- .):
pack16_d16odd taillow16_only=odd_tail->False: killed ("odd dmask 0x1 direct export: unexpectedly accepted").v_and_b32mask test(c1 & 0xffff0000) == 0->== 0xffff0000: killed ("whole-word read of v4 after odd d16 image_load").
Findings:
- P1: none in the logic. The odd-dmask low-16 tracking, exact-UNORM16 mode and SRV format validation look correct and the tests kill both mutations.
- P1 (process): rebase needed because of the conflict above. The Windows WARP/D3D12 gate should be run after the rebase, since the diff touches
d3d12_draw.inl,d3d12_xs_device.cppand the C++ tests. I did not queue it on the conflicted head. - Nit:
getattr(pipe, ...)fallbacks in theimage_loadd16 branch ofgfx2hlsl.pyhide a missing pipe state; a plain attribute with a default would be clearer.
AI-assisted; commands listed were executed locally.
5f34447 to
8baceea
Compare
tedin7
left a comment
There was a problem hiding this comment.
Re-review of head 8baceea3e6292a573316e7ebd6614da69d145c4f (after rebase).
Scope read: tools/startup/gfx2hlsl.py (low-16-bit tracking, v_and_b32 mask logic, SDWA selectors), src/startup_stubs/d16_image_format.h (SRV format whitelist, manifest parser), tests.
Commands run locally (Linux):
git diff --check origin/main...HEAD: cleanpython3 tests/docs_links_check.py: pass (18 files, 405 links)python3 tests/bidi_controls_check.py: passpython3 tests/startup_image_load_d16_check.py: pass (14 exact formats, 32 refused; 12 low-16 paths accepted, 18 leaks refused)python3 tests/startup_image_load_mip_check.py: passtests/startup_d16_srv_check.pyneeds C++ binary args, so it was not run on Linux (Windows-only).
CI: Linux Python and gfx1013 fixtures pass. "Build and test on Windows" was still pending when I looked. I did not run a Win2025 job. The D3D12 WARP readback tests are in the PR but are not exercised by my Linux run.
Mutations (reverted afterwards with git checkout -- .):
- Disabled the leak check (
leak = set()): KILLED ("backward loop odd d16 leak: unexpectedly accepted"). - In the
v_and_b32lowering, replacedlow16_only=c1 is not None and (c1 & 0xffff0000) == 0withlow16_only=True: SURVIVED. The suite still passes.
Findings
- P1: none.
- P2:
tools/startup/gfx2hlsl.py(v_and_b32branch ofVEC_U): the mask-operand rule is untested for the non-constant and wide-mask cases. With the mutation above,v_and_b32 vD, v_odd, vMaskor& 0xffffffffwould read the undefined upper 16 bits and still be accepted. Please add refusal cases tostartup_image_load_d16_check.pyfor (a) a VGPR mask, (b) a constant mask with upper bits set, and (c) the swapped operand order. - nit:
Stage.exec_known,low16_only_vand the related attributes are class-level defaults. They are replaced with per-instance sets in the translate loop, so nothing is shared. A short comment saying so would help the next reader.
Clean-room/title: the title is neutral and the change is in-repo logic only. No clean-room concern seen. Mergeable: yes.
Verdict: logic looks sound; the P2 is a test gap and does not block.
AI-assisted; commands listed were executed locally.
…guards - Add exact UNORM16 code recovery and ratio-to-binary16 conversion (pack16_unorm16) alongside IEEE binary32-to-binary16 RNE (pack16_rne, preserving NaN sign), selected per SRV via 'udsrc <ud> d16unorm16 <idx>' to avoid binary32 double-rounding at 0xffaf and 0xffef. - Restrict 'd16srv <idx> exact' (src/startup_stubs/d16_image_format.h and src/startup_stubs/d3d12_draw.inl) to the 14 independently GPU-verified exact DXGI formats (11 float_exact + 3 unorm16), refusing packed-target stand-ins, UINT/SINT, SNORM16, R24_UNORM, SRGB, BCn, typeless, null and unwritten views. - Guard odd-dmask D16 destination VGPRs across Stage helpers and blocks, preserve the explicit image_load_mip d16 refusal check, and verify the live emitted HLSL helpers directly on Linux and Windows. Part of R0Y00#2023 AI-assisted.
|
Thanks @tedin7! Pushed an update addressing those remaining items:
AI-assisted. |
8baceea to
536a626
Compare
tedin7
left a comment
There was a problem hiding this comment.
Re-review of head 536a626e46d217acdc7f9a9b67dd2667ae737cfe (previous review was on 8baceea3).
Delta read: git diff 8baceea3..536a626 (2 files: tools/startup/gfx2hlsl.py, tests/startup_image_load_d16_check.py). The getattr(pipe, ...) fallbacks in the d16 image_load path became direct self.pipe.resources[...] / self.pipe.srv_formats access, so the SRV format guard and the exact-UNORM16 mode argument can no longer be silently skipped. A comment now documents the class-level defaults. New refusal cases cover the v_and_b32 mask operand.
Commands run locally (Linux):
git diff --check origin/main...HEAD: cleanpython3 tests/docs_links_check.py: pass (18 files, 405 links)python3 tests/bidi_controls_check.py: pass (1483 files)python3 tests/startup_image_load_d16_check.py: pass (14 exact formats, 32 refused; 12 low-16 paths accepted, 23 leaks refused)python3 tests/startup_image_load_mip_check.py: pass
CI on this head: Linux Python checks, gfx1013 fixtures and "Build and test on Windows" all pass. I did not run a Win2025 job myself; the D3D12 WARP readback tests are covered by the PR's Windows CI job only.
Mutations (each reverted with git checkout -- .):
v_and_b32lowering forced tolow16_only=Trueon both operands (the one that survived last time): now KILLED ("v4 vgpr mask lhs: unexpectedly accepted").- SRV format guard disabled (
if fmt not in D16_EXACT_SRV_FORMATS->if False): KILLED ("srv_formats UNKNOWN: unexpectedly accepted").
Findings
- P1: none.
- P2: none. The earlier P2 (untested VGPR, wide-constant and swapped-operand mask cases) is fixed with the new lhs/rhs, imm, hex,
-1and SGPR refusal cases. - Previous nit (class-level defaults comment): addressed.
Clean-room/title: neutral title, in-repo logic only, no clean-room concern. Mergeable: yes.
Verdict: no blocking findings on this head.
AI-assisted; commands listed were executed locally.
|
Hardware run of the draw stage on the current head Both pixel fixtures (8x2 R16_UNORM including Note: the head moved from Limits: AMD only, no NVIDIA here. AI-assisted. |
R0Y00
left a comment
There was a problem hiding this comment.
Re-reviewed 536a626e. The previous changes request is addressed. The runtime checks the bound SRV format, and the UNORM16 path recovers the integer code before rounding the exact ratio to binary16. The prior mismatch inputs now produce 0xffaf → 0x3bfd and 0xffef → 0x3bff. The upper-half guard rejects the new variable and wide-mask consumers. #2119 was closed in favor of this level-zero implementation.
Independent Windows Release run: ctest --preset release --no-tests=error -R "^startup_(image_load_(d16|mip)|d16_)" -V passed 10/10 with no skips on WARP and RTX 4060 Laptop (driver 32.0.16.1656). DXC and FXC both caught the deliberate double-rounding and upper-half mutations. The exhaustive GPU comparison across all 65,536 UNORM16 codes is the contributor’s RX 9070 XT/WARP result.
|
Correction to my comment above: there are eight negative controls, not five, and they run under both compilers.
I had read the last five lines of the log and written "all five mutations are caught". The match is worth more than I said, not less, but the count was wrong. The same applies to "the earlier one had four controls": that was also a tail read, not a count. AI-assisted. |
|
One more correction, on the description of the fixtures rather than the count. I wrote "Both pixel fixtures (8x2 R16_UNORM including No dimensions, and AI-assisted. |
Extend the D16 MIMG load lowering in `tools/startup/gfx2hlsl.py` (`#2139`) from level-zero `image_load` to explicit-mip `image_load_mip` on 2D, 3D and 2D-array resources: - Accept `d16` alongside cache-policy and `unorm` modifiers on `image_load_mip` (`Texture2D.Load(int3(x, y, mip))` and `Texture2DArray`/`Texture3D.Load(int4(x, y, slice_or_z, mip))`), including non-sequential address (`NSA`) register lists and both vertex and pixel stages. - Reuse the exact IEEE binary32-to-binary16 RNE (`pack16_rne`) and exact `UNORM16` (`pack16_unorm16`) helpers, `udsrc <ud> d16unorm16 <index>` selection, `d16srv <index> exact` manifest validation against the 14 GPU-verified exact DXGI formats, and odd-`dmask` low-16-bit provenance tracking (`low16_only_v`). - Keep `a16`, `tfe`, `lwe`, `r128`, set reserved MIMG bits, `dmask:0x0`, 1D and cube dimensions, compute `d16` image loads, and mismatched destination or address register widths refused. - Extend `offscreen_check --startup-image-load-d16` (`tests/startup_image_3d.cpp`) and `tests/startup_image_load_d16_check.py` (plus the explicit-mip layout checks in `tests/startup_image_load_mip_check.py` and `tests/startup_image_2d_array_check.py`) to two-mip (`8x2` + `4x1`) 2D and two-slice 2D-array `R16_UNORM` and `R32G32B32A32_FLOAT` textures, covering explicit-mip fixtures C and D, odd-`dmask` upper-half poison checks, and six additional HLSL mutations (`mip_zero`, `mip_drop_nsa`, `mip_rtz`, `mip_double_round`, `swap_slice_mip`, and `array_drop_nsa`). Part of #2023 AI-assisted. Co-authored-by: tedin7 <110300616+tedin7@users.noreply.github.com>
Summary
Lowers level-zero MIMG
image_loadwithd16(opcode 0x00) intools/startup/gfx2hlsl.pyfor 2D (including packeda16coordinates and NSA coordinate lists), 3D, and 2D-array textures, validates the bound SRV's effectiveDXGI_FORMATbefore drawing against the 14 independently GPU-verified exact formats, dispatches exactUNORM16ratio-to-binary16 conversion per SRV soDXGI_FORMAT_R16*_UNORMavoids binary32 double-rounding, and guards hardware-undefined upper 16 bits on odd-dmaskdestination VGPRs.Part of #2023 (item D).
Root Cause & Design
image_load ... d16narrowing and binary32 double-rounding:dmaskcomponent to IEEE-754 binary16 (round to nearest even) and packs the halves pairwise intoceil(popcount(dmask) / 2)consecutive VGPRs (low 16 bits first, high 16 bits second).f32tof16(DXBCftof16) truncates toward zero on WARP, lowering 31,740 of the 65,536DXGI_FORMAT_R16_UNORMvalues by 1 ULP relative to RDNA hardware.Texture*<float4>.Load, narrowing an intermediate IEEE binary32 value double-roundsR16_UNORMat two codes:0xffaf(0x3bfeinstead of0x3bfd) and0xffef(0x3c00instead of0x3bff).gfx2hlsl.pytherefore emits:pack16_rne(float): integer IEEE binary32-to-binary16 round-to-nearest-even (covering normals, subnormals, halfway ties to even, signed zero, overflow to infinity, and quiet NaNs preserving signsign | 0x7e00uas measured on RDNA 2 hardware).pack16_unorm16(float): recovers the exact 16-bit integeru = uint(saturate(value) * 65535.0 + 0.5)and roundsu / 65535directly to IEEE binary16 in 32-bituintarithmetic (firstbithigh(u),u << (26u - msb), quotient + remainder> 32767u; odd65535has no exact halfway ties).pack16_d16(float, uint): selectspack16_unorm16when the per-SRV entry constantudsrc <ud> d16unorm16 <index>is non-zero andpack16_rneotherwise (default.y/.z = 0.0and.w = 1.0channels on 1/2-channelR16*_UNORMalso map to exact0x0000and0x3c00).src/startup_stubs/d16_image_format.h,src/startup_stubs/d3d12_draw.inl):d16srv <index> exactandudsrc <ud> d16unorm16 <index>for every SRV read byimage_load ... d16.d16_srvs_readyresolves the bound descriptor's effectiveDXGI_FORMAT(explicit SRV format, or underlying console/desktop resource format for default SRVs) and accepts only the 14 independently GPU-verified exact formats:11D16SrvMode::float_exact(d16unorm16 = 0):R32G32B32A32_FLOAT,R32G32B32_FLOAT,R32G32_FLOAT,R32_FLOAT,R32_FLOAT_X8X24_TYPELESS,R8G8B8A8_UNORM,R8G8_UNORM,R8_UNORM,A8_UNORM,B8G8R8A8_UNORM,B8G8R8X8_UNORM.3D16SrvMode::unorm16(d16unorm16 = 1):R16G16B16A16_UNORM,R16G16_UNORM,R16_UNORM.UINT/SINT), typeless, depth-stencil-only,R16*_FLOAT,SNORM16,R24_UNORM_X8_TYPELESS,SRGB, block-compressed (BCn), packed-target stand-ins (packed_stand_in_of), console extension, null-resource, and unwritten views are refused withd16 exact refused.dmaskupper-half safety:popcount(dmask)is odd (1or3), bits31:16of the final destination VGPR are hardware-undefined on RDNA 2.Stagetrackslow16_only_vacross straight-line expressions and basic blocks and refuses whole-word reads unless consumed through a low-16-bit operation (v_cvt_f32_f16,v_cvt_f32_ubyte0/1,SDWABYTE_0/BYTE_1/WORD_0,v_and_b32with constant mask<= 0xffff,v_cmp_class_f16/v_cmpx_class_f16, orv_fma_mix*half operands).image_load_mip(0x01) withd16, sampler MIMG forms withd16, 1D and cube dimensions, 3D/2D-arraya16,tfe,lwe,r128, set reserved MIMG bits,dmask:0x0, and mismatched register counts remain refused.Verification
Verified on commit base
009153b7(Windows 11 26H2 build26300.9974, MSVC19.44, DXC + FXC10.0.26100.0, D3D12 debug layer enabled withdebug_errors=0 debug_warnings=0):32.0.32029.2010& WARP10.0.26100.9818):R16_UNORM:65,536 / 65,536exact code recoveries and65,536 / 65,536exact binary16 results (0mismatches under both DXC and FXC, including0xffaf -> 0x3bfdand0xffef -> 0x3bff).R8_UNORM:256 / 256exact binary16 results underpack16_rne(0mismatches).R32_FLOATNaN sign preservation:0x7fc00001 -> 0x7e00,0xffc00123 -> 0xfe00.10/10D16 +image_load_miptests,30/30prpreset,100/100startup_*suite):startup_image_load_d16_controls: transpiles and executes the livepack16_rneandpack16_unorm16HLSL emitted bygfx2hlsl.pyacross 320 boundary floats, all 256UNORM8codes, and all 65,536R16_UNORMcodes on Linux/Windows (with self-tests killing tie-to-even and threshold mutations), plus all 15 non-zerodmasks,d16_image_format.hsync, 30 odd-dmaskconsumer paths, and refusal checks.startup_image_load_d16_{warp,hardware}: DXC (ps_6_0) and FXC (ps_5_1) draws across8x2R16_UNORM(including0xffafand0xffef) and8x2R32G32B32A32_FLOAT,0xdead0000upper-half poison invariance, and 8 negative HLSL mutation controls (rtz,double_round,unpacked_x,swap_halves,drop_shift,drop_a16,drop_nsa,unmasked_odd_hi).startup_d16_image_format&startup_d16_image_format_accept_uint_control: all 256DXGI_FORMATenum values (11float_exact+3unorm16+242refused), manifest parser bounds, and negative mutation control.startup_d16_srv_{warp,hardware}: end-to-endd3d12_xs.dlldraw dispatchingd16unorm16=1(R16_UNORM0xffef -> 0x3bff) andd16unorm16=0(R32_FLOAT0x3f7ff000 -> 0x3c00) on one PSO,R16_TYPELESS + R16_UNORM(0xaaaa -> 0x3955), refusingR16_UINT,R16_SNORM, null-resource and unwritten slots, and rejecting malformedd16srvmanifests.AI-assisted.