Skip to content

FIX: CompareArrays all-elements check + GBCD double-precision Pi/180#1607

Open
joeykleingers wants to merge 3 commits intoBlueQuartzSoftware:developfrom
joeykleingers:fix/compare-arrays-check-all-elements
Open

FIX: CompareArrays all-elements check + GBCD double-precision Pi/180#1607
joeykleingers wants to merge 3 commits intoBlueQuartzSoftware:developfrom
joeykleingers:fix/compare-arrays-check-all-elements

Conversation

@joeykleingers
Copy link
Copy Markdown
Contributor

Summary

  • CompareArrays / CompareFloatArraysWithNans in UnitTestCommon.hpp stopped at the first element within EPSILON via a spurious break. Removing it revealed pre-existing exemplar-vs-NX mismatches the helper had been silently hiding (ComputeFeatureFaceMisorientation, ComputeGBCDMetricBased).
  • ComputeGBCDMetricBased root cause: three sites in the algorithm multiplied double-precision resolution and angle values by k_PiOver180F (float). Promoting float→double preserves the quantized float bits rather than recovering true M_PI/180.0, introducing a ~1e-10 deviation from the legacy double-precision SIMPL algorithm. Over ~756k triangles × ~2300 symmetry ops this flipped two near-boundary triangles in/out of the selected set, shifting a handful of distribution bin values by ~3e-2. Switched to k_PiOver180D (double) at all three sites.
  • Exemplar refresh: the stored 6_6_find_gbcd_metric_based.tar.gz was generated by the original float-precision DREAM3D FindGBCDMetricBased and no longer matches the corrected NX output. Published a fresh exemplar compute_gbcd_metric_based.tar.gz to the Data_Archive release (dropped legacy 6_6_ prefix per current naming conventions) and repointed both ComputeGBCDMetricBasedTest and ComputeGBPDMetricBasedTest at the new archive. The legacy 6_6_find_gbcd_metric_based.tar.gz remains in the release for any consumers still referencing it.

Test plan

  • OrientationAnalysis::ComputeGBCDMetricBasedFilter: Valid Filter Execution passes in-core
  • OrientationAnalysis::ComputeGBCDMetricBasedFilter: InValid Filter Execution passes in-core
  • OrientationAnalysis::ComputeGBPDMetricBasedFilter: Valid Filter Execution passes in-core
  • OrientationAnalysis::ComputeGBPDMetricBasedFilter: InValid Filter Execution passes in-core (same archive)
  • Same 4 tests pass in simplnx-ooc-Rel (verified on ooc-filter-optimizations with the two fixes cherry-picked, since this branch's base predates the OOC infrastructure)

Remove erroneous `break` after the first mismatched element in both
CompareArrays and CompareFloatArraysWithNans. The break caused both
functions to stop after finding the first difference that was within
EPSILON, silently skipping all remaining elements. This masked
pre-existing exemplar-vs-NX mismatches in ComputeFeatureFaceMisorientation
and ComputeGBCDMetricBased tests.
Three sites in the algorithm multiplied double-precision resolution and
angle values by k_PiOver180F (a float constant). Float promotion to
double preserves the quantized float bits rather than recovering the
true M_PI/180.0, introducing a ~1e-10 deviation from the legacy
SIMPL algorithm (which uses double k_PiOver180). Over ~756k triangles
times ~2300 symmetry operations the deviation flipped two near-boundary
triangles in/out of the selected set, shifting a handful of
distribution bin values by ~3e-2.

Switch the three multiplications to the existing k_PiOver180D double
constant so the resolution thresholds and fixed-misorientation angle
are computed at full double precision.

Signed-off-by: Joey Kleingers <joey.kleingers@bluequartz.net>
The stored 6_6_find_gbcd_metric_based.tar.gz exemplar was generated by
the original float-precision DREAM3D FindGBCDMetricBased filter and no
longer matches the simplnx algorithm after the double-precision fix
(BUG: Use double-precision Pi/180 in ComputeGBCDMetricBased). Publish
a fresh exemplar from the double-precision legacy pipeline and repoint
the tests at it.

* Rename archive and top-level folder from 6_6_find_gbcd_metric_based
  to compute_gbcd_metric_based (drops the legacy 6_6_ prefix in
  accordance with current archive-naming conventions).
* Drop the 6_6_ prefix from the stored .dat exemplar filenames;
  input .dream3d filename follows the folder name.
* ComputeGBPDMetricBasedTest's InValid section reuses the GBCD archive
  (for crystal-structures and mesh input); update its paths too.
* CMakeLists.txt download_test_data entry bumped to the new archive
  name and SHA512.

Signed-off-by: Joey Kleingers <joey.kleingers@bluequartz.net>
@joeykleingers joeykleingers force-pushed the fix/compare-arrays-check-all-elements branch from 28068e6 to d0d9fe6 Compare April 23, 2026 17:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant