Skip to content

M4: fail-fast native FX prepare guard before any plugin allocation - #572

Merged
1 commit merged into
mainfrom
guard/m4-builtin-fx-prepare-preflight-20261111
Nov 11, 2026
Merged

1 commit merged into
mainfrom
guard/m4-builtin-fx-prepare-preflight-20261111

Conversation

@masarray

Copy link
Copy Markdown
Owner

#527 — host-wide safe FX preparation

Current main@fd2dd0c4d9cb78abd34c6f12e28f33f0e8a55b74 supports built-in EQ, Compressor, Harmonice and Vocal Throw via one NativeBuiltInFx registry. Its preparation wrapper previously constructed a plugin and called prepareToPlay even for an invalid/NaN/Inf device rate or absurd block count, relying on each effect's local behavior to reject the request. A future built-in FX could allocate enormous buffers before returning not-ready.

Change: src/NativeBuiltInFx.h now rejects non-finite, sub-8k/>384k rates, block counts outside [16,8192] and invalid state pointer/size before std::make_unique<Processor>(). The bound uses the same PreparedMixerBlock::hardFrameLimit as native graph PCM; legitimate 16-frame ASIO is still admitted at the generic host boundary and individual processors can require more. This has NO changes to valid EQ/Compressor/Harmonice/Throw DSP or editor behavior. tests/native_fx_registry_extension_test.cpp records fixture construction to prove fail-closed negative cases occur before allocation, and checks 16-frame ownership remains processor-specific.

Branch compatibility: direct patch only in the common native FX registration and its existing CTest. Neither currently changing Harmonice #529 nor O1/O2 #563 edits those files; no changes to live Main.cpp, audio callback, ASIO routing, OSC/UI, .smix schema or current Harmony sound. M2/M3 #571 is a separate source-disjoint PR.

Qualification: fast native contracts then one exact SHA Windows MSVC/CTest when the code reaches a stable checkpoint; no Chromium or FAT artifact for host-preparation-only change. Physical audio remains unverified. Keep epic #527 OPEN.

Copy link
Copy Markdown
Owner Author

/arsonmix-ci native 4497119

@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying arsonmix with  Cloudflare Pages  Cloudflare Pages

Latest commit: 4497119
Status: ✅  Deploy successful!
Preview URL: https://6c4251d4.arsonmix.pages.dev
Branch Preview URL: https://guard-m4-builtin-fx-prepare.arsonmix.pages.dev

View logs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant