The GitHub Actions job "CI" on 
tvm-ffi.git/junrushao/2026-07-15/generate-layout-compatible-cpp-object-declarations
 has succeeded.
Run started by GitHub user junrushao (triggered by junrushao).

Head commit for run:
8d2aee550b193a7b057a35bad1fd7779c58af0d1 / Junru Shao <[email protected]>
feat(abi): generate layout-compatible C++ object declarations

Architecture:
- Add a reflection-to-C++ pipeline that expands exact or globbed type keys 
through their dynamic object ancestry, lowers reflected fields to 
layout-compatible C++ carriers, and emits deterministic namespace-grouped 
declarations.
- Emit lookup-only object views with compile-time size, alignment, and offset 
assertions so generated classes read existing registered objects without 
registering types, allocating objects, or changing the C ABI.
- Add TVM_FFI_DECLARE_OBJECT_INFO_LOOKUP for cached runtime type-index lookup 
and TVM_FFI_DECLARE_OBJECT_SUBCLASS for forward-declared recursive ObjectPtr 
fields.
- Enrich Python reflection with field alignment, static type indices, total 
size, native-metadata availability, and schema subtype queries required to 
prove carrier and inheritance compatibility.
- Match derived-field placement to Microsoft and Itanium-family tail-padding 
rules while preserving existing ObjectPtr and container ownership semantics.

Public Interfaces:
- Export tvm_ffi.dataclasses.gen_abi_cpp, accepting exact type keys, 
shell-style patterns, or sequences of selectors and returning a self-contained 
C++17 header.
- Add TVM_FFI_DECLARE_OBJECT_INFO_LOOKUP and TVM_FFI_DECLARE_OBJECT_SUBCLASS to 
the public C++ headers for lookup-only generated object declarations.
- Expose TypeSchema.is_subtype_of, TypeField.alignment, 
TypeField.field_static_type_index, and TypeInfo.total_size in the Python 
reflection surface.
- Add the optional frozen parameter to c_class so C++-reflected fields can be 
presented as read-only Python dataclass fields.
- This change is additive and does not alter the C ABI, registered object 
layout, or established ObjectPtr upcast behavior.

UI/UX:
- none

Behavioral Changes:
- Generate inheritance-preserving object declarations, including recursive and 
mutually recursive ObjectPtr container fields, escaped non-C++ identifiers, 
opaque dependencies, and deterministic namespace ordering.
- Validate native raw schemas and reject aliases, ambiguous Optional or Union 
carriers, unsupported static objects, and types without fixed size metadata 
instead of emitting unsafe layouts.
- Use erased ObjectPtr<Object> carriers for schema-less custom object fields 
and typed ObjectPtr carriers when reflection proves the concrete object type.
- Place Python-defined subclass fields at ABI-correct tail-padding offsets on 
Windows and Itanium-family platforms.
- Support reflection-based subtype checks and frozen presentation of reflected 
C++ fields while retaining an explicit descriptor-level mutation escape hatch.
- Preserve backing-object identity across tested ObjectPtr container covariance 
and erased-value round trips.
- Keep runtime-resolved generator test schemas collectable on Python 3.9 by 
spelling unions with typing.Optional and typing.Union.

Docs:
- Document c_class(..., frozen=True), read-only reflected fields, inheritance 
behavior, and the controlled descriptor set escape hatch in the dataclass 
reflection guide.
- Document gen_abi_cpp selector and return semantics in the exported function 
docstring; no separate generator walkthrough is included.
- No documentation update is needed for the Python 3.9 test-annotation 
compatibility adjustment.

Tests:
- Executed: full CTest suite
- Result: all 451 enabled tests passed; 2 remained disabled.
- Executed: full Python unit suite before the test-only annotation adjustment
- Result: 2393 passed, 18 skipped, 3 xfailed.
- Executed: tests/python/test_dataclass_gen_abi_cpp.py under isolated Python 3.9
- Result: 14 passed.
- Executed: tests/python/test_dataclass_gen_abi_cpp.py under the normal 
development Python
- Result: 14 passed.
- Executed: pre-commit on all files
- Result: passed all hooks.
- Executed: Ruff check and format check
- Result: passed.
- Executed: pinned clang-tidy 21.1.1 on tests/cpp/test_abi_object.cc and 
tests/cpp/test_object_ptr.cc
- Result: passed both translation units.
- Executed: git diff --check
- Result: passed.

Untested Edge Cases:
- The complete Python suite was not rerun under Python 3.9; the full generator 
test file covers the only annotations adjusted for Python 3.9 collection.
- Rust tests were not executed because cargo and rustup are unavailable 
locally; no Rust source or binding is modified.
- Linux and Windows compiler matrices remain CI-only; local generated-header 
compilation and platform-conditional layout tests cover the code paths 
available on macOS.

Refs: https://github.com/apache/tvm-ffi/pull/670

Report URL: https://github.com/apache/tvm-ffi/actions/runs/29458763764

With regards,
GitHub Actions via GitBox


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to