Exported processor entry¶
NativeProcessor<P, S>::entry() acquires a canonical static v1 table at runtime
on CONTROL for a consumer-selected Default + Send + 'static processor in native f32 or f64.
export_native_processor_v1!(symbol, Processor32, Processor64) exports the
consumer's entry symbol: 32/64 select matching tables, other values return null.
The public Gain library exports ravet_native_processor_v1 alongside its existing
product ABI. The matching C header is include/RavetNativeProcessor.h.
Acquisition is deliberately non-const: exported and transitive companion paths return the same table address across codegen units. All six companion kinds retain exact originating-pointer checks. Move prior const expressions to CONTROL runtime acquisition; see canonical native tables for the API change, independent actual-consumer validation and remaining lifetime obligations.
Check table version, byte size and sample bits before use. Create returns an opaque exclusively owned handle, or null on construction panic. Keep the exact origin table and library loaded until its handles/callbacks end; passing a handle to another table/precision violates foreign safety. Stopped handles can transfer to their audio owner because selected processors must be Send. Stop callbacks before prepare/deactivate/destroy or control timing queries. No implicit locking, worker or host scheduling is supplied.
Preparation consumes a fixed version-one configuration: main then up to eight auxiliaries, complete capacities/rate/layouts, zero unused slots and reserved word. It deactivates/replaces prepared storage on control and leaves rejected processors inactive. Decoded input storage is separately bounded by 1024 portable events, in addition to the audio adapter's sample/generated-event payload limit. Processor-specific layouts and event support remain validated by the processor.
Process takes raw bus pointer-array addresses in the originating precision, tagged native input records, optional native transport, separate generated-record storage and one result record. Native output capacity must cover the full prepared generated capacity before DSP, even when this block generates fewer events. Whole input/transport conversion precedes DSP; successful generated conversion preserves complete records. All inputs copy before output writes. Every valid result pointer receives status 0 Continue/1 Silence/2 Fault and generated count, which is zero on faults. Foreign sample ranges, metadata and output/result records must satisfy the header's lifetime/alignment/nonoverlap obligations. Supported raw output prefixes silence on faults and backing tails survive. Native output conversion/delivery failure cannot roll back progressed DSP history.
Callbacks return 0 success, 1 rejection/backend failure, 2 panic/poison. Processing, reset and control-query unwinding is contained; a poisoned owner rejects until fresh stopped preparation. Reset/deactivation do not conceal poison. Normal framework process/reset paths use prepared storage without heap actions; arbitrary consumer code, aborting/destructor panics and exceptional handlers have no recovery or deadline promise. Prepared timing queries preserve latency and None/finite/ Infinite tail declarations; consumers own restart/latency notifications and draining.
This is a generic foreign processor boundary. Parameter/state schema, product metadata, SDK registration, editors and host event/transport conversions remain separate interfaces and implementations. Tests use complete multibus f32/f64 entries, no-input instruments/completions, timing declarations, malformed prefixes, capacity, unknown transport and factory/control/audio/reset/query panics. C++ contracts invoke the actual public Gain table, compare both precisions against its legacy ABI over 2000 timed/cross-alias blocks, and check zero-frame controls, rejected state prefixes and wide f64 samples. See decision 0145.