Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Multithreaded ANTs registration reproducibility in Phase 2E

Status

This note records the root cause of a failed Cy-ExM Phase 2E scientific-parity check. It is characterization evidence, not a claim that multithreaded ANTs registration is defective or that a production registration should use one native thread.

Observed failure

The Phase 2E acceptance harness ran the same scientific plan through the SLURM and sequential executors with eight ITK threads and eight BLAS-family threads. Both workflows completed, used the same inputs and scientific fingerprint, and produced valid artifacts with matching geometry. The final voxelwise comparison nevertheless failed at rtol=1e-4 and atol=1e-5:

This was not isolated to the sequential-versus-SLURM pair. Repeated eight-thread SLURM runs of the same inputs also produced different affine parameters and output arrays. Pairwise round-2 registered-image comparisons between the available SLURM runs differed at approximately 26.8 million to 31.2 million voxels, with mean absolute intensity differences of approximately 1.6 to 2.3 intensity units.

Root cause experiment

ANTs’ Mattes affine metric uses random spatial sampling when aff_random_sampling_rate is less than one. Cy-ExM’s accepted high-accuracy TRSAA policy uses this sampling behavior. Floating-point reductions performed by multiple native threads can also depend on execution order.

A bounded synthetic TRSAA experiment separated random seeding from native-thread count:

Native ITK/BLAS threadsANTs seedRepeated affine parameters
8unsetdifferent
8fixeddifferent
1fixedexactly identical

Thus a fixed ANTs seed alone did not make the eight-thread registration exactly repeatable. A fixed seed combined with one native thread did. This agrees with the reproducibility constraint exposed by ANTSpyX’s deterministic configuration, which sets the ITK thread count to one.

Scientific interpretation

The failed check conflated two different questions:

  1. Executor parity: do sequential and SLURM execution preserve the same plan, inputs, geometry, registration policy, artifact semantics, and scientific quality?

  2. Optimizer repeatability: do two independent multithreaded stochastic registrations produce numerically identical transforms and voxels?

The second property is not guaranteed by the configured ANTs optimization. It is therefore not a valid proxy for the first.

The independently estimated results remained close in their scientific endpoint metrics. Across the available eight-thread and sequential runs, nonlinear correlation varied by less than 0.004 for each accepted moving round. The failed voxelwise threshold was consequently much stricter than the natural run-to-run variation of the optimizer and did not indicate a loss of registration quality.

Acceptance consequence

Phase 2E will use two complementary gates:

Neither gate silently relaxes scientific behavior. The first tests the actual parallel operating configuration without pretending it is deterministic; the second retains a strict numerical executor check under controlled deterministic conditions.

Limitations

The 0.01 metric bound is an acceptance threshold for the approved Phase 2E dataset, not a universal registration-quality threshold. It is deliberately wider than the observed less-than-0.004 run-to-run range and must be revisited for materially different acceptance data or metrics. Spatially resolved residuals, deformation regularity, and chunk seams remain separate scientific characterization targets.