Skip to content

Conversation

@jorenham
Copy link
Member

@jorenham jorenham commented Dec 22, 2025

The removal of this unused SeedlessSequence declaration (in #30164) broke every library that uses the numpy.random Cython API. Specifically, the wheels that were built against numpy<2.4.0. See scipy/scipy#24215 for the full discussion.

@jorenham jorenham added Priority: high High priority, also add milestones for urgent issues component: numpy.random 09 - Backport-Candidate PRs tagged should be backported 34 - Reversion Reversion of previous commit or merge labels Dec 22, 2025
@jorenham jorenham added this to the 2.4.1 Release milestone Dec 22, 2025
@jorenham jorenham requested review from charris and rgommers December 22, 2025 11:45
Copy link
Member

@rgommers rgommers left a comment

Choose a reason for hiding this comment

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

Confirmed that this fixes the problem for SciPy.

@bashtage
Copy link
Contributor

Also breaks randomgen. I don't think NumPy will ever directly use SeedlessSequence, but it was written with the purpose it is shows up downstream.

@seberg
Copy link
Member

seberg commented Dec 22, 2025

Ack, that is too bad that Cython checks for it even though it never exists.

Let's probably just do this. I think the slightly better fix will be to just move this to the .pyx file. That way, Cython will find it at runtime for the moment but when compiling new Cython modules against this, it is gone from the .pxd so that in the future we can actually remove it completly.

@rkern
Copy link
Member

rkern commented Dec 22, 2025

@bashtage SeedlessSequence was always a typo in the .pxd and was removed because the corresponding class didn't actually exist. SeedlessSeedSequence is the real class that was missing from the .pxd because of the typo.

In fixing this, we just didn't realize that downstream extension modules that linked in np.random's Cython API would always access everything declared in the .pxd it saw at buildtime even if they didn't actually use it at runtime (because, it doesn't actually exist).

@jorenham
Copy link
Member Author

Let's probably just do this. I think the slightly better fix will be to just move this to the .pyx file. That way, Cython will find it at runtime for the moment but when compiling new Cython modules against this, it is gone from the .pxd so that in the future we can actually remove it completly.

That's something we could always do at a later point, no?

@charris
Copy link
Member

charris commented Dec 22, 2025

in the future we can actually remove it completly.

That would be nice, we don't want to get stuck with an immortal typo.

@seberg
Copy link
Member

seberg commented Dec 22, 2025

That's something we could always do at a later point, no?

Yes, although the earlier we actually do it, the earlier the time comes when we technically might break someone, but in practice nobody will notice that when we remove it :).

@jorenham
Copy link
Member Author

I'm up for trying it if no one objects

@rgommers
Copy link
Member

I would recommend against trying that for 2.4.1 - always best to do a straight revert, and do anything else in main.

@seberg seberg merged commit bf31f29 into numpy:main Dec 22, 2025
75 checks passed
@seberg
Copy link
Member

seberg commented Dec 22, 2025

Let's just put it in, I think 2 lines with a clear way to test that it works doesn't matter for backporting, but 2.4.1 is basically identical anyway (normally I would prefer to not do this type of thin in a 2.4.x release though, while I don't think there would be a risk here).

But this whole thing is so risk free either way...

@jorenham jorenham deleted the random.bit_generator.SeedSequence branch December 22, 2025 16:29
@jorenham
Copy link
Member Author

Ok, thanks for the help, all :)

@maresb
Copy link

maresb commented Jan 6, 2026

I just hit this, and so was wondering what happened with the plan to yank and release 2.4.1? Thanks!!!

@jorenham
Copy link
Member Author

jorenham commented Jan 6, 2026

what happened with the plan to yank and release 2.4.1?

As far as I'm aware, that's still the plan.

@rgommers
Copy link
Member

@charris thanks for the 2.4.1 release! Are you planning to yank 2.4.0? Between the incoming links to this issue and scipy/scipy#24215, this clearly affects quite a few packages, and it's the first accidental ABI break in quite a while I believe, so yanking is the right to do. There shouldn't be any downsides to doing that - anyone who used == '2.4.0' will continue to have access to that version.

@charris
Copy link
Member

charris commented Jan 10, 2026

@rgommers I'll yank 2.4.0, but I am not convinced it will make much difference.

@charris
Copy link
Member

charris commented Jan 10, 2026

Yanked.

@rgommers
Copy link
Member

thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

34 - Reversion Reversion of previous commit or merge component: numpy.random Priority: high High priority, also add milestones for urgent issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants