Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
14f57ea
engine(FX): additive rack bypass gate combines with per-insert bypass…
masarray Nov 5, 2026
f51c65c
engine(FX): retain native ChannelId master rack gate across graph rev…
masarray Nov 5, 2026
eb7e475
engine(FX): master rack bypass authoritative on prepared M4 and Chann…
masarray Nov 5, 2026
6f03c3b
engine(FX): master rack bypass authoritative on prepared M4 and Chann…
masarray Nov 5, 2026
d9ccc6d
engine(FX): master rack bypass authoritative on prepared M4 and Chann…
masarray Nov 5, 2026
2542a73
engine(FX): identify actual external CH1 lease before applying origin…
masarray Nov 5, 2026
383a148
native(FX): ACK-fenced ChannelId rack/insert power requests with real…
masarray Nov 5, 2026
d9f5ca2
bridge(FX): show effective rack+slot state only after authoritative n…
masarray Nov 5, 2026
116af0a
bridge(FX): show effective rack+slot state only after authoritative n…
masarray Nov 5, 2026
c3b8121
bridge(FX): show effective rack+slot state only after authoritative n…
masarray Nov 5, 2026
e852830
gui(FX): master OFF forces all insert power visuals OFF without overw…
masarray Nov 5, 2026
3eba5cb
build(FX): same single assembler powers Pages and native from separat…
masarray Nov 5, 2026
9116d80
build(FX): same single assembler powers Pages and native from separat…
masarray Nov 5, 2026
7f98d63
engine(FX): preserve rack master gate when appending a new native VST…
masarray Nov 5, 2026
e171298
test(FX): prove header OFF shows all insert powers OFF and ON restore…
masarray Nov 5, 2026
6c25c80
ci(FX): gate rack master/individual effective ON/OFF and state restor…
masarray Nov 5, 2026
e9f2f08
test(engine): rack power restores individual bypass, survives graph r…
masarray Nov 5, 2026
a66e4d5
native(FX): return explicit rejected ACK during Show/backup, never le…
masarray Nov 5, 2026
d2c990f
test(FX): assert native CH1 bypass envelope combines rack gate OR sto…
masarray Nov 5, 2026
b3d1570
test(FX): use approved channel bank when verifying isolation on mobil…
masarray Nov 5, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/ui-smoke.yml
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,8 @@ jobs:
run: python tests/approved_stage_c_css_visual_parity_smoke.py
- name: Check real mobile /preview/ touch toolbar, popup and stray chevrons
run: python tests/approved_preview_mobile_navigation_smoke.py
- name: FX rack master bypass preserves each insert state (real Chromium)
run: python tests/approved_fx_rack_master_power_smoke.py
- name: Stage D one runtime CSSOM and actual stylesheet network count
run: python tests/approved_css_stage_d_single_bundle_smoke.py
- name: Stage C rendered CSS parity (original vs compiled, three viewports + hover)
Expand Down
30 changes: 28 additions & 2 deletions engine/core/DynamicChannelFxLeaseBank.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
#include <array>
#include <cmath>
#include <cstdint>
#include <atomic>
#include <memory>
#include <span>
#include <utility>
#include <vector>
Expand Down Expand Up @@ -33,6 +35,9 @@ class DynamicChannelFxLeaseBank final {
ChannelId id{};
ProcessingFormat format=ProcessingFormat::stereo;
std::vector<Lease> inserts; // CONTROL only; no creation on callback
// Reused over revision changes. This flag overrides the effective
// output without changing the individual FxInstance bypass flags.
std::shared_ptr<std::atomic<bool>> rackBypassed;
};

// Occupied CH1 vendor/Orbit owner remains alive with accepted PCM.
Expand Down Expand Up @@ -101,6 +106,8 @@ class DynamicChannelFxLeaseBank final {
if(b.format!=ProcessingFormat::mono &&
b.format!=ProcessingFormat::stereo)return Fault::invalidBusLayout;
Row row;row.id=b.id;row.format=b.format;
row.rackBypassed=b.rackBypassed?b.rackBypassed:
std::make_shared<std::atomic<bool>>(false); // CONTROL allocation
Comment on lines +109 to +110

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Preserve rack bypass across native graph re-admission

When an original channel/AUX rack is bypassed and the operator performs a structural channel repatch with outputs disarmed, LiveAudioEngine::repatchDryRoutingLabChannel() calls admitChannelIdFromAcceptedM4(), which rebuilds the bank through UnifiedLegacyProductionAdmission::compileAndCommit(). That path obtains every assignment from captureLegacy(), which never populates rackBypassed, so this fallback initializes every rack to ON. Native rack commands update only the accepted bank, leaving no corresponding bypass state in the M4 graph to recover. Consequently, an unrelated routing edit silently re-enables previously bypassed effects when output resumes. Preserve the accepted rack gates through this re-admission path as well as through reuseRevision() and appendOwned().

AGENTS.md reference: AGENTS.md:L37-L37

Useful? React with 👍 / 👎.

row.count=static_cast<std::uint8_t>(b.inserts.size());
for(std::size_t i=0;i<b.inserts.size();++i) {
const auto& owner=b.inserts[i];
Expand Down Expand Up @@ -174,6 +181,21 @@ class DynamicChannelFxLeaseBank final {
(*owner)->bypassRequested.store(bypass,std::memory_order_release);
return true;
}
bool setRackBypass(std::uint64_t expectedEpoch,
std::uint64_t expectedRevision,ChannelId id,
bool bypass) const noexcept {
if(expectedEpoch!=epoch_||expectedRevision!=revision_||!id.value)
return false;
const auto* row=find(id);
if(!row||!row->rackBypassed)return false;
row->rackBypassed->store(bypass,std::memory_order_release);
return true;
}
bool rackBypassed(ChannelId id) const noexcept {
const auto* row=find(id);
return row&&row->rackBypassed &&
row->rackBypassed->load(std::memory_order_acquire);
}
// The actual prepared vendor instance is also the native editor owner;
// never synthesize a WebView editor or use a catalog name as identity.
Lease leaseEditor(std::uint64_t expectedEpoch,
Expand All @@ -199,7 +221,7 @@ class DynamicChannelFxLeaseBank final {
retained.reserve(prior.rows_.size());
for(const auto& row:prior.rows_) {
Assignment item;
item.id=row.id;item.format=row.format;
item.id=row.id;item.format=row.format;item.rackBypassed=row.rackBypassed;
item.inserts.reserve(row.count);
for(std::size_t slot=0;slot<row.count;++slot)
item.inserts.push_back(row.owners[slot]);
Expand All @@ -225,6 +247,7 @@ class DynamicChannelFxLeaseBank final {
bool found=false;
for(const auto& row:prior.rows_) {
Assignment a;a.id=row.id;a.format=row.format;
a.rackBypassed=row.rackBypassed;
a.inserts.reserve(row.count+(row.id==target?1:0));
for(std::size_t i=0;i<row.count;++i)a.inserts.push_back(row.owners[i]);
if(row.id==target) {
Expand Down Expand Up @@ -253,15 +276,18 @@ class DynamicChannelFxLeaseBank final {
external_.render(external_.context,left,right,frames);
return; // occupied CH1 is processed exactly once
}
const bool rackOff=row->rackBypassed &&
row->rackBypassed->load(std::memory_order_acquire);
for(std::size_t i=0;i<row->count;++i)
row->raw[i]->render(left,right,frames);
row->raw[i]->render(left,right,frames,rackOff);
}

private:
struct Row final {
ChannelId id{};
ProcessingFormat format=ProcessingFormat::stereo;
std::uint8_t count=0;
std::shared_ptr<std::atomic<bool>> rackBypassed; // persists across revisions
std::array<Lease,maxInserts> owners{};
std::array<FxGraph::FxInstance*,maxInserts> raw{};
};
Expand Down
26 changes: 23 additions & 3 deletions engine/core/LiveChannelFxGraph.h
Original file line number Diff line number Diff line change
Expand Up @@ -79,15 +79,16 @@ class LiveChannelFxGraph final {
processing.clear(std::memory_order_release);
return ok;
}
void render(float* left,float* right,int samples) noexcept {
void render(float* left,float* right,int samples,bool rackBypassed=false) noexcept {
if(processing.test_and_set(std::memory_order_acquire)) {
contention.fetch_add(1,std::memory_order_relaxed);
juce::FloatVectorOperations::clear(left,samples);
juce::FloatVectorOperations::clear(right,samples);
return;
}
// G5C: atomic request from control; fade and scratch RT-owned.
bypassFade.request(bypassRequested.load(std::memory_order_relaxed));
// Master rack bypass affects the WET/DRY envelope, never the remembered insert preference.
bypassFade.request(rackBypassed || bypassRequested.load(std::memory_order_relaxed));
if(bypassFade.fullyBypassed()) {
processing.clear(std::memory_order_release);
return;
Expand Down Expand Up @@ -227,6 +228,17 @@ class LiveChannelFxGraph final {
fx->bypassRequested.store(bypass,std::memory_order_release);
return true;
}
// One atomic rack override per channel. Individual slot bypass flags stay
// unchanged; ON restores the previous enabled/disabled combination.
bool setRackBypass(int strip,bool bypass) noexcept {
if(strip<0||strip>=fxSlots)return false;
rackBypassed_[strip].store(bypass,std::memory_order_release);
return true;
}
bool rackBypassed(int strip) const noexcept {
return strip>=0&&strip<fxSlots &&
rackBypassed_[strip].load(std::memory_order_acquire);
}
// Same opaque token used by the native BYPASS ACK. A vendor editor takes
// an owner lease ONLY on the message thread, never in process().
InstanceLease leaseInsert(int strip,int position,const juce::String& token) const noexcept {
Expand Down Expand Up @@ -255,6 +267,10 @@ class LiveChannelFxGraph final {
if(!original||original->catalogId!=catalogId)return false;
for(int i=0;i<counts_[strip];++i)
if(processors_[strip][i]==original)return false;
// Reusing the first retained plugin also carries its channel-level
// rack override; no resume-to-ON during a compatible reconfigure.
if(target==0)rackBypassed_[strip].store(
previous.rackBypassed(strip),std::memory_order_relaxed);
processors_[strip][target]=original; // shared_ptr CONTROL only
++counts_[strip];++activeInserts_;
return true;
Expand Down Expand Up @@ -295,12 +311,15 @@ class LiveChannelFxGraph final {
(int strip,float* l,float* r,int samples) noexcept {
if(strip<0||strip>=fxSlots)return;
const int count=counts_[strip]; // immutable, prepared OFF RT
const bool rackOff=rackBypassed_[strip].load(std::memory_order_acquire);
if(count>0) {
for(int slot=0;slot<count;++slot) {
auto* instance=processors_[strip][slot].get();
instance->render(l,r,samples); // no shared_ptr copies or RT heap use
instance->render(l,r,samples,rackOff); // existing 8ms fade; no RT allocation
}
} else if(strip==0 && externalFx)
// The legacy CH1 callback owns its own per-slot smooth rack
// bypass. Never skip it abruptly or strip out its FX tail.
externalFx(externalContext,strip,l,r,samples);
};
if(monitorEnabled_ && (!monitorL||!monitorR))return false;
Expand All @@ -315,6 +334,7 @@ class LiveChannelFxGraph final {
RealtimeStripControls controls_ {};
FxBank processors_ {};
std::array<std::uint8_t,fxSlots> counts_ {};
std::array<std::atomic<bool>,fxSlots> rackBypassed_{}; // CONTROL write; one RT read per lane
int activeInserts_=0;
int pluginQuantum_=512;
int mainOutputLeft_=0,mainOutputRight_=1;
Expand Down
6 changes: 6 additions & 0 deletions engine/core/UnifiedLegacyProductionAdmission.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,12 @@ struct UnifiedLegacyAccepted final {
fxOwners->setInsertBypass(epoch,revision,id,slot,
instanceId,bypass);
}
bool setFxRackBypass(const DynamicNativeSessionPublisher& publisher,
std::uint64_t epoch,std::uint64_t revision,
ChannelId id,bool bypass) const noexcept {
return matches(publisher,epoch,revision) &&
fxOwners->setRackBypass(epoch,revision,id,bypass);
}
DynamicChannelFxLeaseBank::Lease leaseFxEditor(
const DynamicNativeSessionPublisher& publisher,
std::uint64_t epoch,std::uint64_t revision,ChannelId id,
Expand Down
32 changes: 32 additions & 0 deletions scripts/approved_fx_rack_power.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
"""Approved single-GUI FX rack power semantics, injected at the ONE Pages build.

The historical V28 source HTML is immutable. Apply exactly TWO audited
semantic substitutions to its JavaScript when assembling both public /preview/
and native JUCE WebView2. No additional stylesheet, second state store, or
private fork of the mixer. t.fxOn is rack authority, slotBypass[] is the
preserved per-insert preference. Effective = fxOn && !slotBypass[i].
"""
def apply_authoritative_fx_power(html: str) -> str:
substitutions = [
(
"name==='None'?'is-empty':t.slotBypass[i]?'is-bypassed':'is-active'",
"name==='None'?'is-empty':(!t.fxOn||t.slotBypass[i])?'is-bypassed':'is-active'",
),
(
'aria-pressed="\'+Boolean(!t.slotBypass[i])+\'">',
'aria-pressed="\'+Boolean(t.fxOn&&!t.slotBypass[i])+\'">',
),
(
"title=\"'+(t.slotBypass[i]?'Enable':'Bypass')+' only insert",
"title=\"'+(!t.fxOn?'Rack bypassed, saved '+(t.slotBypass[i]?'OFF':'ON'):t.slotBypass[i]?'Enable':'Bypass')+' only insert",
),
(
"aria-label=\"'+(t.slotBypass[i]?'Enable':'Bypass')+' only FX insert",
"aria-label=\"'+(!t.fxOn?'Rack bypassed, saved '+(t.slotBypass[i]?'OFF':'ON'):t.slotBypass[i]?'Enable':'Bypass')+' only FX insert",
),
]
for before, after in substitutions:
if html.count(before) != 1:
raise ValueError("FX master semantics anchor missing or ambiguous: " + before[:90])
html=html.replace(before,after,1)
return html
2 changes: 2 additions & 0 deletions scripts/build_pages.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
from pathlib import Path
import argparse,os,json,shutil,subprocess,sys
from compile_approved_css import optimize_assets
from approved_fx_rack_power import apply_authoritative_fx_power
ROOT=Path(__file__).resolve().parents[1]
p=argparse.ArgumentParser()
p.add_argument('--out',default='dist-pages')
Expand Down Expand Up @@ -59,6 +60,7 @@
if canonical_html.count('</body>')!=1 or probe_tag in canonical_html:
raise SystemExit('Approved Pages profiler injection must have exactly one body')
canonical_html=canonical_html.replace('</body>',probe_tag+'\n</body>',1)
canonical_html=apply_authoritative_fx_power(canonical_html)
# Stage C: compile only DEPLOYED copies, never modify locked V28 source
# owners or approved PNG artwork. No new CSS/override or second renderer.
canonical_html,css_compilation=optimize_assets(canonical_html,buttons_dest/'assets',runtime_bundle=True)
Expand Down
5 changes: 5 additions & 0 deletions src/ApprovedNativeV8Projection.h
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,11 @@ inline bool projectApprovedNativeV8(juce::var& snapshot,const juce::var& bus) {
fx.add(juce::var(insert.release()));
}
ch->setProperty("inserts",juce::var(fx));
const auto rackBypassed=row.getProperty("fxRackBypassed",{});
if(!rackBypassed.isVoid()) {
if(!rackBypassed.isBool())return false;
ch->setProperty("fxRackBypassed",rackBypassed);
}
ch->setProperty("sends",juce::var(juce::Array<juce::var>{}));
if(role!="INPUT"){
auto dst=std::make_unique<juce::DynamicObject>();
Expand Down
2 changes: 2 additions & 0 deletions src/ConsoleLiveBridgeV6.h
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,8 @@ class LiveConsoleBridgeV6 final {
if(peaksL.isArray())object->setProperty("channelPeaksL",peaksL);
if(peaksR.isArray())object->setProperty("channelPeaksR",peaksR);
if(inserts.isArray())object->setProperty("fxInstances",inserts);
const auto rackPower=route.getProperty("fxRackBypassed",juce::var());
if(rackPower.isArray())object->setProperty("fxRackBypassed",rackPower);
// The prepared/unpatched native M4 graph is a real silent route.
// It allows direct IN gesture to activate the FIRST source.
// This does not set productionCallbackLive or fake PCM.
Expand Down
26 changes: 25 additions & 1 deletion src/LiveAudioEngine.h
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ class LiveAudioEngine final : private juce::AudioIODeviceCallback
}
std::array<Slot, maxFx> slots {};
std::array<std::atomic<bool>, maxFx> bypassFlags {};
std::atomic<bool> rackBypassed{false}; // does not overwrite per-slot flags
// Owned and advanced exclusively by the realtime render callback.
// Physical-slot identity survives an atomic logical reorder (PR #102).
std::array<armix::dsp::FxBypassEnvelope, maxFx> bypassEnvelope {};
Expand Down Expand Up @@ -1229,6 +1230,16 @@ class LiveAudioEngine final : private juce::AudioIODeviceCallback
!=armix::diagnostics::Route::normal)return false;
return dryRoutingLab_.setFxBypass(lane,slot,epoch,revision,instanceId,bypass);
}
bool setDryRoutingLabFxRackBypass(int lane,std::uint64_t epoch,
std::uint64_t revision,bool bypass) noexcept {
if(routeReconfiguring_.load(std::memory_order_acquire)||
diagnosticRoute_.load(std::memory_order_acquire)!=
armix::diagnostics::Route::normal)return false;
if(!dryRoutingLab_.setFxRackBypass(lane,epoch,revision,bypass))return false;
if(lane==0 && graphOwned_)
graphOwned_->rackBypassed.store(bypass,std::memory_order_release);
return true;
}
armix::mixer::LiveChannelFxGraph::InstanceLease leaseRoutedFxForEditor(
int lane,int slot,std::uint64_t epoch,std::uint64_t revision,
const juce::String& instanceId) const noexcept {
Expand Down Expand Up @@ -1333,6 +1344,18 @@ class LiveAudioEngine final : private juce::AudioIODeviceCallback
return dryRoutingLab_.bypassNativeInsert(epoch,revision,id,slot,
token,bypass);
}
bool bypassNativeFxRack(std::uint64_t epoch,std::uint64_t revision,
armix::mixer::ChannelId id,bool bypass) noexcept {
if(routeReconfiguring_.load(std::memory_order_acquire)||
diagnosticRoute_.load(std::memory_order_acquire)!=
armix::diagnostics::Route::normal)return false;
if(!dryRoutingLab_.bypassNativeRack(epoch,revision,id,bypass))return false;
// The original CH1 VST3 instance can be external-leased into the
// native ChannelId publisher. Its own crossfade gate must agree.
if(graphOwned_ && dryRoutingLab_.nativeChannelIsOriginalCh1(id))
graphOwned_->rackBypassed.store(bypass,std::memory_order_release);
return true;
}
armix::mixer::LiveChannelFxGraph::InstanceLease leaseNativeVst3Editor(
std::uint64_t epoch,std::uint64_t revision,
armix::mixer::ChannelId id,std::size_t slot,
Expand Down Expand Up @@ -1935,7 +1958,8 @@ class LiveAudioEngine final : private juce::AudioIODeviceCallback
auto& slot=graph.slots[physical];
if(!slot.processor)continue;
auto& bypass=graph.bypassEnvelope[physical];
bypass.request(graph.bypassFlags[physical].load(std::memory_order_acquire));
bypass.request(graph.rackBypassed.load(std::memory_order_acquire) ||
graph.bypassFlags[physical].load(std::memory_order_acquire));
const bool blend=bypass.transitioning();
if(blend)
{
Expand Down
26 changes: 26 additions & 0 deletions src/LiveDryRoutingLab.h
Original file line number Diff line number Diff line change
Expand Up @@ -946,6 +946,16 @@ class LiveDryRoutingLab final {
});
}

// Master rack gate is a single RT-visible atomic per lane; never overwrite
// stored individual insert bypass flags. Safe under current epoch/revision.
bool setFxRackBypass(int lane,std::uint64_t expectedEpoch,
std::uint64_t expectedRevision,bool bypass) noexcept {
if(lane<0||lane>=fxSlots||!hasExplicitRoute()||
expectedEpoch!=epoch()||expectedRevision!=revision())return false;
return publisher_.updateActiveControl(expectedEpoch,expectedRevision,
[&](FxGraph& fx) noexcept {return fx.setRackBypass(lane,bypass);});
}

// Quiescent message-thread identity lease for the vendor's native GUI.
// Shared lifetime is independent of route reorder, but not authority:
// an editor request MUST match the current accepted route.
Expand Down Expand Up @@ -1197,6 +1207,16 @@ class LiveDryRoutingLab final {
return nativeAccepted_.setFxBypass(nativePublisher_,epochAtEdit,
pcmRevision,target,slot,token,bypass);
}
bool nativeChannelIsOriginalCh1(armix::mixer::ChannelId target) const noexcept {
return nativeAccepted_.fxOwners &&
nativeAccepted_.fxOwners->externalChannel()==target &&
target==nativeAccepted_.graph.ids.inputs[0];
}
bool bypassNativeRack(std::uint64_t epochAtEdit,std::uint64_t pcmRevision,
armix::mixer::ChannelId target,bool bypass) noexcept {
return nativeAccepted_.setFxRackBypass(nativePublisher_,epochAtEdit,
pcmRevision,target,bypass);
}
armix::mixer::DynamicChannelFxLeaseBank::Lease leaseNativeInsertEditor(
std::uint64_t epochAtEdit,std::uint64_t pcmRevision,
armix::mixer::ChannelId target,std::size_t slot,
Expand Down Expand Up @@ -1720,6 +1740,8 @@ class LiveDryRoutingLab final {
liveInserts.add(juce::var(item.release()));
}
row->setProperty("inserts",juce::var(liveInserts));
row->setProperty("fxRackBypassed",
nativeAccepted_.fxOwners->rackBypassed(ch.id));
if(pcmMeterValid && meterIndex<nativeMeterCapacity) {
row->setProperty("peakL",static_cast<double>(
nativeMeterPeaksL_[meterIndex].load(std::memory_order_relaxed)));
Expand Down Expand Up @@ -2169,6 +2191,10 @@ class LiveDryRoutingLab final {
liveFxInstances.add(juce::var(slots));
}
out->setProperty("fxInstances",juce::var(liveFxInstances));
juce::Array<juce::var> rackFlags;
for(int lane=0;lane<fxSlots;++lane)
rackFlags.add(prepared?prepared->rackBypassed(lane):false);
out->setProperty("fxRackBypassed",juce::var(rackFlags));
juce::Array<juce::var> controls,fxNames;
for(int i=0;i<count;++i) {
const auto& st=channelEdits_[i];
Expand Down
Loading
Loading