#32830·numpy

BUG: a few more reproducers related to large structured dtypes

Author: tylerjereddyCreated Sep 29, 2026Updated Sep 30, 2026
Labels00 - Bug

I think some of this may be getting a little more borderline with respect to Claude Opus 5.5 going fishing for problems, but I've vetted the reproducers below the fold on NumPy main after merging both gh-32811 and gh-31332 and it looks like we're down to 4 left, at least for Python level public API accessibility route. Maybe I'll wait for i.e., Sebastian to indicate if any of these are of genuine concern before I let the LLM drive again--most, but not all, are just int -> larger conversion issues, so the patch is likely to be small again if we want it.

This one segfaults at the print with 2**32 + 1 used, produces a memory error on the resize operation when using 2**31 + 1, and produces the value the LLM expects at 2**30 + 1 :

python
a = np.zeros(2, [("x", "u1", 2**32 + 1)])
a.resize(3, refcheck=False)
print(a["x"][:, -1])  # expected [0 0 0]

This one prints [0] instead of [2] as written, prints the expected [2] if we descrease to 2**30 + 1, and np.choose segfaults when using 2**31 + 2:

python
a = np.zeros(2, [("x", "u1", 2**32 + 1)])
a["x"][1, -1] = 2
print(np.choose([1], a)["x"][:, -1])

This incorrectly reports True as written, reports False with a smaller void type. Although I didn't vet the extra scenarios, Opus claims that np.array_equal, np.unique, and np.isin are also affected.

python
a = np.zeros(2, "V4294967297")
a.view(np.uint8)[-1] = 1
print(a[0] == a[1])

The final failure scenario is a weird one, which Opus claims gets even weirder now that we allow larger dtypes, so it is more of expansion of what could already be done before with memory issues. As written, it produces a MemoryError, but with 2**32 it doesn't error. Yuck, not sure I want to mess with that one.

python
np.zeros(2, [("x", "u1", 2**31 + 2)]).sort(kind="stable")