Releases: CQCL/hugr
Releases · CQCL/hugr
hugr-py: v0.10.2
hugr: v0.14.1
hugr-py: v0.10.1
hugr-passes: v0.14.1
hugr-model: v0.16.0
New Features
- Scoping rules and utilities for symbols, links and variables (#1754)
hugr-llvm: v0.14.1
hugr-core: v0.14.1
hugr-cli: v0.14.1
New Features
- Print
hugr-cli
's correct version when using '--version' (#1790)
hugr: v0.14.0
This release includes a long list of breaking changes that simplify the API, specially around
extensions and extension registry management.
Extension definitions are now tracked by each operation and type inside the hugr, so there is no
need to pass around extension registries any more.
⚠ BREAKING CHANGES
Core
- The
LoadFunction::signature
field has been removed. Replaced withDataflowOpTrait::signature()
. - Types which implement
AsRef
- both library ones such asRc
and custom ones - no longer get a blanket impl ofHugrView
. Workaround by manually callingas_ref()
and using the&Hugr
yourself. - Removed
Array
type variant from the serialization format. Optrait
now requiresSized
andClone
and is no longer object safe.DataflowOptrait
now requiresSized
and has an additional required methodsubstitute
.::extension::resolve
operations now useWeakExtensionRegistry
es.ExtensionRegistry
andPackage
now wrap Extensions inArc
s.- Renamed
OpDef::extension
andTypeDef::extension
toextension_id
. extension now returns weak references to the Extension defining them. Extension::with_reqs
moved toset_reqs
, which takes&mut self
instead ofself
.Extension::add_type
andExtension::add_op
now take an extra parameter. See docs for example usage.ExtensionRegistry::register_updated
andregister_updated_ref
are no longer fallible.- Removed
CustomType::new_simple
. Custom types can no longer be const-constructed. - Added
init_signature
andextension_ref
methods to theMakeOpDef
trait. - Redefined the const types in the prelude to generator functions.
- Removed
resolve_opaque_op
andresolve_extension_ops
. UseHugr::resolve_extension_defs
instead. - Removed
ExtensionRegistry::try_new
. Usenew
instead, and callExtensionRegistry::validate
to validate. ExtensionSet::insert
andsingleton
take extension ids by value instead of cloning internally.- Removed
update_validate
. The hugr extensions should be resolved at load time, so we can use validate instead. - The builder
finish_hugr
function family no longer takes a registry as parameter, and the_prelude
variants have been removed. extension_reqs
field inFunctionType
andExtension
renamed toruntime_reqs
.- Removed the extension registry argument from validate calls.
- Removed the extension registry argument from operation instantiation methods.
- Removed most extension-specific test registries. Use
EMPTY_REG
,PRELUDE_REGISTRY
, orSTD_REG
instead.
Extensions
- Array scan and repeat ops get an additional type parameter specifying the extension requirements of their input functions. Furthermore, repeat is no longer part of
ArrayOpDef
but is instead specified via a newArrayScan
struct. collections
extension renamed tocollections.list
- Array type and operations have been moved out of prelude and into a new
collections.array
extension.
Passes
ConstantFoldPass
is no longerUnwindSafe
,RefUnwindSafe
, norCopy
.fold_leaf_op
andfind_consts
have been removed.ConstantFoldPass::new
function removed. Instead useConstantFoldPass::default
.- Variant
ConstFoldError::SimpleReplacementError
was removed.
Bug Fixes
- hierarchical simple replacement using insert_hugr (#1718)
- hugr-py not adding extension-reqs on custom ops (#1759)
- [breaking] Replace
LoadFunction::signature
withLoadFunction::instantiation
(#1756) - Resolve types in
Value
s and custom consts (#1779) - allow disconnected outputs in SiblingSubgraph::from_node (#1769)
Documentation
- Fix comment for scan op (#1751)
New Features
- Dataflow analysis framework (#1476)
- (hugr-passes) [breaking] Rewrite constant_fold_pass using dataflow framework (#1603)
- Export/import of JSON metadata (#1622)
- Add
SiblingSubgraph::from_node
(#1655) - [breaking] Replace GATs with
impl Iterator
returns (RPITIT) onHugrView
(#1660) - Emulate
TypeBound
s on parameters via constraints. (#1624) - Add array
repeat
andscan
ops (#1633) - move unwrap builder to hugr core (#1674)
- Lists and extension sets with splicing (#1657)
- add HugrView::first_child and HugrMut::remove_subtree (#1721)
- Lower collections extension (#1720)
- [breaking] impl HugrView for any &(mut) to a HugrView (#1678)
- [breaking] Make array repeat and scan ops generic over extension reqs (#1716)
- Print []+[] as Bool and [] as Unit in user-facing messages (#1745)
- Add
PartialEq
impls forFuncTypeBase
andCow<FuncTypeBase>
(#1762) - [breaking] Rename
collections
extension tocollections.list
(#1764) - add
is_
variant methods toEdgeKind
(#1768) - [breaking] Move arrays from prelude into new extension (#1770)
- Add
LoadNat
operation to enable loading genericBoundedNat
s into runtime values (#1763) - [breaking] Add
monomorphization
pass (#1733) - Update extension pointers in customConsts (#1780)
- [breaking] Use registries of
Weak<Extension>
s when doing resolution (#1781) - [breaking] Resolve extension references inside the extension themselves (#1783)
- [breaking] Remove ExtensionRegistry args in UnwrapBuilder and ListOp (#1785)
- export llvm test utilities under llvm-test feature (#1677)
- [breaking] Share
Extension
s underArc
s (#1647) - [breaking] OpDefs and TypeDefs keep a reference to their extension (#1719)
- [breaking] Have
CustomType
s reference theirExtension
definition (#1723) - [breaking] Resolve OpaqueOps and CustomType extensions (#1735)
- [breaking]
used_extensions
calls for both ops and signatures (#1739) - [breaking] Hugrs now keep a
ExtensionRegistry
with their requirements (#1738) - [breaking] rename
extension_reqs
toruntime_reqs
(#1776) - [breaking] Don't require explicit extension registers for validation (#1784)
Performance
Refactor
hugr-py: v0.10.0
0.10.0 (2024-12-16)
⚠ BREAKING CHANGES
- Removed the extension registry argument from
validate
calls. Removed the extension registry argument from operation instantiation methods. Removed most extension-specific test registries. UseEMPTY_REG
,PRELUDE_REGISTRY
, orSTD_REG
instead. extension_reqs
field in FunctionType and Extension renamed toruntime_reqs
- Array type and operations have been moved out of
prelude
and into a newcollections.array
extension. (py)list_type
method replaced withList
class. RemovedArray
type variant from the serialization format. collections
extension renamed tocollections.list
- The
LoadFunction::signature
field is removed. Replace uses withDataflowOpTrait::signature()
. - Array
scan
andrepeat
ops get an additional type parameter specifying the extension requirements of their input functions. Furthermore,repeat
is no longer part ofArrayOpDef
but is instead specified via a newArrayScan
struct.
Features
- Add
LoadNat
operation to enable loading genericBoundedNat
s into runtime values (#1763) (6f035d6), closes #1629 - Add array
repeat
andscan
ops (#1633) (649589c), closes #1627 - Automatically add the custom op's extension to its 'runtime_reqs' set (#1787) (3ef5bd9)
- Don't require explicit extension registers for validation (#1784) (b517dc3)
- Make array repeat and scan ops generic over extension reqs (#1716) (4c1c6ee)
- Move arrays from prelude into new extension (#1770) (187ea8f)
- Rename
collections
extension tocollections.list
(#1764) (eef239f) - rename
extension_reqs
toruntime_reqs
(#1776) (5f5bce4)
Bug Fixes
- hugr-py not adding extension-reqs on custom ops (#1759) (97ba7f4)
- py: allow conditional cases to be defined out of order (#1599) (583d21d)
- Replace
LoadFunction::signature
withLoadFunction::instantiation
(#1756) (5b50d1d) - Resolve types in
Value
s and custom consts (#1779) (080eaae) - Update number of ports for PartialOps, and sanitize orderd edges (#1635) (81a1385), closes #1625