Layered min-sum decode
Example directory:
examples/minsum_decode
This is the standalone decoder-facing reference flow. It uses the scalable RTL
under rtl/minsum_bp/ and a Stim-backed case builder.
Commands
./.venv/bin/python examples/minsum_decode/build.py
./.venv/bin/python examples/minsum_decode/run.py
./.venv/bin/python examples/minsum_decode/read.py
Inputs
The build step starts from:
a Stim-generated detector error model
the derived binary check matrix
Hbinary logical-observable matrix
logicalsper-edge priors
It quantizes the priors, runs the fixed-point Python min-sum reference, and keeps the sampled syndrome and logical-observable data as-is.
Outputs
The built case stores:
H.npysyndrome.npyactual_observables.npylogicals.npyprior_llr.npyrow-major graph data for
row_ptrandedge_varsoftware reference posterior LLRs and hard decisions
The hardware run writes:
out/hard_decision_hw.binout/posterior_llr_hw.hexout/counts_hw.txt
Final checks
read.py reports:
the final hard decision vector
eH @ e == sigmaresidual = (H @ e) - sigmaover \(\mathrm{GF}(2)\)|residual|, the Hamming weight of the residuallogicals @ e == actual_observables