Skip to content

Fix/windows overflow#364

Closed
baogorek wants to merge 7 commits intomasterfrom
fix/windows-overflow
Closed

Fix/windows overflow#364
baogorek wants to merge 7 commits intomasterfrom
fix/windows-overflow

Conversation

@baogorek
Copy link
Copy Markdown
Collaborator

@baogorek baogorek commented Apr 24, 2025

What this fixes and how it's fixed

Fixes #363. Moving from instantiating a different generator per entity to a single random number sequence seeded by the minimum entity id saves about 10 seconds. As long as entity id is not negative, our seed will not be negative.

@baogorek baogorek added the bug Something isn't working label Apr 24, 2025
@baogorek baogorek requested a review from nikhilwoodruff April 24, 2025 21:54
@baogorek baogorek self-assigned this Apr 24, 2025
@MaxGhenis
Copy link
Copy Markdown
Contributor

Closing this PR as the issue has been fixed more comprehensively in PR #382 (merged July 2025).

The current master code now uses a vectorized PCG hash approach with np.abs() to handle the seed overflow issue. This PR's approach is now obsolete.

Thank you @baogorek for identifying this issue and proposing an initial fix!

@MaxGhenis MaxGhenis closed this Dec 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Integer Overflow Risk in random()

2 participants