From fd616619eb2db9015fc64f4462f2661eac0224f4 Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Sat, 14 Nov 2026 18:30:10 +0700 Subject: [PATCH 01/10] fix(sonku): isolated measured centered-mid and unconditional music side, preventing stereo phase nulls --- engine/builtin_fx/sonku/SonKuSpatialCore.h | 62 ++++++++++++++++++---- 1 file changed, 52 insertions(+), 10 deletions(-) diff --git a/engine/builtin_fx/sonku/SonKuSpatialCore.h b/engine/builtin_fx/sonku/SonKuSpatialCore.h index f15aab200..010693f74 100644 --- a/engine/builtin_fx/sonku/SonKuSpatialCore.h +++ b/engine/builtin_fx/sonku/SonKuSpatialCore.h @@ -269,6 +269,15 @@ class SonKuSpatialCore final { const float distanceGain=room_.relativeDistanceGain(); const bool nativeSpace=nativeSpaceEverUsed_; const bool roomEnabled=settings_.spacePreset!=0; +#if defined(SONKU_P75_MUSIC_SAFE_RESEARCH) && SONKU_P75_MUSIC_SAFE_RESEARCH + // Field-failure quarantine, opt-in ONLY: spatialize the MUSIC MID + // through one real measured center HRTF, keep stereo SIDE separated. + // The original two-emitter renderer is never modified in public builds. + const bool musicSafe= + room_.preparedProfile()==SonKuReflectionProfile::SixSurfaceKemarResearch; +#else + constexpr bool musicSafe=false; +#endif // Deliberate music-monitor compensation: real distance perception // still comes from direct/reflected ratio and high-frequency cues, // while the direct field is not attenuated by the full physical 1/r. @@ -299,10 +308,19 @@ class SonKuSpatialCore final { // Preserve strong anti-correlated music side energy without // collapsing it into the two virtual mono HRTF sources. The // independent guard has no hidden UI state or new audio bus. - const float preservedSide=integrity_.preservedSide(x0,x1); - // At native spatialMix=0 the dry input stays bit-exact. - // At ordinary positively-correlated stereo the guard is zero. - const float sideRescue=.65f*smoothedMix_*smoothedTrim_*preservedSide; + const float inputMid=.5f*(x0+x1); + const float preservedSide=musicSafe?.5f*(x0-x1): + integrity_.preservedSide(x0,x1); + // P7.5 research: an unconditional, orthogonal L/R side return + // rather than correlation-gated, time-varying rescue. A centered + // HRTF cannot annihilate anti-phase stereo. WIDTH changes level + // of the stereo SIDE but never sets it to zero by accident. + // 0° => 0.5x; 60° => 1x; >=90° => 1.25x (bounded). + const float musicSideWidth=musicSafe? + std::min(1.25f,.5f+settings_.stereoSpreadDegrees/120.f):1.f; + const float sideRescue=musicSafe? + smoothedMix_*smoothedTrim_*musicSideWidth*preservedSide: + .65f*smoothedMix_*smoothedTrim_*preservedSide; history_[0][write_]=x0; history_[1][write_]=x1; float ears[2]{0.f,0.f}; @@ -318,16 +336,27 @@ class SonKuSpatialCore final { auto& r1=kernels_[1][1][tap]; l0+=filterSlew_*(targets_[0][0][tap]-l0); r0+=filterSlew_*(targets_[0][1][tap]-r0); - l1+=filterSlew_*(targets_[1][0][tap]-l1); - r1+=filterSlew_*(targets_[1][1][tap]-r1); - ears[0]+=v0*l0+v1*l1; - ears[1]+=v0*r0+v1*r1; + if(musicSafe) { + // Both musical input channels share exactly one centered + // measured HRIR. No dual-HRTF center interference; the + // unprocessed SIDE is returned in its own stereo axis. + // Only two FIR multiply-accumulates per tap, not four. + const float sum=v0+v1; + ears[0]+=sum*l0; + ears[1]+=sum*r0; + }else{ + l1+=filterSlew_*(targets_[1][0][tap]-l1); + r1+=filterSlew_*(targets_[1][1][tap]-r1); + ears[0]+=v0*l0+v1*l1; + ears[1]+=v0*r0+v1*r1; + } } const auto reflection=room_.active() - ?room_.process(x0,x1,degrees_,settings_.stereoSpreadDegrees) + ?room_.process(musicSafe?inputMid:x0,musicSafe?inputMid:x1, + degrees_,musicSafe?0.f:settings_.stereoSpreadDegrees) :SonKuEarlyReflections::Ears{}; const auto late=reverb_.active() - ?reverb_.process(x0,x1) + ?reverb_.process(musicSafe?inputMid:x0,musicSafe?inputMid:x1) :SonKuMusicalReverb::Ears{}; if(!nativeSpace && settings_.outputTrim<=1.f && smoothedTrim_<=1.f) { @@ -468,6 +497,19 @@ class SonKuSpatialCore final { } } void updateKernels() noexcept { +#if defined(SONKU_P75_MUSIC_SAFE_RESEARCH) && SONKU_P75_MUSIC_SAFE_RESEARCH + if(room_.preparedProfile()==SonKuReflectionProfile::SixSurfaceKemarResearch) { + // Control evidence no longer gates musical MID coefficients: + // the first sample already has a single centered KEMAR HRIR. + // Never add two offset HRTFs for correlated source material. + interpolate(centerTarget_,degrees_); + targets_[0]=centerTarget_; + targets_[1]=centerTarget_; + if(!haveKernel_)kernels_=targets_; + haveKernel_=true; + return; + } +#endif interpolate(targets_[0], degrees_-static_cast(settings_.stereoSpreadDegrees)*0.5); interpolate(targets_[1], From 019948c7b74b186eb542242d6603fd1edba07358 Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Sat, 14 Nov 2026 18:31:31 +0700 Subject: [PATCH 02/10] build(sonku): isolate P7.5 music-safe experiment behind explicit CMake opt-in and native contract tests --- CMakeLists.txt | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index b7c187e08..a4f3482f3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -10,6 +10,15 @@ option(ARMIX_SONKU_EXPERIMENTAL_DIRECTIONAL_RT option(ARMIX_SONKU_EXPERIMENTAL_NATIVE_XYZ_RT "Enable P7.2 unqualified native real-time XYZ/v3 research adapter" OFF) +# P7.5 field-failure research: spatial MUSIC MID and strictly retain stereo SIDE. +# No effect on public builds or original P7.4 research unless explicit ON. +option(ARMIX_SONKU_EXPERIMENTAL_MUSIC_SAFE + "Enable quarantined phase-preserving music-stereo P7.5 PCM only in XYZ research" + OFF) +if(ARMIX_SONKU_EXPERIMENTAL_MUSIC_SAFE AND + NOT ARMIX_SONKU_EXPERIMENTAL_NATIVE_XYZ_RT) + message(FATAL_ERROR "P7.5 music-safe requires explicit native XYZ research ON") +endif() set(CMAKE_CXX_STANDARD 20) set(CMAKE_CXX_STANDARD_REQUIRED ON) @@ -207,7 +216,8 @@ target_compile_definitions(ARMixConsole PRIVATE $<$:ARMIX_SONKU_EXPERIMENTAL_NATIVE_XYZ_RT=1> $<$:SONKU_P7_MEASURED_ELEVATION_RESEARCH=1> $<$:SONKU_P71_DIRECT_XYZ_RESEARCH=1> - $<$:SONKU_P72_NATIVE_XYZ_RT=1>) + $<$:SONKU_P72_NATIVE_XYZ_RT=1> + $<$:SONKU_P75_MUSIC_SAFE_RESEARCH=1>) if(WIN32) # Windows retains its proven ASIO-first / WASAPI / static WebView2 distribution. # Never link Windows loader or sound APIs into macOS/Linux builds. @@ -324,6 +334,21 @@ if(BUILD_TESTING) SONKU_P72_NATIVE_XYZ_RT=1) add_test(NAME NativeSonKuP72JuceV3XyzLiveAckV1V2Restore COMMAND ARMixSonKuP72NativeTests) + if(ARMIX_SONKU_EXPERIMENTAL_MUSIC_SAFE) + # The executable and THIS actual JUCE adapter run the identical P7.5 DSP. + target_compile_definitions(ARMixSonKuP72NativeTests PRIVATE + SONKU_P75_MUSIC_SAFE_RESEARCH=1) + add_executable(ARMixSonKuP75MusicIntegrityTests + tests/sonku_p75_stereo_integrity_test.cpp) + target_compile_features(ARMixSonKuP75MusicIntegrityTests PRIVATE cxx_std_20) + target_compile_definitions(ARMixSonKuP75MusicIntegrityTests PRIVATE + SONKU_P7_MEASURED_ELEVATION_RESEARCH=1 + SONKU_P71_DIRECT_XYZ_RESEARCH=1 + SONKU_P72_NATIVE_XYZ_RT=1 + SONKU_P75_MUSIC_SAFE_RESEARCH=1) + add_test(NAME NativeSonKuP75MusicStereoPhaseNoNullAndChunkParity + COMMAND ARMixSonKuP75MusicIntegrityTests) + endif() endif() # Pure control-plane first-run routing selection: no JUCE, drivers, # WASAPI activation or callback dependencies. Full Windows CTest gate. From 7e12da635a974101db57b1833390e3aad08b9bc5 Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Sat, 14 Nov 2026 18:32:44 +0700 Subject: [PATCH 03/10] test(sonku): reproduce stereo phase-collapse field report across measured XYZ, music, width and room PCM --- tests/sonku_p75_stereo_integrity_test.cpp | 158 ++++++++++++++++++++++ 1 file changed, 158 insertions(+) create mode 100644 tests/sonku_p75_stereo_integrity_test.cpp diff --git a/tests/sonku_p75_stereo_integrity_test.cpp b/tests/sonku_p75_stereo_integrity_test.cpp new file mode 100644 index 000000000..8871821c6 --- /dev/null +++ b/tests/sonku_p75_stereo_integrity_test.cpp @@ -0,0 +1,158 @@ +// SPDX-License-Identifier: AGPL-3.0-only +// Physical field failure reproduction: do NOT certify music from RMS-only +// anti-phase tone tests. The entire P7.5 PCM safety mode is research-only. +#if defined(NDEBUG) +#undef NDEBUG +#endif +#if !defined(SONKU_P75_MUSIC_SAFE_RESEARCH) || !SONKU_P75_MUSIC_SAFE_RESEARCH +#error P7.5 phase-integrity test must compile the experimental music-safe path +#endif +#if !defined(SONKU_P72_NATIVE_XYZ_RT) || !SONKU_P72_NATIVE_XYZ_RT +#error P7.5 test must cover the same research XYZ state as the native tester +#endif +#include "../engine/builtin_fx/sonku/SonKuSpatialCore.h" +#include +#include +#include +#include +#include +#include +#include + +using armix::sonku::Settings; +using armix::sonku::SonKuSpatialCore; +using armix::sonku::SonKuReflectionProfile; +constexpr float pi=3.14159265358979323846f; +constexpr auto profile=SonKuReflectionProfile::SixSurfaceKemarResearch; + +static auto create(double rate,const Settings& s) { + auto core=std::make_unique(); + assert(core->prepare(rate,profile)); + assert(core->setSettings(s)); + return core; +} + +static void antiPhaseCanNeverNull(double rate) { + for(const float width:{0.f,60.f,180.f}) { + Settings s{};s.moving=false;s.spacePreset=0; + s.startAzimuthDegrees=180.f;s.spatialMix=1.f; + s.stereoSpreadDegrees=width;s.outputTrim=.75f; + auto core=create(rate,s); + constexpr int n=8192; + std::vector l(n),r(n); + const float scaledWidth=std::min(1.25f,.5f+width/120.f); + for(int i=0;i(rate)) + +.08f*std::sin(2.f*pi*3150.f*i/static_cast(rate)); + l[i]=v;r[i]=-v; + } + const auto original=l; + core->process(l.data(),r.data(),n); + double pIn=0.,pOut=0.; + for(int i=0;i.15*pIn); + } +} +static void monoMidCannotCombFromSpread(double rate) { + Settings s{};s.moving=false;s.startAzimuthDegrees=180.f; + s.spacePreset=0;s.spatialMix=1.f;s.outputTrim=.7f; + s.stereoSpreadDegrees=0.f; + auto zero=create(rate,s); + s.stereoSpreadDegrees=120.f; + auto wide=create(rate,s); + constexpr int n=8192; + std::vector l(n),r(n),wl(n),wr(n); + for(int i=0;i(rate)) + +.09f*std::sin(2.f*pi*2050.f*i/static_cast(rate)); + l[i]=r[i]=wl[i]=wr[i]=sample; + } + zero->process(l.data(),r.data(),n); + wide->process(wl.data(),wr.data(),n); + double outPower=0.; + for(int i=0;i.0001); +} +static void coherentBassInvertedHighSurvives(double rate) { + Settings s{};s.moving=false;s.startAzimuthDegrees=0.f; + s.spacePreset=0;s.spatialMix=1.f;s.outputTrim=.75f; + s.stereoSpreadDegrees=60.f; + auto core=create(rate,s); + constexpr int n=16384; + const float upper=static_cast(rate/20.); + std::vector l(n),r(n); + double originalSideEnergy=0.,originalMidEnergy=0.; + for(int i=0;i(rate)); + const float side=.09f*std::sin(2.f*pi*upper*i/static_cast(rate)); + l[i]=mid+side;r[i]=mid-side; + originalSideEnergy+=side*side; + originalMidEnergy+=mid*mid; + } + core->process(l.data(),r.data(),n); + double outSide=0.,outMid=0.; + for(int i=n/2;ioriginalSideEnergy*.12); + assert(outMid>originalMidEnergy*.005); +} +static void roomAndMovingArePartitionInvariant(double rate) { + Settings s{};s.moving=true;s.revolutionSeconds=2.5f; + s.startAzimuthDegrees=85.f;s.stereoSpreadDegrees=95.f; + s.spatialMix=1.f;s.outputTrim=.62f; + s.spacePreset=1;s.sourceDistanceMeters=1.6f; + s.roomAmount=.5f;s.ambience=.2f; + s.directElevationDegrees=18.f; + assert(armix::sonku::valid(s)); + auto contiguous=create(rate,s),chunked=create(rate,s); + constexpr int n=8192; + std::vector l(n),r(n),cl(n),cr(n); + for(int i=0;i(rate)); + const float side=.09f*std::sin(2.f*pi*2400.f*i/static_cast(rate)); + l[i]=cl[i]=m+side;r[i]=cr[i]=m-side; + } + contiguous->process(l.data(),r.data(),n); + for(int pos=0;posprocess(cl.data()+pos,cr.data()+pos,k); + pos+=k; + } + double pow=0.; + for(int i=0;i.001); +} +int main() { + for(const double rate:{44100.,48000.}) { + antiPhaseCanNeverNull(rate); + monoMidCannotCombFromSpread(rate); + coherentBassInvertedHighSurvives(rate); + roomAndMovingArePartitionInvariant(rate); + } + std::puts("PASS: P7.5 experimental centered measured KEMAR MID, bounded stereo SIDE, no anti-phase null, no coherent SPREAD comb, mixed-frequency integrity and moving XYZ ROOM chunk parity at 44.1/48 kHz"); +} From d70ed6f2c03073e58870766f881037970d88cedd Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Sat, 14 Nov 2026 18:33:49 +0700 Subject: [PATCH 04/10] docs(sonku): record real-user cancellation failure and honest P7.5 stereo music-safe qualification --- ...P75_PHYSICAL_AUDIO_FAILURE_FIX_20261114.md | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 docs/SONKU_P75_PHYSICAL_AUDIO_FAILURE_FIX_20261114.md diff --git a/docs/SONKU_P75_PHYSICAL_AUDIO_FAILURE_FIX_20261114.md b/docs/SONKU_P75_PHYSICAL_AUDIO_FAILURE_FIX_20261114.md new file mode 100644 index 000000000..d0acebdc0 --- /dev/null +++ b/docs/SONKU_P75_PHYSICAL_AUDIO_FAILURE_FIX_20261114.md @@ -0,0 +1,28 @@ +# 8D-SonKu P7.5 — real-music cancellation incident response and physical FAT +14 November 2026 · **Research only · previous P7.4 field audio REJECTED** + +The owner has reported severe cancellation and destroyed sound during physical listening of the P7.4 Windows XYZ tester. Do **not** install that candidate for live monitoring, play out at high volume or claim dearVR parity. P7.5 is an isolated diagnostic render experiment; it neither replaces the release branch nor grants production admission. + +## Why the previous tests missed the failure +Previous P0–P7.4 fixture tests proved anti-phase energy only for a few strong coherent/inverted sinusoids. The actual stereo algorithm rendered left and right program channels as two spatial HRIR objects and summed each ear. MID compensation was correlation-gated and SIDE was restored via an unaligned, adaptive direct path. Partial/stochastic music coherence, stereo stems and dynamic spectra were not proven stable. The Linux objective CSV/WAVs could not certify subjective music quality. The owner’s physical evidence invalidates the marketing-level readiness claim. + +## P7.5 hypothesis — isolated stereo music-safe test mode +- Compile only when `ARMIX_SONKU_EXPERIMENTAL_NATIVE_XYZ_RT=ON` **and** `ARMIX_SONKU_EXPERIMENTAL_MUSIC_SAFE=ON`; default public and original P7.4 remain OFF. +- MUSIC MID `M=(L+R)/2` is rendered by **one centered measured MIT KEMAR HRTF** (both ears). This avoids cross-summing two offset impulse responses for the same musical object. Elevation, azimuth and measured room remain from the same JUCE native PCM instance. +- SIDE `S=(L-R)/2` is never correlation-gated. It is delivered symmetrically to the headphone ears with a bounded width gain: at width 0° → 0.5×; 60° → 1×; 90° and beyond → 1.25×. Full inverse-polarity music therefore cannot produce the previous zero-pressure null. **This side is still inside-head** and is NOT a substitute for fully externalized individual stereo sources. Width is an M/S stereo image width control in this experimental mode, not two independent physically located monitors. +- ROOM/late stereo inputs are based on the musical MID; they cannot sum an inverted SIDE into a false spatial reflection. The SIDE bed remains clean and independent. +- Coherence-triggered gain modulation is skipped for the experimental render, reducing dynamic image pumping. The direct FIR loop runs only two measured-ear MACs per sample/tap rather than four. No new callback worker, async CPU probing, heap, mutex or WebAudio authority is added. +- True output tonality, bass, transient behaviour, 1-channel vs 2-channel layouts and externalization are **not yet qualified**. Even with these guarantees, mixed dry/HRIR at nonzero intermediate wet percentage can cause coloration and requires real musical listening. + +## Validation gates +1. P7.5 source tests: 44.1/48k; FRONT/REAR; anti-phase with SPREAD 0/60/180, exact side transfer at ROOM OFF; mono MID identical for any SPREAD; mixed bass MID + inverted upper band; ROOM XYZ+motion partition 64/257 parity, finite/headroom. +2. Full Windows JUCE 8.0.15 `ARMixConsole` compile with the new flag; actual JUCE XYZ/ACK/v3 state tests; portable PE and bundled GUI hash check. Source commit + music-safe mode must be in provenance. +3. Before full-volume listening: use low headphone volume, ROOM OFF, ORBIT OFF, stereo music file with both L/R, SPREAD 60, SPATIAL MIX 100%, GAIN at -6 dB and compare **bypass → old P7.4 → new P7.5**. Capture L/R dry and new wet output for FFT/rms phase transfer. Stop on severe cancellation/bursts. +4. Once good, evaluate ROOM and motion, source elevation, room on/off, 44.1/48k, 64/128/256 and 1/2/4 concurrent inserts with ASIO/WIRE/VST3; save/open `.smix` and restart device. +5. Need stereo music, hard-left single channel, duplicated mono, phase-inverted stereo and correlated narrow stereo as distinct cases. If hard-left single channel is unnatural in this experimental M/S presentation, **record and reject** rather than silently deem it fixed. Subsequent product architecture must explicitly handle mono-vs-stereo routing semantics. +6. Loudness-match to dearVR PRO 2 with original licensed music, compare side width, tonal accuracy, front/back, elevation, real room depth and perceived externalization with blinded headphone tests. Do NOT certify equal quality from one engineer or a green CI. + +## Safety and release +Original P7.4 portable should be considered an unsuccessful audio test; P7.5 is a candidate to investigate the failure. Public `main`/alpha installer and default LIGHT must never be changed based on these offline tests. Hardware and owner approval are prerequisites to promotion. + +Source provenance and redistribution conditions: `docs/THIRD_PARTY_8D_SONKU_HRTF.md`. From 07a8a9b0ebf6f145ede63ea3a5136633e934f154 Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Sat, 14 Nov 2026 18:34:58 +0700 Subject: [PATCH 05/10] ci(sonku): phase-safe P7.5 PCM and full native JUCE Windows portable research tester --- .github/workflows/sonku-p75-windows-field.yml | 198 ++++++++++++++++++ 1 file changed, 198 insertions(+) create mode 100644 .github/workflows/sonku-p75-windows-field.yml diff --git a/.github/workflows/sonku-p75-windows-field.yml b/.github/workflows/sonku-p75-windows-field.yml new file mode 100644 index 000000000..3be236236 --- /dev/null +++ b/.github/workflows/sonku-p75-windows-field.yml @@ -0,0 +1,198 @@ +name: SonKu P7.5 phase-safe Windows music field candidate +# Isolated opt-in full JUCE app build; no public installer, tag or release. +on: + pull_request: + types: [opened, reopened, synchronize] + paths: + - '.github/workflows/sonku-p75-windows-field.yml' + - 'src/Main.cpp' + - 'src/SonKuNativeBridgeContract.h' + - 'src/LiveAudioEngine.h' + - 'engine/builtin_fx/SonKuSpatialProcessor.h' + - 'engine/builtin_fx/sonku/**' + - 'site/preview-v2/assets/mixer-native-sonku.js' + - 'CMakeLists.txt' + - 'tests/sonku_p72_*' + - 'tests/sonku_p75_*' + workflow_dispatch: +permissions: + contents: read +concurrency: + group: sonku-p75-physical-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true +jobs: + preflight: + name: Isolated fast PCM and GUI preflight + runs-on: ubuntu-latest + timeout-minutes: 8 + steps: + - uses: actions/checkout@v4 + with: + ref: ${{ github.event.pull_request.head.sha || github.sha }} + persist-credentials: false + - name: Native JS and source GUI capability checks + run: | + set -euo pipefail + node --check site/preview-v2/assets/mixer-native-sonku.js + node tests/sonku_p73_gui_contract_test.js + grep -q "'FIELD_PREVIEW_FULL_CTEST_NOT_RUN'" scripts/m3e_fat_evidence_gate.mjs + python -m unittest discover -s tests -p native_peq_assembly_test.py + - name: 44.1 and 48 kHz prepared PCM source regression + run: | + set -euo pipefail + g++ -std=c++20 -O2 -Wall -Wextra -Werror -pedantic \ + -DSONKU_P7_MEASURED_ELEVATION_RESEARCH=1 \ + -DSONKU_P71_DIRECT_XYZ_RESEARCH=1 \ + -DSONKU_P72_NATIVE_XYZ_RT=1 \ + tests/sonku_p72_realtime_xyz_test.cpp -o /tmp/sonku-p75-pcm + /tmp/sonku-p75-pcm + g++ -std=c++20 -O2 -Wall -Wextra -Werror -pedantic \ + -DSONKU_P7_MEASURED_ELEVATION_RESEARCH=1 \ + -DSONKU_P71_DIRECT_XYZ_RESEARCH=1 \ + -DSONKU_P72_NATIVE_XYZ_RT=1 \ + -DSONKU_P75_MUSIC_SAFE_RESEARCH=1 \ + tests/sonku_p75_stereo_integrity_test.cpp -o /tmp/sonku-p75-music + /tmp/sonku-p75-music + windows-field: + name: Actual full Windows JUCE executable and verified portable field ZIP + needs: preflight + runs-on: windows-2022 + timeout-minutes: 55 + steps: + - uses: actions/checkout@v4 + with: + ref: ${{ github.event.pull_request.head.sha || github.sha }} + persist-credentials: false + - name: Verify immutable PR head and physical candidate identity + shell: pwsh + env: + EXPECTED_SHA: ${{ github.event.pull_request.head.sha || github.sha }} + run: | + $actual = (& git rev-parse HEAD).Trim() + if ($LASTEXITCODE -ne 0 -or $actual -ne $env:EXPECTED_SHA -or $actual -notmatch '^[0-9a-f]{40}$') { + throw "SONKU_P75_SOURCE_MISMATCH:$actual" + } + Write-Host "SONKU_P75_EXACT_SOURCE=$actual" + - uses: actions/checkout@v4 + with: + repository: juce-framework/JUCE + ref: 8.0.15 + path: third_party/JUCE + persist-credentials: false + - name: Obtain pinned WebView2 compilation SDK + shell: pwsh + run: | + nuget install Microsoft.Web.WebView2 -Version 1.0.3485.44 -OutputDirectory .deps -NonInteractive + if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE } + - name: Configure full native app with research XYZ explicit ON + shell: pwsh + run: | + cmake -S . -B build -G "Visual Studio 17 2022" -A x64 ` + -DJUCE_ROOT="$env:GITHUB_WORKSPACE/third_party/JUCE" ` + -DJUCE_WEBVIEW2_PACKAGE_LOCATION="$env:GITHUB_WORKSPACE/.deps" ` + -DARMIX_SONKU_EXPERIMENTAL_NATIVE_XYZ_RT=ON ` + -DARMIX_SONKU_EXPERIMENTAL_MUSIC_SAFE=ON ` + -DBUILD_TESTING=ON + if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE } + $cache = Get-Content -LiteralPath build/CMakeCache.txt -Raw + if ($cache -notmatch 'ARMIX_SONKU_EXPERIMENTAL_NATIVE_XYZ_RT:BOOL=ON' -or + $cache -notmatch 'ARMIX_SONKU_EXPERIMENTAL_MUSIC_SAFE:BOOL=ON') { + throw "SONKU_P75_RESEARCH_NOT_ENABLED" + } + $tests = (& ctest --test-dir build -C Release --show-only=json-v1 | Out-String | ConvertFrom-Json) + if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE } + $required = @('NativeSonKuP72AtomicXyzLiveEditSource', + 'NativeSonKuP72JuceV3XyzLiveAckV1V2Restore', + 'NativeSonKuSessionV1V2AndAudioAppliedAck', + 'NativeSonKuP75MusicStereoPhaseNoNullAndChunkParity') + $available = @($tests.tests | ForEach-Object { $_.name }) + foreach ($test in $required) { + if ($test -notin $available) { throw "SONKU_P75_MISSING_CTEST:$test" } + } + - name: Compile actual ARMixConsole Windows GUI and focused real JUCE tests + shell: pwsh + run: | + cmake --build build --config Release --parallel 2 --target ` + ARMixConsole ARMixSonKuP72SourceTests ARMixSonKuP72NativeTests ARMixSonKuNativeStateTests ARMixSonKuP75MusicIntegrityTests + if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE } + $exe = 'build/ARMixConsole_artefacts/Release/AR MIX Studio.exe' + if (-not (Test-Path -LiteralPath $exe -PathType Leaf)) { throw "SONKU_P75_NO_GUI_EXE" } + if ((Get-Item -LiteralPath $exe).Length -lt 4MB) { throw "SONKU_P75_WRONG_GUI_TARGET" } + - name: Scoped native XYZ state, callback ACK and legacy restoration + shell: pwsh + run: | + ctest --test-dir build -C Release --output-on-failure ` + -R '^NativeSonKu(P72AtomicXyzLiveEditSource|P72JuceV3XyzLiveAckV1V2Restore|SessionV1V2AndAudioAppliedAck|P75MusicStereoPhaseNoNullAndChunkParity)$' + if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE } + - name: Package real native portable mixer, never an installer + shell: pwsh + run: | + & ./scripts/package_native_windows.ps1 -BuildDir build -OutputDir dist + if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE } + python scripts/factoryfx_release_bundle.py stage --lock config/factoryfx-approved-releases.json --output dist --best-effort + if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE } + - name: Record exact experiment and physical qualification pending + shell: pwsh + run: | + $path = 'dist/BUILD_PROVENANCE.json' + $p = Get-Content -LiteralPath $path -Raw -Encoding utf8 | ConvertFrom-Json + $sha = (& git rev-parse HEAD).Trim() + if ($p.sourceCommit -ne $sha) { throw "SONKU_P75_ARTIFACT_SHA_MISMATCH" } + $p.fatStatus = 'FIELD_PREVIEW_FULL_CTEST_NOT_RUN' + $p | Add-Member -NotePropertyName sonkuExperiment -NotePropertyValue @{ + enabled = $true + nativeXYZ = $true + musicSafeStereo = $true + musicSafeAlgorithm = 'MEASURED_CENTER_MID_PLUS_UNCONDITIONAL_STEREO_SIDE_RESEARCH' + stateSchema = 3 + fullWindowsExecutable = $true + publicRelease = $false + physicalAsioQualified = $false + dearVrPerceptualParityProven = $false + qualification = 'SONKU_P75_FULL_JUCE_APP_3_SCOPED_CTEST_PASS_REAL_ASIO_LISTENING_PENDING' + licenseRedistributionApproval = $false + mitKemarNoticeSha256 = (Get-FileHash -LiteralPath docs/THIRD_PARTY_8D_SONKU_HRTF.md -Algorithm SHA256).Hash.ToLowerInvariant() + fieldFatGuideSha256 = (Get-FileHash -LiteralPath docs/SONKU_P75_PHYSICAL_AUDIO_FAILURE_FIX_20261114.md -Algorithm SHA256).Hash.ToLowerInvariant() + } -Force + $p | ConvertTo-Json -Depth 20 | Set-Content -LiteralPath $path -Encoding utf8 + - name: Independent GUI PE, approved resources, provenance and ZIP verification + shell: pwsh + run: | + & ./scripts/verify_native_windows_artifact.ps1 -OutputDir dist + if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE } + $p = Get-Content -LiteralPath dist/BUILD_PROVENANCE.json -Raw | ConvertFrom-Json + if (-not $p.sonkuExperiment.enabled -or + -not $p.sonkuExperiment.musicSafeStereo -or + $p.sonkuExperiment.stateSchema -ne 3 -or $p.sonkuExperiment.publicRelease) { + throw 'SONKU_P75_WRONG_FIELD_ARTIFACT' + } + - name: Include mandatory MIT KEMAR notice and physical FAT guide + shell: pwsh + run: | + # Standard distribution allowlist was verified above. Field-only notice. + Copy-Item -LiteralPath docs/THIRD_PARTY_8D_SONKU_HRTF.md -Destination dist/THIRD_PARTY_8D_SONKU_HRTF.md + Copy-Item -LiteralPath docs/SONKU_P75_PHYSICAL_FIELD_FAT_20261114.md -Destination dist/SONKU_P75_FIELD_FAT.md + $p = Get-Content -LiteralPath dist/BUILD_PROVENANCE.json -Raw | ConvertFrom-Json + $checks = @{ + 'THIRD_PARTY_8D_SONKU_HRTF.md' = [string]$p.sonkuExperiment.mitKemarNoticeSha256 + 'SONKU_P75_FIELD_FAT.md' = [string]$p.sonkuExperiment.fieldFatGuideSha256 + } + foreach ($item in $checks.GetEnumerator()) { + $file = Join-Path dist $item.Key + if ($item.Value -notmatch '^[0-9a-f]{64}$' -or + -not (Test-Path -LiteralPath $file -PathType Leaf)) { + throw "SONKU_P75_FIELD_NOTICE_MISSING:$($item.Key)" + } + $actual = (Get-FileHash -LiteralPath $file -Algorithm SHA256).Hash.ToLowerInvariant() + if ($actual -ne $item.Value) { throw "SONKU_P75_FIELD_NOTICE_HASH_MISMATCH:$($item.Key)" } + } + if (Test-Path -LiteralPath dist/Studio) { throw 'SONKU_FIELD_USER_DATA_MUST_NOT_SHIP' } + Write-Host 'SONKU_P75_FIELD_READY: GUI EXE + verified MIT notice + FAT guide' + - uses: actions/upload-artifact@v4 + name: Upload isolated SonKu Windows x64 field candidate + with: + name: ArSonMix-SonKu-P75-Music-Safe-Windows-x64-${{ github.run_id }} + path: dist/ + if-no-files-found: error + retention-days: 21 + compression-level: 0 From dad995469dedc8b25dd34537e3dfacf572068fe2 Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Sat, 14 Nov 2026 18:35:24 +0700 Subject: [PATCH 06/10] fix(sonku-ci): package exact new P7.5 FAT guide and correct verification labels --- .github/workflows/sonku-p75-windows-field.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/sonku-p75-windows-field.yml b/.github/workflows/sonku-p75-windows-field.yml index 3be236236..adad0dc3f 100644 --- a/.github/workflows/sonku-p75-windows-field.yml +++ b/.github/workflows/sonku-p75-windows-field.yml @@ -149,7 +149,7 @@ jobs: publicRelease = $false physicalAsioQualified = $false dearVrPerceptualParityProven = $false - qualification = 'SONKU_P75_FULL_JUCE_APP_3_SCOPED_CTEST_PASS_REAL_ASIO_LISTENING_PENDING' + qualification = 'SONKU_P75_FULL_JUCE_APP_4_SCOPED_CTEST_PASS_REAL_ASIO_LISTENING_PENDING' licenseRedistributionApproval = $false mitKemarNoticeSha256 = (Get-FileHash -LiteralPath docs/THIRD_PARTY_8D_SONKU_HRTF.md -Algorithm SHA256).Hash.ToLowerInvariant() fieldFatGuideSha256 = (Get-FileHash -LiteralPath docs/SONKU_P75_PHYSICAL_AUDIO_FAILURE_FIX_20261114.md -Algorithm SHA256).Hash.ToLowerInvariant() @@ -171,7 +171,7 @@ jobs: run: | # Standard distribution allowlist was verified above. Field-only notice. Copy-Item -LiteralPath docs/THIRD_PARTY_8D_SONKU_HRTF.md -Destination dist/THIRD_PARTY_8D_SONKU_HRTF.md - Copy-Item -LiteralPath docs/SONKU_P75_PHYSICAL_FIELD_FAT_20261114.md -Destination dist/SONKU_P75_FIELD_FAT.md + Copy-Item -LiteralPath docs/SONKU_P75_PHYSICAL_AUDIO_FAILURE_FIX_20261114.md -Destination dist/SONKU_P75_FIELD_FAT.md $p = Get-Content -LiteralPath dist/BUILD_PROVENANCE.json -Raw | ConvertFrom-Json $checks = @{ 'THIRD_PARTY_8D_SONKU_HRTF.md' = [string]$p.sonkuExperiment.mitKemarNoticeSha256 From 00678c4e83383d4f7d2a06b33761618729ac0920 Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Sat, 14 Nov 2026 18:36:55 +0700 Subject: [PATCH 07/10] =?UTF-8?q?test(sonku):=20correct=20width-zero=20exp?= =?UTF-8?q?ected=20side-power=20bound=20(0.375=C2=B2,=20not=20>0.15)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tests/sonku_p75_stereo_integrity_test.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/sonku_p75_stereo_integrity_test.cpp b/tests/sonku_p75_stereo_integrity_test.cpp index 8871821c6..5bcea2d59 100644 --- a/tests/sonku_p75_stereo_integrity_test.cpp +++ b/tests/sonku_p75_stereo_integrity_test.cpp @@ -57,7 +57,9 @@ static void antiPhaseCanNeverNull(double rate) { pIn+=original[i]*original[i]; pOut+=l[i]*l[i]; } - assert(pOut>.15*pIn); + const double exactRatio=std::pow(.75*scaledWidth,2.); + assert(std::abs(pOut/pIn-exactRatio)<1.e-4); + assert(pOut>.12*pIn); // width=0 intentionally retains half SIDE } } static void monoMidCannotCombFromSpread(double rate) { From a291897334e987fc61c4217c8906066dc6a36045 Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Sat, 14 Nov 2026 18:39:57 +0700 Subject: [PATCH 08/10] feat(sonku): expose truthful P7.5 research music-safe capability in identity-bound native readback --- src/Main.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/Main.cpp b/src/Main.cpp index 45680d11d..e3090f74e 100644 --- a/src/Main.cpp +++ b/src/Main.cpp @@ -3034,6 +3034,13 @@ class ConsoleWindow final : public juce::DocumentWindow, private juce::Timer, pr reply->setProperty("schemaVersion", armix::builtin_fx::sonku_bridge::schemaVersion()); reply->setProperty("status",processor?"ACCEPTED":"REJECTED"); +#if defined(SONKU_P75_MUSIC_SAFE_RESEARCH) && SONKU_P75_MUSIC_SAFE_RESEARCH + // Read-only experiment capability is authoritative only for a real + // leased native SonKu instance. No public UI or saved state change. + if(processor && processor->preparedReflectionProfile()== + armix::sonku::SonKuReflectionProfile::SixSurfaceKemarResearch) + reply->setProperty("musicSafeStereo",true); +#endif if(processor) { reply->setProperty("settings", armix::builtin_fx::sonku_bridge::acceptedSettings( From 089520f43c7e9d4900d70ee9ea5b10f83d167226 Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Sat, 14 Nov 2026 18:40:25 +0700 Subject: [PATCH 09/10] ux(sonku): disclose tested P7.5 MID/SIDE safety mode only after native identity-bound readback --- site/preview-v2/assets/mixer-native-sonku.js | 21 ++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/site/preview-v2/assets/mixer-native-sonku.js b/site/preview-v2/assets/mixer-native-sonku.js index 89d48b032..07fd02a61 100644 --- a/site/preview-v2/assets/mixer-native-sonku.js +++ b/site/preview-v2/assets/mixer-native-sonku.js @@ -173,7 +173,7 @@ 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, - xyzCapable=false, + xyzCapable=false,musicSafeStereo=false, readId="",readSentAt=0,seq=1,clock=null,frame=null,observed=0,observedAt=0, drag=null,dialDrag=null,rangeEdits=new Set(),gestureStart=new Map(), visualPhase=0,visualAt=0,liveTimer=null,lastLiveAt=0; @@ -231,9 +231,15 @@ function render(){ if(!rangeEdits.has("skElevation"))elevation.value=String(s.directElevationDegrees); $("skElevationValue").textContent=s.directElevationDegrees.toFixed(1)+"°"; } - root.querySelector(".sk-stage-caption").textContent=xyzCapable - ?"HEADPHONES · MEASURED 3D HRIR · 44.1 / 48 kHz" + root.querySelector(".sk-stage-caption").textContent=musicSafeStereo + ?"HEADPHONES · MEASURED CENTER 3D HRTF + MUSIC SIDE · EXPERIMENT" + :xyzCapable?"HEADPHONES · MEASURED 3D HRIR · 44.1 / 48 kHz" :"HEADPHONES · HRIR 0° ELEVATION · 44.1 / 48 kHz"; + $("skSpread").closest("label").querySelector(".sk-param-name").textContent= + musicSafeStereo?"SIDE WIDTH":"SPREAD"; + root.querySelector(".sk-guide").textContent=musicSafeStereo + ?"Stereo WIDTH adjusts preserved L/R SIDE, not two separately located HRIR emitters" + :"Drag monitors to position · rotary knobs: vertical drag, double-click to reset"; if(!rangeEdits.has("skAmbience")) $("skAmbience").value=String(Math.round(s.ambience*100)); const reflections=$("skReflections"); @@ -246,7 +252,9 @@ function render(){ // Only source placement is animated; knobs and input ranges are NOT // redrawn at 60 Hz. The native audio callback remains the time authority. drawSpeakers(); - $("skMode").textContent=native()?(context()?"NATIVE HRTF":"NATIVE UNAVAILABLE"):"VISUAL ONLY · NO AUDIO"; + $("skMode").textContent=native()?(context()? + (musicSafeStereo?"NATIVE MUSIC SAFE · RESEARCH":"NATIVE HRTF"): + "NATIVE UNAVAILABLE"):"VISUAL ONLY · NO AUDIO"; } function drawSpeakers(){ const s=draft; @@ -391,6 +399,7 @@ backend()?.addEventListener?.("arMixBuiltinSonKuSnapshot",r=>{ if(!valid(incoming))return; // Activation happens only after a fully identity-bound native readback. xyzCapable=measured; + musicSafeStereo=measured && r.musicSafeStereo===true; readId="";readSentAt=0; if(pending) { if(!pending.ack || r.appliedRequestId!==pending.requestId){ @@ -413,7 +422,7 @@ backend()?.addEventListener?.("arMixBuiltinSonKuSnapshot",r=>{ } render(); }); -$("skClose").addEventListener("click",()=>{root.hidden=true;current=null;xyzCapable=false; +$("skClose").addEventListener("click",()=>{root.hidden=true;current=null;xyzCapable=false;musicSafeStereo=false; cancelLiveTimer();pending=null;latest=null;readId="";readSentAt=0;dialDrag=null; drag=null;rangeEdits.clear();gestureStart.clear();lastLiveAt=0; if(clock!==null){clearInterval(clock);clock=null;} @@ -566,7 +575,7 @@ const api={ cancelLiveTimer();pending=null;latest=null;readId="";readSentAt=0;dialDrag=null; observedAt=0;visualAt=0;visualPhase=0;lastLiveAt=0; drag=null;rangeEdits.clear();gestureStart.clear(); - accepted=defaults();draft=defaults();xyzCapable=false; + accepted=defaults();draft=defaults();xyzCapable=false;musicSafeStereo=false; current={track,slot,instanceId:null}; const s=snapshot(),id=window.__ARMIX_NATIVE_M2__?.nativeIdFor?.(track); const fx=s?.graph?.channels?.find(x=>x.id===id)?.inserts?.[slot]; From 170cfecc26279f95ee27f9b8f58a18cee10199db Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Sat, 14 Nov 2026 19:20:52 +0700 Subject: [PATCH 10/10] docs(sonku): P8 dearVR-grounded acoustic fidelity architecture and evidence-driven QA gates --- ...ENCHMARK_ACOUSTIC_ARCHITECTURE_20261114.md | 112 ++++++++++++++++++ 1 file changed, 112 insertions(+) create mode 100644 docs/SONKU_P8_DEARVR_BENCHMARK_ACOUSTIC_ARCHITECTURE_20261114.md diff --git a/docs/SONKU_P8_DEARVR_BENCHMARK_ACOUSTIC_ARCHITECTURE_20261114.md b/docs/SONKU_P8_DEARVR_BENCHMARK_ACOUSTIC_ARCHITECTURE_20261114.md new file mode 100644 index 000000000..9bb4aca0e --- /dev/null +++ b/docs/SONKU_P8_DEARVR_BENCHMARK_ACOUSTIC_ARCHITECTURE_20261114.md @@ -0,0 +1,112 @@ +# ArSonMix 8D-SonKu — P8 Acoustic Fidelity RFC and DearVR PRO 2 Benchmark + +**Date:** 2026-11-14. **Status:** RESEARCH DESIGN / NO PRODUCTION DSP CHANGES. +**Owner physical listening verdict:** P7.4 FAILED (severe cancellation); P7.5 FAILED PERCEPTUAL TARGET (thin bass, nasal/prominent mid, unnatural stereo consolidation, weak cube/room depth). Green source tests or Windows build do NOT override physical listening. **No claim of dearVR equivalence.** + +## 1. Reference evidence: what dearVR actually does + +Public documentation, NOT reverse engineering: +1. Official dearVR PRO 2 manual (Jan 2024): https://files.plugin-alliance.com/products/dearvr-pro-2/dearvr-pro-2_manual.pdf + - Chapter 2: spatial location alone is insufficient; distance, motion, first reflections, late diffuse reverb are separate acoustic cues. + - Chapter 3.2: Realtime Auralisation computes reflections relative to LEFT/RIGHT/FRONT/BACK/TOP/BOTTOM boundaries; wall distances influence arrival delay/strength; independent reflection gain, high-pass and low-pass. + - Chapter 3.3: 46 *captured room-character* presets, independently adjustable reverb size, high-pass, low-pass, gain. We do NOT need 46 presets for a believable first release: better 1 reference-calibrated room than 46 arbitrary labels. + - Chapter 4: CLARITY trades HRTF spectral coloration against externalized/localizable perception (0=maximum localization, 100=minimum tonal coloration); BASS BOOST separately enhances input bass. **Don't credit room alone for dearVR's bass until BASS BOOST control state is known.** + - Mono input is explicitly separate from stereo width; a mono track has only one positioned virtual source, while stereo input can retain two source markers. + - Bass Boost, Clarity and Performance Mode cannot be inferred from screenshots; A/B must log their actual states. +2. Sennheiser explanation (2025): https://help.sennheiser.com/hc/en-us/articles/27424692616594-How-to-produce-natural-immersive-music-with-the-CLARITY-modul-of-dearVR-PRO2 + - HRTF always changes the spectrum; the optimal balance is CONTENT DEPENDENT. Do not copy patented AMBEO Clarity algorithm or weights. +3. Sennheiser PRO 2 release: https://newsroom.sennheiser.com/dear-reality-releases-dearvr-pro-2-spatializer-plugin-p7zg0c + - Proper stereo input and stereo-width positioning, distinct ER/late high-/low-pass, believable distance. +4. DAGA 2025 binaural auralization research: https://pub.dega-akustik.de/DAS-DAGA_2025/files/upload/paper/397.pdf + - Plausible BRIR-style rendering may combine a GOOD HRTF, simplified geometrically consistent early image sources and a COMMON late diffuse RIR/reverb; measured RIR/RT60 and interaural room statistics are meaningful anchors. +5. DAGA 2018 externalization and HRTF/headphone dependence: https://pub.dega-akustik.de/DAGA_2018/data/articles/000252.pdf + +**Legal design constraint:** Do not copy dearVR binary, measured response, presets/IR files, patented Clarity, GUI or proprietary kernels; use original algorithms and datasets licensed explicitly for redistribution. Commercial reference is a black-box listening comparator, not a source-code dependency. + +## 2. Confirmed source-level architectural problems (P7.5 at 089520f43c7e) + +| Finding | Existing source | Engineering consequence | +|---|---|---| +| P7.5 forces a stereo track's MID into ONE KEMAR directional center FIR, adds unfiltered SIDE as equal-and-opposite ear bed. | `SonKuSpatialCore.h::process` `musicSafe`, `sideRescue` | Prevents select anti-phase nulls but puts SIDE IN THE HEAD; the stereo soundstage does not truly occupy separate L/R positions in space. Does not preserve natural sound by construction. | +| ROOM feeds two copies of MID to reflections at zero spread; late FDN also gets MID/MID. | `SonKuSpatialCore.h::room_.process`, `reverb_.process` | ER and tail lack the original SIDE scene information. Stereo width control is *not* independently spatialized left and right sources. | +| Spectral balance is not designed from full-band calibrated reference response. A ~180 Hz one-pole ear shelf is nonzero in scene mode; legacy/off mode bypasses that compensation. | `SonKuSpatialCore.h`: `earBass_`, `smoothedBassShelf_`, `nativeSpaceEverUsed_` | Low frequency can remain weak when ROOM OFF; scene switching changes tonal balance as well as room. Mid presence cannot be fixed by simply raising broadband gain. | +| Room uses geometric 4+2 image reflection paths with fixed scalar wall gains and one mild low-pass, not calibrated frequency-dependent boundary absorption. | `SonKuEarlyReflections.h`, six-surface research | Six-wall coordinates ARE implemented, but physical depth is not guaranteed: time, direction, strength and spectra must be consistent with target room and loudspeaker positions. | +| Late room is synthetic eight-delay-line FDN with small fixed wet scale; three presets based on RT60/damping, no measured per-room RIR or independently controlled late spectral decay. | `SonKuMusicalReverb.h`: `wetLeft*.23f*amount_`, `prepared_` | Flat or artificial room impression despite presence of reverb. | +| Existing P0–P7.5 tests mostly use impulses and simple tones + stereo energy minima, not captured music and direct/room-separated transfer plots. | `tests/sonku_p75_stereo_integrity_test.cpp`, CTest | A non-null output can still be hollow, nasal, phasey or lacking externalization. | + +Source pointers are claims about **this specific branch**, not claims that the commercial engine uses the same filter topology. + +## 3. Target architecture — source-faithful, room-aware binaural renderer + +```text +Input L/R or true mono + ├── source-layout adapter (MonoObject | StereoObject | StereoBed) + ├── calibrated spectral/phase safety model (control-side coefficients) + │ ├── center/coherence-safe musical content + │ └── truly positioned stereo object information (never unfiltered headphone SIDE as the sole width) + ├── object-based direct field: interpolated measured HRTF(s) + │ └── separately derived common timbral equalization / constrained localization cues + ├── six boundary image paths with real delay, direction, frequency-dependent absorption + ├── calibrated late diffuse/BRIR-like field (RT60 by octave, predelay, decorrelation) + └── headroom/level-calibrated summation, stereo linked peak protection + → JUCE native single-authority PCM → existing FX rack/WIRE/MAIN +``` + +**Critical invariant:** An *unfiltered SIDE rescue* is NOT the shipping stereo renderer. Explore a stereo-source aware 2-input/2-ear transfer matrix whose coherence, frequency-band energy and independent source locations are analytically validated. A single centered HRIR can be a safe diagnostic mode for mono; it is not a spatial substitute for stereo scene source objects. + +**Timbre path:** +- Audit KEMAR dataset normalization (free-/diffuse-field reference), ear magnitude and group delay in at least 1/3-octave bands for all real source directions; do NOT assume the baseline `~ -7 to -11 dB below 200 Hz` comment is a sufficient calibration. +- Proposed original **Timbre Preserve** mode: bounded common-channel, minimum-phase correction prepared OFF the callback; spectrally smooth gains that preserve interaural time/level differences and salient pinna notch cues. Expose a controllable coloration/localization tradeoff AFTER a measured improvement, not a copy of proprietary CLARITY. +- Evaluate lows independently: bass retention 40–250 Hz, mid 250–2500 Hz and treble 2.5–10 kHz relative to dry/source and matched dearVR. Add *optional* bass enhancement only after the signal has correct neutral base. Compare dearVR Bass Boost OFF/ON explicitly, never infer the room created all LF. +- Preserve energy across coherent mono, stereo correlated, inverse polarity, hard-left/right, narrow and diffuse sources. No unconditional mono fold for a stereo object. + +**Room path:** +- First calibrate **one** credible reference room with measured or defensible RIR statistics, e.g. modest studio (not “cube” merely in GUI). Treat each surface as a frequency-dependent reflection transfer and track image-source arrival direction, distance, and delay. Independent low/high cut for ER. +- Preserve a coherent physically meaningful direct/ER ratio (DRR), decay time and interaural coherence; enable 6-wall ER AND late tail via separate controls. A big late-reverb multiplier alone does not create a cubic volume. +- Prefer a hybrid room model (physically positioned image-source early paths + FDN/partitioned-convolution diffuse late field) with prepared coefficients. No copied dearVR impulse responses. Calibrate RT60 by frequency band (at least low/mid/high) and reflection density, rather than only global 0.78/1.28/2.05 s. +- Distances must alter direct level, spectral air loss, DRR, early arrival and late diffuseness consistently, without arbitrary full-range dips. +- Keep SPSC atomic accepted settings, deviceEpoch/graphRevision ACK, on/off tail causal reset, bounded audio callback, exact source SHA artifact provenance, and compatibility with .smix existing schemas. + +## 4. Experimental process — do NOT mix multiple corrective algorithms into one uncontrolled test + +### P8.0 — measurement and hypothesis isolation (BEFORE redesign) +- Add a deterministic offline **source → FX → measured ear PCM** renderer for the same exact experimental `SonKuSpatialCore` source used by the full Windows app. Ensure bypass reference and switchable direct-only, ER-only, late-only, all-in combinations. +- Output per-case CSV/JSON and licensed WAV stems; report sample rate, block size, source file hash, preset, mode, direction, elevation, room geometry, verified applied state and source commit. +- Generate 2-channel logarithmic sweep / multitone transfer, transient and broadband noise at 44.1 and 48 kHz and examine 40–16k band ratios. Test calibrated dry reference and separately captured actual music: bass guitar/kick, full-range vocal, guitar, dense mixed stereo, hard-left stem, mono, decorrelated ambience, anti-phase and partial-coherence material. +- Measure: loudness matched within 0.2 LU/0.2 dB where feasible, 1/3-octave left/right/mid/side spectral deviation, per-band coherence, integrated short-time side loss, true peak, phase/ITD/ILD/position, short-term comb-notch depth, peak-to-RMS. For room impulse: ER arrivals/six directions, DRR, T20/T30/RT60 by band, interaural cross-correlation (IACC), energy build-up, tail density and echo density. Use a stable window and comparable direct-only signal. +- Baseline A/B four states: source bypass; P7.4 failed; P7.5 failed target; dearVR PRO 2, matched binaural output at the same source angle and distance. Capture reference exact control values (Clarity 0/50/100, Bass Boost OFF then ON, ER OFF/ON, Reverb OFF/ON, input Stereo Width, Output Binaural, master gain and OS headphone EQ disabled). +- **Gate:** no acoustic feature coding until failure origin isolated to direct HRTF coloration, stereo summation, or ER/reverb composition. Source tests must recognize *audibly flawed* P7.5 rather than pass solely because RMS > 0. + +### P8.1 — music and tonal fidelity +- Implement independent mono vs stereo source semantics and validated coherence/energy-constrained binaural matrix. Keep a direct-only tonal A/B gate; reversible feature flag. +- Offline-prepared timbre correction, no naïve wide-band bass boost or unstable subtraction of differently delayed dry/HRIR. +- Acceptance: no material instrument disappearing; test bass and mid ratios against bypass and dearVR with fixed gain, no extra transient clipping, controlled L/R stereo placement, no head-locked SIDE-only artifact as principal stereo renderer. Targets require measurements + real listening, not arbitrary single RMS threshold. + +### P8.2 — room realism +- Make separately isolated direct, first-arrival six-wall ER, diffuse late field and common output; calibrate one reference studio room for plausible DRR/decay and direction. +- Follow-up listening for front/back externalization, real room size, tail naturalness, timbral smoothness and distance ordering. Only then consider additional spaces. +- Reproducible A/B room-only and direct+room examples, measured impulse plots and bandwidth-limited controls; verify no "large room" labels unsupported by acoustics. + +### P8.3 — CPU and product qualification +- Benchmark callback p95/p99 CPU and XRUN at 44.1/48k with 64/128/256 where hardware supports, 1/2/4 instances, room ON, direction movement, WIRE/VST3 and restart. Prefer one authoritative JUCE PCM graph; no WebAudio simulation or alternate audio engine. +- Source-derived, block-invariant DSP, no allocations/locks/work queues on callback, shared coefficient cache prepared control-side, optionally partitioned FIR/convolution for room assets when profiling justifies it. +- Test normal Save/Open `.smix`, v1/v2/v3 migrations, FX rack OFF/ON, per-channel main/bus routing, stereo output mapping, and mono switch. +- Two-stage release gate: automated numerical/CI AND actual owner headphone evaluation matched to dearVR; multiple independent listeners recommended before any "comparable to dearVR" claim. + +## 5. Physical A/B matrix: record both SonKu and dearVR settings + +| Scene | dearVR (log exact state) | SonKu measurement | Pass criterion | +| --- | --- | --- | --- | +| Dry direct | Reverb OFF, ER OFF, Bass Boost OFF, Clarity 0/50/100, output Binaural | bypass, direct-only, room OFF, spectral profiler | Mid and LF coloration explained and controlled; localization maintained | +| Stereo objects | matched stereo width and FRONT/R/L/REAR, static | independent L/R tracks and phase/coherence | No disappearing instruments, no unreasonably head-locked side | +| Six boundaries | Realtime Auralisation with actual wall distances, ER ON, Reverb OFF | 6-path timing/direction, band-filtered energy | Reflection direction and delay track room dimensions | +| Captured room | selected Studio Room/Small Studio, ER+Reverb, preset/size/filters written down | one calibrated target room; direct/ER/late diagnostic | Audible room size/depth, natural decay, consistent DRR | +| Bass comparison | Bas Boost OFF + repeat ON | neutral + optional explicit enhancement | Never confuse bass processing with spatial realism | +| Hardware | headphone EQ profile and exact ASIO mapping stated | same physical interface/cans, no OS spatial enhancements | Level matched, low XRUN, no user-critical dropout | + +## 6. Implementation guardrails and decision + +- **STOP iterating UI/assets, arbitrary wet multipliers or forced MID folding to solve this audio defect.** +- Current P7.5 [PR #689] must stay Draft/research-only, and P7.4 [PR #688] may not be presented as successfully audio-qualified. Current public default/release is unchanged. +- Do not copy or use Sennheiser proprietary source/code/IR data. Benchmark by functional/output observations and independently licensed original acoustic models. +- **Owner acceptance matters:** hearing reports of nasal mid, lost bass and lack of cube depth are fail conditions regardless of source CI. Measured improvements are necessary but not sufficient.