Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix random seed initialization between runs in SabreSwap (backport #9127
) (#9132) * Fix random seed initialization between runs in SabreSwap (#9127) * Fix random seed initialization between runs in SabreSwap This commit fixes an issue in the case no random seed is provided by the user when initializing an instance of SabreSwap. The pass was previously potentially reusing the random seed between runs even if no seed was specified. This was an artifact of storing the initial seed as an instance variable. Instead this commit just relies on the the Rust RNG to initialize from entropy if no seed is specified. * Remove unused numpy import (cherry picked from commit dfbc738) * Restore numpy import On the main branch the SabreSwap python code has been refactored so it no longer is using numpy besides the previous use for the RNG. Removing the numpy RNG usage in this PR meant also removing the numpy import as nothing else was using it anymore. However, the version of SabreSwap in stable/0.22 does not have this refactor and numpy is still used to construct intermediate objects which are passed to rhe rust code. This commit restores the import to fix the backported PR so it works with the version of SabreSwap in stable/0.22 Co-authored-by: Matthew Treinish <[email protected]>
- Loading branch information