Skip to content

Opencl diff part4#20709

Open
jenshannoschwalm wants to merge 2 commits intodarktable-org:masterfrom
jenshannoschwalm:opencl_diff_part4
Open

Opencl diff part4#20709
jenshannoschwalm wants to merge 2 commits intodarktable-org:masterfrom
jenshannoschwalm:opencl_diff_part4

Conversation

@jenshannoschwalm
Copy link
Copy Markdown
Collaborator

Fix highlights clip mode if no temperature data is provided

Got aware of this while testing some integration tests, also some simplifications.

Graduated ND improvements & maintenance

  1. Make sure we use predefined values for M_LN2f if available
  2. Corrected CLARG() for colors
  3. The "precise" algorithm (instead of quite good the approximation) has slightly less banding artifacts, so
    • The OpenCL implementation uses precise algorithm and possibly looses some precision in optimizing code as using the native variant.
    • The CPU code chooses the algorithm depending on -ffast-math switch tested via FAST_MATH_
  4. Avoid a few double->float compiler conversions.

Testing 0012-gdnd-45 via --dump-diff-pipe shows some remaining diffs in this module, diffs are ~1e-6, overall pixel diffs seem to be unrelated to current code.


@ralfbrown what do you think of such switches?

Tested complete integration suite without regressions.

@TurboGit while analysing big-cpu/gpu diff counts i checked:

0028-highpass-overlay
CPU & GPU version differ by 587539 pixels
commit 8bd644d introduced a fast box-blur-like OpenCL algorithm so diff results are expected as we don't do a box blur but a gaussian weighted approx in a single run. We have a box blur in bloom - also failing and needing analysis - so i will check that and possibly provide a fix for both.

0043-dithering-fs
CPU & GPU version differ by 820153 pixels
difference is due to tea states so expected and not a problem at all, every start is with different random data. Not sure if this is a worthwhile test at all.

0045-vignetting
CPU & GPU version differ by 719921 pixels
difference is due to tea states initialized differently so GPU/CPU diffs are expected. CPU always starts with same tea state so CPU vs ref test is safe.

1. Make sure we use predefined values for M_LN2f if available
2. Corrected CLARG() for colors
3. The "precise" algorithm (instead of quite good the approximation) has slightly less
   banding artifacts, so
   - The OpenCL implementation uses precise algorithm and possibly looses some precision
     in optimizing code as using the native variant.
   - The CPU code chooses the algorithm depending on -ffast-math switch tested via _FAST_MATH__
4. Avoid a few double->float compiler conversions.

Testing 0012-gdnd-45 via --dump-diff-pipe shows some remaining diffs in this module, diffs are ~1e-6,
overall pixel diffs seem to be unrelated to current code.
@jenshannoschwalm jenshannoschwalm added this to the 5.6 milestone Mar 30, 2026
@jenshannoschwalm jenshannoschwalm added bugfix pull request fixing a bug scope: image processing correcting pixels OpenCL Related to darktable OpenCL code labels Mar 30, 2026
@ralfbrown
Copy link
Copy Markdown
Collaborator

Looks fine to me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugfix pull request fixing a bug OpenCL Related to darktable OpenCL code scope: image processing correcting pixels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants