GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||
GeezerVison is showing github.com — BUG: fix free-threaded races in RandomState by ngoldbaum · Pull Request #30360 · numpy/numpy Conversation
Member
Fixes one of the races in #30085. I'd appreciate it if one of @lysnikolaou, @kumaraditya303, or @crusaderky could look this over, since you're all doing work related to this change. I verified that the test I added generates TSan races without the cython change to add critical sections. As far as I can tell, all other reads and writes to internal state are either atomic (e.g. in
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
ngoldbaum
force-pushed
the
randomstate-critical-sections
branch
from
03132a0 to
95e36ee
Compare
Member
Author
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
Member
Author
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
ngoldbaum
marked this pull request as draft
ngoldbaum
marked this pull request as ready for review
Member
Author
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
Member
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
Member
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page.
bashtage
added a commit
to vigna/randomgen
that referenced
this pull request
Port NumPy's lock changes (numpy/numpy#30360, numpy/numpy#32061) so bit generators are safe to share across threads on free-threaded Python. - Always use an RLock, since NumPy < 2.5 provides a plain Lock that deadlocks when locked calls nest; RDRAND's RaisingLock wraps an RLock - Lock state get/set, seeding (including key=/counter= paths), advance and jump in every bit generator and in UserBitGenerator - Validate state before writing in the AES, Philox and ThreeFry setters so a bad state no longer leaves the generator half updated - Lock the scalar path of ExtendedGenerator.complex_normal - Declare the extensions free-threading compatible when built with Cython >= 3.1 so importing randomgen does not re-enable the GIL - Add threaded tests covering seed/state races, reentrancy and the GIL Co-Authored-By: Claude Opus 5.5 <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
ReviewersNo reviewsUh oh!
There was an error while loading. Please reload this page. AssigneesNo one assignedLabels
00 - Bug
39 - free-threading
ProjectsMilestoneNo milestoneDevelopmentSuccessfully merging this pull request may close these issues. Uh oh!
There was an error while loading. Please reload this page. Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later. | |||||
| You are visitor 01402775 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |