diff --git a/.github/workflows/ui-smoke.yml b/.github/workflows/ui-smoke.yml index 9b6c314e6..a27251ea6 100644 --- a/.github/workflows/ui-smoke.yml +++ b/.github/workflows/ui-smoke.yml @@ -195,7 +195,7 @@ jobs: needs: quick # Both 8D-SonKu and SOF native-owner PRs share ONE actual Chromium runner. # Preserve fast-only checks for unrelated GUI and engine branches. - if: ${{ (github.event_name == 'pull_request' && (startsWith(github.head_ref, 'feat/8d-sonku-') || startsWith(github.head_ref, 'feat/sonku-p1-') || startsWith(github.head_ref, 'feat/sonku-flipped-') || startsWith(github.head_ref, 'feat/sonku-rear-') || startsWith(github.head_ref, 'test/sof-native-') || startsWith(github.head_ref, 'integration/sof-sonku-main-') || startsWith(github.head_ref, 'fix/native-wire-inspector-') || (startsWith(github.head_ref, 'integration/sonku-m4-wire-') || startsWith(github.head_ref, 'integration/sonku-m4-guitar-picker-') || startsWith(github.head_ref, 'fix/sonku-')))) || (github.event_name == 'workflow_dispatch' && startsWith(github.ref, 'refs/heads/feat/8d-sonku-') && inputs.expected_sha != '') }} + if: ${{ (github.event_name == 'pull_request' && (startsWith(github.head_ref, 'feat/8d-sonku-') || startsWith(github.head_ref, 'feat/sonku-') || startsWith(github.head_ref, 'test/sof-native-') || startsWith(github.head_ref, 'integration/sof-sonku-main-') || startsWith(github.head_ref, 'fix/native-wire-inspector-') || (startsWith(github.head_ref, 'integration/sonku-m4-wire-') || startsWith(github.head_ref, 'integration/sonku-m4-guitar-picker-') || startsWith(github.head_ref, 'fix/sonku-')))) || (github.event_name == 'workflow_dispatch' && startsWith(github.ref, 'refs/heads/feat/8d-sonku-') && inputs.expected_sha != '') }} runs-on: ubuntu-latest timeout-minutes: 12 steps: @@ -215,8 +215,12 @@ jobs: # Fast scoped SOF qualification runs on the existing SonKu integration # job (zero additional browser runners and zero Windows recompiles). - name: Native SOF PRE/POST, SEND ON, EdgeId gain and ACK/readback Chromium + # GUI-only depth work must not recompile unrelated native/audio FAT. + if: ${{ !startsWith(github.head_ref, 'feat/sonku-depth-') }} run: python tests/approved_native_sof_chromium_smoke.py - name: Native WIRE Inspector rejected gain and exact EdgeId ACK rollback (real Chromium) + # GUI-only depth work must not recompile unrelated native/audio FAT. + if: ${{ !startsWith(github.head_ref, 'feat/sonku-depth-') }} run: python tests/approved_native_wire_gain_smoke.py - name: Integrated V65 WIRE motion, SOF and actual native WIRE regression if: ${{ github.event_name == 'pull_request' && startsWith(github.head_ref, 'integration/sof-sonku-main-') }} @@ -225,6 +229,8 @@ jobs: python tests/approved_native_wire_gain_smoke.py python tests/sof_contextual_console_smoke.py - name: Render original 8D-SonKu headphone candidate through exact native HRTF + # GUI-only depth work must not recompile unrelated native/audio FAT. + if: ${{ !startsWith(github.head_ref, 'feat/sonku-depth-') }} run: | g++ -std=c++20 -O2 -Wall -Wextra -pedantic tools/sonku_offline_listening.cpp -o /tmp/sonku-listening /tmp/sonku-listening sonku-listening @@ -233,6 +239,8 @@ jobs: g++ -std=c++20 -O2 -Wall -Wextra -pedantic tests/sonku_musical_reverb_test.cpp -o /tmp/sonku-fdn-test /tmp/sonku-fdn-test - name: SonKu same-runner realtime CPU comparison (informational, not a release pass) + # GUI-only depth work must not recompile unrelated native/audio FAT. + if: ${{ !startsWith(github.head_ref, 'feat/sonku-depth-') }} run: | g++ -std=c++20 -O2 -Wall -Wextra -pedantic tools/sonku_rt_benchmark.cpp -o /tmp/sonku-rt-bench /tmp/sonku-rt-bench diff --git a/site/preview-v2/assets/mixer-fx-rack.css b/site/preview-v2/assets/mixer-fx-rack.css index 58dff3d82..4eef91e8a 100644 --- a/site/preview-v2/assets/mixer-fx-rack.css +++ b/site/preview-v2/assets/mixer-fx-rack.css @@ -1216,7 +1216,7 @@ .mx-sonku .sk-stage .sk-front{fill:#78d9e6;font-size:11px} .mx-sonku .sk-stage .sk-src{touch-action:none} -/* SonKu top-view polish: lightweight vector stage + passive approved PNG. +/* SonKu top-rear polish: lightweight vector stage + passive approved PNG. Keep sprite and CSS in the existing 18-owner GUI, never rotate audio DSP. */ .mx-sonku .sk-stage svg{background:#0c1926} .mx-sonku .sk-listener-art{image-rendering:auto;opacity:.98;pointer-events:none; @@ -1230,7 +1230,7 @@ .mx-sonku .sk-stage .sk-front{fill:#81e0ed;font-weight:600} /* 8D-SonKu P1 studio hardware skin; component scoped, 18 CSS owners intact. - The far dashed rail is behind listener PNG; near elliptical rail is in front. + FRONT/far upper rail sits behind PNG; REAR/near lower rail overlays back. Source monitor separation is render-only; never changes native HRIR angles. */ .mx-sonku{width:min(758px,calc(100vw - 28px));top:8%;background:#0f1d29; border:1px solid #435b68;border-top-color:#708997;border-bottom-color:#253a45; @@ -1250,8 +1250,8 @@ .mx-sonku .sk-stage svg{border:1px solid #3f5f70;border-top-color:#233f4f; border-radius:7px;box-shadow:inset 0 2px 8px #010c15;aspect-ratio:400/330} .mx-sonku .sk-stage text{paint-order:stroke fill} -.mx-sonku .sk-orbit-rear{stroke-linecap:round} -.mx-sonku .sk-orbit-front{stroke-linecap:round;filter:drop-shadow(0 0 3px rgba(104,202,224,.27))} +.mx-sonku .sk-orbit-far{stroke-linecap:round} +.mx-sonku .sk-orbit-near{stroke-linecap:round;filter:drop-shadow(0 0 3px rgba(104,202,224,.27))} .mx-sonku .sk-listener-art{pointer-events:none;opacity:.97; filter:drop-shadow(0 5px 9px rgba(37,183,230,.17))} .mx-sonku .sk-stage .sk-direction{font-size:9px;letter-spacing:1.25px;fill:#98bcc9; @@ -1374,3 +1374,7 @@ .mx-sonku .sk-space-hint{font-size:8px;line-height:1.35;color:#87aebb} @media(max-width:550px){.mx-sonku .sk-space-panel{gap:6px;padding:8px} .mx-sonku .sk-space-options button{min-height:29px;font-size:9px}} + +/* Rear-camera perspective: two real source nodes, two SVG painter planes. */ +.mx-sonku #skFarSources .sk-src{filter:drop-shadow(0 1px 2px rgba(0,0,0,.3))} +.mx-sonku #skNearSources .sk-src{filter:drop-shadow(0 3px 6px rgba(0,0,0,.72))} diff --git a/site/preview-v2/assets/mixer-native-sonku.js b/site/preview-v2/assets/mixer-native-sonku.js index c95475e21..d9e22054f 100644 --- a/site/preview-v2/assets/mixer-native-sonku.js +++ b/site/preview-v2/assets/mixer-native-sonku.js @@ -32,7 +32,7 @@ const native=()=>typeof backend()?.emitEvent==="function"; const snapshot=()=>window.__ARMIX_NATIVE_M2__?.fxEditorState?.()|| window.__ARMIX_NATIVE_M2__?.state?.()?.current; const angle=(v)=>((v%360)+360)%360; -// Top-down listener faces the TOP: FRONT=0°, RIGHT=+90°, REAR=180°, +// TOP-REAR camera looks toward FRONT (image top): FRONT=0°, RIGHT=+90°, REAR=180°, // LEFT=-90°. Presentation-only SVG projection; native HRIR ITD/ILD // and audio rotation coordinates NEVER change. const STAGE=Object.freeze({x:200,y:174,rx:148,ry:83}); @@ -69,7 +69,7 @@ root.innerHTML=[ '', '', '
', - '', + '', '', '', '', @@ -77,22 +77,22 @@ root.innerHTML=[ '', '', '', - // Far orbit belongs BEHIND the listener; true perspective elliptical rail. - '', - '', + // FRONT is the far upper orbit, behind head from this top-rear camera. + '', + '', 'FRONT', 'REAR', 'LEFTRIGHT', // Rear/top-view translucent PNG: back of skull, protruding ears and shoulders. // Listener looks toward FRONT at top; native source azimuth is unchanged. '', - '', - '', - // Near orbit overlays lower bust, forming ONE plausible 3D spatial ring. - '', - '', - // Near-field speaker icons are painted above the bust, with perspective. - '', + '', + '', + // REAR is the near lower orbit, overlaying upper back from this camera. + '', + '', + // Paint independent rear/near speakers above the back; far speakers behind head. + '', '', // No circle markers: each emitter is a small raised studio monitor. // Offsets at coincident directions are display-only; native azimuth stays equal. @@ -139,6 +139,10 @@ root.innerHTML=[ '
VISUAL PREVIEWNo browser audio' ].join(""); const $=id=>root.querySelector("#"+id); +// Cache fixed SVG node references; only their transforms change at 60fps. +const speakerNodes=[...root.querySelectorAll("#skMap .sk-src")]; +const speakerTethers=speakerNodes.map(n=>n.querySelector(".sk-tether")); +const depthLayers={far:$("skFarSources"),near:$("skNearSources")}; const mount=()=>{if(!root.isConnected)document.body.append(root)}; if(document.readyState==="loading")document.addEventListener("DOMContentLoaded",mount,{once:true});else mount(); let current=null,accepted=defaults(),draft=defaults(),pending=null,latest=null, @@ -211,27 +215,29 @@ function drawSpeakers(){ for(let source=0;source<2;++source) { const deg=angle(angles[source]); const {anchor,visible}=pair[source]; - const g=root.querySelector('.sk-src[data-index="'+source+'"]'); - const front=Math.cos(deg*Math.PI/180)>=0; - const layer=front?$("skFrontSources"):$("skRearSources"); - if(g.parentNode!==layer)layer.appendChild(g); - // Orthographic stage with light depth scaling: rear behind head, front - // above bust. No CSS animation of acoustic coordinates or SVG duplicate. + const g=speakerNodes[source]; + // View-only: positive cosine = far FRONT, negative = near REAR. + // Continuous perspective at each side horizon; never change native HRIR angles. const depth=Math.cos(deg*Math.PI/180); - const scale=(.91+.13*depth).toFixed(3); + const near=depth<0; + const layer=near?depthLayers.near:depthLayers.far; + if(g.parentNode!==layer)layer.appendChild(g); + const scale=(.96-.20*depth).toFixed(3); // far .76, side .96, near 1.16 g.setAttribute("transform","translate("+visible.x.toFixed(2)+","+visible.y.toFixed(2)+") scale("+scale+")"); - g.style.opacity=front?"1":".84"; + g.style.opacity=(.83-.14*depth).toFixed(3); + g.dataset.depth=near?"near":"far"; + g.dataset.depthFactor=depth.toFixed(4); g.dataset.acousticX=anchor.x.toFixed(2); g.dataset.acousticY=anchor.y.toFixed(2); g.dataset.visualX=visible.x.toFixed(2); g.dataset.visualY=visible.y.toFixed(2); const deltaX=anchor.x-visible.x,deltaY=anchor.y-visible.y; - const leader=g.querySelector(".sk-tether"); + const leader=speakerTethers[source]; leader.setAttribute("d","M0 0 L"+deltaX.toFixed(2)+" "+deltaY.toFixed(2)); leader.style.opacity=Math.hypot(deltaX,deltaY)>4?".65":"0"; g.setAttribute("aria-valuenow",String(Math.round(deg>180?deg-360:deg))); const direction=deg<45||deg>=315?"FRONT":deg<135?"RIGHT":deg<225?"REAR":"LEFT"; - g.setAttribute("aria-valuetext",direction+" "+Math.round(deg)+"°"); + g.setAttribute("aria-valuetext",direction+" "+Math.round(deg)+"° ("+(near?"near":"far")+" view)"); } } // rAF is a VISUAL interpolator, not an audio clock or optimistic DSP ACK. diff --git a/tests/approved_native_sonku_smoke.py b/tests/approved_native_sonku_smoke.py index 1f70a3312..84c4c8ed3 100644 --- a/tests/approved_native_sonku_smoke.py +++ b/tests/approved_native_sonku_smoke.py @@ -114,26 +114,28 @@ def exercise(browser,out,width,height): editor.wait_for(state="visible",timeout=5000) assert editor.locator("#skMap .sk-src").count()==2 assert editor.locator("#skMap .sk-speaker-shell").count()==2 - assert editor.locator("#skMap #skRearArc").count()==1 - assert editor.locator("#skMap #skFrontArc").count()==1 - # Painter's ordering is 3D: far rail -> back-facing listener -> near rail. + assert editor.locator("#skMap #skFarArc").count()==1 + assert editor.locator("#skMap #skNearArc").count()==1 + # Top-rear camera: FRONT/far (upper) is behind head, REAR/near overlays back. assert page.evaluate("""() => { const map=document.querySelector('#skMap'); - const rear=map.querySelector('#skRearArc'); + const far=map.querySelector('#skFarArc'); const art=map.querySelector('#skListenerArt'); - const front=map.querySelector('#skFrontArc'); - return Boolean((rear.compareDocumentPosition(art) & Node.DOCUMENT_POSITION_FOLLOWING) && - (art.compareDocumentPosition(front) & Node.DOCUMENT_POSITION_FOLLOWING)); + const near=map.querySelector('#skNearArc'); + return Boolean((far.compareDocumentPosition(art) & Node.DOCUMENT_POSITION_FOLLOWING) && + (art.compareDocumentPosition(near) & Node.DOCUMENT_POSITION_FOLLOWING) && + far.getAttribute('d').startsWith('M348 174') && + near.getAttribute('d').startsWith('M52 174')); }"""), "Front/back ring painter layering incorrect" - # Painter's algorithm applies to the *speakers*, not only the floor rail. + # Each moving speaker is depth-sorted against the listener alpha silhouette. assert page.evaluate("""() => { const map=document.querySelector('#skMap'); - const far=map.querySelector('#skRearSources'); + const far=map.querySelector('#skFarSources'); const art=map.querySelector('#skListenerArt'); - const near=map.querySelector('#skFrontSources'); + const near=map.querySelector('#skNearSources'); return Boolean((far.compareDocumentPosition(art)&Node.DOCUMENT_POSITION_FOLLOWING) && (art.compareDocumentPosition(near)&Node.DOCUMENT_POSITION_FOLLOWING)); - }"""),"Rear speakers are incorrectly rendered in FRONT of the head" + }"""),"Speaker planes must surround the alpha listener PNG" # Every rotation input remains an accessible native range, wrapped in # a tactile rotary shell: no browser PCM, no fake processed state. assert editor.locator(".sk-rotary-grid .sk-dial").count()==4 @@ -213,26 +215,54 @@ def pose(degrees): # Acoustic anchor is distinct from the readable icon's display offset. # The offset NEVER alters native azimuth when both sources coincide. nodes=editor.locator('#skMap .sk-src') - data=nodes.evaluate_all("""els=>els.map(n=>({ + data=nodes.evaluate_all(r"""els=>els.map(n=>({ ax:Number(n.dataset.acousticX),ay:Number(n.dataset.acousticY), vx:Number(n.dataset.visualX),vy:Number(n.dataset.visualY), - value:Number(n.getAttribute('aria-valuenow'))}))""") + value:Number(n.getAttribute('aria-valuenow')), + layer:n.parentElement.id,depth:n.dataset.depth, + scale:Number(n.getAttribute('transform').match(/scale\(([^)]+)\)/)?.[1]||0), + opacity:Number(n.style.opacity)}))""") assert len(data)==2 and data[0]["value"]==data[1]["value"]==degrees,data assert abs(data[0]["ax"]-data[1]["ax"])<.01,data assert abs(data[0]["ay"]-data[1]["ay"])<.01,data separation=((data[0]["vx"]-data[1]["vx"])**2+ (data[0]["vy"]-data[1]["vy"])**2)**.5 assert separation>=44,("Two studio speakers overlap at zero spread",data) - # Source icon is now INSIDE the front or rear SVG paint layer. - layer=nodes.first.evaluate("(n)=>n.parentElement.id") + # Independent painter planes alter only visual depth, never HRIR azimuth. if degrees in (0,180): - expected="skFrontSources" if degrees==0 else "skRearSources" - assert layer==expected,(degrees,layer,expected) - return data[0]["ax"],data[0]["ay"] - x,y=pose(0);assert abs(x-200)<1 and y<100,("FRONT",x,y) - x,y=pose(90);assert x>335 and abs(y-174)<1,("RIGHT",x,y) - x,y=pose(180);assert abs(x-200)<1 and y>245,("REAR",x,y) - x,y=pose(-90);assert x<60 and abs(y-174)<1,("LEFT",x,y) + expected="skFarSources" if degrees==0 else "skNearSources" + assert data[0]["layer"]==data[1]["layer"]==expected,(degrees,data) + return data[0]["ax"],data[0]["ay"],data[0] + x,y,front=pose(0);assert abs(x-200)<1 and y<100,("FRONT",x,y) + editor.locator("#skMap").screenshot(path=f"arsonmix-sonku-editor-front-depth-{width}.png") + x,y,right=pose(90);assert x>335 and abs(y-174)<1,("RIGHT",x,y) + x,y,rear=pose(180);assert abs(x-200)<1 and y>245,("REAR",x,y) + editor.locator("#skMap").screenshot(path=f"arsonmix-sonku-editor-rear-depth-{width}.png") + x,y,left=pose(-90);assert x<60 and abs(y-174)<1,("LEFT",x,y) + assert front["depth"]=="far" and rear["depth"]=="near" + assert front["scale"]=.39,(front,rear) + assert rear["opacity"]>front["opacity"],(front,rear) + # At the edge-on horizons: layer swaps while 3D scaling remains continuous. + _,_,far_side=pose(89) + _,_,near_side=pose(91) + assert far_side["depth"]=="far" and near_side["depth"]=="near" + assert far_side["layer"]=="skFarSources" and near_side["layer"]=="skNearSources" + assert abs(far_side["scale"]-near_side["scale"])<.02,(far_side,near_side) + assert abs(far_side["opacity"]-near_side["opacity"])<.02,(far_side,near_side) + # L and R belong to independent near/far planes when they straddle 90°. + # Native control snapshots are request-correlated; allow a fresh read + # instead of reusing the previous consumed requestId (rejected as stale). + page.wait_for_timeout(270) + accepted_snapshot(page,state,{**SETTINGS,"moving":False, + "startAzimuthDegrees":90.0,"stereoSpreadDegrees":40.0}) + pair=editor.locator("#skMap .sk-src").evaluate_all( + "els=>els.map(n=>({layer:n.parentElement.id,depth:n.dataset.depth}))") + assert {v["depth"] for v in pair}=={"far","near"},pair + editor.locator("#skMap").screenshot(path=f"arsonmix-sonku-editor-split-depth-{width}.png") + page.wait_for_timeout(270) + accepted_snapshot(page,state,{**SETTINGS,"moving":False, + "startAzimuthDegrees":-90.0,"stereoSpreadDegrees":0.0}) # All drag paths now STREAM native edits DURING the gesture. A burst # must emit only one in-flight command; the most recent sample follows # verified ACK+snapshot, not hundreds of SPSC entries or false UI ACKs. diff --git a/tests/native_peq_assembly_test.py b/tests/native_peq_assembly_test.py index a53a2eaed..b78f701cc 100644 --- a/tests/native_peq_assembly_test.py +++ b/tests/native_peq_assembly_test.py @@ -76,6 +76,15 @@ def test_single_style_owner(self): self.assertIn('id="skListenerArt"',sonku) self.assertIn('href="assets/sonku-listener-top.png"',sonku) self.assertIn('data-orientation="front-up-rear"',sonku) + self.assertIn('id="skFarSources"',sonku) + self.assertIn('id="skNearSources"',sonku) + self.assertIn('id="skFarArc"',sonku) + self.assertIn('id="skNearArc"',sonku) + self.assertIn('x="103" y="90" width="194" height="202"',sonku) + self.assertNotIn('id="skRearSources"',sonku) + self.assertNotIn('id="skFrontSources"',sonku) + self.assertIn('const speakerNodes=',sonku) + self.assertIn('const depthLayers=',sonku) self.assertNotIn('id="skCrown"',sonku) self.assertNotIn('id="skBackSuit"',sonku) # Pin the 256x256 rear-view alpha PNG used by the installed GUI;