Move analysis off the audio callback #2

Open
erdoar wants to merge 1 commit from analysis-off-callback into main
erdoar commented 2026-10-15 04:54:31 +00:00 (Migrated from github.com)

Fixes the first P0 in docs/REFACTOR_AUDIT.md.

  • Gate analysis and howl tracking run in Engine.performAnalysis() on the worker. Each partition, the callback copies a preallocated 1024-sample frame behind an atomic job state and adopts the newest feature snapshot (likelihood, voice hold, per-howl hz/gain/biquad) from a three-slot atomic store. The callback keeps only notch filters, tail FIR and subtraction. Block-size changes bump an epoch so stale snapshots are ignored.
  • vDSP for FFT, window, autocorrelation and the 512-tap FIR (mirrored history for contiguous reads); scalar fallback without Accelerate.
  • New DeadlineTests (release only): 8 engines at 48 kHz with the worker running. 32-frame block worst 52 µs vs 667 µs deadline (main: 1246 µs, a miss); 128-frame worst 260 µs vs 2667 µs (main: 1608 µs).

cd SI01 && swift test -c release: 10 tests pass on macOS 15 / Apple Silicon. Not re-run on Linux; not measured on a Core Audio IO thread.

🤖 Generated with Claude Code

Fixes the first P0 in docs/REFACTOR_AUDIT.md. - Gate analysis and howl tracking run in `Engine.performAnalysis()` on the worker. Each partition, the callback copies a preallocated 1024-sample frame behind an atomic job state and adopts the newest feature snapshot (likelihood, voice hold, per-howl hz/gain/biquad) from a three-slot atomic store. The callback keeps only notch filters, tail FIR and subtraction. Block-size changes bump an epoch so stale snapshots are ignored. - vDSP for FFT, window, autocorrelation and the 512-tap FIR (mirrored history for contiguous reads); scalar fallback without Accelerate. - New `DeadlineTests` (release only): 8 engines at 48 kHz with the worker running. 32-frame block worst **52 µs** vs 667 µs deadline (main: 1246 µs, a miss); 128-frame worst 260 µs vs 2667 µs (main: 1608 µs). `cd SI01 && swift test -c release`: 10 tests pass on macOS 15 / Apple Silicon. Not re-run on Linux; not measured on a Core Audio IO thread. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
This pull request has changes conflicting with the target branch.
  • CHANGELOG.md
  • docs/REFACTOR_AUDIT.md
View command line instructions

Manual merge helper

Use this merge commit message when completing the merge manually.

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin analysis-off-callback:analysis-off-callback
git switch analysis-off-callback

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch main
git merge --no-ff analysis-off-callback
git switch analysis-off-callback
git rebase main
git switch main
git merge --ff-only analysis-off-callback
git switch analysis-off-callback
git rebase main
git switch main
git merge --no-ff analysis-off-callback
git switch main
git merge --squash analysis-off-callback
git switch main
git merge --ff-only analysis-off-callback
git switch main
git merge analysis-off-callback
git push origin main
Sign in to join this conversation.
No description provided.