Skip to content

Investigate test_precomputed_nearest_neighbors_filtering[60] failure on CI - #31262

Merged
adrinjalali merged 5 commits into
scikit-learn:mainfrom
ogrisel:unstable-ci-issue-31256
Apr 30, 2025
Merged

adrinjalali merged 5 commits into
scikit-learn:mainfrom
ogrisel:unstable-ci-issue-31256

Conversation

@ogrisel

@ogrisel ogrisel commented Apr 28, 2025

Copy link
Copy Markdown
Member

Trying to reproduce #31256 on the CI.

test_precomputed_nearest_neighbors_filtering
@ogrisel ogrisel added Build / CI module:test-suite everything related to our tests and removed Build / CI labels Apr 28, 2025
@github-actions

github-actions Bot commented Apr 28, 2025 •

Copy link
Copy Markdown

✔️ Linting Passed

All linting checks passed. Your pull request is in excellent shape! ☀️

Generated for commit: d444653. Link to the linter CI: here

@ogrisel

ogrisel commented Apr 28, 2025

Copy link
Copy Markdown
Member Author

Ok, so this test is definitely platform sensitive.

@ogrisel

ogrisel commented Apr 28, 2025

Copy link
Copy Markdown
Member Author

I can also reproduce the failure on arm64 macOS with

SKLEARN_TESTS_GLOBAL_RANDOM_SEED="60" pytest -k test_precomputed_nearest_neighbors_filtering sklearn/cluster/tests/test_spectral.py

if I use openblas instead of accelerate in my dev env:

mamba install "libblas=*=*openblas"

ogrisel added 2 commits April 28, 2025 11:02
…zure parallel] [all random seeds]

test_precomputed_nearest_neighbors_filtering
…graph [azure parallel] [all random seeds]

test_precomputed_nearest_neighbors_filtering
@ogrisel
ogrisel marked this pull request as ready for review April 28, 2025 10:02
@ogrisel

ogrisel commented Apr 28, 2025

Copy link
Copy Markdown
Member Author

I am not 100% sure, but I think the previous way the test was written could lead to tied neighbors. Adding a 3rd data dimension and using the continuous valued distance graph instead of the discretized connectivity graph reduces this likelihood and makes the tests robust, even with the original small dataset size.

@ogrisel ogrisel added the Quick Review For PRs that are quick to review label Apr 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Build / CI module:test-suite everything related to our tests No Changelog Needed Quick Review For PRs that are quick to review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants