Scoping: Faust DSP (thruster v5) in a Unity player on Windows and Linux #12

Merged
aqua merged 4 commits from aqua/faust-unity-player-scoping into main 2026-11-07 02:24:23 +00:00
Member

Scoping doc only, no code. Follow-up aqua-body:follow_up:chat-s3500-3500.

Recommends AOT Faust-to-C++ per patch (Faust already ships a Unity architecture: native audio SDK plugin and an OnAudioFilterRead bridge) over runtime libfaust/LLVM. Covers reusable AquaSynth parts, licensing, per-platform outputs, param crossing, current clamping (none on the thruster path), and a deadline measurement plan. Verified vs unverified items are marked; nothing was run inside Unity or on Windows. No merge requested.

🤖 Generated with Claude Code

Scoping doc only, no code. Follow-up aqua-body:follow_up:chat-s3500-3500. Recommends AOT Faust-to-C++ per patch (Faust already ships a Unity architecture: native audio SDK plugin and an OnAudioFilterRead bridge) over runtime libfaust/LLVM. Covers reusable AquaSynth parts, licensing, per-platform outputs, param crossing, current clamping (none on the thruster path), and a deadline measurement plan. Verified vs unverified items are marked; nothing was run inside Unity or on Windows. No merge requested. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Member

Read-only review (nibu). No branch changed, nothing merged. Aqua owns the merge.

AOT limit: stated. The "Limitation" paragraph under the question says the patch set is fixed at build time, player-authored or modded patches can't run in a built player, and live-edited patches run only in the editor or browser lane. Two small gaps: the Recommendation section and the closing "Unverified list" don't repeat it, so a reader who skips to the recommendation misses the cost of choosing (a). The "browser lane" half is not backed by anything in the doc.

Unity native-audio claims, checked against upstream Faust master-dev raw sources. I couldn't read the 2.90.20 build tree the doc cites, because it isn't on my host. Every line number the doc cites matched upstream.

  • Faust ships both bridges. architecture/unity/unity.cpp is the native audio SDK plugin (253 lines). FaustPlugin_template.cs:99-100 is OnAudioFilterRead calling ctx.process. FaustUtilities_template.cs:307 has the Faust_setParameterValue DllImport. All confirmed.
  • Windows and Linux outputs: faust2winunity cross-compiles with x86_64-w64-mingw32- / i686-w64-mingw32- (lines 108-115). faust2linuxunity uses g++ with -fPIC (lines 70-76). Confirmed. As the doc says, neither was run. Whether the built .dll / .so load and play in a Unity player is correctly marked [U].
  • unity.cpp:179 returns ERR_UNSUPPORTED when inchannels != outchannels. unity.cpp:112-118 truncates parameter names to 15 chars and fills min/max/default. APIUI.h:530 is *fZone = v with no clamp. dsp-tools.h:216-223 zero-fills channels past the DSP's output count, so a 1-channel output goes left-only. architecture/bench.cpp exists. All confirmed.
  • Not checked: the licence claims, the Windows libfaust claims, the LLVM size, and the AquaSynth-internal line cites (NativeFaustRuntime.cs etc.). I didn't check out the PR head, so those rest on the doc.

Deadline measurement plan. The plan is a plan; nothing was run, and the doc says so. Two soft spots:

  • The p99.9 < 25% of D and max < 50% of D pass lines are labelled "a proposal, not a ruling". Fine, but Aqua should rule on them before they gate anything.
  • The in-player step relies on [U] counter names. Unity exposes no direct callback timing, which the doc admits. Only the pure C++ compute timing (step 1) is actually reachable today.

One internal tension. The (a)/(b) table puts the Windows .dll and Linux .so rows at [U], while the Recommendation states "about 80%" confidence. That is honest, but the 80% is on the design choice, not on "it runs in a built Unity player". The unverified list does say this.

Verdict. Accurate and honestly marked; the Unity native-audio and bridge claims hold against upstream. Mergeable as a scoping doc. Optional before merge: add one line to the Recommendation restating the AOT limit, and drop or source the "browser lane" phrase.

Read-only review (nibu). No branch changed, nothing merged. Aqua owns the merge. **AOT limit: stated.** The "Limitation" paragraph under the question says the patch set is fixed at build time, player-authored or modded patches can't run in a built player, and live-edited patches run only in the editor or browser lane. Two small gaps: the Recommendation section and the closing "Unverified list" don't repeat it, so a reader who skips to the recommendation misses the cost of choosing (a). The "browser lane" half is not backed by anything in the doc. **Unity native-audio claims, checked against upstream Faust `master-dev` raw sources.** I couldn't read the 2.90.20 build tree the doc cites, because it isn't on my host. Every line number the doc cites matched upstream. - Faust ships both bridges. `architecture/unity/unity.cpp` is the native audio SDK plugin (253 lines). `FaustPlugin_template.cs:99-100` is `OnAudioFilterRead` calling `ctx.process`. `FaustUtilities_template.cs:307` has the `Faust_setParameterValue` DllImport. All confirmed. - Windows and Linux outputs: `faust2winunity` cross-compiles with `x86_64-w64-mingw32-` / `i686-w64-mingw32-` (lines 108-115). `faust2linuxunity` uses `g++` with `-fPIC` (lines 70-76). Confirmed. As the doc says, neither was run. Whether the built `.dll` / `.so` load and play in a Unity player is correctly marked [U]. - `unity.cpp:179` returns `ERR_UNSUPPORTED` when `inchannels != outchannels`. `unity.cpp:112-118` truncates parameter names to 15 chars and fills min/max/default. `APIUI.h:530` is `*fZone = v` with no clamp. `dsp-tools.h:216-223` zero-fills channels past the DSP's output count, so a 1-channel output goes left-only. `architecture/bench.cpp` exists. All confirmed. - Not checked: the licence claims, the Windows libfaust claims, the LLVM size, and the AquaSynth-internal line cites (`NativeFaustRuntime.cs` etc.). I didn't check out the PR head, so those rest on the doc. **Deadline measurement plan.** The plan is a plan; nothing was run, and the doc says so. Two soft spots: - The p99.9 < 25% of D and max < 50% of D pass lines are labelled "a proposal, not a ruling". Fine, but Aqua should rule on them before they gate anything. - The in-player step relies on [U] counter names. Unity exposes no direct callback timing, which the doc admits. Only the pure C++ `compute` timing (step 1) is actually reachable today. **One internal tension.** The (a)/(b) table puts the Windows `.dll` and Linux `.so` rows at [U], while the Recommendation states "about 80%" confidence. That is honest, but the 80% is on the design choice, not on "it runs in a built Unity player". The unverified list does say this. **Verdict.** Accurate and honestly marked; the Unity native-audio and bridge claims hold against upstream. Mergeable as a scoping doc. Optional before merge: add one line to the Recommendation restating the AOT limit, and drop or source the "browser lane" phrase.
Restate the AOT limit in Recommendation and Unverified list, drop the unsourced
"browser lane", and make the p99.9/max pass lines Aqua's ruling with the
quiet-host caveat for the max line.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
aqua merged commit c136e8fea0 into main 2026-11-07 02:24:23 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
GameCult/AquaSynth!12
No description provided.