Skip to content

[CORE] Invert object/type_traits dependency layering#638

Merged
tqchen merged 1 commit into
apache:mainfrom
tqchen:tvm-ffi-invert-object-type-traits-dependency-layering
Jun 20, 2026
Merged

[CORE] Invert object/type_traits dependency layering#638
tqchen merged 1 commit into
apache:mainfrom
tqchen:tvm-ffi-invert-object-type-traits-dependency-layering

Conversation

@tqchen

@tqchen tqchen commented Jun 19, 2026

Copy link
Copy Markdown
Member

Summary

  • invert the header dependency so object.h includes type_traits.h, and move shared type metadata/helpers like StaticTypeKey, TypeIndexToTypeKey, and details::type_contains_v into type_traits.h
  • move object and Optional trait specializations into their owning headers, move DLTensor* traits into tensor.h, and keep the uint64_t overflow-checked specialization near the end of any.h
  • add a narrow ASF header checker skip for .agents/skills/**/SKILL.md so skill files can keep frontmatter at byte 0

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request refactors the TVM FFI type traits and error-handling mechanisms to break circular dependencies and improve header organization. It introduces a low-level error_throw.h header, moves core type traits and static type keys to type_traits.h, and extracts object-dependent traits into a new object_type_traits.h header. Additionally, a TypeTraits specialization for Optional has been added. The feedback suggests explicitly including <tvm/ffi/object.h> in <tvm/ffi/object_type_traits.h> to ensure header self-containment and prevent compilation failures when it is included directly.

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.

Comment thread include/tvm/ffi/object_type_traits.h Outdated
@tqchen tqchen force-pushed the tvm-ffi-invert-object-type-traits-dependency-layering branch 2 times, most recently from 5a23b88 to e5ad134 Compare June 19, 2026 20:10
@tqchen tqchen changed the title [FFI] Invert object/type_traits dependency layering Invert object/type_traits dependency layering Jun 19, 2026
@tqchen tqchen changed the title Invert object/type_traits dependency layering [CORE] Invert object/type_traits dependency layering Jun 19, 2026
@tqchen tqchen force-pushed the tvm-ffi-invert-object-type-traits-dependency-layering branch from e5ad134 to 874e131 Compare June 19, 2026 20:13
@tqchen tqchen merged commit e8a5516 into apache:main Jun 20, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants