junrushao opened a new pull request, #456: URL: https://github.com/apache/tvm-ffi/pull/456
## Summary - Deprecate `field_static_type_index` in `TVMFFIFieldInfo` by renaming to `_deprecated_field_static_type_index` (preserves ABI layout) - Remove `TypeToFieldStaticTypeIndex` and `TypeToRuntimeTypeIndex` template infrastructure from `type_traits.h` - Simplify `serialization.cc`: all object fields now go through the node graph via `GetOrCreateNodeIndex` instead of a compile-time type switch - Add comprehensive serialization tests: 40 C++ tests and 58 Python tests covering primitives, containers, objects, JSON structure, dedup, metadata, and error cases ## Motivation `field_static_type_index` was a compile-time type hint that serialization used to decide whether to inline POD field values or route them through the node graph. This was: - **Unnecessary**: `GetOrCreateNodeIndex` already handles all types correctly via runtime `type_index()` - **Fragile**: the inline/graph decision duplicated logic between serialization and deserialization switches that had to stay in sync - **Incorrect for `Any`/`Optional` fields**: compile-time types don't reliably match runtime values ## Test plan - [x] All 302 C++ tests pass (including 40 serialization tests) - [x] All 444 Python tests pass (including 58 new serialization tests) - [x] Pre-commit hooks pass (ruff, ty, clang-format) -- 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]
