tqchen commented on PR #634:
URL: https://github.com/apache/tvm-ffi/pull/634#issuecomment-4744969084

   Fixed the enum test failure in the latest push (`320aa73`).
   
   Root cause: some enum registration helpers are not hot-path type checks; 
they need to force runtime type-index allocation before touching type-attr 
columns. After making dynamic `RuntimeTypeIndex()` a cached inline load, C++ 
enum registration exposed a static-initialization ordering issue.
   
   Fix:
   
   - `EnumObj::Get<T>` now uses `T::_GetOrAllocRuntimeTypeIndex()` for the 
registry lookup.
   - `EnumDef` forces the allocated type index before creating/storing enum 
singletons.
   - The enum entries column now uses `Dict<String, ObjectRef>` internally, so 
child enum singleton objects keep their concrete type identity while C++ lookup 
returns `Enum`.
   
   Validation run locally:
   
   - `pytest tests/python/test_dataclass_enum.py -q` -> 53 passed
   - `ASAN_OPTIONS=detect_leaks=0 GTEST_COLOR=1 
build/cpp_tests/lib/tvm_ffi_tests --gtest_filter='Object*:Reflection*'` -> 41 
passed
   - `pre-commit run --all-files` -> passed


-- 
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]

Reply via email to