You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The QIR runtime currently emits output records in a custom label: value format that does not conform to the QIR specification. The spec defines two output schemas (Labeled and Ordered) that wrap each shot's output in HEADER / START / END framing and emit each record as a tab-separated OUTPUT\t<TYPE>\t<value>\t<label> line.
Without spec-conformant output, MQT Core's QIR runtime cannot interoperate with downstream tools that consume QIR output records.
Spec-mandated framing.
The Runtime emits a HEADER line before the shot loop and brackets each shot with START / END markers.
Labeling schema selection driven by the QIR program.
The JIT session reads the output_labeling_schema function attribute from the QIR module and configures the Runtime accordingly. The HEADER block also emits a METADATA\toutput_labeling_schema\t<schema> line so the schema is self-describing in the output. No external toggle is exposed; the program declares its preferred schema.
Note
The output_labeling_schema function attribute is optional. When a program does not declare it, the Runtime defaults to Labeled.
QIR's per-type record API.
The __quantum__rt__*_record_output functions delegate to the Runtime's per-type record methods, so JIT-compiled QIR programs emit in spec format with no source change.
Runtime's per-type record API.
The Runtime exposes a per-type record method for each QIR output type (recordResult, recordBool, recordInt, recordFloat, recordTuple, recordArray).
Each emits the spec-defined OUTPUT\t<TYPE>\t<value>\t<label> line.
Consumer wiring (Runner and DDSIM QDMI Device).
Both the mqt-core-qir-runner CLI and the DDSIM QDMI Device emit the program header once before running, and bracket each shot with start/end framing.
Tests for both schemas.
Cover the framing shape, per-type line shape, the METADATA line, and the Labeled vs. Ordered branch driven by the function attribute.
Problem Statement
The QIR runtime currently emits output records in a custom
label: valueformat that does not conform to the QIR specification. The spec defines two output schemas (Labeled and Ordered) that wrap each shot's output inHEADER/START/ENDframing and emit each record as a tab-separatedOUTPUT\t<TYPE>\t<value>\t<label>line.Without spec-conformant output, MQT Core's QIR runtime cannot interoperate with downstream tools that consume QIR output records.
QIR output schemas spec: https://github.com/qir-alliance/qir-spec/tree/main/specification/output_schemas
Depends on: #1797
Proposed Solution
The Runtime emits a
HEADERline before the shot loop and brackets each shot withSTART/ENDmarkers.The JIT session reads the
output_labeling_schemafunction attribute from the QIR module and configures the Runtime accordingly. The HEADER block also emits aMETADATA\toutput_labeling_schema\t<schema>line so the schema is self-describing in the output. No external toggle is exposed; the program declares its preferred schema.Note
The
output_labeling_schemafunction attribute is optional. When a program does not declare it, the Runtime defaults to Labeled.The
__quantum__rt__*_record_outputfunctions delegate to the Runtime's per-type record methods, so JIT-compiled QIR programs emit in spec format with no source change.The Runtime exposes a per-type record method for each QIR output type (
recordResult,recordBool,recordInt,recordFloat,recordTuple,recordArray).Each emits the spec-defined
OUTPUT\t<TYPE>\t<value>\t<label>line.Both the
mqt-core-qir-runnerCLI and the DDSIM QDMI Device emit the program header once before running, and bracket each shot with start/end framing.Cover the framing shape, per-type line shape, the
METADATAline, and the Labeled vs. Ordered branch driven by the function attribute.