InsightSoftwareConsortium / ITK

Insight Toolkit (ITK) -- Official Repository. ITK builds on a proven, spatially-oriented architecture for processing, segmentation, and registration of scientific images in two, three, or more dimensions.
https://itk.org
Apache License 2.0
1.4k stars 662 forks source link

itkSLICImageFilterTest1 fails on macOS ARM #4514

Closed thewtex closed 5 months ago

thewtex commented 5 months ago

With current ITK Git master, itkSLICImageFilterTest fails on macOS ARM.

2803:   AverageResidual: 1.79769e+308
2803: Name of Class = SLICImageFilter
2803: Iterations #: 0 Average Residual: 0.296951
2803: Iterations #: 1 Average Residual: 0.123393
2803: Iterations #: 2 Average Residual: 0.0615196
2803: Iterations #: 3 Average Residual: 0.0413902
2803: Iterations #: 4 Average Residual: 0.0348925
2803: Iterations #: 5 Average Residual: 0.0359442
2803: Iterations #: 6 Average Residual: 0.030454
2803: Iterations #: 7 Average Residual: 0.026951
2803: Iterations #: 8 Average Residual: 0.0222663
2803: Iterations #: 9 Average Residual: 0.0223891
2803: Test finished.
2803: <DartMeasurement name="ImageError itkSLICImageFilterTest1.1.png" type="numeric/double">187</DartMeasurement>
2803: <DartMeasurement name="ImageError itkSLICImageFilterTest1.png" type="numeric/double">67</DartMeasurement>
2803: <DartMeasurement name="ImageError" type="numeric/double">67</DartMeasurement>
2803: <DartMeasurement name="ImageError Minimum" type="numeric/double">10</DartMeasurement>
2803: <DartMeasurement name="ImageError Maximum" type="numeric/double">22</DartMeasurement>
2803: <DartMeasurement name="ImageError Mean" type="numeric/double">11.9552</DartMeasurement>
2803: <DartMeasurementFile name="DifferenceImage" type="image/png">/Users/matt.mccormick/bin/ITK-GCC-Release/Testing/Temporary/ITKSuperPixel/itkSLICImageFilterTestOutput1.png.diff.png</DartMeasurementFile>
2803: <DartMeasurementFile name="BaselineImage" type="image/png">/Users/matt.mccormick/bin/ITK-GCC-Release/Testing/Temporary/ITKSuperPixel/itkSLICImageFilterTestOutput1.png.base.png</DartMeasurementFile>
2803: <DartMeasurementFile name="TestImage" type="image/png">/Users/matt.mccormick/bin/ITK-GCC-Release/Testing/Temporary/ITKSuperPixel/itkSLICImageFilterTestOutput1.png.test.png</DartMeasurementFile>
2803: <DartMeasurement name="BaselineImageName" type="text/string">itkSLICImageFilterTest1.png</DartMeasurement>
1/1 Test #2803: itkSLICImageFilterTest1 ..........***Failed    0.04 sec
❯ c++ --version
Apple clang version 15.0.0 (clang-1500.3.9.4)
Target: arm64-apple-darwin23.3.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin

Diff image: itkSLICImageFilterTestOutput1 png diff

@blowekamp any ideas?

blowekamp commented 5 months ago

The compared image is of the resulting labels, so that magnitude of the difference is not significant. The number of pixel differences is set to 25. The difference looks like mostly minor boundary differences and not significant. Perhaps due to accumulation error, in an iterative algorithm?

image

I can't seem to reproduce the issue with clang 14.0.0 and I am unable to upgrade at this time. Perhaps this issue is just with clang 15.0

There is already a second base committed of intel 32-bit instructions (957f35d2ecf93c0e58b86011fcea784b009ff104). Perhaps the appropriate solution is to add another baseline?

thewtex commented 5 months ago

Thanks for the feedback. Yes, agreed, @blowekamp . New baseline added in #4515.