Skip to content

feat: post-rebase 1Q squashing in QSystemPass#1430

Draft
CalMacCQ wants to merge 12 commits intomainfrom
cm/post_rebase_squashing
Draft

feat: post-rebase 1Q squashing in QSystemPass#1430
CalMacCQ wants to merge 12 commits intomainfrom
cm/post_rebase_squashing

Conversation

@CalMacCQ
Copy link
Contributor

@CalMacCQ CalMacCQ commented Mar 2, 2026

Still have plenty of work to do on this (including fixing some failing tests)

closes #1419

Also one the issues are fixed I need to do proper testing with other components in the stack before this can be merged.

@CalMacCQ CalMacCQ requested a review from a team as a code owner March 2, 2026 15:55
@CalMacCQ CalMacCQ requested a review from acl-cqc March 2, 2026 15:55
@CalMacCQ CalMacCQ marked this pull request as draft March 2, 2026 15:55
.unwrap();

let (mut hugr, [call_node, h_node, f_node, rx_node, main_node]) = {
let (mut hugr, [call_node, h_node, f_node, rz_node, main_node]) = {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was a typo I think

Copy link
Contributor Author

@CalMacCQ CalMacCQ Mar 10, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This surely isn't the breaking change hugrbot is mentioning below.

EDIT: this is a test so it shouldn't be part of the API

@hugrbot
Copy link
Collaborator

hugrbot commented Mar 10, 2026

This PR contains breaking changes to the public Rust API.
Please deprecate the old API instead (if possible), or mark the PR with a ! to indicate a breaking change.

cargo-semver-checks summary
    Building tket v0.17.0 (current)
     Built [  46.589s] (current)
   Parsing tket v0.17.0 (current)
    Parsed [   0.098s] (current)
  Building tket v0.17.0 (baseline)
     Built [  46.907s] (baseline)
   Parsing tket v0.17.0 (baseline)
    Parsed [   0.090s] (baseline)
  Checking tket v0.17.0 -> v0.17.0 (assume minor change)
   Checked [   0.112s] 196 checks: 196 pass, 56 skip
   Summary no semver update required
  Finished [  95.901s] tket
  Building tket-qsystem v0.23.0 (current)
error: running cargo-doc on crate 'tket-qsystem' failed with output:
-----
 Compiling proc-macro2 v1.0.106
 Compiling quote v1.0.45
 Compiling unicode-ident v1.0.24
 Compiling libc v0.2.183
 Compiling memchr v2.8.0
 Compiling serde_core v1.0.228
 Compiling shlex v1.3.0
 Compiling syn v2.0.117
 Compiling find-msvc-tools v0.1.9
  Checking once_cell v1.21.3
 Compiling jobserver v0.1.34
  Checking cfg-if v1.0.4
 Compiling cc v1.2.56
 Compiling serde v1.0.228
 Compiling heck v0.5.0
 Compiling autocfg v1.5.0
 Compiling aho-corasick v1.1.4
 Compiling num-traits v0.2.19
 Compiling zmij v1.0.21
 Compiling regex-syntax v0.8.10
 Compiling version_check v0.9.5
  Checking either v1.15.0
 Compiling glob v0.3.3
 Compiling crossbeam-utils v0.8.21
 Compiling semver v1.0.27
 Compiling equivalent v1.0.2
 Compiling hashbrown v0.16.1
 Compiling regex-automata v0.4.14
 Compiling indexmap v2.13.0
 Compiling lazy_static v1.5.0
 Compiling thiserror v2.0.18
 Compiling pkg-config v0.3.32
 Compiling serde_derive v1.0.228
 Compiling getrandom v0.4.2
 Compiling unicode-segmentation v1.12.0
 Compiling zstd-sys v2.0.16+zstd.1.5.7
 Compiling regex v1.12.3
 Compiling convert_case v0.10.0
 Compiling thiserror-impl v2.0.18
 Compiling ident_case v1.0.1
  Checking unicode-width v0.2.2
 Compiling unicode-xid v0.2.6
  Checking smallvec v1.15.1
 Compiling strsim v0.11.1
 Compiling fnv v1.0.7
 Compiling serde_json v1.0.149
 Compiling ucd-trie v0.1.7
  Checking itoa v1.0.17
 Compiling pest v2.8.6
 Compiling darling_core v0.21.3
 Compiling itertools v0.13.0
 Compiling derive_more-impl v2.1.1
  Checking crossbeam-epoch v0.9.18
 Compiling radium v0.7.0
 Compiling zerocopy v0.8.42
 Compiling paste v1.0.15
 Compiling rayon-core v1.13.0
 Compiling typeid v1.0.3
  Checking foldhash v0.1.5
  Checking hashbrown v0.15.5
 Compiling darling_macro v0.21.3
  Checking crossbeam-deque v0.8.6
 Compiling pest_meta v2.8.6
 Compiling slotmap_fork_lmondada v1.0.8
 Compiling ahash v0.8.12
  Checking tracing-core v0.1.36
  Checking fixedbitset v0.5.7
  Checking pin-project-lite v0.2.17
 Compiling rustix v1.1.4
 Compiling erased-serde v0.4.10
 Compiling zstd-safe v7.2.4
 Compiling ref-cast v1.0.25
  Checking derive_more v2.1.1
 Compiling winnow v0.7.15
  Checking tap v1.0.1
 Compiling thiserror v1.0.69
  Checking wyz v0.5.1
  Checking petgraph v0.8.3
 Compiling pest_generator v2.8.6
 Compiling toml_parser v1.0.9+spec-1.1.0
 Compiling darling v0.21.3
 Compiling llvm-sys v140.1.3
 Compiling ref-cast-impl v1.0.25
 Compiling thiserror-impl v1.0.69
 Compiling rustc_version v0.4.1
 Compiling serde_derive_internals v0.29.1
  Checking itertools v0.14.0
 Compiling cgmath v0.18.0
  Checking arrayvec v0.5.2
 Compiling toml_datetime v1.0.0+spec-1.1.0
  Checking linux-raw-sys v0.12.1
  Checking bitflags v2.11.0
 Compiling convert_case v0.4.0
  Checking byteorder v1.5.0
 Compiling parking_lot_core v0.9.12
  Checking typed-arena v2.0.2
  Checking rustc-hash v2.1.1
 Compiling typetag v0.2.21
  Checking funty v2.0.0
  Checking pretty v0.12.5
  Checking bitvec v1.0.1
  Checking fxhash v0.2.1
 Compiling derive_more v0.99.20
 Compiling toml_edit v0.25.4+spec-1.1.0
 Compiling schemars_derive v1.2.1
 Compiling rstest_macros v0.26.1
 Compiling serde_with_macros v3.17.0
  Checking rayon v1.11.0
 Compiling pest_derive v2.8.6
  Checking ordered-float v5.1.0
 Compiling derive-where v1.6.0
 Compiling strum_macros v0.28.0
 Compiling tracing-attributes v0.1.31
 Compiling typetag-impl v0.2.21
 Compiling delegate v0.13.5
 Compiling clang-sys v1.8.1
  Checking approx v0.4.0
  Checking smol_str v0.3.6
  Checking allocator-api2 v0.2.21
 Compiling fixedbitset v0.4.2
  Checking fastrand v2.3.0
  Checking scopeguard v1.2.0
  Checking inventory v0.3.22
  Checking utf8parse v0.2.2
  Checking bumpalo v3.20.2
 Compiling prettyplease v0.2.37
  Checking base64 v0.22.1
  Checking utf8-width v0.1.8
  Checking dyn-clone v1.0.20
  Checking capnp v0.25.1
  Checking schemars v1.2.1
  Checking html-escape v0.2.13
  Checking relrc v0.5.0
  Checking hashbrown v0.14.5
  Checking anstyle-parse v0.2.7
  Checking lock_api v0.4.14
  Checking tempfile v3.26.0
 Compiling petgraph v0.6.5
 Compiling enum_dispatch v0.3.13
  Checking strum v0.28.0
  Checking portgraph v0.15.3
  Checking hugr-model v0.25.7
  Checking tracing v0.1.44
  Checking zstd v0.13.3
  Checking serde_with v3.17.0
 Compiling proc-macro-crate v3.5.0
 Compiling ascent_base v0.8.0
 Compiling futures-macro v0.3.32
 Compiling derive-syn-parse v0.2.0
  Checking slab v0.4.12
  Checking anstyle v1.0.13
  Checking futures-task v0.3.32
  Checking downcast-rs v2.0.2
 Compiling relative-path v1.9.3
 Compiling pastey v0.2.1
 Compiling minimal-lexical v0.2.1
  Checking anstyle-query v1.1.5
 Compiling anyhow v1.0.102
  Checking is_terminal_polyfill v1.70.2
  Checking static_assertions v1.1.0
  Checking futures-core v0.3.32
  Checking colorchoice v1.0.4
 Compiling inkwell v0.8.0
 Compiling duplicate v2.0.1
  Checking anstream v0.6.21
  Checking hugr-core v0.25.7
  Checking futures-util v0.3.32
 Compiling nom v7.1.3
 Compiling ascent_macro v0.8.0
  Checking dashmap v5.5.3
 Compiling inkwell_internals v0.13.0
 Compiling libloading v0.8.9
 Compiling hugr-llvm v0.25.7
  Checking console v0.15.11
  Checking instant v0.1.13
  Checking boxcar v0.1.0
  Checking clap_lex v1.0.0
 Compiling bindgen v0.72.1
  Checking futures-timer v3.0.3
  Checking similar v2.7.0
  Checking insta v1.46.3
  Checking clap_builder v4.5.60
  Checking rstest v0.26.1
  Checking ascent v0.8.0
 Compiling cexpr v0.6.0
 Compiling strum_macros v0.27.2
 Compiling clap_derive v4.5.55
 Compiling proc-macro-error-attr2 v2.0.0
  Checking log v0.4.29
  Checking strum v0.27.2
 Compiling proc-macro-error2 v2.0.1
  Checking clap v4.5.60
  Checking hugr-passes v0.25.7
 Compiling conan2 v0.1.9
  Checking uuid v1.22.0
  Checking num-integer v0.1.46
  Checking bytecount v0.6.9
  Checking same-file v1.0.6
  Checking walkdir v2.5.0
  Checking papergrid v0.17.0
  Checking num-bigint v0.4.6
  Checking tket-json-rs v0.8.1
 Compiling tabled_derive v0.11.0
  Checking hugr v0.25.7
  Checking sharded-slab v0.1.7
  Checking tracing-log v0.2.0
  Checking testing_table v0.3.0
  Checking csv-core v0.1.13
  Checking is-terminal v0.4.17
  Checking thread_local v1.1.9
  Checking ryu v1.0.23
  Checking iana-time-zone v0.1.65
  Checking nu-ansi-term v0.50.3
  Checking chrono v0.4.44
  Checking tracing-subscriber v0.3.22
  Checking csv v1.4.0
 Compiling tket1-passes v0.0.0 (/home/runner/work/tket2/tket2/PR_BRANCH/tket1-passes)
  Checking clio v0.3.5
  Checking tabled v0.20.0
  Checking num-rational v0.4.2
  Checking clap-verbosity-flag v3.0.4
  Checking priority-queue v2.7.0
  Checking crossbeam-channel v0.5.15
  Checking bytemuck v1.25.0
  Checking tket v0.17.0 (/home/runner/work/tket2/tket2/PR_BRANCH/tket)
  Checking hugr-cli v0.25.7
error[E0277]: the trait bound `BoolOp: strum::IntoEnumIterator` is not satisfied
 --> /home/runner/work/tket2/tket2/PR_BRANCH/tket/src/extension/bool.rs:32:13
  |
32 |             BoolOp::load_all_ops(ext, ext_ref).unwrap();
  |             ^^^^^^ unsatisfied trait bound
  |
help: the trait `strum::IntoEnumIterator` is not implemented for `BoolOp`
 --> /home/runner/work/tket2/tket2/PR_BRANCH/tket/src/extension/bool.rs:118:1
  |
118 | pub enum BoolOp {
  | ^^^^^^^^^^^^^^^
note: there are multiple different versions of crate `strum` in the dependency graph
 --> /home/runner/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/strum-0.28.0/src/lib.rs:99:1
  |
99 | pub trait IntoEnumIterator: Sized {
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ this is the expected trait
  |
 ::: /home/runner/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/strum-0.27.2/src/lib.rs:100:1
  |
100 | pub trait IntoEnumIterator: Sized {
  | --------------------------------- this is the found trait
  = help: you can use `cargo tree` to explore your dependency tree
  = help: the following other types implement trait `strum::IntoEnumIterator`:
            BArrayUnsafeOpDef
            ConvertOpDef
            FloatOps
            GenericArrayOpDef<AK>
            IntOpDef
            ListOp
            LogicOp
            PtrOpDef
          and 2 others
note: required by a bound in `load_all_ops`
 --> /home/runner/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/hugr-core-0.25.7/src/extension/simple_op.rs:109:15
  |
104 |     fn load_all_ops(
  |        ------------ required by a bound in this associated function
...
109 |         Self: IntoEnumIterator,
  |               ^^^^^^^^^^^^^^^^ required by this bound in `MakeOpDef::load_all_ops`

error[E0277]: the trait bound `RotationOp: strum::IntoEnumIterator` is not satisfied
 --> /home/runner/work/tket2/tket2/PR_BRANCH/tket/src/extension/rotation.rs:215:5
  |
215 |     RotationOp::load_all_ops(extension, extension_ref).expect("add fail");
  |     ^^^^^^^^^^ unsatisfied trait bound
  |
help: the trait `strum::IntoEnumIterator` is not implemented for `RotationOp`
 --> /home/runner/work/tket2/tket2/PR_BRANCH/tket/src/extension/rotation.rs:119:1
  |
119 | pub enum RotationOp {
  | ^^^^^^^^^^^^^^^^^^^
note: there are multiple different versions of crate `strum` in the dependency graph
 --> /home/runner/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/strum-0.28.0/src/lib.rs:99:1
  |
99 | pub trait IntoEnumIterator: Sized {
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ this is the expected trait
  |
 ::: /home/runner/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/strum-0.27.2/src/lib.rs:100:1
  |
100 | pub trait IntoEnumIterator: Sized {
  | --------------------------------- this is the found trait
  = help: you can use `cargo tree` to explore your dependency tree
  = help: the following other types implement trait `strum::IntoEnumIterator`:
            BArrayUnsafeOpDef
            ConvertOpDef
            FloatOps
            GenericArrayOpDef<AK>
            IntOpDef
            ListOp
            LogicOp
            PtrOpDef
          and 2 others
note: required by a bound in `load_all_ops`
 --> /home/runner/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/hugr-core-0.25.7/src/extension/simple_op.rs:109:15
  |
104 |     fn load_all_ops(
  |        ------------ required by a bound in this associated function
...
109 |         Self: IntoEnumIterator,
  |               ^^^^^^^^^^^^^^^^ required by this bound in `MakeOpDef::load_all_ops`

error[E0277]: the trait bound `TketOp: strum::IntoEnumIterator` is not satisfied
 --> /home/runner/work/tket2/tket2/PR_BRANCH/tket/src/extension.rs:102:13
  |
102 |             TketOp::load_all_ops(res, ext_ref).expect("add_fail");
  |             ^^^^^^ unsatisfied trait bound
  |
help: the trait `strum::IntoEnumIterator` is not implemented for `TketOp`
 --> /home/runner/work/tket2/tket2/PR_BRANCH/tket/src/ops.rs:43:1
  |
43 | pub enum TketOp {
  | ^^^^^^^^^^^^^^^
note: there are multiple different versions of crate `strum` in the dependency graph
 --> /home/runner/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/strum-0.28.0/src/lib.rs:99:1
  |
99 | pub trait IntoEnumIterator: Sized {
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ this is the expected trait
  |
 ::: /home/runner/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/strum-0.27.2/src/lib.rs:100:1
  |
100 | pub trait IntoEnumIterator: Sized {
  | --------------------------------- this is the found trait
  = help: you can use `cargo tree` to explore your dependency tree
  = help: the following other types implement trait `strum::IntoEnumIterator`:
            BArrayUnsafeOpDef
            ConvertOpDef
            FloatOps
            GenericArrayOpDef<AK>
            IntOpDef
            ListOp
            LogicOp
            PtrOpDef
          and 2 others
note: required by a bound in `load_all_ops`
 --> /home/runner/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/hugr-core-0.25.7/src/extension/simple_op.rs:109:15
  |
104 |     fn load_all_ops(
  |        ------------ required by a bound in this associated function
...
109 |         Self: IntoEnumIterator,
  |               ^^^^^^^^^^^^^^^^ required by this bound in `MakeOpDef::load_all_ops`

error[E0277]: the trait bound `BoolOp: strum::IntoEnumIterator` is not satisfied
 --> /home/runner/work/tket2/tket2/PR_BRANCH/tket/src/llvm/bool.rs:113:14
  |
113 |             .simple_extension_op(move |context, args, op| self.emit_bool_op(context, args, op))
  |              ^^^^^^^^^^^^^^^^^^^ unsatisfied trait bound
  |
help: the trait `strum::IntoEnumIterator` is not implemented for `BoolOp`
 --> /home/runner/work/tket2/tket2/PR_BRANCH/tket/src/extension/bool.rs:118:1
  |
118 | pub enum BoolOp {
  | ^^^^^^^^^^^^^^^
note: there are multiple different versions of crate `strum` in the dependency graph
 --> /home/runner/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/strum-0.28.0/src/lib.rs:99:1
  |
99 | pub trait IntoEnumIterator: Sized {
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ this is the expected trait
  |
 ::: /home/runner/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/strum-0.27.2/src/lib.rs:100:1
  |
100 | pub trait IntoEnumIterator: Sized {
  | --------------------------------- this is the found trait
  = help: you can use `cargo tree` to explore your dependency tree
  = help: the following other types implement trait `strum::IntoEnumIterator`:
            BArrayUnsafeOpDef
            ConvertOpDef
            FloatOps
            GenericArrayOpDef<AK>
            IntOpDef
            ListOp
            LogicOp
            PtrOpDef
          and 2 others
note: required by a bound in `CodegenExtsBuilder::<'a, H>::simple_extension_op`
 --> /home/runner/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/hugr-llvm-0.25.7/src/custom.rs:110:48
  |
110 |     pub fn simple_extension_op<Op: MakeOpDef + IntoEnumIterator>(
  |                                                ^^^^^^^^^^^^^^^^ required by this bound in `CodegenExtsBuilder::<'a, H>::simple_extension_op`

error[E0277]: the trait bound `RotationOp: strum::IntoEnumIterator` is not satisfied
 --> /home/runner/work/tket2/tket2/PR_BRANCH/tket/src/llvm/rotation.rs:208:14
  |
208 |             .simple_extension_op(move |context, args, op| self.emit_rotation_op(context, args, op))
  |              ^^^^^^^^^^^^^^^^^^^ unsatisfied trait bound
  |
help: the trait `strum::IntoEnumIterator` is not implemented for `RotationOp`
 --> /home/runner/work/tket2/tket2/PR_BRANCH/tket/src/extension/rotation.rs:119:1
  |
119 | pub enum RotationOp {
  | ^^^^^^^^^^^^^^^^^^^
note: there are multiple different versions of crate `strum` in the dependency graph
 --> /home/runner/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/strum-0.28.0/src/lib.rs:99:1
  |
99 | pub trait IntoEnumIterator: Sized {
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ this is the expected trait
  |
 ::: /home/runner/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/strum-0.27.2/src/lib.rs:100:1
  |
100 | pub trait IntoEnumIterator: Sized {
  | --------------------------------- this is the found trait
  = help: you can use `cargo tree` to explore your dependency tree
  = help: the following other types implement trait `strum::IntoEnumIterator`:
            BArrayUnsafeOpDef
            ConvertOpDef
            FloatOps
            GenericArrayOpDef<AK>
            IntOpDef
            ListOp
            LogicOp
            PtrOpDef
          and 2 others
note: required by a bound in `CodegenExtsBuilder::<'a, H>::simple_extension_op`
 --> /home/runner/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/hugr-llvm-0.25.7/src/custom.rs:110:48
  |
110 |     pub fn simple_extension_op<Op: MakeOpDef + IntoEnumIterator>(
  |                                                ^^^^^^^^^^^^^^^^ required by this bound in `CodegenExtsBuilder::<'a, H>::simple_extension_op`

For more information about this error, try `rustc --explain E0277`.
error: could not compile `tket` (lib) due to 5 previous errors

-----

error: failed to build rustdoc for crate tket-qsystem v0.23.0
note: this is usually due to a compilation error in the crate,
    and is unlikely to be a bug in cargo-semver-checks
note: the following command can be used to reproduce the error:
    cargo new --lib example &&
        cd example &&
        echo '[workspace]' >> Cargo.toml &&
        cargo add --path /home/runner/work/tket2/tket2/PR_BRANCH/tket-qsystem --features cli,default,llvm &&
        cargo check &&
        cargo doc

error: aborting due to failure to build rustdoc for crate tket-qsystem v0.23.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature]: Add post rebase 1Q gate optimisation in QSystemPass

2 participants