From dc5bf5c55372029ee0351d3c9ba0d8f84ea7e935 Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Sun, 1 Nov 2026 06:07:33 +0700 Subject: [PATCH 001/233] feat(M5): stable ChannelId VST3 instance lease bank for mono/stereo CH-N Group/FX Return, no RT allocations or catalog remap --- engine/core/DynamicChannelFxLeaseBank.h | 151 ++++++++++++++++++++++++ 1 file changed, 151 insertions(+) create mode 100644 engine/core/DynamicChannelFxLeaseBank.h diff --git a/engine/core/DynamicChannelFxLeaseBank.h b/engine/core/DynamicChannelFxLeaseBank.h new file mode 100644 index 000000000..fe264da0e --- /dev/null +++ b/engine/core/DynamicChannelFxLeaseBank.h @@ -0,0 +1,151 @@ +// SPDX-License-Identifier: AGPL-3.0-only +#pragma once +#include "DynamicChannelRoster.h" +#include "LiveChannelFxGraph.h" +#include +#include +#include +#include +#include +#include +#include + +// M5 universal ChannelId/VST3 ownership bridge. +// +// Unlike the fixed ten-strip index, this immutable CONTROL-PREPARED table +// follows stable ChannelId across +CHANNEL, +GROUP, FX Return and reorder. +// It holds the exact M4 vendor FxInstance owner leases (binary state, +// parameters, bypass envelope, reverb tail). The audio callback traverses +// RAW pointers only: no shared_ptr refcount, heap, lock, VST instantiation, +// string compare or plugin lookup by catalog name. +// +// The bank must be owned by the SAME published/retired native graph snapshot +// as the PCM schedule. Do not discard it while a callback can render from it. +// Never render a former legacy graph concurrently with its migrated instances. +namespace armix::mixer { +class DynamicChannelFxLeaseBank final { +public: + using FxGraph=LiveChannelFxGraph; + using Lease=FxGraph::InstanceLease; + static constexpr int maxInserts=FxGraph::maxInsertsPerStrip; + + struct Assignment final { + ChannelId id{}; + ProcessingFormat format=ProcessingFormat::stereo; + std::vector inserts; // CONTROL only; no creation on callback + }; + + enum class Fault : std::uint8_t { + none,invalidEpoch,emptyId,duplicateChannel,tooManyInserts, + emptyLease,duplicateInstance,invalidBusLayout,missingLegacyIdentity + }; + DynamicChannelFxLeaseBank()=default; + DynamicChannelFxLeaseBank(const DynamicChannelFxLeaseBank&)=delete; + DynamicChannelFxLeaseBank& operator=(const DynamicChannelFxLeaseBank&)=delete; + DynamicChannelFxLeaseBank(DynamicChannelFxLeaseBank&&)=default; + DynamicChannelFxLeaseBank& operator=(DynamicChannelFxLeaseBank&&)=default; + + // Used by message-thread M4->M5 migration. There is no fallback by + // slot position or catalog ID: an actual opaque M4 instance token is + // required, so a Show/reorder cannot accidentally acquire another plugin. + static bool captureLegacy(int lane,ChannelId nativeId, + ProcessingFormat format, + const FxGraph& prior, + Assignment& destination) { + if(lane<0||lane>=FxGraph::fxSlots||!nativeId.value)return false; + Assignment staged; + staged.id=nativeId;staged.format=format; + for(int slot=0;slotinstanceId!=token)return false; + staged.inserts.push_back(std::move(owner)); + } + destination=std::move(staged); + return true; + } + + static Fault prepare(std::uint64_t epoch,std::uint64_t revision, + std::span bindings, + DynamicChannelFxLeaseBank& destination) { + if(!epoch||!revision)return Fault::invalidEpoch; + DynamicChannelFxLeaseBank candidate; + candidate.epoch_=epoch;candidate.revision_=revision; + candidate.rows_.reserve(bindings.size()); + for(const auto& b:bindings) { + if(!b.id.value)return Fault::emptyId; + if(b.inserts.size()>static_cast(maxInserts)) + return Fault::tooManyInserts; + if(b.format!=ProcessingFormat::mono && + b.format!=ProcessingFormat::stereo)return Fault::invalidBusLayout; + Row row;row.id=b.id;row.format=b.format; + row.count=static_cast(b.inserts.size()); + for(std::size_t i=0;iprocessor)return Fault::emptyLease; + // M4's preparation verifies a stereo processor layout for + // both mono-as-dual and stereo strips. Other plugin layouts + // must be negotiated explicitly before a future PCM cutover. + if(owner->processor->getTotalNumInputChannels()!=2 || + owner->processor->getTotalNumOutputChannels()!=2) + return Fault::invalidBusLayout; + for(const auto& existing:candidate.rows_) + for(std::size_t k=0;kcount:0; + } + const Lease* ownerForControl(ChannelId id,std::size_t slot) const noexcept { + const auto* p=find(id);return p&&slotcount?&p->owners[slot]:nullptr; + } + + // Process each M4 VST exactly once at its target ChannelId. CPU work is + // proportional to that node's FX rack, not every Channel in the session. + // Call only on the native audio thread after epoch/revision graph admission. + void operator()(ChannelId id,float* left,float* right,int frames) const noexcept { + const Row* row=find(id); + if(!row)return; // a genuinely dry ChannelId or MASTER + if(!left||!right||left==right||frames<=0)return; + for(std::size_t i=0;icount;++i) + row->raw[i]->render(left,right,frames); + } + +private: + struct Row final { + ChannelId id{}; + ProcessingFormat format=ProcessingFormat::stereo; + std::uint8_t count=0; + std::array owners{}; + std::array raw{}; + }; + const Row* find(ChannelId id) const noexcept { + const auto it=std::lower_bound(rows_.begin(),rows_.end(),id.value, + [](const Row& row,std::uint64_t value){return row.id.valueid==id?&*it:nullptr; + } + std::vector rows_{}; + std::uint64_t epoch_=0,revision_=0; +}; +} // namespace armix::mixer From d7bdd4c0c5947af8a77bafa34385511580a2ff41 Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Sun, 1 Nov 2026 06:08:04 +0700 Subject: [PATCH 002/233] feat(M5): expose epoch/revision-gated M4 FX lease migration to stable ChannelIds on control thread --- src/LiveDryRoutingLab.h | 52 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) diff --git a/src/LiveDryRoutingLab.h b/src/LiveDryRoutingLab.h index ae28b5f16..dfc48de8d 100644 --- a/src/LiveDryRoutingLab.h +++ b/src/LiveDryRoutingLab.h @@ -3,6 +3,7 @@ #include "../engine/core/PreparedMixerBlock.h" #include "../engine/core/MasterOutputMonoPolicy.h" #include "../engine/core/LiveChannelFxGraph.h" +#include "../engine/core/DynamicChannelFxLeaseBank.h" #include "VstBusLayout.h" #include "../engine/core/NativeDryRouteCommand.h" #include "../engine/device/JuceActivePortSnapshot.h" @@ -567,6 +568,57 @@ class LiveDryRoutingLab final { return true; } + // M5 native ChannelId VST3 migration: capture actual current M4 vendor + // processor LEASES, not catalog names or copied binary state. The writer + // must hold these control-owned leases within its new published dynamic + // PCM snapshot until final callback retirement. No callback activity, + // device reopen, preset restoration or rack instantiation occurs here. + // The host's special legacy CH1 external chain remains a SEPARATE lease; + // do not cut over a loaded external CH1 graph without transferring it. + bool captureDynamicFxLeases( + std::uint64_t expectedEpoch,std::uint64_t expectedRevision, + std::span laneIds, + armix::mixer::DynamicChannelFxLeaseBank& destination, + juce::String& error) const { + using Bank=armix::mixer::DynamicChannelFxLeaseBank; + if(laneIds.size()!=static_cast(fxSlots) || + !hasExplicitRoute() || !ready() || + expectedEpoch!=epoch() || expectedRevision!=revision()) { + error="M5: native epoch/revision or 10CH+4AUX FX roster stale"; + return false; + } + const FxGraph* current=publisher_.controlPrepared(expectedEpoch,expectedRevision); + if(!current) { + error="M5: no current M4 prepared vendor FX graph"; + return false; + } + std::vector staged; + staged.reserve(fxSlots); + for(int lane=0;lane(lane)], + format,*current,slot)) { + error="M5: failed to retain M4 VST3 token for lane "+ + juce::String(lane); + return false; + } + staged.push_back(std::move(slot)); + } + const auto fault=Bank::prepare(expectedEpoch,expectedRevision,staged, + destination); + if(fault!=Bank::Fault::none) { + error="M5: ChannelId VST lease migration rejected, fault "+ + juce::String(static_cast(fault)); + return false; + } + error.clear(); + return true; + } + // Live, nonstructural FX power control; all guards bound to a real ACK. bool setFxBypass(int lane,int slot,std::uint64_t expectedEpoch, std::uint64_t expectedRevision,const juce::String& token, From 09f2c0c46d65306a671d2b6b9b797a32118f2dc2 Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Sun, 1 Nov 2026 06:08:56 +0700 Subject: [PATCH 003/233] test(M5): render real JUCE FX on CH1, CH11, Group and FX Return with one prepared PCM, state retention and zero RT heap --- tests/live_channel_fx_graph_test.cpp | 118 +++++++++++++++++++++++++++ 1 file changed, 118 insertions(+) diff --git a/tests/live_channel_fx_graph_test.cpp b/tests/live_channel_fx_graph_test.cpp index d437b1579..aee035e38 100644 --- a/tests/live_channel_fx_graph_test.cpp +++ b/tests/live_channel_fx_graph_test.cpp @@ -1,5 +1,7 @@ // SPDX-License-Identifier: AGPL-3.0-only #include "../engine/core/LiveChannelFxGraph.h" +#include "../engine/core/DynamicChannelFxLeaseBank.h" +#include "../engine/core/DynamicNativeSessionPublisher.h" #include "../engine/core/NativeOutputPairTap.h" #include "../engine/core/RealtimeRoutePublisher.h" #if defined(NDEBUG) @@ -87,7 +89,123 @@ static std::unique_ptr makeGraph(float firstFx,float returnF assert(graph->maxFramesPerPlugin()==32); // clamp minimum safe plugin quantum return graph; } +// M5: real M4 JUCE plugin instances survive ChannelId graph migration. +// CH11 and FX Return are not borrowed legacy strips: they receive their own +// native processor leases and execute in the same prepared PCM schedule. +static void verifyUniversalChannelIdFxLeaseAndLivePcm() { + using Bank=DynamicChannelFxLeaseBank; + DynamicChannelRoster roster; + std::array adds{}; + for(int i=0;i<4;++i) { + auto& op=adds[static_cast(i)]; + op.kind=ChannelEdit::Kind::add; + op.position=static_cast(i); + op.role=i==2?ChannelRole::fxReturn:i==3?ChannelRole::main:ChannelRole::input; + op.format=i<2?ProcessingFormat::mono:ProcessingFormat::stereo; + op.text=i==0?"CH1":i==1?"CH11":i==2?"FX RETURN":"MAIN"; + } + const auto created=roster.edit(0,adds); + assert(created.ok()&&created.createdIds.size()==4); + const auto ch1=created.createdIds[0],ch11=created.createdIds[1]; + const auto ret=created.createdIds[2],main=created.createdIds[3]; + std::vector wire; + const auto link=[&](ChannelId src,ChannelId dst,bool primary, + float gain=1.f) { + ChannelEdit op;op.kind=ChannelEdit::Kind::addSendReference; + op.id=src;op.target=dst;op.value=gain;op.primaryOutput=primary; + wire.push_back(std::move(op)); + }; + link(ch1,main,true); + link(ch11,main,true); + link(ret,main,true); + link(ch11,ret,false,.5f); + ChannelEdit marker;marker.kind=ChannelEdit::Kind::addInsertReference; + marker.id=ret;marker.text="native-vst3-fx-return"; + wire.push_back(std::move(marker)); + assert(roster.edit(roster.revision(),wire).ok()); + const std::array selected{ch1,ch11}; + const auto group=roster.createBusForSelected( + roster.revision(),selected,"VOCAL GROUP",ChannelRole::group); + assert(group.ok()&&group.createdIds.size()==1); + const auto bus=group.createdIds[0]; + assert(roster.find(ch11)->primaryOutput==bus); + assert(roster.find(bus)->primaryOutput==main); + + DynamicGraphRequest req; + req.physicalInputs=2;req.maxFrames=64; + req.sources={{ch1,0,-1,false},{ch11,1,-1,false}}; + DynamicNativeSessionPublisher native; + constexpr std::uint64_t epoch=991; + assert(native.commit(roster,req,0,epoch,epoch,true).ok()); + + auto original=makeGraph(2.f,3.f); + Bank::Assignment first,groupOwner; + assert(Bank::captureLegacy(0,ch1,ProcessingFormat::mono,*original,first)); + assert(Bank::captureLegacy(1,bus,ProcessingFormat::stereo,*original,groupOwner)); + // These are genuinely new CH11/FX Return native instances. The M4 + // vendor processor ownership class and binary state path are reused. + const auto newFx=[&](float g,const char* catalog)->Bank::Lease { + auto p=std::make_unique(g); + p->prepareToPlay(48000.0,64); + return std::make_shared( + std::move(p),juce::String(catalog),juce::String(catalog),64); + }; + Bank::Assignment eleven;eleven.id=ch11;eleven.format=ProcessingFormat::mono; + eleven.inserts.push_back(newFx(4.f,"ch11-gain")); + Bank::Assignment returnFx;returnFx.id=ret;returnFx.format=ProcessingFormat::stereo; + returnFx.inserts.push_back(newFx(2.f,"fx-return-gain")); + std::array assignments{first,eleven,groupOwner,returnFx}; + Bank bank; + assert(Bank::prepare(epoch,native.acceptedRevision(),assignments,bank)== + Bank::Fault::none); + assert(bank.lanes()==4&&bank.insertCount(ch11)==1&& + bank.insertCount(bus)==1&&bank.insertCount(ret)==1); + assert(bank.ownerForControl(ch1,0)&& + (*bank.ownerForControl(ch1,0))->instanceId== + original->insertInstanceId(0,0)); + Bank blocked; + std::array alias{first,groupOwner}; + alias[1].id=ch11; + alias[1].inserts=first.inserts; // same native processor twice + assert(Bank::prepare(epoch,2,alias,blocked)==Bank::Fault::duplicateInstance); + assert(blocked.lanes()==0); + assert(Bank::prepare(epoch,2,assignments,blocked)==Bank::Fault::none); + const auto token=original->insertInstanceId(0,0); + auto migrated=*bank.ownerForControl(ch1,0); + assert(migrated->instanceId==token); + original.reset(); // vendor instances retained by bank, no new VST3 scan + assert(GainFx::living>=4); + std::array mic{},music{},left{},right{}; + mic.fill(.2f);music.fill(.1f); + const float* pins[]{mic.data(),music.data()}; + const auto beforeHeap=heapCalls.load(std::memory_order_relaxed); + assert(native.render(epoch,pins,2,left.data(),right.data(),64,false, + [&bank](ChannelId id,float* l,float* r,int n) noexcept { + bank(id,l,r,n); + })); + assert(heapCalls.load(std::memory_order_relaxed)==beforeHeap); + constexpr float center=.7071067811865475f; + // Main: (CH1 .2*2 + CH11 .1*4) * mono pan * GROUP FX3 + // + CH11 post-send .5 * FX Return VST2 (no extra dry source). + assert(near(left[63],((.2f*2.f+.1f*4.f)*3.f+ + (.1f*4.f)*.5f*2.f)*center)); + assert(near(left[63],right[63])); + assert(native.setChannelMix(epoch,1,bus,.5f,0.f)); + assert(native.render(epoch,pins,2,left.data(),right.data(),64,false, + [&bank](ChannelId id,float* l,float* r,int n) noexcept { + bank(id,l,r,n); + })); + assert(near(left[63],((.2f*2.f+.1f*4.f)*3.f*.5f+ + (.1f*4.f)*.5f*2.f)*center)); + assert(!native.render(epoch+1,pins,2,left.data(),right.data(),64,false, + [&bank](ChannelId id,float* l,float* r,int n) noexcept { + bank(id,l,r,n); + })); + assert(left[63]==0.f&&right[63]==0.f); +} + int main() { + verifyUniversalChannelIdFxLeaseAndLivePcm(); // R0: existing CH1 FX chain may be rendered inside the SAME prepared // ten-channel routing pass, without creating a second plugin or copying // a processor. Verify exactly one call and zero callback heap allocation. From 15ac5f2c57373d8406512693cdd6fc66b1f83ac8 Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Sun, 1 Nov 2026 06:09:22 +0700 Subject: [PATCH 004/233] test(M5): use verified accepted Group topology and vendor-prepared 32-frame quantum in native PCM --- tests/live_channel_fx_graph_test.cpp | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/tests/live_channel_fx_graph_test.cpp b/tests/live_channel_fx_graph_test.cpp index aee035e38..2a709987d 100644 --- a/tests/live_channel_fx_graph_test.cpp +++ b/tests/live_channel_fx_graph_test.cpp @@ -128,15 +128,18 @@ static void verifyUniversalChannelIdFxLeaseAndLivePcm() { roster.revision(),selected,"VOCAL GROUP",ChannelRole::group); assert(group.ok()&&group.createdIds.size()==1); const auto bus=group.createdIds[0]; - assert(roster.find(ch11)->primaryOutput==bus); - assert(roster.find(bus)->primaryOutput==main); + // The accepted routing view, not a UI draft, proves exclusive primary OUT. DynamicGraphRequest req; - req.physicalInputs=2;req.maxFrames=64; + req.physicalInputs=2;req.maxFrames=32; req.sources={{ch1,0,-1,false},{ch11,1,-1,false}}; DynamicNativeSessionPublisher native; constexpr std::uint64_t epoch=991; assert(native.commit(roster,req,0,epoch,epoch,true).ok()); + const auto* view=native.acceptedRouting(epoch,1); + assert(view&&view->find(ch11)&&view->find(bus)); + assert(view->find(ch11)->primaryOutput==bus); + assert(view->find(bus)->primaryOutput==main); auto original=makeGraph(2.f,3.f); Bank::Assignment first,groupOwner; @@ -175,11 +178,11 @@ static void verifyUniversalChannelIdFxLeaseAndLivePcm() { assert(migrated->instanceId==token); original.reset(); // vendor instances retained by bank, no new VST3 scan assert(GainFx::living>=4); - std::array mic{},music{},left{},right{}; + std::array mic{},music{},left{},right{}; mic.fill(.2f);music.fill(.1f); const float* pins[]{mic.data(),music.data()}; const auto beforeHeap=heapCalls.load(std::memory_order_relaxed); - assert(native.render(epoch,pins,2,left.data(),right.data(),64,false, + assert(native.render(epoch,pins,2,left.data(),right.data(),32,false, [&bank](ChannelId id,float* l,float* r,int n) noexcept { bank(id,l,r,n); })); @@ -187,21 +190,21 @@ static void verifyUniversalChannelIdFxLeaseAndLivePcm() { constexpr float center=.7071067811865475f; // Main: (CH1 .2*2 + CH11 .1*4) * mono pan * GROUP FX3 // + CH11 post-send .5 * FX Return VST2 (no extra dry source). - assert(near(left[63],((.2f*2.f+.1f*4.f)*3.f+ + assert(near(left[31],((.2f*2.f+.1f*4.f)*3.f+ (.1f*4.f)*.5f*2.f)*center)); - assert(near(left[63],right[63])); + assert(near(left[31],right[31])); assert(native.setChannelMix(epoch,1,bus,.5f,0.f)); - assert(native.render(epoch,pins,2,left.data(),right.data(),64,false, + assert(native.render(epoch,pins,2,left.data(),right.data(),32,false, [&bank](ChannelId id,float* l,float* r,int n) noexcept { bank(id,l,r,n); })); - assert(near(left[63],((.2f*2.f+.1f*4.f)*3.f*.5f+ + assert(near(left[31],((.2f*2.f+.1f*4.f)*3.f*.5f+ (.1f*4.f)*.5f*2.f)*center)); - assert(!native.render(epoch+1,pins,2,left.data(),right.data(),64,false, + assert(!native.render(epoch+1,pins,2,left.data(),right.data(),32,false, [&bank](ChannelId id,float* l,float* r,int n) noexcept { bank(id,l,r,n); })); - assert(left[63]==0.f&&right[63]==0.f); + assert(left[31]==0.f&&right[31]==0.f); } int main() { From d5ebc0b6cf005d2f78dc7b90abd55c977f004169 Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Sun, 1 Nov 2026 06:10:04 +0700 Subject: [PATCH 005/233] docs(M5): native Group/CH11 FX state migration, global console contract and exact safe cutover/FAT gates --- ...CHANNELID_VST3_LEASE_MIGRATION_20261101.md | 38 +++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 docs/M5_UNIVERSAL_CHANNELID_VST3_LEASE_MIGRATION_20261101.md diff --git a/docs/M5_UNIVERSAL_CHANNELID_VST3_LEASE_MIGRATION_20261101.md b/docs/M5_UNIVERSAL_CHANNELID_VST3_LEASE_MIGRATION_20261101.md new file mode 100644 index 000000000..9a237de74 --- /dev/null +++ b/docs/M5_UNIVERSAL_CHANNELID_VST3_LEASE_MIGRATION_20261101.md @@ -0,0 +1,38 @@ +# M5 — Universal ChannelId / native VST3 lease migration + +**Scope:** ArSonMix is a realtime live-performance digital mixer, NOT a DAW arranger/editor. This milestone migrates the actual M4 per-channel vendor processor ownership model into a ChannelId-keyed native DSP graph. It is the required shared FX seam for real CH11+, Group and FX Return parity. It does **not** activate the old dry-only M3E #263 pilot in production. + +## Why + +Current shipped M4 supports native VST3 on fixed CH1..CH10 and four AUX lanes, with stateful FX instance identity, bypass fade and correct control-thread retirement. Prior M3E pilot could create a new Group native PCM but refused any existing VST3/AUX/MONITOR/Show. Replacing an accepted M4 mix with an FX-free graph would silently discard reverb and compressor state. This is unacceptable for live karaoke, podcast, streaming or stage use. + +Top global console contracts are consistent: +- Fender Studio Pro: Bus submixes, FX Channel return with independent sends, pre/post send choices, Group channel input fan-in, nested Bus and direct output routing. https://fenderstudiopromanual.fender.com/en/Content/Mixing_Topics/The_Console.htm +- Waves eMotion LV1: Channel and Group processing, separate Aux/FX/Monitor/MATRIX layers and physical routing patches. https://www.waves.com/emotion-lv1-tutorial-4-2-mixer-channels-groups-aux + +## Implemented M5 native architecture + +### `engine/core/DynamicChannelFxLeaseBank.h` +- A **stable ChannelId → M4 FX rack** map. Identities survive reordering and channel-bank viewport changes. Works for arbitrary dynamically admitted Mono/Stereo input, Group, and FX Return IDs; no CH10 borrowing. +- `captureLegacy`: imports each already-accepted M4 native vendor **FxInstance lease** using exact opaque `instanceId`, never a catalog-name substitute or processor recreation. The actual `juce::AudioProcessor`, parameters, binary state, internal delay/reverb tail, bypass envelope and MIDI scratch remain owned. +- `prepare`: one control-thread transaction preallocates and validates mapping, 8-insert bound, mono/stereo Node contract, stereo VST bus layout, missing lease, reused native processor in multiple simultaneous lanes, invalid device epoch or repeated ChannelId. Failed preparation leaves the previously accepted bank unchanged. +- `operator()(ChannelId,float*,float*,frames) noexcept`: callback dispatch is read-only, binary search by immutable ID with raw processor pointers, no `shared_ptr` copy, allocation, waiting, mutex, VST scan, new callback or dynamic catalog lookup. +- **Lifecycle requirement:** lease bank MUST be owned/retired by the SAME native prepared PCM publication/snapshot as its routing plan. A final owner must never disappear inside a callback. Two graphs sharing the same plugin may NOT render concurrently; existing `FxInstance::render` fail-closed atomic gate is an additional safety fence, not a dual-render design. + +### `src/LiveDryRoutingLab.h` +- `captureDynamicFxLeases(expectedEpoch,expectedRevision,ids,...)` now exposes exactly 10 input + 4 AUX M4 VST rack owners for native M5 conversion, from the actual publisher accepted revision. No device switching and no modification to the active M4 graph. Stale/invalid device epochs fail closed. + +### `tests/live_channel_fx_graph_test.cpp` +- Native JUCE `AudioProcessor::processBlock` through ONE `DynamicNativeSessionPublisher` PCM graph: **CH1 FX + CH11 FX → GROUP FX → MAIN** while CH11 also has a parallel POST SEND to an independent FX Return with its own processor. +- Proves an actual output sum with no doubled dry signal and correct -6 dB Group fader, opaque M4 instance token reuse after the old owner graph is retired, no audio-callback heap allocations, one native render, duplicate vendor instance rejection, and wrong-epoch output fail-silent. +- Reuses existing `ARMixLiveChannelFxTests` Windows MSVC/CTest executable; no separate CI matrix and no expensive external vendor plugins for deterministic tests. + +## Integration admission — do not skip + +1. Merge this bank only after exact-head native Windows CTest and test fixture pass. +2. Refactor M3E dynamic publisher to **own Bank alongside native prepared PCM**, so an epoch/revision ACK refers to the same routing + FX instance generation. No separate second render path. Use the M4 off-RT plugin editor/Show save-restore; CH1 legacy external owner must be migrated independently (the legacy routed graph can have an empty CH1 FX lane while the special CH1 host still has FX). Never claim a complete CH1 transfer until that owner is connected. +3. Migrate the entire accepted legacy Show/AUX/PRE/POST/MONITOR/MAIN/secondary output via the existing `LegacyGraphMigration` bridge. Support one hardware device pin mask per accepted render; no hidden coercion to ASIO/OBS. +4. Permit Add Channel/Group/FX Return in the single native producer **after** passing true CH11 mono/stereo, plugin preset state, nested Group and send/monitor tests. Build GUI strip IDs from the exact native ACK. Hardware FAT follows from a Windows executable at that head. +5. Keep existing M4/FAST3 one-APPLY and emergency MUTE, adaptive channel bank R7, P0 #15 0FX crackle evidence and realtime performance counters intact. + +**Honest status:** This is a substantive native FX/state migration seam with real processor PCM tests, **not yet a publicly usable full dynamic Studio One-equivalent Console**. No physical zero-latency guarantee and no field MAONO PS22 FAT has been executed for this M5 branch. From baf6e7fae0aec47ea0b7a3fd9511690133d27d0e Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Sun, 1 Nov 2026 06:11:56 +0700 Subject: [PATCH 006/233] feat(M5): bind VST3 owner lease to SAME atomic native PCM snapshot; dispatch exactly once with RT raw pointers --- engine/core/DynamicNativeSessionPublisher.h | 33 +++++++++++++++++++-- 1 file changed, 31 insertions(+), 2 deletions(-) diff --git a/engine/core/DynamicNativeSessionPublisher.h b/engine/core/DynamicNativeSessionPublisher.h index 65b315d8a..d2d697fa2 100644 --- a/engine/core/DynamicNativeSessionPublisher.h +++ b/engine/core/DynamicNativeSessionPublisher.h @@ -18,9 +18,23 @@ // Never run both renderers or sum their outputs. No browser-only LIVE status. namespace armix::mixer { class DynamicNativeSessionPublisher final { +public: + // Control-owned native FX lifetime travels IN the same accepted PCM + // snapshot. JUCE types stay outside this portable DSP publisher. + struct FxPlan final { + std::shared_ptr owner; // CONTROL-only copy/destruction + void* context=nullptr; // unchanged owner.get(), RT raw pointer + void (*render)(void*,ChannelId,float*,float*,int) noexcept=nullptr; + bool valid() const noexcept { + return (!owner&&!context&&!render) || + (owner&&context==owner.get()&&render); + } + }; +private: struct Prepared final { DynamicPreparedMixerBlock graph; DynamicConsoleRoutingView routing; + FxPlan fx; // SAME lifetime and revision as native PCM graph int physicalInputs=0; bool monitor=false; }; @@ -49,8 +63,12 @@ class DynamicNativeSessionPublisher final { std::uint64_t expectedRevision, std::uint64_t proposedDeviceEpoch, std::uint64_t activeDeviceEpoch, - bool allOutputsDisarmed) { + bool allOutputsDisarmed, + FxPlan fx={}) { CommitResult report;report.revision=publisher_.lastRevision(); + if(!fx.valid()) { + report.fault=Fault::invalidCandidate;return report; + } if(proposedDeviceEpoch==0 || proposedDeviceEpoch!=activeDeviceEpoch) { report.fault=Fault::staleDevice;return report; @@ -76,6 +94,7 @@ class DynamicNativeSessionPublisher final { report.fault=Fault::invalidGraph;return report; } prepared->physicalInputs=request.physicalInputs; + prepared->fx=std::move(fx); // one accepted control-plane publication prepared->monitor=std::any_of(roster.channels().begin(), roster.channels().end(),[](const ChannelStripDefinition& row) { return row.role==ChannelRole::monitor; @@ -143,9 +162,19 @@ class DynamicNativeSessionPublisher final { if(rendering_.test_and_set(std::memory_order_acquire)) { clearOutputs();return false; } + // Prepared FX takes precedence over the legacy external callback. + // NEVER invoke both: that would double-compress or double-reverb. + // Snapshot ownership pins the M4 instance throughout this callback; + // only control-thread retirement releases the shared owner. + const auto dispatch=[&](ChannelId id,float* l,float* r,int n) noexcept { + const auto& acceptedFx=snap->prepared->fx; + if(acceptedFx.render) + acceptedFx.render(acceptedFx.context,id,l,r,n); + else effect(id,l,r,n); + }; const bool ok=snap->prepared->graph.process( physical,physicalCount,mainL,mainR,frames, - std::forward(effect),monitorL,monitorR); + dispatch,monitorL,monitorR); rendering_.clear(std::memory_order_release); if(!ok)clearOutputs(); return ok; From 9184a901d1d48f86e6f4e30e89b3d84e78956b1c Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Sun, 1 Nov 2026 06:12:28 +0700 Subject: [PATCH 007/233] test(M5): bind real JUCE FX bank to same native PCM snapshot, reject pointer mismatch, no duplicate plugin render, retain through graph republish --- tests/live_channel_fx_graph_test.cpp | 53 ++++++++++++++++++++++------ 1 file changed, 42 insertions(+), 11 deletions(-) diff --git a/tests/live_channel_fx_graph_test.cpp b/tests/live_channel_fx_graph_test.cpp index 2a709987d..1cd2df115 100644 --- a/tests/live_channel_fx_graph_test.cpp +++ b/tests/live_channel_fx_graph_test.cpp @@ -159,7 +159,8 @@ static void verifyUniversalChannelIdFxLeaseAndLivePcm() { returnFx.inserts.push_back(newFx(2.f,"fx-return-gain")); std::array assignments{first,eleven,groupOwner,returnFx}; Bank bank; - assert(Bank::prepare(epoch,native.acceptedRevision(),assignments,bank)== + // The accepted FX owner and native PCM must share the NEXT graph revision. + assert(Bank::prepare(epoch,native.acceptedRevision()+1,assignments,bank)== Bank::Fault::none); assert(bank.lanes()==4&&bank.insertCount(ch11)==1&& bank.insertCount(bus)==1&&bank.insertCount(ret)==1); @@ -178,14 +179,36 @@ static void verifyUniversalChannelIdFxLeaseAndLivePcm() { assert(migrated->instanceId==token); original.reset(); // vendor instances retained by bank, no new VST3 scan assert(GainFx::living>=4); + auto acceptedOwner=std::make_shared(std::move(bank)); + DynamicNativeSessionPublisher::FxPlan ownerPlan; + ownerPlan.owner=std::static_pointer_cast(acceptedOwner); + ownerPlan.context=acceptedOwner.get(); + ownerPlan.render=+[](void* ctx,ChannelId id,float* l,float* r,int n) noexcept { + (*static_cast(ctx))(id,l,r,n); + }; + assert(ownerPlan.valid()); + // A mismatched raw callback context cannot be published or overwrite a + // working hardware graph. This is not a UI flag or an unchecked pointer. + auto wrong=ownerPlan;wrong.context=nullptr; + assert(native.commit(roster,req,1,epoch,epoch,true,std::move(wrong)).fault== + DynamicNativeSessionPublisher::Fault::invalidCandidate); + assert(native.acceptedRevision()==1); + assert(native.commit(roster,req,1,epoch,epoch,true,ownerPlan).ok()); + assert(native.acceptedRevision()==2); + // Only the accepted snapshot retains the vendor bank; local control + // holders can retire without losing a live VST during callback. + acceptedOwner.reset(); std::array mic{},music{},left{},right{}; mic.fill(.2f);music.fill(.1f); const float* pins[]{mic.data(),music.data()}; + int legacyFallbackCalls=0; + const auto legacyFx=[&](ChannelId,float*,float*,int) noexcept { + ++legacyFallbackCalls; + }; const auto beforeHeap=heapCalls.load(std::memory_order_relaxed); assert(native.render(epoch,pins,2,left.data(),right.data(),32,false, - [&bank](ChannelId id,float* l,float* r,int n) noexcept { - bank(id,l,r,n); - })); + legacyFx)); + assert(legacyFallbackCalls==0); // never dual-render M4 + M5 assert(heapCalls.load(std::memory_order_relaxed)==beforeHeap); constexpr float center=.7071067811865475f; // Main: (CH1 .2*2 + CH11 .1*4) * mono pan * GROUP FX3 @@ -193,17 +216,25 @@ static void verifyUniversalChannelIdFxLeaseAndLivePcm() { assert(near(left[31],((.2f*2.f+.1f*4.f)*3.f+ (.1f*4.f)*.5f*2.f)*center)); assert(near(left[31],right[31])); - assert(native.setChannelMix(epoch,1,bus,.5f,0.f)); + assert(native.setChannelMix(epoch,2,bus,.5f,0.f)); + assert(native.render(epoch,pins,2,left.data(),right.data(),32,false, + legacyFx)); + assert(legacyFallbackCalls==0); + assert(near(left[31],((.2f*2.f+.1f*4.f)*3.f*.5f+ + (.1f*4.f)*.5f*2.f)*center)); + // A structural recompile carries the same M4 VST3 lease and accepted + // Group gain. In real production the control thread must serialize + // the same revision/epoch and never recreate vendor state. + assert(roster.rememberLiveMix(bus,.5f,0.f)); + assert(native.commit(roster,req,2,epoch,epoch,true,ownerPlan).ok()); + assert(native.acceptedRevision()==3); assert(native.render(epoch,pins,2,left.data(),right.data(),32,false, - [&bank](ChannelId id,float* l,float* r,int n) noexcept { - bank(id,l,r,n); - })); + legacyFx)); assert(near(left[31],((.2f*2.f+.1f*4.f)*3.f*.5f+ (.1f*4.f)*.5f*2.f)*center)); + assert(legacyFallbackCalls==0); assert(!native.render(epoch+1,pins,2,left.data(),right.data(),32,false, - [&bank](ChannelId id,float* l,float* r,int n) noexcept { - bank(id,l,r,n); - })); + legacyFx)); assert(left[31]==0.f&&right[31]==0.f); } From bbce5818608a2a2683228c5298d4e1e739a5e250 Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Sun, 1 Nov 2026 06:14:54 +0700 Subject: [PATCH 008/233] fix(M5): atomic FX lease/PCM device epoch and revision admission with non-destructive rollback test --- engine/core/DynamicNativeSessionPublisher.h | 10 +++++++--- tests/live_channel_fx_graph_test.cpp | 17 ++++++++++++++++- 2 files changed, 23 insertions(+), 4 deletions(-) diff --git a/engine/core/DynamicNativeSessionPublisher.h b/engine/core/DynamicNativeSessionPublisher.h index d2d697fa2..149f286d8 100644 --- a/engine/core/DynamicNativeSessionPublisher.h +++ b/engine/core/DynamicNativeSessionPublisher.h @@ -25,9 +25,11 @@ class DynamicNativeSessionPublisher final { std::shared_ptr owner; // CONTROL-only copy/destruction void* context=nullptr; // unchanged owner.get(), RT raw pointer void (*render)(void*,ChannelId,float*,float*,int) noexcept=nullptr; + std::uint64_t deviceEpoch=0,graphRevision=0; bool valid() const noexcept { - return (!owner&&!context&&!render) || - (owner&&context==owner.get()&&render); + return (!owner&&!context&&!render&&!deviceEpoch&&!graphRevision) || + (owner&&context==owner.get()&&render&& + deviceEpoch>0&&graphRevision>0); } }; private: @@ -66,7 +68,9 @@ class DynamicNativeSessionPublisher final { bool allOutputsDisarmed, FxPlan fx={}) { CommitResult report;report.revision=publisher_.lastRevision(); - if(!fx.valid()) { + if(!fx.valid() || + (fx.owner && (fx.deviceEpoch!=proposedDeviceEpoch || + fx.graphRevision!=expectedRevision+1))) { report.fault=Fault::invalidCandidate;return report; } if(proposedDeviceEpoch==0 || diff --git a/tests/live_channel_fx_graph_test.cpp b/tests/live_channel_fx_graph_test.cpp index 1cd2df115..ad869e21b 100644 --- a/tests/live_channel_fx_graph_test.cpp +++ b/tests/live_channel_fx_graph_test.cpp @@ -186,6 +186,7 @@ static void verifyUniversalChannelIdFxLeaseAndLivePcm() { ownerPlan.render=+[](void* ctx,ChannelId id,float* l,float* r,int n) noexcept { (*static_cast(ctx))(id,l,r,n); }; + ownerPlan.deviceEpoch=epoch;ownerPlan.graphRevision=2; assert(ownerPlan.valid()); // A mismatched raw callback context cannot be published or overwrite a // working hardware graph. This is not a UI flag or an unchecked pointer. @@ -226,7 +227,21 @@ static void verifyUniversalChannelIdFxLeaseAndLivePcm() { // Group gain. In real production the control thread must serialize // the same revision/epoch and never recreate vendor state. assert(roster.rememberLiveMix(bus,.5f,0.f)); - assert(native.commit(roster,req,2,epoch,epoch,true,ownerPlan).ok()); + // A structurally new graph must NOT silently accept an old-revision + // FX binding, even when the raw processor pointers are still alive. + assert(native.commit(roster,req,2,epoch,epoch,true,ownerPlan).fault== + DynamicNativeSessionPublisher::Fault::invalidCandidate); + assert(native.acceptedRevision()==2); + Bank refreshed; + assert(Bank::prepare(epoch,3,assignments,refreshed)==Bank::Fault::none); + auto refreshedOwner=std::make_shared(std::move(refreshed)); + auto refreshedPlan=ownerPlan; + refreshedPlan.owner=std::static_pointer_cast(refreshedOwner); + refreshedPlan.context=refreshedOwner.get(); + refreshedPlan.graphRevision=3; + const auto originalProcessors=GainFx::living; + assert(native.commit(roster,req,2,epoch,epoch,true,refreshedPlan).ok()); + assert(GainFx::living==originalProcessors); // reuse, never rebuild VST assert(native.acceptedRevision()==3); assert(native.render(epoch,pins,2,left.data(),right.data(),32,false, legacyFx)); From f34334a3ea0d16f8d632170627455c98e374a9c8 Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Sun, 1 Nov 2026 06:24:02 +0700 Subject: [PATCH 009/233] test(M5): preserve legacy absolute FX retirement counter baseline; run new native ChannelId fixture after M4 suite --- tests/live_channel_fx_graph_test.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/live_channel_fx_graph_test.cpp b/tests/live_channel_fx_graph_test.cpp index ad869e21b..f83943ce7 100644 --- a/tests/live_channel_fx_graph_test.cpp +++ b/tests/live_channel_fx_graph_test.cpp @@ -254,7 +254,6 @@ static void verifyUniversalChannelIdFxLeaseAndLivePcm() { } int main() { - verifyUniversalChannelIdFxLeaseAndLivePcm(); // R0: existing CH1 FX chain may be rendered inside the SAME prepared // ten-channel routing pass, without creating a second plugin or copying // a processor. Verify exactly one call and zero callback heap allocation. @@ -582,6 +581,11 @@ int main() { assert(graph->monitorOutputLeft()==4&&graph->monitorOutputRight()==5); assert(near(graph->monitorGains()[1],.5f)); } + // Run M5 AFTER the legacy suite: older M4 tests use absolute global + // GainFx::living/released counters as their own lifetime oracle. Running + // M5 before them changes those historical baseline counts, not DSP. + // M5 additionally asserts zero heap and valid vendor leases itself. + verifyUniversalChannelIdFxLeaseAndLivePcm(); // Tests above use a real JUCE AudioProcessor processing seam. Vendor // VST3 formats and sound quality require separate Windows hardware FAT. } From c492f80d611465960d12f36d91a23266c0a5a503 Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Sun, 1 Nov 2026 06:31:24 +0700 Subject: [PATCH 010/233] feat(M-U1): atomically prepare/publish full M4 10CH+4AUX VST3 and MAIN/MONITOR PCM on one ChannelId graph --- engine/core/LegacyLiveGraphMigration.h | 4 + .../core/UnifiedLegacyProductionAdmission.h | 153 ++++++++++++++++++ tests/live_channel_fx_graph_test.cpp | 104 ++++++++++++ 3 files changed, 261 insertions(+) create mode 100644 engine/core/UnifiedLegacyProductionAdmission.h diff --git a/engine/core/LegacyLiveGraphMigration.h b/engine/core/LegacyLiveGraphMigration.h index 2358e6724..54a06c3cc 100644 --- a/engine/core/LegacyLiveGraphMigration.h +++ b/engine/core/LegacyLiveGraphMigration.h @@ -44,6 +44,9 @@ struct LegacyMigratedGraph final { 32u*1024u*1024u,8u,static_cast(maxChannelSends+maxAuxSends+2)}}; DynamicPreparedMixerBlock pcm{}; LegacyChannelIds ids{}; + // Exact verified physical SOURCE request, preserved for a single native + // admission. Never reconstruct callback port ordinals from a GUI draft. + DynamicGraphRequest request{}; std::uint64_t revision=0; }; @@ -187,6 +190,7 @@ class LegacyGraphMigration final { next.pcm,error.dynamic)){ error.fault=LegacyMigrationFault::invalidDynamicGraph;return false; } + next.request=std::move(request); next.revision=next.roster.revision(); destination=std::move(next); // publish only after caller's native MUTE/epoch ACK return true; diff --git a/engine/core/UnifiedLegacyProductionAdmission.h b/engine/core/UnifiedLegacyProductionAdmission.h new file mode 100644 index 000000000..b24e0edcc --- /dev/null +++ b/engine/core/UnifiedLegacyProductionAdmission.h @@ -0,0 +1,153 @@ +// SPDX-License-Identifier: AGPL-3.0-only +#pragma once +#include "LegacyLiveGraphMigration.h" +#include "DynamicChannelFxLeaseBank.h" +#include "DynamicNativeSessionPublisher.h" +#include +#include +#include +#include +#include +#include + +// M-U1: full M4 10CH + 4 AUX + MONITOR PCM and real VST leases are admitted +// as ONE identity-preserving dynamic session. No extra audio callback. +// This is CONTROL-only preparation; the physical callback cutover is a +// separate safety transaction and must select only ONE renderer. +// Special legacy CH1 external/Orbit FX is explicitly REFUSED until the +// actual processor/editor lease is migrated. Never silently discard it. +namespace armix::mixer { +struct VerifiedNativeOutputs final { + int activeOutputChannels=0; // EXACT current enabled callback output count + int mainL=-1,mainR=-1,monitorL=-1,monitorR=-1; + bool monitorEnabled=false; + bool valid() const noexcept { + if(activeOutputChannels<2||activeOutputChannels>256 || + mainL<0||mainR<0||mainL>=activeOutputChannels|| + mainR>=activeOutputChannels||mainL==mainR)return false; + if(!monitorEnabled)return monitorL==-1&&monitorR==-1; + return monitorL>=0&&monitorR>=0&& + monitorL fxOwners{}; + VerifiedNativeOutputs hardware{}; + std::uint64_t deviceEpoch=0,pcmRevision=0; +}; +class UnifiedLegacyProductionAdmission final { +public: + enum class Fault : std::uint8_t { + none,invalidOutputPins,staleHardware,outputArmed, + legacyCh1ExternalFx,staleFxGraph,legacyGraphInvalid, + fxLeaseInvalid,nativeRejected + }; + struct Report final { + Fault fault=Fault::none; + LegacyMigrationError migration{}; + DynamicChannelFxLeaseBank::Fault fx=DynamicChannelFxLeaseBank::Fault::none; + DynamicNativeSessionPublisher::CommitResult native{}; + bool ok() const noexcept {return fault==Fault::none;} + }; + + // Must be invoked on the SAME serialized M4 native control executor as + // hardware APPLY, Show capture and editor state. Prior accepted graph, + // leases and user outputs stay intact on any rejection. + static Report compileAndCommit( + const ChannelRoutingConfig& channels, + std::span callbackOrderedPhysicalPorts, + const SendRequest& sends,const AuxBusRequest& aux, + const std::array& monitorGains, + const LiveChannelFxGraph& acceptedM4Fx, + bool legacyExternalCh1FxActive, + const VerifiedNativeOutputs& hardware, + int maxFrames,std::size_t scratchBudget, + std::uint64_t expectedPcmRevision, + std::uint64_t deviceEpoch,std::uint64_t currentHardwareEpoch, + bool allOutputsDisarmed, + DynamicNativeSessionPublisher& publisher, + UnifiedLegacyAccepted& accepted) { + Report result; + if(!hardware.valid() || + hardware.monitorEnabled!=acceptedM4Fx.monitorEnabled() || + hardware.mainL!=acceptedM4Fx.mainOutputLeft() || + hardware.mainR!=acceptedM4Fx.mainOutputRight() || + (hardware.monitorEnabled && + (hardware.monitorL!=acceptedM4Fx.monitorOutputLeft()|| + hardware.monitorR!=acceptedM4Fx.monitorOutputRight()))) { + result.fault=Fault::invalidOutputPins;return result; + } + if(!deviceEpoch || deviceEpoch!=currentHardwareEpoch) { + result.fault=Fault::staleHardware;return result; + } + if(!allOutputsDisarmed) { + result.fault=Fault::outputArmed;return result; + } + if(legacyExternalCh1FxActive) { + result.fault=Fault::legacyCh1ExternalFx;return result; + } + // FxInstance owns one already-prepared stereo block. Do not let the + // dynamic callback deliver a larger quantum and silently bypass it. + if(maxFrames<1||maxFrames>acceptedM4Fx.capacity()|| + maxFrames>acceptedM4Fx.maxFramesPerPlugin()) { + result.fault=Fault::staleFxGraph;return result; + } + if(expectedPcmRevision!=publisher.acceptedRevision()) { + result.fault=Fault::nativeRejected; + result.native.fault=DynamicNativeSessionPublisher::Fault::staleRevision; + return result; + } + LegacyMigratedGraph candidate; + if(!LegacyGraphMigration::compile( + channels,callbackOrderedPhysicalPorts,sends,aux, + hardware.monitorEnabled,monitorGains,maxFrames,scratchBudget, + candidate,result.migration)) { + result.fault=Fault::legacyGraphInvalid;return result; + } + using Bank=DynamicChannelFxLeaseBank; + std::array lanes{}; + for(int i=0;iformat, + acceptedM4Fx,lanes[i])) { + result.fault=Fault::fxLeaseInvalid; + result.fx=Bank::Fault::missingLegacyIdentity; + return result; + } + } + Bank bank; + result.fx=Bank::prepare(deviceEpoch,expectedPcmRevision+1,lanes,bank); + if(result.fx!=Bank::Fault::none) { + result.fault=Fault::fxLeaseInvalid;return result; + } + auto owner=std::make_shared(std::move(bank)); + DynamicNativeSessionPublisher::FxPlan plan; + plan.owner=std::static_pointer_cast(owner); + plan.context=owner.get(); + plan.render=+[](void* ctx,ChannelId id,float* l,float* r,int n) noexcept { + (*static_cast(ctx))(id,l,r,n); + }; + plan.deviceEpoch=deviceEpoch;plan.graphRevision=expectedPcmRevision+1; + result.native=publisher.commit(candidate.roster,candidate.request, + expectedPcmRevision,deviceEpoch,currentHardwareEpoch, + allOutputsDisarmed,std::move(plan)); + if(!result.native.ok()) { + result.fault=Fault::nativeRejected;return result; + } + UnifiedLegacyAccepted next; + next.graph=std::move(candidate); + next.fxOwners=std::move(owner); + next.hardware=hardware; + next.deviceEpoch=deviceEpoch; + next.pcmRevision=result.native.revision; + accepted=std::move(next); + return result; + } +}; +} // namespace armix::mixer diff --git a/tests/live_channel_fx_graph_test.cpp b/tests/live_channel_fx_graph_test.cpp index f83943ce7..785091d0d 100644 --- a/tests/live_channel_fx_graph_test.cpp +++ b/tests/live_channel_fx_graph_test.cpp @@ -2,6 +2,7 @@ #include "../engine/core/LiveChannelFxGraph.h" #include "../engine/core/DynamicChannelFxLeaseBank.h" #include "../engine/core/DynamicNativeSessionPublisher.h" +#include "../engine/core/UnifiedLegacyProductionAdmission.h" #include "../engine/core/NativeOutputPairTap.h" #include "../engine/core/RealtimeRoutePublisher.h" #if defined(NDEBUG) @@ -253,6 +254,108 @@ static void verifyUniversalChannelIdFxLeaseAndLivePcm() { assert(left[31]==0.f&&right[31]==0.f); } +// M-U1 full-fidelity preparation: 10 CH + 4 AUX + M4 VST owners, +// sparse verified input ports, independent physical MAIN and MONITOR, +// PRE/POST and native Show/epoch rejection. Compare actual old M4 processor +// output with the same owners in ONE new atomic ChannelId publication. +static void verifyMU1LegacyM4FxFullMigrationAndMonitorPcm() { + constexpr std::array ports{3,0,4,7}; + ChannelRoutingConfig channels; + channels.stripsAndMaster.strips[0]={ + SourceMode::mono,3,-1,.5f,-.3f,false,false}; + channels.stripsAndMaster.strips[1]={ + SourceMode::stereo,4,7,.75f,.2f,false,false}; + channels.formats[2]=ChannelFormat::stereo; + channels.stripsAndMaster.master={1.1f,.1f,false,true}; + SendRequest sends; + sends.toMaster[0]=false;sends.count=1; + sends.sends[0]={0,2,SendTap::postFader,.3f,-.3f,true}; + AuxBusRequest aux; + aux.buses[0]={true,true,false,.8f}; + aux.count=1; + aux.sends[0]={1,0,SendTap::postFader,.25f,.1f,true}; + std::array monitorGains{}; + monitorGains[0]=.25f;monitorGains[stripCount]=.3f; + PreparedRenderGraph legacyGraph; + RenderError legacyError; + assert(PreparedRenderGraph::compile(channels,ports,sends, + legacyGraph,legacyError,aux)); + auto legacy=std::make_unique(legacyGraph,32,32); + assert(legacy->setMonitorOutputBus(2,3,4,monitorGains)); + auto ch1=std::make_unique(1.2f); + auto returnFx=std::make_unique(.9f); + ch1->prepareToPlay(48000,32); + returnFx->prepareToPlay(48000,32); + assert(legacy->install(0,std::move(ch1),"CH1 VST3","m4-ch1")); + assert(legacy->install(stripCount,std::move(returnFx),"AUX VST3","m4-aux")); + const auto oldCh1=legacy->insertInstanceId(0,0); + const auto oldAux=legacy->insertInstanceId(stripCount,0); + std::array mono{},unrelated{},stL{},stR{}; + for(int i=0;i<32;++i){ + mono[i]=.2f+.001f*i;unrelated[i]=.8f; + stL[i]=.15f+.002f*i;stR[i]=.35f-.001f*i; + } + const float* physical[]{mono.data(),unrelated.data(),stL.data(),stR.data()}; + std::array legacyL{},legacyR{},legacyML{},legacyMR{}; + assert(legacy->process(physical,4,legacyL.data(),legacyR.data(),32, + nullptr,nullptr,nullptr,legacyML.data(),legacyMR.data())); + DynamicNativeSessionPublisher publisher; + UnifiedLegacyAccepted accepted; + constexpr std::uint64_t epoch=565; + VerifiedNativeOutputs outputs{4,0,1,2,3,true}; + const auto good=UnifiedLegacyProductionAdmission::compileAndCommit( + channels,ports,sends,aux,monitorGains,*legacy,false,outputs, + 32,2u*1024u*1024u,0,epoch,epoch,true,publisher,accepted); + assert(good.ok()); + assert(publisher.acceptedRevision()==1); + assert(accepted.deviceEpoch==epoch&&accepted.pcmRevision==1); + assert(accepted.graph.roster.size()==stripCount+auxBusCount+2); + assert(accepted.graph.request.sources.size()==2); + assert(accepted.fxOwners->insertCount(accepted.graph.ids.inputs[0])==1); + assert(accepted.fxOwners->insertCount(accepted.graph.ids.aux[0])==1); + assert((*accepted.fxOwners->ownerForControl( + accepted.graph.ids.inputs[0],0))->instanceId==oldCh1); + assert((*accepted.fxOwners->ownerForControl( + accepted.graph.ids.aux[0],0))->instanceId==oldAux); + // Actual FX ownership survives the old M4 graph retirement. + legacy.reset(); + std::array dynamicL{},dynamicR{},dynamicML{},dynamicMR{}; + const auto mustNeverCall=[&](ChannelId,float*,float*,int) noexcept { + assert(false && "M4 processor may not render twice"); + }; + const auto before=heapCalls.load(std::memory_order_relaxed); + assert(publisher.render(epoch,physical,4,dynamicL.data(),dynamicR.data(), + 32,false,mustNeverCall, + dynamicML.data(),dynamicMR.data())); + assert(heapCalls.load(std::memory_order_relaxed)==before); + for(int i=0;i<32;++i) { + assert(near(legacyL[i],dynamicL[i])); + assert(near(legacyR[i],dynamicR[i])); + assert(near(legacyML[i],dynamicML[i])); + assert(near(legacyMR[i],dynamicMR[i])); + } + // Faults are non-destructive: no external CH1 Orbit state dropped, no + // wrong-speaker output, no stale hardware, no armed graph recreation. + auto bad=UnifiedLegacyProductionAdmission::compileAndCommit( + channels,ports,sends,aux,monitorGains, + // use a new empty graph only for rejecting BEFORE any instance access + *([](const PreparedRenderGraph& g)->LiveChannelFxGraph* { + static std::unique_ptr candidate; + if(!candidate)candidate=std::make_unique(g,32,32); + return candidate.get(); + })(legacyGraph), + true,outputs,32,2u*1024u*1024u,1,epoch,epoch,true, + publisher,accepted); + assert(bad.fault==UnifiedLegacyProductionAdmission::Fault::invalidOutputPins || + bad.fault==UnifiedLegacyProductionAdmission::Fault::legacyCh1ExternalFx); + assert(publisher.acceptedRevision()==1); + assert(accepted.fxOwners->insertCount(accepted.graph.ids.inputs[0])==1); + assert(!publisher.render(epoch+1,physical,4,dynamicL.data(), + dynamicR.data(),32,false,mustNeverCall, + dynamicML.data(),dynamicMR.data())); + assert(dynamicL[31]==0.f&&dynamicR[31]==0.f); +} + int main() { // R0: existing CH1 FX chain may be rendered inside the SAME prepared // ten-channel routing pass, without creating a second plugin or copying @@ -586,6 +689,7 @@ int main() { // M5 before them changes those historical baseline counts, not DSP. // M5 additionally asserts zero heap and valid vendor leases itself. verifyUniversalChannelIdFxLeaseAndLivePcm(); + verifyMU1LegacyM4FxFullMigrationAndMonitorPcm(); // Tests above use a real JUCE AudioProcessor processing seam. Vendor // VST3 formats and sound quality require separate Windows hardware FAT. } From 2bbf9f08b5495c3ad61b7d8d0ec5190177bdb55c Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Sun, 1 Nov 2026 06:32:16 +0700 Subject: [PATCH 011/233] test(M-U1): prove M4 VST/PCM + MAIN/MONITOR parity and non-destructive hotplug/CH1/output rejection --- ...CHANNELID_VST3_LEASE_MIGRATION_20261101.md | 8 ++++ tests/live_channel_fx_graph_test.cpp | 37 ++++++++++++++----- 2 files changed, 36 insertions(+), 9 deletions(-) diff --git a/docs/M5_UNIVERSAL_CHANNELID_VST3_LEASE_MIGRATION_20261101.md b/docs/M5_UNIVERSAL_CHANNELID_VST3_LEASE_MIGRATION_20261101.md index 9a237de74..7e52b2855 100644 --- a/docs/M5_UNIVERSAL_CHANNELID_VST3_LEASE_MIGRATION_20261101.md +++ b/docs/M5_UNIVERSAL_CHANNELID_VST3_LEASE_MIGRATION_20261101.md @@ -36,3 +36,11 @@ Top global console contracts are consistent: 5. Keep existing M4/FAST3 one-APPLY and emergency MUTE, adaptive channel bank R7, P0 #15 0FX crackle evidence and realtime performance counters intact. **Honest status:** This is a substantive native FX/state migration seam with real processor PCM tests, **not yet a publicly usable full dynamic Studio One-equivalent Console**. No physical zero-latency guarantee and no field MAONO PS22 FAT has been executed for this M5 branch. + +## M-U1 full native admission transaction — added after initial M5 bridge + +`engine/core/UnifiedLegacyProductionAdmission.h` now composes the **existing** `LegacyGraphMigration` of the full 10-input + 4-AUX scene, FX PRE/POST sends, MAIN, independent MONITOR, effective mono/stereo format and physical capture port order with the actual M4 `FxInstance` ownership into **one native accepted PCM+VST publication**. `LegacyMigratedGraph.request` is retained verbatim from the validated old physical port map, not recreated from browser controls. A single snapshot binds hardware output callback pairs, exact device epoch, next PCM graph revision and all 14 M4 FX lane leases. Existing committed session/PCM/plugins remain unmodified on failed migration. + +The new native golden test renders real JUCE M4 processors BEFORE the conversion and compares it to output from the same instance objects AFTER the legacy graph owner is destroyed: MAIN L/R and independently routed MONITOR L/R, channel→bus sends and AUX return. It also checks no RT allocation, wrong physical MAIN/MONITOR alias, hotplug epoch, OUTPUT ARMED, external CH1/Orbit owner admission and post-reject audio continuity. A successful test is preparation evidence only; the production callback is NOT yet switched, hardware FAT is still required. + +**Critical safety gate:** an occupied legacy external CH1 FX chain/Orbit is explicitly rejected, not discarded or accidentally duplicated. The next M-U1 phase must migrate that separate owner and Show/editor state, then atomically choose the unified render in `LiveAudioEngine`; only after that can unrestricted +CHANNEL, Group Selected and +FX Return UI become live. diff --git a/tests/live_channel_fx_graph_test.cpp b/tests/live_channel_fx_graph_test.cpp index 785091d0d..362bcd9a6 100644 --- a/tests/live_channel_fx_graph_test.cpp +++ b/tests/live_channel_fx_graph_test.cpp @@ -336,20 +336,39 @@ static void verifyMU1LegacyM4FxFullMigrationAndMonitorPcm() { } // Faults are non-destructive: no external CH1 Orbit state dropped, no // wrong-speaker output, no stale hardware, no armed graph recreation. + LiveChannelFxGraph blockedLegacy(legacyGraph,32,32); + assert(blockedLegacy.setMonitorOutputBus(2,3,4,monitorGains)); auto bad=UnifiedLegacyProductionAdmission::compileAndCommit( - channels,ports,sends,aux,monitorGains, - // use a new empty graph only for rejecting BEFORE any instance access - *([](const PreparedRenderGraph& g)->LiveChannelFxGraph* { - static std::unique_ptr candidate; - if(!candidate)candidate=std::make_unique(g,32,32); - return candidate.get(); - })(legacyGraph), + channels,ports,sends,aux,monitorGains,blockedLegacy, true,outputs,32,2u*1024u*1024u,1,epoch,epoch,true, publisher,accepted); - assert(bad.fault==UnifiedLegacyProductionAdmission::Fault::invalidOutputPins || - bad.fault==UnifiedLegacyProductionAdmission::Fault::legacyCh1ExternalFx); + assert(bad.fault==UnifiedLegacyProductionAdmission::Fault::legacyCh1ExternalFx); + auto wrongPins=outputs; + wrongPins.monitorR=0; // same physical output as MAIN + bad=UnifiedLegacyProductionAdmission::compileAndCommit( + channels,ports,sends,aux,monitorGains,blockedLegacy, + false,wrongPins,32,2u*1024u*1024u,1,epoch,epoch,true, + publisher,accepted); + assert(bad.fault==UnifiedLegacyProductionAdmission::Fault::invalidOutputPins); + bad=UnifiedLegacyProductionAdmission::compileAndCommit( + channels,ports,sends,aux,monitorGains,blockedLegacy, + false,outputs,32,2u*1024u*1024u,1,epoch,epoch+1,true, + publisher,accepted); + assert(bad.fault==UnifiedLegacyProductionAdmission::Fault::staleHardware); + bad=UnifiedLegacyProductionAdmission::compileAndCommit( + channels,ports,sends,aux,monitorGains,blockedLegacy, + false,outputs,32,2u*1024u*1024u,1,epoch,epoch,false, + publisher,accepted); + assert(bad.fault==UnifiedLegacyProductionAdmission::Fault::outputArmed); assert(publisher.acceptedRevision()==1); assert(accepted.fxOwners->insertCount(accepted.graph.ids.inputs[0])==1); + assert(publisher.render(epoch,physical,4,dynamicL.data(),dynamicR.data(), + 32,false,mustNeverCall, + dynamicML.data(),dynamicMR.data())); + for(int i=0;i<32;++i){ + assert(near(legacyL[i],dynamicL[i])); + assert(near(legacyMR[i],dynamicMR[i])); + } assert(!publisher.render(epoch+1,physical,4,dynamicL.data(), dynamicR.data(),32,false,mustNeverCall, dynamicML.data(),dynamicMR.data())); From 3cfeb3d7d68337f3a8537e63b15785f08aba65d1 Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Sun, 1 Nov 2026 09:39:58 +0700 Subject: [PATCH 012/233] feat(gui-v6): add native-accepted operator console and intent/ACK projection --- web/mixer-layout.js | 452 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 452 insertions(+) diff --git a/web/mixer-layout.js b/web/mixer-layout.js index 9e1ac306b..1cd695345 100644 --- a/web/mixer-layout.js +++ b/web/mixer-layout.js @@ -142,3 +142,455 @@ } document.documentElement.dataset.arMixerShell='rail-modes'; })(); + + +/* ARSONMIX V6 OPERATOR CONSOLE — native accepted projection only. + The legacy M4 console remains available until the native v6 publisher exists. + No WebAudio, DSP, routing solver, or fabricated ACK lives in this module. */ +(() => { + 'use strict'; + const mount=document.querySelector('#app .workbench'); + const backend=window.__JUCE__?.backend; + if(!mount||!document.getElementById('mixer')||document.getElementById('arV6Console'))return; + const native=!!(backend&&typeof backend.emitEvent==='function'&&typeof backend.addEventListener==='function'); + const h=(tag,cls,text)=>{ + const n=document.createElement(tag); + if(cls)n.className=cls; + if(text!==undefined)n.textContent=String(text); + return n; + }; + const button=(label,attrs={})=>{ + const n=h('button','arV6Button',label);n.type='button'; + for(const [key,value] of Object.entries(attrs))n.setAttribute(key,String(value)); + return n; + }; + const clamp=(n,a,b)=>Math.max(a,Math.min(b,n)); + const clean=s=>String(s==null?'—':s); + const byId=new Map(); + const pending=new Map(); + const pendingTargets=new Set(); + const operationCaps={ + SET_SOURCE:'SET_SOURCE',SET_PROCESSING_FORMAT:'SET_PROCESSING_FORMAT', + SET_PRIMARY_OUT:'SET_PRIMARY_OUT',ADD_INSERT:'ADD_INSERT', + PICK_INSERT_FILE:'PICK_INSERT_FILE',SET_INSERT_BYPASS:'SET_INSERT_BYPASS', + OPEN_INSERT_EDITOR:'OPEN_INSERT_EDITOR',MOVE_INSERT:'MOVE_INSERT', + ADD_SEND:'ADD_SEND',SET_SEND_TAP:'SET_SEND_TAP',SET_SEND_LEVEL:'SET_SEND_LEVEL', + SET_FADER:'SET_FADER',SET_PAN:'SET_PAN',SET_MUTE:'SET_MUTE', + SET_SOLO:'SET_SOLO',CREATE_CHANNEL:'CREATE_CHANNEL' + }; + let accepted=null,acceptedNative=false,modeSend='',lastStructure='',requestSeq=0; + const instance='gui'+Date.now().toString(36)+Math.random().toString(36).slice(2,7); + let feedback=''; + const root=h('section','arV6Console');root.id='arV6Console'; + root.setAttribute('aria-label','ArSonMix universal operator console'); + const top=h('div','arV6Top'); + const identification=h('div','arV6Identification'); + const kicker=h('span','arV6Kicker','ARSONMIX / UNIVERSAL LIVE CONSOLE'); + const deviceText=h('span','arV6Device','NO NATIVE CONSOLE SNAPSHOT'); + const modeBadge=h('span','arV6State','WAITING FOR NATIVE'); + identification.append(kicker,deviceText,modeBadge); + const tools=h('div','arV6Tools'); + const bankPrev=button('‹',{'aria-label':'Previous channel bank'}); + const bankLabel=h('span','arV6BankLabel','—'); + const bankNext=button('›',{'aria-label':'Next channel bank'}); + const sendMode=h('select','arV6Select arV6SendMode');sendMode.setAttribute('aria-label','Sends on faders target'); + const add=button('+ CHANNEL',{'data-op':'CREATE_CHANNEL'}); + const patch=button('PATCH',{'aria-label':'Open advanced patch'}); + const back=button('V6 CONSOLE',{'aria-label':'Return to operator console'}); + back.id='arV6Return';back.hidden=true; + tools.append(bankPrev,bankLabel,bankNext,sendMode,add,patch); + top.append(identification,tools); + const message=h('div','arV6Message');message.setAttribute('role','status'); + const body=h('div','arV6Body'); + const lanes=h('div','arV6Lanes');lanes.setAttribute('aria-label','Channel banks'); + const main=h('div','arV6Main');main.setAttribute('aria-label','Pinned main output'); + body.append(lanes,main); + root.append(top,message,body); + mount.append(root); + document.querySelector('.toolbar-actions')?.append(back); + const setVisible=v=>{ + document.documentElement.classList.toggle('ar-v6-active',!!v); + back.hidden=!!v; + }; + patch.addEventListener('click',()=>{ + setVisible(false); + document.querySelector('[data-view="SIGNAL FLOW"]')?.click(); + }); + back.addEventListener('click',()=>{ + document.querySelector('[data-view="MIX"]')?.click();setVisible(true); + }); + function supported(op){ + const caps=accepted?.graph?.capabilities||{}; + // Absence of explicit native advertised operation support means disabled. + return acceptedNative && Array.isArray(caps.supportedOps) && caps.supportedOps.includes(operationCaps[op]); + } + function can(op,id){ + if(!supported(op))return false; + if(op==='CREATE_CHANNEL')return !!accepted.graph.capabilities.dynamicChannels; + if(!id)return true; + const ch=byId.get(id); + return !!ch && !pendingTargets.has(id) && + (!Array.isArray(ch.allowedOps)||ch.allowedOps.includes(op)); + } + function showFeedback(text){ + feedback=clean(text);message.textContent=feedback; + message.hidden=!feedback; + } + function requestSnapshot(){ + if(native)backend.emitEvent('arMixConsoleSubscribe',{protocol:'v6',requester:instance}); + } + function sendIntent(op,id,payload){ + if(!can(op,id)){showFeedback('UNAVAILABLE · Native capability or channel authorization missing');return false} + const requestId=instance+':'+(++requestSeq); + const command={requestId,baseRevision:accepted.graph.revision, + deviceEpoch:accepted.device.epoch,op,targetChannelId:id||null,payload:payload||{}}; + pending.set(requestId,{op,id,baseRevision:command.baseRevision,epoch:command.deviceEpoch}); + if(id)pendingTargets.add(id); + showFeedback('PENDING · '+op+' · awaiting native ACK'); + refreshDisabled(); + backend.emitEvent('arMixConsoleIntent',command); + return true; + } + function receiveAck(data){ + const ack=data?.ack||data; + if(!ack||typeof ack.requestId!=='string')return; + const intent=pending.get(ack.requestId);if(!intent)return; + pending.delete(ack.requestId); + if(intent.id)pendingTargets.delete(intent.id); + if(ack.status==='ACCEPTED'){ + // ACK is NOT a replacement graph. No channel/route/FX mutation before + // a full accepted snapshot arrives; telemetry is never guessed. + showFeedback('ACCEPTED · '+intent.op+' · synchronizing native snapshot'); + requestSnapshot(); + }else{ + showFeedback((ack.status==='REQUIRES_DEVICE_CHANGE'?'REQUIRES DEVICE · ':'REJECTED · ')+ + clean(ack.errorCode||ack.message||'Native rejected request')+' · accepted audio preserved'); + // Also request authoritative recovery after stale revision/device. + requestSnapshot(); + render(); + } + refreshDisabled(); + } + function validSnapshot(s){ + if(!s||typeof s!=='object'||!s.device||!s.graph)return false; + if(!Number.isSafeInteger(s.device.epoch)||!Number.isSafeInteger(s.graph.revision))return false; + if(!Array.isArray(s.graph.channels)||!s.graph.capabilities)return false; + const ids=new Set(); + for(const c of s.graph.channels){ + // JS numeric conversion corrupts 64-bit identities: reject such a wire. + if(!c||typeof c.id!=='string'||!c.id||ids.has(c.id))return false; + ids.add(c.id); + } + return true; + } + function receiveSnapshot(data,fromNative){ + const s=data?.snapshot||data; + if(!validSnapshot(s)){ + if(fromNative)showFeedback('REJECTED SNAPSHOT · Invalid native epoch, revision or ChannelId'); + return false; + } + if(acceptedNative&&!fromNative)return false; + if(fromNative&&acceptedNative&&accepted&&s.device.epoch===accepted.device.epoch&& + s.graph.revisionc.id).join('|'); + accepted=s;acceptedNative=!!fromNative; + byId.clear(); + for(const c of s.graph.channels)byId.set(c.id,c); + if(structure!==lastStructure||root.dataset.demo!==String(!fromNative)){ + lastStructure=structure;render(); + }else{ + refreshMeters();refreshDisabled();updateHeader(); + } + root.dataset.demo=String(!fromNative); + setVisible(true); + return true; + } + const makeDemo=()=>{ + const names=['Lead Vocal','Guest Mic','Music L','Music R','Speech','Stream','Backing','Guitar','Keys','Talkback']; + const channels=names.map((name,i)=>({ + id:'DEMO:'+String(i+1),role:'INPUT',name,color:'#4e8ba4',processingFormat:i===2||i===3?'STEREO':'MONO', + source:null,primaryOut:null,inserts:[],sends:[],controls:{faderDb:0,pan:0,mute:false,solo:false} + })); + channels.push({id:'DEMO:MAIN',role:'MAIN',name:'MAIN',processingFormat:'STEREO', + inserts:[],sends:[],controls:{faderDb:0,pan:0,mute:false,solo:false}}); + return {device:{epoch:0,backend:'BROWSER DEMO',sampleRate:null,bufferFrames:null,outputArmed:false, + inputEndpoints:[],outputEndpoints:[]},graph:{revision:0,channels,destinations:[], + capabilities:{dynamicChannels:false,groups:false,fxReturns:false,sendsOnFaders:false,supportedOps:[]}}, + telemetry:{rawCapturePresent:false,channelMeterRmsPeak:{}}}; + }; + function options(select,items,current,emptyLabel){ + select.replaceChildren(); + const zero=h('option','',emptyLabel);zero.value='';select.append(zero); + let found=!current; + for(const item of items){ + if(!item||typeof item.id!=='string'||!item.id)continue; + const opt=h('option','',item.name||item.label||item.id); + opt.value=item.id;opt.disabled=item.available===false||item.active===false; + if(current===item.id){opt.selected=true;found=true} + select.append(opt); + } + if(!found){ + const missing=h('option','','MISSING · '+current);missing.value=current; + missing.selected=true;missing.disabled=true;select.append(missing); + } + if(!current)select.value=''; + return select; + } + function selectField(label,op,id,items,current,placeholder,extra){ + const row=h('label','arV6Field'); + row.append(h('span','arV6FieldName',label)); + const sel=options(h('select','arV6Select'),items,current,placeholder); + sel.dataset.op=op;sel.dataset.id=id; + if(extra)for(const [key,val] of Object.entries(extra))sel.dataset[key]=val; + sel.disabled=!can(op,id); + row.append(sel);return row; + } + function fxSection(ch){ + const section=h('div','arV6Fx'); + section.append(h('span','arV6SectionTitle','VST3 INSERTS')); + const list=Array.isArray(ch.inserts)?ch.inserts:[]; + for(const fx of list){ + const row=h('div','arV6FxSlot'); + row.append(button(fx.name||fx.pluginName||'VST3',{'data-op':'OPEN_INSERT_EDITOR', + 'data-id':ch.id,'data-insert':clean(fx.id)})); + const bypass=button(fx.bypassed?'OFF':'ON',{'data-op':'SET_INSERT_BYPASS', + 'data-id':ch.id,'data-insert':clean(fx.id),'aria-pressed':String(!fx.bypassed)}); + bypass.classList.toggle('isOff',!!fx.bypassed);row.append(bypass); + section.append(row); + } + const addFx=button('+ VST3',{'data-op':supported('PICK_INSERT_FILE')?'PICK_INSERT_FILE':'ADD_INSERT','data-id':ch.id}); + addFx.classList.add('arV6AddFx');section.append(addFx); + return section; + } + function sendSection(ch){ + const section=h('div','arV6Sends'); + section.append(h('span','arV6SectionTitle','SEND')); + const sends=Array.isArray(ch.sends)?ch.sends:[]; + const targets=(accepted.graph.destinations||[]).filter(x=>x.acceptsSend===true); + for(const send of sends){ + const line=h('div','arV6Send'); + line.append(h('span','arV6SendName',clean(send.name||send.targetId))); + const toggle=button(send.tap==='PRE'?'PRE':'POST',{'data-op':'SET_SEND_TAP', + 'data-id':ch.id,'data-send':clean(send.id)}); + line.append(toggle); + section.append(line); + } + const select=selectField('+ TO','ADD_SEND',ch.id,targets,'','NO NATIVE SEND BUS'); + section.append(select);return section; + } + function strip(ch,pinned=false){ + const role=clean(ch.role).toUpperCase(); + const elStrip=h('article','arV6Strip'+(pinned?' arV6Master':'')); + elStrip.dataset.channelId=ch.id; + const head=h('div','arV6StripHead'); + const roleName=h('span','arV6Role',role); + const name=h('strong','arV6Name',ch.name||ch.id);name.title=ch.id; + head.append(roleName,name);elStrip.append(head); + const sourceSection=h('div','arV6Upper'); + const sources=(accepted.device.inputEndpoints||[]).filter(p=>p.active!==false && p.available!==false); + if(role==='INPUT')sourceSection.append(selectField('IN','SET_SOURCE',ch.id,sources, + ch.source?.portId||ch.source?.id||'','NO VERIFIED INPUT')); + else sourceSection.append(h('div','arV6Field arV6FixedField','IN · '+role)); + const formats=['MONO','STEREO'].map(s=>({id:s,name:s})); + sourceSection.append(selectField('M/ST','SET_PROCESSING_FORMAT',ch.id,formats, + ch.processingFormat||'','NATIVE FORMAT')); + sourceSection.append(fxSection(ch),sendSection(ch)); + const outs=(accepted.graph.destinations||[]).concat(accepted.device.outputEndpoints||[]); + sourceSection.append(selectField('OUT','SET_PRIMARY_OUT',ch.id,outs, + ch.primaryOut?.id||ch.primaryOut||'','NO VERIFIED OUT')); + elStrip.append(sourceSection); + const controls=h('div','arV6Controls'); + const pan=h('label','arV6Pan');pan.append(h('span','','PAN')); + const panRange=h('input','arV6PanRange');panRange.type='range'; + panRange.min='-100';panRange.max='100';panRange.step='1'; + panRange.value=String(Number(ch.controls?.pan)||0); + panRange.dataset.op='SET_PAN';panRange.dataset.id=ch.id; + pan.append(panRange);controls.append(pan); + controls.append(button('M',{'data-op':'SET_MUTE','data-id':ch.id, + 'aria-pressed':String(!!ch.controls?.mute)})); + controls.append(button('S',{'data-op':'SET_SOLO','data-id':ch.id, + 'aria-pressed':String(!!ch.controls?.solo)})); + elStrip.append(controls); + const lower=h('div','arV6Lower'); + const meter=h('div','arV6Meter');meter.dataset.meterId=ch.id; + meter.setAttribute('aria-label','Native channel meter: '+(ch.name||ch.id)); + for(let n=0;n<22;n++)meter.append(h('i','arV6Led')); + const range=h('input','arV6Fader'); + range.type='range';range.min='-60';range.max='12';range.step='.1'; + const faderVal=Number(ch.controls?.faderDb); + range.value=String(Number.isFinite(faderVal)?clamp(faderVal,-60,12):0); + range.dataset.op='SET_FADER';range.dataset.id=ch.id; + range.setAttribute('aria-label',(ch.name||ch.id)+' fader dB'); + const lowerLabel=h('span','arV6Readout',(Number.isFinite(faderVal)?faderVal.toFixed(1):'—')+' dB'); + lower.append(meter,range,lowerLabel);elStrip.append(lower); + const status=h('div','arV6StripStatus'); + status.dataset.statusId=ch.id;status.textContent=channelState(ch); + elStrip.append(status); + return elStrip; + } + function channelState(ch){ + if(!acceptedNative)return 'DEMO / NO AUDIO'; + if(ch.controls?.mute)return 'MUTED'; + if(!ch.source && clean(ch.role).toUpperCase()==='INPUT')return 'SILENT / NO SOURCE'; + if(!accepted.device.outputArmed)return 'OUTPUT DISARMED'; + const t=accepted.telemetry||{}; + // Do not infer LIVE from a port label, snapshot or demo LED alone. + if(t.rawCapturePresent!==true)return 'NO VERIFIED PCM'; + return 'ACCEPTED / AUDIO ARMED'; + } + function updateHeader(){ + const d=accepted?.device||{},g=accepted?.graph||{}; + deviceText.textContent=(d.backend||'NO DEVICE')+' · '+ + (d.sampleRate?Math.round(d.sampleRate)+' Hz':'— Hz')+' / '+ + (d.bufferFrames||'—')+' frames · GRAPH '+(g.revision??'—'); + modeBadge.textContent=!acceptedNative?'DEMO · NOT CONNECTED': + d.outputArmed?'NATIVE ACCEPTED · ARMED':'NATIVE ACCEPTED · OUTPUT DISARMED'; + root.dataset.demo=String(!acceptedNative); + root.dataset.armed=String(acceptedNative&&!!d.outputArmed); + } + function render(){ + if(!accepted)return; + updateHeader(); + lanes.replaceChildren();main.replaceChildren(); + const channels=accepted.graph.channels; + for(const ch of channels){ + if(clean(ch.role).toUpperCase()==='MAIN')main.append(strip(ch,true)); + else lanes.append(strip(ch)); + } + if(!main.children.length){ + main.append(h('div','arV6NoMaster','MAIN NOT PUBLISHED BY NATIVE')); + } + const destinations=(accepted.graph.destinations||[]).filter(x=>x.acceptsSend===true); + options(sendMode,destinations,modeSend,'MAIN FADERS'); + const cap=accepted.graph.capabilities||{}; + sendMode.disabled=!acceptedNative||!cap.sendsOnFaders; + add.disabled=!can('CREATE_CHANNEL'); + refreshDisabled();refreshMeters();refreshBanks(); + } + function refreshDisabled(){ + if(!accepted)return; + for(const node of root.querySelectorAll('[data-op]')){ + const op=node.dataset.op,id=node.dataset.id||null; + node.disabled=!can(op,id); + } + add.disabled=!can('CREATE_CHANNEL'); + const caps=accepted.graph.capabilities||{}; + sendMode.disabled=!acceptedNative||!caps.sendsOnFaders; + } + function refreshMeters(){ + if(!accepted)return; + const meters=acceptedNative?accepted.telemetry?.channelMeterRmsPeak||{}:{}; + for(const meter of root.querySelectorAll('[data-meter-id]')){ + const id=meter.dataset.meterId; + const m=meters[id]||{}; + const peak=Math.max(0,Number(m.peakLeft)||0,Number(m.peakRight)||0,Number(m.peak)||0); + const lit=clamp(Math.ceil(22*clamp(peak,0,1)),0,22); + if(meter.dataset.lit===String(lit))continue; + meter.dataset.lit=String(lit); + const leds=meter.children; + for(let i=0;i=total; + } + function jump(dir){ + const first=lanes.querySelector('.arV6Strip'); + if(!first)return; + const perPage=Math.max(1,Math.floor(lanes.clientWidth/first.getBoundingClientRect().width)); + lanes.scrollBy({left:dir*perPage*first.getBoundingClientRect().width,behavior:'auto'}); + refreshBanks(); + } + bankPrev.addEventListener('click',()=>jump(-1)); + bankNext.addEventListener('click',()=>jump(1)); + lanes.addEventListener('scroll',refreshBanks,{passive:true}); + if(typeof ResizeObserver==='function')new ResizeObserver(refreshBanks).observe(lanes); + sendMode.addEventListener('change',()=>{modeSend=sendMode.value;showFeedback(modeSend? + 'SENDS ON FADERS · native sends only · select MAIN FADERS to return':'MAIN FADERS · source gains unchanged')}); + root.addEventListener('click',event=>{ + const n=event.target.closest('button[data-op]'); + if(!n||n.disabled)return; + const op=n.dataset.op,id=n.dataset.id||null,ch=byId.get(id); + if(op==='CREATE_CHANNEL'){ + // Native must allocate ChannelId; never append a fake strip on ACK. + const type=window.prompt('Native channel type (MONO, STEREO, GROUP, FX_RETURN, MONITOR):','MONO'); + if(!type)return; + const role=type.toUpperCase(); + const caps=accepted.graph.capabilities||{}; + if(!['MONO','STEREO','GROUP','FX_RETURN','MONITOR'].includes(role))return; + if(role==='GROUP'&&!caps.groups||role==='FX_RETURN'&&!caps.fxReturns|| + role==='MONITOR'&&!caps.monitor){showFeedback('UNAVAILABLE · Native role not accepted');return} + sendIntent(op,null,{role});return; + } + if(!ch)return; + if(op==='SET_MUTE')sendIntent(op,id,{value:!ch.controls?.mute}); + else if(op==='SET_SOLO')sendIntent(op,id,{value:!ch.controls?.solo}); + else if(op==='SET_INSERT_BYPASS'){ + const fx=(ch.inserts||[]).find(x=>String(x.id)===n.dataset.insert); + if(fx)sendIntent(op,id,{insertId:fx.id,bypassed:!fx.bypassed}); + } + else if(op==='OPEN_INSERT_EDITOR')sendIntent(op,id,{insertId:n.dataset.insert}); + else if(op==='SET_SEND_TAP'){ + const send=(ch.sends||[]).find(x=>String(x.id)===n.dataset.send); + if(send)sendIntent(op,id,{sendId:send.id,tap:send.tap==='PRE'?'POST':'PRE'}); + } + else if(op==='PICK_INSERT_FILE')sendIntent(op,id,{}); + else if(op==='ADD_INSERT'){ + const catalog=accepted?.catalog?.plugins||[]; + if(!catalog.length){showFeedback('UNAVAILABLE · No native VST3 catalog published');return} + const pluginId=window.prompt('Native plugin ID: '+catalog.map(p=>p.id).join(', '),''); + if(catalog.some(p=>p.id===pluginId))sendIntent(op,id,{pluginId}); + } + }); + root.addEventListener('change',event=>{ + const n=event.target.closest('[data-op]'); + if(!n||n.disabled)return; + const id=n.dataset.id,op=n.dataset.op,ch=byId.get(id); + if(!ch)return; + if(op==='SET_SOURCE'&&n.value){ + const endpoint=(accepted.device.inputEndpoints||[]).find(e=>e.id===n.value&&e.available!==false&&e.active!==false); + if(endpoint)sendIntent(op,id,{portId:endpoint.id}); + }else if(op==='SET_PRIMARY_OUT'&&n.value)sendIntent(op,id,{destinationId:n.value}); + else if(op==='SET_PROCESSING_FORMAT')sendIntent(op,id,{format:n.value}); + else if(op==='ADD_SEND'&&n.value)sendIntent(op,id,{targetId:n.value,tap:'POST',levelDb:0}); + else if(op==='SET_PAN')sendIntent(op,id,{value:Number(n.value)}); + else if(op==='SET_FADER'){ + if(modeSend){ + const send=(ch.sends||[]).find(s=>s.targetId===modeSend); + if(send)sendIntent('SET_SEND_LEVEL',id,{sendId:send.id,levelDb:Number(n.value)}); + else showFeedback('UNAVAILABLE · No native send on this channel'); + }else sendIntent(op,id,{valueDb:Number(n.value)}); + } + // Native snapshot (not the locally manipulated HTML select/range) owns truth. + if(accepted)render(); + }); + if(native){ + backend.addEventListener('arMixConsoleSnapshot',s=>receiveSnapshot(s,true)); + backend.addEventListener('arMixConsoleAck',receiveAck); + requestSnapshot(); + }else{ + // Browser preview is visibly DEMO with every mutation disabled. + receiveSnapshot(makeDemo(),false); + showFeedback('BROWSER DEMO · UI layout only · no PCM, hardware, installed VST3 or LIVE routes'); + } + // Host/browser acceptance harness: dispatch a native envelope explicitly; + // no public function may forge a native acceptance in a real JUCE session. + if(!native){ + window.addEventListener('arMixV6Fixture',e=>receiveSnapshot(e.detail?.snapshot||e.detail,false)); + } + window.__arMixV6ReadOnly=()=>({ + nativePublisher:acceptedNative,revision:accepted?.graph?.revision??null, + epoch:accepted?.device?.epoch??null,visibleChannelIds:[...byId.keys()], + pendingCount:pending.size,feedback + }); +})(); From 829239f8c2dd9c4126f116c19d9ead37f0f5d365 Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Sun, 1 Nov 2026 09:40:45 +0700 Subject: [PATCH 013/233] style(gui-v6): compact premium pinned-master console and fixed geometry --- web/mixer-layout.css | 182 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 182 insertions(+) diff --git a/web/mixer-layout.css b/web/mixer-layout.css index 7a9ecf2b4..173f53758 100644 --- a/web/mixer-layout.css +++ b/web/mixer-layout.css @@ -251,3 +251,185 @@ @media(max-width:1366px){ #app .toolbar .project{max-width:130px;flex-basis:130px} } + + +/* ARSONMIX V6 PREMIUM LIVE CONSOLE — low-compositor-cost fixed strip grid. + Browser demo and native capability-gated shell share exactly the same DOM. */ +#app #arV6Console{display:none} +.ar-v6-active #app .left-rail{display:none!important} +.ar-v6-active #app .workbench{display:flex!important;flex:1 1 0;min-width:0;min-height:0;overflow:hidden} +.ar-v6-active #app #mixer, +.ar-v6-active #app #rackWorkspace{display:none!important} +.ar-v6-active #app .toolbar-actions.arSegmentedToolbar .nav, +.ar-v6-active #app .arMixerChannelPager{display:none!important} +#app .arV6Console, #app .arV6Console *{box-sizing:border-box} +.ar-v6-active #app #arV6Console{ + display:grid;grid-template-rows:51px auto minmax(0,1fr); + width:100%;height:100%;min-width:0;min-height:0;overflow:hidden; + background:linear-gradient(180deg,#23313a,#111b23 90px,#0c151c 100%); + color:#d3e0e6;font:11px/1.35 "ArSonMix Inter","Segoe UI",sans-serif; +} +#app .arV6Top{ + display:flex;justify-content:space-between;align-items:center; + gap:12px;padding:6px 13px;border-bottom:1px solid #435967; + background:linear-gradient(180deg,#33444e,#192833); + min-width:0; +} +#app .arV6Identification{display:flex;align-items:center;gap:11px;min-width:0;overflow:hidden} +#app .arV6Kicker{font:600 10px/1.2 "Segoe UI",sans-serif;letter-spacing:1.1px;white-space:nowrap;color:#d3e4ec} +#app .arV6Device{color:#92b3c1;font:10px/1.25 "Segoe UI",sans-serif;overflow:hidden;white-space:nowrap;text-overflow:ellipsis} +#app .arV6State{padding:4px 7px;border:1px solid #607782;border-radius:3px;white-space:nowrap;color:#e0dbad;font:600 9px/1 "Segoe UI",sans-serif} +#app .arV6Console[data-armed="true"] .arV6State{color:#a8e6cd;border-color:#396c62} +#app .arV6Tools{display:flex;align-items:center;gap:6px;flex:none} +#app .arV6Button,#app .arV6Select{ + font:500 10px/1.2 "Segoe UI",sans-serif; + color:#d5e5eb;background:linear-gradient(180deg,#354956,#1c303b); + border:1px solid #526e7a;border-radius:3px;min-height:25px; + padding:4px 7px;min-width:0; +} +#app .arV6Button{cursor:pointer} +#app .arV6Button:focus-visible,#app .arV6Select:focus-visible, +#app .arV6Fader:focus-visible,#app .arV6PanRange:focus-visible{ + outline:2px solid #62cce8;outline-offset:1px; +} +#app .arV6Button:disabled,#app .arV6Select:disabled, +#app .arV6Fader:disabled,#app .arV6PanRange:disabled{opacity:.48;cursor:not-allowed} +#app .arV6BankLabel{min-width:72px;text-align:center;color:#abc3cf;font:10px Consolas,monospace;white-space:nowrap} +#app .arV6SendMode{max-width:126px} +#app .arV6Message{ + font:10px/1.3 "Segoe UI",sans-serif; + padding:5px 12px;color:#e2caaa;background:#28333a; + border-bottom:1px solid #46535a;overflow:hidden;text-overflow:ellipsis;white-space:nowrap; +} +#app .arV6Message[hidden]{display:none} +#app .arV6Body{display:flex;min-width:0;min-height:0;overflow:hidden} +#app .arV6Lanes{ + display:flex;flex:1 1 0;min-width:0;min-height:0; + overflow-x:auto;overflow-y:hidden;scrollbar-width:thin; + scrollbar-color:#486171 #0e1b25;scroll-snap-type:x proximity; +} +#app .arV6Main{ + display:flex;flex:0 0 178px;max-width:178px;min-height:0; + border-left:2px solid #6b8993; + background:#22313c;z-index:1; +} +#app .arV6NoMaster{padding:15px;color:#e2ae97;font-size:11px} +#app .arV6Strip{ + --v6-strip-color:#5f9ab1; + display:grid;grid-template-rows:37px minmax(235px,auto) 52px minmax(105px,1fr) 26px; + flex:0 0 167px;width:167px;min-height:0;height:100%; + padding:0 7px 5px;border-right:1px solid #354955; + background:linear-gradient(90deg,#1b2b35 0%,#263741 14%,#263741 87%,#15252e); + scroll-snap-align:start;overflow:hidden; +} +#app .arV6Strip.arV6Master{ + flex:1 0 0;width:100%; + background:linear-gradient(90deg,#2a414b,#283b47 88%,#172934); +} +#app .arV6StripHead{ + display:flex;flex-direction:column;justify-content:center;gap:3px; + min-width:0;border-bottom:1px solid #496473; +} +#app .arV6Role{font:600 9px/1 "Segoe UI",sans-serif;letter-spacing:.9px;color:#88adbc} +#app .arV6Name{font:600 12px/1.2 "Segoe UI",sans-serif;color:#ecf1f3; + white-space:nowrap;overflow:hidden;text-overflow:ellipsis} +#app .arV6Upper{ + display:grid;grid-template-rows:31px 31px minmax(83px,1fr) minmax(54px,auto) 31px; + min-height:0;overflow:hidden;padding:6px 0 4px; + border-bottom:1px solid #3b4d57; +} +#app .arV6Field{display:flex;align-items:center;gap:5px;min-width:0} +#app .arV6FixedField{color:#91afbb;white-space:nowrap;font:9px Consolas,monospace} +#app .arV6FieldName{flex:0 0 27px;font:600 9px/1 "Segoe UI",sans-serif;color:#8faebc} +#app .arV6Field .arV6Select{flex:1 1 0;width:100%;max-width:116px;min-height:23px;padding:2px 3px} +#app .arV6Fx,#app .arV6Sends{ + min-height:0;overflow:hidden;display:flex;flex-direction:column;gap:3px; + border-top:1px solid #354b57;padding-top:5px; +} +#app .arV6SectionTitle{font:600 9px/1.2 "Segoe UI",sans-serif;letter-spacing:.6px;color:#83aaba} +#app .arV6FxSlot,#app .arV6Send{display:flex;gap:3px;align-items:center;min-width:0} +#app .arV6FxSlot .arV6Button:first-child{ + flex:1 1 0;text-align:left;white-space:nowrap;overflow:hidden;text-overflow:ellipsis; + background:#172b35;border-color:#476270;color:#c9dfe7; +} +#app .arV6FxSlot .arV6Button:last-child{flex:0 0 29px;width:29px;padding:3px 0;color:#9ee0bb} +#app .arV6FxSlot .arV6Button.isOff{color:#95a1a9} +#app .arV6AddFx{width:100%;min-height:23px!important;padding:3px!important;text-align:left;color:#90c9d8!important} +#app .arV6SendName{ + flex:1 1 0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:#bfd2dc; + font:10px/1.1 "Segoe UI",sans-serif; +} +#app .arV6Send .arV6Button{min-height:20px;padding:2px 5px} +#app .arV6Controls{display:grid;grid-template-columns:minmax(0,1fr) 28px 28px;align-items:center; + gap:5px;border-bottom:1px solid #445863} +#app .arV6Controls .arV6Button{width:28px;min-height:28px;padding:0;font-size:11px} +#app .arV6Controls .arV6Button[aria-pressed="true"]{border-color:#bba35d;background:#61532b;color:#fff0ac} +#app .arV6Pan{display:flex;flex-direction:column;gap:2px;min-width:0;color:#86abb9;font-size:9px} +#app .arV6PanRange{width:100%;min-width:0;accent-color:#54bbcf;height:14px;margin:0} +#app .arV6Lower{display:flex;gap:16px;align-items:center;justify-content:center; + padding:7px 5px 2px;min-height:0;position:relative} +#app .arV6Meter{ + display:flex;flex-direction:column-reverse;justify-content:space-between;gap:1px; + width:12px;height:100%;max-height:100%;min-height:70px;padding:2px; + border:1px solid #15242c;background:#02080d;box-shadow:inset 1px 0 #516673; +} +#app .arV6Led{display:block;flex:1 1 0;min-height:2px;background:#172b30} +#app .arV6Led.lit{background:#29b277} +#app .arV6Led:nth-child(n+15).lit{background:#d8ac44} +#app .arV6Led:nth-child(n+20).lit{background:#dc6148} +#app .arV6Fader{ + writing-mode:vertical-lr;direction:rtl; + height:100%;min-height:75px;width:46px;min-width:46px;margin:0; + cursor:pointer;appearance:none;-webkit-appearance:none;background:transparent; +} +#app .arV6Fader::-webkit-slider-runnable-track{ + width:11px;min-height:100%;border:1px solid #02080d;border-radius:3px; + background:linear-gradient(90deg,#050a0f 0%,#182c36 45%,#061018 100%); + box-shadow:inset 1px 0 #58737d,inset -1px 0 #050b10; +} +#app .arV6Fader::-webkit-slider-thumb{ + -webkit-appearance:none;appearance:none; + width:44px;height:24px;border:0;border-radius:2px; + background:transparent url("assets/fader-silver2.png") center/contain no-repeat; +} +#app .arV6Fader::-moz-range-thumb{ + width:43px;height:23px;border:0;border-radius:2px; + background:transparent url("assets/fader-silver2.png") center/contain no-repeat; +} +#app .arV6Readout{ + position:absolute;bottom:3px;right:3px; + font:10px Consolas,monospace;color:#b7cbd5; +} +#app .arV6StripStatus{ + display:flex;align-items:center;min-width:0;overflow:hidden; + font:600 9px/1.2 "Segoe UI",sans-serif;letter-spacing:.15px; + color:#91b6c3;white-space:nowrap;text-overflow:ellipsis; +} +#app .arV6Console[data-demo="true"] .arV6StripStatus{color:#d9b98a} +#app .arV6Console[data-demo="true"] .arV6State{color:#e6bf8e;border-color:#986d46} +#app #arV6Return{min-height:29px;flex:0 0 auto} +#app #arV6Return[hidden]{display:none!important} +@media(max-width:1366px){ + #app .arV6Kicker{max-width:176px;overflow:hidden;text-overflow:ellipsis} + #app .arV6Strip{flex-basis:155px;width:155px;padding-left:6px;padding-right:6px} + #app .arV6Main{flex-basis:166px;max-width:166px} + #app .arV6Tools{gap:3px} +} +@media(max-width:1100px){ + #app .arV6Top{padding:5px 7px} + #app .arV6Kicker{display:none} + #app .arV6SendMode{max-width:105px} +} +@media(max-height:790px){ + #app .arV6Strip{grid-template-rows:32px minmax(197px,auto) 45px minmax(85px,1fr) 22px} + #app .arV6Upper{grid-template-rows:27px 27px minmax(74px,1fr) minmax(43px,auto) 27px;padding-top:3px} + #app .arV6Top{min-height:44px} + #app .arV6Console .arV6Button{min-height:22px} +} +@media(max-height:690px){ + #app .arV6Strip{grid-template-rows:28px minmax(160px,auto) 40px minmax(75px,1fr) 18px} + #app .arV6Upper{grid-template-rows:24px 24px minmax(54px,1fr) minmax(34px,auto) 24px} + #app .arV6SectionTitle{font-size:8px} + #app .arV6FxSlot .arV6Button{min-height:18px} + #app .arV6Device{font-size:9px} +} From a20b92237be9a9a6bd89fc02e2a369e00023da75 Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Sun, 1 Nov 2026 09:41:09 +0700 Subject: [PATCH 014/233] build(gui-v6): synchronize offline standalone console source parity --- AR-MIX-Live-FX-Host-Standalone-v0.3.html | 634 +++++++++++++++++++++++ 1 file changed, 634 insertions(+) diff --git a/AR-MIX-Live-FX-Host-Standalone-v0.3.html b/AR-MIX-Live-FX-Host-Standalone-v0.3.html index d280a1443..a5b93c5b1 100644 --- a/AR-MIX-Live-FX-Host-Standalone-v0.3.html +++ b/AR-MIX-Live-FX-Host-Standalone-v0.3.html @@ -1702,6 +1702,188 @@ @media(max-width:1366px){ #app .toolbar .project{max-width:130px;flex-basis:130px} } + + +/* ARSONMIX V6 PREMIUM LIVE CONSOLE — low-compositor-cost fixed strip grid. + Browser demo and native capability-gated shell share exactly the same DOM. */ +#app #arV6Console{display:none} +.ar-v6-active #app .left-rail{display:none!important} +.ar-v6-active #app .workbench{display:flex!important;flex:1 1 0;min-width:0;min-height:0;overflow:hidden} +.ar-v6-active #app #mixer, +.ar-v6-active #app #rackWorkspace{display:none!important} +.ar-v6-active #app .toolbar-actions.arSegmentedToolbar .nav, +.ar-v6-active #app .arMixerChannelPager{display:none!important} +#app .arV6Console, #app .arV6Console *{box-sizing:border-box} +.ar-v6-active #app #arV6Console{ + display:grid;grid-template-rows:51px auto minmax(0,1fr); + width:100%;height:100%;min-width:0;min-height:0;overflow:hidden; + background:linear-gradient(180deg,#23313a,#111b23 90px,#0c151c 100%); + color:#d3e0e6;font:11px/1.35 "ArSonMix Inter","Segoe UI",sans-serif; +} +#app .arV6Top{ + display:flex;justify-content:space-between;align-items:center; + gap:12px;padding:6px 13px;border-bottom:1px solid #435967; + background:linear-gradient(180deg,#33444e,#192833); + min-width:0; +} +#app .arV6Identification{display:flex;align-items:center;gap:11px;min-width:0;overflow:hidden} +#app .arV6Kicker{font:600 10px/1.2 "Segoe UI",sans-serif;letter-spacing:1.1px;white-space:nowrap;color:#d3e4ec} +#app .arV6Device{color:#92b3c1;font:10px/1.25 "Segoe UI",sans-serif;overflow:hidden;white-space:nowrap;text-overflow:ellipsis} +#app .arV6State{padding:4px 7px;border:1px solid #607782;border-radius:3px;white-space:nowrap;color:#e0dbad;font:600 9px/1 "Segoe UI",sans-serif} +#app .arV6Console[data-armed="true"] .arV6State{color:#a8e6cd;border-color:#396c62} +#app .arV6Tools{display:flex;align-items:center;gap:6px;flex:none} +#app .arV6Button,#app .arV6Select{ + font:500 10px/1.2 "Segoe UI",sans-serif; + color:#d5e5eb;background:linear-gradient(180deg,#354956,#1c303b); + border:1px solid #526e7a;border-radius:3px;min-height:25px; + padding:4px 7px;min-width:0; +} +#app .arV6Button{cursor:pointer} +#app .arV6Button:focus-visible,#app .arV6Select:focus-visible, +#app .arV6Fader:focus-visible,#app .arV6PanRange:focus-visible{ + outline:2px solid #62cce8;outline-offset:1px; +} +#app .arV6Button:disabled,#app .arV6Select:disabled, +#app .arV6Fader:disabled,#app .arV6PanRange:disabled{opacity:.48;cursor:not-allowed} +#app .arV6BankLabel{min-width:72px;text-align:center;color:#abc3cf;font:10px Consolas,monospace;white-space:nowrap} +#app .arV6SendMode{max-width:126px} +#app .arV6Message{ + font:10px/1.3 "Segoe UI",sans-serif; + padding:5px 12px;color:#e2caaa;background:#28333a; + border-bottom:1px solid #46535a;overflow:hidden;text-overflow:ellipsis;white-space:nowrap; +} +#app .arV6Message[hidden]{display:none} +#app .arV6Body{display:flex;min-width:0;min-height:0;overflow:hidden} +#app .arV6Lanes{ + display:flex;flex:1 1 0;min-width:0;min-height:0; + overflow-x:auto;overflow-y:hidden;scrollbar-width:thin; + scrollbar-color:#486171 #0e1b25;scroll-snap-type:x proximity; +} +#app .arV6Main{ + display:flex;flex:0 0 178px;max-width:178px;min-height:0; + border-left:2px solid #6b8993; + background:#22313c;z-index:1; +} +#app .arV6NoMaster{padding:15px;color:#e2ae97;font-size:11px} +#app .arV6Strip{ + --v6-strip-color:#5f9ab1; + display:grid;grid-template-rows:37px minmax(235px,auto) 52px minmax(105px,1fr) 26px; + flex:0 0 167px;width:167px;min-height:0;height:100%; + padding:0 7px 5px;border-right:1px solid #354955; + background:linear-gradient(90deg,#1b2b35 0%,#263741 14%,#263741 87%,#15252e); + scroll-snap-align:start;overflow:hidden; +} +#app .arV6Strip.arV6Master{ + flex:1 0 0;width:100%; + background:linear-gradient(90deg,#2a414b,#283b47 88%,#172934); +} +#app .arV6StripHead{ + display:flex;flex-direction:column;justify-content:center;gap:3px; + min-width:0;border-bottom:1px solid #496473; +} +#app .arV6Role{font:600 9px/1 "Segoe UI",sans-serif;letter-spacing:.9px;color:#88adbc} +#app .arV6Name{font:600 12px/1.2 "Segoe UI",sans-serif;color:#ecf1f3; + white-space:nowrap;overflow:hidden;text-overflow:ellipsis} +#app .arV6Upper{ + display:grid;grid-template-rows:31px 31px minmax(83px,1fr) minmax(54px,auto) 31px; + min-height:0;overflow:hidden;padding:6px 0 4px; + border-bottom:1px solid #3b4d57; +} +#app .arV6Field{display:flex;align-items:center;gap:5px;min-width:0} +#app .arV6FixedField{color:#91afbb;white-space:nowrap;font:9px Consolas,monospace} +#app .arV6FieldName{flex:0 0 27px;font:600 9px/1 "Segoe UI",sans-serif;color:#8faebc} +#app .arV6Field .arV6Select{flex:1 1 0;width:100%;max-width:116px;min-height:23px;padding:2px 3px} +#app .arV6Fx,#app .arV6Sends{ + min-height:0;overflow:hidden;display:flex;flex-direction:column;gap:3px; + border-top:1px solid #354b57;padding-top:5px; +} +#app .arV6SectionTitle{font:600 9px/1.2 "Segoe UI",sans-serif;letter-spacing:.6px;color:#83aaba} +#app .arV6FxSlot,#app .arV6Send{display:flex;gap:3px;align-items:center;min-width:0} +#app .arV6FxSlot .arV6Button:first-child{ + flex:1 1 0;text-align:left;white-space:nowrap;overflow:hidden;text-overflow:ellipsis; + background:#172b35;border-color:#476270;color:#c9dfe7; +} +#app .arV6FxSlot .arV6Button:last-child{flex:0 0 29px;width:29px;padding:3px 0;color:#9ee0bb} +#app .arV6FxSlot .arV6Button.isOff{color:#95a1a9} +#app .arV6AddFx{width:100%;min-height:23px!important;padding:3px!important;text-align:left;color:#90c9d8!important} +#app .arV6SendName{ + flex:1 1 0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:#bfd2dc; + font:10px/1.1 "Segoe UI",sans-serif; +} +#app .arV6Send .arV6Button{min-height:20px;padding:2px 5px} +#app .arV6Controls{display:grid;grid-template-columns:minmax(0,1fr) 28px 28px;align-items:center; + gap:5px;border-bottom:1px solid #445863} +#app .arV6Controls .arV6Button{width:28px;min-height:28px;padding:0;font-size:11px} +#app .arV6Controls .arV6Button[aria-pressed="true"]{border-color:#bba35d;background:#61532b;color:#fff0ac} +#app .arV6Pan{display:flex;flex-direction:column;gap:2px;min-width:0;color:#86abb9;font-size:9px} +#app .arV6PanRange{width:100%;min-width:0;accent-color:#54bbcf;height:14px;margin:0} +#app .arV6Lower{display:flex;gap:16px;align-items:center;justify-content:center; + padding:7px 5px 2px;min-height:0;position:relative} +#app .arV6Meter{ + display:flex;flex-direction:column-reverse;justify-content:space-between;gap:1px; + width:12px;height:100%;max-height:100%;min-height:70px;padding:2px; + border:1px solid #15242c;background:#02080d;box-shadow:inset 1px 0 #516673; +} +#app .arV6Led{display:block;flex:1 1 0;min-height:2px;background:#172b30} +#app .arV6Led.lit{background:#29b277} +#app .arV6Led:nth-child(n+15).lit{background:#d8ac44} +#app .arV6Led:nth-child(n+20).lit{background:#dc6148} +#app .arV6Fader{ + writing-mode:vertical-lr;direction:rtl; + height:100%;min-height:75px;width:46px;min-width:46px;margin:0; + cursor:pointer;appearance:none;-webkit-appearance:none;background:transparent; +} +#app .arV6Fader::-webkit-slider-runnable-track{ + width:11px;min-height:100%;border:1px solid #02080d;border-radius:3px; + background:linear-gradient(90deg,#050a0f 0%,#182c36 45%,#061018 100%); + box-shadow:inset 1px 0 #58737d,inset -1px 0 #050b10; +} +#app .arV6Fader::-webkit-slider-thumb{ + -webkit-appearance:none;appearance:none; + width:44px;height:24px;border:0;border-radius:2px; + background:transparent url("assets/fader-silver2.png") center/contain no-repeat; +} +#app .arV6Fader::-moz-range-thumb{ + width:43px;height:23px;border:0;border-radius:2px; + background:transparent url("assets/fader-silver2.png") center/contain no-repeat; +} +#app .arV6Readout{ + position:absolute;bottom:3px;right:3px; + font:10px Consolas,monospace;color:#b7cbd5; +} +#app .arV6StripStatus{ + display:flex;align-items:center;min-width:0;overflow:hidden; + font:600 9px/1.2 "Segoe UI",sans-serif;letter-spacing:.15px; + color:#91b6c3;white-space:nowrap;text-overflow:ellipsis; +} +#app .arV6Console[data-demo="true"] .arV6StripStatus{color:#d9b98a} +#app .arV6Console[data-demo="true"] .arV6State{color:#e6bf8e;border-color:#986d46} +#app #arV6Return{min-height:29px;flex:0 0 auto} +#app #arV6Return[hidden]{display:none!important} +@media(max-width:1366px){ + #app .arV6Kicker{max-width:176px;overflow:hidden;text-overflow:ellipsis} + #app .arV6Strip{flex-basis:155px;width:155px;padding-left:6px;padding-right:6px} + #app .arV6Main{flex-basis:166px;max-width:166px} + #app .arV6Tools{gap:3px} +} +@media(max-width:1100px){ + #app .arV6Top{padding:5px 7px} + #app .arV6Kicker{display:none} + #app .arV6SendMode{max-width:105px} +} +@media(max-height:790px){ + #app .arV6Strip{grid-template-rows:32px minmax(197px,auto) 45px minmax(85px,1fr) 22px} + #app .arV6Upper{grid-template-rows:27px 27px minmax(74px,1fr) minmax(43px,auto) 27px;padding-top:3px} + #app .arV6Top{min-height:44px} + #app .arV6Console .arV6Button{min-height:22px} +} +@media(max-height:690px){ + #app .arV6Strip{grid-template-rows:28px minmax(160px,auto) 40px minmax(75px,1fr) 18px} + #app .arV6Upper{grid-template-rows:24px 24px minmax(54px,1fr) minmax(34px,auto) 24px} + #app .arV6SectionTitle{font-size:8px} + #app .arV6FxSlot .arV6Button{min-height:18px} + #app .arV6Device{font-size:9px} +}
@@ -3653,11 +3760,11 @@ const mixer=document.getElementById('mixer'); const host=document.querySelector('.workbench'); if(!mixer||!host)return; - let mode='FX', lastStatus={}, deviceInventory=null, ioTab='device', lastSignature='', focusedInput=2; + let mode='FX', lastStatus={}, deviceInventory=null, ioTab='device', lastSignature='', focusedInput=0; let monitorSendsExpanded=false; // DEVICE1: staged selections are UI-only; only positive native ACK changes active hardware. let deviceDraft=null,deviceBusy=false,deviceNote='',deviceRequest='',deviceRequestSeq=0,lastDeviceRefresh=0,lastDeviceRescan=0,applyMutePending=false,applyAfterDevice=null,applyBaseEpoch=0; - let deviceMatrixView='inputs',deviceMatrixWaitEpoch=null; // Never display old hardware pins after an APPLY ACK. + let deviceMatrixView='inputs',deviceMatrixWaitEpoch=null,deviceMatrixOpen=false; // Never display old hardware pins after an APPLY ACK. // Pending SOURCE ACK is a UI projection only; monitor.js owns the native route. let quickSourcePending=null; const el=id=>document.getElementById(id); @@ -4100,7 +4207,7 @@ sofControls.hidden=true;toolbar.appendChild(sofControls); const overlay=node('div','arIOOverlay'); overlay.id='arIOOverlay';overlay.hidden=true; - overlay.innerHTML=''; + overlay.innerHTML=''; document.body.appendChild(overlay); const audioPath=node('div','arIOAudioPath');audioPath.id='arIOAudioPath'; audioPath.innerHTML='CAPTURE · WAITROUTE · WAITMIXER · WAITOUTPUT · WAIT'; @@ -4563,7 +4670,7 @@ const title=node('header','arIOQuickHeader'); const words=node('div',''); words.append(node('strong','','1 · INTERFACE INPUT → MIXER CHANNEL'), - node('small','','Choose a channel, mono/stereo source and actual driver input(s). STAGE → MUTE → APPLY.')); + node('small','','Choose one channel and one or two distinct verified capture pins. USE INPUT commits through native ACK.')); const jump=node('select','arIOJump'); jump.dataset.ioJump='1';jump.setAttribute('aria-label','Find mixer channel'); for(let i=0;i<10;i++){ @@ -4591,15 +4698,20 @@ for(let i=0;i<10;i++){ const r=channelState(s,i),accepted=s.acceptedRoute?.channels?.[i]; const row=node('div','arIOQuickRow');row.dataset.ioQuickRow=String(i); + row.hidden=i!==focusedInput; row.dataset.state=!s.ready?'offline':valueFor(r)!==valueFor(accepted)?'draft': r.mode==='NONE'?'empty':'live'; const identity=node('div','arIOQuickIdentity'); identity.append(node('strong','','CH '+String(i+1).padStart(2,'0')),node('small','',matrixLogicalName(i))); const mode=node('select','arIOQuickMode');mode.dataset.ioQuickMode='1'; mode.setAttribute('aria-label','CH '+(i+1)+' physical input type'); - for(const pair of [['NONE','NO INPUT'],['MONO','MONO'],['STEREO','STEREO'], + for(const pair of [['NONE','NO INPUT'],['MONO','MONO'],['STEREO','STEREO · 2 PINS'], ...(r.mode==='BUS'?[['BUS','INTERNAL BUS']]:[])]){ - const option=node('option','',pair[1]);option.value=pair[0];option.selected=r.mode===pair[0];mode.appendChild(option); + const option=node('option','',pair[1]);option.value=pair[0];option.selected=r.mode===pair[0]; + // An accepted legacy invalid stereo route must remain inspectable, + // but new STEREO selection requires two distinct enabled driver pins. + if(pair[0]==='STEREO'&&verified.length<2&&r.mode!=='STEREO')option.disabled=true; + mode.appendChild(option); } const left=sourceSelect(i,'left',r.left),right=sourceSelect(i,'right',r.right); left.disabled=!hardwareReady(s)||r.mode==='NONE'||r.mode==='BUS'; @@ -4609,12 +4721,16 @@ const stage=node('button','btn-180 arIOQuickStage','USE INPUT'); stage.dataset.ioQuickStage='1';stage.type='button'; stage.disabled=!hardwareReady(s)||r.mode==='BUS'; - action.append(stage,node('small','arIOQuickState',r.mode==='BUS'?'INTERNAL BUS': + const stereoInvalid=r.mode==='STEREO'&&(!verified.some(p=>p.port===r.left)|| + !verified.some(p=>p.port===r.right)||r.left===r.right); + if(stereoInvalid)row.dataset.state='invalid'; + action.append(stage,node('small','arIOQuickState',stereoInvalid? + 'INVALID STEREO · SELECT DISTINCT L/R':r.mode==='BUS'?'INTERNAL BUS': !s.ready?'NO DEVICE':row.dataset.state==='draft'?'DRAFT · NOT LIVE': - row.dataset.state==='live'?'LIVE · ACK':'UNPATCHED')); + row.dataset.state==='live'?'ROUTE ACK · CHECK PCM':'UNPATCHED')); row.append(identity,mode,left,right,action);section.appendChild(row); } - section.appendChild(node('p','arIOQuickFooter','Select verified inputs, click USE INPUT. Native routing handles any required safe mute, ACK and re-arm automatically.')); + section.appendChild(node('p','arIOQuickFooter','ONE ACTION: USE INPUT → native safe route/ACK. No input PCM? Send playback into the selected recording endpoint, then check SIGNAL CHECK.')); return section; } function stageQuickInput(button){ @@ -5044,7 +5160,7 @@ hidden.value=d.backend;panel.appendChild(hidden); } const same=deviceSameEndpoint(d),advanced=node('details','arIODeviceAdvanced'); - advanced.appendChild(node('summary','','BUFFER / SAMPLE RATE / HARDWARE PIN ENABLE')); + advanced.appendChild(node('summary','','ADVANCED · BUFFER / SAMPLE RATE')); const fields=node('div','arIODeviceFields'); const rateOpts=[[0,'AUTO · driver default']],bufferOpts=[[0,'AUTO · driver default']]; if(same){ @@ -5059,6 +5175,12 @@ deviceSelect('arIODeviceBuffer',d.bufferSize,bufferOpts,deviceBusy||!isNative()))); advanced.appendChild(fields); const pins=node('div','arIODevicePins'); + const pinHeading=node('div','arIOPinHeading'); + const enabledCount=Array.isArray(d.enabledInputs)?d.enabledInputs.length:0; + pinHeading.append(node('strong','','HARDWARE PORTS · ENABLE INPUTS / OUTPUTS'), + node('span','',enabledCount+' capture pin(s) selected · '+(enabledCount<2? + 'MONO ONLY until a second distinct input is enabled':'MONO / STEREO PAIRS POSSIBLE'))); + panel.appendChild(pinHeading); for(const [direction,names,selectedPins] of [ ['INPUT',same?a.inputNames:[],d.enabledInputs], ['OUTPUT',same?a.outputNames:[],d.enabledOutputs]]){ @@ -5078,7 +5200,9 @@ }); pins.appendChild(side); } - advanced.appendChild(pins);panel.appendChild(advanced); + // Input/output pin enabling is a BASIC step, not an advanced matrix. + // The original native device draft/ACK path remains unchanged. + panel.appendChild(pins);panel.appendChild(advanced); } const actions=node('div','arIODeviceActions'); const refresh=node('button','btn-180 arIODeviceRefresh','REFRESH DEVICES'); @@ -5098,9 +5222,11 @@ devicePinNextStep())); panel.appendChild(actions);body.appendChild(panel); - const matrixSection=node('section','arIODevicePatchMatrix'); - const heading=node('div','arIODeviceMatrixHeading'); - heading.appendChild(node('strong','','AUDIO I/O · REAL PORT MATRIX')); + const matrixSection=node('details','arIODevicePatchMatrix'); + matrixSection.open=deviceMatrixOpen; + matrixSection.addEventListener('toggle',()=>{deviceMatrixOpen=matrixSection.open;}); + const heading=node('summary','arIODeviceMatrixHeading'); + heading.appendChild(node('strong','','ADVANCED · HARDWARE PORT MATRIX (OPTIONAL)')); const tabs=node('div','arIODeviceMatrixSwitch'); for(const [value,label] of [['inputs','INPUTS'],['outputs','OUTPUTS']]){ const b=node('button','arIODeviceMatrixTab',label);b.type='button'; @@ -5149,7 +5275,10 @@ }); overlay.dataset.activeTab=ioTab; const matrixInDevice=ioTab==='device'&&deviceSameEndpoint(deviceDraft)&&hardwareReady(s); - overlay.querySelector('[data-mix-apply]').hidden=ioTab==='device'; + overlay.querySelector('[data-mix-apply]').hidden=ioTab==='device'|| + (ioTab==='inputs'&&!advancedMatrixOpen); + overlay.querySelector('[data-mix-apply]').textContent= + ioTab==='outputs'?'APPLY MAIN OUT':'APPLY ADVANCED'; overlay.querySelector('[data-io-revert]').hidden=ioTab==='device'&&!matrixInDevice; overlay.querySelector('[data-io-internal]').hidden=ioTab==='device'; overlay.querySelector('[data-io-device-apply]').hidden=ioTab!=='device'; @@ -5175,6 +5304,8 @@ if(previous)advancedMatrixOpen=previous.open; const previousDirect=body.querySelector('.arIODeviceDirectMatrix'); if(previousDirect)directMatrixOpen=previousDirect.open; + const previousHardware=body.querySelector('.arIODevicePatchMatrix'); + if(previousHardware)deviceMatrixOpen=previousHardware.open; body.replaceChildren(); if(ioTab!=='device'){ const identity=node('div','arIOHardwareHeader'); @@ -5190,10 +5321,43 @@ body.appendChild(makeQuickInputs(s)); const advanced=node('details','arIOAdvancedMatrix'); advanced.open=advancedMatrixOpen; - advanced.appendChild(node('summary','','ADVANCED M / L / R CROSSPOINT · SAME NATIVE ROUTING')); + advanced.addEventListener('toggle',()=>{ + advancedMatrixOpen=advanced.open; + overlay.querySelector('[data-mix-apply]').hidden=!advanced.open; + }); + advanced.appendChild(node('summary','','ADVANCED · MANUAL INPUT CROSSPOINTS')); advanced.appendChild(makeMatrix(s,ioTab)); body.appendChild(advanced); - }else body.appendChild(makeMatrix(s,ioTab)); + }else{ + // MAIN Left/Right must be visible before the engineering matrix. + // The same __arMixStageMainOutputs owns both paths. + const simple=node('section','arIOSimpleMain'); + simple.append(node('strong','','MAIN OUTPUT · STEREO PAIR'), + node('p','','Select two different enabled hardware outputs. APPLY OUTPUT publishes native routing; no browser sound is generated.')); + const outputPorts=matrixPorts(s,'outputs'); + const accepted=s.mainOutputs?.length===2?s.mainOutputs:[]; + const picked=s.draftMainOutputs?.length===2?s.draftMainOutputs:accepted; + const pickers=node('div','arIOSimpleMainRow'); + for(let side=0;side<2;side++){ + const label=node('label','arIOSimpleMainField'); + label.append(node('span','',side===0?'MAIN LEFT':'MAIN RIGHT')); + const select=node('select','arIOMainOutput');select.dataset.side=String(side); + const empty=node('option','','Choose verified output…');empty.value='-1';select.append(empty); + for(const port of outputPorts){ + const opt=node('option','','HW OUT '+(port+1));opt.value=String(port); + opt.selected=port===picked[side];select.appendChild(opt); + } + select.disabled=!hardwareReady(s)||s.pending||outputPorts.length<2; + label.append(select);pickers.append(label); + } + simple.append(pickers); + body.append(simple); + const advanced=node('details','arIOAdvancedMatrix'); + advanced.open=advancedMatrixOpen; + advanced.append(node('summary','','ADVANCED · OUTPUT CROSSPOINTS / MONITOR')); + advanced.append(makeMatrix(s,ioTab)); + body.append(advanced); + } } if(ioTab==='inputs'){ body.appendChild(node('p','arIOHint','MAONO PS22 virtual inputs appear here ONLY if its selected driver enumerates them as capture ports. Configure MAONO Routing Center and select the appropriate PS22 ASIO/recording endpoint in DEVICE / DRIVER. Separate Windows capture endpoints cannot be silently combined into one device. Processing MONO/STEREO is independent of physical source mode.')); @@ -5231,26 +5395,9 @@ body.appendChild(node('p','arIOHint','LIVE MONITOR: '+ (monitorLive.length===2?'HW '+(monitorLive[0]+1)+'/'+(monitorLive[1]+1):'DISABLED')+ ' · Independent POST-fader mix; all changes require MUTE → APPLY → ACK.')); - const details=node('details','arIOQuickMap'); - details.appendChild(node('summary','','QUICK OUTPUT SELECTION · ACCESSIBLE ALTERNATIVE')); - const accepted=s.mainOutputs?.length===2?s.mainOutputs:[]; - const draft=s.draftMainOutputs?.length===2?s.draftMainOutputs:accepted; - const ports=matrixPorts(s,'outputs'); - for(const [i,label] of ['MAIN LEFT','MAIN RIGHT'].entries()){ - const row=node('label','arIOOutputRow'); - const selector=node('select','arIOMainOutput'); - selector.dataset.side=String(i); - selector.setAttribute('aria-label',label+' destination'); - for(const p of ports){ - const option=node('option','','HW OUT '+(p+1)); - option.value=String(p);option.selected=p===draft[i];selector.appendChild(option); - } - selector.disabled=!hardwareReady(s)||ports.length<2; - row.append(node('strong','',label),selector);details.appendChild(row); - } - body.appendChild(details); - body.appendChild(node('p','arIOHint','LIVE MAIN: '+(accepted.length===2?'HW '+(accepted[0]+1)+'/'+(accepted[1]+1):'UNAVAILABLE')+ - ' · Only native-ACKed MAIN/MONITOR pairs can carry sound. AUX1–4 are internal stereo FX returns, not physical output sockets.')); + const acknowledged=s.mainOutputs?.length===2?s.mainOutputs:[]; + body.appendChild(node('p','arIOHint','NATIVE MAIN: '+(acknowledged.length===2?'HW '+(acknowledged[0]+1)+' / '+(acknowledged[1]+1):'UNAVAILABLE')+ + ' · Selection is DRAFT until native APPLY/ACK. AUX1–4 are internal FX returns, not hardware ports.')); }else{ renderCustomDevice(body); } @@ -5299,6 +5446,7 @@ } if(e.target.matches('[data-io-jump]')){ focusedInput=Number(e.target.value); + lastSignature='';refreshIO(); overlay.querySelector('[data-io-quick-row="'+focusedInput+'"]')?.scrollIntoView({block:'nearest'}); return; } From 30e7d4d47555aff94242f3238b607caec0a80492 Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Sun, 1 Nov 2026 10:35:23 +0700 Subject: [PATCH 058/233] test(gui): match revised accurate AUX and advanced input labels --- tests/mixer_io_operator_contract_test.mjs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/mixer_io_operator_contract_test.mjs b/tests/mixer_io_operator_contract_test.mjs index ed9bb552c..27d108c07 100644 --- a/tests/mixer_io_operator_contract_test.mjs +++ b/tests/mixer_io_operator_contract_test.mjs @@ -27,7 +27,7 @@ test('MS3A MAIN physical output patch stages through existing muted native route assert.match(gui,/__arMixStageMainOutputs/); assert.match(gui,/\.arIOMainOutput/); assert.match(gui,/Selection is DRAFT until native APPLY\/ACK/); - assert.match(gui,/internal stereo FX returns/); + assert.match(gui,/AUX1–4 are internal FX returns/); assert.match(monitor,/window\.__arMixStageMainOutputs/); assert.match(monitor,/mainOutputs:draftMainOutputs/); assert.match(monitor,/routingDryApply/); @@ -188,7 +188,7 @@ test('PATCH1 operator-first mono and nonadjacent stereo stage into ONE native tr assert.match(gui,/window\.__arMixOpenAudioIO=openIO/); assert.match(gui,/if\(b\.dataset\.mixPatch==='input'\)openIO\('inputs',channel\)/); assert.match(gui,/matrixPorts\(s,'inputs'\)/); - assert.match(gui,/SAME NATIVE ROUTING/); + assert.match(gui,/ADVANCED · MANUAL INPUT CROSSPOINTS/); assert.match(gui,/A separate Windows capture endpoints cannot be silently combined|Separate Windows capture endpoints cannot be silently combined/); assert.match(css,/\.arIOQuickPatch\{/); assert.match(css,/\.arIOQuickRow\[data-state="draft"\]/); From a77a7b84c19bfaf7fb8ad6f463e2a22171d83890 Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Sun, 1 Nov 2026 10:36:50 +0700 Subject: [PATCH 059/233] test(gui): assert physical MAIN outputs remain separate from internal AUX returns --- tests/mixer_io_smoke.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/mixer_io_smoke.py b/tests/mixer_io_smoke.py index 683ed56d8..694cf7f85 100644 --- a/tests/mixer_io_smoke.py +++ b/tests/mixer_io_smoke.py @@ -401,7 +401,7 @@ async def main(): assert duplicate['ok'] is False and 'different' in duplicate['error'],duplicate assert (await page.evaluate('()=>window.__arMixRouteView().draftMainOutputs'))==[1,0] await page.evaluate('()=>window.__arMixRevertMixerDraft()') - assert "AUX1" in outputs and "not physical" in outputs,outputs + assert "AUX1–4 are internal FX returns, not hardware ports" in outputs,outputs await page.locator('[data-io-tab="device"]').click() await page.evaluate("""() => window.__armixTestEmit('arMixAudioDeviceInventory',{ types:[{name:'ASIO',active:true,inputs:['Mic 1','Mic 2'],outputs:['Out 1','Out 2']}] From 3548084a2e434ed72925367ca64479c61d4f1b55 Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Sun, 1 Nov 2026 10:37:19 +0700 Subject: [PATCH 060/233] fix(gui): offer explicit one-click native-safe MONO repair for invalid stereo L=R on one-pin devices --- web/mixer-io.js | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/web/mixer-io.js b/web/mixer-io.js index f42593899..bb8f4ae26 100644 --- a/web/mixer-io.js +++ b/web/mixer-io.js @@ -969,7 +969,14 @@ stage.disabled=!hardwareReady(s)||r.mode==='BUS'; const stereoInvalid=r.mode==='STEREO'&&(!verified.some(p=>p.port===r.left)|| !verified.some(p=>p.port===r.right)||r.left===r.right); - if(stereoInvalid)row.dataset.state='invalid'; + if(stereoInvalid){ + row.dataset.state='invalid'; + // On a one-pin device, the accepted legacy stereo L=R route cannot + // be usable stereo. Offer ONE explicit native-safe MONO correction. + if(verified.length===1&&verified[0].port===r.left){ + stage.textContent='FIX AS MONO';stage.dataset.ioQuickFix='1'; + } + } action.append(stage,node('small','arIOQuickState',stereoInvalid? 'INVALID STEREO · SELECT DISTINCT L/R':r.mode==='BUS'?'INTERNAL BUS': !s.ready?'NO DEVICE':row.dataset.state==='draft'?'DRAFT · NOT LIVE': @@ -984,7 +991,8 @@ const s=route(),pins=new Set(matrixPorts(s,'inputs')); if(!row||!Number.isInteger(channel)||channel<0||channel>=10||!hardwareReady(s)) return matrixSay('Choose an active driver and wait for any previous APPLY.'); - const mode=row.querySelector('[data-io-quick-mode]').value, + const mode=button.dataset.ioQuickFix==='1'?'MONO': + row.querySelector('[data-io-quick-mode]').value, left=Number(row.querySelector('[data-io-quick-pin="left"]').value), right=Number(row.querySelector('[data-io-quick-pin="right"]').value); if(mode==='MONO'&&!pins.has(left))return matrixSay('CH '+(channel+1)+' · choose a valid mono input.'); From 49a58ab063b2facb9f29f399ebb2092c073cda92 Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Sun, 1 Nov 2026 10:37:34 +0700 Subject: [PATCH 061/233] test(gui): require safe one-click MONO repair through native source commit --- tests/mixer_io_operator_contract_test.mjs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/mixer_io_operator_contract_test.mjs b/tests/mixer_io_operator_contract_test.mjs index 27d108c07..0ca5ded0a 100644 --- a/tests/mixer_io_operator_contract_test.mjs +++ b/tests/mixer_io_operator_contract_test.mjs @@ -586,6 +586,8 @@ test('Audio Setup first-sound workflow keeps hardware and routing distinct',()=> assert.match(gui,/pair\[0\]==='STEREO'&&verified.length<2/); assert.match(gui,/r.left===r.right/); assert.match(gui,/INVALID STEREO · SELECT DISTINCT L\/R/); + assert.match(gui,/stage.textContent='FIX AS MONO'/); + assert.match(gui,/button.dataset.ioQuickFix==='1'\?'MONO'/); assert.match(gui,/function stageQuickInput\(button\)/); assert.match(gui,/commitSourceInOneGesture\(/); assert.match(gui,/arIOSimpleMain/); From a6419abc75d830875aba1c3ae71fb80f8177a76e Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Sun, 1 Nov 2026 10:37:51 +0700 Subject: [PATCH 062/233] build(gui): preserve source parity for single-pin native mono repair --- AR-MIX-Live-FX-Host-Standalone-v0.3.html | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/AR-MIX-Live-FX-Host-Standalone-v0.3.html b/AR-MIX-Live-FX-Host-Standalone-v0.3.html index 69c640316..eb2aee52a 100644 --- a/AR-MIX-Live-FX-Host-Standalone-v0.3.html +++ b/AR-MIX-Live-FX-Host-Standalone-v0.3.html @@ -4723,7 +4723,14 @@ stage.disabled=!hardwareReady(s)||r.mode==='BUS'; const stereoInvalid=r.mode==='STEREO'&&(!verified.some(p=>p.port===r.left)|| !verified.some(p=>p.port===r.right)||r.left===r.right); - if(stereoInvalid)row.dataset.state='invalid'; + if(stereoInvalid){ + row.dataset.state='invalid'; + // On a one-pin device, the accepted legacy stereo L=R route cannot + // be usable stereo. Offer ONE explicit native-safe MONO correction. + if(verified.length===1&&verified[0].port===r.left){ + stage.textContent='FIX AS MONO';stage.dataset.ioQuickFix='1'; + } + } action.append(stage,node('small','arIOQuickState',stereoInvalid? 'INVALID STEREO · SELECT DISTINCT L/R':r.mode==='BUS'?'INTERNAL BUS': !s.ready?'NO DEVICE':row.dataset.state==='draft'?'DRAFT · NOT LIVE': @@ -4738,7 +4745,8 @@ const s=route(),pins=new Set(matrixPorts(s,'inputs')); if(!row||!Number.isInteger(channel)||channel<0||channel>=10||!hardwareReady(s)) return matrixSay('Choose an active driver and wait for any previous APPLY.'); - const mode=row.querySelector('[data-io-quick-mode]').value, + const mode=button.dataset.ioQuickFix==='1'?'MONO': + row.querySelector('[data-io-quick-mode]').value, left=Number(row.querySelector('[data-io-quick-pin="left"]').value), right=Number(row.querySelector('[data-io-quick-pin="right"]').value); if(mode==='MONO'&&!pins.has(left))return matrixSay('CH '+(channel+1)+' · choose a valid mono input.'); From 3da29a0b1dce44c5da6d64d1961993467d9a2349 Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Sun, 1 Nov 2026 10:40:47 +0700 Subject: [PATCH 063/233] test(gui): Playwright one-pin VB-Cable case blocks fake stereo and commits only verified mono native PCM route --- tests/mixer_io_smoke.py | 63 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) diff --git a/tests/mixer_io_smoke.py b/tests/mixer_io_smoke.py index 694cf7f85..9b58fd50b 100644 --- a/tests/mixer_io_smoke.py +++ b/tests/mixer_io_smoke.py @@ -1180,6 +1180,69 @@ async def main(): assert len(armed)==1 and armed[0]['data']['expectedEpoch']==31,armed assert armed[0]['data']['expectedRevision']==3,armed await qp.close() + + # Field screenshot regression: one enabled VB-Cable/recording pin may + # ONLY be selected as mono. Do not fabricate a second R endpoint. + one=await browser.new_page(viewport={"width":1366,"height":768}) + await one.add_init_script("""(() => { + const listeners={}; + window.__armixTestActions=[]; + window.__JUCE__={backend:{ + addEventListener(name,fn){(listeners[name]??=[]).push(fn)}, + emitEvent(name,data){window.__armixTestActions.push({name,data})} + }}; + window.__armixTestEmit=(name,datum)=>(listeners[name]||[]).forEach(fn=>fn(datum)); + })();""") + await one.goto((root/"web/index.html").as_uri()) + await one.evaluate("""() => { + const channels=Array.from({length:10},()=>({ + mode:'NONE',left:-1,right:-1,gain:.25,pan:0,main:true, + mute:false,solo:false,fxId:''})); + const auxes=Array.from({length:4},()=>({ + enabled:false,gain:1,main:true,mute:false,fxId:''})); + const lab={active:true,ready:true,epoch:51,revision:3, + ports:[{port:0,label:'CABLE Output capture pin 1'}], + outputPorts:[0,1], + acceptedRoute:{deviceEpoch:51,channels,auxes,sends:[]}}; + window.__armixTestEmit('arMixStatus',{ + connected:true,directRouteAuthorized:true,driver:'Windows Audio', + rate:48000,buffer:480,monitor:false,masterMute:false, + chainCount:0,dryRoutingLab:lab}); + window.__armixTestEmit('arMixAudioDeviceInventory',{ + currentType:'Windows Audio', + active:{backend:'Windows Audio', + captureDevice:'CABLE Output (VB-Audio Virtual Cable)', + playbackDevice:'Realtek HD Audio 2nd output',open:true, + authorized:true,deviceGeneration:51,enabledInputs:[0], + enabledOutputs:[0,1],inputNames:['CABLE recording'], + outputNames:['Speakers L','Speakers R']}, + types:[{name:'Windows Audio',active:true,separate:true, + inputs:['CABLE Output (VB-Audio Virtual Cable)'], + outputs:['Realtek HD Audio 2nd output']}]}); + }""") + await one.locator('#audioSetupBtn').click() + assert await one.locator('.arIODevicePin').count()==3 + assert 'MONO ONLY' in await one.locator('.arIOPinHeading').inner_text() + assert not await one.locator('.arIODevicePatchMatrix').evaluate('(e)=>e.open') + await one.locator('[data-io-tab="inputs"]').click() + assert await one.locator('[data-io-quick-row]:visible').count()==1 + ch1=one.locator('[data-io-quick-row="0"]') + assert await ch1.locator('[data-io-quick-mode] option[value="STEREO"]').is_disabled() + await ch1.locator('[data-io-quick-mode]').select_option('MONO') + await ch1.locator('[data-io-quick-pin="left"]').select_option('0') + await ch1.locator('[data-io-quick-stage]').click() + sent=await one.evaluate("""() => window.__armixTestActions.filter( + x=>x.name==='arMixAction'&&x.data.action==='routingDryApply')""") + assert len(sent)==1,sent + assert sent[0]['data']['value']['channels'][0]['mode']=='MONO',sent + assert sent[0]['data']['value']['channels'][0]['left']==0,sent + assert sent[0]['data']['value']['channels'][0]['right']==-1,sent + # A pending routing command does not claim input PCM, MAIN sound, or + # output ARM. These require native acceptance and capture telemetry. + assert not await one.evaluate("""() => window.__armixTestActions.some( + x=>x.data?.action==='monitor'&&x.data.value===true)""") + await one.screenshot(path='audio-setup-one-pin-1366.png') + await one.close() await browser.close() print("PASS: G1/G2 + G3 real PRE/POST draft, AUX return, 0-gain bypass, native ACK/reject/revert, stable rack and 3 viewports") From 2c40467be2f3d43d02ffec912a4c048ebb47cf4c Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Sun, 1 Nov 2026 10:41:01 +0700 Subject: [PATCH 064/233] ci(gui): retain screenshot evidence for one-pin native audio routing test --- .github/workflows/ui-smoke.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ui-smoke.yml b/.github/workflows/ui-smoke.yml index fed263b4c..627c36c6b 100644 --- a/.github/workflows/ui-smoke.yml +++ b/.github/workflows/ui-smoke.yml @@ -98,6 +98,7 @@ jobs: with: name: arsonmix-gui-baseline-smoke path: | + audio-setup-one-pin-1366.png operator-console-v6-1680-900.png operator-console-v6-1366-768.png native-orbit-ui-review.png From 9f49efc4624825870b3718f2d28edb30134847aa Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Sun, 1 Nov 2026 10:49:20 +0700 Subject: [PATCH 065/233] feat(gui): make one native-owned CONSOLE the default with direct IN, MAIN OUT, FX and SEND per strip --- web/mixer-io.js | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/web/mixer-io.js b/web/mixer-io.js index bb8f4ae26..e1f1b38c4 100644 --- a/web/mixer-io.js +++ b/web/mixer-io.js @@ -6,7 +6,7 @@ const mixer=document.getElementById('mixer'); const host=document.querySelector('.workbench'); if(!mixer||!host)return; - let mode='FX', lastStatus={}, deviceInventory=null, ioTab='device', lastSignature='', focusedInput=0; + let mode='CONSOLE', lastStatus={}, deviceInventory=null, ioTab='device', lastSignature='', focusedInput=0; let monitorSendsExpanded=false; // DEVICE1: staged selections are UI-only; only positive native ACK changes active hardware. let deviceDraft=null,deviceBusy=false,deviceNote='',deviceRequest='',deviceRequestSeq=0,lastDeviceRefresh=0,lastDeviceRescan=0,applyMutePending=false,applyAfterDevice=null,applyBaseEpoch=0; @@ -254,7 +254,7 @@ 'MAIN → HW '+(out[0]+1)+'/'+(out[1]+1):'MAIN → NO HW OUTPUT'; }; const toolbar=node('div','arMixerBankBar'); - toolbar.innerHTML='
NO HARDWARE · PREVIEW
'; + toolbar.innerHTML='
NO HARDWARE · PREVIEW
'; host.insertBefore(toolbar,mixer); // One genuinely selected-channel journey, NOT another DSP or source registry. // Four compact steps show ACKNOWLEDGED state, never stage a hidden graph. @@ -769,7 +769,7 @@ window.__arMixOpenAudioIO=openIO; function closeIO(){overlay.hidden=true;matrixDraft.clear();matrixSide.clear();matrixMessage='';} function setMode(next){ - if(!['FX','ROUTE','SENDS'].includes(next))return; + if(!['CONSOLE','FX','ROUTE','SENDS'].includes(next))return; if(next!=='SENDS'&&sofBus>=0)leaveSof(); mode=next;mixer.dataset.ioMode=mode; toolbar.querySelectorAll('[data-mix-mode]').forEach(b=>{const selected=b.dataset.mixMode===mode;b.classList.toggle('active',selected);b.setAttribute('aria-pressed',String(selected));}); @@ -788,7 +788,7 @@ } if(strip.querySelector('.arChannelBank'))continue; const bank=node('div','arChannelBank'); - bank.innerHTML='
INPUT SOURCE · NATIVEOUTPUT DESTINATIONMAIN · UNKNOWN
NATIVE PATCH REQUIRED
AUX SENDS · PRE / POST
'; + bank.innerHTML='
INPUT SOURCE · NATIVEOUTPUT DESTINATION
NATIVE PATCH REQUIRED
AUX SENDS · PRE / POST
'; strip.querySelector('.rack')?.insertAdjacentElement('afterend',bank); } } @@ -828,7 +828,7 @@ const dirty=current!==valueFor(accepted)||channelFormat(r)!==channelFormat(accepted); const stage=strip.querySelector('.arBankStage'); const sourcePending=quickSourcePending?.channel===i&&quickSourcePending.epoch===s.epoch; - stage.textContent=!s.ready?'NO LIVE DEVICE':sourcePending?'PENDING · NATIVE ACK':dirty?'DRAFT · NOT APPLIED':r.mode==='NONE'?'UNPATCHED · SILENT':'LIVE · NATIVE ACK'; + stage.textContent=!s.ready?'NO VERIFIED DEVICE':sourcePending?'PENDING · NATIVE ACK':dirty?'DRAFT · NOT APPLIED':r.mode==='NONE'?'UNPATCHED · NO INPUT':'ROUTE ACK · PCM UNVERIFIED'; stage.dataset.state=!s.ready?'offline':sourcePending?'draft':dirty?'draft':r.mode==='NONE'?'offline':'live'; // Four native AUX destinations are always visible, even when empty. // Render only after a topology change, never on meter telemetry. @@ -1766,7 +1766,9 @@ if(!route().ready)openIO('device'); else openSourceChooser(index); } else if(step==='fx'){ - setMode('FX'); + // CONSOLE is the single visible operator workflow; classic layers are + // retained only as an advanced compatibility/diagnostics view. + setMode('CONSOLE'); if(typeof chooseChannel==='function')chooseChannel(index); strip?.querySelector('.rack')?.scrollIntoView?.({block:'nearest',inline:'nearest'}); } else if(step==='sends'){ @@ -1939,6 +1941,7 @@ e.preventDefault();e.stopImmediatePropagation(); const strip=b.closest('[data-strip]'),channel=Number(strip?.dataset.strip)||0; if(b.dataset.mixPatch==='input')openIO('inputs',channel); + else if(b.dataset.mixPatch==='output')openIO('outputs',channel); else window.__arMixOpenChannelPatch?.(channel,b.dataset.mixPatch); return; } From 5fed40e55eede1343bdf404cd3b3a897298e586a Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Sun, 1 Nov 2026 10:49:58 +0700 Subject: [PATCH 066/233] feat(gui): read-only pinned MAIN physical output status and direct native patch action --- web/mixer-io.js | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/web/mixer-io.js b/web/mixer-io.js index e1f1b38c4..9e8f47f5b 100644 --- a/web/mixer-io.js +++ b/web/mixer-io.js @@ -869,6 +869,28 @@ if(info.textContent!==caption)info.textContent=caption; toolbar.querySelector('[data-mix-apply]').disabled=!isNative()||!s.ready||!!s.pending||(!overlay.hidden&&matrixDraft.size>0); for(const strip of mixer.querySelectorAll('.strip[data-strip]'))refreshStrip(strip,s); + // Read-only pinned MAIN route. Reattach on master DOM regeneration but + // do not alter its fader, meters, FX, callback or native router. + const master=mixer.querySelector('#masterLeft'); + if(master){ + let summary=master.querySelector('.arMainOutSummary'); + if(!summary){ + summary=node('div','arMainOutSummary'); + summary.setAttribute('aria-label','Accepted physical MAIN routing'); + const heading=node('span','arMainOutHeading','MAIN OUT · NATIVE'); + const output=node('button','arMainOutAction'); + output.type='button';output.dataset.mixPatch='output'; + output.dataset.master='1';output.title='Configure physical MAIN L/R (native ACK)'; + summary.append(heading,output); + master.querySelector('.master-ch-id')?.insertAdjacentElement('afterend',summary); + } + const output=summary.querySelector('.arMainOutAction'); + if(output){ + const next=outputLabel(s); + if(output.textContent!==next)output.textContent=next; + output.disabled=!isNative()||!s.ready; + } + } if(!overlay.hidden)refreshIO(); if(!sendEditor.hidden)drawSendEditor(); sofRefresh(s); From cdc09cc163cf2072403f78e30a7612139a9a8a73 Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Sun, 1 Nov 2026 10:50:51 +0700 Subject: [PATCH 067/233] style(gui): replace segmented M4 view with unified compact native strip console and pinned MAIN --- web/mixer-layout.css | 309 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 309 insertions(+) diff --git a/web/mixer-layout.css b/web/mixer-layout.css index bd71157cb..6d6dc1a7d 100644 --- a/web/mixer-layout.css +++ b/web/mixer-layout.css @@ -439,3 +439,312 @@ #app .arV6FxSlot[draggable="true"]{cursor:grab} #app .arV6FxSlot[draggable="true"]:active{cursor:grabbing} #app .arV6PluginChoice{width:100%;max-width:100%;min-height:23px} + + +/* ARSONMIX M4 UNIFIED OPERATOR CONSOLE — real WebView2 / JUCE path. + Single native-source view: IN -> M/ST -> FX -> AUX SEND -> MAIN -> FADER. + The existing mixer-io.js + monitor.js keep exclusive routing authority. + Zero CSS filter blur, large glow, transformed hover layers or extra canvas. */ +#app #mixer[data-io-mode="CONSOLE"]{ + align-items:stretch; + background:#0c1720; + scroll-snap-type:x proximity; +} +#app #mixer[data-io-mode="CONSOLE"] > .strip[data-strip]{ + flex:0 0 146px;min-width:146px;max-width:146px; + display:flex;min-height:0;height:100%; + border-right:1px solid #334b58; + background:linear-gradient(90deg,#162631,#263741 8%,#22313c 88%,#152630); + box-shadow:inset 1px 0 #718a9938; + scroll-snap-align:start; +} +#app #mixer[data-io-mode="CONSOLE"] > .strip[data-strip].selected{ + background:linear-gradient(90deg,#233e4b,#29424f 8%,#233845 88%,#152f3b); + box-shadow:inset 2px 0 #52d4ee; +} +#app #mixer[data-io-mode="CONSOLE"] > .strip[data-strip] > .ch-id{ + order:0;height:32px;min-height:32px;flex:0 0 32px; + font:600 13px/1 "Segoe UI",sans-serif; + justify-content:space-between;padding:0 9px; + background:linear-gradient(180deg,color-mix(in srgb,var(--ch) 34%,#2d404c),#172a35); + border-top:2px solid var(--ch);border-bottom:1px solid #3d5662; + text-shadow:none; +} +#app #mixer[data-io-mode="CONSOLE"] > .strip[data-strip] .arChannelQuickInput{ + display:none!important; +} +#app #mixer[data-io-mode="CONSOLE"] > .strip[data-strip] > .arChannelBank{ + order:1;display:flex!important;flex-direction:column; + flex:0 0 148px;height:148px;min-height:148px; + padding:5px 7px 4px;gap:4px; + background:linear-gradient(#142631,#152934); + border-bottom:1px solid #3b5460;overflow:hidden; +} +#app #mixer[data-io-mode="CONSOLE"] .arChannelBank .arRouteBank{ + display:grid!important;flex:0 0 79px;min-height:79px; + grid-template-columns:26px minmax(0,1fr); + grid-template-rows:24px 24px 24px; + gap:2px 4px;align-items:center;min-width:0; +} +#app #mixer[data-io-mode="CONSOLE"] .arChannelBank .arRouteBank > .arBankTitle{ + display:block;min-width:0;margin:0;line-height:1.1; + white-space:nowrap;overflow:hidden; + font:600 9px/1 "Segoe UI",sans-serif;color:#84b2c4; +} +#app #mixer[data-io-mode="CONSOLE"] .arChannelBank .arRouteBank > .arBankTitle:first-child{ + grid-column:1;grid-row:1;font-size:0; +} +#app #mixer[data-io-mode="CONSOLE"] .arChannelBank .arRouteBank > .arBankTitle:first-child::before{ + content:"IN";font:600 9px "Segoe UI",sans-serif; +} +#app #mixer[data-io-mode="CONSOLE"] .arChannelBank .arRouteBank > .arBankTitle:nth-of-type(2){ + grid-column:1;grid-row:2;font-size:0; +} +#app #mixer[data-io-mode="CONSOLE"] .arChannelBank .arRouteBank > .arBankTitle:nth-of-type(2)::before{ + content:"OUT";font:600 9px "Segoe UI",sans-serif; +} +#app #mixer[data-io-mode="CONSOLE"] .arChannelBank .arBankSource{ + grid-column:2;grid-row:1; + height:23px;min-height:23px;width:100%; + padding:2px 4px;font:10px/1.1 "Segoe UI",sans-serif; + border:1px solid #4e7282;border-radius:2px; + background:#091d28;color:#d0e6ef; +} +#app #mixer[data-io-mode="CONSOLE"] .arChannelBank .arBankOutput{ + grid-column:2;grid-row:2; + display:block;height:23px;min-height:23px;width:100%; + padding:3px 5px;text-align:left;white-space:nowrap;text-overflow:ellipsis; + border:1px solid #3c6271;border-radius:2px; + background:#142d39;color:#afd3df; + font:10px/1.1 "Segoe UI",sans-serif;cursor:pointer; +} +#app #mixer[data-io-mode="CONSOLE"] .arChannelBank .arBankOutput:hover{ + background:#1c3b4b; +} +#app #mixer[data-io-mode="CONSOLE"] .arChannelBank .arBankFormatRow{ + grid-column:1/-1;grid-row:3; + height:24px;min-height:24px;display:flex;align-items:center;gap:5px; + justify-content:space-between;overflow:hidden; +} +#app #mixer[data-io-mode="CONSOLE"] .arChannelBank .arBankChannelFormat{ + flex:0 0 60px;width:60px;max-width:60px;min-width:0; + min-height:21px;height:21px;padding:1px 3px; + background:#0c222e;border:1px solid #436777;color:#bcdbe5; + font:9px "Segoe UI",sans-serif; +} +#app #mixer[data-io-mode="CONSOLE"] .arChannelBank .arBankStage{ + display:block;min-width:0;flex:1 1 auto; + font:8px/1.1 "Segoe UI",sans-serif;white-space:nowrap; + text-align:right;overflow:hidden;text-overflow:ellipsis; +} +#app #mixer[data-io-mode="CONSOLE"] .arChannelBank .arRouteBank > .arBankPatch{ + display:none!important; +} +#app #mixer[data-io-mode="CONSOLE"] .arChannelBank .arSendBank{ + display:flex!important;flex:1 1 0;min-height:0; + flex-direction:column;gap:3px;overflow:hidden; + border-top:1px solid #355361;padding-top:4px; +} +#app #mixer[data-io-mode="CONSOLE"] .arChannelBank .arSendBank > .arBankTitle{ + flex:0 0 10px;display:block;font:600 9px/1 "Segoe UI",sans-serif; + color:#8ebccd; +} +#app #mixer[data-io-mode="CONSOLE"] .arChannelBank .arSendSummary{ + display:grid;grid-template-columns:repeat(2,minmax(0,1fr)); + grid-template-rows:repeat(2,20px);gap:2px;min-width:0;min-height:42px; +} +#app #mixer[data-io-mode="CONSOLE"] .arChannelBank .arSendChip{ + display:flex;align-items:center;gap:3px;min-width:0; + width:100%;height:20px;min-height:20px; + padding:2px 3px;border:1px solid #426474; + background:#152c37;border-radius:2px;font:9px/1 "Segoe UI",sans-serif; + overflow:hidden;text-overflow:ellipsis;white-space:nowrap; +} +#app #mixer[data-io-mode="CONSOLE"] .arChannelBank .arSendChip .arSendDest{ + font:600 8px/1 "Segoe UI",sans-serif;min-width:0;flex:none; +} +#app #mixer[data-io-mode="CONSOLE"] .arChannelBank .arSendBank > .arBankPatch{ + display:none!important; +} +#app #mixer[data-io-mode="CONSOLE"] > .strip[data-strip] > .rack{ + order:2;display:flex!important;flex:0 0 112px;height:112px;min-height:112px; + flex-direction:column;gap:3px;padding:6px 5px 4px; + overflow-x:hidden;overflow-y:auto;scrollbar-width:thin; + scrollbar-color:#456b7b #11242e; + border-bottom:1px solid #385460;background:#0f202b; +} +#app #mixer[data-io-mode="CONSOLE"] .rack .insert-slot{ + height:23px;min-height:23px;flex:0 0 23px; +} +#app #mixer[data-io-mode="CONSOLE"] .rack .insert{ + height:23px;min-height:23px; + font:10px/1 "Segoe UI",sans-serif; + border-color:#304b5b;box-shadow:none; + background:linear-gradient(#263c49,#122833); +} +#app #mixer[data-io-mode="CONSOLE"] .rack .insert.empty{ + border:1px dashed #315365;color:#70bdd1; +} +#app #mixer[data-io-mode="CONSOLE"] .rack .fx-power{ + width:23px;min-width:23px;height:23px;min-height:23px; + box-shadow:none;text-shadow:none;transition:none; +} +#app #mixer[data-io-mode="CONSOLE"] > .strip[data-strip] > .strip-controls{ + order:3;flex:0 0 78px;height:78px;min-height:78px; + padding:0;border-bottom:1px solid #324e5a; + background:#223440; +} +#app #mixer[data-io-mode="CONSOLE"] .strip-controls > .trim-row, +#app #mixer[data-io-mode="CONSOLE"] .strip-controls > .knob{ + display:none!important; +} +#app #mixer[data-io-mode="CONSOLE"] .strip-controls .pan-control{ + height:37px;min-height:37px;flex:0 0 37px; +} +#app #mixer[data-io-mode="CONSOLE"] .strip-controls .utility-row{ + height:31px;min-height:31px;flex:0 0 31px; + margin:0!important;padding:2px 6px; +} +#app #mixer[data-io-mode="CONSOLE"] > .strip[data-strip] > .channel-actions{ + order:4;height:35px;flex:0 0 35px;min-height:35px; + padding:3px 6px;gap:4px; +} +#app #mixer[data-io-mode="CONSOLE"] .channel-actions > button{ + height:27px!important;min-height:27px!important; +} +#app #mixer[data-io-mode="CONSOLE"] > .strip[data-strip] > .db-display{ + order:5;height:24px;flex:0 0 24px; + font:600 11px/1 Consolas,monospace;text-shadow:none; + color:#75cce4;background:#152934; +} +#app #mixer[data-io-mode="CONSOLE"] > .strip[data-strip] > .fader-zone{ + order:6;flex:1 1 auto;min-height:100px;overflow:hidden; +} +#app #mixer[data-io-mode="CONSOLE"] > .strip[data-strip] > .strip-name{ + order:7;height:44px;flex:0 0 44px;gap:3px; + font:600 11px/1 "Segoe UI",sans-serif;text-shadow:none; + background:linear-gradient(110deg,color-mix(in srgb,var(--ch) 45%,#101d26),#142936); +} +#app #mixer[data-io-mode="CONSOLE"] > .strip[data-strip] > .strip-name .track-icon{ + font-size:13px;line-height:14px; +} +#app #mixer[data-io-mode="CONSOLE"] > #masterLeft{ + flex:0 0 155px;min-width:155px;max-width:155px; + height:100%;position:sticky;right:0;z-index:3; + background:#293845;border-left:2px solid #a17f8b; + box-shadow:-5px 0 12px #06131a; +} +#app #mixer[data-io-mode="CONSOLE"] #masterLeft .master-ch-id{ + height:32px;flex:0 0 32px;min-height:32px; + font:600 12px "Segoe UI",sans-serif; +} +#app #mixer[data-io-mode="CONSOLE"] #masterLeft .arMainOutSummary{ + height:80px;min-height:80px;flex:0 0 80px; + display:flex;flex-direction:column;gap:8px;align-items:stretch; + padding:10px 8px;background:#19303c; + border-bottom:1px solid #3e6171; +} +#app #mixer[data-io-mode="CONSOLE"] #masterLeft .arMainOutHeading{ + font:600 9px/1 "Segoe UI",sans-serif;color:#a1c5d1; +} +#app #mixer[data-io-mode="CONSOLE"] #masterLeft .arMainOutAction{ + height:31px;min-height:31px;max-width:100%;overflow:hidden; + white-space:nowrap;text-overflow:ellipsis; + padding:3px 5px;border-radius:3px;border:1px solid #567583; + background:#203d4b;color:#e3ecf1; + font:10px/1.2 "Segoe UI",sans-serif;text-align:left; +} +#app #mixer[data-io-mode="CONSOLE"] #masterLeft .arMainOutAction:disabled{opacity:.48} +#app #mixer[data-io-mode="CONSOLE"] #masterLeft .master-fx-rack{ + flex:0 0 180px;height:180px;min-height:180px; + background:#152832; +} +#app #mixer[data-io-mode="CONSOLE"] #masterLeft .master-fx-slot{ + height:23px;min-height:23px;flex:0 0 23px; +} +#app #mixer[data-io-mode="CONSOLE"] #masterLeft .master-controls-zone{ + flex:0 0 78px;height:78px;min-height:78px; +} +#app #mixer[data-io-mode="CONSOLE"] #masterLeft .master-analysis{ + height:33px;min-height:33px;flex:0 0 33px;margin:2px 0; + overflow:hidden;padding:2px 5px; +} +#app #mixer[data-io-mode="CONSOLE"] #masterLeft .master-analysis .master-info-kicker{display:none} +#app #mixer[data-io-mode="CONSOLE"] #masterLeft .master-analysis .master-info-row{ + margin:0;font-size:8px;line-height:12px; +} +#app #mixer[data-io-mode="CONSOLE"] #masterLeft .master-pan-wrap{ + height:40px;min-height:40px;flex:0 0 40px; +} +#app #mixer[data-io-mode="CONSOLE"] #masterLeft .master-actions{ + height:35px;min-height:35px;flex:0 0 35px; +} +#app #mixer[data-io-mode="CONSOLE"] #masterLeft .master-db-display{ + height:24px;min-height:24px;flex:0 0 24px; +} +#app #mixer[data-io-mode="CONSOLE"] #masterLeft .master-fader-zone{ + flex:1 1 0;min-height:100px; +} +#app #mixer[data-io-mode="CONSOLE"] #masterLeft .master-strip-name{ + height:44px;min-height:44px;flex:0 0 44px; +} +#app .arRailModeSection .arMixerBankBar{ + height:auto;min-height:0;padding:5px;display:flex;flex-direction:column; + gap:5px;background:#14242d; +} +#app .arRailModeSection .arMixerBankModes{ + display:grid;grid-template-columns:1fr repeat(3,minmax(0,25px)); + width:100%;gap:2px; +} +#app .arRailModeSection .arMixerBankModes [data-mix-mode="CONSOLE"]{ + min-width:0;width:100%;background:#25495b;color:#d7eff7; + border-color:#547c8c;font-size:9px;padding:0 3px;letter-spacing:0; +} +#app .arRailModeSection .arMixerBankModes [data-mix-mode="CONSOLE"].active{ + background:#3b8695;color:#fff;border-color:#68b1bb; +} +#app .arRailModeSection .arMixerBankModes [data-mix-mode]:not([data-mix-mode="CONSOLE"]){ + width:25px;min-width:25px;padding:0; + font:600 8px "Segoe UI",sans-serif;letter-spacing:-.15px; +} +#app .arRailModeSection .arMixerBankBar .arMixApply{display:none} +#app .arRailModeSection .arMixerBankBar .arMixIoOpen{ + width:100%;height:30px;flex:none; +} +#app .arChannelSignalFlow{height:29px;min-height:29px;flex:0 0 29px} +#app .arChannelSignalFlow [data-focus-step]{ + font-size:9px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis; +} +/* Four-layer engineering modes are retained for exact regression and + advanced work; the one-console mode is the M4 first-sound default. */ +@media(max-height:770px){ + #app #mixer[data-io-mode="CONSOLE"] > .strip[data-strip] > .arChannelBank{ + flex-basis:132px;height:132px;min-height:132px;padding-top:3px; + } + #app #mixer[data-io-mode="CONSOLE"] .arChannelBank .arRouteBank{ + flex-basis:70px;min-height:70px;grid-template-rows:21px 21px 22px; + } + #app #mixer[data-io-mode="CONSOLE"] .arChannelBank .arSendSummary{ + grid-template-rows:repeat(2,18px);min-height:38px; + } + #app #mixer[data-io-mode="CONSOLE"] .arChannelBank .arSendChip{ + height:18px;min-height:18px; + } + #app #mixer[data-io-mode="CONSOLE"] > .strip[data-strip] > .rack{ + flex-basis:96px;height:96px;min-height:96px; + } + #app #mixer[data-io-mode="CONSOLE"] #masterLeft .arMainOutSummary{ + flex-basis:73px;height:73px;min-height:73px; + } + #app #mixer[data-io-mode="CONSOLE"] #masterLeft .master-fx-rack{ + flex-basis:155px;height:155px;min-height:155px; + } +} +@media(max-width:1250px){ + #app #mixer[data-io-mode="CONSOLE"] > .strip[data-strip]{ + flex-basis:136px;min-width:136px;max-width:136px; + } + #app #mixer[data-io-mode="CONSOLE"] > #masterLeft{ + flex-basis:148px;min-width:148px;max-width:148px; + } +} From 9663b3ea20271535dcf5b1732f2e1547d0cf6fa3 Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Sun, 1 Nov 2026 10:51:55 +0700 Subject: [PATCH 068/233] test(gui): require actual M4 unified native console and screen-visible pinned MAIN on bank scroll --- tests/mixer_io_smoke.py | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/tests/mixer_io_smoke.py b/tests/mixer_io_smoke.py index 9b58fd50b..a2482b43c 100644 --- a/tests/mixer_io_smoke.py +++ b/tests/mixer_io_smoke.py @@ -22,6 +22,32 @@ async def main(): await page.goto((root/"web/index.html").as_uri()) assert await page.locator("#mixer .rack").count()==10 assert await page.locator("#mixer .arChannelBank").count()==10 + # The REAL M4 host, not the future v6 demo, opens one console: + # actual native selectors, six VST3 slots and four AUX controls + # coexist in every input strip without FX/ROUTE/SENDS switching. + assert await page.locator('#mixer').get_attribute('data-io-mode')=='CONSOLE' + assert await page.locator('[data-mix-mode="CONSOLE"]').get_attribute('aria-pressed')=='true' + assert await page.locator('#mixer .arBankSource:visible').count()==10 + assert await page.locator('#mixer .arBankOutput:visible').count()==10 + assert await page.locator('#mixer .rack .insert-slot').count()==60 + assert await page.locator('#mixer .arSendBank:visible').count()==10 + await page.screenshot(path='mixer-m4-unified-1366.png') + # Main is visually pinned during navigation across the 10 real strips. + # Do not accept a CSS "sticky" label if its pixels are offscreen. + main_geom=await page.evaluate("""() => { + const mixer=document.querySelector('#mixer'); + const master=document.querySelector('#masterLeft'); + const start=master.getBoundingClientRect(); + const frame=mixer.getBoundingClientRect(); + mixer.scrollLeft=99999; + const end=master.getBoundingClientRect(); + mixer.scrollLeft=0; + return {left:start.left,right:start.right,endLeft:end.left,endRight:end.right, + frameRight:frame.right,frameLeft:frame.left}; + }""") + assert main_geom['right']<=main_geom['frameRight']+2,main_geom + assert main_geom['left']>=main_geom['frameLeft']-2,main_geom + assert abs(main_geom['right']-main_geom['endRight'])<2,main_geom assert await page.locator('.arChannelSignalFlow [data-focus-step]').count()==4 assert 'NO NATIVE ACK' in await page.locator('[data-focus-source]').inner_text() assert await page.locator("[data-mix-mode]").count()==3 From 142192cc24fc5c27e7a0bda39368e669f05bbde6 Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Sun, 1 Nov 2026 10:52:07 +0700 Subject: [PATCH 069/233] ci(gui): capture true M4 unified console and pinned-master viewport evidence --- .github/workflows/ui-smoke.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ui-smoke.yml b/.github/workflows/ui-smoke.yml index 627c36c6b..c409a9998 100644 --- a/.github/workflows/ui-smoke.yml +++ b/.github/workflows/ui-smoke.yml @@ -98,6 +98,7 @@ jobs: with: name: arsonmix-gui-baseline-smoke path: | + mixer-m4-unified-1366.png audio-setup-one-pin-1366.png operator-console-v6-1680-900.png operator-console-v6-1366-768.png From 015474caaa79360b803b1c3ff1947fd7df5037d1 Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Sun, 1 Nov 2026 10:52:30 +0700 Subject: [PATCH 070/233] build(gui): exact standalone parity for actual M4 unified console and native source/main controls --- AR-MIX-Live-FX-Host-Standalone-v0.3.html | 346 ++++++++++++++++++++++- 1 file changed, 340 insertions(+), 6 deletions(-) diff --git a/AR-MIX-Live-FX-Host-Standalone-v0.3.html b/AR-MIX-Live-FX-Host-Standalone-v0.3.html index eb2aee52a..5ef8f46f9 100644 --- a/AR-MIX-Live-FX-Host-Standalone-v0.3.html +++ b/AR-MIX-Live-FX-Host-Standalone-v0.3.html @@ -1890,6 +1890,315 @@ #app .arV6FxSlot[draggable="true"]{cursor:grab} #app .arV6FxSlot[draggable="true"]:active{cursor:grabbing} #app .arV6PluginChoice{width:100%;max-width:100%;min-height:23px} + + +/* ARSONMIX M4 UNIFIED OPERATOR CONSOLE — real WebView2 / JUCE path. + Single native-source view: IN -> M/ST -> FX -> AUX SEND -> MAIN -> FADER. + The existing mixer-io.js + monitor.js keep exclusive routing authority. + Zero CSS filter blur, large glow, transformed hover layers or extra canvas. */ +#app #mixer[data-io-mode="CONSOLE"]{ + align-items:stretch; + background:#0c1720; + scroll-snap-type:x proximity; +} +#app #mixer[data-io-mode="CONSOLE"] > .strip[data-strip]{ + flex:0 0 146px;min-width:146px;max-width:146px; + display:flex;min-height:0;height:100%; + border-right:1px solid #334b58; + background:linear-gradient(90deg,#162631,#263741 8%,#22313c 88%,#152630); + box-shadow:inset 1px 0 #718a9938; + scroll-snap-align:start; +} +#app #mixer[data-io-mode="CONSOLE"] > .strip[data-strip].selected{ + background:linear-gradient(90deg,#233e4b,#29424f 8%,#233845 88%,#152f3b); + box-shadow:inset 2px 0 #52d4ee; +} +#app #mixer[data-io-mode="CONSOLE"] > .strip[data-strip] > .ch-id{ + order:0;height:32px;min-height:32px;flex:0 0 32px; + font:600 13px/1 "Segoe UI",sans-serif; + justify-content:space-between;padding:0 9px; + background:linear-gradient(180deg,color-mix(in srgb,var(--ch) 34%,#2d404c),#172a35); + border-top:2px solid var(--ch);border-bottom:1px solid #3d5662; + text-shadow:none; +} +#app #mixer[data-io-mode="CONSOLE"] > .strip[data-strip] .arChannelQuickInput{ + display:none!important; +} +#app #mixer[data-io-mode="CONSOLE"] > .strip[data-strip] > .arChannelBank{ + order:1;display:flex!important;flex-direction:column; + flex:0 0 148px;height:148px;min-height:148px; + padding:5px 7px 4px;gap:4px; + background:linear-gradient(#142631,#152934); + border-bottom:1px solid #3b5460;overflow:hidden; +} +#app #mixer[data-io-mode="CONSOLE"] .arChannelBank .arRouteBank{ + display:grid!important;flex:0 0 79px;min-height:79px; + grid-template-columns:26px minmax(0,1fr); + grid-template-rows:24px 24px 24px; + gap:2px 4px;align-items:center;min-width:0; +} +#app #mixer[data-io-mode="CONSOLE"] .arChannelBank .arRouteBank > .arBankTitle{ + display:block;min-width:0;margin:0;line-height:1.1; + white-space:nowrap;overflow:hidden; + font:600 9px/1 "Segoe UI",sans-serif;color:#84b2c4; +} +#app #mixer[data-io-mode="CONSOLE"] .arChannelBank .arRouteBank > .arBankTitle:first-child{ + grid-column:1;grid-row:1;font-size:0; +} +#app #mixer[data-io-mode="CONSOLE"] .arChannelBank .arRouteBank > .arBankTitle:first-child::before{ + content:"IN";font:600 9px "Segoe UI",sans-serif; +} +#app #mixer[data-io-mode="CONSOLE"] .arChannelBank .arRouteBank > .arBankTitle:nth-of-type(2){ + grid-column:1;grid-row:2;font-size:0; +} +#app #mixer[data-io-mode="CONSOLE"] .arChannelBank .arRouteBank > .arBankTitle:nth-of-type(2)::before{ + content:"OUT";font:600 9px "Segoe UI",sans-serif; +} +#app #mixer[data-io-mode="CONSOLE"] .arChannelBank .arBankSource{ + grid-column:2;grid-row:1; + height:23px;min-height:23px;width:100%; + padding:2px 4px;font:10px/1.1 "Segoe UI",sans-serif; + border:1px solid #4e7282;border-radius:2px; + background:#091d28;color:#d0e6ef; +} +#app #mixer[data-io-mode="CONSOLE"] .arChannelBank .arBankOutput{ + grid-column:2;grid-row:2; + display:block;height:23px;min-height:23px;width:100%; + padding:3px 5px;text-align:left;white-space:nowrap;text-overflow:ellipsis; + border:1px solid #3c6271;border-radius:2px; + background:#142d39;color:#afd3df; + font:10px/1.1 "Segoe UI",sans-serif;cursor:pointer; +} +#app #mixer[data-io-mode="CONSOLE"] .arChannelBank .arBankOutput:hover{ + background:#1c3b4b; +} +#app #mixer[data-io-mode="CONSOLE"] .arChannelBank .arBankFormatRow{ + grid-column:1/-1;grid-row:3; + height:24px;min-height:24px;display:flex;align-items:center;gap:5px; + justify-content:space-between;overflow:hidden; +} +#app #mixer[data-io-mode="CONSOLE"] .arChannelBank .arBankChannelFormat{ + flex:0 0 60px;width:60px;max-width:60px;min-width:0; + min-height:21px;height:21px;padding:1px 3px; + background:#0c222e;border:1px solid #436777;color:#bcdbe5; + font:9px "Segoe UI",sans-serif; +} +#app #mixer[data-io-mode="CONSOLE"] .arChannelBank .arBankStage{ + display:block;min-width:0;flex:1 1 auto; + font:8px/1.1 "Segoe UI",sans-serif;white-space:nowrap; + text-align:right;overflow:hidden;text-overflow:ellipsis; +} +#app #mixer[data-io-mode="CONSOLE"] .arChannelBank .arRouteBank > .arBankPatch{ + display:none!important; +} +#app #mixer[data-io-mode="CONSOLE"] .arChannelBank .arSendBank{ + display:flex!important;flex:1 1 0;min-height:0; + flex-direction:column;gap:3px;overflow:hidden; + border-top:1px solid #355361;padding-top:4px; +} +#app #mixer[data-io-mode="CONSOLE"] .arChannelBank .arSendBank > .arBankTitle{ + flex:0 0 10px;display:block;font:600 9px/1 "Segoe UI",sans-serif; + color:#8ebccd; +} +#app #mixer[data-io-mode="CONSOLE"] .arChannelBank .arSendSummary{ + display:grid;grid-template-columns:repeat(2,minmax(0,1fr)); + grid-template-rows:repeat(2,20px);gap:2px;min-width:0;min-height:42px; +} +#app #mixer[data-io-mode="CONSOLE"] .arChannelBank .arSendChip{ + display:flex;align-items:center;gap:3px;min-width:0; + width:100%;height:20px;min-height:20px; + padding:2px 3px;border:1px solid #426474; + background:#152c37;border-radius:2px;font:9px/1 "Segoe UI",sans-serif; + overflow:hidden;text-overflow:ellipsis;white-space:nowrap; +} +#app #mixer[data-io-mode="CONSOLE"] .arChannelBank .arSendChip .arSendDest{ + font:600 8px/1 "Segoe UI",sans-serif;min-width:0;flex:none; +} +#app #mixer[data-io-mode="CONSOLE"] .arChannelBank .arSendBank > .arBankPatch{ + display:none!important; +} +#app #mixer[data-io-mode="CONSOLE"] > .strip[data-strip] > .rack{ + order:2;display:flex!important;flex:0 0 112px;height:112px;min-height:112px; + flex-direction:column;gap:3px;padding:6px 5px 4px; + overflow-x:hidden;overflow-y:auto;scrollbar-width:thin; + scrollbar-color:#456b7b #11242e; + border-bottom:1px solid #385460;background:#0f202b; +} +#app #mixer[data-io-mode="CONSOLE"] .rack .insert-slot{ + height:23px;min-height:23px;flex:0 0 23px; +} +#app #mixer[data-io-mode="CONSOLE"] .rack .insert{ + height:23px;min-height:23px; + font:10px/1 "Segoe UI",sans-serif; + border-color:#304b5b;box-shadow:none; + background:linear-gradient(#263c49,#122833); +} +#app #mixer[data-io-mode="CONSOLE"] .rack .insert.empty{ + border:1px dashed #315365;color:#70bdd1; +} +#app #mixer[data-io-mode="CONSOLE"] .rack .fx-power{ + width:23px;min-width:23px;height:23px;min-height:23px; + box-shadow:none;text-shadow:none;transition:none; +} +#app #mixer[data-io-mode="CONSOLE"] > .strip[data-strip] > .strip-controls{ + order:3;flex:0 0 78px;height:78px;min-height:78px; + padding:0;border-bottom:1px solid #324e5a; + background:#223440; +} +#app #mixer[data-io-mode="CONSOLE"] .strip-controls > .trim-row, +#app #mixer[data-io-mode="CONSOLE"] .strip-controls > .knob{ + display:none!important; +} +#app #mixer[data-io-mode="CONSOLE"] .strip-controls .pan-control{ + height:37px;min-height:37px;flex:0 0 37px; +} +#app #mixer[data-io-mode="CONSOLE"] .strip-controls .utility-row{ + height:31px;min-height:31px;flex:0 0 31px; + margin:0!important;padding:2px 6px; +} +#app #mixer[data-io-mode="CONSOLE"] > .strip[data-strip] > .channel-actions{ + order:4;height:35px;flex:0 0 35px;min-height:35px; + padding:3px 6px;gap:4px; +} +#app #mixer[data-io-mode="CONSOLE"] .channel-actions > button{ + height:27px!important;min-height:27px!important; +} +#app #mixer[data-io-mode="CONSOLE"] > .strip[data-strip] > .db-display{ + order:5;height:24px;flex:0 0 24px; + font:600 11px/1 Consolas,monospace;text-shadow:none; + color:#75cce4;background:#152934; +} +#app #mixer[data-io-mode="CONSOLE"] > .strip[data-strip] > .fader-zone{ + order:6;flex:1 1 auto;min-height:100px;overflow:hidden; +} +#app #mixer[data-io-mode="CONSOLE"] > .strip[data-strip] > .strip-name{ + order:7;height:44px;flex:0 0 44px;gap:3px; + font:600 11px/1 "Segoe UI",sans-serif;text-shadow:none; + background:linear-gradient(110deg,color-mix(in srgb,var(--ch) 45%,#101d26),#142936); +} +#app #mixer[data-io-mode="CONSOLE"] > .strip[data-strip] > .strip-name .track-icon{ + font-size:13px;line-height:14px; +} +#app #mixer[data-io-mode="CONSOLE"] > #masterLeft{ + flex:0 0 155px;min-width:155px;max-width:155px; + height:100%;position:sticky;right:0;z-index:3; + background:#293845;border-left:2px solid #a17f8b; + box-shadow:-5px 0 12px #06131a; +} +#app #mixer[data-io-mode="CONSOLE"] #masterLeft .master-ch-id{ + height:32px;flex:0 0 32px;min-height:32px; + font:600 12px "Segoe UI",sans-serif; +} +#app #mixer[data-io-mode="CONSOLE"] #masterLeft .arMainOutSummary{ + height:80px;min-height:80px;flex:0 0 80px; + display:flex;flex-direction:column;gap:8px;align-items:stretch; + padding:10px 8px;background:#19303c; + border-bottom:1px solid #3e6171; +} +#app #mixer[data-io-mode="CONSOLE"] #masterLeft .arMainOutHeading{ + font:600 9px/1 "Segoe UI",sans-serif;color:#a1c5d1; +} +#app #mixer[data-io-mode="CONSOLE"] #masterLeft .arMainOutAction{ + height:31px;min-height:31px;max-width:100%;overflow:hidden; + white-space:nowrap;text-overflow:ellipsis; + padding:3px 5px;border-radius:3px;border:1px solid #567583; + background:#203d4b;color:#e3ecf1; + font:10px/1.2 "Segoe UI",sans-serif;text-align:left; +} +#app #mixer[data-io-mode="CONSOLE"] #masterLeft .arMainOutAction:disabled{opacity:.48} +#app #mixer[data-io-mode="CONSOLE"] #masterLeft .master-fx-rack{ + flex:0 0 180px;height:180px;min-height:180px; + background:#152832; +} +#app #mixer[data-io-mode="CONSOLE"] #masterLeft .master-fx-slot{ + height:23px;min-height:23px;flex:0 0 23px; +} +#app #mixer[data-io-mode="CONSOLE"] #masterLeft .master-controls-zone{ + flex:0 0 78px;height:78px;min-height:78px; +} +#app #mixer[data-io-mode="CONSOLE"] #masterLeft .master-analysis{ + height:33px;min-height:33px;flex:0 0 33px;margin:2px 0; + overflow:hidden;padding:2px 5px; +} +#app #mixer[data-io-mode="CONSOLE"] #masterLeft .master-analysis .master-info-kicker{display:none} +#app #mixer[data-io-mode="CONSOLE"] #masterLeft .master-analysis .master-info-row{ + margin:0;font-size:8px;line-height:12px; +} +#app #mixer[data-io-mode="CONSOLE"] #masterLeft .master-pan-wrap{ + height:40px;min-height:40px;flex:0 0 40px; +} +#app #mixer[data-io-mode="CONSOLE"] #masterLeft .master-actions{ + height:35px;min-height:35px;flex:0 0 35px; +} +#app #mixer[data-io-mode="CONSOLE"] #masterLeft .master-db-display{ + height:24px;min-height:24px;flex:0 0 24px; +} +#app #mixer[data-io-mode="CONSOLE"] #masterLeft .master-fader-zone{ + flex:1 1 0;min-height:100px; +} +#app #mixer[data-io-mode="CONSOLE"] #masterLeft .master-strip-name{ + height:44px;min-height:44px;flex:0 0 44px; +} +#app .arRailModeSection .arMixerBankBar{ + height:auto;min-height:0;padding:5px;display:flex;flex-direction:column; + gap:5px;background:#14242d; +} +#app .arRailModeSection .arMixerBankModes{ + display:grid;grid-template-columns:1fr repeat(3,minmax(0,25px)); + width:100%;gap:2px; +} +#app .arRailModeSection .arMixerBankModes [data-mix-mode="CONSOLE"]{ + min-width:0;width:100%;background:#25495b;color:#d7eff7; + border-color:#547c8c;font-size:9px;padding:0 3px;letter-spacing:0; +} +#app .arRailModeSection .arMixerBankModes [data-mix-mode="CONSOLE"].active{ + background:#3b8695;color:#fff;border-color:#68b1bb; +} +#app .arRailModeSection .arMixerBankModes [data-mix-mode]:not([data-mix-mode="CONSOLE"]){ + width:25px;min-width:25px;padding:0; + font:600 8px "Segoe UI",sans-serif;letter-spacing:-.15px; +} +#app .arRailModeSection .arMixerBankBar .arMixApply{display:none} +#app .arRailModeSection .arMixerBankBar .arMixIoOpen{ + width:100%;height:30px;flex:none; +} +#app .arChannelSignalFlow{height:29px;min-height:29px;flex:0 0 29px} +#app .arChannelSignalFlow [data-focus-step]{ + font-size:9px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis; +} +/* Four-layer engineering modes are retained for exact regression and + advanced work; the one-console mode is the M4 first-sound default. */ +@media(max-height:770px){ + #app #mixer[data-io-mode="CONSOLE"] > .strip[data-strip] > .arChannelBank{ + flex-basis:132px;height:132px;min-height:132px;padding-top:3px; + } + #app #mixer[data-io-mode="CONSOLE"] .arChannelBank .arRouteBank{ + flex-basis:70px;min-height:70px;grid-template-rows:21px 21px 22px; + } + #app #mixer[data-io-mode="CONSOLE"] .arChannelBank .arSendSummary{ + grid-template-rows:repeat(2,18px);min-height:38px; + } + #app #mixer[data-io-mode="CONSOLE"] .arChannelBank .arSendChip{ + height:18px;min-height:18px; + } + #app #mixer[data-io-mode="CONSOLE"] > .strip[data-strip] > .rack{ + flex-basis:96px;height:96px;min-height:96px; + } + #app #mixer[data-io-mode="CONSOLE"] #masterLeft .arMainOutSummary{ + flex-basis:73px;height:73px;min-height:73px; + } + #app #mixer[data-io-mode="CONSOLE"] #masterLeft .master-fx-rack{ + flex-basis:155px;height:155px;min-height:155px; + } +} +@media(max-width:1250px){ + #app #mixer[data-io-mode="CONSOLE"] > .strip[data-strip]{ + flex-basis:136px;min-width:136px;max-width:136px; + } + #app #mixer[data-io-mode="CONSOLE"] > #masterLeft{ + flex-basis:148px;min-width:148px;max-width:148px; + } +}
@@ -4335,10 +4392,16 @@ return section; } + // Only an ACKed physical MAIN pair is a MAIN route. Available output pins + // are merely inventory, never proof that a route has been selected. const outputLabel=s=>{ - const out=s.mainOutputs?.length===2?s.mainOutputs:s.outputPorts||[]; - return s.ready&&Number.isInteger(out[0])&&Number.isInteger(out[1])? - 'MAIN → HW '+(out[0]+1)+'/'+(out[1]+1):'MAIN → NO HW OUTPUT'; + const out=s.mainOutputs,enabled=new Set(s.outputPorts||[]); + if(!s.ready)return 'MAIN → NO DEVICE'; + if(!Array.isArray(out)||out.length!==2)return 'MAIN → UNPATCHED'; + if(!Number.isInteger(out[0])||!Number.isInteger(out[1])|| + out[0]===out[1]||!enabled.has(out[0])||!enabled.has(out[1])) + return 'MAIN → INVALID L/R'; + return 'MAIN → HW '+(out[0]+1)+'/'+(out[1]+1); }; const toolbar=node('div','arMixerBankBar'); toolbar.innerHTML='
NO HARDWARE · PREVIEW
'; @@ -4915,8 +4978,22 @@ const dirty=current!==valueFor(accepted)||channelFormat(r)!==channelFormat(accepted); const stage=strip.querySelector('.arBankStage'); const sourcePending=quickSourcePending?.channel===i&&quickSourcePending.epoch===s.epoch; - stage.textContent=!s.ready?'NO VERIFIED DEVICE':sourcePending?'PENDING · NATIVE ACK':dirty?'DRAFT · NOT APPLIED':r.mode==='NONE'?'UNPATCHED · NO INPUT':'ROUTE ACK · PCM UNVERIFIED'; - stage.dataset.state=!s.ready?'offline':sourcePending?'draft':dirty?'draft':r.mode==='NONE'?'offline':'live'; + const verified=new Set(portList(s).map(p=>p.port)); + const validInput=r.mode==='NONE'|| + (r.mode==='MONO'&&verified.has(r.left)&&r.right===-1)|| + (r.mode==='STEREO'&&r.left!==r.right&&verified.has(r.left)&&verified.has(r.right)); + const acceptedValid=!accepted||accepted.mode==='NONE'|| + (accepted.mode==='MONO'&&verified.has(accepted.left)&&accepted.right===-1)|| + (accepted.mode==='STEREO'&&accepted.left!==accepted.right&&verified.has(accepted.left)&&verified.has(accepted.right)); + // Source is real hardware, processing M/ST is independent. A restored + // invalid legacy alias is NEVER 'ACK/LIVE', even after a native route ACK. + stage.textContent=!s.ready?'NO VERIFIED DEVICE': + sourcePending?'PENDING · NATIVE ACK': + (!validInput||!acceptedValid)?'INVALID PHYSICAL INPUT · RE-PATCH': + dirty?'DRAFT · NOT APPLIED':r.mode==='NONE'?'UNPATCHED · NO INPUT': + 'ROUTE ACK · PCM UNVERIFIED'; + stage.dataset.state=!s.ready?'offline':sourcePending||dirty?'draft': + (!validInput||!acceptedValid)?'invalid':r.mode==='NONE'?'offline':'ack'; // Four native AUX destinations are always visible, even when empty. // Render only after a topology change, never on meter telemetry. const slots=Array.from({length:4},(_,bus)=>{ @@ -5587,7 +5664,14 @@ const matrixSection=node('details','arIODevicePatchMatrix'); matrixSection.open=deviceMatrixOpen; - matrixSection.addEventListener('toggle',()=>{deviceMatrixOpen=matrixSection.open;}); + matrixSection.addEventListener('toggle',()=>{ + if(deviceMatrixOpen!==matrixSection.open){ + deviceMatrixOpen=matrixSection.open; + // Expensive crosspoints are constructed on demand, never just hidden + // behind CSS while a 12Hz native readback refreshes the device panel. + lastSignature='';refreshIO(); + } + }); const heading=node('summary','arIODeviceMatrixHeading'); heading.appendChild(node('strong','','ADVANCED · HARDWARE PORT MATRIX (OPTIONAL)')); const tabs=node('div','arIODeviceMatrixSwitch'); @@ -5598,6 +5682,12 @@ tabs.appendChild(b); } heading.appendChild(tabs);matrixSection.appendChild(heading); + if(!deviceMatrixOpen){ + matrixSection.appendChild(node('p','arIODeviceMatrixEmpty', + 'Optional engineering crosspoints. Open only for advanced pin patching.')); + body.appendChild(matrixSection); + return; + } const live=!!d&&deviceSameEndpoint(d)&&a.authorized!==false; const s=route(); if(deviceMatrixWaitEpoch!==null&&s.epoch!==deviceMatrixWaitEpoch&&s.ready&&s.active) @@ -6446,10 +6536,24 @@ let draggingFx=null; // Numeric decimal wire identifiers are required by integration/ConsoleNativeContractV6.h. // Never downcast native 64-bit ChannelId, device epoch, or graph revision. - const decimal=v=>typeof v==='string'&&/^(0|[1-9][0-9]*)$/.test(v)? - v:(Number.isSafeInteger(v)&&v>=0?String(v):null); + // Wire uint64 identities are canonical decimal STRINGS, not JS numbers. + // Reject overflow and noncanonical aliases before BigInt comparisons. + const decimal=v=>typeof v==='string'&&/^(0|[1-9][0-9]*)$/.test(v)&& + BigInt(v)<=18446744073709551615n?v:null; const ge=(a,b)=>a!==null&&b!==null&&BigInt(a)>=BigInt(b); - const instance='v6'; + // A reconnect must not replay the prior editor's request IDs. Retain a + // single session prefix for this WebView lifetime; each new WebView gets + // a cryptographically random prefix when secure randomness is available. + const instance=(()=>{ + const bytes=new Uint8Array(16); + try{ + window.crypto.getRandomValues(bytes); + return 'gui-'+Array.from(bytes,b=>b.toString(16).padStart(2,'0')).join(''); + }catch{ + return 'gui-'+Date.now().toString(36)+'-'+ + Math.random().toString(36).slice(2,14); + } + })(); let feedback=''; const root=h('section','arV6Console');root.id='arV6Console'; root.setAttribute('aria-label','ArSonMix universal operator console'); @@ -6518,7 +6622,7 @@ } function sendIntent(op,id,payload){ if(!can(op,id)){showFeedback('UNAVAILABLE · Native capability or channel authorization missing');return false} - const requestId=String(++requestSeq); + const requestId=instance+':'+String(++requestSeq); const command={requestId,deviceEpoch:accepted.device.epoch, baseGraphRevision:accepted.graph.revision, baseRosterRevision:accepted.graph.rosterRevision, @@ -6567,7 +6671,7 @@ const ids=new Set(); for(const c of s.graph.channels){ // JS numeric conversion corrupts 64-bit identities: reject such a wire. - if(!c||typeof c.id!=='string'||!c.id||ids.has(c.id))return false; + if(!c||decimal(c.id)===null||ids.has(c.id))return false; ids.add(c.id); } return true; From 9a5908710793924fc1cdf720cbdc0a89aaabc1fe Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Sun, 1 Nov 2026 11:31:10 +0700 Subject: [PATCH 101/233] test(gui): await demand-mounted matrix after native details toggle; ensure closed state creates zero cells --- tests/mixer_io_smoke.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/mixer_io_smoke.py b/tests/mixer_io_smoke.py index 1aa828c5d..fcc48ae12 100644 --- a/tests/mixer_io_smoke.py +++ b/tests/mixer_io_smoke.py @@ -308,9 +308,14 @@ async def main(): assert await page.locator('.arIODeviceDriverButton[aria-pressed="true"]').inner_text()=='ASIO' assert await page.locator('.arIODevicePatchMatrix').is_visible() assert not await page.locator('.arIODevicePatchMatrix').evaluate('(e)=>e.open') + # No large software-input / crosspoint DOM until explicitly requested. + assert await page.locator('.arIODevicePatchMatrix .arIOMatrixCell').count()==0 assert await page.locator('.arIODevicePins').is_visible() await page.locator('.arIODevicePatchMatrix > summary').click() assert await page.locator('.arIODevicePatchMatrix').evaluate('(e)=>e.open') + # Details toggle is asynchronous; rendering the costly matrix only + # AFTER toggle is intentional, not a race to be hidden by time.sleep. + await page.locator('.arIODevicePatchMatrix .arIOMatrixCell').first.wait_for(state='visible') assert await page.locator('.arIODevicePatchMatrix .arIOMatrixCell').count()>0 # FAST3 source one-gesture has already completed an ARM ACK above. # This separate DEVICE APPLY must produce ONE new guarded arm, not From bfc5eb38a7a167e4598c13886b3014ef22d8b73a Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Sun, 1 Nov 2026 11:33:04 +0700 Subject: [PATCH 102/233] feat(release-v7): require actual SHA-verified native PCM/ACK/ZIP/hardware files and full live graph for promotion --- docs/CONSOLE_V6_FAT_EVIDENCE_GATE_20261101.md | 6 + scripts/console_v6_fat_gate.mjs | 123 +++++++++++++++--- tests/console_v6_fat_gate_test.mjs | 115 ++++++++++++++-- 3 files changed, 216 insertions(+), 28 deletions(-) diff --git a/docs/CONSOLE_V6_FAT_EVIDENCE_GATE_20261101.md b/docs/CONSOLE_V6_FAT_EVIDENCE_GATE_20261101.md index 8967ab001..e865d5933 100644 --- a/docs/CONSOLE_V6_FAT_EVIDENCE_GATE_20261101.md +++ b/docs/CONSOLE_V6_FAT_EVIDENCE_GATE_20261101.md @@ -29,3 +29,9 @@ Do not promote until ENGINE migrates occupied CH1 vendor VST/editor/Orbit, other ## Field FAT milestone — packaged collector A verified Windows FAT artifact includes `ArSonMix-Hardware-FAT.ps1` bound to the package manifest by `fatCollectorSha256`; the release verifier also checks its ZIP entry bytes. `Verify`, `Start`, `Stop`, and `Summary` actions record actual operator-timed OUTPUT_ONLY_TONE, CAPTURE_ONLY and >=30-minute wired DRY_THROUGH_0FX into `FAT_RUNS.json`, with diagnostic report SHA-256; `FAT_SUMMARY.json` always sets `hardwareCertified=false`. This is a field record, not acoustic telemetry or an app-controlled audio test. Do not use old ZIPs without this built-in collector; their original FIRST SOUND guide still applies. All device/route/ARM control remains native and manual. The script never tries to load a VST, set a device or authorize output. + + +## G3 release evidence hardening — real files, one source SHA +The v7 \`release\` action now requires \`artifacts:{zip,nativeTrace,nativePcm,hardwareReport}\` as four safe **basenames** under the extracted local evidence directory, hashes **each real file**, compares their actual SHA-256 to \`artifactSha256\`, \`traceSha256\`, \`pcmSha256\` and \`hardware.fullReportSha256\`, and validates the EXE bytes against \`BUILD_PROVENANCE.json\`. ZIP magic is a fast sanity check only: \`scripts/verify_native_windows_artifact.ps1\` remains the independent full ZIP-entry and embedded BinaryData verifier. All provenance/CIs must refer to **the same exact source SHA**; GitHub workflow status itself still must be independently checked (this CLI does not call GitHub). + +The trace file MUST be schema v2 WebView native ACK/PCM state with \`provenance:{kind:"NATIVE_JUCE",sourceSha:"...",producer:"JUCE_WEBVIEW"}\`, and its last accepted native snapshot must advertise **actual** ChannelId production callback, vendor FX/Show/pin-admission, dynamic CH11+, GROUP, FX_RETURN, MONITOR, physically armed output, and live raw/MAIN/MONITOR telemetry. PCM JSON must have the existing four golden PCM cases plus \`provenance:{kind:"NATIVE_JUCE",sourceSha:"...",producer:"JUCE_CALLBACK"}\`. For any missing producer field, **G3 fails closed until ENGINE actually exports it**: never fill the gap with fabricated or manually edited data. An attacker could forge text labels or binary fixture files; therefore native CTest, source-checked real JUCE publisher, Windows package verifier, CI run evidence, and independent human hardware FAT remain separate mandatory checks. The structural unit tests explicitly use fabricated fixture bytes and their expected final result is always \`certified:false\`. This script NEVER authorizes or starts a customer UAT. diff --git a/scripts/console_v6_fat_gate.mjs b/scripts/console_v6_fat_gate.mjs index 2bcbccc33..fcebd16b4 100644 --- a/scripts/console_v6_fat_gate.mjs +++ b/scripts/console_v6_fat_gate.mjs @@ -183,25 +183,116 @@ export function checkPcm(p){ must(required.every(k=>seen.has(k)),'missing PCM cases: '+required.filter(k=>!seen.has(k)).join(',')); return {pcmCases:seen.size,note:'numerical evidence only; synthetic fixtures are not live hardware proof'}; } +// Gate G3: release evidence must be the ACTUAL files, not plausible-looking +// 64-character claims. Still cannot authenticate CI results or human hearing. +const bundleFile=(dist,name,label)=>{ + must(typeof name==='string'&&name.length>0&&name.length<=140&& + /^[A-Za-z0-9][A-Za-z0-9._-]*$/.test(name)&&!name.includes('..'), + label+': use one safe basename inside the distribution directory'); + return join(dist,name); +}; +const verifiedHash=(p,expected,label)=>{ + must(is64(expected),label+': SHA-256 digest required'); + must(hash(p)===expected,label+': actual file SHA-256 mismatch'); +}; export function checkRelease(r,dist){ must(is40(r?.sourceSha),'release: exact source SHA required'); - must(r.nativeCI?.sourceSha===r.sourceSha&&r.nativeCI?.conclusion==='success','release: same-source Windows CI PASS required'); - must(r.chromiumCI?.sourceSha===r.sourceSha&&r.chromiumCI?.conclusion==='success','release: same-source Chromium CI PASS required'); - for(const ci of [r.nativeCI,r.chromiumCI])must(/^https:\/\/github\.com\/masarray\/arsonmix\/actions\/runs\/[0-9]+$/.test(ci.url||''),'release: GitHub CI run URL required'); - const m=json(join(dist,'BUILD_PROVENANCE.json')); - must(m.sourceCommit===r.sourceSha,'release: package sourceCommit mismatches exact CI SHA'); - must(m.fatStatus==='EXPERIMENTAL_NOT_HARDWARE_QUALIFIED','release: package cannot self-certify hardware'); - must(m.peMachine==='AMD64 (0x8664)'&&m.peSubsystem==='WINDOWS_GUI (2)'&&m.webView2LoaderMode==='JUCE_WEBVIEW2_LOADER_STATIC_LINKED_V1','release: Windows x64 GUI/WebView2 provenance missing'); - must(is64(m.exeSha256)&&m.exeSha256===hash(join(dist,m.executable)),'release: EXE SHA-256 does not match actual packaged bytes'); - must(r.exeSha256===m.exeSha256,'release: evidence EXE SHA mismatch'); - must(r.nativeCTest==='PASS'&&r.chromiumPlaywright==='PASS'&&r.windowsVerifier==='PASS','release: existing CTest/Chromium/package verifier proof missing'); - must(is64(r.artifactSha256)&&is64(r.traceSha256)&&is64(r.pcmSha256),'release: ZIP/trace/PCM evidence digests required'); + must(r.nativeCI?.sourceSha===r.sourceSha&&r.nativeCI?.conclusion==='success', + 'release: same-source Windows CI PASS required'); + must(r.chromiumCI?.sourceSha===r.sourceSha&&r.chromiumCI?.conclusion==='success', + 'release: same-source Chromium CI PASS required'); + for(const ci of [r.nativeCI,r.chromiumCI]) + must(/^https:\/\/github\.com\/masarray\/arsonmix\/actions\/runs\/[0-9]+$/.test(ci.url||''), + 'release: GitHub CI run URL required'); + must(r.nativeCTest==='PASS'&&r.chromiumPlaywright==='PASS'&& + r.windowsVerifier==='PASS', + 'release: CTest, Playwright and real Windows package verification required'); + const folder=resolve(dist); + const m=json(join(folder,'BUILD_PROVENANCE.json')); + must(m.sourceCommit===r.sourceSha,'release: packaged sourceCommit mismatches exact CI SHA'); + must(m.fatStatus==='EXPERIMENTAL_NOT_HARDWARE_QUALIFIED', + 'release: package cannot self-certify hardware'); + must(m.peMachine==='AMD64 (0x8664)'&&m.peSubsystem==='WINDOWS_GUI (2)'&& + m.webView2LoaderMode==='JUCE_WEBVIEW2_LOADER_STATIC_LINKED_V1', + 'release: Windows x64 GUI/WebView2 provenance missing'); + const exePath=bundleFile(folder,m.executable,'release exe path'); + must(is64(m.exeSha256),'release: manifest EXE SHA missing'); + verifiedHash(exePath,m.exeSha256,'release EXE'); + must(r.exeSha256===m.exeSha256,'release: EXE evidence digest mismatch'); + const artifacts=r.artifacts; + must(artifacts&&typeof artifacts==='object','release: actual evidence filenames required'); + const names=['zip','nativeTrace','nativePcm','hardwareReport']; + const namesSeen=new Set(); + const files={}; + for(const name of names){ + const file=artifacts[name]; + files[name]=bundleFile(folder,file,'release '+name); + must(!namesSeen.has(file)&&file!==m.executable&&file!=='BUILD_PROVENANCE.json', + 'release: distinct real evidence files required'); + namesSeen.add(file); + } + verifiedHash(files.zip,r.artifactSha256,'release ZIP'); + verifiedHash(files.nativeTrace,r.traceSha256,'release native ACK trace'); + verifiedHash(files.nativePcm,r.pcmSha256,'release native PCM samples'); + const zipBytes=readFileSync(files.zip); + must(zipBytes.length>=4&&zipBytes[0]===0x50&&zipBytes[1]===0x4b&& + zipBytes[2]===0x03&&zipBytes[3]===0x04, + 'release: artifact must be a ZIP; full contents verified by Windows PowerShell verifier'); + const trace=json(files.nativeTrace),pcm=json(files.nativePcm); + must(trace.provenance?.kind==='NATIVE_JUCE'&& + trace.provenance.sourceSha===r.sourceSha&& + trace.provenance.producer==='JUCE_WEBVIEW', + 'release: native WebView producer evidence required; SYNTHETIC not eligible'); + const verifiedTrace=checkTrace(trace); + must(verifiedTrace.provenance==='NATIVE_JUCE', + 'release: cannot qualify synthetic trace'); + must(pcm.provenance?.kind==='NATIVE_JUCE'&& + pcm.provenance.sourceSha===r.sourceSha&& + pcm.provenance.producer==='JUCE_CALLBACK', + 'release: actual JUCE callback PCM provenance required; SYNTHETIC not eligible'); + const verifiedPcm=checkPcm(pcm); + // Native graph admission gate: the final accepted runtime snapshot must + // expose the real universal roster, routes and live capabilities. + const finalEvent=trace.events[trace.events.length-1]; + must(finalEvent?.event==='arMixConsoleSnapshot', + 'release: no final accepted native snapshot'); + const s=finalEvent.payload,caps=s.graph.capabilities; + must(s.productionCallbackLive===true&& + caps.callbackOwnsChannelIds===true&& + caps.fullVendorFxMigration===true&&caps.showAndOutputParity===true&& + caps.physicalCaptureMapped===true&&caps.dynamicChannels===true&& + caps.groups===true&&caps.fxReturns===true&&caps.monitor===true, + 'release: full production ChannelId/VST/Show/physical output capabilities not LIVE'); + const roles=s.graph.channels.map(x=>x.role); + for(const role of ['GROUP','FX_RETURN','MONITOR','MAIN']) + must(roles.includes(role),'release: missing live '+role+' channel'); + must(roles.filter(x=>x==='INPUT').length>=11, + 'release: CH11 native callback not present'); + must(s.device.outputArmed===true&& + s.telemetry.rawCapturePresent===true&& + s.telemetry.mainPcmPresent===true&& + s.telemetry.monitorPcmPresent===true, + 'release: real raw/MAIN/MONITOR PCM and physical output arm required'); const h=r.hardware; - must(h&&h.issue===15&&h.status==='PENDING_HUMAN_REVIEW','release: issue #15 physical review must remain open'); - must(h.backend&&h.sampleRate>0&&h.bufferFrames>0&&Array.isArray(h.inputPins)&&h.inputPins.length>0&&Array.isArray(h.outputPins)&&h.outputPins.length>0&&h.wired===true&&h.testDurationSeconds>=1800,'release: wired 0FX physical 30min evidence required'); - must(h.outputOnlyTone==='RECORDED'&&h.captureOnly==='RECORDED'&&h.dry0Fx==='RECORDED'&&is64(h.fullReportSha256),'release: OUTPUT_ONLY_TONE, CAPTURE_ONLY, 0FX and full report required'); - must(h.verifiedHumanWitness===true&&typeof h.witnessId==='string'&&h.witnessId.length>=3,'release: human witness review required'); - return {stage:'EVIDENCE_INTAKE_COMPLETE__ACOUSTIC_REVIEW_REQUIRED',certified:false,sourceSha:r.sourceSha,exeSha256:m.exeSha256}; + must(h&&h.issue===15&&h.status==='PENDING_HUMAN_REVIEW', + 'release: hardware issue #15 must stay under human review'); + must(h.backend&&h.sampleRate>0&&h.bufferFrames>0&& + Array.isArray(h.inputPins)&&h.inputPins.length>0&& + Array.isArray(h.outputPins)&&h.outputPins.length>0&& + h.wired===true&&h.testDurationSeconds>=1800, + 'release: wired 0FX physical 30min evidence required'); + must(h.outputOnlyTone==='RECORDED'&&h.captureOnly==='RECORDED'&& + h.dry0Fx==='RECORDED'&&is64(h.fullReportSha256), + 'release: OUTPUT_ONLY_TONE, CAPTURE_ONLY, 0FX and full report required'); + verifiedHash(files.hardwareReport,h.fullReportSha256,'release hardware report'); + must(h.verifiedHumanWitness===true&& + typeof h.witnessId==='string'&&h.witnessId.length>=3, + 'release: independent human witness required'); + return {stage:'EVIDENCE_INTAKE_COMPLETE__ACOUSTIC_REVIEW_REQUIRED', + certified:false,sourceSha:r.sourceSha,exeSha256:m.exeSha256, + pcmCases:verifiedPcm.pcmCases,ackEvents:verifiedTrace.acceptedCommands+ + verifiedTrace.rejectedCommands, + evidenceFilesHashed:names.length}; } if(process.argv[1]&&import.meta.url===pathToFileURL(resolve(process.argv[1])).href){ try{ diff --git a/tests/console_v6_fat_gate_test.mjs b/tests/console_v6_fat_gate_test.mjs index 75f5cbe5b..af0bdae50 100644 --- a/tests/console_v6_fat_gate_test.mjs +++ b/tests/console_v6_fat_gate_test.mjs @@ -95,17 +95,108 @@ test('MONITOR distinct device destination and independent mute; MASTER silence', const b=pcm();b.cases[2].samples.mainAfterMonitorMute=zero(dry);assert.throws(()=>checkPcm(b),/cannot change MAIN/); const c=pcm();c.cases[3].samples.mainAfterMute=dry;assert.throws(()=>checkPcm(c),/MASTER mute/); }); -test('exact SHA Windows+Chromium CI, EXE hash, manual 0FX 30-minute gate',()=>{ +test('exact-source full native evidence rejects forged digest, mock PCM, missing live roles and 0FX report',()=>{ const dir=mkdtempSync(join(tmpdir(),'arsonmix-fat-')); - try{ - const exe=Buffer.from('SYNTHETIC EXE HASH FIXTURE');const h=createHash('sha256').update(exe).digest('hex'),sha='a'.repeat(40); - writeFileSync(join(dir,'test.exe'),exe); - writeFileSync(join(dir,'BUILD_PROVENANCE.json'),JSON.stringify({sourceCommit:sha,executable:'test.exe',exeSha256:h,fatStatus:'EXPERIMENTAL_NOT_HARDWARE_QUALIFIED',peMachine:'AMD64 (0x8664)',peSubsystem:'WINDOWS_GUI (2)',webView2LoaderMode:'JUCE_WEBVIEW2_LOADER_STATIC_LINKED_V1'})); - const r={sourceSha:sha,nativeCI:{sourceSha:sha,conclusion:'success',url:'https://github.com/masarray/arsonmix/actions/runs/123'},chromiumCI:{sourceSha:sha,conclusion:'success',url:'https://github.com/masarray/arsonmix/actions/runs/124'},exeSha256:h,artifactSha256:h,traceSha256:h,pcmSha256:h,nativeCTest:'PASS',chromiumPlaywright:'PASS',windowsVerifier:'PASS',hardware:{issue:15,status:'PENDING_HUMAN_REVIEW',wired:true,backend:'ASIO',sampleRate:48000,bufferFrames:480,inputPins:[0],outputPins:[0,1],testDurationSeconds:1800,outputOnlyTone:'RECORDED',captureOnly:'RECORDED',dry0Fx:'RECORDED',fullReportSha256:h,verifiedHumanWitness:true,witnessId:'operator1'}}; - assert.equal(checkRelease(r,dir).certified,false); - const stale=copy(r);stale.chromiumCI.sourceSha='b'.repeat(40);assert.throws(()=>checkRelease(stale,dir),/Chromium CI/); - const tampered=copy(r);tampered.exeSha256='f'.repeat(64);assert.throws(()=>checkRelease(tampered,dir),/EXE SHA mismatch/); - const short=copy(r);short.hardware.testDurationSeconds=1799;assert.throws(()=>checkRelease(short,dir),/30min/); - const noOperator=copy(r);noOperator.hardware.verifiedHumanWitness=false;assert.throws(()=>checkRelease(noOperator,dir),/human witness/); - }finally{rmSync(dir,{recursive:true,force:true})} + try { + const sha='a'.repeat(40); + const hashBytes=data=>createHash('sha256').update(data).digest('hex'); + const persist=(file,data)=>{ + const bytes=Buffer.isBuffer(data)?data:Buffer.from(typeof data==='string'?data:JSON.stringify(data)); + writeFileSync(join(dir,file),bytes); + return hashBytes(bytes); + }; + const exeHash=persist('console.exe','EXE FIXTURE ONLY'); + persist('BUILD_PROVENANCE.json',{ + sourceCommit:sha,executable:'console.exe',exeSha256:exeHash, + fatStatus:'EXPERIMENTAL_NOT_HARDWARE_QUALIFIED', + peMachine:'AMD64 (0x8664)',peSubsystem:'WINDOWS_GUI (2)', + webView2LoaderMode:'JUCE_WEBVIEW2_LOADER_STATIC_LINKED_V1'}); + const traceFixture=trace(); + traceFixture.provenance={kind:'NATIVE_JUCE',sourceSha:sha,producer:'JUCE_WEBVIEW'}; + const liveCaps={ + callbackOwnsChannelIds:true,fullVendorFxMigration:true, + showAndOutputParity:true,physicalCaptureMapped:true,dynamicChannels:true, + groups:true,fxReturns:true,monitor:true, + supportedOps:['SET_FADER','SET_SOURCE']}; + const channels=Array.from({length:11},(_,i)=>({ + id:String(i+1),role:'INPUT',source:{physicalPins:[i%2]}})); + channels.push(...[ + {id:'50',role:'GROUP'}, {id:'51',role:'FX_RETURN'}, + {id:'52',role:'MONITOR'}, {id:'53',role:'MAIN'}]); + for(const item of traceFixture.events){ + if(item.event!=='arMixConsoleSnapshot')continue; + item.payload.productionCallbackLive=true; + item.payload.device.outputArmed=true; + item.payload.graph.capabilities=liveCaps; + item.payload.graph.channels=channels; + item.payload.telemetry={ + rawCapturePresent:true,mainPcmPresent:true,monitorPcmPresent:true}; + } + const pcmFixture=pcm(); + pcmFixture.provenance={kind:'NATIVE_JUCE',sourceSha:sha,producer:'JUCE_CALLBACK'}; + const archiveHash=persist('release.zip',Buffer.from('PK\x03\x04synthetic-zip-header-only')); + const traceHash=persist('trace.json',traceFixture); + const pcmHash=persist('pcm.json',pcmFixture); + const reportHash=persist('audio-report.txt','SYNTHETIC HARDWARE QA TEST FIXTURE — NOT AUDIO CERTIFICATION'); + const record={ + sourceSha:sha,exeSha256:exeHash, + nativeCI:{sourceSha:sha,conclusion:'success',url:'https://github.com/masarray/arsonmix/actions/runs/123'}, + chromiumCI:{sourceSha:sha,conclusion:'success',url:'https://github.com/masarray/arsonmix/actions/runs/124'}, + nativeCTest:'PASS',chromiumPlaywright:'PASS',windowsVerifier:'PASS', + artifactSha256:archiveHash,traceSha256:traceHash,pcmSha256:pcmHash, + artifacts:{zip:'release.zip',nativeTrace:'trace.json',nativePcm:'pcm.json', + hardwareReport:'audio-report.txt'}, + hardware:{issue:15,status:'PENDING_HUMAN_REVIEW',wired:true, + backend:'ASIO',sampleRate:48000,bufferFrames:480,inputPins:[0,1], + outputPins:[0,1],testDurationSeconds:1800,outputOnlyTone:'RECORDED', + captureOnly:'RECORDED',dry0Fx:'RECORDED', + fullReportSha256:reportHash,verifiedHumanWitness:true,witnessId:'qa1'} + }; + // Even a fully structural synthetic test fixture never sets certified=true. + const accepted=checkRelease(record,dir); + assert.equal(accepted.certified,false); + assert.equal(accepted.evidenceFilesHashed,4); + assert.equal(accepted.pcmCases,4); + const wrongSha=copy(record); + wrongSha.chromiumCI.sourceSha='b'.repeat(40); + assert.throws(()=>checkRelease(wrongSha,dir),/Chromium CI/); + const tampered=copy(record); + tampered.artifactSha256='f'.repeat(64); + assert.throws(()=>checkRelease(tampered,dir),/release ZIP: actual file SHA-256 mismatch/); + const tamperedHardware=copy(record); + tamperedHardware.hardware.fullReportSha256='f'.repeat(64); + assert.throws(()=>checkRelease(tamperedHardware,dir),/release hardware report: actual file SHA-256 mismatch/); + const syntheticTrace=copy(traceFixture); + syntheticTrace.provenance.kind='SYNTHETIC'; + const syntheticTraceHash=persist('trace.json',syntheticTrace); + const fromFake=copy(record); + fromFake.traceSha256=syntheticTraceHash; + assert.throws(()=>checkRelease(fromFake,dir),/native WebView producer evidence required/); + persist('trace.json',traceFixture); + const syntheticPcm=copy(pcmFixture); + syntheticPcm.provenance.kind='SYNTHETIC'; + const syntheticPcmHash=persist('pcm.json',syntheticPcm); + const fakePcm=copy(record); + fakePcm.pcmSha256=syntheticPcmHash; + assert.throws(()=>checkRelease(fakePcm,dir),/actual JUCE callback PCM provenance required/); + persist('pcm.json',pcmFixture); + const missingRole=copy(traceFixture); + for(const e of missingRole.events) + if(e.event==='arMixConsoleSnapshot') + e.payload.graph.channels=e.payload.graph.channels.filter(ch=>ch.role!=='FX_RETURN'); + const missingRoleHash=persist('trace.json',missingRole); + const noGroup=copy(record); + noGroup.traceSha256=missingRoleHash; + assert.throws(()=>checkRelease(noGroup,dir),/missing live FX_RETURN channel/); + persist('trace.json',traceFixture); + const shorter=copy(record); + shorter.hardware.testDurationSeconds=1799; + assert.throws(()=>checkRelease(shorter,dir),/30min/); + const missingWitness=copy(record); + missingWitness.hardware.verifiedHumanWitness=false; + assert.throws(()=>checkRelease(missingWitness,dir),/human witness/); + const pathTraversal=copy(record); + pathTraversal.artifacts.zip='../release.zip'; + assert.throws(()=>checkRelease(pathTraversal,dir),/safe basename/); + }finally {rmSync(dir,{recursive:true,force:true})} }); From 65cb0fda9c7c51e1775dd5b8f0426104fc6bba20 Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Sun, 1 Nov 2026 11:33:26 +0700 Subject: [PATCH 103/233] test(gui): inspect nested on-demand native hardware matrix only after both opt-in disclosure layers --- tests/mixer_io_smoke.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/mixer_io_smoke.py b/tests/mixer_io_smoke.py index fcc48ae12..0bc63b129 100644 --- a/tests/mixer_io_smoke.py +++ b/tests/mixer_io_smoke.py @@ -315,6 +315,10 @@ async def main(): assert await page.locator('.arIODevicePatchMatrix').evaluate('(e)=>e.open') # Details toggle is asynchronous; rendering the costly matrix only # AFTER toggle is intentional, not a race to be hidden by time.sleep. + await page.locator('.arIODeviceDirectMatrix > summary').wait_for(state='visible') + # Matrix itself is an opt-in nested inspector; its individual cells + # must be visible only after expanding that native crosspoint layer. + await page.locator('.arIODeviceDirectMatrix > summary').click() await page.locator('.arIODevicePatchMatrix .arIOMatrixCell').first.wait_for(state='visible') assert await page.locator('.arIODevicePatchMatrix .arIOMatrixCell').count()>0 # FAST3 source one-gesture has already completed an ARM ACK above. From a2b0094e74983fd1e019454504eaa39ab4e0f3df Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Sun, 1 Nov 2026 11:34:04 +0700 Subject: [PATCH 104/233] style(gui): ensure real body-mounted drawer wins legacy high-specificity modal sizing --- web/mixer-io.css | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/web/mixer-io.css b/web/mixer-io.css index 07fb32c57..982f1fe27 100644 --- a/web/mixer-io.css +++ b/web/mixer-io.css @@ -747,36 +747,36 @@ /* v7 G1 operator hardware drawer. Unlike the former 920x700 blocking wizard, device management is a narrow edge drawer; channel controls and MAIN remain visible behind a light scrim, without new routing ownership. */ -.arIOOverlay{ +#arIOOverlay{ padding:0;justify-content:flex-end;align-items:stretch; background:rgba(4,10,16,.48); } -.arIOOverlay .arIOWindow{ +#arIOOverlay .arIOWindow{ width:min(760px,100vw);height:100dvh;max-height:100dvh; border:0;border-left:1px solid #5b7785;border-radius:0; background:#13232c;box-shadow:-9px 0 22px #0005; } -.arIOOverlay[data-active-tab="device"] .arIOWindow{ +#arIOOverlay[data-active-tab="device"] .arIOWindow{ width:min(594px,100vw); } -.arIOWindow>header{ +#arIOOverlay .arIOWindow>header{ min-height:43px;padding:7px 11px;gap:5px; } -.arIOWindow>header h2{font-size:13px;font-weight:550;margin:0} -.arIOWindow>header small{font-size:9px} -.arIOTop{padding:5px 11px;font-size:10px} -.arIOWindow nav{ +#arIOOverlay .arIOWindow>header h2{font-size:13px;font-weight:550;margin:0} +#arIOOverlay .arIOWindow>header small{font-size:9px} +#arIOOverlay .arIOTop{padding:5px 11px;font-size:10px} +#arIOOverlay .arIOWindow nav{ padding:5px 8px;gap:0;background:#142934; } -.arIOWindow nav .btn-180{ +#arIOOverlay .arIOWindow nav .btn-180{ flex:1 1 0;min-width:0;height:29px;min-height:29px; padding:0 5px;font-size:9px;letter-spacing:0; } -.arIOBody{ +#arIOOverlay .arIOBody{ padding:8px 10px;overflow-y:auto;min-height:0;overscroll-behavior:contain; } -.arIOWindow>footer{padding:7px 10px;min-height:43px;gap:5px} -.arIOWindow>footer .btn-180{height:28px;min-height:28px} +#arIOOverlay .arIOWindow>footer{padding:7px 10px;min-height:43px;gap:5px} +#arIOOverlay .arIOWindow>footer .btn-180{height:28px;min-height:28px} .arIODevicePinGroup .arIODevicePinRow{ min-height:27px; } @@ -790,12 +790,12 @@ color:#a5d0de!important; } @media(max-width:640px){ - .arIOOverlay .arIOWindow,.arIOOverlay[data-active-tab="device"] .arIOWindow{ + #arIOOverlay .arIOWindow,#arIOOverlay[data-active-tab="device"] .arIOWindow{ width:100vw; } } @media(max-height:640px){ - .arIOBody{padding:6px 9px} - .arIOTop{padding:3px 9px} - .arIOWindow nav{padding:3px 8px} + #arIOOverlay .arIOBody{padding:6px 9px} + #arIOOverlay .arIOTop{padding:3px 9px} + #arIOOverlay .arIOWindow nav{padding:3px 8px} } From 9efdc752cca6411effe7c531359b0d5c9acac666 Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Sun, 1 Nov 2026 11:35:06 +0700 Subject: [PATCH 105/233] feat(engine): first-sound physical MONO source transaction on installed M4 callback, preserving VST3/Show and rollback; fix MSVC tests --- src/LiveAudioEngine.h | 19 ++++++- src/LiveDryRoutingLab.h | 75 ++++++++++++++++++++++++++++ src/NativeVerifiedSourcePatch.h | 63 +++++++++++++++++++++++ tests/live_channel_fx_graph_test.cpp | 64 ++++++++++++++++++++++-- 4 files changed, 214 insertions(+), 7 deletions(-) create mode 100644 src/NativeVerifiedSourcePatch.h diff --git a/src/LiveAudioEngine.h b/src/LiveAudioEngine.h index a80004bf0..178c8eb7e 100644 --- a/src/LiveAudioEngine.h +++ b/src/LiveAudioEngine.h @@ -1058,14 +1058,29 @@ class LiveAudioEngine final : private juce::AudioIODeviceCallback } juce::String switchDryRoutingLabSource(int strip,std::uint64_t epoch, std::uint64_t revision,const juce::String& mode, - int left,int right) noexcept { + int left,int right) { if(independent_.active()||routeReconfiguring_.load(std::memory_order_acquire)|| handoff_.busy()||!directFence_.permitted()|| diagnosticRoute_.load(std::memory_order_acquire) !=armix::diagnostics::Route::normal|| savedDirectSetup_||savedLiveSetup_) return "SOURCE SWITCH: live DIRECT device or graph unavailable"; - return dryRoutingLab_.switchPhysicalSource(strip,epoch,revision,mode,left,right); + auto* device=deviceManager_.getCurrentAudioDevice(); + if(!device)return "SOURCE: active DIRECT audio device unavailable"; + // True first-input SOURCE selection is a control-prepared native graph + // transaction, not a browser-side APPLY or alternate callback. A + // single verified mono capture pin is a supported source. + try { + return dryRoutingLab_.repatchPhysicalSource( + strip,epoch,revision,mode,left,right, + directFence_.permitted(),independent_.active(), + graphOwned_->count,formats_,device->getCurrentSampleRate(), + juce::jmax(32,device->getCurrentBufferSizeSamples())); + } catch(const std::exception& ex) { + return "SOURCE: native prepare failed; prior audio kept: " + juce::String(ex.what()); + } catch(...) { + return "SOURCE: native prepare failed; prior audio kept"; + } } bool setDryRoutingLabParameter(int strip,std::uint64_t epoch, std::uint64_t revision,const juce::String& parameter, diff --git a/src/LiveDryRoutingLab.h b/src/LiveDryRoutingLab.h index 3f4631e71..464daa857 100644 --- a/src/LiveDryRoutingLab.h +++ b/src/LiveDryRoutingLab.h @@ -6,6 +6,7 @@ #include "../engine/core/DynamicChannelFxLeaseBank.h" #include "VstBusLayout.h" #include "../engine/core/NativeDryRouteCommand.h" +#include "NativeVerifiedSourcePatch.h" #include "../engine/device/JuceActivePortSnapshot.h" #include "../engine/core/RealtimeRoutePublisher.h" #include "../engine/device/LiveInputPortRegistry.h" @@ -412,6 +413,11 @@ class LiveDryRoutingLab final { // displays an acknowledged immutable copy; draft changes // never update this until graph publication succeeds. acceptedRoute_=explicitSelection?command:juce::var(); + // Retain the REAL prepared (possibly UNPATCHED/SILENT) M4 + // input topology so a single native SOURCE selection can + // compile the first mono route. No UI draft is authoritative. + sourceTemplate_=command; + acceptedFxSelections_=selections; // Release-store only AFTER a valid immutable graph publishes. // Even if OUTPUT is mistakenly armed, unpatched renders never // enter ANY channel/master vendor DSP or produce sound. @@ -487,6 +493,71 @@ class LiveDryRoutingLab final { return {}; } + // A source changing from NONE to MONO/STEREO needs a new prepared + // topology. A source changing physical pin within the same format uses + // the existing zero-heap atomic source switch above. Both cases are + // handled through ONE native command and ONE ACK, not GUI APPLY wizard. + // All heavy preparation/reuse and deep cloning happen on message thread. + juce::String repatchPhysicalSource(int strip,std::uint64_t expectedEpoch, + std::uint64_t expectedRevision,const juce::String& mode, + int physicalLeft,int physicalRight,bool directPermitted, + bool independentClock,int occupiedCh1Fx, + juce::AudioPluginFormatManager& formats,double sampleRate, + int deviceFrames) + { + if(!ready() || !registryValid_.load(std::memory_order_acquire) || + topologyFault_.load(std::memory_order_acquire) || + expectedEpoch!=epoch() || expectedRevision!=revision() || + !sourceTemplate_.isObject()) + return "SOURCE: native device, graph or accepted template stale"; + const auto sourceRows=sourceTemplate_.getProperty("channels",juce::var()); + const auto* rows=sourceRows.getArray(); + if(!rows || strip<0 || strip>=count || rows->size()!=count) + return "SOURCE: target channel unavailable"; + // Preserve the proven live-safe atomic path for an already scheduled + // channel. Never force a vendor graph rebuild for ordinary pin moves. + if(hasExplicitRoute() && + rows->getReference(strip).getProperty("mode",{}).toString()==mode) + return switchPhysicalSource(strip,expectedEpoch,expectedRevision, + mode,physicalLeft,physicalRight); + const int available=portCount_.load(std::memory_order_acquire); + if(available<=0||available>armix::device::LiveInputPortRegistry::limit) + return "SOURCE: driver did not verify active capture pins"; + std::array pins{}; + for(int i=0;i(available)}, + expectedEpoch,expectedRevision,staged); + if(error.isNotEmpty())return error; + // Preserve every currently ACKed fader, pan, MUTE and SOLO. The + // template may predate atomic live controls; reusing it verbatim + // would silently reset a musician's mix after a SOURCE selection. + auto stagedRows=staged.getProperty("channels",juce::var()); + auto* editable=stagedRows.getArray(); + if(!editable || editable->size()!=count) + return "SOURCE: prepared input document malformed"; + for(int i=0;igetReference(i).getDynamicObject(); + if(!row)return "SOURCE: missing acknowledged channel control"; + const auto& c=channelEdits_[i]; + row->setProperty("gain",static_cast(c.linear)); + row->setProperty("pan",static_cast(c.pan)); + row->setProperty("mute",c.mute); + row->setProperty("solo",c.solo); + } + if(expectedEpoch!=epoch() || expectedRevision!=revision() || + !registryValid_.load(std::memory_order_acquire)) + return "SOURCE: device changed during preparation; accepted mix preserved"; + // Same M4 publisher, same plugin lease/FX state and physical MAIN + // outputs. Existing 256-frame topology crossfade is performed by + // its ONE installed callback. Compilation/publish failures roll back. + return apply(staged,directPermitted,independentClock,occupiedCh1Fx, + acceptedFxSelections_,formats,sampleRate,deviceFrames,true); + } + // Native live control path. Only the JUCE message thread writes. No // graph recompilation, VST3 instantiation or callback detach. // Browser carries the exact acknowledged route token to reject stale @@ -693,6 +764,8 @@ class LiveDryRoutingLab final { fxCount_.store(0,std::memory_order_relaxed); fxReused_.store(0,std::memory_order_relaxed); acceptedRoute_=juce::var(); // control-thread STOP only + sourceTemplate_=juce::var(); + acceptedFxSelections_=FxSelections{}; for(auto& n:auxFxNames_)n.clear(); for(auto& p:channelPeaks_)p.store(0.f,std::memory_order_relaxed); for(auto& p:channelPeaksL_)p.store(0.f,std::memory_order_relaxed); @@ -1052,6 +1125,8 @@ class LiveDryRoutingLab final { std::array,auxCount> auxPeaks_{}; std::atomic auxCountActive_{0},auxSendCount_{0}; juce::var acceptedRoute_; // native ACK only, no UI preview/localStorage truth + juce::var sourceTemplate_; // last prepared M4 template, including SILENT/NONE startup + FxSelections acceptedFxSelections_{}; // CONTROL ONLY: original VST3 identity for FX reuse // All data shared between JUCE device lifecycle and GUI/control reads // are atomic; the callback never enumerates masks or channel names. std::array,armix::device::LiveInputPortRegistry::limit> enabledPorts_{}; diff --git a/src/NativeVerifiedSourcePatch.h b/src/NativeVerifiedSourcePatch.h new file mode 100644 index 000000000..6ca6f4d78 --- /dev/null +++ b/src/NativeVerifiedSourcePatch.h @@ -0,0 +1,63 @@ +// SPDX-License-Identifier: AGPL-3.0-only +#pragma once +#include +#include +#include +#include +#include + +// Message-thread SOURCE transaction: one verified input selection from an +// initially SILENT M4 session, without modifying the accepted Show or FX +// until the whole graph/epoch has compiled. Both MAIN and auxiliary outputs +// remain owned by the existing one JUCE production callback. +namespace armix::mixer { +struct NativeVerifiedSourcePatch final { + static juce::String prepare(const juce::var& accepted, + int channel,const juce::String& mode,int physicalLeft,int physicalRight, + std::span enabledPhysicalPorts, + std::uint64_t actualEpoch,std::uint64_t actualRevision, + juce::var& destination) + { + if(!actualEpoch || + actualEpoch>static_cast(std::numeric_limits::max()) || + actualRevision>static_cast(std::numeric_limits::max()) || + !accepted.isObject() || channel<0 || channel>=10) + return "SOURCE: stale device epoch or invalid native channel"; + if(mode!="MONO"&&mode!="STEREO") + return "SOURCE: MONO or STEREO mode required"; + if(physicalLeft<0 || enabledPhysicalPorts.empty()) + return "SOURCE: select an enabled physical capture pin"; + if(static_cast(accepted.getProperty("deviceEpoch",juce::var(-1))) != + static_cast(actualEpoch)) + return "SOURCE: device epoch changed; accepted patch preserved"; + bool validLeft=false,validRight=false; + for(const int port:enabledPhysicalPorts) { + if(port==physicalLeft)validLeft=true; + if(port==physicalRight)validRight=true; + } + if(!validLeft || (mode=="STEREO" && + (!validRight || physicalLeft==physicalRight))) + return "SOURCE: STEREO requires two distinct active physical pins; MONO accepts one"; + // JUCE var assignment shares the underlying DynamicObject. Deep + // clone before touching a row, or failed prepare would silently + // mutate the still-audible accepted routing snapshot. + auto copy=juce::JSON::parse(juce::JSON::toString(accepted,false)); + if(!copy.isObject()) + return "SOURCE: cannot clone accepted native patch"; + auto channels=copy.getProperty("channels",juce::var()); + auto* list=channels.getArray(); + if(!list || list->size()!=10 || !list->getReference(channel).isObject()) + return "SOURCE: accepted patch channel layout unavailable"; + auto* row=list->getReference(channel).getDynamicObject(); + row->setProperty("mode",mode); + row->setProperty("left",physicalLeft); + row->setProperty("right",mode=="STEREO"?physicalRight:-1); + // The existing M4 producer handles revision/epoch publication and + // fails back to its prior accepted graph on any bad plugin/routing. + copy.getDynamicObject()->setProperty("deviceEpoch",static_cast(actualEpoch)); + copy.getDynamicObject()->setProperty("revision",static_cast(actualRevision)); + destination=std::move(copy); + return {}; + } +}; +} // namespace armix::mixer diff --git a/tests/live_channel_fx_graph_test.cpp b/tests/live_channel_fx_graph_test.cpp index 8dd2962dd..a0ca9fb4e 100644 --- a/tests/live_channel_fx_graph_test.cpp +++ b/tests/live_channel_fx_graph_test.cpp @@ -6,6 +6,7 @@ #include "../engine/core/NativeOutputPairTap.h" #include "../engine/core/RealtimeRoutePublisher.h" #include "../src/ConsoleLiveBridgeV6.h" +#include "../src/NativeVerifiedSourcePatch.h" #if defined(NDEBUG) #undef NDEBUG #endif @@ -558,7 +559,7 @@ static void verifyNativeConsoleWireRejectsUnsupportedM4AndPreservesEpoch() { auto device=snap.getProperty("device",{}); auto graph=snap.getProperty("graph",{}); auto measured=snap.getProperty("telemetry",{}); - assert(snap.getProperty("schemaVersion",0)==6); + assert(static_cast(snap.getProperty("schemaVersion",0))==6); assert(!static_cast(snap.getProperty("productionCallbackLive",true))); assert(device.getProperty("epoch","").toString()=="9007199254740993"); assert(static_cast(device.getProperty("outputArmed",false))); @@ -573,13 +574,13 @@ static void verifyNativeConsoleWireRejectsUnsupportedM4AndPreservesEpoch() { auto ins=device.getProperty("inputEndpoints",{}); auto outs=device.getProperty("outputEndpoints",{}); assert(ins.getArray()->size()==1 && outs.getArray()->size()==2); - assert(ins.getArray()->getReference(0).getProperty("port",0)==2); + assert(static_cast(ins.getArray()->getReference(0).getProperty("port",0))==2); assert(static_cast(ins.getArray()->getReference(0) .getProperty("rawPeak",0.0))==.25); assert(static_cast(ins.getArray()->getReference(0) .getProperty("rawPresent",false))); - assert(outs.getArray()->getReference(0).getProperty("port",0)==1); - assert(outs.getArray()->getReference(1).getProperty("port",0)==4); + assert(static_cast(outs.getArray()->getReference(0).getProperty("port",0))==1); + assert(static_cast(outs.getArray()->getReference(1).getProperty("port",0))==4); const auto diagnostic=snap.getProperty("legacyM4",{}); assert(diagnostic.getProperty("routingRevision","").toString()=="77"); Bridge bridge; @@ -613,7 +614,59 @@ static void verifyNativeConsoleWireRejectsUnsupportedM4AndPreservesEpoch() { assert(!Bridge::decodeDecimal(juce::var("01"),decoded)); assert(!Bridge::decodeDecimal(juce::var(9007199254740993.0),decoded)); // No request above mutates the genuinely accepted M4 hardware route. - assert(live.getProperty("dryRoutingLab",{}).getProperty("revision",0)==77); + assert(static_cast(live.getProperty("dryRoutingLab",{}).getProperty("revision",0))==77); +} + +// G1 physical First Sound: one enabled callback pin becomes a MONO +// production source in ONE native mutation. No fabricated stereo IN1/IN1, +// no accidental modification of the last accepted M4 request on failure. +static void verifyFirstSoundOnePinNativeSourceDraft() { + using armix::mixer::NativeVerifiedSourcePatch; + auto command=std::make_unique(); + command->setProperty("deviceEpoch",juce::int64(17)); + command->setProperty("revision",juce::int64(8)); + juce::Array sources; + for(int c=0;c<10;++c) { + auto ch=std::make_unique(); + ch->setProperty("mode","NONE"); + ch->setProperty("left",-1); + ch->setProperty("right",-1); + ch->setProperty("gain",.25); + ch->setProperty("pan",0.0); + sources.add(juce::var(ch.release())); + } + command->setProperty("channels",juce::var(sources)); + const auto accepted=juce::var(command.release()); + const std::array physical{{5}}; + juce::var candidate; + assert(NativeVerifiedSourcePatch::prepare(accepted,6,"MONO",5,-1, + physical,17,9,candidate).isEmpty()); + const auto draftChannels=candidate.getProperty("channels",juce::var()); + const auto* acceptedChannels=accepted.getProperty("channels",juce::var()).getArray(); + const auto* changed=draftChannels.getArray(); + assert(changed && changed->size()==10 && acceptedChannels && + acceptedChannels->size()==10); + assert(changed->getReference(6).getProperty("mode","").toString()=="MONO"); + assert(static_cast(changed->getReference(6).getProperty("left",-1))==5); + assert(static_cast(changed->getReference(6).getProperty("right",0))==-1); + assert(acceptedChannels->getReference(6).getProperty("mode","").toString()=="NONE"); + assert(candidate.getProperty("revision",{}).toString()=="9"); + candidate=juce::var(); + assert(NativeVerifiedSourcePatch::prepare(accepted,6,"STEREO",5,5, + physical,17,9,candidate).isNotEmpty()); + assert(candidate.isVoid()); + assert(NativeVerifiedSourcePatch::prepare(accepted,6,"STEREO",5,7, + physical,17,9,candidate).isNotEmpty()); + assert(NativeVerifiedSourcePatch::prepare(accepted,6,"MONO",4,-1, + physical,17,9,candidate).isNotEmpty()); + assert(NativeVerifiedSourcePatch::prepare(accepted,6,"MONO",5,-1, + physical,18,9,candidate).isNotEmpty()); + assert(acceptedChannels->getReference(6).getProperty("mode","").toString()=="NONE"); + const std::array stereoPhysical{{5,7}}; + assert(NativeVerifiedSourcePatch::prepare(accepted,2,"STEREO",5,7, + stereoPhysical,17,9,candidate).isEmpty()); + const auto stereoRows=candidate.getProperty("channels",juce::var()); + assert(stereoRows.getArray()->getReference(2).getProperty("mode","").toString()=="STEREO"); } int main() { @@ -988,6 +1041,7 @@ int main() { verifyOccupiedExternalCh1Owner(); verifySourceFormatIndependentPanPcmParity(); verifyNativeConsoleWireRejectsUnsupportedM4AndPreservesEpoch(); + verifyFirstSoundOnePinNativeSourceDraft(); // Tests above use a real JUCE AudioProcessor processing seam. Vendor // VST3 formats and sound quality require separate Windows hardware FAT. } From 723d48bb69b38c46d28b9b6596b2209436087e38 Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Sun, 1 Nov 2026 11:35:08 +0700 Subject: [PATCH 106/233] build(gui v7): exact standalone parity after device drawer/accepted I-O/native wire contract --- AR-MIX-Live-FX-Host-Standalone-v0.3.html | 32 ++++++++++++------------ 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/AR-MIX-Live-FX-Host-Standalone-v0.3.html b/AR-MIX-Live-FX-Host-Standalone-v0.3.html index d71febe02..1331c59d1 100644 --- a/AR-MIX-Live-FX-Host-Standalone-v0.3.html +++ b/AR-MIX-Live-FX-Host-Standalone-v0.3.html @@ -2973,36 +2973,36 @@ /* v7 G1 operator hardware drawer. Unlike the former 920x700 blocking wizard, device management is a narrow edge drawer; channel controls and MAIN remain visible behind a light scrim, without new routing ownership. */ -.arIOOverlay{ +#arIOOverlay{ padding:0;justify-content:flex-end;align-items:stretch; background:rgba(4,10,16,.48); } -.arIOOverlay .arIOWindow{ +#arIOOverlay .arIOWindow{ width:min(760px,100vw);height:100dvh;max-height:100dvh; border:0;border-left:1px solid #5b7785;border-radius:0; background:#13232c;box-shadow:-9px 0 22px #0005; } -.arIOOverlay[data-active-tab="device"] .arIOWindow{ +#arIOOverlay[data-active-tab="device"] .arIOWindow{ width:min(594px,100vw); } -.arIOWindow>header{ +#arIOOverlay .arIOWindow>header{ min-height:43px;padding:7px 11px;gap:5px; } -.arIOWindow>header h2{font-size:13px;font-weight:550;margin:0} -.arIOWindow>header small{font-size:9px} -.arIOTop{padding:5px 11px;font-size:10px} -.arIOWindow nav{ +#arIOOverlay .arIOWindow>header h2{font-size:13px;font-weight:550;margin:0} +#arIOOverlay .arIOWindow>header small{font-size:9px} +#arIOOverlay .arIOTop{padding:5px 11px;font-size:10px} +#arIOOverlay .arIOWindow nav{ padding:5px 8px;gap:0;background:#142934; } -.arIOWindow nav .btn-180{ +#arIOOverlay .arIOWindow nav .btn-180{ flex:1 1 0;min-width:0;height:29px;min-height:29px; padding:0 5px;font-size:9px;letter-spacing:0; } -.arIOBody{ +#arIOOverlay .arIOBody{ padding:8px 10px;overflow-y:auto;min-height:0;overscroll-behavior:contain; } -.arIOWindow>footer{padding:7px 10px;min-height:43px;gap:5px} -.arIOWindow>footer .btn-180{height:28px;min-height:28px} +#arIOOverlay .arIOWindow>footer{padding:7px 10px;min-height:43px;gap:5px} +#arIOOverlay .arIOWindow>footer .btn-180{height:28px;min-height:28px} .arIODevicePinGroup .arIODevicePinRow{ min-height:27px; } @@ -3016,14 +3016,14 @@ color:#a5d0de!important; } @media(max-width:640px){ - .arIOOverlay .arIOWindow,.arIOOverlay[data-active-tab="device"] .arIOWindow{ + #arIOOverlay .arIOWindow,#arIOOverlay[data-active-tab="device"] .arIOWindow{ width:100vw; } } @media(max-height:640px){ - .arIOBody{padding:6px 9px} - .arIOTop{padding:3px 9px} - .arIOWindow nav{padding:3px 8px} + #arIOOverlay .arIOBody{padding:6px 9px} + #arIOOverlay .arIOTop{padding:3px 9px} + #arIOOverlay .arIOWindow nav{padding:3px 8px} } From dbc81de2a9f3c9ff53119a9098821e453c6b6477 Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Sun, 1 Nov 2026 11:35:48 +0700 Subject: [PATCH 107/233] fix(engine): hold JUCE var lifetime when asserting accepted source rollback --- tests/live_channel_fx_graph_test.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/live_channel_fx_graph_test.cpp b/tests/live_channel_fx_graph_test.cpp index a0ca9fb4e..46fa1bbbd 100644 --- a/tests/live_channel_fx_graph_test.cpp +++ b/tests/live_channel_fx_graph_test.cpp @@ -642,7 +642,8 @@ static void verifyFirstSoundOnePinNativeSourceDraft() { assert(NativeVerifiedSourcePatch::prepare(accepted,6,"MONO",5,-1, physical,17,9,candidate).isEmpty()); const auto draftChannels=candidate.getProperty("channels",juce::var()); - const auto* acceptedChannels=accepted.getProperty("channels",juce::var()).getArray(); + const auto sourceBefore=accepted.getProperty("channels",juce::var()); + const auto* acceptedChannels=sourceBefore.getArray(); const auto* changed=draftChannels.getArray(); assert(changed && changed->size()==10 && acceptedChannels && acceptedChannels->size()==10); From 7c544bf8f692dd5b63d8027077d0c4b155a33ee8 Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Sun, 1 Nov 2026 11:37:39 +0700 Subject: [PATCH 108/233] test(gui): wait for native software-I/O disclosure to mount lazily before functional interaction --- tests/mixer_io_smoke.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/mixer_io_smoke.py b/tests/mixer_io_smoke.py index 0bc63b129..2d4feb634 100644 --- a/tests/mixer_io_smoke.py +++ b/tests/mixer_io_smoke.py @@ -999,6 +999,9 @@ async def main(): await page.locator('[data-io-tab="device"]').click() if not await page.locator('.arIODevicePatchMatrix').evaluate('(e)=>e.open'): await page.locator('.arIODevicePatchMatrix > summary').click() + # Demand-mounted logical-input matrix is appended on the details + # toggle; wait for real UI state instead of assuming synchronous DOM. + await page.locator('.arIOSoftwareGrid').wait_for(state='visible') assert await page.locator('.arIOSoftwareGrid').is_visible() count_before=await page.evaluate("""()=>window.__armixTestActions.filter(x=> x.name==='arMixAction'&&x.data.action==='routingDryApply').length""") From 32033c25ae4e9e7716dea0dd8eefd1f8de6fc8a8 Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Sun, 1 Nov 2026 11:39:39 +0700 Subject: [PATCH 109/233] fix(gui): identify legacy CH10 as normal INPUT, never fabricate a native wet FX RETURN --- web/app.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/app.js b/web/app.js index dfc9ef649..56b2738b0 100644 --- a/web/app.js +++ b/web/app.js @@ -11,7 +11,7 @@ const raw=[ ['Backing','♫',['EQ','Reverb'],-3.6,-25], ['Guitar','♬',['EQ','Compressor','Delay'],-7.9,30], ['Keyboard','▥',['EQ','Reverb'],-14.2,0], - ['FX Return','◎',['Reverb'],-5.1,0] + ['Input 10','♩',['Reverb'],-5.1,0] ]; const channels=raw.map((a,i)=>({id:i+1,name:a[0],icon:a[1],color:colors[i],inserts:[...a[2]],fader:a[3],pan:a[4],trim:0,mute:false,solo:false,pre:false,hpf:i%4!==0,stereo:i>=6})); let currentChannel=0, masterSelected=false, view='MIX', sceneIdx=0, timer=0; From ee475b7688635a67b9c6a68410cd8b50046b0fcd Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Sun, 1 Nov 2026 11:40:54 +0700 Subject: [PATCH 110/233] build(gui): synchronize actual M4 standalone app with truthful CH10 INPUT role --- AR-MIX-Live-FX-Host-Standalone-v0.3.html | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/AR-MIX-Live-FX-Host-Standalone-v0.3.html b/AR-MIX-Live-FX-Host-Standalone-v0.3.html index 1331c59d1..f3d2d706a 100644 --- a/AR-MIX-Live-FX-Host-Standalone-v0.3.html +++ b/AR-MIX-Live-FX-Host-Standalone-v0.3.html @@ -3086,7 +3086,7 @@ ['Backing','♫',['EQ','Reverb'],-3.6,-25], ['Guitar','♬',['EQ','Compressor','Delay'],-7.9,30], ['Keyboard','▥',['EQ','Reverb'],-14.2,0], - ['FX Return','◎',['Reverb'],-5.1,0] + ['Input 10','♩',['Reverb'],-5.1,0] ]; const channels=raw.map((a,i)=>({id:i+1,name:a[0],icon:a[1],color:colors[i],inserts:[...a[2]],fader:a[3],pan:a[4],trim:0,mute:false,solo:false,pre:false,hpf:i%4!==0,stereo:i>=6})); let currentChannel=0, masterSelected=false, view='MIX', sceneIdx=0, timer=0; @@ -4141,6 +4141,7 @@ }else if(!meterTimer&&!meterRAF)scheduleDemoMeter(); }); scheduleDemoMeter(); + diff --git a/tests/operator_console_v6_smoke.py b/tests/operator_console_v6_smoke.py index f26129564..f1273986c 100644 --- a/tests/operator_console_v6_smoke.py +++ b/tests/operator_console_v6_smoke.py @@ -14,7 +14,7 @@ "SET_SOURCE", "SET_PROCESSING_FORMAT", "SET_PRIMARY_OUT", "PICK_INSERT_FILE", "SET_INSERT_BYPASS", "OPEN_INSERT_EDITOR", "MOVE_INSERT", "ADD_SEND", "SET_SEND_TAP", "SET_SEND_LEVEL", "SET_FADER", - "SET_PAN", "SET_MUTE", "SET_SOLO", "CREATE_CHANNEL", + "SET_PAN", "SET_MUTE", "SET_SOLO", "SET_TRIM", "SET_CUE", "CREATE_CHANNEL", ] @@ -24,7 +24,8 @@ def channel(identity, name, role="INPUT", source=None): "source":{"portId":source,"physicalPins":[int(source.split(":")[1])]} if source else None, "primaryOutId":"1000" if role!="MAIN" else None, "inserts":[],"sends":[], - "controls":{"faderDb":-3,"pan":0,"mute":False,"solo":False}} + "controls":{"faderDb":-3,"pan":0,"mute":False,"solo":False, + "trimDb":-2.5,"cue":False}} def snapshot(revision=3, epoch=7, new_channel=False): @@ -197,6 +198,41 @@ async def aligned_sections(): await page.locator(f'.arV6RailToggle[data-section="{key}"]').click() assert all(x["topDelta"]<2 for x in await aligned_sections()) + # Native stable ID CTRL/SHIFT selection is UI-only; pinned MAIN excluded. + count_start=await page.evaluate("""()=>window.__v6Test.sent.filter( + x=>x.event==='arMixConsoleIntent').length""") + await page.locator('[data-channel-id="2"] .arV6StripHead').click() + await page.locator('[data-channel-id="7"] .arV6StripHead').click(modifiers=["Control"]) + assert await page.evaluate("()=>window.__arMixV6ReadOnly().selectedChannelIds")==["2","7"] + await page.locator('[data-channel-id="9"] .arV6StripHead').click(modifiers=["Shift"]) + assert await page.evaluate("()=>window.__arMixV6ReadOnly().selectedChannelIds")==["7","8","9"] + assert await page.locator('#arV6Main .arV6Master').get_attribute("aria-selected")=="false" + assert await page.locator('.arV6SelectionCount').inner_text()=="3 SEL" + assert await page.evaluate("""()=>window.__v6Test.sent.filter( + x=>x.event==='arMixConsoleIntent').length""")==count_start + + trim=page.locator('[data-op="SET_TRIM"][data-id="7"]') + assert await trim.is_enabled() and await trim.input_value()=="-2.5" + await trim.evaluate("(el)=>{el.value='5';el.dispatchEvent(new Event('change',{bubbles:true}))}") + trim_cmd=await page.evaluate("""()=>window.__v6Test.sent.filter( + x=>x.event==='arMixConsoleIntent').at(-1).payload""") + assert trim_cmd["operation"]=="SET_TRIM" and trim_cmd["payload"]=={"valueDb":5} + assert await trim.input_value()=="-2.5" + await page.evaluate("""id=>window.__v6Test.publish('arMixConsoleAck', + {requestId:id,status:'REJECTED',deviceEpoch:'7',graphRevision:'3', + rosterRevision:'3',errorCode:'TRIM_NOT_READY'})""",trim_cmd["requestId"]) + cue=page.locator('[data-op="SET_CUE"][data-id="7"]') + assert await cue.is_enabled() + await cue.click() + cue_cmd=await page.evaluate("""()=>window.__v6Test.sent.filter( + x=>x.event==='arMixConsoleIntent').at(-1).payload""") + assert cue_cmd["operation"]=="SET_CUE" and cue_cmd["payload"]=={"value":True} + assert await cue.get_attribute("aria-pressed")=="false" + await page.evaluate("""id=>window.__v6Test.publish('arMixConsoleAck', + {requestId:id,status:'REJECTED',deviceEpoch:'7',graphRevision:'3', + rosterRevision:'3',errorCode:'NO_MONITOR'})""",cue_cmd["requestId"]) + assert await cue.get_attribute("aria-pressed")=="false" + # Role and SOLO filters are UI-only; MAIN remains pinned, original # numeric ChannelIds survive and no console intent is emitted. count_before=await page.evaluate("""()=>window.__v6Test.sent.filter( diff --git a/web/mixer-layout.css b/web/mixer-layout.css index 00163b809..bf502cdee 100644 --- a/web/mixer-layout.css +++ b/web/mixer-layout.css @@ -936,3 +936,49 @@ @media(max-height:690px){ #app .arV6Console{--v6-fx-h:56px;--v6-send-h:55px} } + + +/* User-approved PRD v5.2: native-only digital TRIM/CUE and lightweight + ChannelId-based multiselect. No RT animation or DSP graph duplication. */ +#app .arV6Console .arV6SelectionCount{ + flex:0 0 auto;white-space:nowrap;color:#9ebbc7;font:10px/1 Consolas,monospace; +} +#app .arV6Console .arV6StripHead{cursor:pointer} +#app .arV6Console .arV6Strip.isSelected{ + background:linear-gradient(90deg,#254454,#304958 14%,#304958 87%,#1a3441); + box-shadow:inset 0 0 0 1px #70b6d1; +} +#app .arV6Console .arV6Strip.isSelected .arV6StripHead{border-bottom-color:#79b9cb} +#app .arV6Console .arV6Controls{ + display:grid;grid-template-columns:minmax(0,1fr) repeat(3,26px); + grid-template-rows:minmax(0,1fr) 20px;gap:1px 3px; + padding:1px 0 2px;align-items:center; +} +#app .arV6Console .arV6Controls .arV6Pan{grid-row:1;grid-column:1} +#app .arV6Console .arV6Controls .arV6Button{ + min-height:24px;width:26px;padding:0;font-size:11px; +} +#app .arV6Console .arV6Trim{ + display:flex;grid-column:1/-1;grid-row:2;align-items:center; + gap:4px;min-width:0;height:19px;border-top:1px solid #324854; + color:#8cafc0;font:600 9px/1 "Segoe UI",sans-serif; +} +#app .arV6Console .arV6TrimLevel{ + min-width:0;flex:1 1 0;width:100%;margin:0;height:14px; + cursor:ew-resize;accent-color:#60b4ca; +} +#app .arV6Console .arV6TrimDb{ + min-width:28px;text-align:right;white-space:nowrap; + font:9px/1 Consolas,monospace;color:#bdd0d9; +} +#app .arV6Console .arV6TrimLevel:disabled{opacity:.45;cursor:not-allowed} +#app .arV6Console[data-narrow="true"] .arV6Controls{ + grid-template-columns:minmax(0,1fr) repeat(3,23px);gap:1px; +} +#app .arV6Console[data-narrow="true"] .arV6Controls .arV6Button{width:23px} +@media(max-height:690px){ + #app .arV6Console .arV6Controls{grid-template-rows:minmax(0,1fr) 17px;padding:0} + #app .arV6Console .arV6Controls .arV6Button{min-height:19px} + #app .arV6Console .arV6Trim{height:16px;font-size:8px;gap:2px} + #app .arV6Console .arV6TrimLevel{height:12px} +} diff --git a/web/mixer-layout.js b/web/mixer-layout.js index f8ccb2231..242456eec 100644 --- a/web/mixer-layout.js +++ b/web/mixer-layout.js @@ -192,6 +192,8 @@ } const clean=s=>String(s==null?'—':s); const byId=new Map(); + // Selection is display state only, with immutable native ChannelId keys. + const selectedIds=new Set();let selectionAnchor=null; const pending=new Map(); const pendingTargets=new Set(); const awaitingSnapshot=new Map(); @@ -203,7 +205,8 @@ OPEN_INSERT_EDITOR:'OPEN_INSERT_EDITOR',MOVE_INSERT:'MOVE_INSERT', ADD_SEND:'ADD_SEND',SET_SEND_TAP:'SET_SEND_TAP',SET_SEND_LEVEL:'SET_SEND_LEVEL', SET_FADER:'SET_FADER',SET_PAN:'SET_PAN',SET_MUTE:'SET_MUTE', - SET_SOLO:'SET_SOLO',CREATE_CHANNEL:'CREATE_CHANNEL' + SET_SOLO:'SET_SOLO',SET_TRIM:'SET_TRIM',SET_CUE:'SET_CUE', + CREATE_CHANNEL:'CREATE_CHANNEL' }; let accepted=null,acceptedNative=false,modeSend='',lastStructure='',requestSeq=0; let draggingFx=null; @@ -251,13 +254,15 @@ const narrow=button('NARROW',{'aria-pressed':'false','aria-label':'Toggle narrow channel bank'}); const roleFilter=h('select','arV6Select arV6Filter'); roleFilter.setAttribute('aria-label','Filter visible mixer channels'); + const selectionCount=h('span','arV6SelectionCount','0 SEL'); for(const [value,label] of [['ALL','ALL'],['INPUT','INPUT'],['GROUP','BUS'], ['FX_RETURN','FX RTN'],['AUX','AUX'],['MONITOR','MON'],['SOLO','SOLO']]){ const option=h('option','',label);option.value=value;roleFilter.append(option); } const back=button('V6 CONSOLE',{'aria-label':'Return to operator console'}); back.id='arV6Return';back.hidden=true; - tools.append(bankPrev,bankLabel,bankNext,roleFilter,sendMode,roleSelect,add,narrow,patch); + tools.append(bankPrev,bankLabel,bankNext,roleFilter,selectionCount, + sendMode,roleSelect,add,narrow,patch); top.append(identification,tools); const message=h('div','arV6Message');message.setAttribute('role','status'); const body=h('div','arV6Body'); @@ -434,14 +439,16 @@ } for(const ch of g.channels){ if(ch.primaryOutId!==undefined&&ch.primaryOutId!==null&& - !ids.has(ch.primaryOutId))return false; + (!ids.has(ch.primaryOutId)||ch.primaryOutId===ch.id))return false; if(ch.source){ const x=ch.source; if(ch.role!=='INPUT'||typeof x.portId!=='string'|| !Array.isArray(x.physicalPins)||!pins(x.physicalPins)|| ![1,2].includes(x.physicalPins.length)|| - !x.physicalPins.every(p=>d.enabledInputs.includes(p))|| - !d.inputEndpoints.some(p=>p.id===x.portId&&p.active))return false; + !x.physicalPins.every(p=>d.enabledInputs.includes(p)&& + d.inputEndpoints.some(e=>e.port===p&&e.active))|| + !d.inputEndpoints.some(p=>p.id===x.portId&&p.active&& + x.physicalPins.includes(p.port)))return false; } for(const send of ch.sends) if(!ids.has(send.targetId)||send.targetId===ch.id|| @@ -449,6 +456,17 @@ if(ch.role==='GROUP'&&!c.groups||ch.role==='FX_RETURN'&&!c.fxReturns|| ch.role==='MONITOR'&&!c.monitor)return false; } + if(s.productionCallbackLive&&g.channels.filter(ch=>ch.role==='MAIN').length!==1)return false; + // Reject source/primary bus cycles before allowing the operator to act. + const graphIds=new Map(g.channels.map(ch=>[ch.id,ch])); + for(const ch of g.channels){ + let current=ch,visited=new Set(); + while(current?.primaryOutId){ + if(visited.has(current.id))return false; + visited.add(current.id); + current=graphIds.get(current.primaryOutId); + } + } if(g.destinations.some(dst=>!dst||!ids.has(dst.id)))return false; if(typeof t.rawCapturePresent!=='boolean'||typeof t.mainPcmPresent!=='boolean'|| typeof t.monitorPcmPresent!=='boolean'||typeof t.rawCapturePeak!=='number'|| @@ -484,6 +502,7 @@ // Device replacement invalidates all old intents and controls; never // replay them into an unrelated callback/port inventory. pending.clear();pendingTargets.clear();awaitingSnapshot.clear(); + selectedIds.clear();selectionAnchor=null; showFeedback('DEVICE CHANGED · native source and destination inventory refreshed'); } for(const [requestId,task] of awaitingSnapshot){ @@ -605,6 +624,7 @@ const roleName=h('span','arV6Role',role); const name=h('strong','arV6Name',ch.name||ch.id);name.title=ch.id; head.append(roleName,name);elStrip.append(head); + elStrip.setAttribute('aria-selected',String(selectedIds.has(ch.id))); const sourceSection=h('div','arV6Upper'); const routeSection=h('div','arV6Route'); const sources=(accepted.device.inputEndpoints||[]).filter(p=>p.active===true && accepted.device.enabledInputs.includes(p.port)); @@ -631,7 +651,24 @@ 'aria-pressed':String(!!ch.controls?.mute)})); controls.append(button('S',{'data-op':'SET_SOLO','data-id':ch.id, 'aria-pressed':String(!!ch.controls?.solo)})); - elStrip.append(controls); + const cueKnown=typeof ch.controls?.cue==='boolean'&&role!=='MAIN'; + const cue=button('C',{'data-op':'SET_CUE','data-id':ch.id, + 'aria-pressed':String(ch.controls?.cue===true), + 'aria-label':(ch.name||ch.id)+' native monitor Cue/PFL'}); + cue.dataset.acceptedKnown=String(cueKnown);cue.disabled=!cueKnown||!can('SET_CUE',ch.id); + controls.append(cue); + const trimKnown=typeof ch.controls?.trimDb==='number'&&Number.isFinite(ch.controls.trimDb); + const trimRow=h('label','arV6Trim');trimRow.append(h('span','','TRIM')); + const trim=h('input','arV6TrimLevel');trim.type='range'; + trim.min='-24';trim.max='24';trim.step='.5'; + trim.value=String(trimKnown?clamp(ch.controls.trimDb,-24,24):0); + trim.dataset.op='SET_TRIM';trim.dataset.id=ch.id; + trim.dataset.acceptedKnown=String(trimKnown); + trim.setAttribute('aria-label',(ch.name||ch.id)+' digital input trim dB'); + trim.disabled=!trimKnown||!can('SET_TRIM',ch.id); + trimRow.append(trim,h('output','arV6TrimDb', + trimKnown?ch.controls.trimDb.toFixed(1):'—')); + controls.append(trimRow);elStrip.append(controls); const lower=h('div','arV6Lower'); const meter=h('div','arV6Meter');meter.dataset.meterId=ch.id; meter.dataset.format=ch.processingFormat||'MONO'; @@ -678,6 +715,32 @@ root.dataset.demo=String(!acceptedNative); root.dataset.armed=String(acceptedNative&&accepted?.productionCallbackLive===true&&!!d.outputArmed); } + function updateSelection(){ + for(const strip of root.querySelectorAll('[data-channel-id]')){ + const selected=selectedIds.has(strip.dataset.channelId); + strip.classList.toggle('isSelected',selected); + strip.setAttribute('aria-selected',String(selected)); + } + selectionCount.textContent=selectedIds.size+' SEL'; + } + function selectChannel(id,event){ + const channel=byId.get(id); + if(!channel||channel.role==='MAIN')return; + const visible=[...lanes.querySelectorAll('.arV6Strip:not([hidden])')] + .map(strip=>strip.dataset.channelId); + if(!visible.includes(id))return; + if(event.shiftKey&&selectionAnchor&&visible.includes(selectionAnchor)){ + if(!event.ctrlKey&&!event.metaKey)selectedIds.clear(); + const a=visible.indexOf(selectionAnchor),b=visible.indexOf(id); + for(const x of visible.slice(Math.min(a,b),Math.max(a,b)+1))selectedIds.add(x); + }else if(event.ctrlKey||event.metaKey){ + if(selectedIds.has(id))selectedIds.delete(id);else selectedIds.add(id); + selectionAnchor=id; + }else{ + selectedIds.clear();selectedIds.add(id);selectionAnchor=id; + } + updateSelection(); // No DSP or ConsoleIntent involved. + } function applyPresentation(){ const value=roleFilter.value; for(const strip of lanes.querySelectorAll('.arV6Strip')){ @@ -688,13 +751,15 @@ } // Presentational filters cannot alter native roster nor hide pinned MAIN. if(lanes.querySelector('.arV6Strip:not([hidden])')===null)lanes.scrollLeft=0; - refreshBanks(); + updateSelection();refreshBanks(); } function render(){ if(!accepted)return; updateHeader(); lanes.replaceChildren();main.replaceChildren(); const channels=accepted.graph.channels; + for(const id of selectedIds)if(!byId.has(id))selectedIds.delete(id); + if(selectionAnchor&&!byId.has(selectionAnchor))selectionAnchor=null; for(const ch of channels){ if(clean(ch.role).toUpperCase()==='MAIN')main.append(strip(ch,true)); else lanes.append(strip(ch)); @@ -714,7 +779,8 @@ for(const node of root.querySelectorAll('[data-op]')){ const op=node.dataset.op,id=node.dataset.id||null; node.disabled=!can(op,id)|| - op==='SET_SEND_LEVEL'&&node.dataset.hasAcceptedLevel!=='true'; + (op==='SET_SEND_LEVEL'&&node.dataset.hasAcceptedLevel!=='true')|| + ((op==='SET_TRIM'||op==='SET_CUE')&&node.dataset.acceptedKnown!=='true'); } add.disabled=!can('CREATE_CHANNEL'); const caps=accepted.graph.capabilities||{}; @@ -754,9 +820,20 @@ } const meter=strip.querySelector('[data-meter-id]'); if(meter)meter.dataset.format=ch.processingFormat||'MONO'; - for(const op of ['SET_MUTE','SET_SOLO']){ + for(const op of ['SET_MUTE','SET_SOLO','SET_CUE']){ const n=strip.querySelector('button[data-op="'+op+'"]'); - if(n)n.setAttribute('aria-pressed',String(!!ch.controls?.[op==='SET_MUTE'?'mute':'solo'])); + if(n)n.setAttribute('aria-pressed',String(!!ch.controls?.[ + op==='SET_MUTE'?'mute':op==='SET_SOLO'?'solo':'cue'])); + if(n&&op==='SET_CUE')n.dataset.acceptedKnown=String( + typeof ch.controls?.cue==='boolean'&&ch.role!=='MAIN'); + } + const trim=strip.querySelector('[data-op="SET_TRIM"]'); + if(trim){ + const known=typeof ch.controls?.trimDb==='number'&&Number.isFinite(ch.controls.trimDb); + trim.dataset.acceptedKnown=String(known); + trim.value=String(known?clamp(ch.controls.trimDb,-24,24):0); + const readout=strip.querySelector('.arV6TrimDb'); + if(readout)readout.textContent=known?ch.controls.trimDb.toFixed(1):'—'; } for(const node of strip.querySelectorAll('.arV6FxSlot')){ const fx=(ch.inserts||[]).find(x=>String(x.id)===node.dataset.fxId); @@ -894,6 +971,8 @@ if(!ch)return; if(op==='SET_MUTE')sendIntent(op,id,{value:!ch.controls?.mute}); else if(op==='SET_SOLO')sendIntent(op,id,{value:!ch.controls?.solo}); + else if(op==='SET_CUE'&&typeof ch.controls?.cue==='boolean') + sendIntent(op,id,{value:!ch.controls.cue}); else if(op==='SET_INSERT_BYPASS'){ const fx=(ch.inserts||[]).find(x=>String(x.id)===n.dataset.nativeInsertId); if(fx)sendIntent(op,id,{insertId:fx.id,bypassed:!fx.bypassed}); @@ -911,6 +990,11 @@ else showFeedback('UNAVAILABLE · Select a verified native VST3 first'); } }); + root.addEventListener('click',event=>{ + const strip=event.target.closest('.arV6Strip'); + if(!strip||event.target.closest('button,input,select,[draggable]'))return; + selectChannel(strip.dataset.channelId,event); + }); root.addEventListener('dblclick',event=>{ const n=event.target.closest('.arV6PanRange'); if(n&&!n.disabled)sendIntent('SET_PAN',n.dataset.id,{value:0}); @@ -930,6 +1014,11 @@ const value=Number(n.value),snapped=Math.abs(value)<=4?0:value; sendIntent(op,id,{value:snapped}); // ACK/snapshot, no optimistic PAN. } + else if(op==='SET_TRIM'){ + const db=Number(n.value); + if(typeof ch.controls?.trimDb==='number'&&Number.isFinite(db)) + sendIntent(op,id,{valueDb:clamp(db,-24,24)}); + } else if(op==='SET_SEND_LEVEL'){ const send=(ch.sends||[]).find(s=>String(s.id)===n.dataset.send); const value=Number(n.value); @@ -964,6 +1053,6 @@ window.__arMixV6ReadOnly=()=>({ nativePublisher:acceptedNative,revision:accepted?.graph?.revision??null, epoch:accepted?.device?.epoch??null,visibleChannelIds:[...byId.keys()], - pendingCount:pending.size,feedback + pendingCount:pending.size,selectedChannelIds:[...selectedIds],feedback }); })(); From 667e47be848a7e64f14d75328675baa1edaca51f Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Sun, 1 Nov 2026 14:52:32 +0700 Subject: [PATCH 139/233] test(gui): verify unique session request IDs and fail-closed native pin/cycle snapshots --- tests/operator_console_v6_smoke.py | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/tests/operator_console_v6_smoke.py b/tests/operator_console_v6_smoke.py index f1273986c..ec0bb7a54 100644 --- a/tests/operator_console_v6_smoke.py +++ b/tests/operator_console_v6_smoke.py @@ -126,6 +126,22 @@ async def main(): # A leading-zero alias must not be accepted even from the JUCE bridge. await page.evaluate("(s)=>window.__v6Test.publish('arMixConsoleSnapshot',s)", malformed) assert await page.locator("#arV6Console").is_hidden() + # A physical source must name an active endpoint that belongs to + # the SAME verified pin set, never a different active IN label. + wrong_pin=snapshot(revision=98) + wrong_pin["graph"]["channels"][1]["source"]={"portId":"in:0","physicalPins":[1]} + await page.evaluate("(s)=>window.__v6Test.publish('arMixConsoleSnapshot',s)",wrong_pin) + assert await page.locator("#arV6Console").is_hidden() + inactive_pin=snapshot(revision=98) + inactive_pin["device"]["inputEndpoints"][1]["active"]=False + await page.evaluate("(s)=>window.__v6Test.publish('arMixConsoleSnapshot',s)",inactive_pin) + assert await page.locator("#arV6Console").is_hidden() + # Native feedback-loop defects must fail closed before UI admission. + cyclic=snapshot(revision=98) + cyclic["graph"]["channels"][-3]["primaryOutId"]="1002" + cyclic["graph"]["channels"][-2]["primaryOutId"]="1001" + await page.evaluate("(s)=>window.__v6Test.publish('arMixConsoleSnapshot',s)",cyclic) + assert await page.locator("#arV6Console").is_hidden() await page.evaluate("(s)=>window.__v6Test.publish('arMixConsoleSnapshot',s)", first) await page.locator("#arV6Console").wait_for(state="visible") assert await page.locator("#arV6Lanes .arV6Strip").count() == 12 @@ -254,7 +270,12 @@ async def aligned_sections(): x => x.event === 'arMixConsoleIntent').at(-1).payload""") assert sent["operation"] == "SET_SOURCE" and sent["targetChannelId"] == "7" assert sent["baseGraphRevision"] == "3" and sent["deviceEpoch"] == "7" - assert sent["baseRosterRevision"] == "3" and sent["requestId"].startswith("gui-") and sent["requestId"].endswith(":1") + assert sent["baseRosterRevision"] == "3" + ids=await page.evaluate("""()=>window.__v6Test.sent.filter( + x=>x.event==='arMixConsoleIntent').map(x=>x.payload.requestId)""") + assert len(ids)==len(set(ids)) and all( + x.startswith("gui-") and x.rsplit(":",1)[-1].isdigit() for x in ids) + assert ids[-1]==sent["requestId"] assert sent["payload"] == {"portId":"in:0"} assert await page.locator('[data-op="SET_SOURCE"][data-id="7"]').input_value() == "" assert "PENDING" in await page.locator(".arV6Message").inner_text() From 157bf6950b6cf3943b60ea45daf6e142a9f14cb7 Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Sun, 1 Nov 2026 14:53:42 +0700 Subject: [PATCH 140/233] fix(engine/RT): preserve 64-sample channel MUTE/PRE-send envelope across variable JUCE callback sizes; source/VST identity PCM regression --- engine/core/PreparedMixerBlock.h | 26 +++++++++++++++++++++----- tests/live_channel_fx_graph_test.cpp | 21 +++++++++++++++++++++ 2 files changed, 42 insertions(+), 5 deletions(-) diff --git a/engine/core/PreparedMixerBlock.h b/engine/core/PreparedMixerBlock.h index 7d58a411f..038803ecb 100644 --- a/engine/core/PreparedMixerBlock.h +++ b/engine/core/PreparedMixerBlock.h @@ -411,18 +411,32 @@ class PreparedMixerBlock final { const float targetGate=routeAudible?1.f:0.f; if(!rampPrimed_[strip]) { preGate_[strip]=targetGate; + preGateTarget_[strip]=targetGate; + preRampRemaining_[strip]=0; lastGainL_[strip]=gl; lastGainR_[strip]=gr; rampPrimed_[strip]=true; } - const int ramp=std::min(frames,64); - const float dGate=(targetGate-preGate_[strip])/ramp; + // The MUTE/PRE-SEND de-click is 64 AUDIO SAMPLES, not one + // callback: variable 4/16/32-frame JUCE quanta must not turn + // a musical 64-frame transition into a hard-edge pop. + // The target can reverse mid-ramp; continue from the current + // coefficient and restart a full 64-sample envelope. + if(targetGate!=preGateTarget_[strip]) { + preGateTarget_[strip]=targetGate; + preRampRemaining_[strip]=64; + } float gate=preGate_[strip]; + int remaining=preRampRemaining_[strip]; for(int f=0;f0) { + gate+=(targetGate-gate)/static_cast(remaining); + --remaining; + } else gate=targetGate; l[f]*=gate;r[f]*=gate; } - preGate_[strip]=targetGate; + preGate_[strip]=gate; + preRampRemaining_[strip]=remaining; } graph.sends.dispatch(strip,SendTap::preFader,l,r, left_.data(),right_.data(),frames); @@ -577,7 +591,9 @@ class PreparedMixerBlock final { std::array left_{}; std::array right_{}; std::array auxLeft_{},auxRight_{}; - std::array preGate_{},lastGainL_{},lastGainR_{}; + std::array preGate_{},preGateTarget_{}, + lastGainL_{},lastGainR_{}; + std::array preRampRemaining_{}; std::array,stripCount> physicalTarget_{}; std::array physicalBlend_{}; std::array,maxAuxSends> auxTarget_{}; diff --git a/tests/live_channel_fx_graph_test.cpp b/tests/live_channel_fx_graph_test.cpp index cd8eca838..b231237bb 100644 --- a/tests/live_channel_fx_graph_test.cpp +++ b/tests/live_channel_fx_graph_test.cpp @@ -761,6 +761,18 @@ static void verifyFirstSoundOnePinNativeSourceDraft() { mainL[1]/mic[1]>mainL[2]/mic[2]); assert(mainR[0]/mic[0]>mainR[1]/mic[1] && mainR[1]/mic[1]>mainR[2]/mic[2]); + assert(mainL[3]>0.f && mainR[3]>0.f); // 4/64 frames, not a hard mute + // Sixteen small callback blocks complete EXACTLY the same 64-sample + // ramp as one 64-frame callback, without RT heap allocations. + float previousTail=mainL[3]/mic[3]; + for(int blockIndex=1;blockIndex<16;++blockIndex) { + const auto heapBefore=heapCalls.load(std::memory_order_relaxed); + assert(production.process(nativePins,1,mainL.data(),mainR.data(),4,&levels)); + assert(heapCalls.load(std::memory_order_relaxed)==heapBefore); + const float normalizedTail=mainL[3]/mic[3]; + assert(normalizedTail<=previousTail+1.e-5f); + previousTail=normalizedTail; + } assert(near(mainL[3],0.f) && near(mainR[3],0.f)); mainL.fill(1.f);mainR.fill(1.f); assert(production.process(nativePins,1,mainL.data(),mainR.data(),4,&levels)); @@ -769,6 +781,15 @@ static void verifyFirstSoundOnePinNativeSourceDraft() { assert(production.setStripControl(6,.25f,0.f,true,false,false)); assert(production.process(nativePins,1,mainL.data(),mainR.data(),4,&levels)); assert(mainL[0]>0.f&&mainR[0]>0.f); + assert(mainL[3]>mainL[0]); // unmute ramps, never spikes to unity + for(int k=1;k<16;++k) + assert(production.process(nativePins,1,mainL.data(),mainR.data(),4,&levels)); + assert(mainL[3]>0.f); + // A rapid re-MUTE in the middle of an unmute envelope does not + // interpolate from stale unity or introduce a discontinuity. + assert(production.setStripControl(6,.25f,0.f,true,true,false)); + assert(production.process(nativePins,1,mainL.data(),mainR.data(),4,&levels)); + assert(mainL[0]>0.f); juce::var denied; assert(NativeVerifiedSourcePatch::prepare(typed,6,"STEREO",5,5, physical,17,9,denied).isNotEmpty()); From 53b9e550a13efb1234ff24d845e5af3f53c942ab Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Sun, 1 Nov 2026 15:05:20 +0700 Subject: [PATCH 141/233] feat(gui): native device inventory drawer and verified MAIN hardware-output isolation --- AR-MIX-Live-FX-Host-Standalone-v0.3.html | 123 +++++++++++++++++++++-- web/mixer-layout.css | 30 ++++++ web/mixer-layout.js | 93 +++++++++++++++-- 3 files changed, 230 insertions(+), 16 deletions(-) diff --git a/AR-MIX-Live-FX-Host-Standalone-v0.3.html b/AR-MIX-Live-FX-Host-Standalone-v0.3.html index 7ef03fd17..f36250019 100644 --- a/AR-MIX-Live-FX-Host-Standalone-v0.3.html +++ b/AR-MIX-Live-FX-Host-Standalone-v0.3.html @@ -2433,6 +2433,36 @@ #app .arV6Console .arV6Trim{height:16px;font-size:8px;gap:2px} #app .arV6Console .arV6TrimLevel{height:12px} } + + +/* v5.2 one-Console DEVICE drawer: native hardware inventory only, no + fake setup wizard, no full-window modal and no fader DOM reflow. */ +#app .arV6Console{position:relative} +#app .arV6Console .arV6DevicePanel{ + position:absolute;z-index:20;top:52px;right:8px; + display:flex;flex-direction:column; + width:min(420px,calc(100% - 16px));max-height:min(72vh,530px); + overflow:hidden;background:#1a2a34;color:#d4e5eb; + border:1px solid #668693;border-radius:4px; + box-shadow:0 8px 25px #071019aa; +} +#app .arV6Console .arV6DevicePanel[hidden]{display:none!important} +#app .arV6Console .arV6DevicePanelHead{ + display:flex;justify-content:space-between;align-items:center; + gap:6px;min-height:35px;padding:5px 10px;background:#304651; + border-bottom:1px solid #456370; + font:600 10px/1.2 "Segoe UI",sans-serif; +} +#app .arV6Console .arV6DevicePanelHead .arV6Button{min-height:23px;min-width:26px;padding:2px} +#app .arV6Console .arV6DeviceRows{padding:5px 10px 10px;overflow-y:auto} +#app .arV6Console .arV6DeviceRow{ + display:grid;grid-template-columns:95px minmax(0,1fr);gap:8px; + padding:5px 0;border-bottom:1px solid #324954;font:10px/1.45 "Segoe UI",sans-serif; +} +#app .arV6Console .arV6DeviceRow span{color:#8fb5c4} +#app .arV6Console .arV6DeviceRow strong{font-weight:500;overflow-wrap:anywhere} +#app .arV6Console .arV6DeviceNote{margin:9px 0 2px;color:#c5ad86;font:10px/1.5 "Segoe UI",sans-serif} +@media(max-width:1100px){#app .arV6Console .arV6DevicePanel{top:45px}} ')); +assert.ok(html.includes('')); +assert.ok(html.includes('')); +assert.ok(html.includes('')); +console.log('PASS: V6 native Console material, dual identity, guarded inline rename, bank arrows and standalone parity'); diff --git a/web/app.js b/web/app.js index 5cfc3a4a9..54b9ce586 100644 --- a/web/app.js +++ b/web/app.js @@ -266,19 +266,38 @@ function closeChannelIdentity(){ document.querySelectorAll('.strip.identity-editing').forEach(el=>el.classList.remove('identity-editing')); } function commitChannelIdentity(){ - if(editingChannel<0)return;const index=editingChannel; - const name=$('identityName').value.trim().replace(/\s+/g,' ').slice(0,26); + if(editingChannel<0)return; + const index=editingChannel, name=$('identityName').value.trim().replace(/\s+/g,' ').slice(0,26); if(!name){flash('Enter a channel name');$('identityName').focus();return} - channels[index].name=name;channels[index].icon=channelIcons.includes(editingIcon)?editingIcon:'♩'; - channels[index].color=channelPalette.includes(editingColor)?editingColor:colors[index]; - closeChannelIdentity();currentChannel=index;renderMixer(); + if(channels.some((c,i)=>i!==index&&c.name.trim().toLowerCase()===name.toLowerCase())){ + flash('Channel name already used');$('identityName').focus();return; + } + const ch=channels[index]; + ch.name=name;ch.icon=channelIcons.includes(editingIcon)?editingIcon:'♩'; + ch.color=channelPalette.includes(editingColor)?editingColor:colors[index]; + closeChannelIdentity();currentChannel=index; + // UI identity is not a native graph change. Do not remount any live FX/fader node. + const strip=document.querySelector('#mixer [data-strip="'+index+'"]'); + if(strip){ + strip.style.setProperty('--ch',ch.color); + for(const [sel,val] of [['.arChannelTopName',ch.name],['.arChannelTopIcon',ch.icon], + ['.strip-name .strip-caption',ch.name],['.strip-name .track-icon',ch.icon]]){ + const item=strip.querySelector(sel);if(item)item.textContent=val; + } + strip.querySelector('[data-identity-open]')?.setAttribute('aria-label','Edit '+ch.name+' name, icon and color'); + strip.querySelector('[data-editstrip]')?.setAttribute('aria-label','Double-click to edit '+ch.name+' name, icon and color'); + strip.querySelector('[data-fader]')?.setAttribute('aria-label',ch.name+' fader'); + const meter=strip.querySelector('.vu-bank'); + if(meter)meter.setAttribute('aria-label',ch.name+(ch.stereo?' stereo left and right meters':' mono meter')); + } + createSide(); if(view==='FX RACK')renderRackWorkspace(); - persistSession();flash('Channel identity updated'); + persistSession();flash('Channel label updated · native audio route unchanged'); } window.addEventListener('resize',positionChannelIdentity); $('mixer').addEventListener('scroll',positionChannelIdentity,{passive:true}); function makeStrip(ch,i){let inserts=ch.inserts.slice(0,6);while(inserts.length<6) inserts.push('');return `
-
${i+1}
${inserts.map((n,j)=>`
${n?``:''}
`).join('')}
+
CH ${String(i+1).padStart(2,'0')}
${inserts.map((n,j)=>`
${n?``:''}
`).join('')}
TRIM
dB
${fmt(ch.trim)}
${knobMarkup('trim',i,ch.trim,'Trim')}
${panMarkup(ch,i)}
${panText(ch.pan)}
${fmt(ch.fader)}
${ch.stereo?meterUnit(String(i)+'L','L')+meterUnit(String(i)+'R','R'):meterUnit(String(i),'')}${meterScaleMarkup()}
${faderScaleMarkup()}
@@ -305,7 +324,7 @@ function syncStripFormat(i,format){ window.__arMixSyncAcceptedChannelFormat=syncStripFormat; function renderMixer(){ const x=$('mixer'),scroll=x.scrollLeft; - x.innerHTML=channels.map(makeStrip).join('')+'
'; + x.innerHTML=channels.map(makeStrip).join('')+'
'; renderMaster();x.scrollLeft=scroll;createSide(); } let masterGain=-.1,masterPan=0,masterMute=false,masterMono=false,phones=-12,masterInserts=['Studio EQ','Brickwall Limiter'],masterBypassed={},pendingMasterSlot=null; @@ -327,7 +346,7 @@ const meterPercentToDbfs=p=>clamp(p,0,100)*.6-60; function meterUnit(key,label){return `
`} function renderMaster(){ const host=$('masterLeft');if(!host)return; - host.innerHTML=`
MASTER
+ host.innerHTML=`
MAIN
${masterFxRows()}
@@ -449,6 +468,11 @@ document.addEventListener('click',e=>{const b=e.target.closest('button,[data-cho if(b.dataset.pluginManager!==undefined){flash('Plugin Manager is available in the Windows desktop app');return} if(b.dataset.mySounds!==undefined){flash('Native VST3 presets are available in the Windows desktop app');return} if(b.dataset.choose!==undefined){chooseChannel(+b.dataset.choose);return} + if(b.dataset.identityOpen!==undefined){ + const index=Number(b.dataset.identityOpen); + if(Number.isInteger(index)&&index>=0&&index=channels.length)return; diff --git a/web/mixer-layout.css b/web/mixer-layout.css index 449cc8a23..b618f7096 100644 --- a/web/mixer-layout.css +++ b/web/mixer-layout.css @@ -1156,3 +1156,88 @@ #app .arV6Console .arV6QuickPanel{max-height:62vh} #app .arV6Console .arV6CatalogFilters{gap:3px} } + + +/* PR#278 V6 theme authority ported to actual WebView M4. No native DSP changes. */ +#app{--am-metal-base:#0B161E;--am-metal-panel:#14232C;--am-metal-raised:#20313B; + --am-metal-edge:#334956;--am-metal-inset:#030A0F;--am-text-primary:#DAE9EF; + --am-text-muted:#94B1BD;--am-accent:#66CBDD;--am-crystal:#E7EFF0} +#app .toolbar{background:linear-gradient(#253741,#17252e)!important;border-bottom:1px solid var(--am-metal-edge)} +#app .toolbar-actions.arSegmentedToolbar .nav .btn-180, +#app .toolbar .spec-device,#app .arMixerChannelPager .btn-180{ + height:29px;min-height:29px;max-height:29px;display:inline-flex; + align-items:center;justify-content:center;line-height:1;text-align:center;box-sizing:border-box} +#app .arMixerChannelPager .btn-180{width:29px;min-width:29px;padding:0;--b180-ink:#1f1f1f} +#app .arMixerChannelPager svg{display:block;flex:none;width:24px;height:24px;fill:currentColor} +#app .left-rail{background:var(--am-metal-base)} +#app .left-rail :is(.arRailModeSection,.arRailUtilities){background:var(--am-metal-panel)} +#app .left-rail :is(.arRailHeading,.rail-section-title){background:var(--am-metal-raised);border-color:var(--am-metal-edge)} +#app #mixer[data-io-mode="CONSOLE"]{background:var(--am-metal-base)} +#app #mixer[data-io-mode="CONSOLE"] > .strip[data-strip]{ + background:linear-gradient(90deg,#0e1b23,var(--am-metal-panel) 8%,#172832 92%,#0e1b23); + border-right:1px solid var(--am-metal-edge);box-shadow:inset 1px 0 #aecbd012} +#app #mixer[data-io-mode="CONSOLE"] > .strip[data-strip].selected{ + background:linear-gradient(90deg,#172b35,var(--am-metal-raised) 9%,#1a303b 93%,#122630); + box-shadow:inset 2px 0 var(--am-accent)} +/* Both identity nameplates use the SAME stable --ch source (no second palette). */ +#app #mixer[data-io-mode="CONSOLE"] > .strip[data-strip] > :is(.ch-id,.strip-name), +#app #mixer[data-io-mode="CONSOLE"] #masterLeft > :is(.master-ch-id,.master-strip-name){ + background:color-mix(in srgb,var(--ch) 43%,#101e27)!important; + color:#f0f7fa;border-top:2px solid var(--ch); + border-bottom:1px solid color-mix(in srgb,var(--ch) 49%,#0c1820);text-shadow:0 1px #02080a} +#app #mixer[data-io-mode="CONSOLE"] > .strip[data-strip] > .ch-id{ + display:flex;align-items:center;gap:3px;padding:0 31px 0 5px; + font:500 10px/1.1 "Segoe UI",sans-serif} +#app #mixer[data-io-mode="CONSOLE"] .arChannelNumber{flex:0 0 30px;white-space:nowrap; + color:#e0edf1;font:600 9px/1 Consolas,monospace} +#app #mixer[data-io-mode="CONSOLE"] .arChannelTopIdentity{ + display:flex;align-items:center;gap:3px;flex:1;min-width:0;max-width:100%; + padding:3px 1px;margin:0;border:0;border-radius:2px;background:transparent; + font:500 10px/1.1 "Segoe UI",sans-serif;color:#f2f8fa;cursor:pointer;text-align:left} +#app #mixer[data-io-mode="CONSOLE"] .arChannelTopIdentity:focus-visible{ + outline:1px solid #d7f5f9;outline-offset:0} +#app #mixer[data-io-mode="CONSOLE"] .arChannelTopIcon{flex:none;font-size:13px;line-height:1} +#app #mixer[data-io-mode="CONSOLE"] .arChannelTopName{min-width:0;overflow:hidden; + white-space:nowrap;text-overflow:ellipsis} +#app #mixer[data-io-mode="CONSOLE"] .arFormatBadge{ + right:4px;top:6px;min-height:19px;height:19px; + background:var(--am-metal-inset);border-color:#638594;color:#e4f5f8} +#app #mixer[data-io-mode="CONSOLE"] > .strip[data-strip] > .strip-name{ + display:flex;flex-direction:row;align-items:center;justify-content:center; + gap:5px;padding:3px 6px;overflow:hidden;font:500 10px/1.1 "Segoe UI",sans-serif} +#app #mixer[data-io-mode="CONSOLE"] .strip-name .strip-caption{ + min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap} +#app #mixer[data-io-mode="CONSOLE"] .strip-name .track-icon{flex:none;font-size:14px;line-height:1} +#app #mixer[data-io-mode="CONSOLE"] #masterLeft > .master-ch-id{ + display:flex;justify-content:space-between;align-items:center;padding:0 8px; + color:#f9f0f3;font:500 11px/1 "Segoe UI",sans-serif} +#app #mixer[data-io-mode="CONSOLE"] .arMasterTopIdentity{ + display:inline-flex;align-items:center;gap:4px;font-size:10px} +#app #mixer[data-io-mode="CONSOLE"] > .strip[data-strip] > .arChannelBank, +#app #mixer[data-io-mode="CONSOLE"] > .strip[data-strip] > .rack, +#app #mixer[data-io-mode="CONSOLE"] #masterLeft .master-fx-rack, +#app #mixer[data-io-mode="CONSOLE"] #masterLeft .arMainOutSummary, +#app #mixer[data-io-mode="CONSOLE"] > .strip[data-strip] > .strip-controls{ + background:var(--am-metal-panel);border-color:var(--am-metal-edge)} +#app #mixer[data-io-mode="CONSOLE"] .arChannelBank :is(.arBankSource,.arBankOutput,.arBankChannelFormat){ + background:var(--am-metal-inset);border:1px solid #425d6a; + color:var(--am-text-primary);box-shadow:inset 0 1px 2px #0006} +#app #mixer[data-io-mode="CONSOLE"] .arChannelBank .arSendBank{border-top-color:var(--am-metal-edge)} +#app #mixer[data-io-mode="CONSOLE"] .arChannelBank .arSendChip{ + background:var(--am-metal-raised);border-color:var(--am-metal-edge);color:var(--am-text-primary)} +#app #mixer[data-io-mode="CONSOLE"] .rack .insert, +#app #mixer[data-io-mode="CONSOLE"] #masterLeft .master-insert{ + background:linear-gradient(#283b46,#192b35);border:1px solid #39515c;color:var(--am-text-primary)} +#app #mixer[data-io-mode="CONSOLE"] .rack .insert.empty{ + border:1px dashed #3c5967;color:#a3c8d2} +#app #mixer[data-io-mode="CONSOLE"] #masterLeft .master-controls-zone{ + background:var(--am-metal-panel);border-color:var(--am-metal-edge)} +#app #mixer[data-io-mode="CONSOLE"] .channel-actions{ + background:var(--am-metal-raised);border-color:var(--am-metal-edge)} +#app #mixer[data-io-mode="CONSOLE"] .db-display{ + background:var(--am-metal-panel);color:var(--am-accent)} +#app #mixer[data-io-mode="CONSOLE"] > #masterLeft{ + background:var(--am-metal-panel);border-left-color:#997888} +#app #mixer[data-io-mode="CONSOLE"] #masterLeft .arMainOutAction{ + background:var(--am-metal-inset);color:var(--am-text-primary);border-color:var(--am-metal-edge)} +/* Real fader PNG, RAIL3 well, meter geometry and seven-shadow BTN-180 preserved. */ diff --git a/web/mixer-layout.js b/web/mixer-layout.js index a66328570..2dfb9c169 100644 --- a/web/mixer-layout.js +++ b/web/mixer-layout.js @@ -73,10 +73,10 @@ const mixer=document.getElementById('mixer'); if(mixer&&!document.getElementById('arMixChannelPager')){ const pager=document.createElement('div');pager.id='arMixChannelPager';pager.className='arMixerChannelPager'; - const prev=document.createElement('button');prev.type='button';prev.className='btn-180';prev.textContent='‹'; + const prev=document.createElement('button');prev.type='button';prev.className='btn-180';prev.innerHTML=''; prev.setAttribute('aria-label','Previous mixer channel bank'); const label=document.createElement('span');label.className='arMixerPagerLabel'; - const next=document.createElement('button');next.type='button';next.className='btn-180';next.textContent='›'; + const next=document.createElement('button');next.type='button';next.className='btn-180';next.innerHTML=''; next.setAttribute('aria-label','Next mixer channel bank'); pager.append(prev,label,next);nav.parentElement?.append(pager); const strips=()=>[...mixer.querySelectorAll('[data-strip]')]; diff --git a/web/styles-src/20-button-180.css b/web/styles-src/20-button-180.css index c217cfe70..a82dd60a3 100644 --- a/web/styles-src/20-button-180.css +++ b/web/styles-src/20-button-180.css @@ -3,7 +3,7 @@ Semantic colors alone define the latched state; only the transient :active pointer press moves the cap inward by 1px without changing its layout slot. */ :root{ - --b180-off:#cbd1d1;--b180-edge:#747f7f;--b180-off-ink:#172229; + --b180-off:#E7EFF0;--b180-edge:#747f7f;--b180-off-ink:#172229; --b180-color:var(--b180-off);--b180-border:var(--b180-edge); --b180-ink:var(--b180-off-ink); --b180-on-cyan:#94e8ed;--b180-on-green:#91edac; diff --git a/web/styles.css b/web/styles.css index 74a63fe13..8483175cb 100644 --- a/web/styles.css +++ b/web/styles.css @@ -611,7 +611,7 @@ html[data-mixperf="baseline"] .toolbar .spec-device:hover{border-color:#3586a2} Semantic colors alone define the latched state; only the transient :active pointer press moves the cap inward by 1px without changing its layout slot. */ :root{ - --b180-off:#cbd1d1;--b180-edge:#747f7f;--b180-off-ink:#172229; + --b180-off:#E7EFF0;--b180-edge:#747f7f;--b180-off-ink:#172229; --b180-color:var(--b180-off);--b180-border:var(--b180-edge); --b180-ink:var(--b180-off-ink); --b180-on-cyan:#94e8ed;--b180-on-green:#91edac; From c0c79cdfcde62633c3351c20156cfb22de7abf7c Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Sun, 1 Nov 2026 19:23:15 +0700 Subject: [PATCH 176/233] test(gui): pin brighter V6 BTN180 and run visual identity contract in smoke suite --- tests/button_asset_test.py | 4 +++- tests/mixer_shell_contract_test.mjs | 3 +++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/tests/button_asset_test.py b/tests/button_asset_test.py index 26d835420..7e34d1445 100644 --- a/tests/button_asset_test.py +++ b/tests/button_asset_test.py @@ -26,7 +26,9 @@ 'display:inline-flex', 'inset 5px 5px 2px -1px rgba(0,0,0,.18)' ): assert ''.join(rule.split()) in compact,rule -assert '--b180-off:#cbd1d1' in css +# PR#278 V6 owner-approved brighter OFF plastic; keep all original seven shadows. +assert '--b180-off:#E7EFF0' in css +assert '--b180-off:#E7EFF0' in (root/'web/styles-src/20-button-180.css').read_text(encoding='utf8') assert '--b180-edge:#747f7f' in css assert '--b180-off-ink:#172229' in css assert '--b180-ink:var(--b180-off-ink)' in css diff --git a/tests/mixer_shell_contract_test.mjs b/tests/mixer_shell_contract_test.mjs index b0eed7c43..ba728e7ad 100644 --- a/tests/mixer_shell_contract_test.mjs +++ b/tests/mixer_shell_contract_test.mjs @@ -180,3 +180,6 @@ test('standalone preview uses the same source-owned app and mixer shell',()=>{ assert.match(builder,/script_start=built\.index\(' + diff --git a/README.md b/README.md index c061fd755..bb91240b6 100644 --- a/README.md +++ b/README.md @@ -1,15 +1,20 @@ +> **PRIMARY ARSONMIX GUI AUTHORITY — PR #278 V8 (2 November 2026).** The approved operator experience is [PR #278's Audition-style single Mixer Console](https://github.com/masarray/arsonmix/pull/278), with Studio One fast workflows and the latest [V8 adaptive geometry rules](https://github.com/masarray/arsonmix/blob/design/audition-mixer-reference-isolated-20261101/design-references/audition-mixer-study/V8_ADAPTIVE_BANK_COLLAPSE_ACCEPTANCE_20261102.md). It supersedes competing GUI concepts, legacy multi-workspace/default Audio Setup navigation and outdated v6/v7 operator-layout prescriptions. **Production owner:** [GUI #271](https://github.com/masarray/arsonmix/pull/271) maps this design to the actual native WebView. **Audio owner:** [ENGINE #266](https://github.com/masarray/arsonmix/pull/266) provides one JUCE callback and true PCM/ChannelId/VST3. **Release owner:** [FAT #270](https://github.com/masarray/arsonmix/pull/270) enforces one same-source integration gate in [epic #192](https://github.com/masarray/arsonmix/issues/192). + +> **Current normative product + architecture:** [PRD v5.2 §9](docs/PRD_ARSONMIX_OPERATOR_FIRST_LIVE_MIXER_V5_20261101.md#9-normative-v52-product-design-lock--user-approved-pr-278-mixer-workflow) · [ARD v5.2 §K](docs/ARD_ARSONMIX_UNIVERSAL_REALTIME_CONSOLE_V5_20261101.md#k-normative-v52-design-to-native-execution-contract--pr-278-reference) · [Puzzle Socket v8](docs/PUZZLE_INTEGRATION_CONTRACT_V8_20261101.md). Earlier v6/v7 release-train and design documents are historical references, **not alternative active GUI authority**. The PR #278 HTML is a **SIMULATED VISUAL REFERENCE, NOT NATIVE AUDIO**; never merge its fake meters/plugin catalog/PCM into production. No partial EXE customer UAT, no claim of shipped universal ChannelId callback until one integrated exact-SHA Windows native + Chromium + hardware qualification passes. + # ArSonMix — Native Realtime Live Mixer and VST3 Host A Windows-first **live performance digital mixing console** for stage, karaoke, podcast/radio and flexible physical/virtual output, using the *console workflows* of Studio One / Adobe Audition and *live banking/routing* concepts of Waves eMotion LV1. Not a timeline/DAW audio editor, recorder or OBS-only utility. ## One source of truth -- [PRD v5 — Operator-first product](docs/PRD_ARSONMIX_OPERATOR_FIRST_LIVE_MIXER_V5_20261101.md) -- [ARD v5 — Universal ChannelId architecture](docs/ARD_ARSONMIX_UNIVERSAL_REALTIME_CONSOLE_V5_20261101.md) -- [EXECUTION LOCK v6 — one delivery path, parallel ownership, exact acceptance](docs/EXECUTION_LOCK_UNIVERSAL_LIVE_CONSOLE_V6_20261101.md) -- [ENGINE workstream](docs/workstreams/ENGINE_UNIVERSAL_CONSOLE_V6.md) · [GUI workstream](docs/workstreams/GUI_OPERATOR_CONSOLE_V6.md) · [INTEGRATION/FAT workstream](docs/workstreams/INTEGRATION_FAT_CONSOLE_V6.md) +- [Approved PR #278 V8 GUI design](https://github.com/masarray/arsonmix/pull/278) and [isolated study](https://github.com/masarray/arsonmix/blob/design/audition-mixer-reference-isolated-20261101/design-references/audition-mixer-study/index.html) — visual reference only +- [PRD v5.2 — Operator-first live mixer](docs/PRD_ARSONMIX_OPERATOR_FIRST_LIVE_MIXER_V5_20261101.md) +- [ARD v5.2 — Native Console and realtime safety](docs/ARD_ARSONMIX_UNIVERSAL_REALTIME_CONSOLE_V5_20261101.md) +- [Puzzle Socket v8 — one native source ABI](docs/PUZZLE_INTEGRATION_CONTRACT_V8_20261101.md) +- [Current owner packets: ENGINE](docs/workstreams/ENGINE_PUZZLE_V8.md) · [GUI](docs/workstreams/GUI_PUZZLE_V8.md) · [INTEGRATION/FAT](docs/workstreams/FAT_PUZZLE_V8.md) - [AGENTS.md](AGENTS.md) is mandatory for active contributors. Prior G1/G2/R5/L2 dated plans remain in Git history, not current execution authority. -## Verified actual status (2026-11-01 snapshot) +## Historical verified M4 audio boundary (2026-11-01 snapshot; NOT a claim of current universal release) `main@bb6dff6b42158ba2db4666e0def54bb89abda4f8`: one primary JUCE callback processes **fixed 10 input channels + four AUX**, native MAIN/MONITOR and occupied legacy CH1 VST3/Orbit special path. Windows CI [41263965810](https://github.com/masarray/arsonmix/actions/runs/41263965810) PASS and Chromium [41263965813](https://github.com/masarray/arsonmix/actions/runs/41263965813) PASS; Windows FAT artifact available, **not hardware certified**. Engine [PR #266](https://github.com/masarray/arsonmix/pull/266) is an offline universal publisher/VST lease preparation, NOT yet the live callback cutover. Independent dynamic CH11, Group and FX Return **not shipped**. Zero-FX acoustic crackle [#15](https://github.com/masarray/arsonmix/issues/15) unresolved. ### Product completion means audibly real, not just a fancy UI @@ -18,17 +23,26 @@ Choose device once, then directly from the console: ## Active work and GitHub ownership - Native publisher/full-fidelity callback/CH1 FX migration: [draft PR #266](https://github.com/masarray/arsonmix/pull/266). -- New compact single-screen, native-state-driven console: [GUI issue #268](https://github.com/masarray/arsonmix/issues/268), branch `work/operator-console-v6`. +- Approved GUI/UX visual authority: [PR #278](https://github.com/masarray/arsonmix/pull/278). Its browser demo is not native audio; [GUI #271](https://github.com/masarray/arsonmix/pull/271) owns the real native-state-driven production adaptation. - Unified product acceptance/reconciliation: [epic #192](https://github.com/masarray/arsonmix/issues/192). - Physical sound/crackle blocker: [#15](https://github.com/masarray/arsonmix/issues/15). -- Execution orchestration document PR: [#267](https://github.com/masarray/arsonmix/pull/267). +- Product integration owner: [FAT #270](https://github.com/masarray/arsonmix/pull/270), enforcing exact SHA + PR #278 visual authority without replacing DSP. One accepted stable-ChannelId graph, one JUCE realtime callback, one native VST3 owner, one request/ACK truth. Continuous controls do not trigger device restart; structural edits prepare safely off callback. Native accepted capability gates UI; **no fake CH11/FX/PCM**. Operator-selected legal I/O only; correct device buffering and plugin latency disclosures, not '0ms' guarantees. ## Browser preview, native builds and QA -Browser preview: https://masarray.github.io/arsonmix/preview/mixer.html (UI demo **not real DSP proof**). Source: https://github.com/masarray/arsonmix. Windows x64 native packages: [Windows Actions workflow](https://github.com/masarray/arsonmix/actions/workflows/p1-windows.yml). Download only a successful exact-source-SHA artifact; verify `BUILD_PROVENANCE.json` and EXE SHA-256, install WebView2/real device driver, test at safe headphone volume. +**Primary approved PR #278 V8 GUI study preview:** https://masarray.github.io/arsonmix/preview/mixer.html (visual reference / simulated meters, **NO REAL AUDIO**). Alternate preview route `/preview-v2/` points to the same isolated design study; it is not a second release GUI. Source: https://github.com/masarray/arsonmix. Windows x64 native packages: [Windows Actions workflow](https://github.com/masarray/arsonmix/actions/workflows/p1-windows.yml). Download only a successful exact-source-SHA artifact; verify `BUILD_PROVENANCE.json` and EXE SHA-256, install WebView2/real device driver, test at safe headphone volume. Use owner CSS `web/styles-src/**` and deterministic `scripts/build_ui_css.py` regeneration; avoid manual generated HTML drift. Read full failing CI logs, run targeted tests, then one Windows/CTest and Chromium gate at meaningful vertical checkpoints. For physical clicks use SIGNAL CHECK → MARK CRACKLE → COPY FULL REPORT. Real-device 0FX and loaded-FX performance must be signed off before release. ## Licenses and distribution Respect source/SDK licenses. Third-party VST3 files remain in user-controlled private Studio vault; do not bundle unlicensed commercial plugins. FactoryFX requires signed/provenance-approved host-qualified packages. Reference workflows, never copy proprietary Audition/Studio One/LV1 artwork. + +## Historical diagnostics and visual references (NOT active execution authority) + +Retained for traceable physical hardware diagnostics under [#15](https://github.com/masarray/arsonmix/issues/15): +- [Smart Audio Engine ARD — archival render/device-clock analysis](docs/ARD_SMART_AUDIO_ENGINE_V1_2026-10-25.md). +- [Smart Audio Engine Implementation Blueprint — archival ASIO/WASAPI FAT details](docs/SMART_AUDIO_ENGINE_IMPLEMENTATION_BLUEPRINT.md). +- [Original approved GUI baseline — archival visual comparison](docs/GUI_BASELINE_LOCK_2026-10-25.md). + +These explain prior device-clock evidence and fader/LED design. For **current feature architecture, priority and execution**, the PRD/ARD v5 and execution lock v6 at the top of this document take precedence. The historical specs do not override native ChannelId admission or justify an extra render callback. diff --git a/scripts/build_ui_css.py b/scripts/build_ui_css.py index 86f81f5f2..0f3b79676 100644 --- a/scripts/build_ui_css.py +++ b/scripts/build_ui_css.py @@ -3,7 +3,7 @@ import argparse ROOT=Path(__file__).resolve().parents[1] SOURCE=ROOT/'web/styles-src' -MODULES=('00-font-and-assets.css','10-console-legacy.css','20-button-180.css','21-navigation-fx-power.css','30-selection-effects.css','40-rail-pan.css','41-mixer-performance.css','42-mixer-premium.css') +MODULES=('00-font-and-assets.css','10-console-legacy.css','20-button-180.css','21-navigation-fx-power.css','30-selection-effects.css','40-rail-pan.css','41-mixer-performance.css','42-mixer-premium.css','43-hardware-backlit.css') CSS=ROOT/'web/styles.css' HTML=ROOT/'AR-MIX-Live-FX-Host-Standalone-v0.3.html' def compile_css(): @@ -41,6 +41,7 @@ def embed_all(page,css): ('style','arsonmix-mixer-layout-css','web/mixer-layout.css'), ('script','arsonmix-mixer-io-js','web/mixer-io.js'), ('script','arsonmix-mixer-layout-js','web/mixer-layout.js'), + ('script','arsonmix-hardware-keys-js','web/hardware-keys.js'), ): built=embed_managed(built,tag,slot,(ROOT/path).read_text(encoding='utf-8')) return built diff --git a/tests/fader_asset_test.py b/tests/fader_asset_test.py index a148146be..64978bd71 100644 --- a/tests/fader_asset_test.py +++ b/tests/fader_asset_test.py @@ -58,7 +58,8 @@ assert hashlib.sha256(rose).hexdigest()=="a1d0962a25336d88a062263761d22b65ceca85d4b356e7643f1234afd6573913" assert (int.from_bytes(rose[16:20],"big"),int.from_bytes(rose[20:24],"big"))==(36,77) finish=(root/"web/styles-src/42-mixer-premium.css").read_text(encoding="utf-8") -assert css.endswith(finish), "Premium CSS module not compiled last" +hardware=(root/"web/styles-src/43-hardware-backlit.css").read_text(encoding="utf-8") +assert css.endswith(finish+hardware), "Premium fader CSS must precede isolated V5 hardware-key override" marker='--ari-master-cap:url("data:image/png;base64,' assert css.count(marker)==2, "Rose MASTER must override old gold master once" embedded=css.rsplit(marker,1)[1].split('")',1)[0] diff --git a/tests/hardware_key_v5_smoke.py b/tests/hardware_key_v5_smoke.py new file mode 100644 index 000000000..b9fc9b12f --- /dev/null +++ b/tests/hardware_key_v5_smoke.py @@ -0,0 +1,139 @@ +"""V5 mixer hardware keys: one masked legend, semantic LEDs, native parity. +Runs against the REAL web/index.html and GENERATED offline standalone. +No DSP/audio claims: this validates UI skin and existing button handlers only. +""" +import asyncio +from pathlib import Path +from playwright.async_api import async_playwright + +ROOT=Path(__file__).resolve().parents[1] + +async def audit(page): + await page.wait_for_function("""() => !!window.ArSonMixHardwareKeys && + !!document.querySelector('[data-mute="0"] svg.mx-hw-face')""") + keys=await page.evaluate("""() => { + const read=q=>{ + const b=document.querySelector(q),s=getComputedStyle(b),p=getComputedStyle(b,'::before'); + const face=b.querySelector('svg.mx-hw-face'); + const text=face?.querySelectorAll('mask text'); + return {className:b.className,pressed:b.getAttribute('aria-pressed'), + oldSkin:b.classList.contains('btn-180'),svg:!!face, + masks:face?.querySelectorAll('mask').length, + textCount:text?.length,visualText:face?.querySelectorAll(':scope > text').length, + led:s.getPropertyValue('--mx-hw-led').trim(),gap:p.opacity, + lamp:face?getComputedStyle(face.querySelector('.mx-hw-lamp')).opacity:null, + filter:s.filter,blur:s.backdropFilter,shadow:s.boxShadow}; + }; + return {mute:read('[data-mute="0"]'),solo:read('[data-solo="0"]'), + master:read('#masterMute'),phase:read('[data-pre="0"]'), + hpf:read('[data-hpf="0"]')}; + }""") + for name,item in keys.items(): + assert not item['oldSkin'],(name,item) + assert item['svg'] and item['masks']==1 and item['textCount']==1,(name,item) + assert item['visualText']==0,(name,item) + assert item['gap']=='0' and item['lamp']=='0',(name,item) + assert item['filter']=='none' and item['blur']=='none',(name,item) + assert keys['mute']['led']=='255,64,85',keys + assert keys['solo']['led']=='255,208,44',keys + assert keys['phase']['led']=='243,164,81',keys + assert keys['hpf']['led']=='87,211,189',keys + mute=page.locator('[data-mute="0"]') + solo=page.locator('[data-solo="0"]') + await mute.hover() + assert await mute.evaluate("(e)=>getComputedStyle(e).filter")=='none' + await mute.click() + await solo.click() + assert await mute.get_attribute('aria-pressed')=='true' + assert await solo.get_attribute('aria-pressed')=='true' + lit=await page.evaluate("""()=>[...document.querySelectorAll('[data-mute="0"],[data-solo="0"]')].map(b=>({ + gap:getComputedStyle(b,'::before').opacity, + lamp:getComputedStyle(b.querySelector('.mx-hw-lamp')).opacity + }))""") + assert lit==[{'gap':'1','lamp':'1'}]*2,lit + # Only native/app JS changes channel state: decorating cannot dispatch audio. + await mute.click() + assert await mute.get_attribute('aria-pressed')=='false' + assert await solo.get_attribute('aria-pressed')=='true' + await solo.click() + # Every MASTER control occupies the same 29px row as regular MUTE/SOLO. + dimensions=await page.evaluate("""()=>{ + const rect=q=>document.querySelector(q).getBoundingClientRect(); + const master=rect('#masterMute'),mono=rect('#masterMode'),channel=rect('[data-mute="0"]'); + return {masterH:master.height,modeH:mono.height,channelH:channel.height, + masterMid:master.top+master.height/2,modeMid:mono.top+mono.height/2, + channelMid:channel.top+channel.height/2}; + }""") + assert all(24<=dimensions[k]<=34 for k in ('masterH','modeH','channelH')),dimensions + assert max(dimensions[k] for k in ('masterH','modeH','channelH'))-min( + dimensions[k] for k in ('masterH','modeH','channelH'))<.3,dimensions + assert max(dimensions[k] for k in ('masterMid','modeMid','channelMid'))-min( + dimensions[k] for k in ('masterMid','modeMid','channelMid'))<1,dimensions + # SVG gradient LED stops are resolved colors, never unsupported CSS var syntax. + stops=await page.evaluate("""()=>[...document.querySelectorAll('[data-mute="0"],[data-solo="0"]')] + .map(b=>getComputedStyle(b.querySelector('.mx-hw-lamp').ownerSVGElement + .querySelector('linearGradient[id^="mx-hw-led"] stop')).stopColor)""") + assert stops==['rgb(255, 64, 85)','rgb(255, 208, 44)'],stops + # Master mode changes textContent; observer reinstalls ONE SVG legend. + mode=page.locator('#masterMode') + await mode.click() + await page.wait_for_function("""()=>document.querySelector('#masterMode') + ?.querySelector('svg.mx-hw-face mask text')?.textContent==='MONO'""") + assert await mode.get_attribute('aria-pressed')=='true' + await mode.click() + await page.wait_for_function("""()=>document.querySelector('#masterMode') + ?.querySelector('svg.mx-hw-face mask text')?.textContent==='STEREO'""") + # Channel redraw does not leave a raw/old BTN-180 switch behind. + await page.evaluate('renderMixer()') + await page.wait_for_function("""()=>[...document.querySelectorAll('#mixer .channel-actions button')] + .every(b=>!!b.querySelector('svg.mx-hw-face'))""") + assert await page.locator('#mixer .channel-actions button').count()==22 + # Added native controls get the SAME renderer without poll/per-meter observer. + await page.evaluate("""()=>{ + const node=document.createElement('section');node.className='arV6Console'; + node.id='v5-native-fixture'; + node.innerHTML=''+ + ''+ + ''+ + ''+ + ''; + document.querySelector('#app').appendChild(node); + }""") + await page.wait_for_function("""()=>document.querySelectorAll('#v5-native-fixture .mx-hw-face').length===5""") + native=await page.evaluate("""()=>[...document.querySelectorAll('#v5-native-fixture button')].map(b=>({ + led:getComputedStyle(b).getPropertyValue('--mx-hw-led').trim(), + lamp:getComputedStyle(b.querySelector('.mx-hw-lamp')).opacity, + gap:getComputedStyle(b,'::before').opacity + }))""") + assert [x['led'] for x in native]==[ + '255,64,85','255,208,44','90,200,231','87,211,189','90,200,231'],native + assert all(x['lamp']=='1' and x['gap']=='1' for x in native),native + await page.locator('#v5-native-fixture').evaluate('(el)=>el.remove()') + +async def main(): + async with async_playwright() as p: + browser=await p.chromium.launch(headless=True) + for width,height in [(1366,768),(1680,900)]: + page=await browser.new_page(viewport={'width':width,'height':height}) + errors=[] + page.on('pageerror',lambda e:errors.append(str(e))) + await page.goto((ROOT/'web/index.html').as_uri()) + await audit(page) + assert not errors,(width,errors) + if width==1680: + await page.screenshot(path='mixer-backlit-v5-native-1680.png') + await page.locator('[data-mute="0"]').click() + await page.locator('[data-solo="0"]').click() + await page.screenshot(path='mixer-backlit-v5-native-ON-1680.png') + assert await page.locator('[data-mute="0"]').get_attribute('aria-pressed')=='true' + assert await page.locator('[data-solo="0"]').get_attribute('aria-pressed')=='true' + await page.close() + page=await browser.new_page(viewport={'width':1366,'height':768}) + await page.set_content((ROOT/'AR-MIX-Live-FX-Host-Standalone-v0.3.html').read_text()) + await audit(page) + await page.close() + await browser.close() + print('PASS V5: single mask, asymmetric static light, semantic LEDs, native/legacy dynamic renderer, independent toggles, OFF/ON redraw & offline parity') + +if __name__=='__main__': + asyncio.run(main()) diff --git a/tests/ui_smoke.py b/tests/ui_smoke.py index 5cf8dca1f..37437307a 100644 --- a/tests/ui_smoke.py +++ b/tests/ui_smoke.py @@ -362,37 +362,33 @@ async def passive_hover_is_inert(selector): p=page.locator(f'[data-pan="{idx}"]') assert await p.get_attribute('aria-orientation')=='horizontal' assert await p.locator('.pan-thumb').count()==1 - # Button 180: SOLID base and exact layered shadow (never PNG/gradient). + # V5 approved physical key: one knockout mask, no duplicate text. for selector in ['[data-mute="0"]','[data-solo="0"]','[data-hpf="0"]']: v=await page.locator(selector).first.evaluate("""e=>{ - const s=getComputedStyle(e);return { - image:s.backgroundImage,shadow:s.boxShadow, - color:s.backgroundColor,transition:s.transitionDuration} + const s=getComputedStyle(e),face=e.querySelector('svg.mx-hw-face'); + return {skin:e.classList.contains('mx-hw-key'),old:e.classList.contains('btn-180'), + bg:s.backgroundImage,shadow:s.boxShadow,filter:s.filter, + masks:face?.querySelectorAll('mask').length, + texts:face?.querySelectorAll('mask text').length, + overlaid:face?.querySelectorAll(':scope > text').length, + gap:getComputedStyle(e,'::before').opacity}; }""") - assert v['image']=='none' and v['color'].startswith('rgb('), (selector,v) - assert v['shadow'].count('rgb')>=6,(selector,v) - assert v['transition'].split(', ')[0]=='0.045s',(selector,v) - style=await page.locator('[data-mute="0"]').evaluate("""e=>{ - const s=getComputedStyle(e);return {dur:s.transitionDuration,border:s.borderTopWidth, - radius:s.borderTopLeftRadius,shadow:s.boxShadow}; - }""") - assert style['border']=='1px' and style['radius']=='3px',style - # Inter is part of the app payload; no network font or fallback is allowed. + assert v['skin'] and not v['old'] and 'gradient' in v['bg'],(selector,v) + assert v['masks']==1 and v['texts']==1 and v['overlaid']==0,(selector,v) + assert v['gap']=='0' and v['filter']=='none',(selector,v) + # Inter remains embedded for unrelated app typography. assert await page.evaluate("""async()=>{ await document.fonts.load('600 12px "ArSonMix Inter"'); return document.fonts.check('600 12px "ArSonMix Inter"')&& getComputedStyle(document.querySelector('.strip-name')).fontFamily.includes('ArSonMix Inter'); }"""),'Embedded Inter font was not applied' - assert [round(float(v.rstrip('s')),3) for v in style['dur'].split(', ')]==[.045,.045,0,0],style - # Hover in production does not create a filter, while diagnostic - # baseline restores brightness to permit same-PC performance A/B. + # No passive GPU filter even under the old diagnostic baseline mode. utility=page.locator('[data-hpf="0"]') await utility.hover() assert await utility.evaluate("(e)=>getComputedStyle(e).filter")=='none' await page.evaluate("document.documentElement.dataset.mixperf='baseline'") - assert 'brightness(1.32)' in await utility.evaluate("(e)=>getComputedStyle(e).filter") - await page.evaluate("delete document.documentElement.dataset.mixperf") assert await utility.evaluate("(e)=>getComputedStyle(e).filter")=='none' + await page.evaluate("delete document.documentElement.dataset.mixperf") # The unified M4 CONSOLE is tested in mixer_io_smoke.py, including # a physically visible pinned MAIN, native IN/FX/SEND/OUT controls, # horizontal banking and deliberately scrollable full 6-slot VST racks. @@ -452,8 +448,8 @@ async def passive_hover_is_inert(selector): assert await page.locator('.right-rail,.master-tabs,.head').count()==0 assert await page.locator('[data-master-output]').count()==0 assert await page.locator('.master-stereo-badge,.master-route-label,.fader-tools.master-tools').count()==0 - assert await page.locator('#masterMode.btn-180.is-stereo').count()==1 - assert await page.locator('#masterMode').inner_text()=='STEREO' + assert await page.locator('#masterMode.mx-hw-key.is-stereo').count()==1 + assert await page.locator('#masterMode svg.mx-hw-face mask text').text_content()=='STEREO' assert await page.locator('#masterMode').get_attribute('aria-pressed')=='false' # Streaming output panel has only two useful readouts. assert await page.locator('#masterLeft .master-analysis .master-info-row').count()==2 @@ -471,7 +467,7 @@ async def passive_hover_is_inert(selector): # L2 workspace: original 17 rail controls plus one purposeful MS5 SEND FADERS toggle. # Its optional AUX selector is not a button; preserve the original operator commands. assert await page.locator('.toolbar-actions .nav button.btn-180').count()==3 - assert await page.locator('.left-rail button.btn-180').count()==19 + assert await page.locator('.left-rail button.btn-180').count()==18 assert await page.locator('.left-rail [data-sof-toggle]').count()==1 assert await page.locator('.toolbar-actions .fx-nav,.left-rail .fx-nav').count()==0 assert await page.locator('.left-rail .pushable,.left-rail .front,.left-rail .edge,.left-rail .shadow').count()==0 @@ -491,11 +487,13 @@ async def passive_hover_is_inert(selector): mute:grab('[data-mute="0"]'), utility:grab('[data-hpf="0"]')}; }""") - for key in ('rail','mute','utility'): + for key in ('rail',): assert style[key]['face']=='rgb(231, 239, 240)',(key,style) assert style[key]['image']=='none',(key,style) assert style[key]['shadow'].count('rgb')==7,(key,style) assert style[key]['radius']=='3px',(key,style) + for key in ('mute','utility'): + assert 'gradient' in style[key]['image'] and style[key]['radius']=='5px',(key,style) assert style['nav']['face']=='rgb(231, 239, 240)' and style['selected']['face']=='rgb(178, 232, 160)',style assert style['railOn']['face']=='rgb(237, 184, 223)',style # Audio Device shares the physical BTN-180 toolbar face and dark ink. @@ -520,7 +518,7 @@ async def passive_hover_is_inert(selector): await page.wait_for_function("""()=>getComputedStyle(document.querySelector('.spec-device')).backgroundColor==='rgb(231, 239, 240)'""") assert all(style[key]['spanTransform']=='none' for key in ('nav','rail','selected')),style assert await page.locator('[data-hpf="0"]').evaluate( - "(e)=>getComputedStyle(e).boxShadow.includes('5px 5px 2px -1px')"),style + "(e)=>e.classList.contains('mx-hw-key')&&getComputedStyle(e).boxShadow.includes('inset')"),style # Real 1px tactile travel; no text scaling or width/height changes. preset=page.locator('[data-preset="Clean Vocal"]') pre=await preset.evaluate("(e)=>e.getBoundingClientRect().toJSON()") @@ -542,11 +540,14 @@ async def passive_hover_is_inert(selector): assert active['face']=='rgb(237, 184, 223)' and active['transform']=='matrix(1, 0, 0, 1, 0, 0)',active assert shared_shadow_shape(active['shadow'])==shared_shadow_shape(style['rail']['shadow']),active assert all(abs(active['rect'][k]-pre[k])<=.2 for k in ('x','y','width','height')),active - # Utility ON is soft cyan, not the old green/purple polarity palettes. + # HPF processing: teal lamp inside V5 knockout (not face-color repaint). await page.locator('[data-hpf="0"]').click() - await page.wait_for_timeout(190) - cyan=await page.locator('[data-hpf="0"]').evaluate("(e)=>getComputedStyle(e).backgroundColor") - assert cyan=='rgb(148, 232, 237)',cyan + hpf=await page.locator('[data-hpf="0"]').evaluate("""e=>({ + led:getComputedStyle(e).getPropertyValue('--mx-hw-led').trim(), + gap:getComputedStyle(e,'::before').opacity, + lamp:getComputedStyle(e.querySelector('.mx-hw-lamp')).opacity + })""") + assert hpf=={'led':'87,211,189','gap':'1','lamp':'1'},hpf await page.locator('[data-hpf="0"]').click() # Navigation remains mutually exclusive; selected is only a color latch. await page.locator('[data-view="FX RACK"]').click() @@ -604,18 +605,25 @@ async def passive_hover_is_inert(selector): assert not railGeometry['emptyControls'],railGeometry assert all(btn['width']>=40 and btn['height']>=25 for btn in railGeometry['buttons']),railGeometry await page.screenshot(path=str(project/'mixer-master-dual-metric-left-rail.png'),full_page=True) - off_mute=await page.locator('[data-mute="0"]').evaluate("(e)=>getComputedStyle(e).getPropertyValue('--b180-color').trim()") + off_mute=await page.locator('[data-mute="0"]').evaluate("(e)=>getComputedStyle(e,'::before').opacity") + assert off_mute=='0' await page.locator('[data-mute="0"]').click() - mute_on=await page.locator('[data-mute="0"]').evaluate("(e)=>getComputedStyle(e).getPropertyValue('--b180-color').trim()") - assert mute_on!=off_mute and await page.locator('[data-mute="0"]').get_attribute('aria-pressed')=='true' + mute_on=await page.locator('[data-mute="0"]').evaluate("""e=>({ + led:getComputedStyle(e).getPropertyValue('--mx-hw-led').trim(), + gap:getComputedStyle(e,'::before').opacity})""") + assert mute_on=={'led':'255,64,85','gap':'1'} + assert await page.locator('[data-mute="0"]').get_attribute('aria-pressed')=='true' await page.locator('[data-mute="0"]').click() await page.locator('[data-solo="0"]').click() - solo_on=await page.locator('[data-solo="0"]').evaluate("(e)=>getComputedStyle(e).getPropertyValue('--b180-color').trim()") - assert solo_on!=mute_on + solo_on=await page.locator('[data-solo="0"]').evaluate("""e=>({ + led:getComputedStyle(e).getPropertyValue('--mx-hw-led').trim(), + gap:getComputedStyle(e,'::before').opacity})""") + assert solo_on=={'led':'255,208,44','gap':'1'} await page.locator('[data-solo="0"]').click() await page.locator('[data-hpf="0"]').click() - hpf_on=await page.locator('[data-hpf="0"]').evaluate("(e)=>getComputedStyle(e).getPropertyValue('--b180-color').trim()") - assert hpf_on not in (mute_on,solo_on,off_mute) + hpf_on=await page.locator('[data-hpf="0"]').evaluate( + "(e)=>getComputedStyle(e).getPropertyValue('--mx-hw-led').trim()") + assert hpf_on=='87,211,189' await page.locator('[data-hpf="0"]').click() await page.screenshot(path=str(project/'mixer-crystal-candy-review.png'),full_page=True) await page.screenshot(path=str(project/'mixer-crystal-depth-glow-review.png'),full_page=True) @@ -663,7 +671,7 @@ async def passive_hover_is_inert(selector): selection:getComputedStyle(main,'::before').borderTopWidth, masterRows:[...master.children].map(x=>({cls:x.className,height:x.getBoundingClientRect().height}))}; }""") - assert architecture['small']=='none',architecture + assert 'gradient' in architecture['small'],architecture assert abs(architecture['mainFader']['height']-architecture['masterFader']['height'])<=2,architecture assert architecture['nav']=='none',architecture assert architecture['long']=='none',architecture @@ -697,38 +705,27 @@ async def passive_hover_is_inert(selector): assert smallRail['footerBottom']<=smallRail['bottom']+1,smallRail assert all(b['width']>35 for b in smallRail['buttons']),smallRail assert await page.locator('.strip').count()==11 - # The user's requirement: the SAME size/position before, during, and after toggle. - # OFF/ON use the exact same shadow-layer geometry, differing only in palette. + # V5 state changes only internal lamp and 1–2px occluded light. + # Physical key outer geometry is immutable: no old depressed BTN-180 layers. def switch_state(selector): return page.locator(selector).evaluate("""e=>{ - const s=getComputedStyle(e),r=e.getBoundingClientRect(); - return {t:s.transform,shadow:s.boxShadow,color:s.backgroundColor, - ink:s.color,left:r.left,top:r.top,width:r.width,height:r.height, - selected:e.classList.contains('active')||e.classList.contains('selected')}; + const s=getComputedStyle(e),r=e.getBoundingClientRect(),svg=e.querySelector('svg.mx-hw-face'); + return {t:s.transform,shadow:s.boxShadow,gap:getComputedStyle(e,'::before').opacity, + lamp:getComputedStyle(svg.querySelector('.mx-hw-lamp')).opacity, + left:r.left,top:r.top,width:r.width,height:r.height, + selected:e.classList.contains('active')}; }""") def same_rect(a,b): return all(abs(a[k]-b[k])<=.2 for k in ('left','top','width','height')) off=await switch_state('[data-mute="0"]') - assert off['t']=='matrix(1, 0, 0, 1, 0, 0)',off await page.locator('[data-mute="0"]').click() - await page.wait_for_function("""()=>{ - const e=document.querySelector('[data-mute="0"]'); - return e.classList.contains('active')&&getComputedStyle(e).boxShadow.includes('inset'); - }""",timeout=2500) - await page.wait_for_timeout(65) # 45ms palette, immediate pressed displacement on=await switch_state('[data-mute="0"]') - assert on['selected'] and shared_shadow_shape(on['shadow'])==shared_shadow_shape(off['shadow']),(off,on) - assert on['color']!=off['color'],(off,on) - assert on['t']==off['t'] and same_rect(off,on),(off,on) - assert off['color']=='rgb(231, 239, 240)' and off['ink']=='rgb(23, 34, 41)',(off,on) - assert on['ink']!=off['ink'],(off,on) - assert on['shadow'].startswith('rgba(0, 0, 0, 0.18)'),on + assert on['selected'] and off['gap']=='0' and on['gap']=='1',(off,on) + assert off['lamp']=='0' and on['lamp']=='1',(off,on) + assert off['shadow']==on['shadow'] and off['t']==on['t'] and same_rect(off,on),(off,on) await page.locator('[data-mute="0"]').click() - await page.mouse.move(1,1) # OFF after pointer leaves, not the intentional glossy hover state - await page.wait_for_timeout(190) back=await switch_state('[data-mute="0"]') - assert back['t']==off['t'] and same_rect(off,back),(off,back) - assert back['shadow']==off['shadow'],(off,back) + assert back['gap']=='0' and same_rect(off,back),(off,back) # Source A/B controls are gone; fader travel expands into their old space. assert await page.locator('[data-send]').count()==0 assert await page.locator('#mixer > .strip:not(.master-strip) .fader-tools').count()==0 @@ -762,51 +759,28 @@ def same_rect(a,b): and 'linear-gradient' in x['slitPaint'] and x['capWidth']==36 for x in fader_recess),fader_recess - # Both resting states share depth; while pointer is down only, cap sinks 1px - # with a stronger inner shadow and unchanged width/height/layout slot. + # Press travel applies only to the SVG keycap; housing stays stationary. btn=page.locator('[data-mute="0"]') - before=await btn.evaluate("""e=>({ - shadow:getComputedStyle(e).boxShadow, - before:getComputedStyle(e,'::before').content, - after:getComputedStyle(e,'::after').content})""") - assert before['before']=='none' and before['after']=='none',before press_before=await btn.evaluate("(e)=>e.getBoundingClientRect().toJSON()") await btn.hover() await page.mouse.down() - await page.wait_for_timeout(190) during=await btn.evaluate("""e=>({ - t:getComputedStyle(e).transform,rect:e.getBoundingClientRect().toJSON(), - shadow:getComputedStyle(e).boxShadow})""") - assert during['t']=='matrix(1, 0, 0, 1, 0, 1)',during - assert abs(during['rect']['y']-press_before['y']-1)<=.2,during - assert all(abs(during['rect'][k]-press_before[k])<=.2 for k in ('x','width','height')),during - assert during['shadow']!=before['shadow'] and '0.5' in during['shadow'],(before,during) + outer:getComputedStyle(e).transform, + face:getComputedStyle(e.querySelector('svg.mx-hw-face')).transform, + rect:e.getBoundingClientRect().toJSON() + })""") + assert during['outer'] in ('none','matrix(1, 0, 0, 1, 0, 0)'),during + assert during['face']=='matrix(1, 0, 0, 1, 0, 1)',during + assert abs(during['rect']['y']-press_before['y'])<=.2,during await page.mouse.up() - await page.wait_for_timeout(190) assert await btn.get_attribute('aria-pressed')=='true' - released_on=await btn.evaluate("""e=>({ - t:getComputedStyle(e).transform, shadow:getComputedStyle(e).boxShadow, - rect:e.getBoundingClientRect().toJSON() - })""") - assert released_on['t']=='matrix(1, 0, 0, 1, 0, 0)',released_on - assert abs(released_on['rect']['y']-press_before['y'])<=.2,released_on - assert shared_shadow_shape(released_on['shadow'])==shared_shadow_shape(before['shadow']),(before,released_on) - # Re-press while already ON; it must have the same 1px tactile travel. await btn.hover() await page.mouse.down() - await page.wait_for_timeout(120) - pressed_on=await btn.evaluate("""e=>({ - t:getComputedStyle(e).transform,shadow:getComputedStyle(e).boxShadow, - rect:e.getBoundingClientRect().toJSON() - })""") - assert pressed_on['t']=='matrix(1, 0, 0, 1, 0, 1)',pressed_on - assert abs(pressed_on['rect']['y']-press_before['y']-1)<=.2,pressed_on - assert all(abs(pressed_on['rect'][k]-press_before[k])<=.2 for k in ('x','width','height')),pressed_on - assert '0.5' in pressed_on['shadow'],pressed_on + pressed_on=await btn.evaluate( + "(e)=>getComputedStyle(e.querySelector('svg.mx-hw-face')).transform") + assert pressed_on=='matrix(1, 0, 0, 1, 0, 1)',pressed_on await page.mouse.up() - await page.wait_for_timeout(190) assert await btn.get_attribute('aria-pressed')=='false' - assert await btn.evaluate("(e)=>getComputedStyle(e).transform")=='matrix(1, 0, 0, 1, 0, 0)' released_off=await btn.evaluate("(e)=>e.getBoundingClientRect().toJSON()") assert abs(released_off['y']-press_before['y'])<=.2,released_off widths=await page.evaluate("""()=>{ @@ -873,23 +847,24 @@ def same_rect(a,b): await page.locator('[data-view="MIX"]').click() assert await page.locator('[data-fxpower="0:0"]').get_attribute('aria-pressed')=='true' assert await page.evaluate('durableSession().bypassed["0:0"]') is False - # A real two-state BTN-180 control: blue STEREO, red MONO, durable state. + # Master mode is also V5; MONO/STEREO replace only its SINGLE mask legend. mode=page.locator('#masterMode') - blue=await mode.evaluate("(e)=>getComputedStyle(e).getPropertyValue('--b180-color').trim()") - assert blue=='#9dd2f0',blue + assert await mode.evaluate("(e)=>e.classList.contains('mx-hw-key')") await mode.click() - red=await mode.evaluate("(e)=>getComputedStyle(e).getPropertyValue('--b180-color').trim()") - assert await mode.inner_text()=='MONO' and await mode.get_attribute('aria-pressed')=='true' - assert red=='#f99aa4' and red!=blue,red + await page.wait_for_function("""()=>document.querySelector('#masterMode') + .querySelector('svg.mx-hw-face mask text')?.textContent==='MONO'""") + assert await mode.get_attribute('aria-pressed')=='true' assert await page.evaluate('durableSession().masterMono') is True await mode.click() - assert await mode.inner_text()=='STEREO' and await mode.get_attribute('aria-pressed')=='false' + await page.wait_for_function("""()=>document.querySelector('#masterMode') + .querySelector('svg.mx-hw-face mask text')?.textContent==='STEREO'""") + assert await mode.get_attribute('aria-pressed')=='false' assert await page.evaluate('durableSession().masterMono') is False await page.locator('#masterMute').click() - assert await page.locator('#masterMute').inner_text()=='MUTE' assert await page.locator('#masterMute').get_attribute('aria-pressed')=='true' + assert await page.locator('#masterMute svg.mx-hw-face mask text').text_content()=='MUTE' await page.locator('#masterMute').click() - assert await page.locator('#masterMute').inner_text()=='MUTE' + assert await page.locator('#masterMute').get_attribute('aria-pressed')=='false' # Hover and active feedback stays visual and does not change native fader geometry. cap0=page.locator('[data-fader="0"] .cap') await cap0.hover() @@ -1136,11 +1111,14 @@ def same_rect(a,b): assert all(abs(v['unit']-14)<.3 and abs(v['meter']-14)<.3 and abs(v['fill']-10)<.6 and v['clip'] for v in vu_geometry),vu_geometry assert len(set(v['gradient'] for v in vu_geometry))==1, 'VU palette must match across all L/R/mono bars' await page.locator('#masterMode').click() - assert await page.locator('#masterMode').inner_text()=='MONO' - mono_text=await page.locator('#masterMode').evaluate('(e)=>({color:getComputedStyle(e).color,shadow:getComputedStyle(e).textShadow})') - assert mono_text['color']=='rgb(20, 16, 20)' and mono_text['shadow']=='none',mono_text + assert await page.locator('#masterMode svg.mx-hw-face mask text').text_content()=='MONO' + mono_text=await page.locator('#masterMode').evaluate("""e=>({ + led:getComputedStyle(e).getPropertyValue('--mx-hw-led').trim(), + glow:getComputedStyle(e.querySelector('.mx-hw-lamp')).opacity + })""") + assert mono_text=={'led':'210,225,234','glow':'1'},mono_text await page.locator('#masterMode').click() - assert await page.locator('#masterMode').inner_text()=='STEREO' + assert await page.locator('#masterMode svg.mx-hw-face mask text').text_content()=='STEREO' # Manual peak-hold reset must be deterministic: cancel the browser's # unrelated 25Hz demo producer before injecting explicit levels. Without # this, a live demo RAF can repopulate peakHold after RESET and make the @@ -1206,28 +1184,24 @@ def same_rect(a,b): assert await pan.get_attribute('aria-valuenow')=='0' assert not await page.locator('#editor').is_visible(),'PAN double click opened editor' - # Same Button 180 construction, distinct solid color for each ON state. - async def image_for(selector): - return await page.locator(selector).first.evaluate( - '(b) => getComputedStyle(b).backgroundColor') - off_mute=await image_for('[data-mute="0"]') - assert off_mute.startswith('rgb(') - assert off_mute == await image_for('[data-solo="0"]') + # Same V5 material on all buttons, independent semantic LED and lamp. + async def led_state(selector): + return await page.locator(selector).first.evaluate("""b=>({ + led:getComputedStyle(b).getPropertyValue('--mx-hw-led').trim(), + gap:getComputedStyle(b,'::before').opacity, + lamp:getComputedStyle(b.querySelector('.mx-hw-lamp')).opacity + })""") + off_mute=await led_state('[data-mute="0"]') + off_solo=await led_state('[data-solo="0"]') + assert off_mute['gap']==off_solo['gap']=='0' await page.locator('[data-mute="0"]').click() - assert await page.locator('[data-mute="0"]').get_attribute('aria-pressed') == 'true' - # BTN-180 color transition is 45ms, while tactile press is immediate. - await page.wait_for_function("""()=>getComputedStyle(document.querySelector('[data-mute="0"]')).backgroundColor==='rgb(249, 154, 164)'""",timeout=2500) - assert await image_for('[data-mute="0"]') != await image_for('[data-solo="0"]'), await page.evaluate("""()=>{ - return [...document.querySelectorAll('[data-mute="0"],[data-solo="0"]')].map(e=>({ - cls:e.className,background:getComputedStyle(e).backgroundColor, - token:getComputedStyle(e).getPropertyValue('--b180-color'), - bgImage:getComputedStyle(e).backgroundImage - })) - }""") + assert await page.locator('[data-mute="0"]').get_attribute('aria-pressed')=='true' + mute_on=await led_state('[data-mute="0"]') + assert mute_on=={'led':'255,64,85','gap':'1','lamp':'1'},mute_on await page.locator('[data-solo="0"]').click() - assert await page.locator('[data-solo="0"]').get_attribute('aria-pressed') == 'true' - await page.wait_for_function("""()=>getComputedStyle(document.querySelector('[data-solo="0"]')).backgroundColor==='rgb(244, 212, 121)'""",timeout=2500) - assert await image_for('[data-solo="0"]') != await image_for('[data-mute="0"]') + assert await page.locator('[data-solo="0"]').get_attribute('aria-pressed')=='true' + solo_on=await led_state('[data-solo="0"]') + assert solo_on=={'led':'255,208,44','gap':'1','lamp':'1'},solo_on await page.locator('[data-mute="0"]').click() await page.locator('[data-solo="0"]').click() await page.locator('#masterMute').click() diff --git a/web/hardware-keys.js b/web/hardware-keys.js new file mode 100644 index 000000000..52ca1b322 --- /dev/null +++ b/web/hardware-keys.js @@ -0,0 +1,174 @@ +/* ArSonMix hardware backlit keys — approved owner V5 geometry/occluded light. + UI-only decoration: existing data-*, click handlers and native ACK remain + the sole authority. No audio state is inferred or dispatched here. */ +(function(){ + 'use strict'; + const RULES=[ + ['#mixer .channel-actions [data-mute],#masterMute','mute','MUTE'], + ['#mixer .channel-actions [data-solo]','solo','SOLO'], + ['#mixer .utility-row [data-pre]','phase','Ø'], + ['#mixer .utility-row [data-hpf]','processing','HPF'], + ['#mixer [data-channel-format-toggle]','neutral',null], + ['#masterMode','neutral',null], + ['#mixer [data-fxpower],#masterLeft [data-master-power]','processing','FX'], + ['#app .arV6Console [data-op="SET_MUTE"]','mute','M'], + ['#app .arV6Console [data-op="SET_SOLO"]','solo','S'], + ['#app .arV6Console [data-op="SET_CUE"]','cue','C'], + ['#app .arV6Console [data-op="SET_INSERT_BYPASS"]','processing','FX'], + ['#app .arV6Console [data-op="SET_SEND_TAP"]','cue',null], + ['#app [data-sof-toggle]','cue','SEND'], + ['#app [data-chainbypass]','processing','FX'] + ]; + const PALETTE={ + mute:'255,64,85',solo:'255,208,44',cue:'90,200,231', + processing:'87,211,189',phase:'243,164,81', + link:'163,141,235',neutral:'210,225,234' + }; + const TARGET=RULES.map(rule=>rule[0]).join(','); + const instances=new WeakMap(); + let serial=0; + let observer=null; + const escapeXml=(value)=>String(value).replace(/&/g,'&').replace(//g,'>').replace(/"/g,'"').replace(/'/g,'''); + function source(button){ + for(const [selector,semantic,label] of RULES) { + if(button.matches(selector))return {semantic,label}; + } + return null; + } + function rawLabel(button){ + // Native accepted values can change PRE ↔ POST, MONO ↔ STEREO, etc. + return (button.textContent||'').trim().replace(/\s+/g,' '); + } + function classifyOn(button,legend){ + const pressed=button.getAttribute('aria-pressed'); + if(pressed!==null)return pressed==='true'; + if(button.dataset.op==='SET_SEND_TAP')return legend==='PRE'; + return button.classList.contains('active')||button.classList.contains('selected')|| + button.classList.contains('power-on')||button.classList.contains('on'); + } + function svgMarkup(legend,w,h,id,led){ + // V5: a SINGLE SVG mask text cut-out; never overlay duplicate text paints. + // ViewBox follows actual key size, preventing distorted glyphs in 28px strips. + const safe=escapeXml(legend); + const rx=Math.min(6,Math.max(2.5,h*.135)); + const fontSize=Math.max(8,Math.min(15,h*.46,(w-7)/(Math.max(1,legend.length)*.70))); + const x=w/2,y=h*.615,capW=Math.max(1,w-3),capH=Math.max(1,h-3); + const left=Math.max(3,w*.07),right=w-left,shineY=2.65; + const r=n=>Number(n.toFixed(2)); + return ''; + } + function render(button,force){ + if(!button.isConnected)return; + const record=instances.get(button); + if(!record)return; + const rect=button.getBoundingClientRect(); + const w=Math.max(16,rect.width-4),h=Math.max(16,rect.height-4); + const legend=button.dataset.mxHwLegend||record.legend; + const size=w.toFixed(1)+'x'+h.toFixed(1)+'/'+legend; + if(!force&&record.size===size&&button.querySelector(':scope > svg.mx-hw-face'))return; + record.size=size; + button.innerHTML=''+escapeXml(legend)+''+svgMarkup(legend,w,h,record.id,PALETTE[record.semantic]); + } + function upgrade(button){ + if(!(button instanceof HTMLButtonElement))return; + const rule=source(button); + if(!rule)return; + const existing=instances.get(button); + if(existing&&button.querySelector(':scope > svg.mx-hw-face')){resizer?.observe(button);return;} + const original=rawLabel(button); + let legend=rule.label||original||'ON'; + // A source text replacement (e.g. native PRE/POST) is authoritative. + if(existing&&original&&original!==existing.legend&&original!=='')legend=original; + if(!/^[\wØ/+\- ]{1,10}$/.test(legend))return; + if(!existing){ + // Drop the broken BTN-180 visual skin, retaining functionality/data hooks. + button.classList.remove('btn-180','candy'); + button.classList.add('mx-hw-key','mx-hw-'+rule.semantic); + if(!button.hasAttribute('aria-label'))button.setAttribute('aria-label',original||legend); + button.style.setProperty('--mx-hw-led',PALETTE[rule.semantic]); + instances.set(button,{id:++serial,legend,size:'',semantic:rule.semantic}); + if(resizer)resizer.observe(button); + }else{ + existing.legend=legend; + } + if(button.dataset.op==='SET_SEND_TAP')button.dataset.mxHwOn=String(classifyOn(button,legend)); + button.dataset.mxHwLegend=legend; + render(button,true); + } + function scan(root){ + if(!root||root.nodeType!==1)return; + if(root.matches('button.mx-hw-key')&&!root.querySelector('svg.mx-hw-face')){ + // An existing app handler replaced the button's textContent. + const prev=instances.get(root),changed=rawLabel(root); + if(prev&&changed&&changed!==prev.legend){ + root.dataset.mxHwLegend=changed; + prev.legend=changed; + } + upgrade(root); + }else if(root.matches(TARGET))upgrade(root); + for(const button of root.querySelectorAll(TARGET))upgrade(button); + } + const resizer=typeof ResizeObserver==='function'?new ResizeObserver(entries=>{ + for(const entry of entries)render(entry.target,false); + }):null; + const pending=new Set(); + let scheduled=false; + function flush(){ + scheduled=false; + for(const node of pending)scan(node); + pending.clear(); + } + function schedule(node){ + if(!node||node.nodeType!==1)return; + pending.add(node); + if(!scheduled){scheduled=true;queueMicrotask(flush)} + } + function install(){ + if(observer)return; + scan(document.body); + observer=new MutationObserver(records=>{ + for(const record of records){ + if(record.target instanceof HTMLButtonElement&&record.target.classList.contains('mx-hw-key') && + !record.target.querySelector('svg.mx-hw-face'))schedule(record.target); + for(const node of record.removedNodes)if(node.nodeType===1){ + if(node.matches?.('button.mx-hw-key')&&!node.isConnected)resizer?.unobserve(node); + for(const button of node.querySelectorAll?.('button.mx-hw-key')||[]) + if(!button.isConnected)resizer?.unobserve(button); + } + for(const node of record.addedNodes)if(node.nodeType===1&& + (node.matches?.(TARGET)||node.querySelector?.(TARGET)))schedule(node); + } + }); + // Watch DOM replacement only, not high-frequency meter/style attributes. + observer.observe(document.body,{childList:true,subtree:true}); + } + window.ArSonMixHardwareKeys=Object.freeze({install,upgrade,scan,PALETTE}); + if(document.readyState==='loading')document.addEventListener('DOMContentLoaded',install,{once:true}); + else install(); +})(); \ No newline at end of file diff --git a/web/index.html b/web/index.html index 4b3852300..069ec9cf1 100644 --- a/web/index.html +++ b/web/index.html @@ -47,5 +47,5 @@
UI PREVIEW · Native audio engine is not connectedFader · PAN · VST3 FXPREVIEWArSonMix · Live VST3 Host
- + diff --git a/web/styles-src/43-hardware-backlit.css b/web/styles-src/43-hardware-backlit.css new file mode 100644 index 000000000..72d741113 --- /dev/null +++ b/web/styles-src/43-hardware-backlit.css @@ -0,0 +1,157 @@ +/* Owner-approved V5 graphite hardware keys, production native/legacy console. + ONE SVG cutout legend, ONE white edge shine, asymmetric occluded leakage. + No hover repaint, SVG filters, blur, infinite animation, or fake audio state. + This module is LAST in the deterministic CSS build, replacing BTN-180 only + on opt-in tactile mixer buttons. Navigation, routing pins, meters, faders, + editor launchers, dropdowns and ordinary dialog actions are NOT backlit. */ +#app button.mx-hw-key { + --mx-hw-led:210,225,234; + position:relative!important; + display:inline-block!important; + box-sizing:border-box!important; + min-width:0!important; + padding:2px!important; + overflow:hidden!important; + isolation:isolate!important; + border:1px solid #0c151b!important; + border-radius:5px!important; + background:linear-gradient(180deg,#0b141b,#25343d)!important; + box-shadow:inset 0 2px 4px #03080db5!important; + color:transparent!important; + text-shadow:none!important; + letter-spacing:0!important; + line-height:normal!important; + filter:none!important; + backdrop-filter:none!important; + -webkit-backdrop-filter:none!important; + transform:none!important; + transition:none!important; + text-align:center!important; + cursor:pointer; + touch-action:manipulation; +} +#app button.mx-hw-key.mx-hw-mute {--mx-hw-led:255,64,85} +#app button.mx-hw-key.mx-hw-solo {--mx-hw-led:255,208,44} +#app button.mx-hw-key.mx-hw-cue {--mx-hw-led:90,200,231} +#app button.mx-hw-key.mx-hw-processing {--mx-hw-led:87,211,189} +#app button.mx-hw-key.mx-hw-phase {--mx-hw-led:243,164,81} +#app button.mx-hw-key.mx-hw-link {--mx-hw-led:163,141,235} +#app button.mx-hw-key.mx-hw-neutral {--mx-hw-led:210,225,234} +/* V5 leakage strategy: four tiny STATIC gradients only in the closest + 1–2px gap, unequal sides, lower-center stronger; top almost occluded. */ +#app button.mx-hw-key::before { + content:""!important; + display:block!important; + position:absolute!important; + inset:1px!important; + border:0!important; + border-radius:4px!important; + width:auto!important;height:auto!important; + transform:none!important; + pointer-events:none!important; + z-index:2!important; + opacity:0!important; + box-shadow:none!important; + background: + linear-gradient(90deg,transparent 0%,rgba(var(--mx-hw-led),.035) 18%, + rgba(var(--mx-hw-led),.16) 33%,rgba(var(--mx-hw-led),.46) 49%, + rgba(var(--mx-hw-led),.27) 63%,rgba(var(--mx-hw-led),.07) 80%,transparent 100%) + center bottom / calc(100% - 12px) 2px no-repeat, + linear-gradient(180deg,transparent 0%,transparent 30%, + rgba(var(--mx-hw-led),.045) 50%,rgba(var(--mx-hw-led),.21) 75%, + rgba(var(--mx-hw-led),.1) 88%,transparent 100%) + left bottom / 2px 100% no-repeat, + linear-gradient(180deg,transparent 0%,transparent 44%, + rgba(var(--mx-hw-led),.075) 65%,rgba(var(--mx-hw-led),.17) 85%, + transparent 100%) + right bottom / 2px 100% no-repeat, + linear-gradient(90deg,transparent 0%,transparent 34%, + rgba(var(--mx-hw-led),.055) 50%,transparent 67%,transparent 100%) + center top / calc(100% - 18px) 1px no-repeat!important; +} +#app button.mx-hw-key::after{content:none!important;display:none!important} +#app button.mx-hw-key[aria-pressed="true"]::before, +#app button.mx-hw-key.active::before, +#app button.mx-hw-key.selected::before, +#app button.mx-hw-key.power-on::before, +#app button.mx-hw-key[data-mx-hw-on="true"]::before {opacity:1!important} +#app button.mx-hw-key > svg.mx-hw-face { + position:absolute!important; + z-index:1!important; + top:2px!important;right:2px!important;bottom:2px!important;left:2px!important; + width:calc(100% - 4px)!important; + height:calc(100% - 4px)!important; + display:block!important; + min-height:0!important; + overflow:hidden!important; + pointer-events:none!important; + transform:translateY(0)!important; + transition:none!important; + filter:none!important; +} +#app button.mx-hw-key svg .mx-hw-lamp {opacity:0!important} +#app button.mx-hw-key[aria-pressed="true"] svg .mx-hw-lamp, +#app button.mx-hw-key.active svg .mx-hw-lamp, +#app button.mx-hw-key.selected svg .mx-hw-lamp, +#app button.mx-hw-key.power-on svg .mx-hw-lamp, +#app button.mx-hw-key[data-mx-hw-on="true"] svg .mx-hw-lamp {opacity:1!important} +#app button.mx-hw-key[aria-pressed="true"] > svg.mx-hw-face, +#app button.mx-hw-key.active > svg.mx-hw-face, +#app button.mx-hw-key[data-mx-hw-on="true"] > svg.mx-hw-face { + transform:translateY(1px)!important; +} +#app button.mx-hw-key > .mx-hw-screen-reader{ + position:absolute!important; + width:1px!important;height:1px!important; + margin:-1px!important;padding:0!important; + border:0!important;overflow:hidden!important; + clip-path:inset(50%)!important; + white-space:nowrap!important; +} +#app button.mx-hw-key:hover:not(:disabled){ + filter:none!important; + background:linear-gradient(180deg,#0b141b,#25343d)!important; + box-shadow:inset 0 2px 4px #03080db5!important; +} +#app button.mx-hw-key:active:not(:disabled){ + transform:none!important; + background:linear-gradient(180deg,#0b141b,#25343d)!important; + box-shadow:inset 0 2px 4px #03080db5!important; +} +#app button.mx-hw-key:active:not(:disabled) > svg.mx-hw-face{ + transform:translateY(1px)!important; +} +#app button.mx-hw-key:focus-visible{ + outline:2px solid #9bbecd!important; + outline-offset:2px!important; +} +#app button.mx-hw-key:disabled { + cursor:not-allowed!important; + opacity:.47!important; + filter:none!important; +} +#app button.mx-hw-key:disabled::before{opacity:0!important} +#app button.mx-hw-key:disabled svg .mx-hw-lamp{opacity:0!important} +/* Keep target strip geometry intact, bypassing the legacy BTN-180 face. */ +#app #mixer .channel-actions button.mx-hw-key, +#app #mixer .utility-row button.mx-hw-key { + flex:1 1 0; +} +/* The legacy MASTER MUTE was sized only by .candy. Own its 29px geometry + explicitly after replacing that obsolete class, matching every strip. */ +#app #masterLeft .master-actions button.mx-hw-key, +#app #masterMute.mx-hw-key{ + height:29px!important; + min-height:29px!important; + max-height:29px!important; + align-self:center!important; +} +#app #mixer [data-channel-format-toggle].mx-hw-key{ + min-width:20px!important; +} +#app .arV6Controls button.mx-hw-key{width:28px!important;height:28px!important;padding:2px!important} +#app .arV6FxSlot button.mx-hw-key{min-width:27px!important;min-height:22px!important;padding:2px!important} +#app .arV6Send button.mx-hw-key{min-width:34px!important;min-height:20px!important;padding:2px!important} +@media(prefers-reduced-motion:reduce){ + #app button.mx-hw-key,#app button.mx-hw-key > svg.mx-hw-face{transition:none!important} +} diff --git a/web/styles.css b/web/styles.css index 8483175cb..eb5955b00 100644 --- a/web/styles.css +++ b/web/styles.css @@ -1447,3 +1447,160 @@ html:not([data-mixperf="baseline"]):not([data-mixperf="layers-off"]):not([data-m background-clip:content-box;border:0;box-shadow:none; } #app #mixer .meter .clip-led.latched{box-shadow:none!important} +/* Owner-approved V5 graphite hardware keys, production native/legacy console. + ONE SVG cutout legend, ONE white edge shine, asymmetric occluded leakage. + No hover repaint, SVG filters, blur, infinite animation, or fake audio state. + This module is LAST in the deterministic CSS build, replacing BTN-180 only + on opt-in tactile mixer buttons. Navigation, routing pins, meters, faders, + editor launchers, dropdowns and ordinary dialog actions are NOT backlit. */ +#app button.mx-hw-key { + --mx-hw-led:210,225,234; + position:relative!important; + display:inline-block!important; + box-sizing:border-box!important; + min-width:0!important; + padding:2px!important; + overflow:hidden!important; + isolation:isolate!important; + border:1px solid #0c151b!important; + border-radius:5px!important; + background:linear-gradient(180deg,#0b141b,#25343d)!important; + box-shadow:inset 0 2px 4px #03080db5!important; + color:transparent!important; + text-shadow:none!important; + letter-spacing:0!important; + line-height:normal!important; + filter:none!important; + backdrop-filter:none!important; + -webkit-backdrop-filter:none!important; + transform:none!important; + transition:none!important; + text-align:center!important; + cursor:pointer; + touch-action:manipulation; +} +#app button.mx-hw-key.mx-hw-mute {--mx-hw-led:255,64,85} +#app button.mx-hw-key.mx-hw-solo {--mx-hw-led:255,208,44} +#app button.mx-hw-key.mx-hw-cue {--mx-hw-led:90,200,231} +#app button.mx-hw-key.mx-hw-processing {--mx-hw-led:87,211,189} +#app button.mx-hw-key.mx-hw-phase {--mx-hw-led:243,164,81} +#app button.mx-hw-key.mx-hw-link {--mx-hw-led:163,141,235} +#app button.mx-hw-key.mx-hw-neutral {--mx-hw-led:210,225,234} +/* V5 leakage strategy: four tiny STATIC gradients only in the closest + 1–2px gap, unequal sides, lower-center stronger; top almost occluded. */ +#app button.mx-hw-key::before { + content:""!important; + display:block!important; + position:absolute!important; + inset:1px!important; + border:0!important; + border-radius:4px!important; + width:auto!important;height:auto!important; + transform:none!important; + pointer-events:none!important; + z-index:2!important; + opacity:0!important; + box-shadow:none!important; + background: + linear-gradient(90deg,transparent 0%,rgba(var(--mx-hw-led),.035) 18%, + rgba(var(--mx-hw-led),.16) 33%,rgba(var(--mx-hw-led),.46) 49%, + rgba(var(--mx-hw-led),.27) 63%,rgba(var(--mx-hw-led),.07) 80%,transparent 100%) + center bottom / calc(100% - 12px) 2px no-repeat, + linear-gradient(180deg,transparent 0%,transparent 30%, + rgba(var(--mx-hw-led),.045) 50%,rgba(var(--mx-hw-led),.21) 75%, + rgba(var(--mx-hw-led),.1) 88%,transparent 100%) + left bottom / 2px 100% no-repeat, + linear-gradient(180deg,transparent 0%,transparent 44%, + rgba(var(--mx-hw-led),.075) 65%,rgba(var(--mx-hw-led),.17) 85%, + transparent 100%) + right bottom / 2px 100% no-repeat, + linear-gradient(90deg,transparent 0%,transparent 34%, + rgba(var(--mx-hw-led),.055) 50%,transparent 67%,transparent 100%) + center top / calc(100% - 18px) 1px no-repeat!important; +} +#app button.mx-hw-key::after{content:none!important;display:none!important} +#app button.mx-hw-key[aria-pressed="true"]::before, +#app button.mx-hw-key.active::before, +#app button.mx-hw-key.selected::before, +#app button.mx-hw-key.power-on::before, +#app button.mx-hw-key[data-mx-hw-on="true"]::before {opacity:1!important} +#app button.mx-hw-key > svg.mx-hw-face { + position:absolute!important; + z-index:1!important; + top:2px!important;right:2px!important;bottom:2px!important;left:2px!important; + width:calc(100% - 4px)!important; + height:calc(100% - 4px)!important; + display:block!important; + min-height:0!important; + overflow:hidden!important; + pointer-events:none!important; + transform:translateY(0)!important; + transition:none!important; + filter:none!important; +} +#app button.mx-hw-key svg .mx-hw-lamp {opacity:0!important} +#app button.mx-hw-key[aria-pressed="true"] svg .mx-hw-lamp, +#app button.mx-hw-key.active svg .mx-hw-lamp, +#app button.mx-hw-key.selected svg .mx-hw-lamp, +#app button.mx-hw-key.power-on svg .mx-hw-lamp, +#app button.mx-hw-key[data-mx-hw-on="true"] svg .mx-hw-lamp {opacity:1!important} +#app button.mx-hw-key[aria-pressed="true"] > svg.mx-hw-face, +#app button.mx-hw-key.active > svg.mx-hw-face, +#app button.mx-hw-key[data-mx-hw-on="true"] > svg.mx-hw-face { + transform:translateY(1px)!important; +} +#app button.mx-hw-key > .mx-hw-screen-reader{ + position:absolute!important; + width:1px!important;height:1px!important; + margin:-1px!important;padding:0!important; + border:0!important;overflow:hidden!important; + clip-path:inset(50%)!important; + white-space:nowrap!important; +} +#app button.mx-hw-key:hover:not(:disabled){ + filter:none!important; + background:linear-gradient(180deg,#0b141b,#25343d)!important; + box-shadow:inset 0 2px 4px #03080db5!important; +} +#app button.mx-hw-key:active:not(:disabled){ + transform:none!important; + background:linear-gradient(180deg,#0b141b,#25343d)!important; + box-shadow:inset 0 2px 4px #03080db5!important; +} +#app button.mx-hw-key:active:not(:disabled) > svg.mx-hw-face{ + transform:translateY(1px)!important; +} +#app button.mx-hw-key:focus-visible{ + outline:2px solid #9bbecd!important; + outline-offset:2px!important; +} +#app button.mx-hw-key:disabled { + cursor:not-allowed!important; + opacity:.47!important; + filter:none!important; +} +#app button.mx-hw-key:disabled::before{opacity:0!important} +#app button.mx-hw-key:disabled svg .mx-hw-lamp{opacity:0!important} +/* Keep target strip geometry intact, bypassing the legacy BTN-180 face. */ +#app #mixer .channel-actions button.mx-hw-key, +#app #mixer .utility-row button.mx-hw-key { + flex:1 1 0; +} +/* The legacy MASTER MUTE was sized only by .candy. Own its 29px geometry + explicitly after replacing that obsolete class, matching every strip. */ +#app #masterLeft .master-actions button.mx-hw-key, +#app #masterMute.mx-hw-key{ + height:29px!important; + min-height:29px!important; + max-height:29px!important; + align-self:center!important; +} +#app #mixer [data-channel-format-toggle].mx-hw-key{ + min-width:20px!important; +} +#app .arV6Controls button.mx-hw-key{width:28px!important;height:28px!important;padding:2px!important} +#app .arV6FxSlot button.mx-hw-key{min-width:27px!important;min-height:22px!important;padding:2px!important} +#app .arV6Send button.mx-hw-key{min-width:34px!important;min-height:20px!important;padding:2px!important} +@media(prefers-reduced-motion:reduce){ + #app button.mx-hw-key,#app button.mx-hw-key > svg.mx-hw-face{transition:none!important} +} From 055313598bc3b23201694de815f40bd5c582f4bd Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Mon, 2 Nov 2026 23:12:14 +0700 Subject: [PATCH 193/233] fix(engine): M1 sample-continuous fader, offline AUX parity, bounded graph retirement tests --- ...M1_REALTIME_CORE_STABILIZATION_20261102.md | 11 +++++ engine/core/PreparedMixerBlock.h | 36 ++++++++++----- tests/mixer_routing_plan_test.cpp | 45 +++++++++++++++++++ tests/realtime_control_test.cpp | 37 +++++++++++++++ 4 files changed, 117 insertions(+), 12 deletions(-) create mode 100644 docs/M1_REALTIME_CORE_STABILIZATION_20261102.md diff --git a/docs/M1_REALTIME_CORE_STABILIZATION_20261102.md b/docs/M1_REALTIME_CORE_STABILIZATION_20261102.md new file mode 100644 index 000000000..a1bd83fae --- /dev/null +++ b/docs/M1_REALTIME_CORE_STABILIZATION_20261102.md @@ -0,0 +1,11 @@ +# M1 — Realtime core stabilization (2026-11-02) + +**Stacked source**: ENGINE #266 at `40a059785993cc6a4bb593020bf9749de92746f9`. No competing DSP, native callback, GUI or worker per channel. + +This checkpoint repairs the Windows CTest AUX static/offline regression and corrects native fader/PAN de-zippering to remain **64 audio samples across variable callback frames** (4/16/32/12), including reverse direction. Existing live PRE/POST sends and AUX return faders retain their prepared 64-sample ramp; offline/no-live paths must not inherit old live AUX targets. All work uses fixed-size arrays and no new callback heap allocations. + +The existing `RealtimeRoutePublisher` owns bounded retirement. New tests hold a real leased reader across two graph publications, verify refusal when the queue is full, and verify all four prepared owners are reclaimed after the reader leaves. All tests run in the existing CTest executables with no additional CI matrix. + +**Runtime invariant:** `LiveAudioEngine::audioDeviceIOCallbackWithContext` is still M4 until the full CH1 external/Orbit owner, native vendor FX/editor/Show, physical input/output pins and monitor can migrate together. Never enable universal supportedOps or silently render the new graph alongside M4. Worker-only work belongs to existing control/Show-save processing, NOT the real-time callback. + +**Remaining M1 release gates:** pass exact-SHA Windows MSVC/CTest, integrate a single full-fidelity ChannelId callback with atomic admission and no FX loss, then qualify ASIO/WASAPI and zero-FX crackle on actual hardware. This change alone is **not M1 complete**, not UAT, not acoustic FAT. diff --git a/engine/core/PreparedMixerBlock.h b/engine/core/PreparedMixerBlock.h index 5bf6c2ec1..4b75cff29 100644 --- a/engine/core/PreparedMixerBlock.h +++ b/engine/core/PreparedMixerBlock.h @@ -450,6 +450,9 @@ class PreparedMixerBlock final { preRampRemaining_[strip]=0; lastGainL_[strip]=gl; lastGainR_[strip]=gr; + gainGoalL_[strip]=gl; + gainGoalR_[strip]=gr; + gainRampRemaining_[strip]=0; rampPrimed_[strip]=true; } // The MUTE/PRE-SEND de-click is 64 AUDIO SAMPLES, not one @@ -480,7 +483,7 @@ class PreparedMixerBlock final { // Once the message thread publishes a changed send target, // the SAME callback switches to one live PRE/POST processor // which follows 64-sample gains across varying block sizes. - if(auxAutomationActive_.load(std::memory_order_acquire)) + if(live && auxAutomationActive_.load(std::memory_order_acquire)) dispatchLiveAux(strip,SendTap::preFader,l,r,frames); else graph.aux.dispatch(strip,SendTap::preFader,l,r, auxLeft_.data(),auxRight_.data(),frames); @@ -495,14 +498,20 @@ class PreparedMixerBlock final { } } if(live) { - // A block-linear fader/PAN ramp avoids zipper clicks at the - // native callback rate. UI sends at most one target per rAF. - const int ramp=std::min(frames,64); - const float dL=(gl-lastGainL_[strip])/ramp; - const float dR=(gr-lastGainR_[strip])/ramp; + // Fader/PAN dezipper is 64 AUDIO SAMPLES, not one callback. + // Reversing the target restarts from the actual applied gain. + if(gl!=gainGoalL_[strip] || gr!=gainGoalR_[strip]) { + gainGoalL_[strip]=gl;gainGoalR_[strip]=gr; + gainRampRemaining_[strip]=64; + } float lv=lastGainL_[strip],rv=lastGainR_[strip]; + int gainRemaining=gainRampRemaining_[strip]; for(int f=0;f0) { + lv+=(gl-lv)/static_cast(gainRemaining); + rv+=(gr-rv)/static_cast(gainRemaining); + --gainRemaining; + } else {lv=gl;rv=gr;} l[f]*=lv;r[f]*=rv; if(monitorBusL) { const float gain=nextMonitorGain(strip); @@ -517,7 +526,8 @@ class PreparedMixerBlock final { masterL_[f]+=l[f];masterR_[f]+=r[f]; } } - lastGainL_[strip]=gl;lastGainR_[strip]=gr; + lastGainL_[strip]=lv;lastGainR_[strip]=rv; + gainRampRemaining_[strip]=gainRemaining; }else for(int f=0;f right_{}; std::array auxLeft_{},auxRight_{}; std::array preGate_{},preGateTarget_{}, - lastGainL_{},lastGainR_{}; - std::array preRampRemaining_{}; + lastGainL_{},lastGainR_{},gainGoalL_{},gainGoalR_{}; + std::array preRampRemaining_{},gainRampRemaining_{}; std::array,stripCount> physicalTarget_{}; std::array physicalBlend_{}; // OFF until any native SET_SEND_LEVEL. Audio callback reads only; diff --git a/tests/mixer_routing_plan_test.cpp b/tests/mixer_routing_plan_test.cpp index 19517fb1c..1a2832a8e 100644 --- a/tests/mixer_routing_plan_test.cpp +++ b/tests/mixer_routing_plan_test.cpp @@ -690,6 +690,50 @@ static void verifyLegacyToDynamicProductionPcmParity() { } + +static void verifyRealtimeFaderRampAcrossShortCallbacks() { + using namespace armix::mixer; + const std::array pins{0,1}; + ChannelRoutingConfig routing; + routing.stripsAndMaster.strips[0]= + {SourceMode::mono,0,-1,1.f,0.f,false,false}; + SendRequest sends; + sends.toMaster[0]=true; + PreparedRenderGraph graph; + RenderError error; + assert(PreparedRenderGraph::compile(routing,pins,sends,graph,error)); + PreparedMixerBlock block(graph,64); + RealtimeStripControls controls; + assert(controls.set(0,1.f,0.f,true,false,false)); + std::array mic{},unused{},left{},right{}; + mic.fill(.8f); + const float* sources[]={mic.data(),unused.data()}; + const auto noFx=[](int,float*,float*,int) noexcept {}; + const auto render=[&](int frames) { + left.fill(0.f);right.fill(0.f); + return block.process(sources,2,left.data(),right.data(),frames, + noFx,nullptr,&controls); + }; + assert(render(4)); + const float baseline=left[0]; + assert(baseline>.01f && close(right[3],baseline)); + assert(controls.set(0,0.f,0.f,true,false,false)); + assert(render(4)); + assert(close(left[3],baseline*60.f/64.f,3.e-5f)); + assert(render(16)); + assert(close(left[15],baseline*44.f/64.f,3.e-5f)); + assert(render(32)); + assert(close(left[31],baseline*12.f/64.f,3.e-5f)); + assert(render(12)); + assert(close(left[11],0.f,3.e-5f)); + // Mid-show fader reversal must not jump to the last requested target. + assert(controls.set(0,1.f,0.f,true,false,false)); + assert(render(4)); + assert(close(left[3],baseline*4.f/64.f,3.e-5f)); + assert(render(60)); + assert(close(left[59],baseline,3.e-5f)); +} + static void verifyRealtimeAuxPostGainWithoutGraphRebuild() { using namespace armix::mixer; const std::array pins{0,1}; @@ -969,6 +1013,7 @@ int main() { verifyDynamicChannelIdLiveControls(); verifyDynamicNativeSessionPublication(); verifyStudioConsoleBusBatchPcm(); + verifyRealtimeFaderRampAcrossShortCallbacks(); verifyRealtimeAuxMasterPcmBothOutputs(); verifyRealtimeAuxPostGainWithoutGraphRebuild(); verifyLegacyToDynamicProductionPcmParity(); diff --git a/tests/realtime_control_test.cpp b/tests/realtime_control_test.cpp index 0cb920ab9..91b288fdb 100644 --- a/tests/realtime_control_test.cpp +++ b/tests/realtime_control_test.cpp @@ -1,5 +1,7 @@ // SPDX-License-Identifier: AGPL-3.0-only #include "../engine/core/RealtimeControl.h" +#include "../engine/core/RealtimeRoutePublisher.h" +#include #include #ifdef NDEBUG #undef NDEBUG @@ -51,6 +53,41 @@ int main(){ checkPan(0.f,0.f,1.f,0.f,1.f); checkPan(0.f,1.f,0.f,1.f,0.f); std::cout<<"PASS: native stereo pan centre, extremes, half-pan and unit-gain dual-mono\n"; + + // M1: retired FX/PCM snapshots remain owned until callbacks release + // their leases; a full bounded queue rejects instead of growing memory. + struct RetireProbe { + std::atomic* counter; + explicit RetireProbe(std::atomic& c):counter(&c){} + ~RetireProbe(){counter->fetch_add(1,std::memory_order_relaxed);} + }; + std::atomic destroyed{0}; + RealtimeRoutePublisher publisher; + const auto publish=[&](std::uint64_t revision) { + auto next=std::make_unique::Snapshot>(); + next->deviceEpoch=7;next->graphRevision=revision; + next->prepared=std::make_unique(destroyed); + return publisher.publish(std::move(next),revision-1,7); + }; + using Result=RealtimeRoutePublisher::Result; + assert(publish(1)==Result::applied); + { + auto lease=publisher.acquire(); + assert(lease.get(7)&&lease.get(7)->graphRevision==1); + assert(publish(2)==Result::applied); + assert(publish(3)==Result::applied); + assert(publisher.pendingRetirements()==2); + assert(publish(4)==Result::retirementFull); + assert(destroyed.load(std::memory_order_relaxed)==1); + assert(lease.get(7)->graphRevision==1); + } + assert(publisher.pollRetirement()); + assert(publisher.pendingRetirements()==0); + assert(destroyed.load(std::memory_order_relaxed)==3); + assert(publish(4)==Result::applied); + publisher.unpublish(); + assert(publisher.pollRetirement()); + assert(destroyed.load(std::memory_order_relaxed)==4); // Runtime contract for the exact RT graph publication helper. struct FakeGraph { int id; }; FakeGraph old{1}, next{2}, third{3}; From 9f15f2b948c4490cde8740c47d0ce8b58d7b989b Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Mon, 2 Nov 2026 23:14:01 +0700 Subject: [PATCH 194/233] fix(worker): release Show snapshots, vendor blobs and completion closures on every job boundary --- ...M1_REALTIME_CORE_STABILIZATION_20261102.md | 3 ++ src/NativeShowSaveWorker.h | 39 ++++++++++++++----- 2 files changed, 33 insertions(+), 9 deletions(-) diff --git a/docs/M1_REALTIME_CORE_STABILIZATION_20261102.md b/docs/M1_REALTIME_CORE_STABILIZATION_20261102.md index a1bd83fae..8ba3ac0f2 100644 --- a/docs/M1_REALTIME_CORE_STABILIZATION_20261102.md +++ b/docs/M1_REALTIME_CORE_STABILIZATION_20261102.md @@ -9,3 +9,6 @@ The existing `RealtimeRoutePublisher` owns bounded retirement. New tests hold a **Runtime invariant:** `LiveAudioEngine::audioDeviceIOCallbackWithContext` is still M4 until the full CH1 external/Orbit owner, native vendor FX/editor/Show, physical input/output pins and monitor can migrate together. Never enable universal supportedOps or silently render the new graph alongside M4. Worker-only work belongs to existing control/Show-save processing, NOT the real-time callback. **Remaining M1 release gates:** pass exact-SHA Windows MSVC/CTest, integrate a single full-fidelity ChannelId callback with atomic admission and no FX loss, then qualify ASIO/WASAPI and zero-FX crackle on actual hardware. This change alone is **not M1 complete**, not UAT, not acoustic FAT. + +## Worker payload lifetime hardening +`NativeShowSaveWorker` validates Show IDs before reserving, releases snapshot/blob/closure memory immediately on start failure, and moves the completion closure rather than retaining a second copy after IO completion. The long-lived worker is reused; no new OS thread or realtime allocation has been introduced. Windows JUCE compilation and runtime verification are release gates. diff --git a/src/NativeShowSaveWorker.h b/src/NativeShowSaveWorker.h index f44e1f23f..f568003d2 100644 --- a/src/NativeShowSaveWorker.h +++ b/src/NativeShowSaveWorker.h @@ -43,17 +43,19 @@ class NativeShowSaveWorker final : private juce::Thread { } bool launch(juce::File studio,SnapshotV2 snapshot, std::vector binaryStates,Completion completion) { - if(!reserve(Operation::save,std::move(studio),std::move(completion)) || - !detail::uuid(snapshot.id))return false; + // Reject invalid requests BEFORE reserving or retaining a potentially + // large vendor-state payload on this long-lived worker. + if(!detail::uuid(snapshot.id) || + !reserve(Operation::save,std::move(studio),std::move(completion))) + return false; snapshot_=std::move(snapshot); blobs_=std::move(binaryStates); - if(startThread())return true; - return false; + return startOrRelease(); } bool list(juce::File studio,Completion completion) { if(!reserve(Operation::list,std::move(studio),std::move(completion))) return false; - return startThread(); + return startOrRelease(); } bool read(juce::File studio,juce::String showId, juce::int64 epoch,juce::int64 revision,Completion completion) { @@ -62,9 +64,27 @@ class NativeShowSaveWorker final : private juce::Thread { return false; requestedId_=std::move(showId); requestEpoch_=epoch;requestRevision_=revision; - return startThread(); + return startOrRelease(); } private: + // Start failure must release captured Show snapshots, binary-state blobs + // and completion closures. The worker never transfers these to RT. + bool startOrRelease() { + if(startThread())return true; + releaseJob(); + return false; + } + // Exclusively invoked after the worker's IO is finished or before it + // started. No concurrent use with the caller/message thread. + void releaseJob() { + snapshot_=SnapshotV2{}; + blobs_.clear(); + blobs_.shrink_to_fit(); + requestedId_={}; + requestEpoch_=0;requestRevision_=0; + studio_={}; + finished_={}; + } bool reserve(Operation mode,juce::File studio,Completion completion) { if(isThreadRunning()||!completion)return false; operation_=mode;studio_=std::move(studio); @@ -86,10 +106,11 @@ class NativeShowSaveWorker final : private juce::Thread { } catch(...) { result.error="Unknown native Show IO exception; session unchanged"; } - blobs_.clear(); // release captured bytes on IO thread after commit - blobs_.shrink_to_fit(); + // Move the completion closure out: the worker must not retain a + // second copy of UI captures or a large Show snapshot between jobs. + auto done=std::move(finished_); + releaseJob(); // IO worker thread, never audio callback auto alive=alive_; - auto done=finished_; // A 128 MB vendor-blob result must not be copied by std::function // when JUCE queues an async callback on the message thread. auto delivered=std::make_shared(std::move(result)); From 773fbddafdbc070831f496a1a6269230f96ce120 Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Mon, 2 Nov 2026 23:35:43 +0700 Subject: [PATCH 195/233] feat(engine): reconcile AUX realtime control, prove ownership; gate M1 hardware FAT artifact --- .github/workflows/p1-windows.yml | 9 ++++---- docs/FIRST_SOUND_FAT_QUICKSTART_20261101.md | 22 ++++++++++++++++++- ...M1_REALTIME_CORE_STABILIZATION_20261102.md | 7 ++++++ engine/core/PreparedMixerBlock.h | 11 +++++----- tests/mixer_routing_plan_test.cpp | 9 +++++++- tests/realtime_control_test.cpp | 4 +++- 6 files changed, 50 insertions(+), 12 deletions(-) diff --git a/.github/workflows/p1-windows.yml b/.github/workflows/p1-windows.yml index 965bd2fbf..266baddc7 100644 --- a/.github/workflows/p1-windows.yml +++ b/.github/workflows/p1-windows.yml @@ -137,12 +137,13 @@ jobs: & ./scripts/verify_native_windows_artifact.ps1 -OutputDir dist if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE } # PRs compile/CTest/package but never silently publish a stable build. - # This single M4 FAT branch is explicitly allowed to upload an - # UNQUALIFIED experimental ZIP for real physical hardware testing. + # Only explicitly named hardware-FAT candidate PRs may upload an + # UNQUALIFIED test artifact. It is never a public/stable release. + # No extra build matrix and no upload when CTest/package audit fails. - uses: actions/upload-artifact@v4 - if: ${{ github.event_name != 'pull_request' || github.head_ref == 'milestone/m4-unified-native-multichannel-fx-20261101' }} + if: ${{ github.event_name != 'pull_request' || github.head_ref == 'milestone/m4-unified-native-multichannel-fx-20261101' || github.head_ref == 'work/m1-realtime-stability-20261102' }} with: - name: ${{ github.event_name == 'pull_request' && 'ArSonMix-M4-EXPERIMENTAL-Hardware-FAT-Windows-x64' || 'ArSonMix-GUI10CH-P012-Verified-Hardware-FAT-Windows-x64' }} + name: ${{ github.event_name == 'pull_request' && (github.head_ref == 'work/m1-realtime-stability-20261102' && 'ArSonMix-M1-EXPERIMENTAL-Hardware-FAT-Windows-x64' || 'ArSonMix-M4-EXPERIMENTAL-Hardware-FAT-Windows-x64') || 'ArSonMix-GUI10CH-P012-Verified-Hardware-FAT-Windows-x64' }} path: dist/ if-no-files-found: error retention-days: 14 diff --git a/docs/FIRST_SOUND_FAT_QUICKSTART_20261101.md b/docs/FIRST_SOUND_FAT_QUICKSTART_20261101.md index baa97a730..c518d4eaf 100644 --- a/docs/FIRST_SOUND_FAT_QUICKSTART_20261101.md +++ b/docs/FIRST_SOUND_FAT_QUICKSTART_20261101.md @@ -1,5 +1,5 @@ # ArSonMix — Windows First Sound / Hardware FAT -Date: 1 November 2026. Current production: **10 input channels + 4 AUX**, one JUCE callback, MAIN/MONITOR and native VST3. The experimental dynamic CH11/Group engine has **not** replaced the production callback. The outstanding 0FX hardware crackle issue is #15. This is a FAT **candidate**, not hardware certified or guaranteed zero physical latency. +Date: 1 November 2026. M1 hardware candidate addendum: 2 November 2026. Current production: **10 input channels + 4 AUX**, one JUCE callback, MAIN/MONITOR and native VST3. The experimental dynamic CH11/Group engine has **not** replaced the production callback. The outstanding 0FX hardware crackle issue is #15. This is a FAT **candidate**, not hardware certified or guaranteed zero physical latency. ## 1. Verify package Extract the complete Windows Actions ZIP to a writable folder. `BUILD_PROVENANCE.json` must show the same `sourceCommit` as the GitHub run; EXE SHA-256 must equal `exeSha256`. Keep `portable_mode.txt`, never delete an existing `Studio` workspace. The file is a Windows x64 JUCE GUI executable; Microsoft Edge WebView2 Runtime and the correct audio hardware driver are required. @@ -28,3 +28,23 @@ Send: (a) screenshot of active driver/rate/buffer/pins, (b) accepted CH01 patch **PASS is hardware-grounded:** correct MAIN source path, verified mute/fader control, no wrong-endpoint output, clean 0FX wired audio for >=30 minutes on the recorded device/rate/buffer, followed by real plugin testing. A green Windows CTest/Chromium CI is not a substitute. Historical full test matrix remains `docs/HARDWARE_FAT_GUI10_ENGINE_P012_20261027.md`. This packaged guide supersedes obsolete manual START AUDIO instructions. + +## 5. M1 candidate — structured physical acceptance (not an M5 universal graph) + +The **ArSonMix-M1-EXPERIMENTAL-Hardware-FAT-Windows-x64** workflow artifact is uploaded only if the exact PR SHA completes Windows compile, all CTests, packaging and ZIP/embedded-GUI SHA256 verification. A PR artifact is not a public stable release. The EXE preserves the existing **native M4 10CH + 4AUX** callback, not a live CH11/group universal engine. DO NOT apply an unqualified artifact on a live public-performance show. + +One real device, one verified I/O clock, wired monitoring, LOW output gain and initially **0 VST3**. Start at a supported buffer of 256 samples, then 128 and 64 only after the earlier stage has passed; document actual negotiated values, don't assume the driver honored the request. For each supported buffer: + +| Native check | Operator action and expected physical result | Hard fail / retain evidence | +|---|---|---| +| Unpatched startup | Launch without input patch; MAIN stays silent and unarmed | Any unexpected output/audio or wrong endpoint | +| Device isolation | Select real active ASIO or WASAPI endpoint; verify L/R physical pins, rate and epoch | Invalid pins, auto re-arm on hotplug, unexpected fallback | +| Real 0FX | Patch CH01 mic/line input, explicitly ARM; record 30-minute continuous wired output | Pops/crackle: Mark Crackle and Copy Full Report | +| Short-buffer gain | Move CH01 fader repeatedly and reverse while moving; listen for clicks, watch true meters | Zipper clicks, freezes, inconsistent physical gain | +| AUX gain/edge | Connect a validated SEND to AUX; change send and AUX return levels with effects bypassed | Silence despite accepted change, stale/reverted controls, double direct signal | +| Monitor isolation | If a separate hardware pair exists, enable MONITOR intentionally | MONITOR leaking to MAIN or shared hardware pair | +| Vendor/plugin | Only after 0FX clean, insert real VST3 and toggle bypass/editor | Stuck UI, plugin recreation, audio gap, FX state loss | +| Show lifecycle | Save and recall same route/plugin states, check output is never armed implicitly | Stale device epoch, missing FX, corrupt restoration | +| Safe shutdown | Stop/restart and unplug/replug device, reselect/ARM deliberately | Audio on unexpected pins, leaked resource or crash | + +**Required evidence**: download artifact name and exact 40-character SHA from `BUILD_PROVENANCE.json`; SHA256 of installed EXE; physical device name/driver/rate/buffer and enabled port mapping; 0FX duration; crackle report if any; one short video or screenshots demonstrating CH01, AUX, MONITOR and Show. The test passes only for the exact device and configuration tested, and never proves every VST3 or absolute crash-proof operation. diff --git a/docs/M1_REALTIME_CORE_STABILIZATION_20261102.md b/docs/M1_REALTIME_CORE_STABILIZATION_20261102.md index 8ba3ac0f2..17f836666 100644 --- a/docs/M1_REALTIME_CORE_STABILIZATION_20261102.md +++ b/docs/M1_REALTIME_CORE_STABILIZATION_20261102.md @@ -12,3 +12,10 @@ The existing `RealtimeRoutePublisher` owns bounded retirement. New tests hold a ## Worker payload lifetime hardening `NativeShowSaveWorker` validates Show IDs before reserving, releases snapshot/blob/closure memory immediately on start failure, and moves the completion closure rather than retaining a second copy after IO completion. The long-lived worker is reused; no new OS thread or realtime allocation has been introduced. Windows JUCE compilation and runtime verification are release gates. + +## Exact CI evidence and hardware artifact scope (revision 2) +Windows run `41479462759` compiled successfully but 52/54 CTests passed. The remaining two failures were analyzed and corrected together: +1. Native `setAuxSendGain` / `setAuxBusGain` is **one atomic automation plane** even without separate strip controls, as exercised by `dedicated_aux_bus_test.cpp`. The old conditional gate silenced actual physical AUX level edits. In the routing CTest, a newly built `PreparedMixerBlock` establishes fresh compiled defaults, while an already automated block retains its explicit target. +2. The graph-retirement test needed to count the rejected candidate's destructor too: 3 original accepted + 1 rejected + 1 newly accepted = **5 distinct prepared instances**. The lifetime test checks that saturation safely rejects and reader-owned graphs are not reclaimed early. + +This patch also authorizes **one** exact-branch `M1-EXPERIMENTAL` GitHub Actions artifact **only after** all CTests and package/provenance validation pass. This does not enable universal routing/CH11, promote stable release, or change hardware patch/ARM policy. The packaged FAT guide now includes explicit pass/fail cases for wired 0FX ASIO, AUX/monitor, state recall and hotplug. No parallel CI matrix or redundant always-on worker. diff --git a/engine/core/PreparedMixerBlock.h b/engine/core/PreparedMixerBlock.h index 4b75cff29..0a13020e6 100644 --- a/engine/core/PreparedMixerBlock.h +++ b/engine/core/PreparedMixerBlock.h @@ -483,7 +483,7 @@ class PreparedMixerBlock final { // Once the message thread publishes a changed send target, // the SAME callback switches to one live PRE/POST processor // which follows 64-sample gains across varying block sizes. - if(live && auxAutomationActive_.load(std::memory_order_acquire)) + if(auxAutomationActive_.load(std::memory_order_acquire)) dispatchLiveAux(strip,SendTap::preFader,l,r,frames); else graph.aux.dispatch(strip,SendTap::preFader,l,r, auxLeft_.data(),auxRight_.data(),frames); @@ -557,7 +557,7 @@ class PreparedMixerBlock final { // Once the message thread publishes a changed send target, // the SAME callback switches to one live PRE/POST processor // which follows 64-sample gains across varying block sizes. - if(live && auxAutomationActive_.load(std::memory_order_acquire)) + if(auxAutomationActive_.load(std::memory_order_acquire)) dispatchLiveAux(strip,SendTap::postFader,l,r,frames); else graph.aux.dispatch(strip,SendTap::postFader,l,r, auxLeft_.data(),auxRight_.data(),frames); @@ -586,9 +586,10 @@ class PreparedMixerBlock final { // the sample-continuous 64-frame de-zipper across 4/8/16-frame // callbacks. The fader scales the return AFTER hosted AUX VST3 // for both MAIN and independent MONITOR, not source dry PCM. - // Offline/static rendering never inherits a previous live - // automation target. Native live control provides 'live'. - const bool automated=live && auxBusAutomationActive_.load( + // AUX automation is independent of channel fader/MUTE control. + // A caller may automate AUX sends/returns without supplying a + // RealtimeStripControls bank; keep one canonical DSP target plane. + const bool automated=auxBusAutomationActive_.load( std::memory_order_acquire); const float target=automated ?auxBusTarget_[b].load(std::memory_order_acquire):bus.gain; diff --git a/tests/mixer_routing_plan_test.cpp b/tests/mixer_routing_plan_test.cpp index 1a2832a8e..b8c3b120e 100644 --- a/tests/mixer_routing_plan_test.cpp +++ b/tests/mixer_routing_plan_test.cpp @@ -842,8 +842,15 @@ static void verifyRealtimeAuxMasterPcmBothOutputs() { assert(!block.setAuxBusGain(0,std::numeric_limits::quiet_NaN())); assert(close(block.auxBusGain(0),0.f)); assert(close(block.plan().aux.buses[0].gain,1.f)); // topology immutable - // Legacy offline/no-live-control path still uses immutable compiled gain. + // Explicit AUX automation remains live even without a separate strip + // controls object. It MUST NOT silently fall back to stale compiled gain + // because older physical/native paths do not always pass that object. assert(block.process(inputs,2,left.data(),right.data(),64,noFx)); + assert(close(left[0],0.f)); + // A newly prepared graph starts at its own immutable initial gain: + // structural transaction/Show recall does not leak old AUX state. + PreparedMixerBlock freshlyPrepared(graph,64); + assert(freshlyPrepared.process(inputs,2,left.data(),right.data(),64,noFx)); assert(close(left[0],initial)); } diff --git a/tests/realtime_control_test.cpp b/tests/realtime_control_test.cpp index 91b288fdb..10678cd4a 100644 --- a/tests/realtime_control_test.cpp +++ b/tests/realtime_control_test.cpp @@ -87,7 +87,9 @@ int main(){ assert(publish(4)==Result::applied); publisher.unpublish(); assert(publisher.pollRetirement()); - assert(destroyed.load(std::memory_order_relaxed)==4); + // Three accepted snapshots + one rejected admission + final fourth + // accepted snapshot: all five owners are reclaimed (no leak/double free). + assert(destroyed.load(std::memory_order_relaxed)==5); // Runtime contract for the exact RT graph publication helper. struct FakeGraph { int id; }; FakeGraph old{1}, next{2}, third{3}; From dd8f8e32918d6928cec19e1a1732a6f30b9f317d Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Mon, 2 Nov 2026 23:45:07 +0700 Subject: [PATCH 196/233] GUI milestone: lock native operator geometry, accepted identity and engine handoff One shared adaptive width for channels and pinned MAIN; exact accepted native color/icon on both headers and lower nameplates; graphite native chassis, retained V5 hardware keys, no browser-created DSP. Chromium assertions for metadata and bank geometry; source/WebView standalone parity; single v8 ENGINE operation contract. Not a native PCM release. --- AR-MIX-Live-FX-Host-Standalone-v0.3.html | 115 +++++++++++++++++- .../GUI_FINAL_ENGINE_HANDOFF_20261102.md | 33 +++++ tests/operator_console_v6_smoke.py | 21 +++- web/mixer-layout.css | 56 +++++++++ web/mixer-layout.js | 59 ++++++++- 5 files changed, 277 insertions(+), 7 deletions(-) create mode 100644 docs/workstreams/GUI_FINAL_ENGINE_HANDOFF_20261102.md diff --git a/AR-MIX-Live-FX-Host-Standalone-v0.3.html b/AR-MIX-Live-FX-Host-Standalone-v0.3.html index cf4109f8a..41ebe98ce 100644 --- a/AR-MIX-Live-FX-Host-Standalone-v0.3.html +++ b/AR-MIX-Live-FX-Host-Standalone-v0.3.html @@ -2973,6 +2973,62 @@ @media(prefers-reduced-motion:reduce){ #app .arV6Console .arV6WirePot::before{transition:none!important} } + + +/* GUI FINAL -> ENGINE V8: 1 accepted identity, 1 channel width, 1 graphite + chassis. No new DSP, paint animation or browser-inferred LIVE controls. */ +#app #arV6Console{ + --v6-channel-w:150px; + --v6-status-h:34px; +} +#app .arV6Console .arV6Main, +#app .arV6Console[data-narrow="true"] .arV6Main{ + flex:0 0 var(--v6-channel-w);width:var(--v6-channel-w); + max-width:var(--v6-channel-w);min-width:var(--v6-channel-w); + border-left:0;box-shadow:-2px 0 0 #63808b; + background:var(--am-metal-panel); +} +#app .arV6Console .arV6Strip, +#app .arV6Console[data-narrow="true"] .arV6Strip{ + flex:0 0 var(--v6-channel-w);width:var(--v6-channel-w); + min-width:var(--v6-channel-w);max-width:var(--v6-channel-w); + background:var(--am-metal-panel); +} +#app .arV6Console .arV6Strip.arV6Master, +#app .arV6Console[data-narrow="true"] .arV6Strip.arV6Master{ + flex:0 0 var(--v6-channel-w);width:var(--v6-channel-w); + min-width:var(--v6-channel-w);max-width:var(--v6-channel-w); + background:var(--am-metal-panel); +} +#app .arV6Console .arV6Top{ + background:linear-gradient(180deg,var(--am-metal-raised),var(--am-metal-panel)); +} +#app .arV6Console .arV6StripHead{ + display:flex;flex-direction:row;align-items:center;gap:3px; + min-width:0;border-bottom:2px solid var(--ch,#5f9ab1); + background:color-mix(in srgb,var(--ch,#5f9ab1) 15%,var(--am-metal-panel)); +} +#app .arV6Console .arV6Role{flex:none;max-width:42%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font:500 8px/1 "Segoe UI",sans-serif;letter-spacing:.15px} +#app .arV6Console .arV6IdentityIcon{flex:none;font-size:13px;line-height:1} +#app .arV6Console .arV6Name{flex:1;min-width:0;font-size:10px;font-weight:550} +#app .arV6Console .arV6StripStatus{ + display:flex;flex-direction:column;align-items:stretch;justify-content:center; + gap:1px;padding:2px 3px; + border-top:2px solid var(--ch,#5f9ab1); + background:color-mix(in srgb,var(--ch,#5f9ab1) 28%,var(--am-metal-panel)); + min-width:0; +} +#app .arV6Console .arV6FootIdentity{ + display:flex;gap:4px;align-items:center;min-width:0; + color:#ebf2f5;font:500 9px/1 "Segoe UI",sans-serif; +} +#app .arV6Console .arV6FootIcon{flex:none;font-size:11px;line-height:1} +#app .arV6Console .arV6FootName{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap} +#app .arV6Console .arV6PcmState{ + color:#b7c8ce;font:500 8px/1.05 "Segoe UI",sans-serif; + letter-spacing:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis; +} +#app .arV6Console[data-demo="true"] .arV6PcmState{color:#e3bb82} '), 'Pages/standalone CSS drift'); assert.ok(standalone.includes(''), 'Pages/standalone JS drift'); for (const cls of ['gain-scale-travel','vu-scale-travel','meter-signal-area','fader-travel']) { diff --git a/web/mixer-layout.js b/web/mixer-layout.js index 6e5d7627b..b330783df 100644 --- a/web/mixer-layout.js +++ b/web/mixer-layout.js @@ -408,7 +408,15 @@ return [...selectedIds].filter(id=>byId.has(id)&&byId.get(id).role!=='MAIN'); } function refreshSelectionActions(){ - selectionCount.textContent=selectedIds.size+' SEL'; + const count=selectedIds.size; + selectionCount.textContent=count+' SEL'; + selectionCount.dataset.selectionCount=String(count); + selectionCount.setAttribute('aria-label', + count+' selected channels; native link and group controls'); + // Hardware keys convert button text into SVG. Repaint this dynamic + // count synchronously instead of waiting for a MutationObserver turn; + // no DSP/control operation is dispatched by this UI-only decoration. + window.ArSonMixHardwareKeys?.upgrade?.(selectionCount); if(selectionPanel.hidden)return; const ids=selectedNativeIds(),channels=ids.map(id=>byId.get(id)); const names=channels.map(c=>c.name).join(' · '); From a5ac20d79abd0dfb547a2f150ea104704fb5ccd7 Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Tue, 3 Nov 2026 18:54:06 +0700 Subject: [PATCH 230/233] fix(joined E3): rebuild exact standalone GUI from changed native selection renderer and require V5 hardware keys Regenerate 1MB source-owned standalone HTML using build_ui_css.py embedding order for app, calibrated CSS, mixer I/O, mixer layout and hardware keys; preserve exact WebView2/offline byte parity. Replace obsolete BTN180_HEADER fixture assertion with modern fail-closed V5_HEADER_KEYS hardware-JS+CSS authority; do not promote fake LIVE or weaken visual design. CI caught both changes and prevents release while stale. --- AR-MIX-Live-FX-Host-Standalone-v0.3.html | 10 +++++++++- tests/console_v6_fat_gate_test.mjs | 4 +++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/AR-MIX-Live-FX-Host-Standalone-v0.3.html b/AR-MIX-Live-FX-Host-Standalone-v0.3.html index a9471ecc0..2a8f9b2f9 100644 --- a/AR-MIX-Live-FX-Host-Standalone-v0.3.html +++ b/AR-MIX-Live-FX-Host-Standalone-v0.3.html @@ -7637,7 +7637,15 @@ return [...selectedIds].filter(id=>byId.has(id)&&byId.get(id).role!=='MAIN'); } function refreshSelectionActions(){ - selectionCount.textContent=selectedIds.size+' SEL'; + const count=selectedIds.size; + selectionCount.textContent=count+' SEL'; + selectionCount.dataset.selectionCount=String(count); + selectionCount.setAttribute('aria-label', + count+' selected channels; native link and group controls'); + // Hardware keys convert button text into SVG. Repaint this dynamic + // count synchronously instead of waiting for a MutationObserver turn; + // no DSP/control operation is dispatched by this UI-only decoration. + window.ArSonMixHardwareKeys?.upgrade?.(selectionCount); if(selectionPanel.hidden)return; const ids=selectedNativeIds(),channels=ids.map(id=>byId.get(id)); const names=channels.map(c=>c.name).join(' · '); diff --git a/tests/console_v6_fat_gate_test.mjs b/tests/console_v6_fat_gate_test.mjs index 5131e5da9..6db14a799 100644 --- a/tests/console_v6_fat_gate_test.mjs +++ b/tests/console_v6_fat_gate_test.mjs @@ -313,7 +313,9 @@ test('PR278 source contract blocks divergent universal chrome/identity/MAIN',()= const r=inspectPr278({reference,js,css,legacy:'channelIcons= channelPalette=', test:'console-v8-native-unready.json arMixConsoleAck'}); for(const id of ['TOP_BOTTOM_COLOR_ICON','ONE_GRAPHITE_CHASSIS', - 'BTN180_HEADER','PINNED_MAIN_EQUAL_WIDTH','V8_DENSITY_AWARE_BANK','V8_TRUE_SECTION_COLLAPSE']) + // V5 replaced the obsolete BTN180_HEADER predicate: require that the + // newer hardware key actually provides its JS owner AND native CSS skin. + 'V5_HEADER_KEYS','PINNED_MAIN_EQUAL_WIDTH','V8_DENSITY_AWARE_BANK','V8_TRUE_SECTION_COLLAPSE']) assert.ok(r.blocked.some(c=>c.id===id),id+' must not pass'); assert.equal(r.audioCertified,false); for(const id of ['REFERENCE_278','DIRECT_NATIVE_IO','LINK_VS_GROUP','NATIVE_ACK_NO_DEMO']) From ac3b97d3365bd36bf23073dd13a2c5e938c8bc23 Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Tue, 3 Nov 2026 19:44:26 +0700 Subject: [PATCH 231/233] fix(integration FAT): assert real SVG hardware selection state after device epoch transition Restore exact joined UI CI: selection-control button is rendered via SVG hardware-key owner; Playwright inner_text is invalid as the text is replaced by SVG. Verify actual native stable ChannelId selection emptiness, count, SVG legend, and accessible label following epoch migration and quick FX navigation. Preserve all approved UI visuals and native state gates; no production source changed. --- tests/operator_console_v6_smoke.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/tests/operator_console_v6_smoke.py b/tests/operator_console_v6_smoke.py index 5532baf35..fa43362b8 100644 --- a/tests/operator_console_v6_smoke.py +++ b/tests/operator_console_v6_smoke.py @@ -641,8 +641,17 @@ async def aligned_sections(): assert await page.locator('[data-channel-id="7"] .arV6FxSlot').count()==fx_count # F8 searches ONLY the native catalog and adds through one typed intent. - # An epoch change clears prior selection; one native ChannelId is required. - assert await page.locator(".arV6SelectionCount").inner_text()=="0 SEL" + # Device epoch change MUST revoke multi-selection, and contextual + # quick FX must NOT silently select its target channel. + # Hardware key legends are SVG-backed: inner_text() is not the + # operator-visible label after the key-upgrade controller runs. + selection=page.locator(".arV6SelectionCount") + assert await page.evaluate( + "()=>window.__arMixV6ReadOnly().selectedChannelIds")==[] + assert await selection.get_attribute("data-selection-count")=="0" + assert await selection.get_attribute("data-mx-hw-legend")=="0 SEL" + assert await selection.get_attribute("aria-label")==( + "0 selected channels; native link and group controls") await page.keyboard.press("F8") manager=page.locator("#arV6PluginPanel") assert await manager.is_visible() From a9834868679c8d5359e8f4f76e4260f160acf960 Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Tue, 3 Nov 2026 19:49:07 +0700 Subject: [PATCH 232/233] fix(joined GUI FAT): stabilize selection controller locator across dynamic native ARIA label The SVG hardware key changes its accessible name to ' selected channels; native link and group controls'; the old static Playwright get_by_role(name='Selected channels and native group actions') cannot match after real selection. Locate the existing canonical .arV6SelectionCount control; require its native ChannelId selection count and hardware SVG legend to agree. Account for deliberate selection changes during inline rename. Keep approved GUI sources and actual operator behavior unchanged. --- tests/operator_console_v6_smoke.py | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/tests/operator_console_v6_smoke.py b/tests/operator_console_v6_smoke.py index fa43362b8..7c17e7eb2 100644 --- a/tests/operator_console_v6_smoke.py +++ b/tests/operator_console_v6_smoke.py @@ -689,7 +689,14 @@ async def aligned_sections(): # grouping transaction, NOT a serial audio GROUP BUS. await page.locator('[data-channel-id="2"] .arV6StripHead').click() await page.locator('[data-channel-id="7"] .arV6StripHead').click(modifiers=["Control"]) - await page.get_by_role("button",name="Selected channels and native group actions").click() + # The accessible name is dynamic ("N selected channels..."). + # Target the stable native selection controller, then assert its + # device-epoch-bound count instead of the stale pre-render label. + assert await page.locator(".arV6SelectionCount").get_attribute( + "data-selection-count")=="2" + assert await page.locator(".arV6SelectionCount").get_attribute( + "data-mx-hw-legend")=="2 SEL" + await page.locator(".arV6SelectionCount").click() operator=page.locator("#arV6SelectionPanel") assert await operator.is_visible() link=page.get_by_role("button", @@ -786,7 +793,19 @@ async def aligned_sections(): no_group["graph"]["revision"]="9" no_group["graph"]["capabilities"]["supportedOps"]=OPS await page.evaluate("(s)=>window.__v6Test.publish('arMixConsoleSnapshot',s)",no_group) - await page.get_by_role("button",name="Selected channels and native group actions").click() + # The accessible name is dynamic ("N selected channels..."). + # Target the stable native selection controller, then assert its + # device-epoch-bound count instead of the stale pre-render label. + # Inline rename may change current selection through channel-header + # clicks. Check the same canonical JS Set and SVG/count projection; + # do not assume the earlier two-channel selection is still active. + selected_now=await page.evaluate( + "()=>window.__arMixV6ReadOnly().selectedChannelIds") + assert await page.locator(".arV6SelectionCount").get_attribute( + "data-selection-count")==str(len(selected_now)) + assert await page.locator(".arV6SelectionCount").get_attribute( + "data-mx-hw-legend")==f"{len(selected_now)} SEL" + await page.locator(".arV6SelectionCount").click() assert await link.is_disabled() and await route.is_disabled() # 4 desktop widths and 3 heights: meter/fader zones aligned, MAIN pinned. From 6d0ae6ad7d70fa174eadea45c898e77746a733b3 Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Tue, 3 Nov 2026 19:54:10 +0700 Subject: [PATCH 233/233] feat(FAT E3): exact-SHA joined Windows field recorder for witnessed matched 0FX/1FX Add a real LIVE_THROUGH_1FX operator evidence session to the packaged, SHA-bound Windows FAT collector. Before starting the 1FX timer, require an existing 30-minute witnessed wired 0FX baseline/full report and identical verified backend, rate, buffer, capture/render endpoints and ordered pins; require one identified active native VST3 rack insert. Record distinct 30-minute 1FX results with a separately hashed full diagnostic report; summary requires output-only, capture-only and both comparable live-through runs, always hardwareCertified=false and operator-reported FX provenance. Preserve actual native device and audio callback ownership unchanged; the field script never arms outputs or operates VST3. Add packaging contract regression and concise novice-ready FAT steps. --- docs/CONSOLE_V6_FAT_EVIDENCE_GATE_20261101.md | 7 ++ docs/FIRST_SOUND_FAT_QUICKSTART_20261101.md | 11 +++ scripts/collect_hardware_fat_windows.ps1 | 89 +++++++++++++++++-- ...ative_artifact_packaging_contract_test.mjs | 30 ++++++- 4 files changed, 127 insertions(+), 10 deletions(-) diff --git a/docs/CONSOLE_V6_FAT_EVIDENCE_GATE_20261101.md b/docs/CONSOLE_V6_FAT_EVIDENCE_GATE_20261101.md index e40305130..4e0bfd99b 100644 --- a/docs/CONSOLE_V6_FAT_EVIDENCE_GATE_20261101.md +++ b/docs/CONSOLE_V6_FAT_EVIDENCE_GATE_20261101.md @@ -43,3 +43,10 @@ The trace file MUST be schema v2 WebView native ACK/PCM state with \`provenance: ### PR #278 V8 — adaptive geometry (2 Nov 2026) The newest isolated design study `eda57f931ae3cc2872579df29cdf4e1486592b64` adds density-aware bank capacity (Comfort 150px, Standard 125px, Compact 105px), corrected 32px rail budget and pinned MAIN at the same channel width. Folded Route, FX and Send children must be `display:none`, never clipped into 23px. Source authority gate now reports these as native GUI blockers; actual Chromium rendered geometry remains a separate test (`design-references/audition-mixer-study/visual_layout_audit_v8.py`). No simulated DSP from the reference enters the app. + + +### Joined hardware 1FX comparison recorder (3 Nov 2026) + +The native Windows FAT ZIP now includes a source+EXE hash-bound offline collector with a fourth explicit mode, `LIVE_THROUGH_1FX`, alongside OUTPUT_ONLY_TONE, CAPTURE_ONLY and DRY_THROUGH_0FX. The 1FX mode requires a **completed witnessed 1800-second wired 0FX baseline with full report** before starting. Its native GUI operator-reported VST3 name and count=1 are journalled, and the backend, rate, frames, capture/render endpoint names and ordered physical pins must exactly match the baseline. A second 1800-second wired 1FX run and separate full diagnostic report are required for the summary to become `EVIDENCE_READY_FOR_HUMAN_REVIEW`. The first mismatch is rejected before starting the timer. + +This is stricter than the legacy v6 automated release-intake minimum, which already requires 0FX issue #15 evidence. The new fourth-mode summary requirement is **field review evidence**; it neither changes the native PCM gate nor fabricates plugin telemetry, acoustic measurements, hardware certification or universal ChannelId readiness. The existing independent `console_v6_fat_gate.mjs` continues to return `certified:false`. diff --git a/docs/FIRST_SOUND_FAT_QUICKSTART_20261101.md b/docs/FIRST_SOUND_FAT_QUICKSTART_20261101.md index 57a784abe..86566177a 100644 --- a/docs/FIRST_SOUND_FAT_QUICKSTART_20261101.md +++ b/docs/FIRST_SOUND_FAT_QUICKSTART_20261101.md @@ -51,3 +51,14 @@ One real device, one verified I/O clock, wired monitoring, LOW output gain and i ### SHA authority for native PR builds The Windows workflow explicitly checks out **`github.event.pull_request.head.sha`**, verifies it against `git rev-parse HEAD` **before** building, and packages the same `sourceCommit`. This avoids GitHub Actions' default transient PR merge commit being mislabelled as the ENGINE HEAD. If provenance SHA differs from the run's exact source SHA, **STOP**; do not start hardware FAT. The GUI and ENGINE on the *new integration branch* still require their own joined exact-SHA test before final UAT. + + +## Matched 0FX / 1FX physical FAT — experimental joined executable (3 Nov 2026) + +The packaged `ArSonMix-Hardware-FAT.ps1` collects human-observed evidence, never starts audio or validates acoustic quality by itself. From the **extracted verified Windows ZIP**, run `-Action Verify` first. Use the **same native-verified ASIO/WASAPI driver, device name, 48 kHz/other actual rate, buffer, physical input and output pins** for both runs; enter only what AUDIO SETUP / SIGNAL CHECK actually displays. Do not type illustrative sample values as if they were hardware readings. + +Complete `-Mode DRY_THROUGH_0FX` with all VST3 inserts removed, `-Wired`, low listening level, `-Action Start`, at least **1800 seconds**, then `-Action Stop -ReportPath "" -Result CLEAR/CRACKLE -Witness ""`. This baseline must have the full report, witness and a conclusive observation before starting 1FX. + +Next load **exactly one real native VST3** into the applicable audio channel, ensure it is active/not bypassed and the native audio route still matches. Use `-Action Start -Mode LIVE_THROUGH_1FX -FxCount 1 -Vst3Name "" -Wired` plus **identical** `-Backend`, `-SampleRate`, `-BufferFrames`, `-InputPins`, `-OutputPins`, `-CaptureEndpoint` and `-RenderEndpoint` as the 0FX run. The collector refuses to begin if any detail or the witnessed baseline is missing/mismatched. Run another **1800-second** wired observation, then `-Action Stop` with the new full diagnostic report and witness. Run `-Action Summary` to create `FAT_SUMMARY.json`. + +The existing OUTPUT_ONLY_TONE and CAPTURE_ONLY isolation runs are also required in the summary. `EVIDENCE_READY_FOR_HUMAN_REVIEW` requires all four modes and matching 0FX/1FX conditions. The VST3 name/count, audibility and crackle observations are **operator reports**, not measurements automatically obtained from the plugin or DAC. `hardwareCertified` and `physicalAudibilityVerifiedBySoftware` always remain **false**; issue #15 and GUI/ChannelId universal release blockers are not cleared by running the script. diff --git a/scripts/collect_hardware_fat_windows.ps1 b/scripts/collect_hardware_fat_windows.ps1 index 62c172635..924bc5cd7 100644 --- a/scripts/collect_hardware_fat_windows.ps1 +++ b/scripts/collect_hardware_fat_windows.ps1 @@ -2,7 +2,7 @@ # Offline Windows field evidence recorder. NEVER controls audio devices, DSP, ARM or plugins. param( [ValidateSet('Verify','Start','Stop','Summary')][string]$Action='Verify', - [ValidateSet('OUTPUT_ONLY_TONE','CAPTURE_ONLY','DRY_THROUGH_0FX')][string]$Mode='DRY_THROUGH_0FX', + [ValidateSet('OUTPUT_ONLY_TONE','CAPTURE_ONLY','DRY_THROUGH_0FX','LIVE_THROUGH_1FX')][string]$Mode='DRY_THROUGH_0FX', [string]$Backend='', [int]$SampleRate=0, [int]$BufferFrames=0, @@ -10,6 +10,10 @@ param( [string]$OutputPins='', [string]$CaptureEndpoint='', [string]$RenderEndpoint='', + # MANUALLY read from the native VST3 rack; not a synthetic software probe. + # A 1FX run must identify exactly one active, non-bypassed vendor insert. + [ValidateRange(0,8)][int]$FxCount=0, + [string]$Vst3Name='', [switch]$Wired, [ValidateSet('CLEAR','CRACKLE','INCONCLUSIVE')][string]$Result='INCONCLUSIVE', [string]$ReportPath='', @@ -85,8 +89,42 @@ if ($Action -eq 'Start') { if ($Mode -eq 'CAPTURE_ONLY' -and ($outputs.Count -ne 0 -or $inputs.Count -lt 1)) { throw 'CAPTURE_ONLY must have NO render pins and a real capture pin' } - if ($Mode -eq 'DRY_THROUGH_0FX' -and ($inputs.Count -lt 1 -or $outputs.Count -lt 1)) { - throw 'DRY_THROUGH_0FX needs verified capture and render pins' + if ($Mode -in @('DRY_THROUGH_0FX','LIVE_THROUGH_1FX') -and + ($inputs.Count -lt 1 -or $outputs.Count -lt 1)) { + throw 'Live-through FAT requires actual capture and render pins' + } + # Prevent confusing a 0FX soak with a real active vendor effect. The + # operator enters verified-in-GUI details; collector cannot observe DSP. + if ($Mode -in @('DRY_THROUGH_0FX','LIVE_THROUGH_1FX') -and -not $Wired) { + throw 'Both matched 0FX/1FX tests require actual -Wired hardware routing' + } + if ($Mode -eq 'LIVE_THROUGH_1FX') { + if ($FxCount -ne 1 -or [string]::IsNullOrWhiteSpace($Vst3Name) -or + $Vst3Name.Length -gt 120) { + throw '1FX FAT requires -FxCount 1 and -Vst3Name copied from the active native VST3 rack' + } + # A user should not spend another 30 minutes on an incomparable setup. + # Compare against the most recent completed, witnessed 0FX baseline + # BEFORE the 1FX timer starts; never accept a guess about the device. + $baseline=@($j.sessions | Where-Object { $_.mode -eq 'DRY_THROUGH_0FX' } | Select-Object -Last 1) + if ($baseline.Count -ne 1 -or $baseline[0].elapsedSeconds -lt 1800 -or + -not $baseline[0].wired -or -not $baseline[0].reportSha256 -or + -not $baseline[0].witness -or + $baseline[0].operatorObservation -eq 'INCONCLUSIVE') { + throw 'Record a completed 30-minute wired 0FX baseline with witness and full report before 1FX' + } + $base=$baseline[0] + if ($base.backend -ne $Backend -or + $base.sampleRate -ne $SampleRate -or + $base.bufferFrames -ne $BufferFrames -or + ($base.capturePins -join ',') -ne ($inputs -join ',') -or + ($base.renderPins -join ',') -ne ($outputs -join ',') -or + $base.captureEndpoint -ne $CaptureEndpoint -or + $base.renderEndpoint -ne $RenderEndpoint) { + throw '1FX must use the identical ASIO/WASAPI device, clock, buffer and physical ports as the 0FX baseline' + } + } elseif ($FxCount -ne 0 -or -not [string]::IsNullOrWhiteSpace($Vst3Name)) { + throw 'Only LIVE_THROUGH_1FX accepts an active VST3 rack; other FAT modes require zero FX' } # The operator must select the mode in the running native app FIRST. # Starting this timer does not change any endpoint or output ARM. @@ -100,6 +138,8 @@ if ($Action -eq 'Start') { renderPins=$outputs captureEndpoint=$CaptureEndpoint renderEndpoint=$RenderEndpoint + operatorReportedFxCount=$FxCount + operatorReportedVst3Name=$Vst3Name.Trim() wired=[bool]$Wired } Save-Journal $j @@ -132,6 +172,8 @@ if ($Action -eq 'Stop') { renderPins=$j.active.renderPins captureEndpoint=$j.active.captureEndpoint renderEndpoint=$j.active.renderEndpoint + operatorReportedFxCount=$j.active.operatorReportedFxCount + operatorReportedVst3Name=$j.active.operatorReportedVst3Name wired=$j.active.wired operatorObservation=$Result witness=$Witness @@ -144,13 +186,15 @@ if ($Action -eq 'Stop') { Save-Journal $j Write-Host ('FAT '+$session.mode+' ended: '+$elapsed+' seconds; observation='+$Result) if ($null -eq $reportHash) { Write-Warning 'No full report supplied. Evidence will be incomplete.' } - if ($session.mode -eq 'DRY_THROUGH_0FX' -and $elapsed -lt 1800) { Write-Warning 'Under 30 minutes; this does NOT satisfy the 0FX soak gate.' } + if ($session.mode -in @('DRY_THROUGH_0FX','LIVE_THROUGH_1FX') -and $elapsed -lt 1800) { + Write-Warning 'Under 30 minutes; this does NOT satisfy the matched 0FX/1FX soak comparison.' + } exit 0 } if ($Action -eq 'Summary') { $missing=@() $selected=@() - foreach ($required in @('OUTPUT_ONLY_TONE','CAPTURE_ONLY','DRY_THROUGH_0FX')) { + foreach ($required in @('OUTPUT_ONLY_TONE','CAPTURE_ONLY','DRY_THROUGH_0FX','LIVE_THROUGH_1FX')) { $s=@($j.sessions | Where-Object { $_.mode -eq $required } | Select-Object -Last 1) if ($s.Count -eq 0) { $missing+= $required; continue } $selected+= $s[0] @@ -158,9 +202,35 @@ if ($Action -eq 'Summary') { $missing+=($required+': report/observation/witness missing') } } - $dry=@($selected | Where-Object { $_.mode -eq 'DRY_THROUGH_0FX' }) - if ($dry.Count -eq 1 -and ($dry[0].elapsedSeconds -lt 1800 -or -not $dry[0].wired)) { - $missing+='DRY_THROUGH_0FX: 1800 seconds on wired route required' + foreach ($mode in @('DRY_THROUGH_0FX','LIVE_THROUGH_1FX')) { + $matches=@($selected | Where-Object { $_.mode -eq $mode }) + if ($matches.Count -eq 1) { + $run=$matches[0] + if ($run.elapsedSeconds -lt 1800 -or -not $run.wired) { + $missing+=($mode+': 1800 seconds on wired route required') + } + if ($mode -eq 'LIVE_THROUGH_1FX' -and + ($run.operatorReportedFxCount -ne 1 -or + [string]::IsNullOrWhiteSpace($run.operatorReportedVst3Name))) { + $missing+='LIVE_THROUGH_1FX: native vendor insert identity missing' + } + } + } + # Compare like-for-like driver, clock, buffer, input/output pins before + # attributing any crackle difference to one vendor VST3. + $zero=@($selected | Where-Object { $_.mode -eq 'DRY_THROUGH_0FX' }) + $one=@($selected | Where-Object { $_.mode -eq 'LIVE_THROUGH_1FX' }) + if ($zero.Count -eq 1 -and $one.Count -eq 1) { + $base=$zero[0];$withFx=$one[0] + if ($base.backend -ne $withFx.backend -or + $base.sampleRate -ne $withFx.sampleRate -or + $base.bufferFrames -ne $withFx.bufferFrames -or + ($base.capturePins -join ',') -ne ($withFx.capturePins -join ',') -or + ($base.renderPins -join ',') -ne ($withFx.renderPins -join ',') -or + $base.captureEndpoint -ne $withFx.captureEndpoint -or + $base.renderEndpoint -ne $withFx.renderEndpoint) { + $missing+='0FX/1FX: backend, clock, buffer and physical routes must match for valid comparison' + } } if ($null -ne $j.active) { $missing+='An active session must be stopped first' } $state=if ($missing.Count -eq 0) { 'EVIDENCE_READY_FOR_HUMAN_REVIEW' } else { 'EVIDENCE_INCOMPLETE' } @@ -172,10 +242,11 @@ if ($Action -eq 'Summary') { status=$state hardwareCertified=$false physicalAudibilityVerifiedBySoftware=$false + fxComparisonSource='OPERATOR_REPORTED_ONLY' unresolvedIssue=15 sessions=$selected blockers=$missing - caution='Observations are human-entered. Validate driver clocks, RAW/MAIN PCM, glitch windows and speaker audio manually. Capture flags are NOT render xruns.' + caution='Observations and VST3 identity are human-entered, not hardware telemetry. Review real 0FX/1FX audio and exact clock/pins before attributing crackles. Capture flags are NOT render xruns.' } $outPath=Join-Path $root 'FAT_SUMMARY.json' $resultJson | ConvertTo-Json -Depth 12 | Set-Content -LiteralPath $outPath -Encoding UTF8 diff --git a/tests/native_artifact_packaging_contract_test.mjs b/tests/native_artifact_packaging_contract_test.mjs index 5f41f205a..ad366619e 100644 --- a/tests/native_artifact_packaging_contract_test.mjs +++ b/tests/native_artifact_packaging_contract_test.mjs @@ -162,7 +162,7 @@ test('native sourceCommit attest matches GitHub PR head and exact compiled sourc test('field FAT collector is packaged, checked against source + ZIP hash, never certifies audio',()=>{ const collector=read('scripts/collect_hardware_fat_windows.ps1'); - for(const part of ['OUTPUT_ONLY_TONE','CAPTURE_ONLY','DRY_THROUGH_0FX','FAT_RUNS.json', + for(const part of ['OUTPUT_ONLY_TONE','CAPTURE_ONLY','DRY_THROUGH_0FX','LIVE_THROUGH_1FX','FAT_RUNS.json', 'FAT_SUMMARY.json','elapsedSeconds','reportSha256','hardwareCertified=$false', 'Get-FileHash','sourceCommit','PSScriptRoot']) assert.ok(collector.includes(part),part); assert.match(packaging,/fatCollectorSha256 = /); @@ -173,3 +173,31 @@ test('field FAT collector is packaged, checked against source + ZIP hash, never assert.doesNotMatch(collector,/AudioDeviceManager|setAudioDeviceSetup|startAudio|armOutput|backend\.emitEvent/i); assert.match(workflow,/ParseFile\('scripts\/collect_hardware_fat_windows\.ps1'/); }); + +test('joined FAT 1FX compares the same verified hardware as witnessed 0FX, never self-certifies',()=>{ + const script=read('scripts/collect_hardware_fat_windows.ps1'); + // The field collector is an *operator evidence journal*, not a fake VST3 + // host. Start must fail BEFORE a 30-minute soak on mismatched drivers. + for(const required of [ + "[ValidateRange(0,8)][int]$FxCount=0", + "[string]$Vst3Name=''", + "$Mode -eq 'LIVE_THROUGH_1FX'", + "$FxCount -ne 1", + "the active native VST3 rack", + "Record a completed 30-minute wired 0FX baseline", + "1FX must use the identical ASIO/WASAPI device", + "backend, clock, buffer and physical routes must match", + "operatorReportedFxCount=$FxCount", + "operatorReportedVst3Name=$Vst3Name.Trim()", + "fxComparisonSource='OPERATOR_REPORTED_ONLY'", + "hardwareCertified=$false", + "physicalAudibilityVerifiedBySoftware=$false" + ]) assert.ok(script.includes(required),required); + assert.match(script,/\$baseline\[0\]\.elapsedSeconds -lt 1800/); + assert.match(script,/\$base\.captureEndpoint -ne \$CaptureEndpoint/); + assert.match(script,/\$base\.renderEndpoint -ne \$RenderEndpoint/); + assert.match(script,/\$base\.capturePins -join ','/); + assert.match(script,/\$base\.renderPins -join ','/); + assert.match(script,/\$run\.elapsedSeconds -lt 1800/); + assert.doesNotMatch(script,/AudioDeviceManager|setAudioDeviceSetup|startAudio|armOutput|backend\.emitEvent/i); +});