Repository navigation
Model L reconstruction: CPU oracle (4 x 4 gather, linear-colour history and fallback, LDR) and the D / render variant rule - #124
Merged
Conversation
…in linear colour, linear-colour fallback, LDR form; the D / render variant rule Refs #89 Signed-off-by: phantoslayer21 <156617979+phantoslayer21@users.noreply.github.com>
phantoslayer21
marked this pull request as ready for review
November 14, 2026 01:47
….1 updated the v1 file in place) Refs #89 Signed-off-by: phantoslayer21 <156617979+phantoslayer21@users.noreply.github.com>
…behaviour (known-answer tests), LDR output filter, history size check; FORMATS points at the oracle 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
#113 and #115 are merged. Against main, this PR changes only:
clean/l/reference/recon.py;table.py,oracle.py;clean/l/tests/test_l_recon.py,test_l_reference.py;test_l_map.py(the map test now finds the map revision by its"preset": "L"key, because revision 1.1 updatedthe v1 file in place, and checks the table's 13 value positions against it instead of skipping).
The CPU oracle of Model L's output reconstruction (stage "post"),
clean/l/reference/recon.py, driven by thestructure table's
reconentry.Model L's reconstruction is Model M's (
clean/reference/post.py) with three changes:then w1 L1 + w2 L2, times the current exposure;
The learned scale comes from the post stage. Everything else is Model M's functions, by import.
Behaviour confirmed by the spec side (for Model L and Model M) and implemented with known-answer tests:
decode passes NaN through. The stored history is h(E(NaN)) = -1.4404296875 per channel in HDR and NaN in LDR; the
display and the reduced code are 0 (also for any 2 x 2 block holding such a pixel). Model M's reference
(
clean/reference/post.py dec) maps NaN to D(1e-4) instead. That reference is not changed here.(
recon.output_filter, Model M's taps).clean/l/FORMATS.mdnow points at the oracle and its pinned behaviour. It also says the kernel summation order(taps, candidates) is not fixed yet: this oracle sums the gather columns first, Model M's rows first, and the
kernel's order will decide.
The table's
reconentry now names the rule as a D / render ratio, with D = ((3 ow + 1) div 2, (3 oh + 1) div 2):float32(D) / float32(render) >= 3.0 on both axes.
table.recon_variantcomputes it. The two variants only tile thework differently and compute the same function, so the oracle has one form.
PROVISIONALis now empty.UNCONFIRMEDkeeps U1 (the encoder halo at tiny render sizes).Tested
Record: CPU only (this PR has no kernel, so there is no GPU part).
python -m unittest discover -s clean/l/tests -t .passes all 45 tests, none skipped, at head de4d346. New in
test_l_recon.py:reduced, display), with and without reset.
display codes 0, reduced 0.
exactly code RN32(1/N) in FP16, at exposure 1 and 5 alike (constants 0x3A001002, 0x3A802008).
Not tested