Problem
AUDIO_PHASE_FRONTEND currently executes the entire resampler/frontend synchronously on lane zero. run_audio_program_stage returns immediately for every other lane, then calls prepare_audio_conformer, which runs resampling, frame geometry, and the full mel frontend serially.
Paired leaves exist, and the workspace aliases some dead planes correctly, but the execution is not a cooperative Flashkern program. Additional violations:
- non-Apple
sgemm_rm is a scalar C++ triple loop;
- mounted frontend assembly calls per-element
logf;
- DFT/power and mel/stat planes materialize more broadly than the register-FIFO contract requires.
Required stage graph
Mount validated generations for:
- polyphase resampling over output ranges;
- preemphasis/window/gather over frame bands;
- DFT through an explicit Accelerate/AMX seam on Apple or supported architecture leaf;
- power conversion, aliasing dead STFT-real storage where valid;
- mel projection through an explicit dense seam;
- log guard;
- per-feature statistics and ddof=1 normalization;
- exact BF16 publication directly into the Conformer consumer layout.
Lanes claim disjoint frame/bin tiles. Lane-zero work is limited to bounded phase transitions and plan-state publication.
Materialization law
A plane is allowed only when data must survive:
- a team barrier;
- DFT/mel opaque matrix seam;
- fan-out to multiple later consumers;
- continuation suspension;
- published Conformer input.
A C++ function or reference-module boundary is not sufficient. Scratch aliases immediately after the last consumer.
Work
- Split
AUDIO_PHASE_FRONTEND into retained program phases.
- Bind all immutable FFT/window/mel tables at plan construction.
- Remove scalar product fallback; unsupported ISA fails readiness.
- Replace per-element libm calls with faithful paired SIMD/assembly math under frozen traces.
- Write normalized valid rows directly in the layout Conformer consumes.
- Preserve the implemented padding, frame-count, normalization, log-guard, and rounding semantics. Do not invent a dither stage: this frontend has no production dither source.
Acceptance
Related
Problem
AUDIO_PHASE_FRONTENDcurrently executes the entire resampler/frontend synchronously on lane zero.run_audio_program_stagereturns immediately for every other lane, then callsprepare_audio_conformer, which runs resampling, frame geometry, and the full mel frontend serially.Paired leaves exist, and the workspace aliases some dead planes correctly, but the execution is not a cooperative Flashkern program. Additional violations:
sgemm_rmis a scalar C++ triple loop;logf;Required stage graph
Mount validated generations for:
Lanes claim disjoint frame/bin tiles. Lane-zero work is limited to bounded phase transitions and plan-state publication.
Materialization law
A plane is allowed only when data must survive:
A C++ function or reference-module boundary is not sufficient. Scratch aliases immediately after the last consumer.
Work
AUDIO_PHASE_FRONTENDinto retained program phases.Acceptance
Related