junrushao opened a new pull request, #670: URL: https://github.com/apache/tvm-ffi/pull/670
Architecture: - Generate lookup-only C++ object declarations from reflected inheritance, size, alignment, and offset metadata. - Teach container storage and object-pointer traits to recognize forward-declared ABI object classes. - Match Python-defined subclass offsets to Microsoft and Itanium-family C++ tail-padding rules. Public Interfaces: - Export tvm_ffi.dataclasses.gen_abi_cpp. - Add TVM_FFI_DECLARE_OBJECT_INFO_LOOKUP and TVM_FFI_DECLARE_ABI_OBJECT for generated views. - Expose field alignment, static type indices, subtype queries, and the c_class frozen option. UI/UX: - None. Behavioral Changes: - Preserve native object inheritance and recursive container fields in generated headers with compile-time layout assertions. - Make ObjectPtr and WeakObjectPtr conversions follow physical C++ pointer convertibility and const correctness. - Reuse base-class tail padding for Python-defined fields where the platform C++ ABI permits it. Docs: - Document read-only reflected fields for frozen C++ dataclass wrappers. Tests: - uv pip install --force-reinstall --verbose -e . - uv run --no-sync pytest -q tests/python/test_dataclass_gen_abi_cpp.py tests/python/test_dataclass_py_class.py tests/python/test_type_converter.py - ./build_test/lib/tvm_ffi_tests - All applicable pre-commit hooks except ty; ty reports two unresolved dynamic TypeInfo attributes. Untested Edge Cases: - The MSVC-specific no-tail-padding path was not executed on macOS. BREAKING CHANGE: ObjectPtr and WeakObjectPtr conversions no longer permit pointee conversions that remove const or are not valid physical C++ pointer conversions. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
