Skip to content

D3D12: analytic-filter ports of the fused output kernels (post_w64.co), byte for byte against HIP - #145

Merged
phantoslayer21 merged 5 commits into
mainfrom
dx12/post-analytic
Nov 14, 2026
Merged

phantoslayer21 merged 5 commits into
mainfrom
dx12/post-analytic

Conversation

@phantoslayer21

@phantoslayer21 phantoslayer21 commented Nov 14, 2026 •

Copy link
Copy Markdown
Owner

Refs #89

#143 (ports keyed by name and code object) has merged; this branch is current with main.

Model L's model file has no output-filter weights, so the runtime loads post_w64.co (the analytic filter) under w64. D3D12 had ports only of the original filter's build (post_w64__orig.co). This PR adds the analytic build's ports of the fused output kernels, byte for byte against HIP post_w64.co.

What

  • clean/dx12/kernels/post.hlsl, WG_LZ_ANALYTIC = 1:
    • w64/post_tf_f32_p12_diet_vsit and w64/post_tf4_dl_f32_p12_diet_vsit with co=post_w64.co; the same names as the original's ports, and the device runs the port of the loaded build;
    • the analytic filter as HIP's profile 0: spec 06's Lanczos weights as FP32 constants, v = w0 t0, then one fused multiply-add per tap, then the clamp to the taps' range;
    • FP32 values between the passes (the horizontal results go to the ring as FP32, the vertical result straight into Dec);
    • no weight arguments (22 arguments, as HIP's).
    • The _direct forms are not in this PR (see Not tested).
  • clean/tests/test_post_tf_geometry.py: the tf4 declarations are compared as a set of names (a name is declared once per build it ports); every declaration line is still checked for 256 lanes and the cap.
  • clean/dx12/tests/post_tf_d3d12_check.py (new): the check below, on clean/l/runner/l_d3d12_ops_check.py's engine. That engine now takes a kinds table and a HIP block size: the tf4 port has no HIP kernel of its own.

GPU record

post_tf_d3d12_check.py --run --seeds 3, one GPU slot, this branch's DXILs, kernel_replay.exe, and post_w64.co / post_w64__orig.co built as clean/runner/build.py builds them.

cases identical bytes compared differing
w64/post_tf_f32_p12_diet_vsit (analytic) vs HIP post_tf_f32_p12_diet_vsit (post_w64.co) 15 15 71,527,440 0
w64/post_tf4_dl_f32_p12_diet_vsit (analytic) vs HIP post_tf_f32_p12_diet_vsit / post_tf_dl_f32_p12 15 15 1,973,568 0
control: Model M w64/post_tf_f32_p12_diet_vsit (original) vs post_w64__orig.co 12 12 2,176,464 0
  • What is compared: the raw bytes of every output (the full history with alpha, the reduced codes, the FP32 output image). Each buffer is filled beforehand with HIP 0xA5 / D3D12 0x5A, and 64 slack bytes after each buffer must keep each back end's own sentinel: 0 bad.
  • Frames: Quality and Performance ratios, odd sizes, reset, the exposure pair given or not, and a 2560 x 280 output whose chunk plan has chunks of 68 and of 36 row pairs. tf4 also covers native AA (D = 1.5 R).
  • The control has the same kernel name as the first row: each case loads its code object under w64, and the device picks the port by it, so the run also exercises D3D12: ports keyed by (name, code object), so one kernel name can have ports of several builds #143's selection.
  • Negative control: w64_post_tf_f32_p12_diet_vsit_s0_4 again on D3D12 with half its workgroups. Caught, 8,899,584 differing bytes.
  • Model M unchanged: all 10 original-filter kernels of post.hlsl (w64/post_tf_*, pmo/post_tf*_mo*, the _tex, _direct and tf4 forms) plus native_fill, exposure_auto_diet and l_coef, built from main (cc0a6df) and from this branch: SHA-256 identical, 13 of 13. A manifest of this branch holds these entries unchanged plus the two analytic entries.

Tested

  • GPU record above; Model M DXILs main vs branch; public gates; leak scan 0 hits.

Not tested

  • The _direct forms of the analytic ports (the game route): they follow in their own PR. The direct form's output table (FP16-indexed) does not apply to an FP32 filter result.
  • runtime.cpp still refuses the native direct route without the original's filter weights; that gate belongs to the D3D12 frame work.
  • A whole frame through the runtime on D3D12 with post_w64.co.

…), byte for byte against HIP

post.hlsl WG_LZ_ANALYTIC: w64/post_tf_f32_p12_diet_vsit and w64/post_tf4_dl_f32_p12_diet_vsit of
post_w64.co (the build the runtime loads when the model file has no output-filter weights, e.g.
Model L): FP32 Lanczos constants, FP32 values between the passes, no weight arguments. The
original's DXILs are unchanged. post_tf_d3d12_check.py: these ports against HIP post_w64.co with
l_d3d12_ops_check.py's engine (raw bytes, sentinels, slack, negative control), the original port
against post_w64__orig.co as the Model M control; the harness takes a kinds table and a HIP block.

Refs #89

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

The analytic-filter ports declare the same kernel names as the original filter's with co=post_w64.co;
every declaration line is still checked for the 256 lanes and the cap.

Refs #89

Signed-off-by: phantoslayer21 <156617979+phantoslayer21@users.noreply.github.com>
@phantoslayer21
phantoslayer21 marked this pull request as ready for review November 14, 2026 04:44
@phantoslayer21
phantoslayer21 merged commit 358fc5f into main Nov 14, 2026
9 checks passed
@phantoslayer21
phantoslayer21 deleted the dx12/post-analytic branch November 14, 2026 04:45
phantoslayer21 added a commit that referenced this pull request Nov 14, 2026
…well

The direct-resource route required the "original" output-filter build of the
wave64 fused post (post_w64__orig.co) with the model file's filter weights. With
the analytic-filter ports on main (#145, #146; keyed by name and code object, #143)
it also takes post_w64.co, the build a model file without those weights uses, as
Model L's: the check now refuses only quality5 / quality9, a post outside wave64,
or the original filter without weights.

test_l_runtime_frame.py: the D3D12 tests use the declared ports as they are (both
filter builds of Model M's fused post are declared now); a test that the analytic
build of the fused pack12 post is among them.

Refs #89

Signed-off-by: phantoslayer21 <156617979+phantoslayer21@users.noreply.github.com>
phantoslayer21 added a commit that referenced this pull request Nov 14, 2026
…well

The direct-resource route required the "original" output-filter build of the
wave64 fused post (post_w64__orig.co) with the model file's filter weights. With
the analytic-filter ports on main (#145, #146; keyed by name and code object, #143)
it also takes post_w64.co, the build a model file without those weights uses, as
Model L's: the check now refuses only quality5 / quality9, a post outside wave64,
or the original filter without weights.

test_l_runtime_frame.py: the D3D12 tests use the declared ports as they are (both
filter builds of Model M's fused post are declared now); a test that the analytic
build of the fused pack12 post is among them.

Refs #89

Signed-off-by: phantoslayer21 <156617979+phantoslayer21@users.noreply.github.com>
phantoslayer21 added a commit that referenced this pull request Nov 14, 2026
…well

The direct-resource route required the "original" output-filter build of the
wave64 fused post (post_w64__orig.co) with the model file's filter weights. With
the analytic-filter ports on main (#145, #146; keyed by name and code object, #143)
it also takes post_w64.co, the build a model file without those weights uses, as
Model L's: the check now refuses only quality5 / quality9, a post outside wave64,
or the original filter without weights.

test_l_runtime_frame.py: the D3D12 tests use the declared ports as they are (both
filter builds of Model M's fused post are declared now); a test that the analytic
build of the fused pack12 post is among them.

Refs #89

Signed-off-by: phantoslayer21 <156617979+phantoslayer21@users.noreply.github.com>
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