Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/p1-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ jobs:
-DBUILD_TESTING=ON
-DJUCE_WEBVIEW2_PACKAGE_LOCATION="${{ github.workspace }}/.deps"
- name: Build executable and native RT tests
run: cmake --build build --config Release --target ARMixConsole ARMixWorkspaceTests ARMixVaultTests ARMixOrbitPhaseTests ARMixOrbitControlTests ARMixOrbitMotionTests ARMixOrbitDistanceTests ARMixFxBypassEnvelopeTests ARMixDearVrPolarPolicyTests ARMixRTTests ARMixPresetTests ARMixDiagnosticTests ARMixClockBridgeTests ARMixVirtualClockSoakTests ARMixCadenceTests ARMixCrackleWindowTests ARMixHealthTests ARMixPolicyTests ARMixPeriodEvidenceTests ARMixLifecycleTests ARMixWasapiProbeTests ARMixDualJuceTests ARMixClockSizingTests ARMixIndependentFormatTests ARMixRecoveryTests ARMixStreamWatchdogTests ARMixBridgeContinuityTests ARMixEndpointPolicyTests ARMixEndpointGuardTests ARMixAsioPolicyTests ARMixAsioBackendTests ARMixAsioRegistryIdentityTests ARMixDirectFenceTests --parallel 2
run: cmake --build build --config Release --target ARMixConsole ARMixMixerRoutingTests ARMixChannelRoutingContractTests ARMixChannelSendTests ARMixWorkspaceTests ARMixVaultTests ARMixOrbitPhaseTests ARMixOrbitControlTests ARMixOrbitMotionTests ARMixOrbitDistanceTests ARMixFxBypassEnvelopeTests ARMixDearVrPolarPolicyTests ARMixRTTests ARMixPresetTests ARMixDiagnosticTests ARMixClockBridgeTests ARMixVirtualClockSoakTests ARMixCadenceTests ARMixCrackleWindowTests ARMixHealthTests ARMixPolicyTests ARMixPeriodEvidenceTests ARMixLifecycleTests ARMixWasapiProbeTests ARMixDualJuceTests ARMixClockSizingTests ARMixIndependentFormatTests ARMixRecoveryTests ARMixStreamWatchdogTests ARMixBridgeContinuityTests ARMixEndpointPolicyTests ARMixEndpointGuardTests ARMixAsioPolicyTests ARMixAsioBackendTests ARMixAsioRegistryIdentityTests ARMixDirectFenceTests --parallel 2
- name: Test realtime control primitives
run: ctest --test-dir build -C Release --output-on-failure
- name: Package verified JUCE GUI for hardware FAT
Expand Down
13 changes: 12 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ juce_add_gui_app(ARMixConsole
juce_add_binary_data(ARMixAssets SOURCES
web/index.html web/styles.css web/app.js web/bridge.js web/monitor.js)

target_sources(ARMixConsole PRIVATE src/Main.cpp src/LiveAudioEngine.h src/VstOrbitController.h engine/core/OrbitPhase.h engine/core/OrbitControlPolicy.h engine/core/OrbitMotion.h engine/core/OrbitDistanceMapping.h engine/core/DearVrPolarPolicy.h src/PluginCatalog.h src/PluginVault.h src/PortableWorkspace.h src/DiagnosticsRecorder.h src/StereoPan.h src/NativePresetArchive.h src/VstBusLayout.h src/LiveGraphHandoff.h src/DiagnosticTone.h engine/core/RealtimeHealthHistogram.h engine/core/CallbackCadenceEvidence.h engine/diagnostics/CrackleEvidenceWindow.h engine/device/AdaptiveClockBridge.h engine/device/AudioProfilePolicy.h engine/device/PeriodCapabilityEvidence.h engine/device/SessionLifecycle.h engine/device/WasapiCapabilityProbe.h engine/device/JuceIndependentClockDevice.h engine/device/ClockBridgeSizing.h engine/device/IndependentStreamFormatFence.h engine/device/DirectRestoreBackoff.h engine/device/IndependentStreamWatchdog.h engine/device/BridgeContinuityGate.h engine/device/EndpointIdentityPolicy.h engine/device/WasapiEndpointIdentityGuard.h engine/device/AsioStartupPolicy.h engine/device/AsioPriorityDeviceManager.h engine/device/AsioRegistrationPolicy.h engine/device/AsioRegistryIdentityProbe.h engine/device/DirectRouteFence.h)
target_sources(ARMixConsole PRIVATE src/Main.cpp src/LiveAudioEngine.h src/VstOrbitController.h engine/core/MixerRoutingPlan.h engine/core/ChannelRoutingContract.h engine/core/ChannelSendPlan.h engine/core/OrbitPhase.h engine/core/OrbitControlPolicy.h engine/core/OrbitMotion.h engine/core/OrbitDistanceMapping.h engine/core/DearVrPolarPolicy.h src/PluginCatalog.h src/PluginVault.h src/PortableWorkspace.h src/DiagnosticsRecorder.h src/StereoPan.h src/NativePresetArchive.h src/VstBusLayout.h src/LiveGraphHandoff.h src/DiagnosticTone.h engine/core/RealtimeHealthHistogram.h engine/core/CallbackCadenceEvidence.h engine/diagnostics/CrackleEvidenceWindow.h engine/device/AdaptiveClockBridge.h engine/device/AudioProfilePolicy.h engine/device/PeriodCapabilityEvidence.h engine/device/SessionLifecycle.h engine/device/WasapiCapabilityProbe.h engine/device/JuceIndependentClockDevice.h engine/device/ClockBridgeSizing.h engine/device/IndependentStreamFormatFence.h engine/device/DirectRestoreBackoff.h engine/device/IndependentStreamWatchdog.h engine/device/BridgeContinuityGate.h engine/device/EndpointIdentityPolicy.h engine/device/WasapiEndpointIdentityGuard.h engine/device/AsioStartupPolicy.h engine/device/AsioPriorityDeviceManager.h engine/device/AsioRegistrationPolicy.h engine/device/AsioRegistryIdentityProbe.h engine/device/DirectRouteFence.h)
target_compile_definitions(ARMixConsole PRIVATE
JUCE_WEB_BROWSER=1
JUCE_USE_WIN_WEBVIEW2=1
Expand Down Expand Up @@ -47,6 +47,17 @@ target_link_libraries(ARMixConsole PRIVATE

include(CTest)
if(BUILD_TESTING)
# P1A/P1B/P1C: compiled and tested now; intentionally NOT connected
# to the JUCE audio callback until control-plane/epoch/hardware FAT exists.
add_executable(ARMixMixerRoutingTests tests/mixer_routing_plan_test.cpp)
target_compile_features(ARMixMixerRoutingTests PRIVATE cxx_std_20)
add_test(NAME TenStripStaticRoutingAndMaster COMMAND ARMixMixerRoutingTests)
add_executable(ARMixChannelRoutingContractTests tests/channel_routing_contract_test.cpp)
target_compile_features(ARMixChannelRoutingContractTests PRIVATE cxx_std_20)
add_test(NAME MonoStereoSparsePhysicalPortRouting COMMAND ARMixChannelRoutingContractTests)
add_executable(ARMixChannelSendTests tests/channel_send_plan_test.cpp)
target_compile_features(ARMixChannelSendTests PRIVATE cxx_std_20)
add_test(NAME TenChannelAcyclicPrePostSends COMMAND ARMixChannelSendTests)
add_executable(ARMixOrbitPhaseTests tests/orbit_phase_test.cpp)
target_compile_features(ARMixOrbitPhaseTests PRIVATE cxx_std_20)
add_test(NAME VstAzimuthOrbitRamp COMMAND ARMixOrbitPhaseTests)
Expand Down
33 changes: 33 additions & 0 deletions docs/P1ABC_MAIN_RECONCILIATION_20261028.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# P1A/P1B/P1C reconciliation — compiled routing foundations only (2026-10-28)

## Current main and dependency decision
Integration base: `main@c0d7c794a27fcdc7adbe77c6166a2e97b848b82c`, which includes #106 visually smoothed native LED meters and #107 sample-accurate FX bypass de-click. Existing stacked drafts #108 (P1A), #110 (P1B) and #111 (P1C) were developed against older bases. Original #108 is **merge-dirty** against main after #107 changed the same Windows CMake test/build line. Do **not** force-merge the stale branches or accept replacement of the de-click/Orbit tests.

This integration takes the reviewed source implementations from head #111, which contains exact ancestry #108 → #110 → #111, then fixes a cross-module pre-fader extraction issue identified during integration review. `extractSource` now makes raw physical capture independent of fader gain, mute and solo, while `extract` retains post-fader MASTER behavior. A new Release regression verifies zero-fader pre-fader sends, muted source taps, and stereo-to-mono raw fold. Only CMake `target_sources`, CTest registration, Windows build target list and this handoff were integrated additively from latest main. No new CI workflows; no base file reset; existing `ARMixFxBypassEnvelopeTests` and `ARMixDearVrPolarPolicyTests` must remain built. All three C++ routing test files have `#undef NDEBUG` *before* `#include <cassert>` to keep Release test assertions executing. Previous P1A alone did not have this, so do not revive its raw 2026-10-27 test blob.

## P1A: deterministic source routing (10 input strips + MASTER)
`engine/core/MixerRoutingPlan.h` compiles mono/stereo input maps, gains, panning, mute/solo, and master mono/gain/balance offline. Fails closed for invalid routes and nonfinite gains/pans. RT extract/accumulate/finish use caller-owned preallocated arrays. See `docs/P1A_REAL_MIXER_ROUTING_CORE_20261028.md`.

## P1B: source format is separate from callback index
`engine/core/ChannelRoutingContract.h` supports independent `followSource/mono/stereo` formats, a validated callback-index lookup derived from sparse **physical port identities**, and mono fold / dual mono. It does NOT assign live device indices or drive native GUI dropdowns. See `docs/P1B_MONO_STEREO_PORT_CONTRACT_20261028.md`.

## P1C: static cycle-safe sends
`engine/core/ChannelSendPlan.h` prepares a bounded 32-edge acyclic send graph, deterministic ordering, pre/post-fader taps, send balance, bus-return semantics and `toMaster` flags. No per-pointer-move send commands, no native stage activation. The live-processing caller will be responsible for correct pre/post tap buffers, solo/mute policy and graph-epoch handoff. See `docs/P1C_INTERNAL_SENDS_DAG_20261028.md`.

## Frozen production boundaries
Current live native chain remains CH1 + MASTER. **CH2–10 and MASTER FX are not yet native multi-bus processing.** Source mapping/FX routing GUI controls must remain disabled/truthful until: (1) physical endpoint ID and callback mask are verified; (2) graph compiled and published with epoch/revision ACK outside RT; (3) deterministic no-heap callback and per-plugin PDC verified; (4) #15 zero-plugin hardware crackle qualification; (5) real-device mono/stereo/multi-input and sends FAT. FX reorder #102 remains separately owned and draft; CI optimization #101 is independent and must not replace native test gates.

## Verification
- P1A test: `TenStripStaticRoutingAndMaster`
- P1B test: `MonoStereoSparsePhysicalPortRouting`
- P1C test: `TenChannelAcyclicPrePostSends`
- Full existing native CTest and single Windows GUI artifact workflow on exact integration SHA.
- Chromium/Firefox GUI smoke includes the real MASTER L/R LED regression and latest Orbit.
- Validate newest main HEAD, PR review and complete CI prior to merge. Postmerge main CI and Pages must be green.
- This is a **compile-only engineering milestone**, not a functioning 10-channel DAW. Neither FPS on owner's Windows server nor native multi-I/O hardware audio has been qualified.

## Late reconciliation with PR #101 (2026-10-28)
While integration PR #112 was being validated, another thread merged PR #101 at `main@66989fa46f004aa852207f1159bf3e1b8e9506c1`: path-filtered native PR gates, current-main-only verified Windows FAT artifact, and stale-safe Pages publisher. Its three workflow changes and policy Node tests are now authoritative. PR #112 was reconciled by a two-parent merge commit (no overwriting `main` workflows). Only three native test targets were inserted into **PR #101's** new Windows build list. `tests/ci_workflow_efficiency_test.mjs`, concurrent Pages policy, Chromium/Firefox gate scheduling, mandatory de-click/Orbit CTests, and main-only artifact upload are preserved unchanged. Main CI and full on-head Windows MSVC CTest must re-pass following this integration.

## Send connectivity correctness gate
The integration audit also corrected `ChannelSendPlan::upstreamOf()`: comparing topological rank alone falsely reported a connection between unrelated strips. The compiled plan now stores a bounded per-source 10-bit descendant mask computed in reverse topological order once during off-RT preparation. Query is O(1); Release CTest proves multihop reachability, disconnected-but-ordered channels, self and reverse negatives. No new runtime graph traversal or heap allocation.
32 changes: 32 additions & 0 deletions docs/P1A_REAL_MIXER_ROUTING_CORE_20261028.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# ArSonMix P1A — verified foundation for real 10-channel routing + MASTER (2026-10-28)

Baseline: `main@de683b001a5a1e5e050bc20ddb52d32b22fa58d1`. Scope: **pure DSP core plus deterministic C++ tests, no live activation**. Superseded/stale UI-DSP PRs must not be bulk merged. Owner's global priority remains stable ultra-low-latency Windows audio and the approved v0.8 GUI; this is not a release or a hardware certification.

## Why this milestone exists

The current JUCE native callback (`src/LiveAudioEngine.h`) processes one stereo input source through one VST3 chain to the master; `src/Main.cpp` currently consumes channel fader/pan/mute only for Channel 1. Its ten other GUI channel/MASTER insert surfaces cannot be called native live FX until a real input/bus topology exists. Issue #15 **0-FX hardware crackle** remains a release gate, and the Smart Audio Engine ARD explicitly prohibits activating P2.6 live multi-channel DSP until that hardware gate passes.

## Implemented: device-independent, offline-prepared routing contract

`engine/core/MixerRoutingPlan.h`:

- Exactly 10 source strips + one MASTER. Every source starts **disconnected** (never invented or assigned to an arbitrary device pin). Physical input indexes are explicit; mono/stereo slots do not infer a nonexistent stereo device.
- The control thread validates *all* channel mappings, valid numeric parameters, stereo channel separation, source mode and physically negotiated input count. It compiles a temporary plan and atomically **as a unit at the API boundary** replaces the output Plan only on complete success. The caller must still publish the Plan across threads safely; **this implementation does not yet provide a graph swap or cross-thread publication**.
- Precomputed equal-power mono pan and stereo-balance coefficients; logical SOLO/MUTE arbitration; fader level, MASTER gain/PAN/mute/mono. No per-sample trig, heap, logging, scans or device operations.
- `extract(strip,...)` reads true physical channel input into preallocated stereo scratch, preserving stereo. `accumulate(strip,...)` sums post-FX stereo scratch into the MASTER mix. `finishMaster(...)` applies MASTER controls after the future master FX chain.
- Unassigned or unavailable physical input returns silence and `false` from `extract`; it never masquerades as a live VST3 or fabricates VU levels.

## Engineering invariants / tests

`tests/mixer_routing_plan_test.cpp` covers 10 independent mono sources, separate left/right physical inputs, stereo identity, mono centered -3 dB law, panic/mute/solo correctness, M/S output summing, invalid physical input and duplicate L/R index, non-finite pan, gain bounds, unknown source modes, recompile rollback and null/insufficient input availability. Existing Windows CTest builds `ARMixMixerRoutingTests` as part of the established workflow (no extra workflow or redundant matrix).

## Next integration gates (deliberately not marked complete)

1. Issue #15 must be physically gated for **0 FX** (OUTPUT_ONLY_TONE, CAPTURE_ONLY, DRY_THROUGH; negotiated driver rate/period and capture/renderer evidence). A CTest pass is not a substitute.
2. Create `SourceRegistry` populated from *actual* ASIO/WASAPI/virtual input endpoints, mapping by explicit per-channel source ID, not hard-coded GUI label or default fake input. Preserve robust DirectFence/independent clocks.
3. Allocate fixed scratch/master buffers ahead of callback; each source: `extract → channel VST chain → fader/pan/mute/solo accumulate`, then `MASTER FX → finishMaster → actual output`. Avoid feedback paths for FX Return. Handle mono/stereo VST bus layout and channel-local plugin/editor/Orbit identity.
4. Publish immutable source/routing snapshots at audio block boundary using the existing `LiveGraphHandoff` epoch/quiescent retirement pattern. No graph destruction, initialization, allocations, locks or device restarts on callback. Support transaction rollback, ACK and source availability status.
5. Verify per-source meters against true post-FX levels; add callback budget profiling, cross-channel isolation, device hotplug, recall, latency/PDC and minimum-buffer soak tests. No guaranteed click-free VST order change until measured on the real device.
6. Only then enable `ADD FX` for CH2–10 and MASTER in native GUI. An unrouted channel must show a truthful disabled/unassigned status until activation.

No installer/runtime changes are included in this milestone. Public/private binary feature parity and the portable VST Vault rules remain unchanged.
Loading
Loading