Repository navigation
Model K: the exposure rule in NumPy, with CPU tests - #194
Merged
Merged
Conversation
…with CPU tests Refs #15. clean/k/reference/exposure.py states the rule in front of the input and output stage references: E_cur is the game's exposure or 1, E_aux the auto-exposure value when it runs (else E_cur), LDR everything 1, e1 = e2 the game's positive finite scale. The stage references are unchanged (docstrings point at the rule). No kernel, runtime or build change. 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 20:34
This was referenced Nov 14, 2026
Merged
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 #15
First piece of bringing Preset K back (#15): the rule that says which exposure value is which, in NumPy, with CPU tests. Nothing else changes.
What changes
clean/k/reference/exposure.py(new): the rule in front of the input and output stage references.E_curis the game's exposure (texture texel or value), 1 if the game passes none.E_auxis the auto-exposure value when auto-exposure runs, otherwiseE_cur. The measured value never takesE_cur's place.E_previs the previous frame'sE_cur(kept by the caller).e1 = e2is the game's exposure scale if it is positive and finite, else 1.instage.py,outstage.py: docstrings only; they point at the rule. The stage arithmetic is unchanged.clean/k/tests/test_k_exposure_rule.py(new): the four HDR cases (neither, auto-exposure only, texture only, both), LDR, the scale's bad values (none, text, zero, negative, infinite, NaN), and that a frame dict that already has the values is left alone.clean/k/README.md: one line in the file table.The whole-frame runner and the HIP runtime keep their present behaviour in this PR. They take the rule in the next piece (HIP side), so that the GPU tests stay consistent with the runtime at every step.
Tested
python -m unittest clean.k.tests.test_k_exposure_rule: 4 tests pass.tools/ci/check_line_endings.py: no problem.public_gates.pyon this branch: the must-pass gates pass; the LOOK counts are the same as for main (1f2a3ac): 42 and 29 leak lines, 418 numbers.Not tested