Streaming decoding phase 0: descriptor invariants, loud decision points, and the frame schema split - #651
Open
ciaranra wants to merge 5 commits into
Open
Streaming decoding phase 0: descriptor invariants, loud decision points, and the frame schema split#651ciaranra wants to merge 5 commits into
ciaranra wants to merge 5 commits into
Conversation
…oints, frame schema split, decision trait
…lting hook, schema guards, dead-helper removal
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.
Phase 0 of the streaming/transversal-decoding program (design record: pecos-docs
design/streaming-transversal-decoding.md, v2). Foundations only — no decoding behavior changes; every previously-silent wrong path now fails loud.Summary
AlgorithmDescriptor::validate): segment/boundary cardinality, every boundary-gate slot bounded by the frame width, and frame-slot schema checks (zero and odd slot counts rejected — the schema is two slots per patch, X then Z). All three decoder constructors validate; bindings validate before any DEM/subgraph build.boundary_gatesclaimed otherwise). Both directions now reject with distinct messages. The semantic redesign (terminal segments) remains tracked in Logical gates after a patch's last memory op are emitted after final measurement and dropped from the algorithm descriptor #595.TGateInjectiondecision points are rejected at construction by every decoder — no path can silently decode a T injection as Clifford.has_decision_points/num_decision_pointsare documented as constant in phase 0.FrameBits(ObsMask-backed, no 64-slot ceiling) with an explicitnum_frame_slotson the descriptor;num_observablesnow reports the DEM's actual declared count (previously2 * num_patches, which doubled as the frame width and disagreed with the DEM). Per-segment observable counts now come from each segment's own sub-DEM. The dead per-qubitVec<u64>frames and the deadObservableBitOutOfRangevariant are gone.propagate_s_gate_framewas provably a no-op for its documented disjoint-mask convention;propagate_h_gate_frameone function below carried the same mask-pairing trap (sets the whole Z mask for any X bit — wrong for multiple pairs). Both had zero production callers and are deleted, with a module note explaining why mask pairs cannot express per-pair frame ops.propagate_cnot_frameswas audited (maskwise XOR is correct for multiple pairs) and gained a multi-bit regression test.DecisionConsultingStrategy(consult(boundary_index, raw_ancilla_outcome, frame) -> Ready { corrected_bit } | NeedMoreData { extra_rounds },#[non_exhaustive], bounded-retry contract documented) plus a defaultedDecodeStrategy::as_decision_consultinghook so the storeddyn DecodeStrategycan reach the subtrait without a future breaking constructor change.Verification
tests/qec/surface/Python suite green (733 passed) against a freshly built module including the LLVM lane.#[should_panic]pin onapply_boundary_gateso the hard assert cannot silently become debug-only.-D warningsincluding pecos-rslib, fmt, and the full pre-commit lane all pass.Breaking notes (experimental surfaces): descriptor dicts gain
num_frame_slots;LogicalAlgorithmDecoder::new/LogicalCircuitDecoder::neware fallible; frame accessors moved fromu64toFrameBits;DecoderError::ObservableBitOutOfRangeremoved.