Repository navigation
Model L frame on HIP: its own reconstruction l_post_recon in place of Model M's post - #135
Merged
Merged
Conversation
… Model M's post Step 5 of Model L's frame runs l_post_recon (l_post.co, #128; clean/l/FORMATS.md step 5) on Model M's unbanded post_recon route: post_recon's arguments and buffers, 8-byte history, the base coefficient format, then Model M's unbanded output filter. - clean/runtime/runtime.cpp: for model=L, l_post.co is loaded and the post kernel is l_post_recon. Model M's post kernels (post_kernel / WG_POST_KERNEL) and post_pack=p12 are refused for Model L. LDR colour (WgRtConfig.hdr = 0) is refused: l_post_recon is HDR and Model L's LDR kernel is not written yet. - clean/tests/runtime_frame_trace.cpp: --hdr=<0|1>; l_post_recon's arguments decoded (P{rw,rh,dw,dh,reset} for WgPostParams). - test_l_runtime_frame.py: Model L's frame equals Model M's on the post_recon route with steps 2, 4 and 5 replaced; l_post_recon's arguments against the named buffers and the post blob; its parameters and grid; Model M's filter follows; three more mix-ups fail; the LDR and post-kernel refusals. - test_l_runtime_abi.py: l_post.co's l_post_recon against the recorder's kinds (WgPostParams 64 bytes). - clean/l/runner/l_frame_check.py: Model L runs with HDR colour; its post and filter against clean/l/reference/recon.py; --plain runs frames without random_inputs' special values. Refs #89 Signed-off-by: phantoslayer21 <156617979+phantoslayer21@users.noreply.github.com>
Signed-off-by: phantoslayer21 <156617979+phantoslayer21@users.noreply.github.com>
…del-l/hip-recon Signed-off-by: phantoslayer21 <156617979+phantoslayer21@users.noreply.github.com>
phantoslayer21
added a commit
that referenced
this pull request
Nov 14, 2026
Signed-off-by: phantoslayer21 <156617979+phantoslayer21@users.noreply.github.com> # Conflicts: # clean/l/runner/l_frame_check.py
Signed-off-by: phantoslayer21 <156617979+phantoslayer21@users.noreply.github.com>
…most 0.01 % per run, 0.05 % per case Model L only (l_post_check.py, and l_frame_check.py for Model L); Model M's checks keep their per-case 0.01 %. The kernel's hardware log2 (v_log_f32, not correctly rounded) can flip one input feature across an FP16 rounding boundary; the gather's half accumulators carry it forward. Forcing that feature in the oracle leaves 0 values over 1 ulp on the cases that failed. Approved by the coordinator; provisional until a kernel-order model. Signed-off-by: phantoslayer21 <156617979+phantoslayer21@users.noreply.github.com>
Signed-off-by: phantoslayer21 <156617979+phantoslayer21@users.noreply.github.com>
phantoslayer21
marked this pull request as ready for review
November 14, 2026 04:13
phantoslayer21
added a commit
that referenced
this pull request
Nov 14, 2026
Since #135, the HIP Model L frame reconstructs with l_post_recon while the native D3D12 frame runs Model M's fused pack12 post. Each frame's encoder reads the previous frame's reconstruction, so the two runs part after the first frame, and a byte comparison with HIP holds only where their inputs agree. For Model L, --compare-d3d12 therefore checks the D3D12 frame on its own: - --run --backend d3d12-stages: the frames with the D3D12 fusions off (WG_D3D12_FUSION=none, set before the runtime library loads: one configuration per process), so every stage output is written except b0 ... b4 (the bottleneck megakernel; the plain C = 128 block has no D3D12 port); - every stage of that run against the reference on the run's own inputs, as --compare (compare_model: post_ref "M", the bottleneck as one unit chained from enc2.merged, A / B / C from the unpacked pack12 images, no display for the fused post); - the default kernels (--backend d3d12) against that run, byte for byte; - the default run's post against Model M's post reference. Model M's D3D12 frame stays compared with its HIP frame, byte for byte. test_l_runtime_frame.py: check_frame / check_roles take l_post (False for the native D3D12 frame, which launches Model M's post, not l_post_recon). Refs #89 Signed-off-by: phantoslayer21 <156617979+phantoslayer21@users.noreply.github.com>
phantoslayer21
added a commit
that referenced
this pull request
Nov 14, 2026
Since #135, the HIP Model L frame reconstructs with l_post_recon while the native D3D12 frame runs Model M's fused pack12 post. Each frame's encoder reads the previous frame's reconstruction, so the two runs part after the first frame, and a byte comparison with HIP holds only where their inputs agree. For Model L, --compare-d3d12 therefore checks the D3D12 frame on its own: - --run --backend d3d12-stages: the frames with the D3D12 fusions off (WG_D3D12_FUSION=none, set before the runtime library loads: one configuration per process), so every stage output is written except b0 ... b4 (the bottleneck megakernel; the plain C = 128 block has no D3D12 port); - every stage of that run against the reference on the run's own inputs, as --compare (compare_model: post_ref "M", the bottleneck as one unit chained from enc2.merged, A / B / C from the unpacked pack12 images, no display for the fused post); - the default kernels (--backend d3d12) against that run, byte for byte; - the default run's post against Model M's post reference. Model M's D3D12 frame stays compared with its HIP frame, byte for byte. test_l_runtime_frame.py: check_frame / check_roles take l_post (False for the native D3D12 frame, which launches Model M's post, not l_post_recon). Refs #89 Signed-off-by: phantoslayer21 <156617979+phantoslayer21@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Model L's HIP frame with its own reconstruction: step 5 runs
l_post_recon(l_post.co, #128) in place of ModelM's post kernel. It takes Model M's unbanded
post_reconroute, withpost_recon's arguments and buffers(
clean/l/FORMATS.mdstep 5), 8-byte history and the base coefficient format, then Model M's unbanded output filter.This branch has #137 merged in (the oracle's steps 4-6 in float32, the cause of the earlier gap), main, and Model L's
post acceptance (below). On the GPU record every stage of all 11 Model L frames passes, and so does Model M's control.
Model L's post acceptance (PROVISIONAL until a kernel-order model of the reconstruction exists; approved by the
coordinator). Model L only:
clean/l/runner/l_post_check.py(l_post_rule,l_post_run) and Model L's post inclean/l/runner/l_frame_check.py. Model M's checks are unchanged.0.01 % per frame or case).
reduced codes within 1.
v_log_f32, not correctly rounded) can put one input feature h(E_in(e c)) on theother side of an FP16 rounding boundary than the oracle's correctly rounded log. The gather's half accumulators
carry that flip forward, to several FP16 steps where a window mixes a clamped negative colour with positive ones.
With about 5 such values per frame, a per-frame 0.01 % turns on one flip.
frames 8 and 9 of this record (at most 1 step), and on the one case of Model L reconstruction oracle: steps 4-6 in float32 (the gap #135 found) #137's record that failed the old rule.
What changes
clean/l/runner/l_post_check.py,clean/l/runner/l_frame_check.py: Model L's post acceptance (above).clean/runtime/runtime.cpp, formodel=L:l_post.cois loaded; the reconstruction launchesl_post_recon;post_kernel/WG_POST_KERNEL) andpost_pack=p12;WgRtConfig.hdr = 0).l_post_reconis HDR, and Model L's LDR kernel is not written yet.Model M's post is never used in its place.
l_post=l_post_recon.clean/tests/runtime_frame_trace.cpp:--hdr=<0|1>;l_post_recon's arguments are decoded,WgPostParamsasP{rw,rh,dw,dh,reset}.clean/l/runtime/tests/test_l_runtime_frame.py,test_l_runtime_abi.py: see "Tested".clean/l/runner/l_frame_check.py: Model L runs with HDR colour; its post and filter are compared withclean/l/reference/recon.py;--plainruns frames withoutrandom_inputs' special values.Refs #89
GPU record (HIP,
clean/l/runner/l_frame_check.py --runand--compare, on 8a3a429: main with #139 and #137merged in, Model L's post acceptance; the head ea1e4f1 only adds main's #144, D3D12 files only, so the HIP record stands)
RX 9070 XT, locked GPU slots (
model-l-frame-1,-2,-3: the same counts on 9278b9a, e217712 and 8a3a429), 2.0 sin the slot each. The same harness as before: 11 frames per model (96 x 64, 80 x 48, 77 x 45; resets on frames 0, 2,
5, 8, 9; both parities), with
random_inputs' special values (NaN, huge and negative colours, NaN depths, motionleaving the frame). Every stage is checked on the runtime's own inputs. Model M's frame on the same harness is the
control.
The default kernels are byte-identical to the six-launch bottleneck run on all 11 frames for both models.
recon.reconstructwith the float32 blend):most 12 steps.
l_post_check.py(locked slotmodel-l-post-4, 2 seeds, on 8a3a429): 20 of 20 cases pass. Over the run, 4 of143,928 history values are more than 1 step off (2.8e-5). Negative control: fails, as required.
What the frames' over-1-step values are. All 12 over-1-step values on frames 8 and 9 are explained by one input feature per
frame. A render pixel's green feature h(E_in(e c)) lies within 1 float32 ulp of log2 of an FP16 rounding boundary. The
kernel's hardware log2 (
v_log_f32, not correctly rounded) rounds it to the other FP16 value than the oracle does.Forcing that one feature to the kernel's side in the oracle gives 0 values over 1 step on both frames (at most 1 step).
The step grows because the half accumulators of the 4 x 4 gather carry the flip, more so where the window mixes a
clamped negative colour with positive ones. The same mechanism explains
l_post_check.py's one failing case on #137.This is the open kernel-order point (hardware log2 / exp2 / reciprocal), not a wiring or special-value fault.
Tested
clean/l/runtime/tests: 24 tests OK;clean/l/tests: 49 tests OK (on 8a3a429).post_reconroute (WG_POST_KERNEL=post_recon), launch for launch,with steps 2, 4 and 5 replaced; Model M's unbanded filter follows
l_post_recon.l_post_recon's 14 arguments match the named buffers and the post blob (found by its bytes' hash): colour, A, B,C, the previous history, this frame's motion surfaces, the new history, the reduced history, the display image,
the exposure pair. Its parameters (render size, D = 180 x 108, reset) and grid are checked too.
dec0.coef, A / C.post_pack=p12.l_post.coexportsl_post_reconwith 12 addresses,WgPostParams(64 bytes) and anaddress, as the recorder decodes it.
clean.tests.test_runtime_frame_trace,test_model_select,test_model_filter,test_model_pack_cpp: 31 OK.WG_MODEL_L, one line differs: theset's
model=Lcase now stops at the LDR refusal (the set runs without HDR).Not tested