Skip to content

Conversation

@Jonhas-qtm
Copy link
Collaborator

This patch refactors the previous workflow of building the RNG library, which started from a C library which was then used to generate a a Rust library to then finally generate python bindings. Now, it uses a single Rust RNG crate, from which Python bindings are directly generated.

Additionally, the global RNG State is no longer static nor global, so any weird behavior involving threads should be nullified. This patch is inherently responding to #166 as well.

@Jonhas-qtm Jonhas-qtm requested a review from ciaranra as a code owner August 6, 2025 05:28
@qciaran
Copy link
Collaborator

qciaran commented Aug 6, 2025

Having pyo3 in pecos-rng is counter to PECOS's current design. All the PyO3 stuff is currently exposed in python/pecos-rslib/. peos-rslib is essentially the central Rust->Python bridge for PECOS.

pecos-rng should be re-exported in the pecos meta crate's prelude and then exposed to the Python side in pecos-rslib, which takes the pecos crate and does all the PyO3 stuff.

@Jonhas-qtm
Copy link
Collaborator Author

Having pyo3 in pecos-rng is counter to PECOS's current design. All the PyO3 stuff is currently exposed in python/pecos-rslib/. peos-rslib is essentially the central Rust->Python bridge for PECOS.

pecos-rng should be re-exported in the pecos meta crate's prelude and then exposed to the Python side in pecos-rslib, which takes the pecos crate and does all the PyO3 stuff.

latest changes responds to this

Copy link
Member

@ciaranra ciaranra left a comment

Choose a reason for hiding this comment

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

LGTM

@ciaranra ciaranra merged commit 4cac55b into dev Aug 7, 2025
44 checks passed
@ciaranra ciaranra deleted the feature/rng-crate branch August 7, 2025 02:37
@ciaranra ciaranra mentioned this pull request Aug 7, 2025
@Jonhas-qtm Jonhas-qtm mentioned this pull request Aug 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants