fix: record an external gate's own depth, not its skipped decomposition's - #359
fix: record an external gate's own depth, not its skipped decomposition's#359ryanhill1 wants to merge 2 commits into
Conversation
…on's _visit_external_gate_operation ran _visit_basic_gate_operation for validation only, but that call still updated qubit depths over the decomposition that was never emitted. Depth recording is now suppressed around the validation call and the external gate records its own depth, mirroring the existing custom-gate path. Affects both explicit external_gates and braket verbatim boxes. Fixes #352
Argus reviewAuto-review is off for this repo. Tick the box below to run a review on this PR.
Estimated cost
Tip: you can also comment |
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
|
@coderabbitai review |
|
|
@coderabbitai review |
|
|
@Argus-Eye review |
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
🔎 Argus · 10/10 — Argus reviewed 4 files and found no issues.
🔍 PR intent vs diff (LLM analysis)
Argus read the diff against the stated intent. This is not an execution log — reviewer still needs to test behavior.
Goal: Ensure external gates record their own depth instead of the depth of a decomposition skipped during validation.
Stated acceptance criteria (from PR/issue — not independently verified):
- Suppress depth recording around the validation-only _visit_basic_gate_operation call.
- Record the external gate's own depth for explicit external_gates and Braket verbatim boxes.
- Record the external gate's own depth in the branch-qubit marking variant inside conditionals.
✅ Intent delivered
Argus reviewed 4 files and found no issues. Code looks good.
Simulated 2 scenarios — all pass.
🔢 124.9k tokens · $0.3314 total
| Stage | Tokens | Cost |
|---|---|---|
| Intent | 2.5k | $0.0000 |
| Triage | 2.7k | $0.0000 |
| Lead agent | 1.6k | $0.0000 |
| Review · bug_hunter | 20.7k | $0.0857 |
| Review · security | 20.4k | $0.0746 |
| Review · architecture | 20.5k | $0.0845 |
| Review · regression | 20.8k | $0.0866 |
| Review | 24.2k | $0.0000 |
| Acceptance | 1.2k | $0.0000 |
| Simulation | 10.4k | $0.0000 |
Contract: production/full · checked: bug_hunter, security, architecture, regression · review took 1m30s
Dashboard → · React 👎 to dismiss · Reply to any inline comment or use @argus-eye help to chat
Fixes #352
_visit_external_gate_operationcalls_visit_basic_gate_operationfor validation only, but that call still ran_update_qubit_depth_for_gateover the decomposition that was never emitted — sounroll(external_gates=["crz"])on a singlecrzreporteddepth() == 12while emitting one statement. Since #341 the same path handles every decomposable gate inside a#pragma braket verbatimbox.Depth recording is now suppressed around the validation-only call (the same
_recording_ext_gate_depthmechanism the custom-gate path uses), and the external gate records its own depth — including the branch-qubit marking variant inside conditionals.