Repository navigation
Model L reconstruction kernel l_post_recon (HIP, HDR) and its GPU check - #128
Merged
Merged
Conversation
…r-colour history and fallback, NaN-passing decode; GPU check against the oracle Refs #89 Signed-off-by: phantoslayer21 <156617979+phantoslayer21@users.noreply.github.com>
phantoslayer21
marked this pull request as ready for review
November 14, 2026 02:23
…e and kernel), fused blend; GPU check with sentinels, every output byte, extreme-coefficient known answers and a negative control Refs #89 Signed-off-by: phantoslayer21 <156617979+phantoslayer21@users.noreply.github.com>
j0nsh1n
pushed a commit
to j0nsh1n/wronggpu
that referenced
this pull request
Nov 14, 2026
… Model M's post Step 5 of Model L's frame runs l_post_recon (l_post.co, phantoslayer21#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 phantoslayer21#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.
Refs #89
l_post_recon(clean/l/kernels/l_post.hip, code objectl_post.co) is Model L's reconstruction kernel, HDR. Ithas Model M's
post_reconarguments, buffers, layouts and grid, with Model L's arithmetic.Colour gather in the model's precision (as the spec side confirmed it, for Model L and Model M):
The oracle (
clean/l/reference/recon.py,gather_half, table entry"gather": "half") computes the gather thesame way, so the kernel and the oracle agree on which weights underflow. No pixel is excluded any more. This settles
the two gather regimes:
all features 0, so the output is the candidate history.
After the gather:
w1 L1 + (w2 L2), times the current exposure;
The file includes Model M's
clean/kernels/post.hipfor its other functions and does not change it. Model M'sreference (
clean/reference/post.py) also keeps its float64 gather: the table's Model M entry keeps"gather": "float64", and the byte-exact reduction test to Model M's oracle still holds.Tested
GPU record: RX 9070 XT, locked GPU slot
model-l-post-3, run on head b055edb, 2 seeds, synthetic data.clean/l/runner/l_post_check.py. This replaces the earlier record of 2a37dbd.Harness:
and top 2 bits (0);
fails, as required.
14 cases, all pass:
earlier record (2a37dbd) compared only the 883 of 950 pixels per seed where the float64 oracle's total weight was
0, and excluded the other 67 per seed (134 in all). Now every pixel is compared: 950 per seed. Result: 0 of 2,850
history values and 0 of 2,850 display values differ per seed, and 0 reduced codes. With the gather in the model's
precision, 943 and 941 pixels have total weight 0 (883 under the old float64 gather). The other pixels are compared
like any other.
fallback.
Criteria: Model M's acceptance for its own reconstruction kernel (
clean/tests/test_post_emu.py): no non-finitevalue, at most 0.01 % of FP16 values more than 1 ulp off, at most 1 % differ, mean error at most 0.1 % of the RMS;
reduced codes within 1, at most 1 % differ. These thresholds are Model M's: a float32 kernel against a float64
oracle. They are to be tightened once a kernel-order model of the reconstruction exists.
CPU:
python -m unittest discover -s clean/l/tests -t .passes. New: the Q3 constants (A = -47264, eps = -472.5at offset 0.1) and the offset-0.05 / 0.1 known answers in the oracle.
Model M code objects:
clean/runner/m_codeobjects_compare.py --base origin/main(base vs this head, everyModel M code object of
build.py --no-runtime --variants, head b055edb): 84 base / 84 head, all identical.Not tested
The LDR kernel (planned; the oracle has the confirmed LDR path).
Motion at output resolution.
Byte-exactness against a kernel-order model. Through
post.hip's helpers, the kernel keeps Model M's forms for:cr_weights, float32 Horner, not C2's fused w0 and w1);This belongs to the Model M fidelity decision.
Tiny exposures (spec question Q4, pending).
The D3D12 port: kern2.