std::any::TypeId is not stable across binaries. This makes it unsuitable for use in scene files, networking, or dynamic plugins.
In the short term we get around this by just using std::any::type_name. But this isn't particularly efficient for certain serialization cases and Eq / Hash traits. Legion uses TypeIds extensively and we've (in the short term) replaced those with type_name to allow for dynamic plugin loading. But that probably incurs measurable overhead.
Its worth exploring the idea of a StableTypeId, which is just a wrapped integer. I think it makes sense to use a const-hashing algorithm on type_name to produce StableTypeIds
std::any::TypeIdis not stable across binaries. This makes it unsuitable for use in scene files, networking, or dynamic plugins.In the short term we get around this by just using
std::any::type_name. But this isn't particularly efficient for certain serialization cases andEq/Hashtraits. Legion uses TypeIds extensively and we've (in the short term) replaced those withtype_nameto allow for dynamic plugin loading. But that probably incurs measurable overhead.Its worth exploring the idea of a
StableTypeId, which is just a wrapped integer. I think it makes sense to use a const-hashing algorithm on type_name to produceStableTypeIds