Problem Statement
PR #1766 added QIR Adaptive Profile format routing to the DDSIM QDMI Device. The program-format gate accepts QIRADAPTIVE{MODULE,STRING} and submitQIRProgram runs them through the JIT. The runtime already handles __quantum__rt__read_result + br i1, so an Adaptive program that only branches on measurement results works end-to-end.
What is still missing is the set of recording functions Adaptive programs use to emit classical compute outputs alongside measurement results. The spec defines five additional __quantum__rt__*_record_output symbols (bool, int, float, tuple, array) that are not currently implemented in the runtime, so any Adaptive program that emits a classical bool, int, or float value, a tuple, or an array fails to link at JIT time.
QIR Adaptive Profile spec: https://github.com/qir-alliance/qir-spec/blob/main/specification/profiles/Adaptive_Profile.md
Blocks: #1798
Proposed Solution
Scope
- Five new runtime recording functions declared in
QIR.h and implemented in QIR.cpp: __quantum__rt__bool_record_output, __quantum__rt__int_record_output, __quantum__rt__float_record_output, __quantum__rt__tuple_record_output, __quantum__rt__array_record_output.
- JIT symbol registration: register the five new symbols in
Session::registerRuntimeSymbols so JIT-compiled Adaptive programs can resolve them.
- Test circuit and tests: a new test circuit exercises every new function in one run. Runtime-level and QDMI-level tests assert the exact emitted format.
Out of scope
- Switching the runtime to the spec-mandated
HEADER / START / END + <TYPE>\t<value>\t<label> output schema. That work is tracked separately under "Add QIR Output Schemas support" and depends on this PR.
Problem Statement
PR #1766 added QIR Adaptive Profile format routing to the DDSIM QDMI Device. The program-format gate accepts
QIRADAPTIVE{MODULE,STRING}andsubmitQIRProgramruns them through the JIT. The runtime already handles__quantum__rt__read_result + br i1, so an Adaptive program that only branches on measurement results works end-to-end.What is still missing is the set of recording functions Adaptive programs use to emit classical compute outputs alongside measurement results. The spec defines five additional
__quantum__rt__*_record_outputsymbols (bool,int,float,tuple,array) that are not currently implemented in the runtime, so any Adaptive program that emits a classical bool, int, or float value, a tuple, or an array fails to link at JIT time.QIR Adaptive Profile spec: https://github.com/qir-alliance/qir-spec/blob/main/specification/profiles/Adaptive_Profile.md
Blocks: #1798
Proposed Solution
Scope
QIR.hand implemented inQIR.cpp:__quantum__rt__bool_record_output,__quantum__rt__int_record_output,__quantum__rt__float_record_output,__quantum__rt__tuple_record_output,__quantum__rt__array_record_output.Session::registerRuntimeSymbolsso JIT-compiled Adaptive programs can resolve them.Out of scope
HEADER / START / END+<TYPE>\t<value>\t<label>output schema. That work is tracked separately under "Add QIR Output Schemas support" and depends on this PR.