GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — ENH: use c11 atomics for `numpy` by kumaraditya303 · Pull Request #30489 · numpy/numpy

Conversation

@kumaraditya303

@kumaraditya303 kumaraditya303 commented Dec 20, 2025 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Experiment: use c11 atomics for numpy instead of hand-written atomic functions.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@github-actions github-actions Bot added the 36 - Build Build related PR label Dec 20, 2025
@kumaraditya303
use c11 atomics for numpy
8584677
@kumaraditya303
kumaraditya303 force-pushed the stdatomics branch from a57b9e4 to 8584677 Compare December 20, 2025 09:23
@kumaraditya303 kumaraditya303 changed the title BLD: use c11 atomics for numpy ENH: use c11 atomics for numpy Dec 20, 2025
@kumaraditya303
fix header order
7540a32
@kumaraditya303
kumaraditya303 marked this pull request as ready for review December 22, 2025 12:09
@kumaraditya303

kumaraditya303 commented Dec 22, 2025

Copy link
Copy Markdown
Contributor Author

cc @rgommers @ngoldbaum

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

ngoldbaum
ngoldbaum approved these changes Dec 22, 2025
View reviewed changes

@ngoldbaum ngoldbaum left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Nice simplification. I agree that relaxed loads should be fine - in the worst case there will be some blocking or duplication of work in code paths for cache misses.

Just to be extra sure, I wrote a little test script which doesn't produce any race reports on a TSan-instrumented build of 3.14:

import numpy as np
from numpy.testing._private.utils import run_threaded


dt = np.dtype(('i4', [('a', '<i2'), ('b', '<i2')]))


def worker(b):
    b.wait()
    hash(dt)


run_threaded(worker, 500, pass_barrier=True)

I'd like someone else who knows numpy's build infrastructure on Windows to weigh in about the new experimental build flag.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread meson.build Resolved

Uh oh!

There was an error while loading. Please reload this page.

rgommers
rgommers reviewed Dec 22, 2025
View reviewed changes

@rgommers rgommers left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Nice, this is worth trying indeed.

The /experimental:c11atomics was added in VS 2022 version 17.5 Preview 2, which I believe corresponds to toolchain version 19.35. Right now the minimum we support is 19.20, so before merging we should bump that version number on line 28 of the top-level meson.build file to 19.35. That way we'll get a clear error message if the installed compiler is too old.

Once that is changed, this LGTM I think.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@kumaraditya303
update msvc version
5a6f815
@kumaraditya303

kumaraditya303 commented Dec 23, 2025

Copy link
Copy Markdown
Contributor Author

Once that is changed, this LGTM I think.

I have updated the msvc version.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@kumaraditya303
kumaraditya303 requested a review from rgommers December 23, 2025 04:29
@ngoldbaum

ngoldbaum commented Dec 23, 2025

Copy link
Copy Markdown
Member

It occurs to me: let's add a release note for the MSVC minimum version bump too.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@kumaraditya303

kumaraditya303 commented Dec 23, 2025

Copy link
Copy Markdown
Contributor Author

let's add a release note for the MSVC minimum version bump too.

Where do I need to add it? I am not familar with how numpy handles release notes.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@mattip

mattip commented Dec 23, 2025

Copy link
Copy Markdown
Member

See the README.rst and other examples in doc/release/upcoming_changes

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@kumaraditya303
add news item
7808904
@kumaraditya303

kumaraditya303 commented Dec 23, 2025

Copy link
Copy Markdown
Contributor Author

Thanks, I added it to the release notes

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@ngoldbaum

ngoldbaum commented Dec 24, 2025 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

CI failures are due to transient network issues during the docs build and are unrelated. Let’s merge this and we’ll see if anyone running against our main branch reports issues.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@ngoldbaum
ngoldbaum merged commit 7e6f606 into numpy:main Dec 24, 2025
@kumaraditya303
kumaraditya303 deleted the stdatomics branch December 24, 2025 15:13
@ngoldbaum ngoldbaum added the 39 - free-threading PRs and issues related to support for free-threading CPython (a.k.a. no-GIL, PEP 703) label Jan 6, 2026
@h-vetinari h-vetinari mentioned this pull request Jun 2, 2026
MAINT: reflect msvc lower bound in error message #31554
Merged
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@ngoldbaum ngoldbaum ngoldbaum approved these changes
@rgommers rgommers Awaiting requested review from rgommers

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

36 - Build Build related PR 39 - free-threading PRs and issues related to support for free-threading CPython (a.k.a. no-GIL, PEP 703)

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

4 participants

@kumaraditya303 @ngoldbaum @mattip @rgommers
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.