PYRS logo PYRS

Native Extensions

Edit this page

Current native-extension compatibility surface and scientific-stack bring-up status.

Native extension support is an active workstream focused on C-API closure and scientific-stack bring-up. PYRS targets a disciplined, CPython-semantics-first extension substrate rather than ad-hoc compatibility shims.

Compatibility Modes

Mode Status
pyrs314 (source-build mode)Primary supported mode for extension bring-up.
cp314 wheel-compat reuseDeferred until ABI/runtime conformance evidence is sufficient.

Current Implemented Surface

Surface Current state
Manifest-backed extension loading (.pyrs-ext)Implemented and smoke-covered.
Direct shared-object import (.so/.dylib/.pyd)Implemented with pyrs_extension_init_v1 and PyInit_* fallback.
CPython single-phase init compatibility slicePartial baseline implemented; full C-API breadth remains open.
PEP 489 multi-phase initNot closed yet.

Scientific-Stack Snapshot (2026-02-23)

Gate Status
import numpy as npPASS
int(np.array([1,2,3]).sum()) == 6PASS
numpy._core.numerictypes core checksPASS
import scipyPASS (latest direct probe snapshot)
import pandas, matplotlib probesStill failing in direct mode; active root-cause closure work remains.

Probe Commands

Shell
$ python3 scripts/probe_numpy_gate.py --pyrs target/debug/pyrs --cpython-lib .local/Python-3.14.3/Lib --out perf/numpy_gate_latest.json --timeout 20 $ python3 scripts/probe_numpy_gate.py --pyrs target/debug/pyrs --cpython-lib .local/Python-3.14.3/Lib --include-scientific-stack --probe-local-stack --python-probe-bin .venv-ext314/bin/python --out perf/numpy_gate_direct_latest.json --timeout 30

Canonical Internal Trackers

  • docs/EXTENSION_CAPABILITY_MATRIX.md
  • docs/EXTENSION_PACKAGING_CONTRACT.md
  • docs/EXTENSION_CAPI_V1.md
  • docs/CAPI_PLAN.md
  • docs/CAPI_LIFETIME_MODEL.md
  • docs/NUMPY_BRINGUP_GATE.md