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 classical-array work in #2109 supports internal storage, but array-valued
OpenQASM outputs remain unsupported. Users must currently copy selected elements
into scalar outputs. An output array must retain its shape, element type, and
values after the entry function returns; returning the current stack-backed memref.alloca storage would leave a dangling reference.
This gap was deliberately deferred until after #2546, which changes computed
output handling and recording.
Proposed Solution
Support array-valued output declarations using a defined value or ownership
contract shared by the frontend and its consumers.
Define the lifetime and ownership of returned arrays, including empty and
multidimensional arrays, without exposing expired stack storage.
Preserve output shape, element type, order, and integer/angle representation
through QC/QCO conversion and supported serialization paths.
Extend native result handling and QIR output recording consistently with the
computed-output contract established by ✨ Preserve structured compilation and execution #2546. Diagnose output element types
or target profiles that cannot be represented.
Test mutable arrays, aliased views, output snapshots, empty dimensions,
repeated calls, and rejection of uninitialized output elements.
Acceptance: a program can return a fully initialized array and retrieve the
same typed, shaped values through each supported execution/export path, without
dangling storage, silent truncation, or changed scalar-output behavior.
Follow-up to #2109; depends on #2546. Classical subroutines and array-reference
parameters are separate work, not prerequisites for standalone array outputs.
🤖 AI text below 🤖
Problem Statement
The classical-array work in #2109 supports internal storage, but array-valued
OpenQASM outputs remain unsupported. Users must currently copy selected elements
into scalar outputs. An output array must retain its shape, element type, and
values after the entry function returns; returning the current stack-backed
memref.allocastorage would leave a dangling reference.This gap was deliberately deferred until after #2546, which changes computed
output handling and recording.
Proposed Solution
Support array-valued
outputdeclarations using a defined value or ownershipcontract shared by the frontend and its consumers.
multidimensional arrays, without exposing expired stack storage.
through QC/QCO conversion and supported serialization paths.
computed-output contract established by ✨ Preserve structured compilation and execution #2546. Diagnose output element types
or target profiles that cannot be represented.
repeated calls, and rejection of uninitialized output elements.
Acceptance: a program can return a fully initialized array and retrieve the
same typed, shaped values through each supported execution/export path, without
dangling storage, silent truncation, or changed scalar-output behavior.
Follow-up to #2109; depends on #2546. Classical subroutines and array-reference
parameters are separate work, not prerequisites for standalone array outputs.