Document Faust toolchain ownership boundary

This commit is contained in:
Meta Vens 2026-05-17 14:52:58 +01:00
commit 2d13e87aa3
7 changed files with 110 additions and 5 deletions

View file

@ -67,7 +67,13 @@ That separation is the model for this repo:
- The DSL owns musical intent and graph construction.
- The Faust emitter owns pure signal expression.
- AquaSynth owns the compile product contract: Faust toolchain selection,
target-language options, cache keys, generated artifact layout, parameter and
bus manifests, diagnostics, and provenance.
- The engine owns scheduling, buffers, device I/O, threading, and presentation.
- The engine may request compilation or load a cached artifact, but dynamic
patch compilation belongs to AquaSynth and must complete outside the realtime
callback before the engine swaps in the finished DSP.
- Patch parameters are runtime controls, not compile-time constants. A compiled
DSP must be able to expose stable parameter paths so AquaSynth can vary a sound
without recompiling the patch.
@ -77,6 +83,13 @@ Generated Faust should be stable, boring, and inspectable. Cleverness belongs in
the DSL compiler only when it lowers to a graph a tired engineer can still read
after midnight.
Authoring and parity tests may render through Faust-generated C# because that
keeps comparison buffers inside the .NET test harness. Shipping/runtime paths
should prefer Faust native targets when the platform permits it. Bundled Faust
belongs in an explicit AquaSynth toolchain lane, while consumer runtimes should
usually ship compiled DSP artifacts plus manifests instead of silently dragging a
compiler into the engine package.
## Control And Modulation
The Serum-style promise is not "one primitive that puts an oscillator on

View file

@ -0,0 +1,74 @@
# Faust Toolchain Boundary
AquaSynth owns the path from patch intent to loadable DSP product. Aquarium
Engine owns audio hosting. That split keeps the compiler brain near the patch
model and keeps the engine from becoming a synth compiler with a game loop
stapled to it.
## Pipeline Map
1. AquaSynth parses `.aqua` script into an explicit `SynthPatch`.
2. AquaSynth emits stable, inspectable Faust source.
3. AquaSynth resolves a pinned Faust toolchain or caller-provided Faust path.
4. AquaSynth compiles the patch into a target artifact.
5. AquaSynth emits a manifest for parameters, buses, MIDI behavior, sample-rate
assumptions, cache keys, diagnostics, and artifact provenance.
6. Aquarium loads the artifact, binds parameters, schedules notes and buffers,
and calls the DSP from its realtime path.
Aquarium may request compilation, cache lookup, reload, or diagnostics. It
should not need to know how AquaSynth chooses Faust flags, target languages,
architecture files, generated source layout, or artifact identity.
## Ownership
AquaSynth owns:
- patch graph contracts
- Faust source emission
- Faust toolchain selection and version pinning
- compile cache keys
- generated source/native artifact layout
- parameter and bus manifests
- diagnostics and compile provenance
- dynamic patch compilation outside the realtime callback
Aquarium owns:
- device I/O
- buffer scheduling
- audio-thread rules
- note/event delivery
- plugin or engine integration
- artifact loading policy for its platform
- presentation and editor UX
## Runtime Rule
Compilation is never an audio-thread operation. Dynamic patches compile in a
background worker or build step, then Aquarium swaps in a finished DSP artifact
through a realtime-safe handoff.
Parameter changes are not recompiles. Recompile only when graph shape changes;
ordinary patch controls move through the compiled DSP parameter API.
## Target Lanes
- Authoring/tests may use Faust-generated C# because it is easy to render,
inspect, and compare inside the .NET test suite.
- Shipping builds should prefer Faust-generated native targets when the platform
permits it.
- A bundled Faust compiler belongs in an AquaSynth toolchain package or
installer lane, not as an accidental dependency of the core DSL package.
- Consumer runtimes should normally bundle compiled DSP artifacts plus manifests,
not the compiler itself, unless live user patch authoring is a product feature.
## Invariants
- AquaSynth remains the authority for what a patch means.
- Faust remains the pure DSP target, not the host runtime.
- Aquarium remains the realtime host, not the compiler.
- Generated artifacts are reproducible from script, AquaSynth version, Faust
version, target, compile options, and architecture inputs.
- Licenses and provenance travel with toolchains, reference inputs, generated
artifacts, and packaged output.