Skip to content

Add an opt-in ABI3T build for aiscat - #621

Draft
honglei wants to merge 1 commit into
jvde-github:mainfrom
honglei:abi3t-python315-prep
Draft

Add an opt-in ABI3T build for aiscat#621
honglei wants to merge 1 commit into
jvde-github:mainfrom
honglei:abi3t-python315-prep

Conversation

@honglei

@honglei honglei commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

This is the implementation draft discussed in #620. It is intentionally
opt-in and additive: the version-specific wheels remain the preferred path.

The conversion loop does not fork in this version. convert_object,
convert_value, and wrap_annotated remain the single semantic
implementation. The two performance-sensitive ABI differences are isolated in
small helpers:

  • version-specific builds use _PyDict_NewPresized; ABI3T uses PyDict_New;
  • version-specific builds use PyList_SET_ITEM; ABI3T uses the checked
    PyList_SetItem call.

The larger conditional section is outside the conversion loop: ABI3T needs a
negative-basicsize heap type, PyObject_GetTypeData, and the
PyModExport__core module export hook because PyObject_HEAD is opaque.

For maintenance, I would treat the shared conversion semantics as the sole
reference implementation. The version-specific build is the performance
baseline, with ABI-specific mechanics kept at the narrow boundaries above.
Both variants run the same decode tests, including annotated output and all
supported input object types.

The build uses scikit-build-core 1.0.3's ABI3T signal as the single source for
the source ABI, Stable-ABI linkage, suffix, and combined wheel tag. A
free-threaded Python 3.15 build produces
cp315-abi3.abi3t / _core.abi3t.so; an inconsistent classic-ABI request is
rejected rather than producing a mislabeled wheel. The ABI3T command requests
CMake 3.26+ explicitly, while ordinary version-specific builds retain their
existing CMake 3.15 floor.

Current validation

  • ABI3T wheel passed the project tests on Python 3.15.0rc1 free-threaded with
    the GIL still disabled, and on a GIL-enabled Python 3.15 build.
  • The cp315t and cp313 version-specific wheels passed the same tests.
  • 100,000 Decoder create/decode/destroy cycles passed on both 3.15 runtimes.
  • The Linux extension exports PyModExport__core, not PyInit__core; all 45
    imported CPython symbols are in the CPython 3.15.0rc1 Stable ABI manifest.
  • On 5,000,000 real AIS input lines, with file I/O and grouping excluded, the
    ABI3T feed() median was 6.58% below cp315t at one thread and 5.04% below at
    four threads. This supports retaining cp315t as the preferred artifact.

This is not merge-ready release plumbing. An actual Windows wheel build/import
(including DLL dependency inspection), ABI3T-aware auditing once available,
and a separately controlled CI/release job remain open gates.

@jvde-github
jvde-github force-pushed the main branch 3 times, most recently from d7f28d4 to e375519 Compare September 6, 2026 22:14
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.

1 participant