Thanks to visit codestin.com
Credit goes to github.com

Skip to content

CI Fix uninitialised memory at exactly x=0.35 - #34373

Merged
virchan merged 2 commits into
scikit-learn:mainfrom
betatim:fix-empty-use
Jun 25, 2026
Merged

CI Fix uninitialised memory at exactly x=0.35#34373
virchan merged 2 commits into
scikit-learn:mainfrom
betatim:fix-empty-use

Conversation

@betatim

@betatim betatim commented Jun 23, 2026

Copy link
Copy Markdown
Member

This is a very unlikely case but cheap to fix. The point fX == 0.35 isn't covered by any of the assignments. So theoretically you could end up with uninitialised memory.

This is a follow up to #34371. I asked AI to look at all the tests in the project to see if there are any other occurrences of np.empty that should be fixed. It found several uses of np.empty/np.empty_like (about 40) but thinks that this is the only case where the array isn't immediately filled with values.

I didn't check all of the ones it did not change to see if it got all of them right. Given that we don't suffer more flakyness in our tests I think that would be too much effort.

(Could have also changed the condition in the assignments to make a < into a <=)

AI usage disclosure

I used AI assistance for:

  • Code generation (e.g., when writing an implementation or fixing a bug)
  • Research and understanding

This is a very unlikely case but cheap to fix.

@ogrisel ogrisel left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

Comment thread sklearn/gaussian_process/tests/test_gpc.py Outdated
@betatim betatim added Quick Review For PRs that are quick to review Waiting for Second Reviewer First reviewer is done, need a second one! labels Jun 24, 2026

@virchan virchan left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Let's merge this.

@virchan
virchan merged commit 4af1831 into scikit-learn:main Jun 25, 2026
50 of 53 checks passed
@betatim
betatim deleted the fix-empty-use branch June 25, 2026 07:42
prady0t pushed a commit to prady0t/scikit-learn that referenced this pull request Sep 2, 2026
@jeremiedbb jeremiedbb mentioned this pull request Sep 8, 2026
14 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Build / CI module:gaussian_process No Changelog Needed Quick Review For PRs that are quick to review Waiting for Second Reviewer First reviewer is done, need a second one!

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants