Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
198 changes: 198 additions & 0 deletions .github/workflows/sonku-p75-windows-field.yml
Original file line number Diff line number Diff line change
@@ -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_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()
} -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_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
'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
27 changes: 26 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down Expand Up @@ -207,7 +216,8 @@ target_compile_definitions(ARMixConsole PRIVATE
$<$<BOOL:${ARMIX_SONKU_EXPERIMENTAL_NATIVE_XYZ_RT}>:ARMIX_SONKU_EXPERIMENTAL_NATIVE_XYZ_RT=1>
$<$<BOOL:${ARMIX_SONKU_EXPERIMENTAL_NATIVE_XYZ_RT}>:SONKU_P7_MEASURED_ELEVATION_RESEARCH=1>
$<$<BOOL:${ARMIX_SONKU_EXPERIMENTAL_NATIVE_XYZ_RT}>:SONKU_P71_DIRECT_XYZ_RESEARCH=1>
$<$<BOOL:${ARMIX_SONKU_EXPERIMENTAL_NATIVE_XYZ_RT}>:SONKU_P72_NATIVE_XYZ_RT=1>)
$<$<BOOL:${ARMIX_SONKU_EXPERIMENTAL_NATIVE_XYZ_RT}>:SONKU_P72_NATIVE_XYZ_RT=1>
$<$<BOOL:${ARMIX_SONKU_EXPERIMENTAL_MUSIC_SAFE}>: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.
Expand Down Expand Up @@ -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.
Expand Down
28 changes: 28 additions & 0 deletions docs/SONKU_P75_PHYSICAL_AUDIO_FAILURE_FIX_20261114.md
Original file line number Diff line number Diff line change
@@ -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`.
Loading
Loading