junrushao opened a new pull request, #666:
URL: https://github.com/apache/tvm-ffi/pull/666
Architecture:
- Normalize unqualified Object subclasses through object_ptr_type_t at every
container storage, conversion, and subsumption boundary.
- Preserve public class templates and C++17 deduction while sharing backing
storage between shorthand and explicit ObjectPtr spellings.
- Apply the same normalization recursively to Array, List, Map, Dict, Tuple,
Optional, Variant, and Expected.
Public Interfaces:
- Make Container<TObject> shorthand for Container<ObjectPtr<TObject>> across
sequence, mapping, tuple, optional, variant, and expected templates.
- Permit zero-copy handle conversion between shorthand and explicit pointer
spellings when their normalized types subsume one another.
UI/UX:
- None.
Behavioral Changes:
- Container accessors, schemas, checks, and ownership now use the normalized
pointer type whenever a template argument is an unqualified Object
subclass.
- Qualified object types remain unnormalized and unsupported by this
shorthand.
Docs:
- Add examples for every redirected container and document storage
equivalence,
zero-copy conversions, deduction behavior, and qualification limits.
Tests:
- Clean Debug tvm_ffi_tests build completed successfully.
- All 444 enabled CTests passed; 2 cycle-detection tests remained disabled.
- Clean editable build and 552 focused container, metadata, and dataclass
Python
tests passed.
- Stub generation was idempotent on the complete tree.
- Scoped pre-commit hooks passed for all files in this boundary.
Untested Edge Cases:
- Rust bindings and the cross-platform CI matrix were not run locally.
- The unchanged original target tree has a known MSVC C2976 failure around
Array<Variant<int64_t, String>> subsumption; this semantic split does not
fix it.
- The unchanged target also has Doxygen warnings for new subsumption/Optional
specializations and enum APIs; documentation cleanup remains follow-up
work.
- Targeted clang-tidy was not rerun during the split; the identical final
tree
had passed the repository's targeted check before history was rewritten.
BREAKING CHANGE: unqualified Object subclasses used as container template
arguments now normalize to ObjectPtr storage. Code depending on the old
declared
type behavior must use the explicit intended storage type and rebuild
extensions.
--
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]