hugr
hugr copied to clipboard
Add metadata specification document with current and planned keys
A number of metadata keys are currently being used ad-hoc. Some are mentioned in the main spec document. We should instead have a structured document that lists the namespaces, keys, value types and meaning.
We also have metadata that can be attached to nodes but also metadata that can be attached to the contents of extension definitions.
Further, the way the model uses metadata is slightly different to how the core uses it.
Already used (what's missing)?:
General
core.generatorfor recording structured HUGR generator names and versionscore.used_extensionsfor names and versions of used extensions in HUGR
Model
core.meta.descriptionfor descriptionscore.order_hintprefix for recording order edges (is this actually metadata, it does not saymeta, is this part of stable model spec instead?)compat.meta_jsonto string encode existing metadata (like those in the General section above)
Proposed
core.hintprefix for adding compiler hints #2328 #2372core.side_effectfor marking impure OpDefscore.passes.<pass name>prefix for targeting specific passes- Debug information, for example guppy source info
We also shouldn't forget about debug info metadata
https://github.com/CQCL/hugr/pull/2448 added core.title to preserve private functions names when exporting. @zrho can you add it to the list above?