Multi pass decoding#255
Open
aria-googler wants to merge 5 commits into
Open
Conversation
…y mapping bugs TAG=agy
d6ad104 to
9392840
Compare
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.
PR Description: Upstream C++ & Python Multi-Pass Decoding Integration
This Pull Request integrates the complete C++ and Python Multi-Pass Prior Propagation Decoding Engine into the repository, surgically resolving several upstream alignment bugs, reindexing logic mismatches, degeneracy mappings, and packaging issues present in the baseline branch.
All changes are fully validated under Bazel and replicate the optimal private baseline logical error rate (LER) results down to the single shot!
🚀 1. Summary of Integrated C++ Engine Fixes
We surgically resolved several critical reindexing and prior propagation bugs inside the C++ core library to align it with high-performance multi-pass decoding:
global_to_local_detas a clean identity map, preventing out-of-bounds array lookup crashes.seed(instead ofseed + i) during BFS traversal orderings, preventing search-tree sweep divergence.symptom_to_error_indexto map degenerate symptoms tostd::vector<size_t>and updated C++ rule propagation to broadcast LLR reweights across all degenerate causal and target error states.decode()with the mathematically correct Max-Prob prior combination rule (std::max(current_p, conditional_prob)), safely capped at0.5to prevent negative edge weights.component_predictionsmap to store predictions across passes, ensuring clean Logical Observable Extraction before the final Surgical Reset restores modified costs.MultiPassTesseractDecoder::validate_annotationsto enforce component partition validations at the CLI layer (src/tesseract_main.cc), preserving C++ core library constructor flexibility for programmatic and single-detector subproblem tests.global_elapsed), reporting accurate multi-threaded throughput in console stats outputs.📦 2. Python Packaging & Bazel Build Repairs
We resolved several outstanding Bazel build and Python dependency reference errors:
BUILDfilepy_wheeldependencies to correctly map to Oscar's renamed pybind extension target//src:_coreand python target//src/py:tesseract_decoder.@pypi//sinterdependency on the:tesseract_decoderpython target insrc/py/BUILDto cleanly pass Sinter-compat python unit tests.scoped_ostream_redirectpybind call guard todecode_shots_bit_packedto pipe C++ stdout natively back to Python standard streams.📊 3. Empirical Verification & Replication Results
We ran full-scale$1,000$ -shot Multi-Pass decoding benchmarks on the newly compiled public binary. The logical error counts match our optimal private baseline exactly down to the single shot:
A. Surface Code ($d=7, p=0.005, 1,000\text{ shots}$ )
145/ 1,000 (Expected:145).7.93 seconds(instead of182seconds of thread-accumulated time!)../bazel-bin/src/tesseract \ --circuit testdata/annotated_surface_codes/style=surface_code,d=7,basis=X,num_rounds=10,max_qubits_per_module=91,total_qubits=118,k=1,noise=SI1000,p=0.00500.stim \ --sample-num-shots 1000 \ --multipass \ --num-passes 2 \ --multipass-strategy causal \ --pqlimit 1000000 \ --beam 20 \ --beam-climbing \ --no-revisit-dets \ --num-det-orders 21 \ --det-order-seed 2384753 \ --sample-seed 2384753 \ --print-statsB. Color Code ($d=5, p=0.003, 1,000\text{ shots}$ )
72/ 1,000 (Expected:72).0.13 seconds!./bazel-bin/src/tesseract \ --circuit testdata/colorcodes/r=5,d=5,p=0.003,noise=si1000,c=midout_color_code_X,q=23,gates=cz.stim \ --sample-num-shots 1000 \ --multipass \ --num-passes 2 \ --multipass-strategy static \ --pqlimit 1000000 \ --beam 20 \ --beam-climbing \ --no-revisit-dets \ --num-det-orders 21 \ --det-order-seed 2384753 \ --sample-seed 2384753 \ --print-stats