Skip to content

add support for abi3t#556

Draft
Icxolu wants to merge 1 commit into
PyO3:mainfrom
Icxolu:abi3t
Draft

add support for abi3t#556
Icxolu wants to merge 1 commit into
PyO3:mainfrom
Icxolu:abi3t

Conversation

@Icxolu

@Icxolu Icxolu commented Jun 15, 2026

Copy link
Copy Markdown
Member

This adds abi3t support by

  • switching to opaque structs
  • exposing data access helpers from slots 369-378
  • redirect all field accesses through the access helpers

Todo:

  • changelog entry
  • CI testing for 3.15/3.15t

See numpy/numpy#31091
Closes #555

@ngoldbaum

Copy link
Copy Markdown
Contributor

Ping @kumaraditya303 - we were just talking about this today.

@neutrinoceros

neutrinoceros commented Jun 17, 2026

Copy link
Copy Markdown

I confirmed that this resolved the runtime error I reported in #555
example logs (remaining failures are unrelated, they're just due to numpy not having cp315 nightlies for windows yet)

Comment thread src/npyffi/array.rs Outdated
Comment thread src/npyffi/array.rs Outdated
Comment thread src/npyffi/array.rs Outdated
Comment thread src/npyffi/objects.rs
opaque_struct!(pub PyArray_Descr);

#[repr(C)]
pub struct PyArray_DescrProto {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

PyArray_DescrProto should not be exposed on abi3t as numpy does.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

same for _PyArray_DescrNumPy2

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I think __PyArray_DescrNumPy2 needs to be defined (with ob_base removed) as this is our (only) way to access the v2 specific fields.

@Icxolu Icxolu Jun 18, 2026

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

For PyArray_DescrProto, what about slot 192 (PyArray_RegisterDataType) which takes it as an argument. Is it not available on abi3t and should be removed when building for it?

@kumaraditya303

Copy link
Copy Markdown

I think we should also add a check that when abi3t is used, the minimum numpy version should be 2.5.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

BUG: function built with -F pyo3/abi3t raises TypeError at runtime (CPython 3.15.0b2-free-threaded))

4 participants