OSD decode
Example directory:
examples/osd_decode
This flow keeps the full decoding problem in hardware-side memories and lets the RTL controller handle ranking, independent-column selection, row compaction, reduced solve, and reconstruction.
Commands
./.venv/bin/python examples/osd_decode/build.py
./.venv/bin/python examples/osd_decode/run.py
./.venv/bin/python examples/osd_decode/read.py
For many-shot statistics:
./.venv/bin/python examples/osd_decode/build_batch.py --shots 1000
./.venv/bin/python examples/osd_decode/run_batch.py --sim verilator --jobs 8
./.venv/bin/python examples/osd_decode/read_batch.py
Inputs
The default input source is Stim-backed and lives in:
examples/osd_decode/stim_example.pyexamples/osd_decode/dem_mat.py
The built case carries both syndrome and logical-observable data through the flow.
Outputs
Generated under cases/<case_id>/ with cases/latest pointing at the active case:
H.npysigma.npylogicals.npyactual_observables.npyinitial_estimate.npyselected_indices_sw.npyselected_indices_hw.txtH_reduced_sw.npysigma_reduced_sw.npyx_software.npyF_software.npyx_hardware.npyF_hardware.npy
Final checks
read.py reports the hardware/software agreement for the reduced solve and the
final decoded vector, including:
H @ F == sigmalogicals @ F == actual_observables