-
Notifications
You must be signed in to change notification settings - Fork 13
feat!: No nested FuncDefns (or AliasDefns) #2256
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
hugr-core/src/builder/module.rs
Outdated
|
|
||
| /// Add a [`ops::FuncDefn`] node and returns a builder to define the function | ||
| /// body graph. | ||
| /// ALAN: could put this on HugrBuilder (subtrait of Container) as utility?? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This comment not for committing (but perhaps the rest) - see PR comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With that utility can we avoid a breakage?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, the breakage is avoidable by code duplication between the deprecated and new versions but I suspect not any other way...neither module_root_builder nor the utility suggested here help, no.
| #[test] | ||
| fn test_polymorphic_call() -> Result<(), Box<dyn std::error::Error>> { | ||
| // TODO: This tests a function call that is polymorphic in an extension set. | ||
| // Should this be rewritten to be polymorphic in something else or removed? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I went for "removed", there are a number of tests using the highly-polymorphic extension_with_eval_parallel
This reverts commit 6b282a9.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2256 +/- ##
==========================================
+ Coverage 82.18% 82.28% +0.10%
==========================================
Files 239 240 +1
Lines 43017 43385 +368
Branches 38928 39295 +367
==========================================
+ Hits 35353 35699 +346
- Misses 5673 5715 +42
+ Partials 1991 1971 -20
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
| /// A function load operation. | ||
| LoadFunc, | ||
| /// A definition that could be at module level or inside a DSG. | ||
| /// Note that this means only Constants, as all other defn/decls |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Commit 6b282a9 trialled removing ScopedDefn, happy to go that way, but this keeps it more consistent with what I've done to the spec
| The following operations are valid at the module level as well as in dataflow | ||
| regions and control-flow regions: | ||
|
|
||
| - `Const<T>` : a static constant value of type T stored in the node |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I kept the idea of Scoped Definitions, even with only a single member, because the idea was used in three places and it seemed odd to repeat the special case of Consts that many times...I could be persuaded otherwise....
| mod_b.finish_hugr().unwrap_or_else(|e| panic!("{e}")) | ||
| pub fn finish_with_exts(self, make: impl FnOnce(DFGW, &ExtensionRegistry) -> Hugr) -> Hugr { | ||
| let func_b = FunctionBuilder::new("main", HugrFuncType::new(self.ins, self.outs)).unwrap(); | ||
| make(func_b, &self.extensions) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So the downside of this FnOnce(...) -> Hugr is that you lose the "debugging aid" printout, because you've given the DFGW to the function.
One alternative that I explored was impl FnOnce(&mut DFGW,...) -> () and the function would then end with .set_outputs(...).unwrap(). I didn't like this because then it's really easy to forget to set the outputs!
An option I didn't explore, would be FnOnce(&mut DFGW,...) -> Vec<Wire> i.e. the function returns the outputs; fn finish then calls finish_hugr_with_outputs. There are a few cases where rather than calling finish_with_outputs we were calling finish_sub_container because there were no outputs, and there I guess we'd just return empty.
If you think that'd be better I'm happy to try! :)
hugr-llvm/src/emit/test.rs
Outdated
| builder.finish_with_outputs([w]).unwrap() | ||
| }; | ||
| let [r] = builder.call(func.handle(), &[], []).unwrap().outputs_arr(); | ||
| let r = builder.load_const(&konst); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So the diverse_cfg_children and diverse_dfg_children are no longer very diverse, i.e. just constants (still important for CFGs because you can share a Const between BB's, but you can't put a Const in a BB and use it in a dominated BB - dom edges are only for Value edges i.e. LoadConstant not Const). Might be best just to remove?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove the tests? Is the const handling covered by other tests?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are several tests of add_load_value inside a DFG, which covers the case of a local Const, so I argue diverse_dfg_children is redundant. (diverse_module_children covers Const nodes at the module level.)
diverse_cfg_children uniquely covers the case of a Const directly inside a CFG so should stay.
…#2336) This should have been part of #2256 but some confusion dates from #2147. Making a callgraph for only the functions beneath the entrypoint makes no sense - that's either all the functions (if the entrypoint is the root) or at most one of them (if the entrypoint is one of the funcdefns). Of course, we didn't test with any Hugrs that had a non-module-root entrypoint.... so the sensible thing to do now, seems to be for callgraph to ignore the entrypoint. (We can optimize it looking for FuncDefns tho, they are now easy to find.) Dead function removal allowed specifying starting points for analysis (top-level FuncDefns) but only if the Hugr's entrypoint was the module. There seems no good reason not to allow specifying module-level FuncDefns even if the entrypoint is lower, and similarly, we should use the entrypoint as one starting point (perhaps among many) for analysis... (One could rename `entry_points` used by analysis to "starting_points" but that would be breaking)
…#2336) This should have been part of #2256 but some confusion dates from #2147. Making a callgraph for only the functions beneath the entrypoint makes no sense - that's either all the functions (if the entrypoint is the root) or at most one of them (if the entrypoint is one of the funcdefns). Of course, we didn't test with any Hugrs that had a non-module-root entrypoint.... so the sensible thing to do now, seems to be for callgraph to ignore the entrypoint. (We can optimize it looking for FuncDefns tho, they are now easy to find.) Dead function removal allowed specifying starting points for analysis (top-level FuncDefns) but only if the Hugr's entrypoint was the module. There seems no good reason not to allow specifying module-level FuncDefns even if the entrypoint is lower, and similarly, we should use the entrypoint as one starting point (perhaps among many) for analysis... (One could rename `entry_points` used by analysis to "starting_points" but that would be breaking)
This release includes a long list of changes:
- The HUGR model serialization format is now stable, and should be
preferred over the old JSON format.
- Type parameters and type arguments are now unified into a single
`Term` type.
- Function definitions can no longer be nested inside dataflow regions.
Now they must be defined at the top level module.
- Function definitions and declarations now have a `Visibility` field,
which define whether they are visible in the public API of the module.
- And many more fixes and improvements.
---
## 🤖 New release
* `hugr-model`: 0.20.2 -> 0.21.0 (⚠ API breaking changes)
* `hugr-core`: 0.20.2 -> 0.21.0 (⚠ API breaking changes)
* `hugr-llvm`: 0.20.2 -> 0.21.0 (⚠ API breaking changes)
* `hugr-passes`: 0.20.2 -> 0.21.0 (✓ API compatible changes)
* `hugr`: 0.20.2 -> 0.21.0 (✓ API compatible changes)
* `hugr-cli`: 0.20.2 -> 0.21.0 (⚠ API breaking changes)
### ⚠ `hugr-model` breaking changes
```text
--- failure constructible_struct_adds_field: externally-constructible struct adds field ---
Description:
A pub struct constructible with a struct literal has a new pub field. Existing struct literals must be updated to include the new field.
ref: https://doc.rust-lang.org/reference/expressions/struct-expr.html
impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.41.0/src/lints/constructible_struct_adds_field.ron
Failed in:
field Symbol.visibility in /tmp/.tmpEqPTGR/hugr/hugr-model/src/v0/ast/mod.rs:198
field Symbol.visibility in /tmp/.tmpEqPTGR/hugr/hugr-model/src/v0/table/mod.rs:307
--- failure pub_module_level_const_missing: pub module-level const is missing ---
Description:
A public const is missing or renamed
ref: https://doc.rust-lang.org/cargo/reference/semver.html#item-remove
impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.41.0/src/lints/pub_module_level_const_missing.ron
Failed in:
CORE_CTRL_TYPE in file /tmp/.tmp1p6e1v/hugr-model/src/v0/mod.rs:175
--- failure struct_with_no_pub_fields_changed_type: public API struct with no public fields is no longer a struct ---
Description:
A struct without pub fields became an enum or union, breaking pattern matching.
ref: https://internals.rust-lang.org/t/rest-patterns-foo-should-match-non-struct-types/21607
impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.41.0/src/lints/struct_with_no_pub_fields_changed_type.ron
Failed in:
struct hugr_model::v0::scope::UnknownVarError became enum in file /tmp/.tmpEqPTGR/hugr/hugr-model/src/v0/scope/vars.rs:147
```
### ⚠ `hugr-core` breaking changes
```text
--- failure auto_trait_impl_removed: auto trait no longer implemented ---
Description:
A public type has stopped implementing one or more auto traits. This can break downstream code that depends on the traits being implemented.
ref: https://doc.rust-lang.org/reference/special-types-and-traits.html#auto-traits
impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.41.0/src/lints/auto_trait_impl_removed.ron
Failed in:
type Term is no longer UnwindSafe, in /tmp/.tmpEqPTGR/hugr/hugr-core/src/types/type_param.rs:70
type Term is no longer RefUnwindSafe, in /tmp/.tmpEqPTGR/hugr/hugr-core/src/types/type_param.rs:70
--- failure enum_missing: pub enum removed or renamed ---
Description:
A publicly-visible enum cannot be imported by its prior path. A `pub use` may have been removed, or the enum itself may have been renamed or removed entirely.
ref: https://doc.rust-lang.org/cargo/reference/semver.html#item-remove
impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.41.0/src/lints/enum_missing.ron
Failed in:
enum hugr_core::types::type_param::TypeArgError, previously in file /tmp/.tmp1p6e1v/hugr-core/src/types/type_param.rs:450
enum hugr_core::hugr::persistent::walker::PinNodeError, previously in file /tmp/.tmp1p6e1v/hugr-core/src/hugr/persistent/walker.rs:333
enum hugr_core::hugr::persistent::serial::SerialCommitData, previously in file /tmp/.tmp1p6e1v/hugr-core/src/hugr/persistent/state_space/serial.rs:11
enum hugr_core::import::ImportError, previously in file /tmp/.tmp1p6e1v/hugr-core/src/import.rs:39
enum hugr_core::import::OrderHintError, previously in file /tmp/.tmp1p6e1v/hugr-core/src/import.rs:82
enum hugr_core::hugr::persistent::InvalidCommit, previously in file /tmp/.tmp1p6e1v/hugr-core/src/hugr/persistent/state_space.rs:474
--- failure enum_no_repr_variant_discriminant_changed: enum variant had its discriminant change value ---
Description:
The enum's variant had its discriminant value change. This breaks downstream code that used its value via a numeric cast like `as isize`.
ref: https://doc.rust-lang.org/reference/items/enumerations.html#assigning-discriminant-values
impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.41.0/src/lints/enum_no_repr_variant_discriminant_changed.ron
Failed in:
variant InterGraphEdgeError::NonCFGAncestor 2 -> 1 in /tmp/.tmpEqPTGR/hugr/hugr-core/src/hugr/validate.rs:795
variant InterGraphEdgeError::MissingOrderEdge 3 -> 2 in /tmp/.tmpEqPTGR/hugr/hugr-core/src/hugr/validate.rs:806
variant InterGraphEdgeError::NoRelation 4 -> 3 in /tmp/.tmpEqPTGR/hugr/hugr-core/src/hugr/validate.rs:817
variant InterGraphEdgeError::NonDominatedAncestor 5 -> 4 in /tmp/.tmpEqPTGR/hugr/hugr-core/src/hugr/validate.rs:827
--- failure enum_variant_added: enum variant added on exhaustive enum ---
Description:
A publicly-visible enum without #[non_exhaustive] has a new variant.
ref: https://doc.rust-lang.org/cargo/reference/semver.html#enum-variant-new
impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.41.0/src/lints/enum_variant_added.ron
Failed in:
variant TypeBound:Linear in /tmp/.tmpEqPTGR/hugr/hugr-core/src/types.rs:138
--- failure enum_variant_missing: pub enum variant removed or renamed ---
Description:
A publicly-visible enum has at least one variant that is no longer available under its prior name. It may have been renamed or removed entirely.
ref: https://doc.rust-lang.org/cargo/reference/semver.html#item-remove
impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.41.0/src/lints/enum_variant_missing.ron
Failed in:
variant PackageEncodingError::RuntimeExtensionResolution, previously in file /tmp/.tmp1p6e1v/hugr-core/src/envelope/package_json.rs:77
variant Term::Type, previously in file /tmp/.tmp1p6e1v/hugr-core/src/types/type_param.rs:67
variant Term::Type, previously in file /tmp/.tmp1p6e1v/hugr-core/src/types/type_param.rs:158
variant Term::Sequence, previously in file /tmp/.tmp1p6e1v/hugr-core/src/types/type_param.rs:180
variant Term::Type, previously in file /tmp/.tmp1p6e1v/hugr-core/src/types/type_param.rs:158
variant Term::Sequence, previously in file /tmp/.tmp1p6e1v/hugr-core/src/types/type_param.rs:180
variant TypeBound::Any, previously in file /tmp/.tmp1p6e1v/hugr-core/src/types.rs:136
variant InterGraphEdgeError::ValueEdgeIntoFunc, previously in file /tmp/.tmp1p6e1v/hugr-core/src/hugr/validate.rs:766
variant ValidationError::ExtensionError, previously in file /tmp/.tmp1p6e1v/hugr-core/src/hugr/validate.rs:714
variant ValidationError::ExtensionError, previously in file /tmp/.tmp1p6e1v/hugr-core/src/hugr/validate.rs:714
--- failure function_missing: pub fn removed or renamed ---
Description:
A publicly-visible function cannot be imported by its prior path. A `pub use` may have been removed, or the function itself may have been renamed or removed entirely.
ref: https://doc.rust-lang.org/cargo/reference/semver.html#item-remove
impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.41.0/src/lints/function_missing.ron
Failed in:
function hugr_core::types::type_param::check_type_arg, previously in file /tmp/.tmp1p6e1v/hugr-core/src/types/type_param.rs:384
function hugr_core::types::type_param::check_type_args, previously in file /tmp/.tmp1p6e1v/hugr-core/src/types/type_param.rs:437
--- failure inherent_method_missing: pub method removed or renamed ---
Description:
A publicly-visible method or associated fn is no longer available under its prior name. It may have been renamed or removed entirely.
ref: https://doc.rust-lang.org/cargo/reference/semver.html#item-remove
impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.41.0/src/lints/inherent_method_missing.ron
Failed in:
Term::max_nat, previously in file /tmp/.tmp1p6e1v/hugr-core/src/types/type_param.rs:100
Term::bounded_nat, previously in file /tmp/.tmp1p6e1v/hugr-core/src/types/type_param.rs:108
Term::as_type, previously in file /tmp/.tmp1p6e1v/hugr-core/src/types/type_param.rs:275
Term::as_type, previously in file /tmp/.tmp1p6e1v/hugr-core/src/types/type_param.rs:275
--- failure method_parameter_count_changed: pub method parameter count changed ---
Description:
A publicly-visible method now takes a different number of parameters.
ref: https://doc.rust-lang.org/cargo/reference/semver.html#fn-change-arity
impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.41.0/src/lints/method_parameter_count_changed.ron
Failed in:
hugr_core::hugr::patch::simple_replace::SimpleReplacement::linked_replacement_output now takes 4 parameters instead of 3, in /tmp/.tmpEqPTGR/hugr/hugr-core/src/hugr/patch/simple_replace.rs:134
hugr_core::hugr::patch::simple_replace::SimpleReplacement::linked_replacement_inputs now takes 4 parameters instead of 3, in /tmp/.tmpEqPTGR/hugr/hugr-core/src/hugr/patch/simple_replace.rs:221
hugr_core::hugr::patch::SimpleReplacement::linked_replacement_output now takes 4 parameters instead of 3, in /tmp/.tmpEqPTGR/hugr/hugr-core/src/hugr/patch/simple_replace.rs:134
hugr_core::hugr::patch::SimpleReplacement::linked_replacement_inputs now takes 4 parameters instead of 3, in /tmp/.tmpEqPTGR/hugr/hugr-core/src/hugr/patch/simple_replace.rs:221
hugr_core::hugr::SimpleReplacement::linked_replacement_output now takes 4 parameters instead of 3, in /tmp/.tmpEqPTGR/hugr/hugr-core/src/hugr/patch/simple_replace.rs:134
hugr_core::hugr::SimpleReplacement::linked_replacement_inputs now takes 4 parameters instead of 3, in /tmp/.tmpEqPTGR/hugr/hugr-core/src/hugr/patch/simple_replace.rs:221
hugr_core::SimpleReplacement::linked_replacement_output now takes 4 parameters instead of 3, in /tmp/.tmpEqPTGR/hugr/hugr-core/src/hugr/patch/simple_replace.rs:134
hugr_core::SimpleReplacement::linked_replacement_inputs now takes 4 parameters instead of 3, in /tmp/.tmpEqPTGR/hugr/hugr-core/src/hugr/patch/simple_replace.rs:221
--- failure module_missing: pub module removed or renamed ---
Description:
A publicly-visible module cannot be imported by its prior path. A `pub use` may have been removed, or the module may have been renamed, removed, or made non-public.
ref: https://doc.rust-lang.org/cargo/reference/semver.html#item-remove
impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.41.0/src/lints/module_missing.ron
Failed in:
mod hugr_core::hugr::persistent, previously in file /tmp/.tmp1p6e1v/hugr-core/src/hugr/persistent.rs:1
mod hugr_core::hugr::persistent::walker, previously in file /tmp/.tmp1p6e1v/hugr-core/src/hugr/persistent/walker.rs:1
mod hugr_core::hugr::persistent::serial, previously in file /tmp/.tmp1p6e1v/hugr-core/src/hugr/persistent.rs:769
--- failure struct_missing: pub struct removed or renamed ---
Description:
A publicly-visible struct cannot be imported by its prior path. A `pub use` may have been removed, or the struct itself may have been renamed or removed entirely.
ref: https://doc.rust-lang.org/cargo/reference/semver.html#item-remove
impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.41.0/src/lints/struct_missing.ron
Failed in:
struct hugr_core::hugr::persistent::PatchNode, previously in file /tmp/.tmp1p6e1v/hugr-core/src/hugr/persistent/state_space.rs:28
struct hugr_core::hugr::persistent::walker::PinnedWire, previously in file /tmp/.tmp1p6e1v/hugr-core/src/hugr/persistent/walker/pinned.rs:30
struct hugr_core::hugr::persistent::PinnedWire, previously in file /tmp/.tmp1p6e1v/hugr-core/src/hugr/persistent/walker/pinned.rs:30
struct hugr_core::hugr::persistent::PersistentHugr, previously in file /tmp/.tmp1p6e1v/hugr-core/src/hugr/persistent.rs:274
struct hugr_core::hugr::persistent::serial::SerialCommitStateSpace, previously in file /tmp/.tmp1p6e1v/hugr-core/src/hugr/persistent/state_space/serial.rs:54
struct hugr_core::types::type_param::TypeArgVariable, previously in file /tmp/.tmp1p6e1v/hugr-core/src/types/type_param.rs:236
struct hugr_core::hugr::persistent::walker::Walker, previously in file /tmp/.tmp1p6e1v/hugr-core/src/hugr/persistent/walker.rs:87
struct hugr_core::hugr::persistent::Walker, previously in file /tmp/.tmp1p6e1v/hugr-core/src/hugr/persistent/walker.rs:87
struct hugr_core::hugr::persistent::PointerEqResolver, previously in file /tmp/.tmp1p6e1v/hugr-core/src/hugr/persistent/resolver.rs:11
struct hugr_core::hugr::persistent::CommitStateSpace, previously in file /tmp/.tmp1p6e1v/hugr-core/src/hugr/persistent/state_space.rs:64
struct hugr_core::hugr::persistent::Commit, previously in file /tmp/.tmp1p6e1v/hugr-core/src/hugr/persistent.rs:108
--- failure trait_method_missing: pub trait method removed or renamed ---
Description:
A trait method is no longer callable, and may have been renamed or removed entirely.
ref: https://doc.rust-lang.org/cargo/reference/semver.html#major-any-change-to-trait-item-signatures
impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.41.0/src/lints/trait_method_missing.ron
Failed in:
method define_function of trait Container, previously in file /tmp/.tmp1p6e1v/hugr-core/src/builder/build_traits.rs:92
```
### ⚠ `hugr-llvm` breaking changes
```text
--- failure trait_method_requires_different_generic_type_params: trait method now requires a different number of generic type parameters ---
Description:
A trait method now requires a different number of generic type parameters than it used to. Calls or implementations of this trait method using the previous number of generic types will be broken.
ref: https://doc.rust-lang.org/reference/items/generics.html
impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.41.0/src/lints/trait_method_requires_different_generic_type_params.ron
Failed in:
FatExt::fat_root (1 -> 0 generic types) in /tmp/.tmpEqPTGR/hugr/hugr-llvm/src/utils/fat.rs:376
```
### ⚠ `hugr-cli` breaking changes
```text
--- failure inherent_method_missing: pub method removed or renamed ---
Description:
A publicly-visible method or associated fn is no longer available under its prior name. It may have been renamed or removed entirely.
ref: https://doc.rust-lang.org/cargo/reference/semver.html#item-remove
impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.41.0/src/lints/inherent_method_missing.ron
Failed in:
ValArgs::verbosity, previously in file /tmp/.tmp1p6e1v/hugr-cli/src/validate.rs:53
MermaidArgs::verbosity, previously in file /tmp/.tmp1p6e1v/hugr-cli/src/mermaid.rs:78
--- failure struct_pub_field_missing: pub struct's pub field removed or renamed ---
Description:
A publicly-visible struct has at least one public field that is no longer available under its prior name. It may have been renamed or removed entirely.
ref: https://doc.rust-lang.org/cargo/reference/semver.html#item-remove
impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.41.0/src/lints/struct_pub_field_missing.ron
Failed in:
field other_args of struct ValArgs, previously in file /tmp/.tmp1p6e1v/hugr-cli/src/validate.rs:24
field other_args of struct MermaidArgs, previously in file /tmp/.tmp1p6e1v/hugr-cli/src/mermaid.rs:36
--- warning enum_missing: pub enum removed or renamed ---
Description:
A publicly-visible enum cannot be imported by its prior path. A `pub use` may have been removed, or the enum itself may have been renamed or removed entirely.
ref: https://doc.rust-lang.org/cargo/reference/semver.html#item-remove
impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.41.0/src/lints/enum_missing.ron
Failed in:
enum hugr_cli::CliArgs, previously in file /tmp/.tmp1p6e1v/hugr-cli/src/lib.rs:78
--- warning struct_missing: pub struct removed or renamed ---
Description:
A publicly-visible struct cannot be imported by its prior path. A `pub use` may have been removed, or the struct itself may have been renamed or removed entirely.
ref: https://doc.rust-lang.org/cargo/reference/semver.html#item-remove
impl: https://github.com/obi1kenobi/cargo-semver-checks/tree/v0.41.0/src/lints/struct_missing.ron
Failed in:
struct hugr_cli::OtherArgs, previously in file /tmp/.tmp1p6e1v/hugr-cli/src/lib.rs:122
```
<details><summary><i><b>Changelog</b></i></summary><p>
## `hugr-model`
<blockquote>
##
[0.21.0](hugr-model-v0.20.2...hugr-model-v0.21.0)
- 2025-07-09
### Bug Fixes
- Model import should perform extension resolution
([#2326](#2326))
- [**breaking**] Fixed bugs in model CFG handling and improved CFG
signatures ([#2334](#2334))
- [**breaking**] Fix panic in model resolver when variable is used
outside of symbol. ([#2362](#2362))
- Order hints on input and output nodes.
([#2422](#2422))
### New Features
- [**breaking**] Added float and bytes literal to core and python
bindings. ([#2289](#2289))
- better errors using metadata from generator
([#2368](#2368))
- [**breaking**] Add Visibility to FuncDefn/FuncDecl.
([#2143](#2143))
- [**breaking**] hugr-model use explicit Option<Visibility>, with
::Unspecified in capnp ([#2424](#2424))
</blockquote>
## `hugr-core`
<blockquote>
##
[0.21.0](hugr-core-v0.20.2...hugr-core-v0.21.0)
- 2025-07-09
### Bug Fixes
- Fixed two bugs in import/export of function operations
([#2324](#2324))
- Model import should perform extension resolution
([#2326](#2326))
- [**breaking**] Fixed bugs in model CFG handling and improved CFG
signatures ([#2334](#2334))
- Use List instead of Tuple in conversions for TypeArg/TypeRow
([#2378](#2378))
- Do extension resolution on loaded extensions from the model format
([#2389](#2389))
- Make JSON Schema checks actually work again
([#2412](#2412))
- Order hints on input and output nodes.
([#2422](#2422))
### New Features
- [**breaking**] No nested FuncDefns (or AliasDefns)
([#2256](#2256))
- Add serial data types for SimpleReplacement and PersistentHugr
([#2300](#2300))
- [**breaking**] Split `TypeArg::Sequence` into tuples and lists.
([#2140](#2140))
- [**breaking**] Added float and bytes literal to core and python
bindings. ([#2289](#2289))
- [**breaking**] More helpful error messages in model import
([#2272](#2272))
- Add MermaidFormatter to replace RenderConfig
([#2275](#2275))
- [**breaking**] Better error reporting in `hugr-cli`.
([#2318](#2318))
- *(core)* builder pattern for EnvelopeConfig
([#2330](#2330))
- *(core, llvm)* add array unpack operations
([#2339](#2339))
- [**breaking**] Merge `TypeParam` and `TypeArg` into one `Term` type in
Rust ([#2309](#2309))
- *(persistent)* Add serialisation for CommitStateSpace
([#2344](#2344))
- Deprecate invalidation_set, add invalidated_nodes and
SimpleReplacement::invalidation_set
([#2358](#2358))
- Rewrite for peeling a TailLoop
([#2290](#2290))
- Create Module/FunctionBuilders from existing Hugrs
([#2359](#2359))
- add TryFrom impls for TypeArg/TypeRow
([#2366](#2366))
- better errors using metadata from generator
([#2368](#2368))
- use `core.` prefixes for generator metadata keys
([#2371](#2371))
- Add `MakeError` op ([#2377](#2377))
- Open lists and tuples in `Term`
([#2360](#2360))
- Call `FunctionBuilder::add_{in,out}put` for any AsMut<Hugr>
([#2376](#2376))
- Add Root checked methods to DataflowParentID
([#2382](#2382))
- Add PersistentWire type
([#2361](#2361))
- Add `BorrowArray` extension
([#2395](#2395))
- [**breaking**] Rename 'Any' type bound to 'Linear'
([#2421](#2421))
- [**breaking**] Add Visibility to FuncDefn/FuncDecl.
([#2143](#2143))
- *(per)* [**breaking**] Support empty wires in commits
([#2349](#2349))
- [**breaking**] hugr-model use explicit Option<Visibility>, with
::Unspecified in capnp ([#2424](#2424))
### Refactor
- [**breaking**] move PersistentHugr into separate crate
([#2277](#2277))
- *(types.rs)* rm incorrect comment and unnecessary allow-unused
([#2340](#2340))
- [**breaking**] remove deprecated runtime extension errors
([#2369](#2369))
- [**breaking**] Reduce error type sizes
([#2420](#2420))
### Testing
- Check hugr json serializations against the schema (again)
([#2216](#2216))
</blockquote>
## `hugr-llvm`
<blockquote>
##
[0.21.0](hugr-llvm-v0.20.2...hugr-llvm-v0.21.0)
- 2025-07-09
### New Features
- [**breaking**] No nested FuncDefns (or AliasDefns)
([#2256](#2256))
- [**breaking**] Split `TypeArg::Sequence` into tuples and lists.
([#2140](#2140))
- [**breaking**] More helpful error messages in model import
([#2272](#2272))
- *(core, llvm)* add array unpack operations
([#2339](#2339))
- [**breaking**] Merge `TypeParam` and `TypeArg` into one `Term` type in
Rust ([#2309](#2309))
- Add `MakeError` op ([#2377](#2377))
### Refactor
- *(llvm)* replace HashMap with BTreeMap
([#2313](#2313))
</blockquote>
## `hugr-passes`
<blockquote>
##
[0.21.0](hugr-passes-v0.20.2...hugr-passes-v0.21.0)
- 2025-07-09
### Bug Fixes
- update CallGraph and remove_dead_funcs for module-only FuncDefns
([#2336](#2336))
- DeadFuncElimPass+CallGraph w/ non-module-child entrypoint
([#2390](#2390))
### New Features
- [**breaking**] No nested FuncDefns (or AliasDefns)
([#2256](#2256))
- [**breaking**] Split `TypeArg::Sequence` into tuples and lists.
([#2140](#2140))
- [**breaking**] Merge `TypeParam` and `TypeArg` into one `Term` type in
Rust ([#2309](#2309))
- [**breaking**] Rename 'Any' type bound to 'Linear'
([#2421](#2421))
### Refactor
- [**breaking**] Reduce error type sizes
([#2420](#2420))
</blockquote>
## `hugr`
<blockquote>
##
[0.21.0](hugr-v0.20.2...hugr-v0.21.0)
- 2025-07-09
### Bug Fixes
- update CallGraph and remove_dead_funcs for module-only FuncDefns
([#2336](#2336))
- DeadFuncElimPass+CallGraph w/ non-module-child entrypoint
([#2390](#2390))
- Fixed two bugs in import/export of function operations
([#2324](#2324))
- Model import should perform extension resolution
([#2326](#2326))
- [**breaking**] Fixed bugs in model CFG handling and improved CFG
signatures ([#2334](#2334))
- Use List instead of Tuple in conversions for TypeArg/TypeRow
([#2378](#2378))
- Do extension resolution on loaded extensions from the model format
([#2389](#2389))
- Make JSON Schema checks actually work again
([#2412](#2412))
- Order hints on input and output nodes.
([#2422](#2422))
### Documentation
- Hide hugr-persistent docs
([#2357](#2357))
### New Features
- Add serial data types for SimpleReplacement and PersistentHugr
([#2300](#2300))
- [**breaking**] Split `TypeArg::Sequence` into tuples and lists.
([#2140](#2140))
- [**breaking**] Added float and bytes literal to core and python
bindings. ([#2289](#2289))
- [**breaking**] More helpful error messages in model import
([#2272](#2272))
- Add MermaidFormatter to replace RenderConfig
([#2275](#2275))
- [**breaking**] Better error reporting in `hugr-cli`.
([#2318](#2318))
- *(core, llvm)* add array unpack operations
([#2339](#2339))
- [**breaking**] Merge `TypeParam` and `TypeArg` into one `Term` type in
Rust ([#2309](#2309))
- *(persistent)* Add serialisation for CommitStateSpace
([#2344](#2344))
- Deprecate invalidation_set, add invalidated_nodes and
SimpleReplacement::invalidation_set
([#2358](#2358))
- Rewrite for peeling a TailLoop
([#2290](#2290))
- Create Module/FunctionBuilders from existing Hugrs
([#2359](#2359))
- add TryFrom impls for TypeArg/TypeRow
([#2366](#2366))
- better errors using metadata from generator
([#2368](#2368))
- use `core.` prefixes for generator metadata keys
([#2371](#2371))
- Add `MakeError` op ([#2377](#2377))
- Open lists and tuples in `Term`
([#2360](#2360))
- Call `FunctionBuilder::add_{in,out}put` for any AsMut<Hugr>
([#2376](#2376))
- Add Root checked methods to DataflowParentID
([#2382](#2382))
- Add PersistentWire type
([#2361](#2361))
- Add `BorrowArray` extension
([#2395](#2395))
- [**breaking**] Add Visibility to FuncDefn/FuncDecl.
([#2143](#2143))
- *(per)* [**breaking**] Support empty wires in commits
([#2349](#2349))
- [**breaking**] hugr-model use explicit Option<Visibility>, with
::Unspecified in capnp ([#2424](#2424))
- [**breaking**] No nested FuncDefns (or AliasDefns)
([#2256](#2256))
- *(core)* builder pattern for EnvelopeConfig
([#2330](#2330))
- [**breaking**] Rename 'Any' type bound to 'Linear'
([#2421](#2421))
### Refactor
- *(types.rs)* rm incorrect comment and unnecessary allow-unused
([#2340](#2340))
- [**breaking**] remove deprecated runtime extension errors
([#2369](#2369))
- [**breaking**] Reduce error type sizes
([#2420](#2420))
- [**breaking**] move PersistentHugr into separate crate
([#2277](#2277))
### Testing
- Check hugr json serializations against the schema (again)
([#2216](#2216))
</blockquote>
## `hugr-cli`
<blockquote>
##
[0.21.0](hugr-cli-v0.20.2...hugr-cli-v0.21.0)
- 2025-07-09
### New Features
- [**breaking**] Better error reporting in `hugr-cli`.
([#2318](#2318))
- *(cli)* convert sub-command for converting envelope formats
([#2331](#2331))
</blockquote>
</p></details>
---
This PR was generated with
[release-plz](https://github.com/release-plz/release-plz/).
---------
Co-authored-by: Agustín Borgna <[email protected]>
This release fixes multiple inconsistencies between the serialization formats and improves the error messages when loading unsupported envelopes. We now also support nodes with up to `2^32` connections to the same port (up from `2^16`). --- ## 🤖 New release * `hugr-model`: 0.21.0 -> 0.22.0 (✓ API compatible changes) * `hugr-core`: 0.21.0 -> 0.22.0 (✓ API compatible changes) * `hugr-llvm`: 0.21.0 -> 0.22.0 (✓ API compatible changes) * `hugr-passes`: 0.21.0 -> 0.22.0 (✓ API compatible changes) * `hugr-persistent`: 0.1.0 -> 0.2.0 (✓ API compatible changes) * `hugr`: 0.21.0 -> 0.22.0 (✓ API compatible changes) * `hugr-cli`: 0.21.0 -> 0.22.0 (✓ API compatible changes) <details><summary><i><b>Changelog</b></i></summary><p> ## `hugr-model` <blockquote> ## [0.22.0](hugr-model-v0.21.0...hugr-model-v0.22.0) - 2025-07-24 ### New Features - Names of private functions become `core.title` metadata. ([#2448](#2448)) - include generator metatada in model import and cli validate errors ([#2452](#2452)) - Version number in hugr binary format. ([#2468](#2468)) - Use semver crate for -model version, and include in docs ([#2471](#2471)) </blockquote> ## `hugr-core` <blockquote> ## [0.22.0](hugr-core-v0.21.0...hugr-core-v0.22.0) - 2025-07-24 ### Bug Fixes - Ensure SumTypes have the same json encoding in -rs and -py ([#2465](#2465)) ### New Features - Export entrypoint metadata in Python and fix bug in import ([#2434](#2434)) - Names of private functions become `core.title` metadata. ([#2448](#2448)) - [**breaking**] Use binary envelopes for operation lower_func encoding ([#2447](#2447)) - [**breaking**] Update portgraph dependency to 0.15 ([#2455](#2455)) - Detect and fail on unrecognised envelope flags ([#2453](#2453)) - include generator metatada in model import and cli validate errors ([#2452](#2452)) - [**breaking**] Add `insert_region` to HugrMut ([#2463](#2463)) - Non-region entrypoints in `hugr-model`. ([#2467](#2467)) </blockquote> ## `hugr-llvm` <blockquote> ## [0.21.0](hugr-llvm-v0.20.2...hugr-llvm-v0.21.0) - 2025-07-09 ### New Features - [**breaking**] No nested FuncDefns (or AliasDefns) ([#2256](#2256)) - [**breaking**] Split `TypeArg::Sequence` into tuples and lists. ([#2140](#2140)) - [**breaking**] More helpful error messages in model import ([#2272](#2272)) - [**breaking**] Merge `TypeParam` and `TypeArg` into one `Term` type in Rust ([#2309](#2309)) - Add `MakeError` op ([#2377](#2377)) </blockquote> ## `hugr-passes` <blockquote> ## [0.22.0](hugr-passes-v0.21.0...hugr-passes-v0.22.0) - 2025-07-24 ### New Features - ReplaceTypes allows linearizing inside Op replacements ([#2435](#2435)) - Add pass for DFG inlining ([#2460](#2460)) </blockquote> ## `hugr-persistent` <blockquote> ## [0.2.0](hugr-persistent-v0.1.0...hugr-persistent-v0.2.0) - 2025-07-24 ### New Features - [**breaking**] Update portgraph dependency to 0.15 ([#2455](#2455)) </blockquote> ## `hugr` <blockquote> ## [0.22.0](hugr-v0.21.0...hugr-v0.22.0) - 2025-07-24 ### Bug Fixes - Ensure SumTypes have the same json encoding in -rs and -py ([#2465](#2465)) ### New Features - ReplaceTypes allows linearizing inside Op replacements ([#2435](#2435)) - Add pass for DFG inlining ([#2460](#2460)) - Export entrypoint metadata in Python and fix bug in import ([#2434](#2434)) - Names of private functions become `core.title` metadata. ([#2448](#2448)) - [**breaking**] Use binary envelopes for operation lower_func encoding ([#2447](#2447)) - [**breaking**] Update portgraph dependency to 0.15 ([#2455](#2455)) - Detect and fail on unrecognised envelope flags ([#2453](#2453)) - include generator metatada in model import and cli validate errors ([#2452](#2452)) - [**breaking**] Add `insert_region` to HugrMut ([#2463](#2463)) - Non-region entrypoints in `hugr-model`. ([#2467](#2467)) </blockquote> ## `hugr-cli` <blockquote> ## [0.22.0](hugr-cli-v0.21.0...hugr-cli-v0.22.0) - 2025-07-24 ### New Features - include generator metatada in model import and cli validate errors ([#2452](#2452)) </blockquote> </p></details> --- This PR was generated with [release-plz](https://github.com/release-plz/release-plz/). --------- Co-authored-by: Agustín Borgna <[email protected]>
🤖 I have created a release *beep* *boop* --- ## [0.13.0rc1](hugr-py-v0.12.2...hugr-py-v0.13.0rc1) (2025-07-24) ### ⚠ BREAKING CHANGES * Lowering functions in extension operations are now encoded as binary envelopes. Older hugr versions will error out when trying to load them. * **py:** `EnvelopeConfig::BINARY` now uses the model binary encoding. `EnvelopeFormat.MODULE` is now `EnvelopeFormat.MODEL`. `EnvelopeFormat.MODULE_WITH_EXTS` is now `EnvelopeFormat.MODEL_WITH_EXTS` * hugr-model: Symbol has an extra field * Renamed the `Any` type bound to `Linear` * The model CFG signature types were changed. * Added `TypeParam`s and `TypeArg`s corresponding to floats and bytes. * `TypeArg::Sequence` needs to be replaced with `TypeArg::List` or `TypeArg::Tuple` * FuncDefns must be moved to beneath Module. `Container::define_function` is gone, use `HugrBuilder::module_root_builder`; similarly in hugr-py `DefinitionBuilder` (`define_function` -> `module_root_builder().define_function`). In hugr-llvm, some uses of ### Features * Add `BorrowArray` extension ([#2395](#2395)) ([782687e](782687e)) * Add `MakeError` op ([#2377](#2377)) ([909a794](909a794)), closes [#1863](#1863) * add toposort to HUGR-py ([#2367](#2367)) ([34eed34](34eed34)) * Add Visibility to FuncDefn/FuncDecl. ([#2143](#2143)) ([5bbe0cd](5bbe0cd)) * Added float and bytes literal to core and python bindings. ([#2289](#2289)) ([e9c5e91](e9c5e91)) * **core, llvm:** add array unpack operations ([#2339](#2339)) ([a1a70f1](a1a70f1)), closes [#1947](#1947) * Detect and fail on unrecognised envelope flags ([#2453](#2453)) ([5e36770](5e36770)) * Export entrypoint metadata in Python and fix bug in import ([#2434](#2434)) ([d17b245](d17b245)) * Expose `BorrowArray` in `hugr-py` ([#2425](#2425)) ([fdb675f](fdb675f)), closes [#2406](#2406) * include generator metatada in model import and cli validate errors ([#2452](#2452)) ([f7cedb4](f7cedb4)) * Names of private functions become `core.title` metadata. ([#2448](#2448)) ([4bc7f65](4bc7f65)) * No nested FuncDefns (or AliasDefns) ([#2256](#2256)) ([214b8df](214b8df)) * Non-region entrypoints in `hugr-model`. ([#2467](#2467)) ([7b42da6](7b42da6)) * Open lists and tuples in `Term` ([#2360](#2360)) ([292af80](292af80)) * **py:** enable Model as default BINARY envelope format ([#2317](#2317)) ([f089931](f089931)) * **py:** Helper methods to get the neighbours of a node ([#2370](#2370)) ([bb6fa50](bb6fa50)) * **py:** Use SumValue serialization for tuples ([#2466](#2466)) ([f615037](f615037)) * Rename 'Any' type bound to 'Linear' ([#2421](#2421)) ([c2f8b30](c2f8b30)) * Split `TypeArg::Sequence` into tuples and lists. ([#2140](#2140)) ([cc4997f](cc4997f)) * Standarize the string formating of sum types and values ([#2432](#2432)) ([ec207e7](ec207e7)) * Use binary envelopes for operation lower_func encoding ([#2447](#2447)) ([2c16a77](2c16a77)) ### Bug Fixes * Ensure SumTypes have the same json encoding in -rs and -py ([#2465](#2465)) ([7f97e6f](7f97e6f)) * Escape html-like labels in DotRenderer ([#2383](#2383)) ([eaa7dfe](eaa7dfe)) * Export metadata in Python ([#2342](#2342)) ([7be52db](7be52db)) * Fix model export of `Opaque` types. ([#2446](#2446)) ([3943499](3943499)) * Fixed bug in python model export name mangling. ([#2323](#2323)) ([041342f](041342f)) * Fixed bugs in model CFG handling and improved CFG signatures ([#2334](#2334)) ([ccd2eb2](ccd2eb2)) * Fixed export of `Call` and `LoadConst` nodes in `hugr-py`. ([#2429](#2429)) ([6a0e270](6a0e270)) * Fixed invalid extension name in test. ([#2319](#2319)) ([c58ddbf](c58ddbf)) * Fixed two bugs in import/export of function operations ([#2324](#2324)) ([1ad450f](1ad450f)) * map IntValue to unsigned repr when serializing ([#2413](#2413)) ([26d426e](26d426e)), closes [#2409](#2409) * Order hints on input and output nodes. ([#2422](#2422)) ([a31ccbc](a31ccbc)) * **py:** correct ConstString JSON encoding ([#2325](#2325)) ([9649a48](9649a48)) * StaticArrayVal payload encoding, improve roundtrip checker ([#2444](#2444)) ([1a301eb](1a301eb)) * stringify metadata before escaping in renderer ([#2405](#2405)) ([8d67420](8d67420)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Release-As: 0.13.0rc1 --------- Co-authored-by: Agustín Borgna <[email protected]>
## 🤖 New release * `hugr-model`: 0.22.0 -> 0.22.1 * `hugr-core`: 0.22.0 -> 0.22.1 * `hugr-llvm`: 0.22.0 -> 0.22.1 * `hugr-passes`: 0.22.0 -> 0.22.1 (✓ API compatible changes) * `hugr`: 0.22.0 -> 0.22.1 (✓ API compatible changes) * `hugr-cli`: 0.22.0 -> 0.22.1 * `hugr-persistent`: 0.2.0 -> 0.2.1 <details><summary><i><b>Changelog</b></i></summary><p> ## `hugr-model` <blockquote> ## [0.22.0](hugr-model-v0.21.0...hugr-model-v0.22.0) - 2025-07-24 ### New Features - Names of private functions become `core.title` metadata. ([#2448](#2448)) - include generator metatada in model import and cli validate errors ([#2452](#2452)) - Version number in hugr binary format. ([#2468](#2468)) - Use semver crate for -model version, and include in docs ([#2471](#2471)) </blockquote> ## `hugr-core` <blockquote> ## [0.22.0](hugr-core-v0.21.0...hugr-core-v0.22.0) - 2025-07-24 ### Bug Fixes - Ensure SumTypes have the same json encoding in -rs and -py ([#2465](#2465)) ### New Features - Export entrypoint metadata in Python and fix bug in import ([#2434](#2434)) - Names of private functions become `core.title` metadata. ([#2448](#2448)) - [**breaking**] Use binary envelopes for operation lower_func encoding ([#2447](#2447)) - [**breaking**] Update portgraph dependency to 0.15 ([#2455](#2455)) - Detect and fail on unrecognised envelope flags ([#2453](#2453)) - include generator metatada in model import and cli validate errors ([#2452](#2452)) - [**breaking**] Add `insert_region` to HugrMut ([#2463](#2463)) - Non-region entrypoints in `hugr-model`. ([#2467](#2467)) </blockquote> ## `hugr-llvm` <blockquote> ## [0.21.0](hugr-llvm-v0.20.2...hugr-llvm-v0.21.0) - 2025-07-09 ### New Features - [**breaking**] No nested FuncDefns (or AliasDefns) ([#2256](#2256)) - [**breaking**] Split `TypeArg::Sequence` into tuples and lists. ([#2140](#2140)) - [**breaking**] More helpful error messages in model import ([#2272](#2272)) - [**breaking**] Merge `TypeParam` and `TypeArg` into one `Term` type in Rust ([#2309](#2309)) - Add `MakeError` op ([#2377](#2377)) </blockquote> ## `hugr-passes` <blockquote> ## [0.22.1](hugr-passes-v0.22.0...hugr-passes-v0.22.1) - 2025-07-28 ### New Features - Include copy_discard_array in DelegatingLinearizer::default ([#2479](#2479)) - Inline calls to functions not on cycles in the call graph ([#2450](#2450)) </blockquote> ## `hugr` <blockquote> ## [0.22.1](hugr-v0.22.0...hugr-v0.22.1) - 2025-07-28 ### New Features - Include copy_discard_array in DelegatingLinearizer::default ([#2479](#2479)) - Inline calls to functions not on cycles in the call graph ([#2450](#2450)) </blockquote> ## `hugr-cli` <blockquote> ## [0.22.0](hugr-cli-v0.21.0...hugr-cli-v0.22.0) - 2025-07-24 ### New Features - include generator metatada in model import and cli validate errors ([#2452](#2452)) </blockquote> ## `hugr-persistent` <blockquote> ## [0.2.0](hugr-persistent-v0.1.0...hugr-persistent-v0.2.0) - 2025-07-24 ### New Features - [**breaking**] Update portgraph dependency to 0.15 ([#2455](#2455)) </blockquote> </p></details> --- This PR was generated with [release-plz](https://github.com/release-plz/release-plz/).
....instead require them all at the top level. This is intended as a preliminary to linking. closes #2249.
Thus:
HugrBuilder::module_root_builder, which you can use to add FuncDefns to the module (outside the mainXXXBuilder<Hugr>); the downside is you have to hang on to the module-root-builder while you use builders that borrow it. This could be made easier by adding insteaddefine_functionitself (andadd_alias_defn) toHugrBuilder- doesn't really seem the principled thing but would be slightly more ergonomic; thoughts?module_root_builderthere :).SimpleTestConfigproduces Hugr's where entrypoint is now themainfunction, and has lost some (currently-disabled) debug printouts, see comment.diverse_dfg_childrentest as Consts within DFGs are well-covered by other tests.FatExt::new_rootis now the root (and always a Module),new_entrypointgets the entrypointNote this removes the possibility of e.g.
SimpleReplacementincluding FuncDefns in the replacement (that would have been transplanted into the target Hugr).BREAKING CHANGE: FuncDefns must be moved to beneath Module.
Container::define_functionis gone, useHugrBuilder::module_root_builder; similarly in hugr-pyDefinitionBuilder(define_function->module_root_builder().define_function). In hugr-llvm, some uses ofFatExt::new_rootshould becomenew_entrypoint.