Repository navigation
Add diagnostic attribute guards and CLI flag - #365
Merged
antond-weta merged 1 commit intoOct 20, 2026
Merged
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #365 +/- ##
==========================================
+ Coverage 91.79% 92.04% +0.24%
==========================================
Files 17 17
Lines 3876 3959 +83
Branches 582 591 +9
==========================================
+ Hits 3558 3644 +86
+ Misses 318 315 -3
Continue to review full report in Codecov by Harness.
🚀 New features to boost your workflow:
|
soswow
approved these changes
Oct 20, 2026
soswow
left a comment
Contributor
There was a problem hiding this comment.
minor things left:
| Stale parameter comment | prepare_transform_spectral still does not document out_found_illuminant. |
|---|---|
| Lens merge untested | The lens tests call the map functions directly, so they never execute the extra_attribs merge. |
| No-op steps | Default soft crop, an identity matrix, and a scale of 1 still write no attribute. That matches the existing skip in process_buffer. |
up to you. LGTM
Add double-application guards to colour transform functions so they cannot be executed twice on the same image. Each function marks its output image buffer with an rta:* attribute on success, and returns false with an error message if the attribute is already present on the source: - apply_matrix -> rta:AppliedColourTransformMatrix - apply_scale -> rta:AppliedScale - apply_crop -> rta:AppliedCrop - apply_vignette_map -> rta:AppliedLensVignetteCorrection - apply_distortion_map -> rta:AppliedLensDistortionCorrection - apply_aberration_map -> rta:AppliedLensChromaticAberrationCorrection Expand remove_diagnostic_attributes to remove all six attributes declared in attributes.h, and add a --keep-diagnostic-attributes CLI flag (linked to ImageConverter::Settings::keep_diagnostic_attributes) that controls whether these attributes are stripped from the output EXR in save_image(). Add Python binding for keep_diagnostic_attributes and regenerate the Python API docs. Add unit tests verifying each guard fails on the second application: test_apply_matrix_twice, test_apply_crop_twice, test_apply_scale_twice, test_remove_diagnostic_attributes, test_apply_vignette_map_twice, test_apply_distortion_map_twice, test_apply_aberration_map_twice. Also fix a pre-existing signature mismatch in prepare_transform_spectral (declaration had 5 params, definition had 6 with out_found_illuminant) and update all test call sites. Assisted-by: nemotron-3.5-super-vl-free Signed-off-by: Anton Dukhovnikov <antond@wetafx.co.nz> Add unit test confirming diagnostic attributes removed in save_image Add test_save_image_removes_diagnostic_attributes which verifies that save_image strips all rta:* diagnostic attributes from the output ImageSpec when keep_diagnostic_attributes is false (the default). The test saves an ImageBuf with all diagnostic attributes set, reads the output EXR back, and asserts none of the diagnostic attributes are present. Assisted-by: nemotron-3.5-super-vl-free Add unit test confirming diagnostic attributes kept in save_image when requested Add test_save_image_keeps_diagnostic_attributes which verifies that save_image preserves all rta:* diagnostic attributes in the output ImageSpec when keep_diagnostic_attributes is set to true. The test saves an ImageBuf with all diagnostic attributes set, reads the output EXR back, and asserts all diagnostic attributes are preserved. Complements test_save_image_removes_diagnostic_attributes which verifies the default behavior (attributes stripped). Assisted-by: nemotron-3.5-super-vl-free
antond-weta
force-pushed
the
diag_attributes
branch
from
October 20, 2026 07:11
fbc8c01 to
4334804
Compare
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.
Add double-application guards to colour transform functions so they cannot be executed twice on the same image. Each function marks its output image buffer with an rta:* attribute on success, and returns false with an error message if the attribute is already present on the source:
Expand remove_diagnostic_attributes to remove all six attributes declared in attributes.h, and add a --keep-diagnostic-attributes CLI flag (linked to ImageConverter::Settings::keep_diagnostic_attributes) that controls whether these attributes are stripped from the output EXR in save_image().
Add Python binding for keep_diagnostic_attributes and regenerate the Python API docs.
Add unit tests verifying each guard fails on the second application: test_apply_matrix_twice, test_apply_crop_twice, test_apply_scale_twice, test_remove_diagnostic_attributes, test_apply_vignette_map_twice, test_apply_distortion_map_twice, test_apply_aberration_map_twice.
Also fix a pre-existing signature mismatch in prepare_transform_spectral (declaration had 5 params, definition had 6 with out_found_illuminant) and update all test call sites.
Assisted-by: nemotron-3.5-super-vl-free
Description
Tests
Checklist:
and if I used AI coding assistants, I have an
Assisted-by: TOOL / MODELline in the pull request description above.
need to update the documentation, for example if this is a bug fix that
doesn't change the API.)
(adding new test cases if necessary).
already run clang-format before submitting, I definitely will look at the CI
test that runs clang-format and fix anything that it highlights as being
nonconforming.