diff --git a/AR-MIX-Live-FX-Host-Standalone-v0.3.html b/AR-MIX-Live-FX-Host-Standalone-v0.3.html
index 96bcf5ba8..b4ad10b4a 100644
--- a/AR-MIX-Live-FX-Host-Standalone-v0.3.html
+++ b/AR-MIX-Live-FX-Host-Standalone-v0.3.html
@@ -1228,14 +1228,27 @@
const meterNodes=new Map();
// Shared preview/native painter: preserve fixed colors; light only whole 7px LEDs.
const LED_PITCH_PX=7,ledMeterCache=new WeakMap();
+// Opt-in performance A/B: reproduce pre-P1 raw-level DOM writes, with the
+// exact same meter visuals. Production only writes CSS on visible LED changes.
+const meterRawStyleWrites=new URLSearchParams(location.search).get('mixperf')==='meter-raw';
function setLedMeterLevel(el,rawLevel){
if(!el)return;
const level=clamp(Number(rawLevel)||0,0,100);
let state=ledMeterCache.get(el);
if(!state){state={height:el.getBoundingClientRect().height,level:-1,lit:-1};ledMeterCache.set(el,state)}
- if(state.level!==level){state.level=level;el.style.setProperty('--level',level+'%')}
+ const levelChanged=state.level!==level;
+ state.level=level; // Full precision remains cached for ResizeObserver / telemetry.
const lit=level>=100?state.height:Math.floor((level*state.height/100+1e-7)/LED_PITCH_PX)*LED_PITCH_PX;
- if(state.lit!==lit){state.lit=lit;el.style.setProperty('--led-lit',lit+'px')}
+ if(state.lit!==lit){
+ state.lit=lit;
+ // --led-lit drives the clip; --level remains the compatible fallback,
+ // updated only when the visible whole-row LED state actually changes.
+ el.style.setProperty('--level',level+'%');
+ el.style.setProperty('--led-lit',lit+'px');
+ }else if(meterRawStyleWrites&&levelChanged){
+ // Diagnostics only: old unconditional raw-level style invalidation.
+ el.style.setProperty('--level',level+'%');
+ }
}
window.__arMixSetLedMeterLevel=setLedMeterLevel;
// Observe only the stable mixer root, never disposable strips; no hot-path reflow.
@@ -1589,7 +1602,7 @@
document.addEventListener('keydown',e=>{if(e.ctrlKey&&e.key.toLowerCase()==='s'){e.preventDefault();if(persistSession())flash('UI state saved locally');else flash('Browser storage unavailable')}});
// Issue #56: no pointer profiler/event listener runs in normal preview or native.
const mixperfParam=new URLSearchParams(location.search).get('mixperf');
-const mixperfModes=['optimized','baseline','hover-off','meters-off','layers-off','all-off'];
+const mixperfModes=['optimized','baseline','hover-off','meters-off','layers-off','all-off','meter-raw'];
const mixperfMode=mixperfModes.includes(mixperfParam)?mixperfParam:'optimized';
document.documentElement.dataset.mixperf=mixperfMode;
if(mixperfParam&&mixperfModes.includes(mixperfParam)){
diff --git a/docs/ARD_056_GUI_RENDER_P1_DIRTY_DOM_2026-10-27.md b/docs/ARD_056_GUI_RENDER_P1_DIRTY_DOM_2026-10-27.md
new file mode 100644
index 000000000..b5bf1efc9
--- /dev/null
+++ b/docs/ARD_056_GUI_RENDER_P1_DIRTY_DOM_2026-10-27.md
@@ -0,0 +1,32 @@
+# ARD-056 P1: dirty LED-paint and idle telemetry DOM writes
+
+**Base:** `main@0dc201c556623a55348abbb93d8dbd0d1cf08cb4` (Orbit PR #94 merged). **Issue:** [#56](https://github.com/masarray/arsonmix/issues/56). User confirmed **slight** pointer improvement after PR #93; not a hardware acceptance or measured p95 result.
+
+## Audit: actual source paths (cost remains unmeasured on user's PC)
+
+| Trigger | Current source | Identified avoidable work | Remediation |
+| --- | --- | --- | --- |
+| Preview meter 40/60ms demo tick and native 12Hz status | `web/app.js::setLedMeterLevel` | Writes CSS `--level` on every changed raw level even if the quantized 7px `--led-lit` clip remains **identical** | Preserve float telemetry in JS cache; only write `--level` and `--led-lit` when the displayed whole-row clip changes; opt-in `meter-raw` reproduces old behavior |
+| Native 12Hz status | `web/bridge.js` | Reassigns the same footer/audio labels each status event | Update those text nodes/data attribute only when changed |
+| Native 12Hz status | `web/monitor.js::repaint` | Rewrites invariant header/status labels regardless of equality | Idempotent `setTextIfChanged` for static or slow-changing labels |
+| FX Orbit (PR #94) | `web/bridge.js` | Animated path uses rAF **only when popover visible**, and normal live Orbit runs in native motion engine | Leave untouched; no competing animation scheduler introduced |
+| Meter `clip-path` / static painted shadows | `40-rail-pan.css`, `20-button-180.css` | May cost compositing but no verified profiler trace or proof of dominant cost | Preserve artwork and physical pad; no blind Canvas merge or removal of seven resting/pressed shadows |
+
+## Engineering decision
+
+`--led-lit` is the primary authored meter clip variable. The `--level` fallback is retained, but normal-mode writes it only when the visible 7px LED count changes. Full-precision measured level remains in the `WeakMap` cache for accurate resize reconstruction; DSP peaks, CLIP latch, 1600ms peak-hold, native meter update frequency and all L/R semantics are untouched. `?mixperf=meter-raw` restores **just** the legacy per-raw-level write, so same-machine A/B separates this change from BTN-180/hover experiments. No new timer, Canvas renderer, layer hint, hot-path DOM lookup or CPU/DSP callback changes.
+
+Native status idempotency is a separate non-visual reduction: compare existing text before assigning; do not suppress state transitions, diagnostic panel measurements or audio device indicators.
+
+## Evidence and acceptance
+
+Deterministic functional smoke tests call `setLedMeterLevel(e,1)` then `setLedMeterLevel(e,1.1)`; displayed 7px LED row is identical. In production style attribute must remain unchanged while cache retains raw 1.1; in explicit `meter-raw` mode the style attribute must change. Chromium/Firefox and Windows-native CI plus source/offline HTML JavaScript byte-parity required. A deterministic DOM mutation count proves redundant writes eliminated **only for identical quantized levels**, not GPU performance gain.
+
+Physical benchmark still needed on affected Windows PC: repeat matched 10-second pointer sweeps in Perf Lab **optimized** vs **meter-raw** and optionally **meters-off**, record p95/p99 and >33ms frames, actual compositor paint/gpu/driver, matched DPI/resolution/monitor/RDP. No claim that pointer stutter is resolved or that meter-raw mode is an accurate reproduction of every earlier build. Issue #56 stays OPEN until physical gate.
+
+## Rejected shortcuts
+
+- Directly replace DOM clip bars with Canvas PR #60 absent same-device evidence.
+- Degrade native meter update rate or L/R precision.
+- Force GPU `will-change` on all LED elements.
+- Rewrite Orbit PR #94, entire FX rack or audio callback for this unrelated GUI optimization.
diff --git a/site/preview/perf.html b/site/preview/perf.html
index ea9d26bfb..bcb6849eb 100644
--- a/site/preview/perf.html
+++ b/site/preview/perf.html
@@ -2,7 +2,7 @@
ArSonMix Mixer Performance LabArSonMix · Mixer Perf Lab
-
+
Open direct mixerLoading…
diff --git a/tests/gui_workflow_contract_test.mjs b/tests/gui_workflow_contract_test.mjs
index 91384f2ef..501c0734a 100644
--- a/tests/gui_workflow_contract_test.mjs
+++ b/tests/gui_workflow_contract_test.mjs
@@ -55,3 +55,12 @@ test('native bridge does not inspect idle pointer movement',()=>{
assert.ok(!guard.includes('"pointermove"'), 'idle pointer listener forbidden');
assert.ok(guard.includes('typeof drag') && guard.includes('"pointerup"') && guard.includes('"pointercancel"'));
});
+
+test('quantised LED meter avoids redundant raw CSS writes while preserving diagnostics',()=>{
+ assert.ok(app.includes('meterRawStyleWrites=new URLSearchParams(location.search)'));
+ assert.ok(app.includes('if(state.lit!==lit)'));
+ assert.ok(app.includes('else if(meterRawStyleWrites&&levelChanged)'));
+ assert.ok(app.includes("'meter-raw'"));
+ assert.ok(monitor.includes('const setTextIfChanged='));
+ assert.ok(bridge.includes('footer.textContent!==text'));
+});
diff --git a/tests/ui_firefox_perf_smoke.py b/tests/ui_firefox_perf_smoke.py
index afe780745..03dbd27ab 100644
--- a/tests/ui_firefox_perf_smoke.py
+++ b/tests/ui_firefox_perf_smoke.py
@@ -24,7 +24,7 @@ async def main():
assert await page.evaluate('window.__arMixPerfProbe === undefined'), "No profiler in normal mode"
await page.close()
- for mode in ("optimized", "meters-off", "all-off"):
+ for mode in ("optimized", "meters-off", "all-off", "meter-raw"):
page = await browser.new_page(viewport={"width": 1440, "height": 820})
page.on("pageerror", lambda error: errors.append(str(error)))
await page.goto(PAGE + "?mixperf=" + mode)
@@ -32,6 +32,15 @@ async def main():
assert await page.locator('#mixer [data-fader]').count() == 11
assert await page.locator('#mixer [data-meter]').count() == 16
assert await page.locator('#mixer [data-clip]').count() == 16
+ dirty = await page.evaluate("""() => {
+ const el=document.querySelector('[data-meter="0"]');
+ setLedMeterLevel(el,1);
+ const first=el.getAttribute('style');
+ setLedMeterLevel(el,1.1);
+ return {changed:first!==el.getAttribute('style'),
+ raw:ledMeterCache.get(el).level};
+ }""")
+ assert dirty == {"changed":mode=="meter-raw","raw":1.1}, (mode,dirty)
heads = await page.evaluate("""() => {
const c = document.querySelector('[data-fader="0"] .cap');
diff --git a/tests/ui_smoke.py b/tests/ui_smoke.py
index d98b8878a..d2ea743ac 100644
--- a/tests/ui_smoke.py
+++ b/tests/ui_smoke.py
@@ -120,6 +120,16 @@ def shared_shadow_shape(shadow):
assert all(x['palette']==meter['first']['palette'] for x in levels),levels
assert all(x['lit']<=.9*x['height'] for x in levels[:4]),levels
assert levels[-1]['lit']>.9*levels[-1]['height'],levels
+ # The visible LED row must be the only normal-mode CSS mutation gate.
+ # Two nearby raw levels with the same lit 7px row must not repaint.
+ dirty=await page.evaluate("""()=>{
+ const e=document.querySelector('[data-meter="0"]');
+ setLedMeterLevel(e,1);
+ const before=e.getAttribute('style'),lit=e.style.getPropertyValue('--led-lit');
+ setLedMeterLevel(e,1.1);
+ return {before,after:e.getAttribute('style'),lit,level:ledMeterCache.get(e).level};
+ }""")
+ assert dirty['before']==dirty['after'] and dirty['level']==1.1,dirty
# Full mixer rebuild must restore held peaks and clip state on fresh DOM nodes.
restored=await page.evaluate("""()=>{
clipLatch['0']=true;
diff --git a/web/app.js b/web/app.js
index 1c8c58290..6288ee500 100644
--- a/web/app.js
+++ b/web/app.js
@@ -35,14 +35,27 @@ function syncClipLeds(){document.querySelectorAll('[data-clip]').forEach(e=>e.cl
const meterNodes=new Map();
// Shared preview/native painter: preserve fixed colors; light only whole 7px LEDs.
const LED_PITCH_PX=7,ledMeterCache=new WeakMap();
+// Opt-in performance A/B: reproduce pre-P1 raw-level DOM writes, with the
+// exact same meter visuals. Production only writes CSS on visible LED changes.
+const meterRawStyleWrites=new URLSearchParams(location.search).get('mixperf')==='meter-raw';
function setLedMeterLevel(el,rawLevel){
if(!el)return;
const level=clamp(Number(rawLevel)||0,0,100);
let state=ledMeterCache.get(el);
if(!state){state={height:el.getBoundingClientRect().height,level:-1,lit:-1};ledMeterCache.set(el,state)}
- if(state.level!==level){state.level=level;el.style.setProperty('--level',level+'%')}
+ const levelChanged=state.level!==level;
+ state.level=level; // Full precision remains cached for ResizeObserver / telemetry.
const lit=level>=100?state.height:Math.floor((level*state.height/100+1e-7)/LED_PITCH_PX)*LED_PITCH_PX;
- if(state.lit!==lit){state.lit=lit;el.style.setProperty('--led-lit',lit+'px')}
+ if(state.lit!==lit){
+ state.lit=lit;
+ // --led-lit drives the clip; --level remains the compatible fallback,
+ // updated only when the visible whole-row LED state actually changes.
+ el.style.setProperty('--level',level+'%');
+ el.style.setProperty('--led-lit',lit+'px');
+ }else if(meterRawStyleWrites&&levelChanged){
+ // Diagnostics only: old unconditional raw-level style invalidation.
+ el.style.setProperty('--level',level+'%');
+ }
}
window.__arMixSetLedMeterLevel=setLedMeterLevel;
// Observe only the stable mixer root, never disposable strips; no hot-path reflow.
@@ -396,7 +409,7 @@ document.addEventListener('keydown',e=>{const pan=e.target.closest('[data-pan]')
document.addEventListener('keydown',e=>{if(e.ctrlKey&&e.key.toLowerCase()==='s'){e.preventDefault();if(persistSession())flash('UI state saved locally');else flash('Browser storage unavailable')}});
// Issue #56: no pointer profiler/event listener runs in normal preview or native.
const mixperfParam=new URLSearchParams(location.search).get('mixperf');
-const mixperfModes=['optimized','baseline','hover-off','meters-off','layers-off','all-off'];
+const mixperfModes=['optimized','baseline','hover-off','meters-off','layers-off','all-off','meter-raw'];
const mixperfMode=mixperfModes.includes(mixperfParam)?mixperfParam:'optimized';
document.documentElement.dataset.mixperf=mixperfMode;
if(mixperfParam&&mixperfModes.includes(mixperfParam)){
diff --git a/web/bridge.js b/web/bridge.js
index 236314c41..5a2e0b565 100644
--- a/web/bridge.js
+++ b/web/bridge.js
@@ -27,7 +27,7 @@
const percent = peak => Math.max(1,Math.min(100,(20*Math.log10(Math.max(1e-6,Number(peak)||0))+60)*100/60));
const toStatus = text => {
const footer = document.querySelector("#audioStatus");
- if(footer) footer.textContent = text;
+ if(footer && footer.textContent!==text) footer.textContent = text;
};
// The v0.3 cosmetic demo catalog and FX editor are replaced with the REAL
@@ -972,7 +972,11 @@
state.monitor=!!d.monitor;
syncNativeMixerControls(d);
const b=document.querySelector('[data-native-action="monitor"]');
- if(b){b.textContent=state.monitor?"MUTE OUTPUT":"UNMUTE OUTPUT";b.classList.toggle("on",!state.monitor);}
+ if(b){
+ const label=state.monitor?"MUTE OUTPUT":"UNMUTE OUTPUT";
+ if(b.textContent!==label)b.textContent=label;
+ b.classList.toggle("on",!state.monitor);
+ }
const text=d.error?"AUDIO ERROR: "+d.error:
d.connected?`${d.driver} · ${Math.round(d.rate)} Hz / ${d.buffer} · ${state.chain.length} LIVE VST3 · ${d.latencySamples||0} samples FX latency`
:"NO AUDIO DEVICE · SELECT AUDIO SETUP";
@@ -995,26 +999,36 @@
paintMeter(aux,liveOutputLevel);
// Design-only LUFS/true-peak fields have no native measurement yet.
const lufs=document.getElementById("masterLufs"),tp=document.getElementById("masterDbtp");
- if(lufs)lufs.textContent="—";
- if(tp)tp.textContent="—";
+ if(lufs&&lufs.textContent!=="—")lufs.textContent="—";
+ if(tp&&tp.textContent!=="—")tp.textContent="—";
// v0.8 Master stream LUFS-I/dBTP remains unimplemented; values stay
// em dashes rather than falsely claiming measured loudness.
const pk=document.getElementById("masterPeakDb");
if(pk)pk.textContent=Number(d.peak)>0
?(20*Math.log10(Math.max(1e-8,Number(d.peak)))).toFixed(1)+" dBFS":"−∞";
const driver=document.getElementById("headerDriver");
- if(driver)driver.textContent=d.driver||"No device";
+ if(driver){
+ const label=d.driver||"No device";
+ if(driver.textContent!==label)driver.textContent=label;
+ }
// Preserve the latest main native device lamp.
const deviceButton=document.querySelector(".toolbar .spec-device");
if(deviceButton){
const ready=!!d.connected && !d.error;
deviceButton.classList.toggle("on",ready);
- deviceButton.dataset.audioConnected=String(ready);
+ if(deviceButton.dataset.audioConnected!==String(ready))
+ deviceButton.dataset.audioConnected=String(ready);
}
const rate=document.getElementById("headerRate");
- if(rate)rate.textContent=d.rate?(Number(d.rate)/1000).toLocaleString("en-US",{maximumFractionDigits:1}):"--";
+ if(rate){
+ const label=d.rate?(Number(d.rate)/1000).toLocaleString("en-US",{maximumFractionDigits:1}):"--";
+ if(rate.textContent!==label)rate.textContent=label;
+ }
const buffer=document.getElementById("headerBuffer");
- if(buffer)buffer.textContent=d.buffer||"--";
+ if(buffer){
+ const label=String(d.buffer||"--");
+ if(buffer.textContent!==label)buffer.textContent=label;
+ }
});
backend.addEventListener("arMixScanProgress",p=>{
state.progress=p;
diff --git a/web/monitor.js b/web/monitor.js
index bf5cbbb65..8979d87de 100644
--- a/web/monitor.js
+++ b/web/monitor.js
@@ -49,6 +49,12 @@
'';
document.body.appendChild(overlay);
const el = id => document.getElementById(id);
+ // 12Hz native telemetry must not replace unchanged text nodes or cause
+ // needless main-thread paint/layout invalidations on static header labels.
+ const setTextIfChanged=(node,value)=>{
+ const text=String(value);
+ if(node&&node.textContent!==text)node.textContent=text;
+ };
const percent = v => Math.max(1,Math.min(100,(20*Math.log10(Math.max(1e-6,Number(v)||0))+60)*100/60));
function diagnosis(d) {
if(d.diagnosticRoute==="OUTPUT_ONLY_TONE") return "Output-only test: capture endpoint is disconnected. Listen for tone at low headphone volume and click MARK CRACKLE when audible.";
@@ -67,22 +73,22 @@
return "Output armed. Speak into the microphone and inspect all three meters.";
}
function repaint(d) {
- el("arSignalBadge").textContent = !d.monitor ? "OUTPUT MUTED" : d.masterMute ? "MASTER MUTED" : d.channelMute ? "CH1 MUTED" : "OUTPUT ARMED";
+ setTextIfChanged(el("arSignalBadge"),!d.monitor ? "OUTPUT MUTED" : d.masterMute ? "MASTER MUTED" : d.channelMute ? "CH1 MUTED" : "OUTPUT ARMED");
el("arSignalBadge").style.color = d.monitor && !d.masterMute && !d.channelMute ? "#71e9cc" : "#e9be7c";
const monitorButton=document.querySelector('[data-native-action="monitor"]');
- if (monitorButton) monitorButton.textContent=d.monitor?"MUTE OUTPUT":"UNMUTE OUTPUT";
+ setTextIfChanged(monitorButton,d.monitor?"MUTE OUTPUT":"UNMUTE OUTPUT");
// The original UI shell had fixed 48 kHz / 64-sample demo badges. Show
// the REAL negotiated driver parameters instead of misleading the user.
const rateLabel=document.querySelector('.spec:not(.spec-device):not(.bpm) strong');
- if(rateLabel)rateLabel.textContent=d.rate?String(Math.round(d.rate/1000)):"—";
+ setTextIfChanged(rateLabel,d.rate?String(Math.round(d.rate/1000)):"—");
const bufferLabel=document.querySelector('.spec.bpm strong');
- if(bufferLabel)bufferLabel.textContent=d.buffer?String(d.buffer):"—";
+ setTextIfChanged(bufferLabel,d.buffer?String(d.buffer):"—");
const driverLabel=document.querySelector('.spec-device strong');
- if(driverLabel)driverLabel.textContent=d.driver||"NO DRIVER";
+ setTextIfChanged(driverLabel,d.driver||"NO DRIVER");
const liveLabel=document.querySelector('.status > span:first-child > b');
- if(liveLabel)liveLabel.textContent="NATIVE CH1";
+ setTextIfChanged(liveLabel,"NATIVE CH1");
const edition=document.querySelector('.status > span:last-child');
- if(edition)edition.textContent="AR MIX P2 · CH1 NATIVE + UI PREVIEW";
+ setTextIfChanged(edition,"AR MIX P2 · CH1 NATIVE + UI PREVIEW");
if (!overlay.classList.contains("open")) return;
el("arInputName").textContent=d.diagnosticRoute==="OUTPUT_ONLY_TONE"?"INTERNAL TEST TONE":d.inputDevice||"Input device";
el("arFxName").textContent=d.diagnosticRoute==="OUTPUT_ONLY_TONE"?"NO INPUT / NO FX":d.diagnosticRoute!=="NORMAL"?"NO FX":d.dryTest?"DRY BYPASS":"VST3 Chain";