Skip to content

Conversation

@lmondada
Copy link
Contributor

@lmondada lmondada commented May 7, 2025

Closes #2074
Closes #2190

@lmondada lmondada requested a review from a team as a code owner May 7, 2025 18:46
@lmondada lmondada requested review from cqc-alec and removed request for a team May 7, 2025 18:46
@lmondada lmondada marked this pull request as draft May 7, 2025 18:46
@lmondada lmondada removed the request for review from cqc-alec May 7, 2025 18:46
@codecov
Copy link

codecov bot commented May 7, 2025

Codecov Report

Attention: Patch coverage is 96.22642% with 8 lines in your changes missing coverage. Please review.

Project coverage is 82.15%. Comparing base (3d2ab66) to head (20958fe).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
hugr-core/src/hugr/persistent/walker/pinned.rs 93.42% 4 Missing and 1 partial ⚠️
hugr-core/src/hugr/persistent/walker.rs 98.42% 2 Missing ⚠️
hugr-core/src/hugr/persistent/state_space.rs 80.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2168      +/-   ##
==========================================
+ Coverage   82.00%   82.15%   +0.15%     
==========================================
  Files         237      239       +2     
  Lines       42778    42989     +211     
  Branches    38690    38901     +211     
==========================================
+ Hits        35079    35319     +240     
+ Misses       5706     5679      -27     
+ Partials     1993     1991       -2     
Flag Coverage Δ
python 85.34% <ø> (ø)
rust 81.82% <96.22%> (+0.17%) ⬆️

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.

@lmondada lmondada force-pushed the feat/persistenthugr branch from a7729f3 to cb812be Compare May 8, 2025 07:05
@lmondada lmondada force-pushed the feat/persistentwalker branch 2 times, most recently from fd0c21f to 3b27b4d Compare May 10, 2025 15:51
@lmondada lmondada marked this pull request as ready for review May 10, 2025 15:52
@lmondada lmondada force-pushed the feat/persistentwalker branch 2 times, most recently from 2206368 to b81ed94 Compare May 10, 2025 16:07
@lmondada
Copy link
Contributor Author

lmondada commented May 10, 2025

EDIT: resolved!

I'm currently unhappy with the state of the end_to_end test within the walker folder, but this can't be simplified and moved out of the repo into tests until further enhancements to the API.

It is nonetheless a very useful test to have, even in its current form.

See #2190

@lmondada lmondada force-pushed the feat/persistentwalker branch 2 times, most recently from 782e1ba to ca5d841 Compare May 10, 2025 21:43
@lmondada lmondada force-pushed the feat/persistentwalker branch from ca5d841 to 7874237 Compare May 12, 2025 14:37
@lmondada lmondada changed the base branch from feat/persistenthugr to luca/persistent-impl-hugrview May 12, 2025 14:43
@lmondada lmondada force-pushed the feat/persistentwalker branch from 7874237 to b1685fd Compare May 12, 2025 14:44
@lmondada lmondada requested a review from acl-cqc May 12, 2025 14:45
@lmondada lmondada force-pushed the feat/persistentwalker branch from b1685fd to 654c4fc Compare May 12, 2025 16:37
@lmondada lmondada force-pushed the feat/persistentwalker branch from 654c4fc to b4bae59 Compare May 12, 2025 16:43
Copy link
Contributor

@acl-cqc acl-cqc left a comment

Choose a reason for hiding this comment

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

Thanks @lmondada, this is great! Not what you'd call easy stuff, but great job in making it comprehensible :-). I have about 60 small suggestions, there are only two big enough to justify not immediately approving:

  • Have I understand PinnedWire always has at least one endpoint pinned? I wasn't clear from the doc so I had to guess a bit, if that's not right then this may need some more thought
  • That equivalent_descendant_ports method....what is all the direction-changing doing...

@lmondada lmondada force-pushed the luca/persistent-impl-hugrview branch from 08e3eb0 to 7cd85d7 Compare May 19, 2025 11:14
@lmondada lmondada requested a review from acl-cqc May 21, 2025 07:30
Base automatically changed from luca/persistent-impl-hugrview to main May 22, 2025 14:34
Copy link
Contributor

@acl-cqc acl-cqc left a comment

Choose a reason for hiding this comment

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

Great stuff Luca, looks good to me, thanks! :). I think you can take it from here, indeed I think some of my comments actually pertain to code from other approved/merged PRs rather than this one...(but the opportunity to remove IteratorNonEmpty might be best taken before we forget 😉)

github-merge-queue bot pushed a commit that referenced this pull request May 26, 2025
I mistakenly made these as comments on #2168 because GitHub's "show
changes from last review" includes changes merged in from main - the
code I was commenting on actually went into main as part of #2202 . So,
nothing major, but separating out.
@lmondada lmondada requested a review from a team as a code owner May 29, 2025 10:53
@lmondada lmondada requested a review from mark-koch May 29, 2025 10:53
@lmondada lmondada enabled auto-merge May 29, 2025 10:55
@lmondada lmondada removed the request for review from mark-koch May 29, 2025 10:55
@lmondada lmondada added this pull request to the merge queue May 29, 2025
Merged via the queue into main with commit 157c44e May 29, 2025
27 checks passed
@lmondada lmondada deleted the feat/persistentwalker branch May 29, 2025 11:02
github-merge-queue bot pushed a commit that referenced this pull request Jun 3, 2025
## 🤖 New release

* `hugr-model`: 0.20.0 -> 0.20.1
* `hugr-core`: 0.20.0 -> 0.20.1 (✓ API compatible changes)
* `hugr-llvm`: 0.20.0 -> 0.20.1 (✓ API compatible changes)
* `hugr-passes`: 0.20.0 -> 0.20.1 (✓ API compatible changes)
* `hugr`: 0.20.0 -> 0.20.1 (✓ API compatible changes)
* `hugr-cli`: 0.20.0 -> 0.20.1 (✓ API compatible changes)

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

## `hugr-model`

<blockquote>

##
[0.20.0](hugr-model-v0.19.0...hugr-model-v0.20.0)
- 2025-05-14

### New Features

- [**breaking**] Mark all Error enums as non_exhaustive
([#2056](#2056))
- [**breaking**] Bump MSRV to 1.85
([#2136](#2136))
- Export and import entrypoints via metadata in `hugr-model`.
([#2172](#2172))
- Define text-model envelope formats
([#2188](#2188))
- Import CFG regions without adding an entry block.
([#2200](#2200))
- Symbol applications can leave out prefixes of wildcards.
([#2201](#2201))
</blockquote>

## `hugr-core`

<blockquote>

##
[0.20.1](hugr-core-v0.20.0...hugr-core-v0.20.1)
- 2025-06-03

### Bug Fixes

- check well-definedness of DFG wires in validate
([#2221](#2221))
- Check for order edges in SiblingSubgraph::from_node
([#2223](#2223))
- Make SumType::Unit(N) equal to SumType::General([(); N])
([#2250](#2250))
- canonicalize_nodes sometimes mangles the entrypoint
([#2263](#2263))

### New Features

- Add PersistentHugr ([#2080](#2080))
- Add `Type::used_extensions`
([#2224](#2224))
- Add boundary edge traversal in SimpleReplacement
([#2231](#2231))
- Add signature map function for DFGs
([#2239](#2239))
- PersistentHugr implements HugrView
([#2202](#2202))
- PersistentHugr Walker API
([#2168](#2168))
- Hugr::store_with_exts and auto-include in serde_as
([#2280](#2280))

### Refactor

- tidies/readability improvements to PersistentHugr
([#2251](#2251))
- Deprecate ValidationError::ExtensionError
([#2281](#2281))

### Testing

- Ignore miri errors in tests involving `assert_snapshot`
([#2261](#2261))
</blockquote>

## `hugr-llvm`

<blockquote>

##
[0.20.1](hugr-llvm-v0.20.0...hugr-llvm-v0.20.1)
- 2025-06-03

### Bug Fixes

- Make SumType::Unit(N) equal to SumType::General([(); N])
([#2250](#2250))

### Testing

- Add exec tests for widen op
([#2043](#2043))
</blockquote>

## `hugr-passes`

<blockquote>

##
[0.20.1](hugr-passes-v0.20.0...hugr-passes-v0.20.1)
- 2025-06-03

### Bug Fixes

- Dataflow analysis produces unsound results on Hugrs with entrypoint
([#2255](#2255))

### New Features

- LocalizeEdges pass ([#2237](#2237))
</blockquote>

## `hugr`

<blockquote>

##
[0.20.1](hugr-v0.20.0...hugr-v0.20.1)
- 2025-06-03

### Bug Fixes

- Dataflow analysis produces unsound results on Hugrs with entrypoint
([#2255](#2255))
- check well-definedness of DFG wires in validate
([#2221](#2221))
- Check for order edges in SiblingSubgraph::from_node
([#2223](#2223))
- Make SumType::Unit(N) equal to SumType::General([(); N])
([#2250](#2250))
- canonicalize_nodes sometimes mangles the entrypoint
([#2263](#2263))

### New Features

- LocalizeEdges pass ([#2237](#2237))
- Add PersistentHugr ([#2080](#2080))
- Add `Type::used_extensions`
([#2224](#2224))
- Add boundary edge traversal in SimpleReplacement
([#2231](#2231))
- Add signature map function for DFGs
([#2239](#2239))
- PersistentHugr implements HugrView
([#2202](#2202))
- PersistentHugr Walker API
([#2168](#2168))
- Hugr::store_with_exts and auto-include in serde_as
([#2280](#2280))

### Refactor

- tidies/readability improvements to PersistentHugr
([#2251](#2251))
- Deprecate ValidationError::ExtensionError
([#2281](#2281))

### Testing

- Ignore miri errors in tests involving `assert_snapshot`
([#2261](#2261))
</blockquote>

## `hugr-cli`

<blockquote>

##
[0.20.1](hugr-cli-v0.20.0...hugr-cli-v0.20.1)
- 2025-06-03

### New Features

- support external subcommands via PATH
([#1343](#1343))
([#2278](#2278))
</blockquote>


</p></details>

---
This PR was generated with
[release-plz](https://github.com/release-plz/release-plz/).
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.

Simplify end_to_end walker example and move to examples Design and Implement Walker API for PersistentHugr

3 participants