Skip to content

refactor: start cleaning up SiblingSubgraph convexity checking#2956

Merged
acl-cqc merged 4 commits intomainfrom
acl/sib_sub
Mar 17, 2026
Merged

refactor: start cleaning up SiblingSubgraph convexity checking#2956
acl-cqc merged 4 commits intomainfrom
acl/sib_sub

Conversation

@acl-cqc
Copy link
Copy Markdown
Contributor

@acl-cqc acl-cqc commented Mar 17, 2026

  • Drop an unused From impl to create a Cow (not sure why we ever needed this but we don't now?!). Technically I think this may make the PR breaking. But rs-semver-checks doesn't think so, so I reckon we can get this in a patch release.
  • That allows deriving Clone rather than manually implementing
  • Correct some type annotations and docstrings that are specifically TopoConvexChecker (a typedef to a particular instantiation of the generic struct ConvexChecker)
  • Remove the lazy initialisation of checker stuff, it seems like a bunch of code for no/small obvious benefit (and it was all private to the file)

ValidationMode::WithChecker(c) => Some(c),
ValidationMode::CheckConvexity => {
checker = ConvexChecker::new(hugr, self.get_parent(hugr));
checker = TopoConvexChecker::new(hugr, self.get_parent(hugr));
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

ValidationMode::WithChecker specifically contains a TopoConvexChecker so this must match that

@codecov
Copy link
Copy Markdown

codecov bot commented Mar 17, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 83.86%. Comparing base (de7b9f7) to head (61f2e44).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2956      +/-   ##
==========================================
+ Coverage   83.85%   83.86%   +0.01%     
==========================================
  Files         267      267              
  Lines       52966    52956      -10     
  Branches    46882    46872      -10     
==========================================
  Hits        44414    44414              
+ Misses       6283     6273      -10     
  Partials     2269     2269              
Flag Coverage Δ
python 88.80% <ø> (ø)
rust 83.22% <100.00%> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@acl-cqc acl-cqc requested a review from aborgna-q March 17, 2026 18:00
@acl-cqc acl-cqc marked this pull request as ready for review March 17, 2026 18:00
@acl-cqc acl-cqc requested a review from a team as a code owner March 17, 2026 18:00
Copy link
Copy Markdown
Collaborator

@aborgna-q aborgna-q left a comment

Choose a reason for hiding this comment

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

Weird that it's not breaking, but LGTM

@acl-cqc acl-cqc enabled auto-merge March 17, 2026 18:21
@acl-cqc acl-cqc added this pull request to the merge queue Mar 17, 2026
Merged via the queue into main with commit 39d047f Mar 17, 2026
57 of 58 checks passed
@acl-cqc acl-cqc deleted the acl/sib_sub branch March 17, 2026 18:25
@hugrbot hugrbot mentioned this pull request Mar 17, 2026
github-merge-queue bot pushed a commit that referenced this pull request Mar 19, 2026
## 🤖 New release

* `hugr-model`: 0.26.0 -> 0.26.1
* `hugr-core`: 0.26.0 -> 0.26.1 (✓ API compatible changes)
* `hugr-llvm`: 0.26.0 -> 0.26.1
* `hugr`: 0.26.0 -> 0.26.1 (✓ API compatible changes)
* `hugr-passes`: 0.26.0 -> 0.26.1 (✓ API compatible changes)
* `hugr-cli`: 0.26.0 -> 0.26.1
* `hugr-persistent`: 0.5.0 -> 0.5.1

<details><summary><i><b>Changelog</b></i></summary><p>

## `hugr-model`

<blockquote>

##
[0.26.0](hugr-model-v0.25.7...hugr-model-v0.26.0)
- 2026-03-16

### Testing

- Replace model text snapshots with roundtrip tests
([#2933](#2933))
- Add missing width arg in model-call example
([#2945](#2945))
</blockquote>

## `hugr-core`

<blockquote>

##
[0.26.1](hugr-core-v0.26.0...hugr-core-v0.26.1)
- 2026-03-18

### New Features

- *(hugr-py)* Allow linking packages and modules from Python
([#2947](#2947))

### Refactor

- start cleaning up SiblingSubgraph convexity checking
([#2956](#2956))
</blockquote>

## `hugr-llvm`

<blockquote>

##
[0.26.0](hugr-llvm-v0.25.7...hugr-llvm-v0.26.0)
- 2026-03-16

### New Features

- *(llvm)* [**breaking**] Upgrade to LLVM 21
([#2901](#2901))
- Include private HUGR functions in the local symbol table
([#2831](#2831))
- [**breaking**] TypeRow: add impl From array of Type, remove From<Type>
([#2784](#2784))

### Refactor

- [**breaking**] Remove deprecated Value::Function
([#2928](#2928))
- [**breaking**] Remove deprecated stack_array codegen
([#2929](#2929))
</blockquote>

## `hugr`

<blockquote>

##
[0.26.1](hugr-v0.26.0...hugr-v0.26.1)
- 2026-03-18

### Bug Fixes

- ConstantFold fails when the module contains function declarations
([#2954](#2954))

### New Features

- *(hugr-py)* Allow linking packages and modules from Python
([#2947](#2947))

### Refactor

- start cleaning up SiblingSubgraph convexity checking
([#2956](#2956))
</blockquote>

## `hugr-passes`

<blockquote>

##
[0.26.1](hugr-passes-v0.26.0...hugr-passes-v0.26.1)
- 2026-03-18

### Bug Fixes

- ConstantFold fails when the module contains function declarations
([#2954](#2954))
</blockquote>

## `hugr-cli`

<blockquote>

##
[0.26.0](hugr-cli-v0.25.7...hugr-cli-v0.26.0)
- 2026-03-16

### Documentation

- Move `spec/schema` and `spec/std_extensions` to `resources/`
([#2897](#2897))

### New Features

- [**breaking**] Rename ModelText envelope format to SExpression
([#2927](#2927))
- [**breaking**] TypeRow: add impl From array of Type, remove From<Type>
([#2784](#2784))
</blockquote>

## `hugr-persistent`

<blockquote>

##
[0.5.0](hugr-persistent-v0.4.7...hugr-persistent-v0.5.0)
- 2026-03-16

### New Features

- *(llvm)* [**breaking**] Upgrade to LLVM 21
([#2901](#2901))
- [**breaking**] TypeRow: add impl From array of Type, remove From<Type>
([#2784](#2784))
</blockquote>


</p></details>

---
This PR was generated with
[release-plz](https://github.com/release-plz/release-plz/).
@hugrbot hugrbot mentioned this pull request Mar 23, 2026
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.

2 participants