#1109957 skimage: test_reproducibility fails with scipy 1.16 on armel

#1109957#5
Date:
2025-07-27 08:55:27 UTC
From:
To:
scipy 1.16 has been uploaded to experimental.
skimage is failing tests with it on armel.
armhf and i386 are passing.

2947s FAILED ../../../../usr/lib/python3/dist-packages/skimage/graph/tests/test_rag.py::test_reproducibility
2947s = 1 failed, 8752 passed, 127 skipped, 91 xfailed, 30 xpassed, 282 warnings in 2818.88s (0:46:58) =

2947s _____________________________ test_reproducibility _____________________________
2947s
2947s     def test_reproducibility():
2947s         """ensure cut_normalized returns the same output for the same input,
2947s         when specifying random seed
2947s         """
2947s         img = data.coffee()
2947s         labels1 = segmentation.slic(img, compactness=30, n_segments=400, start_label=0)
2947s         g = graph.rag_mean_color(img, labels1, mode='similarity')
2947s         results = [None] * 4
2947s         for i in range(len(results)):
2947s             results[i] = graph.cut_normalized(
2947s                 labels1, g, in_place=False, thresh=1e-3, rng=1234
2947s             )
2947s         graph.cut_normalized(labels1, g, in_place=False, thresh=1e-3, rng=1234)
2947s
2947s         for i in range(len(results) - 1):
2947s >           assert_array_equal(results[i], results[i + 1])
2947s E           AssertionError:
2947s E           Arrays are not equal
2947s E
2947s E           Mismatched elements: 616 / 240000 (0.257%)
2947s E           Max absolute difference among violations: 22
2947s E           Max relative difference among violations: 0.16666667
2947s E            ACTUAL: array([[  0,   0,   0, ...,  11,  11,  11],
2947s E                  [  0,   0,   0, ...,  11,  11,  11],
2947s E                  [  0,   0,   0, ...,  11,  11,  11],...
2947s E            DESIRED: array([[  0,   0,   0, ...,  11,  11,  11],
2947s E                  [  0,   0,   0, ...,  11,  11,  11],
2947s E                  [  0,   0,   0, ...,  11,  11,  11],...
2947s
2947s /usr/lib/python3/dist-packages/skimage/graph/tests/test_rag.py:224: AssertionError

On armhf and i386 the test is "deselected" yet runs and passes.
It is also "deselected" on armel, yet running and failing.

I'm not familiar with the "deselect" option. It doesn't seem to be
working as intended.  Should -k "not test_reproducibility" be used
instead?

This bug will become RC serious later, once scipy 1.16 is uploaded to
unstable.

#1109957#10
Date:
2025-07-27 10:40:50 UTC
From:
To:
This is a known issue due to ARPACK introducing randomness that we cannot control. SciPy just finished a re-implementation that addresses the issue, but it will only be available with their next release. The randomness impacts segmentation results, but only for certain corner cases. The test should probably be marked as xfail for now.

Best regards,
Stéfan