Skip to content

VariationalRegistration: Gaussian3D and NCC3D tests diverge on native macOS ARM64 (re-enable follow-up to #6453) #6459

Closed

Description

@hjmjohnson

Two 3D VariationalRegistration tests — VariationalRegistrationGaussian3DTest and
VariationalRegistrationNCC3DTest — remain disabled after #6453 because their
ITK-proper baselines (generated on Ubuntu x86_64) diverge beyond the comparison
tolerance on the native macOS ARM64 runner. #6453 re-enabled the other 11
tests (7 2D + 4 3D); this issue tracks the remaining two.

Follow-up to #6305 (closed by #6453). The two baselines are already published to
ITKTestingData and pre-staged in main (their .cid files and
content-links.manifest entries landed with #6453), so re-enabling does not need
a new upload for a tolerance-based fix.

Why only these two — the regularizer signal

Both disabled tests are the only two that use the Gaussian / Thirion smoothing
regularizer
:

  • VariationalRegistrationGaussian3DTest -r 0 -v 1.5 -u 0
  • VariationalRegistrationNCC3DTest -f 2 -t 40 -r 0 -v 1 -u 0 -q 2 -p 1

Every passing 3D test uses diffusive / elastic / diffeomorphic regularization
(-r 1/-r 2). The recursive Gaussian smoothing of the deformation field
accumulates the most floating-point drift across the 3-level 3D pyramid, which is
why these two diverge most across platforms. #6305 measured the largest field
divergence for exactly these two (ImageError 23657 / 35693; max pixel Δ 149 / 136).

Established facts (from #6305)
  • Deterministic per platform — identical ImageError on repeated runs; not a
    threading race.
  • Not FFT-related — FFTW is off by default; FFT-gated tests are separately
    disabled.
  • Cross-platform FP divergence, not a crash or wrong algorithm — stable
    accumulated numeric difference between the x86_64 baseline-generation host and
    macOS ARM64 (NEON / Apple clang).
  • Regenerating a single baseline on macOS only relocates the failure to the Linux
    and Windows lanes (the pr-fixture-and-expected-values anti-pattern), so
    single-baseline regeneration is ruled out.
Resolution plan
  1. Measure the macOS ARM64 delta against the committed x86_64 baseline: build
    VariationalRegistration, run both tests, capture the test driver's
    NumberOfPixelsWithDifferences and max intensity Δ. This is the discriminator
    and must run on Apple-silicon hardware (the divergence does not reproduce on
    Linux).
  2. Pick by measured magnitude:
    • Per-test relaxed tolerance (preferred if bounded): give these two their
      own larger --compareNumberOfPixelsTolerance (and/or intensity) instead of
      the shared VR_*_TOL; radius/intensity still bound how far each pixel
      may differ. Single baseline, one-line re-enable.
    • Multi-baseline (if the ARM64 field is a genuinely different-but-valid
      convergence): add …Gaussian3DTest.1.nii.gz / …NCC3DTest.1.nii.gz macOS
      baselines and let --compare numbered-baseline search pick the closest.
  3. Re-enable the two test3d(...) lines, re-point the in-code comments from the
    now-closed VariationalRegistration: inherited baselines incompatible with ITK-proper (13 tests disabled pending cross-platform review) #6305 to this issue, and verify green specifically on the
    macOS Pixi-Cxx lane that originally caught the divergence.

Activity

  1. added a commit that references this issue on Jun 17, 2026
    57b7c6e
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions