[CORE] Add type subsumption and object-ref containment relations#647
[CORE] Add type subsumption and object-ref containment relations#647tqchen wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
Code Review
This pull request refactors type trait checks in the TVM FFI library by replacing details::type_contains_v with type_subsumes_v and introducing object_ref_contains_v for safer object reference containment checks. The feedback highlights two critical template metaprogramming issues that could lead to hard compilation errors: first, the Tuple specialization of type_subsumes_v needs to safely handle mismatched pack sizes; second, object_ref_contains_v should be made SFINAE-safe to prevent compilation failures when instantiated with primitive or non-container reference types.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
32d8c49 to
2c522a6
Compare
2c522a6 to
9c6677c
Compare
This change:
type_subsumes_v<TargetType, SourceType>as the public target-first relation used for direct container storage reuse;object_ref_contains_v<RefType, ObjectType>for proving that raw object pointers can be wrapped without a runtime type check;GetRef, recursive container specializations, and focused compile-time and runtime coverage.The separate names distinguish storage subsumption from object-ref containment while allowing direct variable-template specialization for typed refs.