Skip to main content

is_reference_output

Function is_reference_output 

Source
pub fn is_reference_output(decl: &BufferDecl) -> bool
Expand description

The interpreter’s output ABI, single-homed: is_reference_output is the exact predicate reference_eval uses to collect the buffers it returns, and output_index locates a named output by that predicate. Re-exported so test harnesses never hand-roll (and drift from) the selection. True when reference_eval RETURNS this buffer among its outputs. This is the SINGLE source of truth for the interpreter’s output ABI: reference_eval collects exactly these decls, in Program::buffers order, into its result Vec. Test harnesses that need the position of a named output MUST use output_index (which filters by this predicate) rather than re-deriving the selection, a hand-rolled copy silently drifts (e.g. keying on is_pipeline_live_out alone admits ReadOnly live-outs the interpreter never returns, shifting every later index).

The “backend-allocated output” half is BufferDecl::is_backend_allocated_output, the single cross-backend contract in vyre-foundation shared with the CpuRef/device backends; this adds the interpreter’s extra ReadWrite inputs-are-also-returned rule.