Fix main red: clippy, stale QEC snapshots, GHZ lattice-surgery reset bug - #313
Merged
arniber21 merged 1 commit intoJul 20, 2026
Conversation
Chained logical CX ops (e.g. GHZ-style a-b-c programs) left the first ancilla's atoms measured-but-never-reset, tripping the quantum.na dialect verifier the first time a later op's movement/geometry pass had to touch one of them. Fix in both the live patch_ops.rs path and the lattice_surgery.rs reference path; update the two tests whose terminal-length assertions assumed measure-only.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Owner
Author
This stack of pull requests is managed by Graphite. Learn more about stacking. |
arniber21
marked this pull request as ready for review
July 20, 2026 20:25
arniber21
deleted the
07-20-fix_main_red_clippy_unused_imports_stale_qec_snapshots_untrack_insta_scratch_files
branch
August 5, 2026 06:11
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

What's in this PR
cargo test --workspace(and clippy) were red onmain. Three independent issues:Clippy: 7 unused-import errors in
quon_na/src/movement/{duals,emit,geometry,plan}.rs, left over from the NA: Carve movement / zoned / compaction monoliths by interface #215 movement-monolith carve-up.Stale QEC report snapshots: the accepted
.snapgoldens forqec_repetition_d3_hybrid/qec_surface_d3_hybridpredated QEC: implement magic-state-consuming logical T and CCZ operations #283/QEC: magic-state-consuming logical T and CCZ operations (#283) #288's new resource-report fields (t_count,tdag_count,ccz_count,magic_state_demand) and never got re-accepted, socargo test -p quon_nafailed. Also found two.snap.newinsta scratch files tracked in git by mistake (from that same PR) — insta pending-snapshot files are meant for local review viacargo insta review, never committed. Untracked them and added*.snap.newto.gitignore.Real correctness bug:
quonc/tests/samples_catalog.rs::ci_smoke_entries_typecheck_with_quoncfailed on the new GHZ benchmark sample (samples/neutral-atom/benchmarks/surface_d3_ghz.qn, from Samples: reconfigurable neutral-atom QEC benchmark suite #284/Samples: reconfigurable neutral-atom QEC benchmark suite (#284) #292) withquantum.na verification failed: cycle 425: atom 36 is reused ... after measure at cycle 346 without an intervening reset.Root cause:
quon_qec/src/patch_ops.rs'sMeasureAncillahandling (the live logical-CX lattice-surgery lowering) measures only the ancilla patch's top-row atoms when a logical CX finishes, but never resets any of the ancilla's atoms — unlike the seam-atom measure+reset pairingrough_merge_round/smooth_merge_round/split_seam_roundalready do correctly. Chaining two logical CX ops (as the GHZ sample does:logical_cx(a,b)thenlogical_cx(b,c)) leaves the first ancilla's atoms parked, un-reset, in the trap grid; the verifier correctly catches it the first time the second CX's movement/geometry planning has to move one of those atoms out of the way.Fixed by resetting the ancilla's full atom footprint (all data + check atoms, not just the measured top row — by the Horsman gadget's design the ancilla is fully disentangled from control/target by this point, so this is physically sound) right after the logical-Z measurement. Applied the identical fix to the
lattice_surgery.rsreference-only path for consistency. Updated the two tests whose terminal-length assertions assumed measure-only (quon_qec/src/expand.rs,quon_qec/tests/patch_ops.rs).Verification
All run locally, not just asserted:
cargo fmt --check— cleancargo clippy --workspace --all-targets -- -D warnings— cleancargo test --workspace— 0 failures (confirmed 3x, including a full rebuild).venv/bin/python -m pytest python -q— 78 passed, 1 skippedpnpm --dir website build— cleanquantum.na verification passed).🤖 Generated with Claude Code