Skip to content

feat: Clean Up by Deleting Unconnected Nodes after Modifier Solve#1557

Draft
nicolaassolini-qntm wants to merge 46 commits intomainfrom
na/1551-feature-cleanup-the-modifier-pass-code
Draft

feat: Clean Up by Deleting Unconnected Nodes after Modifier Solve#1557
nicolaassolini-qntm wants to merge 46 commits intomainfrom
na/1551-feature-cleanup-the-modifier-pass-code

Conversation

@nicolaassolini-qntm
Copy link
Copy Markdown
Contributor

@nicolaassolini-qntm nicolaassolini-qntm commented Apr 29, 2026

closes #1549
this is a draft...

  • Delete the consumed LoadFunction target during apply_modifier_chain_to_loaded_fn. [1]
  • Run dead-function cleanup after modifier and dangling global-phase cleanup. [2]

nicolaassolini-qntm and others added 30 commits April 10, 2026 12:32
… double_modifier.py, update rendering, and improve apply_passes.py logic
Co-authored-by: Copilot <copilot@github.com>
Co-authored-by: Copilot <copilot@github.com>
Co-authored-by: Copilot <copilot@github.com>
Co-authored-by: Copilot <copilot@github.com>
Co-authored-by: Copilot <copilot@github.com>
nicolaassolini-qntm and others added 16 commits April 27, 2026 15:24
…_saved_hugr

Co-authored-by: Copilot <copilot@github.com>
…for processing hugrs

Co-authored-by: Copilot <copilot@github.com>
Co-authored-by: Copilot <copilot@github.com>
…rs for validation and fix doc indentation

Co-authored-by: Copilot <copilot@github.com>
…structs to private

Co-authored-by: Copilot <copilot@github.com>
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 29, 2026

Codecov Report

❌ Patch coverage is 79.46429% with 23 lines in your changes missing coverage. Please review.
✅ Project coverage is 84.03%. Comparing base (6d87034) to head (59f5f40).
⚠️ Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
tket/src/modifier/modifier_resolver/call_modify.rs 73.17% 9 Missing and 2 partials ⚠️
tket/src/modifier/modifier_resolver.rs 84.21% 2 Missing and 7 partials ⚠️
tket/src/modifier/control.rs 50.00% 1 Missing ⚠️
tket/src/modifier/dagger.rs 50.00% 1 Missing ⚠️
tket/src/modifier/power.rs 50.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1557      +/-   ##
==========================================
+ Coverage   83.80%   84.03%   +0.22%     
==========================================
  Files         188      188              
  Lines       29035    29102      +67     
  Branches    27931    27998      +67     
==========================================
+ Hits        24333    24456     +123     
+ Misses       3540     3473      -67     
- Partials     1162     1173      +11     
Flag Coverage Δ
python 92.32% <ø> (ø)
qis-compiler 91.66% <ø> (ø)
rust 83.70% <79.46%> (+0.23%) ⬆️

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.

@hugrbot
Copy link
Copy Markdown
Collaborator

hugrbot commented Apr 29, 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.18.0 (current)
     Built [  40.815s] (current)
   Parsing tket v0.18.0 (current)
    Parsed [   0.107s] (current)
  Building tket v0.18.0 (baseline)
     Built [  41.071s] (baseline)
   Parsing tket v0.18.0 (baseline)
    Parsed [   0.103s] (baseline)
  Checking tket v0.18.0 -> v0.18.0 (assume minor change)
   Checked [   0.151s] 196 checks: 194 pass, 2 fail, 0 warn, 56 skip

--- 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.47.0/src/lints/function_missing.ron

Failed in:
function tket::modifier::modifier_resolver::global_phase_modify::delete_phase, previously in file /home/runner/work/tket2/tket2/BASELINE_BRANCH/tket/src/modifier/modifier_resolver/global_phase_modify.rs:106

--- 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.47.0/src/lints/inherent_method_missing.ron

Failed in:
ModifierDagger::new, previously in file /home/runner/work/tket2/tket2/BASELINE_BRANCH/tket/src/modifier/dagger.rs:15
ModifierDagger::signature, previously in file /home/runner/work/tket2/tket2/BASELINE_BRANCH/tket/src/modifier/dagger.rs:37
ModifierControl::new, previously in file /home/runner/work/tket2/tket2/BASELINE_BRANCH/tket/src/modifier/control.rs:16
ModifierControl::signature, previously in file /home/runner/work/tket2/tket2/BASELINE_BRANCH/tket/src/modifier/control.rs:27
ModifierResolver::modify_fn_if_needed, previously in file /home/runner/work/tket2/tket2/BASELINE_BRANCH/tket/src/modifier/modifier_resolver/dfg_modify.rs:298
ModifierResolver::modify_fn, previously in file /home/runner/work/tket2/tket2/BASELINE_BRANCH/tket/src/modifier/modifier_resolver/dfg_modify.rs:317
ModifierResolver::modify_global_phase, previously in file /home/runner/work/tket2/tket2/BASELINE_BRANCH/tket/src/modifier/modifier_resolver/global_phase_modify.rs:22
ModifierResolver::modify_tket_op, previously in file /home/runner/work/tket2/tket2/BASELINE_BRANCH/tket/src/modifier/modifier_resolver/tket_op_modify.rs:17
ModifierResolver::new, previously in file /home/runner/work/tket2/tket2/BASELINE_BRANCH/tket/src/modifier/modifier_resolver.rs:331
ModifierResolver::connect_all, previously in file /home/runner/work/tket2/tket2/BASELINE_BRANCH/tket/src/modifier/modifier_resolver.rs:605
ModifierResolver::modify_signature, previously in file /home/runner/work/tket2/tket2/BASELINE_BRANCH/tket/src/modifier/modifier_resolver.rs:699
ModifierPower::new, previously in file /home/runner/work/tket2/tket2/BASELINE_BRANCH/tket/src/modifier/power.rs:16
ModifierPower::signature, previously in file /home/runner/work/tket2/tket2/BASELINE_BRANCH/tket/src/modifier/power.rs:39
ModifierResolverErrors::unreachable, previously in file /home/runner/work/tket2/tket2/BASELINE_BRANCH/tket/src/modifier/modifier_resolver.rs:417
ModifierResolverErrors::unresolvable, previously in file /home/runner/work/tket2/tket2/BASELINE_BRANCH/tket/src/modifier/modifier_resolver.rs:422
ModifierResolverErrors::unreachable, previously in file /home/runner/work/tket2/tket2/BASELINE_BRANCH/tket/src/modifier/modifier_resolver.rs:417
ModifierResolverErrors::unresolvable, previously in file /home/runner/work/tket2/tket2/BASELINE_BRANCH/tket/src/modifier/modifier_resolver.rs:422

   Summary semver requires new major version: 2 major and 0 minor checks failed
  Finished [  84.312s] tket
  Building tket-qec v0.1.0 (current)
     Built [  35.546s] (current)
   Parsing tket-qec v0.1.0 (current)
    Parsed [   0.007s] (current)
  Building tket-qec v0.1.0 (baseline)
     Built [  35.539s] (baseline)
   Parsing tket-qec v0.1.0 (baseline)
    Parsed [   0.006s] (baseline)
  Checking tket-qec v0.1.0 -> v0.1.0 (assume minor change)
   Checked [   0.015s] 196 checks: 196 pass, 56 skip
   Summary no semver update required
  Finished [  72.509s] tket-qec
  Building tket-qsystem v0.24.0 (current)
     Built [  41.863s] (current)
   Parsing tket-qsystem v0.24.0 (current)
    Parsed [   0.027s] (current)
  Building tket-qsystem v0.24.0 (baseline)
     Built [  41.869s] (baseline)
   Parsing tket-qsystem v0.24.0 (baseline)
    Parsed [   0.027s] (baseline)
  Checking tket-qsystem v0.24.0 -> v0.24.0 (assume minor change)
   Checked [   0.062s] 196 checks: 196 pass, 56 skip
   Summary no semver update required
  Finished [  85.760s] tket-qsystem

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]: Removing old function blocks after Modifier resolving

3 participants