Repository navigation
Model L: LDR reconstruction (HIP + D3D12) on every route; no Model M post route for Model L - #176
Merged
Merged
Conversation
…post route for Model L - l_post.hip: l_post_recon_ldr / l_post_recon_p12_ldr, the LDR form of Model L's reconstruction (spec preset L part 3 item 6, Q1, Q2): identity transfer (colour feature h(colour), no decode of the candidates or of C), no exposure, full history h(H^), display image h(code RN32(1 / N)) of the 11 / 11 / 10-bit codes floor(clamp(fused(O^ N + 1/2), 0, N)), reduced codes rint(clamp(mean, 0, 1) 1023); l_post_filter_ldr / l_post_filter_ldr_h, the LDR output stage (Model M's 5-tap filter rows and passes, no clamp to [1e-4, 3], no decode, no exposure). The HDR kernels' ISA is unchanged. - D3D12 ports, byte for byte: l_post.hlsl (LP_LDR), post_filter.hlsl (WG_FILTER_LDR: l_post_filter_ldr and the direct form l_post_filter_direct_ldr); the HDR and Model M DXILs are unchanged. kernel_sets.json regenerated (Model L +4). - runtime.cpp: Model L reconstructs with its own kernels only, HDR and LDR, on HIP and native D3D12 (staged, direct and fallback routes). Model M's post route for Model L is gone: l_post=m is refused, l_post=own is a no-op, and where Model L's route cannot run (l_own_post_fits: the default pack12 post route and its ports, HDR or LDR) creation is refused with the reason. HIP no longer refuses LDR for Model L. - Checks: l_post_check.py --ldr, l_frame_check.py --ldr (and NaN-aware FP16 comparison, LDR filter tolerance), l_d3d12_ops_check.py (LDR kernels and filter), l_d3d12_fallback_check.py --ldr, post_tf_d3d12_check.py --store --ldr; test_l_runtime_frame: the own route in HDR and LDR and test_no_model_m_post_route. Record: clean/l/records/l_post_ldr_record.json. Signed-off-by: phantoslayer21 <156617979+phantoslayer21@users.noreply.github.com>
Signed-off-by: phantoslayer21 <156617979+phantoslayer21@users.noreply.github.com>
Signed-off-by: phantoslayer21 <156617979+phantoslayer21@users.noreply.github.com>
…s not implement (review P1); per-kernel negative controls - runtime.cpp: with LDR colour Model L runs only l_post_filter_ldr (the default filter's geometry, 3 x f32; its direct form on native D3D12; l_post_filter_ldr_h for the HIP output copy). Another filter kernel or geometry, an RGBA16F filter output or output_filter=quality5 / quality9 / original is now refused at create with the reason (l_ldr_filter_unfit), on every backend and for the output copy too, instead of launching the LDR kernel with the selected filter's grid or output format. - test_l_runtime_frame: test_ldr_filter_selection (an alternate geometry, _o16 and output_filter refused in LDR; HDR keeps the filter kernels; the default LDR filter launch on the default grid). - l_d3d12_ops_check.py: a negative control per post kernel (each LDR form its own), all must be caught. - Record updated (clean/l/records/l_post_ldr_record.json). Signed-off-by: phantoslayer21 <156617979+phantoslayer21@users.noreply.github.com>
Signed-off-by: phantoslayer21 <156617979+phantoslayer21@users.noreply.github.com>
Signed-off-by: phantoslayer21 <156617979+phantoslayer21@users.noreply.github.com>
phantoslayer21
added a commit
that referenced
this pull request
Nov 14, 2026
Every game tried (Cyberpunk 2077, RESIDENT EVIL requiem with HDR off, LEGO Batman, Ratchet & Clank: Rift Apart) hands the upscaler HDR colour, so the SDR path (#176) has offline records only; the Known issues line says so plainly. 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.
Refs #89
Model L's reconstruction in LDR, HIP and D3D12, on every route the HDR own post has. Model M's post route for Model
L is removed: the only fallback is a refusal with the reason.
What changes
HIP (
clean/l/kernels/l_post.hip)l_post_recon_ldr/l_post_recon_p12_ldr: the LDR form, following spec preset L part 3 item 6, Q2 and Q1's LDRcolumn:
0, N)), stored h(code RN32(1/N)), with N = 2047, 2047, 1023 and NaN giving code 0;
l_post_filter_ldr(FP32) andl_post_filter_ldr_h(RGBA16F rows, pi folded in): the LDR output stage (Q2). It isModel M's 5-tap filter rows and passes (
post.hip'sfilter_row_c1,lz5, unchanged) without the [1e-4, 3] clamp,the decode and the exposure.
l_post_reconandl_post_recon_p12are instruction-identical to main's (onlyend-of-code padding moves).
post.hipis untouched.D3D12, byte for byte
l_post.hlsl(LP_LDR):l_post_recon_ldr,l_post_recon_p12_ldr.post_filter.hlsl(WG_FILTER_LDR):l_post_filter_ldrand the direct forml_post_filter_direct_ldr.v_fma_mixlo_f16). The spec rounds twice (f32 product, then FP16).For every code 0 … N the two give the same FP16 value (checked for all 3072 codes), so the port may use either.
l_post_recon,l_post_recon_p12,w64/post_filter_c1_s4,l_post_filter_direct) and Model M'sDXILs are unchanged.
kernel_sets.jsonregenerated: Model L +4 kernels, Model M unchanged.Runtime (
clean/runtime/runtime.cpp)route and the fallback frames (
l_coef+l_post_recon[_ldr]).l_post_filter_ldr_h.l_post_filter_ldris the default filter'sgeometry (40 columns x 4 row pairs, 3 x f32 RGB),
l_post_filter_ldr_hits RGBA16F rows for the output copy.Any other selection is refused at create, on every backend and for the output copy too (
l_ldr_filter_unfit):another filter kernel or geometry (
WG_FILTER_KERNEL/filter_kernel), an RGBA16F filter output (_o16), oroutput_filter=quality5/quality9/original. The error line names the selection and why: "Model L, LDRcolour: its output stage is l_post_filter_ldr (the default filter's geometry, 40 columns x 4 row pairs, 3 x f32 RGB;
RGBA16F rows for the output copy); the selected filter (...) has no LDR form".
l_post=mis refused: "Model L has no Model M post route (its reconstruction is l_post_recon[_ldr] only)".l_post=ownis kept as a no-op (existing scripts pass it).l_post=mis not kept as a test switch:no check needs it. The old A/B record stays in
clean/l/records/l_default_post_real_weights.json, andl_default_post_check.pystill judges an old A record if one is present.l_own_post_fitsrule, LDR included:p12, thepost_recon2_r_band_p12/post_filter_c1_s4_bandroute, and no RGBA16F filter output.
l_post_recon_p12,l_post_recon,l_coef,w64/post_filter_c1_s4;l_post_recon_p12_ldr,l_post_recon_ldr,l_coef,l_post_filter_ldr;l_direct_colorandl_post_filter_direct[_ldr].test_l_runtime_frame.D3D12.test_no_model_m_post_route.reconstruction and no Model M post kernel (
post_recon*,post_tf*,post_fused*,post_prep,pmo/*,*_band).l_post=mis refused.test_l_runtime_frame.D3D12.test_ldr_filter_selection.post_filter(128 columns, S=8),post_filter_c1_s16andpost_filter_c1_s4_o16andoutput_filter=quality5are each refused with the exact error line; in HDR the same filter kernels still create.quality9is refused, and so is native D3D12 with a non-default selection.l_post_filter_ldron the kernel's own grid (cdiv(w,40) xcdiv(cdiv(h,2),8), block 64) with the display and output arguments.
test_own_posttraces the own route's arguments and roles in HDR and LDR, and the D3D12 frame checks assertl_post_recon_p12right after the coefficient store.Checks (extended):
l_post_check.py --ldr;l_frame_check.py --ldr, with an FP16 comparison where a non-finite value counts as agreeing only where thereference holds the same one, and an absolute tolerance for the LDR filter;
l_d3d12_ops_check.py, with the LDR kernels and filter;l_d3d12_fallback_check.py --ldr;post_tf_d3d12_check.py --store --ldr.Records (GPU, gfx1201;
clean/l/records/l_post_ldr_record.json, counts and digests only)HIP LDR form against Model L's LDR oracle
l_post_check.py --ldr --seeds 6, synthetic): 60 of 60 cases pass.candidate-1 history.
d3c04019…ad806, map58e6d0e7…e857; syntheticframes, LDR colour;
l_frame_check.py --ldr): Model L passes every stage on 11 of 11 frames.(0.0034 %).
D3D12 byte-identical to HIP (raw bytes, sentinels HIP 0xA5 / D3D12 0x5A, 64 slack bytes)
l_d3d12_ops_check.py --seeds 6)l_post_recon_ldr72/72,l_post_recon_p12_ldr72/72,l_post_filter_ldr30/30, HDRl_post_recon/_p1272/72 each; p12 = base on HIP 72/72 (LDR and HDR); Model M controlswin_block_c96_nc36/36; one half-grid negative control per kernel, all caught:l_post_recon_ldr8509 bytes differ,l_post_recon_p12_ldr8509,l_post_filter_ldr20461, HDRl_post_recon/_p128498 eachl_post_recon_ldr); negative controls 4/4; Model M 11/11--ldr --seeds 2)l_coef10/10,l_post_recon_ldr10/10,l_post_filter_ldr10/10; Model M control 12/12; negative control caught--store --ldr)native_direct_testmatrix)l_direct_color,l_post_recon_p12_ldr,l_post_filter_direct_ldr(staged reference:l_post_filter_ldr); HDR: PASS 96Model M unchanged: its fused posts and
swin_block_c96_ncrebuilt from this tree, 16 of 16 DXILs byte-identical tomain's.
CPU tests:
test_l_runtime_frame21 OK;test_runtime_frame_trace+test_kernel_sets10 OK;test_l_recon15 OK.Merged main (#153, #155, #156, #158, #172; it changes Swin D3D12 kernels and
device.cpp): on the merged tree, afull D3D12 rebuild (68 kernels) and the runtime, real weights, both colour modes:
28 outputs, 0 differing, negative controls caught; Model M 11 of 11.
Review fix (P1) re-run on the fixed runtime, real weights, LDR, default frames: HIP against the LDR reference
passes (L and M; history 0, display 6 of 641520; default kernels equal the stages on 11 of 11); D3D12 against HIP 11 of
11 identical, 28 outputs, 0 differing, negative controls 4 of 4; Model M 11 of 11. The kernel ops check above was re-run
with the per-kernel negative controls. Merged main again (#43, #177, #178, #179; no runtime, Model L or D3D12 files):
CPU tests above pass on the merged tree.
For the spec side (flag, no change made)
to 0.
Tested / Not tested
l_post_filter_ldr_h) is thereference of the direct-store check above (its RGBA16F rows equal the D3D12 direct texture, 20/20); the HIP runtime's
output-copy route itself runs only in the CPU trace.