ngoldbaum
ngoldbaum on Hacker News
It should be good to go, but of course I don’t know what your codebase looks like and issues are always possible in any code, “good to go” or no. Please do give it a try and try testing on 3.15 and 3.15t.
I’m glad to see there’s ongoing work to get protobuf working!
I doubt PyUnstable APIs will get promoted directly to the limited API without at least a release or two in the regular version-specific API first.
That said, if you would be willing to start a thread on discourse describing your need and use-case, that is probably the first step to stabilizing the APIs you want. It may also turn out there’s an alternate way to get protobuf working.
Please do feel free to reach out privately. I’d love to be able
to chat with people working on protobuf and grpcio, they come up reasonably often and it’s hard to get official updates from inside Google.
My headline feature is the new “abi3t” stable ABI for the free-threaded build. While Petr Viktorin did most of the CPython implementation, I’ve been trying to make sure ecosystem support is ready. It’s been a rewarding but quite challenging project to make sure everything is working. There were some late nights leading up to the beta1 release when we found a Windows-specific issue that needed a fix.
I’m particularly proud that the cryptography project is already shipping a single abi3.abi3t wheel for each platform on Python 3.15 or newer. The GIL-enabled build and free-threaded build can both use the same wheel now, because PyObject is opaque.
If you want to learn more about this, I gave a talk at EuroPython this year on Python’s ABI and the road to building and releasing abi3t today. See https://youtu.be/An8lO29SxXE.
Posted by
ngoldbaum on Friday October 09, 2026 @10:35AM
from the python.org dept.
Posted by
ngoldbaum on Tuesday September 08, 2026 @06:04PM
from the labs.quansight.org dept.
I’m saying that it’s a new issue on the free-threaded build.
There’s also the fact that INCREF and DECREF on shared objects is a lot more expensive than plain integer addition, so stuff becomes a bottleneck that was never a bottleneck. Kumar also fixed a bottleneck caused by a lock added only for safety on the free-threaded build. It’s hard to tell in advance than a fancy lock-free data structure is needed for something.
I’m not sure why it took me, a NumPy developer, looking at the benchmark numbers and saying “hmm, this is a bug”. But that is what it took. People are sometimes slow to treat behavior in dependencies like NumPy as bugs.
Posted by
ngoldbaum on Thursday July 30, 2026 @12:09PM
from the labs.quansight.org dept.
I’m glad you enjoyed the post. It really helped me to crystallize my understanding. I was also confused about the API/ABI distinction for a long time.
Thanks for pointing that out, I’ll fix that.
Posted by
ngoldbaum on Friday July 10, 2026 @01:18PM
from the labs.quansight.org dept.
Posted by
ngoldbaum on Thursday September 11, 2025 @09:02AM
from the labs.quansight.org dept.
I wonder why the github status page has an atlassian cookie request pop-up.
Posted by
ngoldbaum on Wednesday July 23, 2025 @08:14AM
from the py-free-threading.github.io dept.
Posted by
ngoldbaum on Tuesday May 13, 2025 @03:47PM
from the labs.quansight.org dept.
Either something about beanie babies or something riffing on "thank you". Couldn't ever make up my mind then basically forgot about it.
I gave away the “ty” on pypi to Astral week or so ago. I wanted to use it for a joke a few years ago but this is a much better use for a two letter project name. They agreed to make a donation to the PSF to demonstrate their gratefulness.
You could do two passes over the string, first get the total length in bytes, then fill it in codepoint by codepoint.
You could also pessimistically over-allocate assuming four bytes per character and then resize afterwards.
With the API in the linked blog post it's up to the user to decide how they want to use the output [u8;4] array.
The main difference is the strings are stored in a single contiguous arena buffer (with some minor caveats if you mutate the array in-place). With object strings each string has its own heap allocation.
More details in NEP 55: https://numpy.org/neps/nep-0055-string_dtype.html
This post is based on the content of a 25 minute talk and it’s hard to explain everything fully…
Ah I could see how that’s confusing. I was trying to indicate that the size stored for the string in the example is 28, but it’s stored in a 64 bit uint.
They’re stored on the DType instance. This requires that there’s only one DType instance per “owned” array buffer, which I figured out how to do along with Sebastian Berg and others using the new DType system.
That is something I’d like to see but I don’t want to wade into the already very complicated discussion around arrow strings in pandas. If a Pandas developer wanted to take this on I think that would make things easier since there’s so much complexity around strings in Pandas.
That said there is a branch that gets most of the way there: https://github.com/pandas-dev/pandas/pull/58578. The remaining challenges are mostly around getting consensus around how to introduce this change.
If NumPy had StringDType in 2019 instead of 2024 I think Pandas might have had an easier time. Sadly the timing didn’t quite work out.
Well, there
was no concept of sidecar storage. Now we have the hack we came up with for StringDType to store data on the DType instance and also make it so StringDType arrays don't share StringDType instances, unless the array is a view.
EDIT: looking back at the NEP, I'm not sure it does a great job explaining exactly how the per-array descriptor works. Ultimately it's powered by a hook in the DType API: https://github.com/numpy/numpy/pull/24988. There is only one spot in NumPy where array buffers are allocated, so we hooked there and made sure any arrays with newly allocated buffers get a new DType instance.
Thank you this really means a lot.
No, it wouldn’t make sense to. Use threading.Lock for that. PyMutex is available in the CPython C API.
This style of mutex will also power PyMutex in Python 3.13. I have real-world benchmarks showing how much faster PyMutex is than the old PyThread_type_lock that was available before 3.13.