Nota — a free DAW for macOS, Windows and Linux. No subscription, no account — just open it and make music.
description: "Root src/ cleanup: move Engine_* TUs, split Engine.h types, migrate legacy DSP twins, rehome PluginHostBridge"
Tasks: src/ Root Cleanup (spec 031)
Input: Design documents from /specs/031-src-root-cleanup/ (spec.md, plan.md, research.md)
Organization: Tasks are ordered so each leaves ./scripts/build.sh and tests/Nota.SmokeTest (3704 checks) 100% green. P0 is read-only investigation; P1/P2/P5 are mechanical moves; P3/P4 carry equivalence tests.
P0. Audit (read-only, no code changes)
Purpose: Resolve the two open questions from research.md with measurements, not guesses.
- T001 Audit
Oversampler.hresolution: for each includer (Amp.h,Vintage.h,Forge.h,dsp/primitives/Oversampler.cpp) determine WHICH header the quoted include resolves to (same-dir-first vs-Iorder), and check the link for duplicate/ODR-violating symbols betweensrc/Oversampler.handdsp/primitives/Oversampler.h. Record the verdict (unify on the primitive vs keep both with a documented split) inresearch.md. - T002 Compare
src/CompensationDelay.hvsdsp/primitives/CompensationDelay.h: list every behavioral difference (read-index semantics,isIdle, latency reporting,ready_handling). Verdict: drop-in migration forTrack::pdcor adapter needed.
Checkpoint: research.md holds both verdicts; no source files touched.
P1. Mechanical moves (no logic changes)
Purpose: Empty the root of already-split translation units.
- T003 Move
Engine.cpp+Engine_{Automation,Devices,Modulation,Rack,Recording,Render,Session,Tracks}.cpp(9 TUs, verbatim, no logic changes) intosrc/native/nota.engine/src/engine/, updateCMakeLists.txtsource paths. Old paths removed viagit rm. - T004 Move
PluginHostBridge.h(verbatim) intopluginhost/bridge/, addpluginhost/to thenota_engineinclude dirs if needed so bare#include "PluginHostBridge.h"keeps resolving for the 6Engine_*.cppusers. No logic changes.
Checkpoint: cmake --build green; smoke green.
P2. Engine.h type split (no logic changes)
Purpose: Shrink the ~1800-line god header by extracting standalone types.
- T005 Extract free types from
Engine.hintosrc/native/nota.engine/src/engine/EngineTypes.h(SPSC queue aliases,WarpBuildCursor, other structs/enums not depending on theEngineclass).Engine.hkeeps theEngineclass +LeafWork(member coupling). Verbatim move; no logic changes.
Checkpoint: cmake --build green; smoke green.
P3–P4. Legacy twin migrations (equivalence-tested)
Purpose: Remove the last two flat DSP headers; each migration proves sample-level equivalence first.
- T006 Migrate
Track::pdctodsp::CompensationDelay, deletesrc/CompensationDelay.h. Standalone null-test old-vs-new (impulse + tail through the PDC line at several delay settings, bothready_states): bit-identical or documented ≤ −100 dB RMS with cause. Per T041 lesson, verify read-index semantics explicitly — do NOT assumeread(d)equivalence. - T007 Unify oversampling on
dsp::primitives::Oversampler(per T001 verdict), delete or formally deprecatesrc/Oversampler.h. Null-test old-vs-new through Vintage/Amp/Forge saturation at 1x/2x/4x/8x: follow the project −60 dB rule (FastMath downstream only; coefficient solving staysstd::-exact); revert any substitution that costs more.
Checkpoint: ls src/*.h src/*.cpp shows only Engine.h (+ audit the remainder); smoke green.
Dependencies & Execution Order
- P0 first (answers gate P3/P4 scope).
- P1, P2, P5(T004) independent of each other after P0 — parallelizable.
- P3, P4 depend on P0 verdicts; each needs its equivalence harness before the swap.
- Final:
scripts/build.shgreen + tasks checked off (this file is the checklist; the spec folder itself stays untracked until the branch merges, per 030 practice).