Skip to content

fix: Improve error messages in ModifierResolver#1808

Open
nicolaassolini-qntm wants to merge 8 commits into
mainfrom
na/1748-badmessage
Open

fix: Improve error messages in ModifierResolver#1808
nicolaassolini-qntm wants to merge 8 commits into
mainfrom
na/1748-badmessage

Conversation

@nicolaassolini-qntm

@nicolaassolini-qntm nicolaassolini-qntm commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

closes #1748

This Pr also slightly refactor modify_tket_op to avoid redundant tests

@codecov

codecov Bot commented Jul 6, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 94.16667% with 7 lines in your changes missing coverage. Please review.
✅ Project coverage is 85.83%. Comparing base (f494f3a) to head (79f8aaa).
⚠️ Report is 3 commits behind head on main.

Files with missing lines Patch % Lines
tket/src/modifier/modifier_resolver.rs 93.33% 2 Missing ⚠️
tket/src/modifier/modifier_resolver/call_modify.rs 0.00% 2 Missing ⚠️
...t/src/modifier/modifier_resolver/tket_op_modify.rs 97.70% 0 Missing and 2 partials ⚠️
...ket/src/modifier/modifier_resolver/array_modify.rs 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1808      +/-   ##
==========================================
+ Coverage   85.74%   85.83%   +0.08%     
==========================================
  Files         198      198              
  Lines       31478    31582     +104     
  Branches    30033    30137     +104     
==========================================
+ Hits        26991    27108     +117     
+ Misses       3208     3194      -14     
- Partials     1279     1280       +1     
Flag Coverage Δ
python 91.91% <ø> (ø)
qis-compiler 74.17% <ø> (ø)
rust 85.53% <94.16%> (+0.09%) ⬆️

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

☔ View full report in Codecov by Harness.
📢 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.

@nicolaassolini-qntm nicolaassolini-qntm marked this pull request as ready for review July 7, 2026 12:46
@nicolaassolini-qntm nicolaassolini-qntm requested a review from a team as a code owner July 7, 2026 12:46

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR addresses #1748 by refining ModifierResolverErrors/UnResolvable messaging so modifier-resolution failures provide clearer context and avoid repetition.

Changes:

  • Refactors ModifierResolverErrors::unresolvable to accept an optional message and updates multiple call sites to use Some(...)/None.
  • Adjusts UnResolvable’s Display format to include node + optype context, and updates several error strings for clarity.
  • Updates/extends tests around rejecting non-quantum TketOps in modified contexts.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
tket/src/modifier/modifier_resolver/tket_op_modify.rs Updates non-quantum-modification error text/behavior and adjusts tests accordingly.
tket/src/modifier/modifier_resolver/dfg_modify.rs Updates TailLoop dagger error to match new unresolvable signature.
tket/src/modifier/modifier_resolver/call_modify.rs Switches indirect-call wrapping to use unresolvable(..., None, ...).
tket/src/modifier/modifier_resolver/array_modify.rs Updates daggered-array error to pass an optional message.
tket/src/modifier/modifier_resolver.rs Refines ModifierResolverErrors documentation/formatting and changes unresolvable signature.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread tket/src/modifier/modifier_resolver.rs Outdated
Comment thread tket/src/modifier/modifier_resolver.rs Outdated
Comment thread tket/src/modifier/modifier_resolver/tket_op_modify.rs Outdated
Comment thread tket/src/modifier/modifier_resolver/tket_op_modify.rs
Comment thread tket/src/modifier/modifier_resolver/tket_op_modify.rs
@nicolaassolini-qntm nicolaassolini-qntm marked this pull request as draft July 7, 2026 12:58

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.

Comment thread tket/src/modifier/modifier_resolver.rs Outdated
Comment thread tket/src/modifier/modifier_resolver/call_modify.rs
Comment thread tket/src/modifier/modifier_resolver/array_modify.rs

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated no new comments.

@nicolaassolini-qntm nicolaassolini-qntm marked this pull request as ready for review July 7, 2026 15:06
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.

[Bug]: ModifierResolverErrors display message

2 participants