Skip to content

Model L: l_post_recon_p12, the reconstruction kernel on pack12 coefficients (HIP + D3D12 port) - #141

Merged
phantoslayer21 merged 3 commits into
mainfrom
model-l/l-post-recon-p12
Nov 14, 2026
Merged

phantoslayer21 merged 3 commits into
mainfrom
model-l/l-post-recon-p12

Conversation

@phantoslayer21

@phantoslayer21 phantoslayer21 commented Nov 14, 2026 •

Copy link
Copy Markdown
Owner

Refs #89

#136 has merged; this branch is current with main. l_post_recon_p12 is Model L's reconstruction kernel on the pack12 coefficients of l_coef_pack12 (#131 / #134), which is the form the D3D12 frame reads. It comes as a HIP kernel plus its D3D12 port.

What

  • clean/l/kernels/l_post.hip: the kernel body becomes a template on the coefficient form.
    • l_post_recon_p12 reads image A8 (8 bytes per render pixel: codes A0 A1 A2 B0 | B1 B2, C2 as FP16) and image C4 (4 bytes per render pixel: C0, C1 as FP16). B is unused (null).
    • Arguments otherwise as l_post_recon, with the same grid and the same outputs.
  • clean/dx12/kernels/l_post.hlsl: the LP_P12 variant (texel load only). l_post_recon's DXIL is byte-identical to Model L: D3D12 port of the reconstruction kernel l_post_recon, byte for byte against its HIP kernel #136's (SHA-256).
  • clean/l/runner/l_d3d12_ops_check.py: the 10 reconstruction cases on pack12 inputs. On HIP, the pack12 kernel's raw output bytes must equal l_post_recon's for the same cases.
  • clean/l/FORMATS.md: the kernel.

GPU record

l_d3d12_ops_check.py --run --seeds 6 --kernels l_post_recon,l_post_recon_p12, one GPU slot, this branch's l_post.co and DXILs.

cases identical bytes compared differing
l_post_recon_p12 (HIP vs D3D12) 60 60 1,982,016 0
l_post_recon (HIP of this branch vs D3D12) 60 60 1,982,016 0
control: Model M swin_block_c96_nc 36 36 3,167,424 0
  • l_post_recon_p12 equals l_post_recon on HIP: 60 of 60 cases, all output bytes.
  • What is compared: raw bytes of the history (with alpha), the display and the reduced codes, with sentinels HIP 0xA5 / D3D12 0x5A. Padding and slack keep each back end's own sentinel: 0 bad.
  • Negative control (half grid): caught, 8,498 differing bytes.
  • The template change moved l_post_recon's HIP machine code (scheduling and encodings; the same arithmetic opcode mix). Its outputs are byte-identical to Model L: D3D12 port of the reconstruction kernel l_post_recon, byte for byte against its HIP kernel #136's D3D12 port on all 60 cases above.
  • Model M: no Model M source changes; Model M's DXILs and code objects are untouched (l_post.co is Model L's code object).

Tested

  • GPU record above; public gates; leak scan 0 hits.

Not tested

  • In a game (the D3D12 frame is param's lane).
  • The LDR form (planned).

…cients (HIP + D3D12 port)

l_post.hip: the kernel body becomes a template on the coefficient form; l_post_recon_p12 reads
l_coef_pack12's images (A8, 8 bytes per pixel; C4, 4 bytes; B unused), the same texel values, so the
same outputs. l_post.hlsl: the D3D12 port's LP_P12 variant (texel load only; l_post_recon's DXIL is
unchanged). l_d3d12_ops_check.py: the reconstruction cases on pack12 inputs, and on HIP the pack12
kernel's raw outputs must equal l_post_recon's. FORMATS.md: the kernel.

Refs #89

Signed-off-by: phantoslayer21 <156617979+phantoslayer21@users.noreply.github.com>
Signed-off-by: phantoslayer21 <156617979+phantoslayer21@users.noreply.github.com>

# Conflicts:
#	clean/l/runner/l_d3d12_ops_check.py
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant