|
| | GpuNeuralRealtimeNode (Config config) |
| | Host thread only.
|
| | ~GpuNeuralRealtimeNode () override |
| | Stop/join the callback and worker first; destruction releases.
|
| | GpuNeuralRealtimeNode (const GpuNeuralRealtimeNode &)=delete |
| GpuNeuralRealtimeNode & | operator= (const GpuNeuralRealtimeNode &)=delete |
| GpuAudioNodeDescriptor | descriptor () const override |
| bool | prepare () override |
| | Stop/join callback and worker first: prepare() begins with release().
|
| bool | release () noexcept |
| | Stop/join callback and worker first.
|
| bool | cpu_fallback_prepared () const noexcept override |
| | True once every channel's shadow processor is published.
|
| void | prime_fallback (const audio::BufferView< const float > &input, std::uint32_t n) noexcept override |
| | RT-safe.
|
| void | process_cpu_fallback (const audio::BufferView< const float > &input, audio::BufferView< float > &output, std::uint32_t n) noexcept override |
| | RT-safe. Emits the latency-aligned block staged by prime_fallback().
|
| void | process_block (const audio::BufferView< const float > &, audio::BufferView< float > &, std::uint32_t) final |
| | Not a legacy FIFO node. GpuAudioTransport rejects an unprepared instance.
|
| PrepareError | last_prepare_error () const noexcept |
| | Reason for the most recent failed prepare(); None after a success.
|
| std::uint64_t | sanitized_input_samples () const noexcept |
| | Non-finite input samples (NaN, +/-Inf) replaced with zero since prepare().
|
| std::uint64_t | callback_contract_violations () const noexcept |
| | Invalid or out-of-sequence callbacks observed on the CPU-only path.
|
| NeuralFamily | family () const noexcept |
| bool | gpu_kernel_available () const noexcept |
| | True only while a GPU backend for this family is prepared and has not been quiesced by an offline fence.
|
| std::uint64_t | epoch () const noexcept |
| | Current GPU delivery epoch, or zero when no GPU epoch is open.
|
| bool | fenced () const noexcept |
| | True before preparation, or once GPU delivery was fenced.
|
| GpuAudioRecoveryReason | recovery_reason () const noexcept |
| | First latched recovery cause.
|
| std::uint64_t | recovery_sequence () const noexcept |
| | Sequence associated with the first latched recovery cause, or UINT64_MAX.
|
| GpuAudioStatus | status_snapshot () const noexcept override |
| | Allocation-free lifecycle projection.
|
| bool | bind_realtime_path (detail::RealtimeGpuNodeBinding &binding) noexcept override |
| | Private transport hook, not for node authors: a node that the GPU audio transport drives through a stamped realtime path describes that path here.
|
| GpuAudioCapabilityReport | capability_report () const noexcept |
| | Allocation-free capability projection.
|
| ShadowStatus | shadow_status () const noexcept |
| | Allocation-free shadow diagnostics beyond the public shadow_* fields of status_snapshot(), which carry the mode and the authoritative delivered, late and double-miss counts.
|
| virtual void | process_block (const audio::BufferView< const float > &input, audio::BufferView< float > &output, uint32_t n)=0 |
| | Non-RT worker context. Process exactly one block (n == block_size).
|
| virtual void | prime_fallback (const audio::BufferView< const float > &, uint32_t) noexcept |
| | RT-safe.
|
| virtual void | process_cpu_fallback (const audio::BufferView< const float > &input, audio::BufferView< float > &output, uint32_t n) noexcept |
| | RT-safe fallback.
|
| virtual bool | release_bounded (std::uint64_t) noexcept |
| | Host thread, audio stopped.
|
Architecture-neutral realtime neural node with a built-in CPU shadow.
Every family (WaveNet/NAM, TCN/NAM-TCN, SSM, LSTM, GRU, custom) owns a continuously primed CPU instance of its model. The transport feeds it on every callback and it emits its result lead_blocks callbacks later, so a missed, failed, or fenced GPU block is replaced by a latency-aligned, history-continuous CPU block without waiting. cpu_fallback_prepared() is therefore true for every prepared node, and the miss policy is always MissPolicy::CpuFallback.
Families without a GPU kernel run CPU-only: they report GpuAudioExecutionPath::Cpu, GpuAudioProvider::Cpu, gpu_kernel_available() == false, and never open a GPU delivery epoch (epoch() == 0). A family with a GPU kernel whose provider cannot be prepared runs the same CPU-only contract and reports a degraded GPU request instead of failing preparation.
Where the shadow runs is the ShadowPolicy. Inline runs it on the audio thread every block, including blocks the GPU delivers. Worker runs it on a dedicated non-realtime thread: the callback only copies its input in and, when the GPU misses, copies the shadow's stamped result out. A shadow result that is late for its slot is dropped, and a block both paths miss is silent. None makes a realtime GPU miss silent. Auto times one block of the CPU model for one channel at prepare() and picks Inline when that cost times the channel count is at most kAutoInlineMaxCostPct of the block period, otherwise Worker. Families without a GPU backend, and a GPU family whose provider could not be prepared, always run Inline, because the CPU model is their output.
The policy governs realtime misses only. An offline render always runs the CPU model inline on the same timeline: under Worker and None the model is kept primed off the audio thread, the start of an offline render finishes its queue and continues it inline, and the first realtime callback after the render hands it back to the shadow thread. The node's shadow_* status fields are the authoritative shadow counts; the transport's CpuFallbackDelivered label means only that the fallback path ran, which can be a silent double miss.
On the GPU path the node detects device loss (the provider's loss query, which outranks the failed completions it causes) and a hung provider (a completion watchdog in callback blocks); both report Unavailable.
Recovery is manual: any latched cause, including a single invalid callback, fences GPU delivery until the host prepares the node again. The shadow carries the stream meanwhile. Automatic re-acquire is future work.
Threading: prepare() and release() are host-thread operations with the callback and worker stopped. The queries below read lifecycle state that only those two calls change, plus counters and recovery state that are atomics, so they are safe from a host or UI thread at any time except concurrently with prepare() or release(). A transport-hosted node is sampled by the transport worker into a sequence-guarded mirror, so the UI-safe read is GpuAudioTransport::status_snapshot().