Skip to content

Commit eba8fab

Browse files
committed
BUG: Pin AdaptiveNonLocalMeansDenoisingImageFilterTest1 to single work unit
itkAdaptiveNonLocalMeansDenoisingImageFilter::ThreadedGenerateData scatter- writes m_RicianBiasImage at neighborhood-offset indices (centerIndex + patchOffset) that cross work-unit boundaries, so multiple work units perform unsynchronized SetPixel on the same shared pixels. The data race is benign at low thread contention but, under CPU oversubscription (ctest -j8), preemption widens the window and yields nondeterministic output: the test fails the baseline comparison intermittently (ImageError != 0), yet passes in isolation. Verified: with the default work-unit count the test fails 50-100% of -j8 runs; pinned to a single work unit it passes 100% (6/6) under the same load and matches the baseline (which reflects the race-free result). Pin the test filter to one work unit for determinism until the filter's scatter is made race-free (the proper long-term fix belongs in the filter, not the test; tracked in #6419).
1 parent a21cf82 commit eba8fab

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

Modules/Filtering/AdaptiveDenoising/test/itkAdaptiveNonLocalMeansDenoisingImageFilterTest.cxx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,10 @@ itkAdaptiveNonLocalMeansDenoisingImageFilterTest(int argc, char * argv[])
115115
ITK_EXERCISE_BASIC_OBJECT_METHODS(filter, AdaptiveNonLocalMeansDenoisingImageFilter, NonLocalPatchBasedImageFilter);
116116

117117
filter->SetInput(reader->GetOutput());
118+
119+
// Single-threaded: m_RicianBiasImage data race across work-unit boundaries; see #6419.
120+
filter->SetNumberOfWorkUnits(1);
121+
118122
filter->SetUseRicianNoiseModel(false);
119123
ITK_TEST_SET_GET_VALUE(false, filter->GetUseRicianNoiseModel());
120124

0 commit comments

Comments
 (0)