✨ Add non-bit record output functions to the QIR runtime#1799
Conversation
- QIR.h, QIR.cpp: implement the five spec-defined `__quantum__rt__{bool,int,float,tuple,array}_record_output` functions used by QIR Adaptive Profile programs to emit classical compute outputs alongside measurement results.
- Runtime.hpp, Runtime.cpp: add `outputValue` and `outputContainer` helpers.
Rename the per-shot bit accumulator (`recordOutput` to `appendMeasurementBit`, `recordedOutputs` to `measurements`, `getRecordedOutputs` to `getMeasurements`) so its name reflects its role in histogram bucketing rather than implying any tie to QIR's `record_output` verb.
- Session.cpp: register the new symbols so JIT-compiled Adaptive programs resolve them.
- AdaptiveRecordOutputs.ll plus runtime- and QDMI-level tests exercising every new function in one circuit.
Assisted-by: Claude Opus 4.7 via Claude Code
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
|
Hey @rturrado 👋🏻 |
@burgholzer Hello! Yes, it is. And if you consider that the issue description needs refining and that that can affect the subsequent PR, no problem with that also. |
Nice! The issue descriptions read just fine as they are 🙂👍🏻 |
Thanks so much. No rush at all! |
Description
This PR completes the runtime side of QIR Adaptive Profile support. PR #1766 already added the format routing for
QIRADAPTIVE{MODULE,STRING}and the bit-recording infrastructure. This follow-up fills the remaining gap: the five spec-defined__quantum__rt__*_record_outputentry points for non-bit values (bool,int,float,tuple,array). Without them, any Adaptive program emitting classical compute outputs alongside measurement results would fail to link at JIT time.The new entry points emit in MQT Core's current custom
label: valueformat. Switching to the spec-mandatedHEADER / START / ENDoutput schemas (Labeled / Ordered) is tracked separately as a follow-up issue.Fixes #1797