test(python): add regression test for register_object __init__ wiring (#493) ## Summary Add a regression test for the `register_object` `__init__` wiring that prevents a NULL-handle segfault. ## Root Cause `CObject` (Cython extension type) has a custom `tp_new`, so CPython's `object.__init__` silently ignores extra positional arguments. Before `_install_init` was wired into `register_object` (#491), calling `TestIntPair(1, 2)` fell through to `object.__init__`, producing `chandle = NULL`. Any subsequent field access (e.g. `pair.a`) dereferences `chandle + field_offset` → **segfault**. ## Test Coverage The new `test_register_object_wires_init` verifies: 1. Construction via the wired `__init__` yields a live (non-NULL) handle with correct field values. 2. `__new__` alone leaves `chandle` at 0, confirming `__init__` is the only path that creates the C++ object. The test does not exercise the actual segfault (which would crash the runner); the NULL-handle assertion is the safe proxy. ## Test Plan - [x] `pytest -xvs tests/python/test_object.py::test_register_object_wires_init` — passed
📚 Documentation | 🚀 Quickstart
Apache TVM FFI is an open ABI and FFI for machine learning systems. It is a minimal, framework-agnostic, yet flexible open convention with the following systems in mind:
These enable broad interoperability across frameworks, libraries, DSLs, and agents; the ability to ship one wheel for multiple frameworks and Python versions (including free-threaded Python); and consistent infrastructure across environments.
Install TVM-FFI with pip, uv or from source:
pip install apache-tvm-ffi pip install torch-c-dlpack-ext # compatibility package for torch <= 2.9
C ABI stability is our top priority.
Status: RFC Main features are complete and ABI stable. We recognize potential needs for evolution to ensure it works best for the machine learning systems community, and would like to work together with the community for such evolution. We plan to stay in the RFC stage for three months from the v0.1.0 release.
Releases during the RFC stage will be 0.X.Y, where bumps in X indicate C ABI-breaking changes and Y indicates other changes. We anticipate the RFC stage will last for three months, then we will start following Semantic Versioning (major.minor.patch) going forward.
Our documentation site includes: