Skip to content

fix: Skip rvalue evaluation for MCM-dependent assignment#377

Merged
aniksd-braket merged 2 commits into
mainfrom
fix/skip-mcm-assignment-eval
May 14, 2026
Merged

fix: Skip rvalue evaluation for MCM-dependent assignment#377
aniksd-braket merged 2 commits into
mainfrom
fix/skip-mcm-assignment-eval

Conversation

@aniksd-braket
Copy link
Copy Markdown
Contributor

When a classical assignment has an MCM-dependent rvalue and the context has no active simulation paths (e.g., Qiskit circuit-building contexts), skip evaluating the rvalue and just propagate MCM-dependency. This prevents NameError when measurement results have no stored runtime value.

Issue #, if available:

Description of changes:

Testing done:

Merge Checklist

Put an x in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your pull request.

General

Tests

  • I have added tests that prove my fix is effective or that my feature works (if appropriate)
  • I have checked that my tests are not configured for a specific region or account (if appropriate)

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

…s in non-simulating contexts

When a classical assignment has an MCM-dependent rvalue and the context
has no active simulation paths (e.g., Qiskit circuit-building contexts),
skip evaluating the rvalue and just propagate MCM-dependency. This
prevents NameError when measurement results have no stored runtime value.
@aniksd-braket aniksd-braket requested a review from a team as a code owner May 14, 2026 19:00
@aniksd-braket aniksd-braket marked this pull request as draft May 14, 2026 19:00
@codecov
Copy link
Copy Markdown

codecov Bot commented May 14, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (b9e18eb) to head (5f4785d).

Additional details and impacted files
@@            Coverage Diff            @@
##              main      #377   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           49        49           
  Lines         4879      4882    +3     
  Branches       560       561    +1     
=========================================
+ Hits          4879      4882    +3     

☔ 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.

@aniksd-braket aniksd-braket marked this pull request as ready for review May 14, 2026 19:13
@aniksd-braket aniksd-braket requested a review from speller26 May 14, 2026 19:13
@aniksd-braket aniksd-braket merged commit 9336d79 into main May 14, 2026
30 checks passed
@aniksd-braket aniksd-braket deleted the fix/skip-mcm-assignment-eval branch May 14, 2026 19:32
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