Skip to content

Adsk Contrb - Fix pass-thru exponent composition issue#2154

Merged
doug-walker merged 6 commits into
AcademySoftwareFoundation:mainfrom
autodesk-forks:walker/gamma-comp-fix
May 18, 2025
Merged

Adsk Contrb - Fix pass-thru exponent composition issue#2154
doug-walker merged 6 commits into
AcademySoftwareFoundation:mainfrom
autodesk-forks:walker/gamma-comp-fix

Conversation

@doug-walker
Copy link
Copy Markdown
Collaborator

Fix a problem where consecutive ExponentTransforms with a negative value handling style of NEGATIVE_PASS_THRU were not combined correctly during optimization.

Added several additional unit tests.

The work-around for this is to use OPTIMIZATION_NONE or set OPTIMIZATION_COMP_GAMMA to false.

Signed-off-by: Doug Walker <doug.walker@autodesk.com>
@doug-walker doug-walker requested review from cozdas and remia May 3, 2025 23:55
@doug-walker doug-walker changed the title Fix pass-thru exponent composition issue Adsk Contrb - Fix pass-thru exponent composition issue May 3, 2025
@doug-walker doug-walker added the Bug Unwanted or incorrect behavior in currently available functionality. label May 4, 2025
Signed-off-by: Doug Walker <doug.walker@autodesk.com>
Signed-off-by: Doug Walker <doug.walker@autodesk.com>
@doug-walker doug-walker requested a review from Copilot May 16, 2025 00:05
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR fixes an issue with the pass‐thru exponent composition, ensuring that consecutive ExponentTransforms with a NEGATIVE_PASS_THRU style are correctly composed. Key changes include:

  • Updating test assertions to pass line numbers using new macros (e.g. OCIO_CHECK_EQUAL_FROM).
  • Adjusting the composition logic in GammaOpData.cpp to check for BASIC_PASS_THRU_REV instead of BASIC_PASS_THRU_FWD.
  • Adding additional unit tests (including gamma_comp_test2) and a minor update in the CI workflow to disable docs build.

Reviewed Changes

Copilot reviewed 4 out of 5 changed files in this pull request and generated no comments.

File Description
tests/cpu/ops/gamma/GammaOpData_tests.cpp Updated test macros with line info and added new test cases for negative style handling.
tests/cpu/OpOptimizers_tests.cpp Added a new test (gamma_comp_test2) to verify optimized gamma behavior and ensured proper exception handling.
src/OpenColorIO/ops/gamma/GammaOpData.cpp Fixed the condition to properly check for PASS_THRU_REV, aligning the logic with the intended behavior.
.github/workflows/ci_workflow.yml Disabled documentation build in CI; ensure this decision is intentional.
Files not reviewed (1)
  • tests/data/files/gamma_comp_test2.ctf: Language not supported
Comments suppressed due to low confidence (3)

src/OpenColorIO/ops/gamma/GammaOpData.cpp:734

  • Ensure that switching from BASIC_PASS_THRU_FWD to BASIC_PASS_THRU_REV is validated by unit tests covering all relevant negative style scenarios.
if (styleB == BASIC_REV || styleB == BASIC_MIRROR_REV || styleB == BASIC_PASS_THRU_REV)

src/OpenColorIO/ops/gamma/GammaOpData.cpp:734

  • Double-check that both conditions for handling negative pass‐thru styles are consistent across inputs to avoid unintended outcomes.
if (styleB == BASIC_REV || styleB == BASIC_MIRROR_REV || styleB == BASIC_PASS_THRU_REV)

.github/workflows/ci_workflow.yml:492

  • Confirm that disabling the documentation build is intentional and consider adding a comment to explain this decision within the CI configuration.
build-docs: 'OFF'

Signed-off-by: Doug Walker <doug.walker@autodesk.com>
Signed-off-by: Doug Walker <doug.walker@autodesk.com>
@doug-walker doug-walker merged commit ac94d7b into AcademySoftwareFoundation:main May 18, 2025
25 checks passed
@doug-walker doug-walker deleted the walker/gamma-comp-fix branch May 18, 2025 05:36
michaelHADSK pushed a commit to autodesk-forks/OpenColorIO that referenced this pull request Jul 24, 2025
…reFoundation#2154)

* Fix gamma composition issue

Signed-off-by: Doug Walker <doug.walker@autodesk.com>

* Adjust docs build settings to fix CI

Signed-off-by: Doug Walker <doug.walker@autodesk.com>

* Adjust docs build settings to fix CI

Signed-off-by: Doug Walker <doug.walker@autodesk.com>

* Revert CI change

Signed-off-by: Doug Walker <doug.walker@autodesk.com>

* Minor comment tweak

Signed-off-by: Doug Walker <doug.walker@autodesk.com>

---------

Signed-off-by: Doug Walker <doug.walker@autodesk.com>
michaelHADSK pushed a commit to autodesk-forks/OpenColorIO that referenced this pull request Jul 24, 2025
…reFoundation#2154)

* Fix gamma composition issue

Signed-off-by: Doug Walker <doug.walker@autodesk.com>

* Adjust docs build settings to fix CI

Signed-off-by: Doug Walker <doug.walker@autodesk.com>

* Adjust docs build settings to fix CI

Signed-off-by: Doug Walker <doug.walker@autodesk.com>

* Revert CI change

Signed-off-by: Doug Walker <doug.walker@autodesk.com>

* Minor comment tweak

Signed-off-by: Doug Walker <doug.walker@autodesk.com>

---------

Signed-off-by: Doug Walker <doug.walker@autodesk.com>
Signed-off-by: Michael Horsch <michael.horsch@autodesk.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bug Unwanted or incorrect behavior in currently available functionality.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants