Skip to content

Decode to errors seg fault from wrong input type #92

@oscarhiggott

Description

@oscarhiggott

I accidentally gave decode_to_errors a bitstring of detector outcomes rather than indices of detection events, and got a segmentation fault. Example:

from tesseract_decoder import tesseract
import stim


dem = stim.DetectorErrorModel("""
    error(0.1) D0 D1 L0
    error(0.2) D1 D2 L1
    detector(0, 0, 0) D0
    detector(1, 0, 0) D1
    detector(2, 0, 0) D2
""")
config = tesseract.TesseractConfig(dem=dem, det_beam=50)
decoder = config.compile_decoder()
syndrome = [0, 1, 1]
decoder.decode_to_errors(syndrome)
# Segmentation fault (core dumped)

Either this should be handled by an exception correctly, or we should switch to have decode_to_errors accept a bitstring of detector outcomes, which would make it consistent with the decode method. WDYT?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions