Replies: 3 comments 3 replies
-
I like this idea a lot, especially since we have lost I think allowing compute_signature to see the static edge would be wrong. It is never necessary: one can always pass the signature as type args. Consider modifying the Const Node that is providing the edge, such that the type does not change. We would want and expect that this should be mostly-fine. and so the signature of the node should not depend on the contents of the Const. It is too much to hope for that this would be always-fine: maybe I need that node to have a Hugr in it, and it is replaced with a Const that provides a FunctionType by naming a symbol. Maybe the validation on the op would fail, or maybe some lowering could no longer be applied to the op. But we should degrade gracefully, there are many other operations on the Hugr that will be unaffected. |
Beta Was this translation helpful? Give feedback.
-
This relates to #1425, right. If a "static edge" is just a static constant TypeArg (of kind "Node", presumably parametrized by the type of the node), then we can effectively allow custom ops with static function inputs. Does this provide an alternative to #1546 - they can have a static function input instead? |
Beta Was this translation helpful? Give feedback.
-
This is now an issue (#1594), so closing |
Beta Was this translation helpful? Give feedback.
-
This follows discussions mainly in #1308
A constant static input to an op would would be some semantically significant data, that cannot be lost like metadata. This could be thought of as "literal properties" or "intrinsic parameters".
If further we can elevate values to constants at compile time (constexpr evaluation) we can do powerful things with ops that need some structured, complicated, compile-time known data.
An open question is whether this data is available to binary compute_signature functions.
Beta Was this translation helpful? Give feedback.
All reactions