Nota — a free DAW for macOS, Windows and Linux. No subscription, no account — just open it and make music.
C# audioaudio-unitavaloniacpp20cross-platformdawdigital-audio-workstationdspjucelinux-audiomcp-servermidimusicmusic-productionpiano-rollplugin-hostsequencersynthesizervstvst3
Research: Aurora CPU Optimization
Feature: 036-aurora-perf | Date: 2026-10-21
All unknowns below were resolved by reading the repo (no external research needed). Hotspot claims are recorded as profiler-verified leads, not decided solutions.
R1: Where does the benchmark harness live?
- Decision: Extend
tests/perf/nota_perf.cppwith a newaurora-supersaw-2xscenario; run it viascripts/bench-engine.sh(wall time) andscripts/perf-gate.sh(Callgrind + wall time). - Rationale: The harness already drives the engine through the public C ABI only, renders a 4-bar polyphonic passage (
fillClip), and printsid TAB label TAB wall_ms_per_s TAB peak. Aninstrument-05(single default Aurora) scenario already exists — the new scenario differs by: two Aurora tracks (kind 5), Super Saw params applied throughnota_plugin_param_set(nota_engine.h:424, id lookup vianota_plugin_param_id), and 6-voice chords. - Alternatives considered: A standalone micro-benchmark calling
WavetableSynth::renderdirectly — rejected: it would bypass the C ABI (AR-7 test discipline), miss engine overhead (mixing, FX, thread handoff), and duplicate the harness.
R2: How are null tests done in this repo?
- Decision: Add C# smoke-test coverage reusing the
NullDbhelper pattern fromtests/Nota.SmokeTest/PanLawTests.cs:46(asserts residual< -120 dBfor bit-identical renders). Tier-1 changes gate at bit-identical (< -120 dB); Tier-2 changes gate at< -50 dBresidual per the spec decision. - Rationale: Established in-repo practice —
PanLawTestsalready asserts sample-for-sample renders, and DSP comments record dB budgets the same way (Volt fast-sin kept at −78 dB,VoltSynth.cpp:712; reverts where the null cost more than −60 dB,VoltSynth.h:46). Same method, new preset set (all factory Aurora presets, rendered offline before/after each step). - Alternatives considered: New native comparison tool — rejected: the C# smoke test already renders through the C ABI end-to-end and is the PR gate.
R3: What are the suspected hotspots, and what confirms them?
- Decision: Treat these code-reading findings as hypotheses for the profiler to confirm on the x86 Linux reference machine before any DSP edit:
std::exp2per unison voice per sample inoscStack(WavetableSynth.cpp:662) — detune factor is block-constant, recomputed ~14×/voice/sample.std::exp2pitch factor per voice per sample (456, 469) — constant1.0when unmodulated.sqrtperoscStackcall (659),std::tanper filter update (588, every 16 samples/voice/filter),std::sinper sample (LFO728, chorus tap774).- Doubled
filterPaircost on spread unison (498-506). - Serial-first adaptive track parallelism (
Engine_Render.cpp:2200-2246) — stutter before the pool engages.
- Rationale: The M2/x86 gap (faster Apple libm, NEON+FMA vs SSE2-baseline x86 build, bigger caches, larger CoreAudio buffers) points at transcendentals + cache + buffering rather than algorithmic complexity. glibc
exp2/tan/sinat ~30–80 ns each dominate the per-sample budget. - Alternatives considered: Rewriting the oscillator/filter algorithms up front — rejected: premature without profiles; Tier-1 hoisting removes most transcendental calls without touching algorithms.
R4: Which AR rules bind this work?
- Decision: AR-6 (no alloc/lock/IO on audio thread), AR-4/AR-5 (existing queue/snapshot patterns — this feature adds no new cross-thread data), AR-7 (no ABI change; benchmark uses existing
nota_plugin_param_set), AR-9 (no time-source changes). - Rationale: All changes are inside existing DSP functions plus benchmark/test code. No new threads, no new managed↔native surface. Constitution Check passes with no violations to justify.
- Alternatives considered: None — rules are non-negotiable (Constitution VIII).
R5: Relation to the 034 perf gate?
- Decision: Coordinate, don't duplicate. The new
aurora-supersaw-2xscenario automatically joins the 034 scenario set (it enumerates instruments), so the Callgrind gate guards Aurora against future regressions. This feature consumes the gate; it does not rebuild it. - Rationale: 034 measures work (instructions + wall time) per scenario base-vs-PR. Our scenario gives it an Aurora heavy-load case it currently lacks (only default single Aurora).