diff --git a/.github/workflows/p1-windows.yml b/.github/workflows/p1-windows.yml index 37f343179..2dac405ab 100644 --- a/.github/workflows/p1-windows.yml +++ b/.github/workflows/p1-windows.yml @@ -133,7 +133,6 @@ permissions: pull-requests: read jobs: - quick: name: Fast native contracts (no Windows / JUCE checkout) runs-on: ubuntu-latest @@ -644,3 +643,115 @@ jobs: retention-days: 14 compression-level: 0 overwrite: true + + sonku-p90-source: + # Runs only on the P9 research PR, even while its production jobs skip. + name: SonKu P9 exact-source C++ PCM preflight + if: ${{ github.event_name == 'pull_request' && startsWith(github.event.pull_request.head.ref, 'research/sonku-p90-') }} + runs-on: ubuntu-latest + timeout-minutes: 10 + steps: + - uses: actions/checkout@v4 + with: + ref: ${{ github.event.pull_request.head.sha }} + persist-credentials: false + - name: Real P9 single-graph PCM / anti-phase / 44.1–48k + shell: bash + run: | + set -euo pipefail + node --check site/preview-v2/assets/mixer-native-sonku.js + node tests/sonku_p90_dropdown_stability_test.cjs + FLAGS="-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 -DSONKU_P80_TRANSPARENT_BASS_RESEARCH=1 -DSONKU_P82_MULTIBAND_ROOM_RESEARCH=1 -DSONKU_P83_PHYSICAL_SPEAKER_RESEARCH=1 -DSONKU_P84_SINGLE_CORE_FUSION_RESEARCH=1 -DSONKU_P85_WORLD_COHERENCE_RESEARCH=1 -DSONKU_P86_HORIZONTAL_FOCUS_RESEARCH=1 -DSONKU_P87_MUSIC_BODY_RESEARCH=1 -DSONKU_P88_PERCEPTUAL_ALIGNMENT_RESEARCH=1 -DSONKU_P89_DEPTH_COHERENCE_RESEARCH=1 -DSONKU_P90_TRUE_EXTERNAL_RESEARCH=1" + g++ $FLAGS tests/sonku_p90_true_external_source_test.cpp -o /tmp/sonku-p90 + /tmp/sonku-p90 + g++ $FLAGS tests/sonku_p89_stereo_room_depth_source_test.cpp -o /tmp/sonku-p89 + /tmp/sonku-p89 + echo "SONKU_P90_NATIVE_SOURCE_CTEST_PASSED" + + sonku-p90-windows-fat: + name: SonKu P9 actual JUCE / GUI portable x64 + needs: sonku-p90-source + if: ${{ github.event_name == 'pull_request' && startsWith(github.event.pull_request.head.ref, 'research/sonku-p90-') }} + runs-on: windows-2022 + timeout-minutes: 55 + steps: + - uses: actions/checkout@v4 + with: + ref: ${{ github.event.pull_request.head.sha }} + persist-credentials: false + - uses: actions/checkout@v4 + with: + repository: juce-framework/JUCE + ref: 8.0.15 + path: third_party/JUCE + persist-credentials: false + - name: Pinned WebView2 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 the actual native app with P9 OFF by default except FAT + 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 ` + -DARMIX_SONKU_EXPERIMENTAL_P8_TRANSPARENT_BASS=ON ` + -DARMIX_SONKU_EXPERIMENTAL_P82_ROOM=ON ` + -DARMIX_SONKU_EXPERIMENTAL_P83_NATIVE_RT=ON ` + -DARMIX_SONKU_EXPERIMENTAL_P84_NATIVE_RT=ON ` + -DARMIX_SONKU_EXPERIMENTAL_P85_NATIVE_RT=ON ` + -DARMIX_SONKU_EXPERIMENTAL_P86_NATIVE_RT=ON ` + -DARMIX_SONKU_EXPERIMENTAL_P87_NATIVE_RT=ON ` + -DARMIX_SONKU_EXPERIMENTAL_P88_NATIVE_RT=ON ` + -DARMIX_SONKU_EXPERIMENTAL_P89_NATIVE_RT=ON ` + -DARMIX_SONKU_EXPERIMENTAL_P90_NATIVE_RT=ON ` + -DBUILD_TESTING=ON + if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE } + $cache = Get-Content build/CMakeCache.txt -Raw + if ($cache -notmatch 'ARMIX_SONKU_EXPERIMENTAL_P90_NATIVE_RT:BOOL=ON') { + throw 'SONKU_P90_WRONG_NATIVE_CONFIGURATION' + } + - name: Build real native JUCE PCM, state ACK, and Windows GUI + shell: pwsh + run: | + cmake --build build --config Release --parallel 2 --target ARMixSonKuP90NativeTests ARMixSonKuP90SourceTests ARMixSonKuP89NativeTests ARMixSonKuP89SourceTests ARMixConsole + if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE } + if (-not (Test-Path -LiteralPath 'build/ARMixConsole_artefacts/Release/AR MIX Studio.exe' -PathType Leaf)) { + throw 'SONKU_P90_NATIVE_GUI_EXE_MISSING' + } + ctest --test-dir build -C Release --output-on-failure -R '^NativeSonKuP(89RoomAnchoredStereoAndP88GoldenParity|89JuceV10AppliedAckAndV9Restore|90StereoExternalizationSource|90JuceV11AppliedAckAndLegacyRestore)$' + if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE } + - name: Verified portable package, no installer or release + 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 } + & ./scripts/verify_native_windows_artifact.ps1 -OutputDir dist + if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE } + Copy-Item docs/THIRD_PARTY_8D_SONKU_HRTF.md dist/THIRD_PARTY_8D_SONKU_HRTF.md + Copy-Item docs/SONKU_P90_TRUE_EXTERNAL_SPEAKER_FAT_20261115.md dist/SONKU_P90_FIELD_FAT.md + $provenance = Get-Content -LiteralPath dist/BUILD_PROVENANCE.json -Raw | ConvertFrom-Json + if ($provenance.sourceCommit -ne (git rev-parse HEAD).Trim()) { + throw 'SONKU_P90_SOURCE_COMMIT_MISMATCH' + } + $provenance | Add-Member -Force -NotePropertyName sonkuExperiment -NotePropertyValue @{ + mode = 'P9.0_TRUE_EXTERNAL_SPEAKER' + stateSchema = 11 + headphoneFat = 'PENDING' + publicRelease = $false + physicalAsioQualified = $false + dearVrParityProven = $false + } + $provenance | ConvertTo-Json -Depth 20 | Set-Content dist/BUILD_PROVENANCE.json -Encoding utf8 + - uses: actions/upload-artifact@v4 + with: + name: ArSonMix-SonKu-P90-Windows-x64-${{ github.run_id }} + path: dist/ + if-no-files-found: error + retention-days: 21 + compression-level: 1 diff --git a/.github/workflows/sonku-p89-windows-field.yml b/.github/workflows/sonku-p89-windows-field.yml index 8e5a52a77..912fb6de0 100644 --- a/.github/workflows/sonku-p89-windows-field.yml +++ b/.github/workflows/sonku-p89-windows-field.yml @@ -1,5 +1,5 @@ -name: SonKu P8.9 room-anchored stereo native mixer portable FAT x64 -# Private JUCE app, no release. Native v10 A/B P8.2/P8.4/P8.5/P8.6/P8.7/P8.8/P8.9. +name: SonKu P9.0 true external speaker native mixer portable FAT x64 +# Private JUCE app, no release. Native v11 A/B P8.2 through P9. on: pull_request: paths: @@ -8,7 +8,7 @@ on: permissions: contents: read concurrency: - group: sonku-p89-field-${{ github.event.pull_request.number || github.ref }} + group: sonku-p90-field-${{ github.event.pull_request.number || github.ref }} cancel-in-progress: true jobs: preflight: @@ -48,6 +48,9 @@ jobs: g++ $FLAGS -DSONKU_P85_WORLD_COHERENCE_RESEARCH=1 -DSONKU_P86_HORIZONTAL_FOCUS_RESEARCH=1 -DSONKU_P87_MUSIC_BODY_RESEARCH=1 -DSONKU_P88_PERCEPTUAL_ALIGNMENT_RESEARCH=1 -DSONKU_P89_DEPTH_COHERENCE_RESEARCH=1 tests/sonku_p89_stereo_room_depth_source_test.cpp -o /tmp/p89-source /tmp/p89-source | tee /tmp/p89-source.log grep -q '^PASS P89 ROOM ANCHOR:' /tmp/p89-source.log + g++ $FLAGS -DSONKU_P85_WORLD_COHERENCE_RESEARCH=1 -DSONKU_P86_HORIZONTAL_FOCUS_RESEARCH=1 -DSONKU_P87_MUSIC_BODY_RESEARCH=1 -DSONKU_P88_PERCEPTUAL_ALIGNMENT_RESEARCH=1 -DSONKU_P89_DEPTH_COHERENCE_RESEARCH=1 -DSONKU_P90_TRUE_EXTERNAL_RESEARCH=1 tests/sonku_p90_true_external_source_test.cpp -o /tmp/p90-source + /tmp/p90-source | tee /tmp/p90-source.log + grep -q '^PASS P90 NATIVE PCM:' /tmp/p90-source.log - name: Native JS and source GUI capability checks run: | set -euo pipefail @@ -68,6 +71,8 @@ jobs: print("P89_NATIVE_HEADER_PREPROCESSOR_BALANCED") PY grep -q 'r.schemaVersion===10' site/preview-v2/assets/mixer-native-sonku.js + grep -q 'r.schemaVersion===11' site/preview-v2/assets/mixer-native-sonku.js + grep -q 'p90TrueExternalSpeaker' src/Main.cpp # A mode8 enum without fused FIR dispatch silently changes P8.8 timbre. # This source contract prevents another fallback-to-wrong-kernel regression. python - <<'PY' @@ -165,6 +170,7 @@ jobs: -DARMIX_SONKU_EXPERIMENTAL_P87_NATIVE_RT=ON ` -DARMIX_SONKU_EXPERIMENTAL_P88_NATIVE_RT=ON ` -DARMIX_SONKU_EXPERIMENTAL_P89_NATIVE_RT=ON ` + -DARMIX_SONKU_EXPERIMENTAL_P90_NATIVE_RT=ON ` -DBUILD_TESTING=ON if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE } $cache = Get-Content -LiteralPath build/CMakeCache.txt -Raw @@ -178,7 +184,8 @@ jobs: $cache -notmatch 'ARMIX_SONKU_EXPERIMENTAL_P86_NATIVE_RT:BOOL=ON' -or $cache -notmatch 'ARMIX_SONKU_EXPERIMENTAL_P87_NATIVE_RT:BOOL=ON' -or $cache -notmatch 'ARMIX_SONKU_EXPERIMENTAL_P88_NATIVE_RT:BOOL=ON' -or - $cache -notmatch 'ARMIX_SONKU_EXPERIMENTAL_P89_NATIVE_RT:BOOL=ON') { + $cache -notmatch 'ARMIX_SONKU_EXPERIMENTAL_P89_NATIVE_RT:BOOL=ON' -or + $cache -notmatch 'ARMIX_SONKU_EXPERIMENTAL_P90_NATIVE_RT:BOOL=ON') { throw "SONKU_P83_RESEARCH_NOT_ENABLED" } $tests = (& ctest --test-dir build -C Release --show-only=json-v1 | Out-String | ConvertFrom-Json) @@ -202,7 +209,9 @@ jobs: 'NativeSonKuP88MeasuredEarHeightAndDistanceDrr', 'NativeSonKuP88JuceV9AppliedAckAndV8Restore', 'NativeSonKuP89RoomAnchoredStereoAndP88GoldenParity', - 'NativeSonKuP89JuceV10AppliedAckAndV9Restore') + 'NativeSonKuP89JuceV10AppliedAckAndV9Restore', + 'NativeSonKuP90StereoExternalizationSource', + 'NativeSonKuP90JuceV11AppliedAckAndLegacyRestore') $available = @($tests.tests | ForEach-Object { $_.name }) foreach ($test in $required) { if ($test -notin $available) { throw "SONKU_P82_MISSING_CTEST:$test" } @@ -210,9 +219,130 @@ jobs: - name: Fail fast — compile and execute real JUCE v5 state + PCM ACK first shell: pwsh run: | - cmake --build build --config Release --parallel 2 --target ARMixSonKuP89NativeTests + cmake --build build --config Release --parallel 2 --target ARMixSonKuP90NativeTests if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE } - ctest --test-dir build -C Release --output-on-failure -R '^NativeSonKuP89JuceV10AppliedAckAndV9Restore$' + ctest --test-dir build -C Release --output-on-failure -R '^NativeSonKuP90JuceV11AppliedAckAndLegacyRestore + if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE } + - 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 ARMixSonKuP80TonalEvidenceTests ARMixSonKuP82RoomTests ARMixSonKuP83LiveSourceTests ARMixSonKuP83NativeTests ARMixSonKuP84LiveSourceTests ARMixSonKuP84NativeTests ARMixSonKuP85WorldSourceTests ARMixSonKuP85NativeTests ARMixSonKuP86FocusSourceTests ARMixSonKuP86NativeTests ARMixSonKuP87MusicSourceTests ARMixSonKuP87NativeTests ARMixSonKuP88SourceTests ARMixSonKuP88NativeTests ARMixSonKuP89SourceTests ARMixSonKuP89NativeTests ARMixSonKuP90SourceTests ARMixSonKuP90NativeTests + 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_P83_NO_GUI_EXE" } + if ((Get-Item -LiteralPath $exe).Length -lt 4MB) { throw "SONKU_P83_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|P80TransparentBassStereoPhaseAndRoomDiagnostic|P82SixWallThreeBandRoomTimingDecayAndParity|P83RealtimeModeSourceAndMusicIntegrity|P83JuceV4AudioAckLegacyRestoreAndHeadYaw|P84SingleCoreMusicFidelityAndWorldYaw|P84JuceV5AudioAckLegacySafeRestore|P85WorldCoherentMidYawSourceAndFidelity|P85JuceV6AudioAckLegacySafeRestore|P86SixWallHorizontalFocusAndMusicIntegrity|P86JuceV7AudioAckAndV6Restore|P87MusicalAirBodyP86DryParityAndFdnBass|P87JuceV8AudioAppliedAckV7Restore|P88MeasuredEarHeightAndDistanceDrr|P88JuceV9AppliedAckAndV8Restore|P89RoomAnchoredStereoAndP88GoldenParity|P89JuceV10AppliedAckAndV9Restore|P90StereoExternalizationSource|P90JuceV11AppliedAckAndLegacyRestore)$' + 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_P83_ARTIFACT_SHA_MISMATCH" } + $p.fatStatus = 'FIELD_PREVIEW_FULL_CTEST_NOT_RUN' + $p | Add-Member -NotePropertyName sonkuExperiment -NotePropertyValue @{ + enabled = $true + nativeXYZ = $true + musicSafeStereo = $true + p8TransparentBass = $true + p82MultibandRoom = $true + p83NativeSpeakers = $false + p84FusedNative = $true + p85WorldLockedMid = $true + p86HorizontalFocus = $true + p87MusicalAirBody = $true + p88PerceptualAlignment = $true + p89StereoRoomDepth = $true + p90TrueExternalSpeaker = $true + p84RenderModes = @('MusicBedP82','MusicSpatialP84','MusicSpatialP85','MusicSpatialP86','MusicSpatialP87','MusicSpatialP88','MusicSpatialP89','MusicSpatialP90') + p83HeadYaw = 'DETERMINISTIC_MANUAL_NO_SENSOR' + p84FusionDifferenceHighpassHz = 750 + p84MeasuredHrirContrast = 0.12 + legacyP83V4Migration = 'OLD_SPEAKER_TO_P82' + p83AudioAppliedAck = $true + p83RealtimeModeCrossfade = '12ms_OUT_AND_IN_NATIVE_SINGLE_PCM_GRAPH' + p82RoomBandsHz = @(250,4800) + p82MaterialCalibration = 'ORIGINAL_ILLUSTRATIVE_NOT_MEASURED_RIR' + p82Rt60StudioSeconds = @(0.717,0.392,0.231) + p82Rt60ChamberSeconds = @(0.933,0.802,0.483) + p82Rt60HallSeconds = @(1.716,1.219,0.650) + p8LowBandCrossoverHz = 220 + musicSafeAlgorithm = 'MEASURED_CENTER_MID_PLUS_UNCONDITIONAL_STEREO_SIDE_RESEARCH' + stateSchema = 11 + fullWindowsExecutable = $true + publicRelease = $false + physicalAsioQualified = $false + dearVrPerceptualParityProven = $false + qualification = 'SONKU_P90_NATIVE_TWO_SPEAKER_COHERENT_PCM_JUCE_V11_FAT_PENDING' + licenseRedistributionApproval = $false + mitKemarNoticeSha256 = (Get-FileHash -LiteralPath docs/THIRD_PARTY_8D_SONKU_HRTF.md -Algorithm SHA256).Hash.ToLowerInvariant() + fieldFatGuideSha256 = (Get-FileHash -LiteralPath docs/SONKU_P90_TRUE_EXTERNAL_SPEAKER_FAT_20261115.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 + -not $p.sonkuExperiment.p8TransparentBass -or + -not $p.sonkuExperiment.p82MultibandRoom -or + -not $p.sonkuExperiment.p84FusedNative -or + -not $p.sonkuExperiment.p85WorldLockedMid -or + -not $p.sonkuExperiment.p86HorizontalFocus -or + -not $p.sonkuExperiment.p87MusicalAirBody -or + -not $p.sonkuExperiment.p88PerceptualAlignment -or + -not $p.sonkuExperiment.p89StereoRoomDepth -or + -not $p.sonkuExperiment.p90TrueExternalSpeaker -or + $p.sonkuExperiment.stateSchema -ne 11 -or $p.sonkuExperiment.publicRelease) { + throw 'SONKU_P90_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_P90_TRUE_EXTERNAL_SPEAKER_FAT_20261115.md -Destination dist/SONKU_P90_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_P90_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_P83_FIELD_NOTICE_MISSING:$($item.Key)" + } + $actual = (Get-FileHash -LiteralPath $file -Algorithm SHA256).Hash.ToLowerInvariant() + if ($actual -ne $item.Value) { throw "SONKU_P83_FIELD_NOTICE_HASH_MISMATCH:$($item.Key)" } + } + if (Test-Path -LiteralPath dist/Studio) { throw 'SONKU_FIELD_USER_DATA_MUST_NOT_SHIP' } + Write-Host 'SONKU_P90_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-P90-True-External-Speaker-Windows-x64-${{ github.run_id }} + path: dist/ + if-no-files-found: error + retention-days: 21 + compression-level: 0 + if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE } - name: Compile actual ARMixConsole Windows GUI and focused real JUCE tests shell: pwsh diff --git a/.github/workflows/sonku-p90-windows-field.yml b/.github/workflows/sonku-p90-windows-field.yml new file mode 100644 index 000000000..c3b922e23 --- /dev/null +++ b/.github/workflows/sonku-p90-windows-field.yml @@ -0,0 +1,464 @@ +name: SonKu P9.0 true external speaker native mixer portable FAT x64 +# Private JUCE app, no release. Native v11 A/B P8.2 through P9. +on: + workflow_call: + pull_request: + paths: + - '.github/workflows/sonku-p90-windows-field.yml' + workflow_dispatch: +permissions: + contents: read +concurrency: + group: sonku-p90-field-${{ 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: Strict P8.4 PCM timbre and spatial source qualification + run: | + set -euo pipefail + FLAGS="-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 -DSONKU_P80_TRANSPARENT_BASS_RESEARCH=1 -DSONKU_P82_MULTIBAND_ROOM_RESEARCH=1 -DSONKU_P83_PHYSICAL_SPEAKER_RESEARCH=1 -DSONKU_P84_SINGLE_CORE_FUSION_RESEARCH=1" + g++ $FLAGS tests/sonku_p84_fused_single_core_test.cpp -o /tmp/p84-native + /tmp/p84-native | tee /tmp/p84-source.log + grep -q '^PASS P84 SINGLE CORE:' /tmp/p84-source.log + g++ $FLAGS tests/sonku_p84_spatial_impulse_evidence_test.cpp -o /tmp/p84-spatial + /tmp/p84-spatial | tee /tmp/p84-spatial.log + grep -q '^PASS P84 SPATIAL SOURCE:' /tmp/p84-spatial.log + g++ $FLAGS tests/sonku_p84_live_v5_modes_source_test.cpp -o /tmp/p84-live-mode + /tmp/p84-live-mode | tee /tmp/p84-live-mode.log + grep -q '^PASS P84 V5 NATIVE SOURCE:' /tmp/p84-live-mode.log + g++ $FLAGS -DSONKU_P85_WORLD_COHERENCE_RESEARCH=1 tests/sonku_p85_world_locked_source_test.cpp -o /tmp/p85-source + /tmp/p85-source | tee /tmp/p85-source.log + grep -q '^PASS P85 WORLD LOCK:' /tmp/p85-source.log + g++ $FLAGS -DSONKU_P85_WORLD_COHERENCE_RESEARCH=1 -DSONKU_P86_HORIZONTAL_FOCUS_RESEARCH=1 tests/sonku_p86_horizontal_focus_native_source_test.cpp -o /tmp/p86-source + /tmp/p86-source | tee /tmp/p86-source.log + grep -q '^PASS P86 HORIZONTAL FOCUS:' /tmp/p86-source.log + g++ $FLAGS -DSONKU_P85_WORLD_COHERENCE_RESEARCH=1 -DSONKU_P86_HORIZONTAL_FOCUS_RESEARCH=1 -DSONKU_P87_MUSIC_BODY_RESEARCH=1 tests/sonku_p87_musical_air_body_source_test.cpp -o /tmp/p87-source + /tmp/p87-source | tee /tmp/p87-source.log + grep -q '^PASS P87 MUSICAL AIR BODY:' /tmp/p87-source.log + g++ $FLAGS -DSONKU_P85_WORLD_COHERENCE_RESEARCH=1 -DSONKU_P86_HORIZONTAL_FOCUS_RESEARCH=1 -DSONKU_P87_MUSIC_BODY_RESEARCH=1 -DSONKU_P88_PERCEPTUAL_ALIGNMENT_RESEARCH=1 tests/sonku_p88_height_distance_source_test.cpp -o /tmp/p88-source + /tmp/p88-source | tee /tmp/p88-source.log + grep -q '^PASS P88 HEIGHT DISTANCE:' /tmp/p88-source.log + g++ $FLAGS -DSONKU_P85_WORLD_COHERENCE_RESEARCH=1 -DSONKU_P86_HORIZONTAL_FOCUS_RESEARCH=1 -DSONKU_P87_MUSIC_BODY_RESEARCH=1 -DSONKU_P88_PERCEPTUAL_ALIGNMENT_RESEARCH=1 -DSONKU_P89_DEPTH_COHERENCE_RESEARCH=1 tests/sonku_p89_stereo_room_depth_source_test.cpp -o /tmp/p89-source + /tmp/p89-source | tee /tmp/p89-source.log + grep -q '^PASS P89 ROOM ANCHOR:' /tmp/p89-source.log + g++ $FLAGS -DSONKU_P85_WORLD_COHERENCE_RESEARCH=1 -DSONKU_P86_HORIZONTAL_FOCUS_RESEARCH=1 -DSONKU_P87_MUSIC_BODY_RESEARCH=1 -DSONKU_P88_PERCEPTUAL_ALIGNMENT_RESEARCH=1 -DSONKU_P89_DEPTH_COHERENCE_RESEARCH=1 -DSONKU_P90_TRUE_EXTERNAL_RESEARCH=1 tests/sonku_p90_true_external_source_test.cpp -o /tmp/p90-source + /tmp/p90-source | tee /tmp/p90-source.log + grep -q '^PASS P90 NATIVE PCM:' /tmp/p90-source.log + - name: Native JS and source GUI capability checks + run: | + set -euo pipefail + node --check site/preview-v2/assets/mixer-native-sonku.js + python - <<'PY' + import re + from pathlib import Path + for path in ("engine/builtin_fx/SonKuSpatialProcessor.h", + "engine/builtin_fx/sonku/SonKuSpatialCore.h"): + depth=0 + for line in Path(path).read_text().splitlines(): + if re.match(r'^\s*#\s*(?:if|ifdef|ifndef)\b',line): + depth+=1 + elif re.match(r'^\s*#\s*endif\b',line): + depth-=1 + assert depth>=0,(path,"excess endif") + assert depth==0,(path,"missing endif",depth) + print("P89_NATIVE_HEADER_PREPROCESSOR_BALANCED") + PY + grep -q 'r.schemaVersion===10' site/preview-v2/assets/mixer-native-sonku.js + grep -q 'r.schemaVersion===11' site/preview-v2/assets/mixer-native-sonku.js + grep -q 'p90TrueExternalSpeaker' src/Main.cpp + # A mode8 enum without fused FIR dispatch silently changes P8.8 timbre. + # This source contract prevents another fallback-to-wrong-kernel regression. + python - <<'PY' + from pathlib import Path + core=Path("engine/builtin_fx/sonku/SonKuSpatialCore.h").read_text() + section=core.split("if((p83Mode_==p83::Mode::MusicSpatialP84 ||",1)[1].split("p84MusicKernel_.merge(",1)[0] + assert "p83Mode_==p83::Mode::MusicSpatialP89 ||" in section + assert "p83Mode_==p83::Mode::MusicSpatialP88 ||" in section + print("SONKU_P89_NATIVE_FUSED_FIR_DISPATCH_VERIFIED") + PY + grep -q 'skHrtfAlign' 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 + 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 \ + -DSONKU_P80_TRANSPARENT_BASS_RESEARCH=1 \ + tests/sonku_p80_tonal_room_evidence_test.cpp -o /tmp/sonku-p80-evidence + /tmp/sonku-p80-evidence | tee /tmp/sonku-p80-acoustic-evidence.csv + grep -q '^PASS P8:' /tmp/sonku-p80-acoustic-evidence.csv + 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 \ + -DSONKU_P80_TRANSPARENT_BASS_RESEARCH=1 \ + -DSONKU_P82_MULTIBAND_ROOM_RESEARCH=1 \ + tests/sonku_p82_sixsurface_multiband_room_test.cpp -o /tmp/sonku-p82-room + /tmp/sonku-p82-room | tee /tmp/sonku-p82-room-evidence.csv + grep -q '^PASS P8.2:' /tmp/sonku-p82-room-evidence.csv + 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_P83_SOURCE_MISMATCH:$actual" + } + Write-Host "SONKU_P84_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 ` + -DARMIX_SONKU_EXPERIMENTAL_P8_TRANSPARENT_BASS=ON ` + -DARMIX_SONKU_EXPERIMENTAL_P82_ROOM=ON ` + -DARMIX_SONKU_EXPERIMENTAL_P83_NATIVE_RT=ON ` + -DARMIX_SONKU_EXPERIMENTAL_P84_NATIVE_RT=ON ` + -DARMIX_SONKU_EXPERIMENTAL_P85_NATIVE_RT=ON ` + -DARMIX_SONKU_EXPERIMENTAL_P86_NATIVE_RT=ON ` + -DARMIX_SONKU_EXPERIMENTAL_P87_NATIVE_RT=ON ` + -DARMIX_SONKU_EXPERIMENTAL_P88_NATIVE_RT=ON ` + -DARMIX_SONKU_EXPERIMENTAL_P89_NATIVE_RT=ON ` + -DARMIX_SONKU_EXPERIMENTAL_P90_NATIVE_RT=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' -or + $cache -notmatch 'ARMIX_SONKU_EXPERIMENTAL_P8_TRANSPARENT_BASS:BOOL=ON' -or + $cache -notmatch 'ARMIX_SONKU_EXPERIMENTAL_P82_ROOM:BOOL=ON' -or + $cache -notmatch 'ARMIX_SONKU_EXPERIMENTAL_P83_NATIVE_RT:BOOL=ON' -or + $cache -notmatch 'ARMIX_SONKU_EXPERIMENTAL_P84_NATIVE_RT:BOOL=ON' -or + $cache -notmatch 'ARMIX_SONKU_EXPERIMENTAL_P85_NATIVE_RT:BOOL=ON' -or + $cache -notmatch 'ARMIX_SONKU_EXPERIMENTAL_P86_NATIVE_RT:BOOL=ON' -or + $cache -notmatch 'ARMIX_SONKU_EXPERIMENTAL_P87_NATIVE_RT:BOOL=ON' -or + $cache -notmatch 'ARMIX_SONKU_EXPERIMENTAL_P88_NATIVE_RT:BOOL=ON' -or + $cache -notmatch 'ARMIX_SONKU_EXPERIMENTAL_P89_NATIVE_RT:BOOL=ON' -or + $cache -notmatch 'ARMIX_SONKU_EXPERIMENTAL_P90_NATIVE_RT:BOOL=ON') { + throw "SONKU_P83_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', + 'NativeSonKuP80TransparentBassStereoPhaseAndRoomDiagnostic', + 'NativeSonKuP82SixWallThreeBandRoomTimingDecayAndParity', + 'NativeSonKuP83RealtimeModeSourceAndMusicIntegrity', + 'NativeSonKuP83JuceV4AudioAckLegacyRestoreAndHeadYaw', + 'NativeSonKuP84SingleCoreMusicFidelityAndWorldYaw', + 'NativeSonKuP84JuceV5AudioAckLegacySafeRestore', + 'NativeSonKuP85WorldCoherentMidYawSourceAndFidelity', + 'NativeSonKuP85JuceV6AudioAckLegacySafeRestore', + 'NativeSonKuP86SixWallHorizontalFocusAndMusicIntegrity', + 'NativeSonKuP86JuceV7AudioAckAndV6Restore', + 'NativeSonKuP87MusicalAirBodyP86DryParityAndFdnBass', + 'NativeSonKuP87JuceV8AudioAppliedAckV7Restore', + 'NativeSonKuP88MeasuredEarHeightAndDistanceDrr', + 'NativeSonKuP88JuceV9AppliedAckAndV8Restore', + 'NativeSonKuP89RoomAnchoredStereoAndP88GoldenParity', + 'NativeSonKuP89JuceV10AppliedAckAndV9Restore', + 'NativeSonKuP90StereoExternalizationSource', + 'NativeSonKuP90JuceV11AppliedAckAndLegacyRestore') + $available = @($tests.tests | ForEach-Object { $_.name }) + foreach ($test in $required) { + if ($test -notin $available) { throw "SONKU_P82_MISSING_CTEST:$test" } + } + - name: Fail fast — compile and execute real JUCE v5 state + PCM ACK first + shell: pwsh + run: | + cmake --build build --config Release --parallel 2 --target ARMixSonKuP90NativeTests + if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE } + ctest --test-dir build -C Release --output-on-failure -R '^NativeSonKuP90JuceV11AppliedAckAndLegacyRestore + if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE } + - 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 ARMixSonKuP80TonalEvidenceTests ARMixSonKuP82RoomTests ARMixSonKuP83LiveSourceTests ARMixSonKuP83NativeTests ARMixSonKuP84LiveSourceTests ARMixSonKuP84NativeTests ARMixSonKuP85WorldSourceTests ARMixSonKuP85NativeTests ARMixSonKuP86FocusSourceTests ARMixSonKuP86NativeTests ARMixSonKuP87MusicSourceTests ARMixSonKuP87NativeTests ARMixSonKuP88SourceTests ARMixSonKuP88NativeTests ARMixSonKuP89SourceTests ARMixSonKuP89NativeTests ARMixSonKuP90SourceTests ARMixSonKuP90NativeTests + 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_P83_NO_GUI_EXE" } + if ((Get-Item -LiteralPath $exe).Length -lt 4MB) { throw "SONKU_P83_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|P80TransparentBassStereoPhaseAndRoomDiagnostic|P82SixWallThreeBandRoomTimingDecayAndParity|P83RealtimeModeSourceAndMusicIntegrity|P83JuceV4AudioAckLegacyRestoreAndHeadYaw|P84SingleCoreMusicFidelityAndWorldYaw|P84JuceV5AudioAckLegacySafeRestore|P85WorldCoherentMidYawSourceAndFidelity|P85JuceV6AudioAckLegacySafeRestore|P86SixWallHorizontalFocusAndMusicIntegrity|P86JuceV7AudioAckAndV6Restore|P87MusicalAirBodyP86DryParityAndFdnBass|P87JuceV8AudioAppliedAckV7Restore|P88MeasuredEarHeightAndDistanceDrr|P88JuceV9AppliedAckAndV8Restore|P89RoomAnchoredStereoAndP88GoldenParity|P89JuceV10AppliedAckAndV9Restore|P90StereoExternalizationSource|P90JuceV11AppliedAckAndLegacyRestore)$' + 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_P83_ARTIFACT_SHA_MISMATCH" } + $p.fatStatus = 'FIELD_PREVIEW_FULL_CTEST_NOT_RUN' + $p | Add-Member -NotePropertyName sonkuExperiment -NotePropertyValue @{ + enabled = $true + nativeXYZ = $true + musicSafeStereo = $true + p8TransparentBass = $true + p82MultibandRoom = $true + p83NativeSpeakers = $false + p84FusedNative = $true + p85WorldLockedMid = $true + p86HorizontalFocus = $true + p87MusicalAirBody = $true + p88PerceptualAlignment = $true + p89StereoRoomDepth = $true + p90TrueExternalSpeaker = $true + p84RenderModes = @('MusicBedP82','MusicSpatialP84','MusicSpatialP85','MusicSpatialP86','MusicSpatialP87','MusicSpatialP88','MusicSpatialP89','MusicSpatialP90') + p83HeadYaw = 'DETERMINISTIC_MANUAL_NO_SENSOR' + p84FusionDifferenceHighpassHz = 750 + p84MeasuredHrirContrast = 0.12 + legacyP83V4Migration = 'OLD_SPEAKER_TO_P82' + p83AudioAppliedAck = $true + p83RealtimeModeCrossfade = '12ms_OUT_AND_IN_NATIVE_SINGLE_PCM_GRAPH' + p82RoomBandsHz = @(250,4800) + p82MaterialCalibration = 'ORIGINAL_ILLUSTRATIVE_NOT_MEASURED_RIR' + p82Rt60StudioSeconds = @(0.717,0.392,0.231) + p82Rt60ChamberSeconds = @(0.933,0.802,0.483) + p82Rt60HallSeconds = @(1.716,1.219,0.650) + p8LowBandCrossoverHz = 220 + musicSafeAlgorithm = 'MEASURED_CENTER_MID_PLUS_UNCONDITIONAL_STEREO_SIDE_RESEARCH' + stateSchema = 11 + fullWindowsExecutable = $true + publicRelease = $false + physicalAsioQualified = $false + dearVrPerceptualParityProven = $false + qualification = 'SONKU_P90_NATIVE_TWO_SPEAKER_COHERENT_PCM_JUCE_V11_FAT_PENDING' + licenseRedistributionApproval = $false + mitKemarNoticeSha256 = (Get-FileHash -LiteralPath docs/THIRD_PARTY_8D_SONKU_HRTF.md -Algorithm SHA256).Hash.ToLowerInvariant() + fieldFatGuideSha256 = (Get-FileHash -LiteralPath docs/SONKU_P90_TRUE_EXTERNAL_SPEAKER_FAT_20261115.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 + -not $p.sonkuExperiment.p8TransparentBass -or + -not $p.sonkuExperiment.p82MultibandRoom -or + -not $p.sonkuExperiment.p84FusedNative -or + -not $p.sonkuExperiment.p85WorldLockedMid -or + -not $p.sonkuExperiment.p86HorizontalFocus -or + -not $p.sonkuExperiment.p87MusicalAirBody -or + -not $p.sonkuExperiment.p88PerceptualAlignment -or + -not $p.sonkuExperiment.p89StereoRoomDepth -or + -not $p.sonkuExperiment.p90TrueExternalSpeaker -or + $p.sonkuExperiment.stateSchema -ne 11 -or $p.sonkuExperiment.publicRelease) { + throw 'SONKU_P90_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_P90_TRUE_EXTERNAL_SPEAKER_FAT_20261115.md -Destination dist/SONKU_P90_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_P90_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_P83_FIELD_NOTICE_MISSING:$($item.Key)" + } + $actual = (Get-FileHash -LiteralPath $file -Algorithm SHA256).Hash.ToLowerInvariant() + if ($actual -ne $item.Value) { throw "SONKU_P83_FIELD_NOTICE_HASH_MISMATCH:$($item.Key)" } + } + if (Test-Path -LiteralPath dist/Studio) { throw 'SONKU_FIELD_USER_DATA_MUST_NOT_SHIP' } + Write-Host 'SONKU_P90_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-P90-True-External-Speaker-Windows-x64-${{ github.run_id }} + path: dist/ + if-no-files-found: error + retention-days: 21 + compression-level: 0 + + if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE } + - 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 ARMixSonKuP80TonalEvidenceTests ARMixSonKuP82RoomTests ARMixSonKuP83LiveSourceTests ARMixSonKuP83NativeTests ARMixSonKuP84LiveSourceTests ARMixSonKuP84NativeTests ARMixSonKuP85WorldSourceTests ARMixSonKuP85NativeTests ARMixSonKuP86FocusSourceTests ARMixSonKuP86NativeTests ARMixSonKuP87MusicSourceTests ARMixSonKuP87NativeTests ARMixSonKuP88SourceTests ARMixSonKuP88NativeTests ARMixSonKuP89SourceTests ARMixSonKuP89NativeTests + 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_P83_NO_GUI_EXE" } + if ((Get-Item -LiteralPath $exe).Length -lt 4MB) { throw "SONKU_P83_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|P80TransparentBassStereoPhaseAndRoomDiagnostic|P82SixWallThreeBandRoomTimingDecayAndParity|P83RealtimeModeSourceAndMusicIntegrity|P83JuceV4AudioAckLegacyRestoreAndHeadYaw|P84SingleCoreMusicFidelityAndWorldYaw|P84JuceV5AudioAckLegacySafeRestore|P85WorldCoherentMidYawSourceAndFidelity|P85JuceV6AudioAckLegacySafeRestore|P86SixWallHorizontalFocusAndMusicIntegrity|P86JuceV7AudioAckAndV6Restore|P87MusicalAirBodyP86DryParityAndFdnBass|P87JuceV8AudioAppliedAckV7Restore|P88MeasuredEarHeightAndDistanceDrr|P88JuceV9AppliedAckAndV8Restore|P89RoomAnchoredStereoAndP88GoldenParity|P89JuceV10AppliedAckAndV9Restore)$' + 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_P83_ARTIFACT_SHA_MISMATCH" } + $p.fatStatus = 'FIELD_PREVIEW_FULL_CTEST_NOT_RUN' + $p | Add-Member -NotePropertyName sonkuExperiment -NotePropertyValue @{ + enabled = $true + nativeXYZ = $true + musicSafeStereo = $true + p8TransparentBass = $true + p82MultibandRoom = $true + p83NativeSpeakers = $false + p84FusedNative = $true + p85WorldLockedMid = $true + p86HorizontalFocus = $true + p87MusicalAirBody = $true + p88PerceptualAlignment = $true + p89StereoRoomDepth = $true + p84RenderModes = @('MusicBedP82','MusicSpatialP84','MusicSpatialP85','MusicSpatialP86','MusicSpatialP87','MusicSpatialP88','MusicSpatialP89') + p83HeadYaw = 'DETERMINISTIC_MANUAL_NO_SENSOR' + p84FusionDifferenceHighpassHz = 750 + p84MeasuredHrirContrast = 0.12 + legacyP83V4Migration = 'OLD_SPEAKER_TO_P82' + p83AudioAppliedAck = $true + p83RealtimeModeCrossfade = '12ms_OUT_AND_IN_NATIVE_SINGLE_PCM_GRAPH' + p82RoomBandsHz = @(250,4800) + p82MaterialCalibration = 'ORIGINAL_ILLUSTRATIVE_NOT_MEASURED_RIR' + p82Rt60StudioSeconds = @(0.717,0.392,0.231) + p82Rt60ChamberSeconds = @(0.933,0.802,0.483) + p82Rt60HallSeconds = @(1.716,1.219,0.650) + p8LowBandCrossoverHz = 220 + musicSafeAlgorithm = 'MEASURED_CENTER_MID_PLUS_UNCONDITIONAL_STEREO_SIDE_RESEARCH' + stateSchema = 10 + fullWindowsExecutable = $true + publicRelease = $false + physicalAsioQualified = $false + dearVrPerceptualParityProven = $false + qualification = 'SONKU_P89_SCOPED_NATIVE_PCM_JUCE_20_CTESTS_HEADPHONE_FAT_PENDING' + licenseRedistributionApproval = $false + mitKemarNoticeSha256 = (Get-FileHash -LiteralPath docs/THIRD_PARTY_8D_SONKU_HRTF.md -Algorithm SHA256).Hash.ToLowerInvariant() + fieldFatGuideSha256 = (Get-FileHash -LiteralPath docs/SONKU_P89_ROOM_ANCHORED_STEREO_20261115.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 + -not $p.sonkuExperiment.p8TransparentBass -or + -not $p.sonkuExperiment.p82MultibandRoom -or + -not $p.sonkuExperiment.p84FusedNative -or + -not $p.sonkuExperiment.p85WorldLockedMid -or + -not $p.sonkuExperiment.p86HorizontalFocus -or + -not $p.sonkuExperiment.p87MusicalAirBody -or + -not $p.sonkuExperiment.p88PerceptualAlignment -or + -not $p.sonkuExperiment.p89StereoRoomDepth -or + $p.sonkuExperiment.stateSchema -ne 10 -or $p.sonkuExperiment.publicRelease) { + throw 'SONKU_P89_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_P89_ROOM_ANCHORED_STEREO_20261115.md -Destination dist/SONKU_P89_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_P89_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_P83_FIELD_NOTICE_MISSING:$($item.Key)" + } + $actual = (Get-FileHash -LiteralPath $file -Algorithm SHA256).Hash.ToLowerInvariant() + if ($actual -ne $item.Value) { throw "SONKU_P83_FIELD_NOTICE_HASH_MISMATCH:$($item.Key)" } + } + if (Test-Path -LiteralPath dist/Studio) { throw 'SONKU_FIELD_USER_DATA_MUST_NOT_SHIP' } + Write-Host 'SONKU_P89_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-P89-Room-Anchored-Stereo-Windows-x64-${{ github.run_id }} + path: dist/ + if-no-files-found: error + retention-days: 21 + compression-level: 0 diff --git a/CMakeLists.txt b/CMakeLists.txt index 1e7340aad..1d9ebab73 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -89,6 +89,13 @@ if(ARMIX_SONKU_EXPERIMENTAL_P89_NATIVE_RT AND NOT ARMIX_SONKU_EXPERIMENTAL_P88_NATIVE_RT) message(FATAL_ERROR "P8.9 requires P8.8 perceptual alignment") endif() +# P9.0 opt-in experiment. Production builds and previous P8.x modes remain OFF. +option(ARMIX_SONKU_EXPERIMENTAL_P90_NATIVE_RT + "Private P9 true external speaker two-source binaural PCM experiment" OFF) +if(ARMIX_SONKU_EXPERIMENTAL_P90_NATIVE_RT AND + NOT ARMIX_SONKU_EXPERIMENTAL_P89_NATIVE_RT) + message(FATAL_ERROR "P9.0 requires P8.9 research branch baseline") +endif() set(CMAKE_CXX_STANDARD 20) set(CMAKE_CXX_STANDARD_REQUIRED ON) @@ -303,7 +310,9 @@ target_compile_definitions(ARMixConsole PRIVATE $<$:ARMIX_SONKU_EXPERIMENTAL_P88_NATIVE_RT=1> $<$:SONKU_P88_PERCEPTUAL_ALIGNMENT_RESEARCH=1> $<$:ARMIX_SONKU_EXPERIMENTAL_P89_NATIVE_RT=1> - $<$:SONKU_P89_DEPTH_COHERENCE_RESEARCH=1>) + $<$:SONKU_P89_DEPTH_COHERENCE_RESEARCH=1> + $<$:ARMIX_SONKU_EXPERIMENTAL_P90_NATIVE_RT=1> + $<$:SONKU_P90_TRUE_EXTERNAL_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. @@ -763,6 +772,61 @@ if(BUILD_TESTING) SONKU_P89_DEPTH_COHERENCE_RESEARCH=1) add_test(NAME NativeSonKuP89JuceV10AppliedAckAndV9Restore COMMAND ARMixSonKuP89NativeTests) + if(ARMIX_SONKU_EXPERIMENTAL_P90_NATIVE_RT) + add_executable(ARMixSonKuP90SourceTests + tests/sonku_p90_true_external_source_test.cpp) + target_compile_features(ARMixSonKuP90SourceTests PRIVATE cxx_std_20) + target_compile_definitions(ARMixSonKuP90SourceTests 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 + SONKU_P80_TRANSPARENT_BASS_RESEARCH=1 + SONKU_P82_MULTIBAND_ROOM_RESEARCH=1 + SONKU_P83_PHYSICAL_SPEAKER_RESEARCH=1 + SONKU_P84_SINGLE_CORE_FUSION_RESEARCH=1 + SONKU_P85_WORLD_COHERENCE_RESEARCH=1 + SONKU_P86_HORIZONTAL_FOCUS_RESEARCH=1 + SONKU_P87_MUSIC_BODY_RESEARCH=1 + SONKU_P88_PERCEPTUAL_ALIGNMENT_RESEARCH=1 + SONKU_P89_DEPTH_COHERENCE_RESEARCH=1 + SONKU_P90_TRUE_EXTERNAL_RESEARCH=1) + add_test(NAME NativeSonKuP90StereoExternalizationSource + COMMAND ARMixSonKuP90SourceTests) + juce_add_console_app(ARMixSonKuP90NativeTests + PRODUCT_NAME "ArSonMix SonKu P90 JUCE v11 State Tests") + target_sources(ARMixSonKuP90NativeTests PRIVATE + tests/sonku_p90_native_juce_v11_test.cpp) + target_compile_features(ARMixSonKuP90NativeTests PRIVATE cxx_std_20) + target_link_libraries(ARMixSonKuP90NativeTests PRIVATE + juce::juce_audio_processors juce::juce_recommended_config_flags) + target_compile_definitions(ARMixSonKuP90NativeTests PRIVATE + ARMIX_SONKU_EXPERIMENTAL_NATIVE_XYZ_RT=1 + ARMIX_SONKU_EXPERIMENTAL_P83_NATIVE_RT=1 + ARMIX_SONKU_EXPERIMENTAL_P84_NATIVE_RT=1 + ARMIX_SONKU_EXPERIMENTAL_P85_NATIVE_RT=1 + ARMIX_SONKU_EXPERIMENTAL_P86_NATIVE_RT=1 + ARMIX_SONKU_EXPERIMENTAL_P87_NATIVE_RT=1 + ARMIX_SONKU_EXPERIMENTAL_P88_NATIVE_RT=1 + ARMIX_SONKU_EXPERIMENTAL_P89_NATIVE_RT=1 + ARMIX_SONKU_EXPERIMENTAL_P90_NATIVE_RT=1 + SONKU_P7_MEASURED_ELEVATION_RESEARCH=1 + SONKU_P71_DIRECT_XYZ_RESEARCH=1 + SONKU_P72_NATIVE_XYZ_RT=1 + SONKU_P75_MUSIC_SAFE_RESEARCH=1 + SONKU_P80_TRANSPARENT_BASS_RESEARCH=1 + SONKU_P82_MULTIBAND_ROOM_RESEARCH=1 + SONKU_P83_PHYSICAL_SPEAKER_RESEARCH=1 + SONKU_P84_SINGLE_CORE_FUSION_RESEARCH=1 + SONKU_P85_WORLD_COHERENCE_RESEARCH=1 + SONKU_P86_HORIZONTAL_FOCUS_RESEARCH=1 + SONKU_P87_MUSIC_BODY_RESEARCH=1 + SONKU_P88_PERCEPTUAL_ALIGNMENT_RESEARCH=1 + SONKU_P89_DEPTH_COHERENCE_RESEARCH=1 + SONKU_P90_TRUE_EXTERNAL_RESEARCH=1) + add_test(NAME NativeSonKuP90JuceV11AppliedAckAndLegacyRestore + COMMAND ARMixSonKuP90NativeTests) + endif() endif() endif() endif() diff --git a/docs/SONKU_P90_TRUE_EXTERNAL_SPEAKER_FAT_20261115.md b/docs/SONKU_P90_TRUE_EXTERNAL_SPEAKER_FAT_20261115.md new file mode 100644 index 000000000..f9fd0e035 --- /dev/null +++ b/docs/SONKU_P90_TRUE_EXTERNAL_SPEAKER_FAT_20261115.md @@ -0,0 +1,50 @@ +# SonKu P9.0 — Native Stereo External Speaker Candidate (DRAFT, 2026-11-15) + +## Scope and version control + +New opt-in `MusicSpatialP90 = 9`, on the exact draft P8.9 branch lineage. All SonKu P8.2–P8.9 modes and current production mixer GUI/routing remain separate. No merge, public release, or subjective claim is authorized. Current `main` has the separate #713 audio-device continuity fixes: P9 source branch is deliberately **not** a substitute for #713 and must not be blindly merged to `main`. + +## Why P8.9 is not enough + +P8.4-P8.9 use `Hc + 0.12 HP750(Hspeaker-Hc)` and independently add wide stereo SIDE (HP220) directly to headphone L/R. At 6.7m the SIDE retains approximately 1x original near-field energy while directional direct speaker is reduced by ~0.42x. The resulting treble remains ear-locked even when virtual speakers rotate, while early reflection gains are comparatively modest. Merely raising 0.12 would reproduce untested P8.3 music damage. + +## New native DSP: coherent directional transfer + +P9 bypasses **only in new mode 9** the old P8.4 12%-contrast kernel blending and after-FIR headphone SIDE rescue. It uses the same single 2×2 native FIR mixer, with full MIT KEMAR measured directional kernels (`H_L,H_R`) and measured midpoint kernel `H_c`. Each kernel is a real impulse response encoding complex frequency response and ITD. Let `c` be a gently smoothed 0..1 positive interchannel-coherence evidence, initialized to 1. At every existing 16-frame FIR retarget: + +``` +A = (H_L + H_R)/2 +H'_L = H_L + c*(H_c - A) +H'_R = H_R + c*(H_c - A) +Y = H'_L * L + H'_R * R + = [H_L + H_R + 2c(H_c-A)]*M + [H_L-H_R]*S +where M=(L+R)/2, S=(L-R)/2 +``` + +The stereo SIDE transfer **does not depend on `c`**. At `c=1`, equal L/R produces exactly the measured center HRIR without a dual-speaker correlated-MID comb. At `c=0`, independent channel sources see their full measured speaker responses. No second renderer, extra audio callback, minimum-phase replacement, spectral high bypass, or anti-phase correlation gate. `c` uses 80ms input correlation evidence, a 120ms response, and one square root per 16-frame retarget; all state fixed-size and allocated before audio. All kernel coefficients continue using the original per-sample slew. + +Important physical degenerate case: stereo **0° angle** places two identical real speakers at the same point. Opposite-polarity inputs then cancel at the source; no physically honest linear two-source binaural renderer can simultaneously make their contributions fully independent and render them as exactly co-located. Use 60–180° for nonzero anti-phase localization; do not falsely promise anti-phase retention at 0°. The GUI explicitly says so. + +## Existing model retained, limitations and follow-up + +P9 currently retains P8.9 distance-to-direct/LF gain, world-head yaw, measured spectral elevation trim, six-wall directional early field, and late FDN. It uses the existing P8.9 long-distance early/diffuse ratio. No fresh spectral HRIR time alignment, phase-aware angular interpolation, personalized HRTF, headphone calibration, BRIR room measurement, or optimized room-distance model has been proven yet. It is an **architectural first candidate**, not the completed 100%-immersive target. + +## Objective qualification + +The new native PCM test uses 44.1/48k; 64/128/256 buffer-invariant output; source L-only, R-only, correlated MID, anti-phase and complex stereo; azimuth, head yaw, 60/104/180° angles; 1.6/6.7/10m scenes; nonzero finite output, no >0.98 peak, changing PCM vs P8.9, HRTF kernel algebra. Existing P8.4–P8.9 regression suites remain mandatory. Native JUCE v11 test covers GUI/bridge-compatible schema, applied ACK, output PCM and unchanged v1..v10 state restores. CPU profiling, HRIR directional ILD/ITD curves, DRR/IACC, and genuine physical ASIO are **not yet qualified**. + +## Headphone FAT + +1. Run an isolated Windows x64 portable candidate with no other spatial FX enabled, stereo headphones, and equal RMS loudness. +2. Compare P8.4, P8.7, P8.8, P8.9, P9 at 1.6/3/6.7m and 60/104/180° angle. Use the same full-range stereo reference and anti-phase/detail torture material. +3. Test stationary and slow yaw -90/0/+90 and elevation 0/±10° with ear-height spectral trim. Confirm each speaker and all treble actually rotate in WORLD. +4. Rate vocal center naturalness, treble source localization outside head, bass body, width, ceiling/floor confusion, silence, transient smear, and long-distance perception. Record precise settings and the source commit; do not equate passing CTest with perceptual dearVR parity. +5. Verify session close/reopen and device dis/reconnect separately against the #713 integrated `main` source before merging any acoustic patch. + +## Publicly documented research reference + +- Best et al. (2020), *Sound Externalization: A Review of Recent Research*, https://pmc.ncbi.nlm.nih.gov/articles/PMC7488874/ +- dearVR PRO 2 user manual (2024), https://files.plugin-alliance.com/products/dearvr-pro-2/dearvr-pro-2_manual.pdf — reflections, room and distance externalization +- Sennheiser AMBEO CLARITY guide, https://help.sennheiser.com/hc/en-us/articles/27424692616594-How-to-produce-natural-immersive-music-with-the-CLARITY-modul-of-dearVR-PRO2 — perceptual localization/tonal tradeoff + +This method is original engineering of public binaural principles, **not** a claim about proprietary dearVR internal code. diff --git a/engine/builtin_fx/SonKuSpatialProcessor.h b/engine/builtin_fx/SonKuSpatialProcessor.h index e762a02da..6ed46528f 100644 --- a/engine/builtin_fx/SonKuSpatialProcessor.h +++ b/engine/builtin_fx/SonKuSpatialProcessor.h @@ -163,7 +163,11 @@ class SonKuSpatialProcessor final : public juce::AudioProcessor, #if defined(ARMIX_SONKU_EXPERIMENTAL_P87_NATIVE_RT) && ARMIX_SONKU_EXPERIMENTAL_P87_NATIVE_RT #if defined(ARMIX_SONKU_EXPERIMENTAL_P88_NATIVE_RT) && ARMIX_SONKU_EXPERIMENTAL_P88_NATIVE_RT #if defined(ARMIX_SONKU_EXPERIMENTAL_P89_NATIVE_RT) && ARMIX_SONKU_EXPERIMENTAL_P89_NATIVE_RT +#if defined(ARMIX_SONKU_EXPERIMENTAL_P90_NATIVE_RT) && ARMIX_SONKU_EXPERIMENTAL_P90_NATIVE_RT + out.writeInt(11); // unchanged 63-byte state; P9 mode 9 +#else out.writeInt(10); // 63 bytes v9 layout, opt-in mode 8 +#endif #else out.writeInt(9); // v8 59-byte state + 4-byte HRTF trim #endif @@ -247,6 +251,9 @@ class SonKuSpatialProcessor final : public juce::AudioProcessor, &&version!=9 #if defined(ARMIX_SONKU_EXPERIMENTAL_P89_NATIVE_RT) && ARMIX_SONKU_EXPERIMENTAL_P89_NATIVE_RT &&version!=10 +#if defined(ARMIX_SONKU_EXPERIMENTAL_P90_NATIVE_RT) && ARMIX_SONKU_EXPERIMENTAL_P90_NATIVE_RT + &&version!=11 +#endif #endif #endif #endif @@ -272,6 +279,9 @@ class SonKuSpatialProcessor final : public juce::AudioProcessor, ||(version==9&&size!=63) #if defined(ARMIX_SONKU_EXPERIMENTAL_P89_NATIVE_RT) && ARMIX_SONKU_EXPERIMENTAL_P89_NATIVE_RT ||(version==10&&size!=63) +#if defined(ARMIX_SONKU_EXPERIMENTAL_P90_NATIVE_RT) && ARMIX_SONKU_EXPERIMENTAL_P90_NATIVE_RT + ||(version==11&&size!=63) +#endif #endif #endif #endif @@ -352,6 +362,13 @@ class SonKuSpatialProcessor final : public juce::AudioProcessor, next.renderMode!=4 && next.renderMode!=5 && next.renderMode!=6 && next.renderMode!=7 && next.renderMode!=8)return false; if(version==10 && next.musicCompatibleLowFrequency)return false; +#if defined(ARMIX_SONKU_EXPERIMENTAL_P90_NATIVE_RT) && ARMIX_SONKU_EXPERIMENTAL_P90_NATIVE_RT + if(version==11 && next.renderMode!=0 && next.renderMode!=3 && + next.renderMode!=4 && next.renderMode!=5 && next.renderMode!=6 && + next.renderMode!=7 && next.renderMode!=8 && next.renderMode!=9) + return false; + if(version==11 && next.musicCompatibleLowFrequency)return false; +#endif #endif #endif #endif diff --git a/engine/builtin_fx/sonku/SonKuEarlyReflections.h b/engine/builtin_fx/sonku/SonKuEarlyReflections.h index 07658b42a..46209c6b8 100644 --- a/engine/builtin_fx/sonku/SonKuEarlyReflections.h +++ b/engine/builtin_fx/sonku/SonKuEarlyReflections.h @@ -458,6 +458,8 @@ class SonKuEarlyReflections final { return history_[source][i0]*(1.f-fract)+history_[source][i1]*fract; } void updateGeometry(double azimuth,float spread,float headYawDegrees) noexcept { + // Used only by world-yaw research variants; keep P6/P8.4 -Werror builds valid. + (void)headYawDegrees; constexpr float pi=3.14159265358979323846f; const float sourceDistance=custom_?geometry_.distanceMeters:1.60f; // The existing four-wall path stays bit-exact at equal source/ear diff --git a/engine/builtin_fx/sonku/SonKuP83SpeakerScene.h b/engine/builtin_fx/sonku/SonKuP83SpeakerScene.h index 3b7e3781e..2820af40f 100644 --- a/engine/builtin_fx/sonku/SonKuP83SpeakerScene.h +++ b/engine/builtin_fx/sonku/SonKuP83SpeakerScene.h @@ -20,6 +20,9 @@ enum class Mode : std::uint8_t { ,MusicSpatialP88=7 #if defined(SONKU_P89_DEPTH_COHERENCE_RESEARCH) && SONKU_P89_DEPTH_COHERENCE_RESEARCH ,MusicSpatialP89=8 +#if defined(SONKU_P90_TRUE_EXTERNAL_RESEARCH) && SONKU_P90_TRUE_EXTERNAL_RESEARCH + ,MusicSpatialP90=9 +#endif #endif #endif #endif @@ -43,6 +46,9 @@ inline bool valid(Mode m) noexcept { || m==Mode::MusicSpatialP88 #if defined(SONKU_P89_DEPTH_COHERENCE_RESEARCH) && SONKU_P89_DEPTH_COHERENCE_RESEARCH || m==Mode::MusicSpatialP89 +#if defined(SONKU_P90_TRUE_EXTERNAL_RESEARCH) && SONKU_P90_TRUE_EXTERNAL_RESEARCH + || m==Mode::MusicSpatialP90 +#endif #endif #endif #endif diff --git a/engine/builtin_fx/sonku/SonKuP90StereoDecoder.h b/engine/builtin_fx/sonku/SonKuP90StereoDecoder.h new file mode 100644 index 000000000..f760c673d --- /dev/null +++ b/engine/builtin_fx/sonku/SonKuP90StereoDecoder.h @@ -0,0 +1,67 @@ +// SPDX-License-Identifier: AGPL-3.0-only +#pragma once +#include +#include +#include +#include + +// SonKu P9 opt-in: complex-coherent two-speaker transfer represented as +// two real FIRs per input. No separate audio engine, HRTF bypass or dry SIDE. +// Measured HRIR kernels contain the complex magnitude/phase relationships; +// the same real coefficient correction to both emitters alters only MID, +// while the full measured L-R SIDE transfer is algebraically invariant. +// +// For input L=M+S, R=M-S, output at either ear is +// [H_L+H_R + 2*c*(H_center-(H_L+H_R)/2)]*M + +// [H_L-H_R]*S. At c=1, coherent mono is precisely 2*H_center*M; +// anti-phase retains full measured (H_L-H_R)*S at ALL c. +// No frequency-domain phase reconstruction or additional convolution. +namespace armix::sonku::p90 { +class StereoDecoder final { +public: + bool prepare(double rate) noexcept { + if (!std::isfinite(rate) || rate < 44000. || rate > 48100.) return false; + evidenceAlpha_=static_cast(1.-std::exp(-1./(rate*.080))); + smoothAlpha_=static_cast(1.-std::exp(-16./(rate*.120))); + reset(); + return true; + } + void reset() noexcept { + energyLeft_=energyRight_=cross_=0.f; + centerBlend_=1.f; // safe mono on first transient / cold prepare + } + void observe(float left,float right) noexcept { + const float l=std::clamp(left,-4.f,4.f); + const float r=std::clamp(right,-4.f,4.f); + energyLeft_+=evidenceAlpha_*(l*l-energyLeft_); + energyRight_+=evidenceAlpha_*(r*r-energyRight_); + cross_+=evidenceAlpha_*(l*r-cross_); + } + float centerBlend() noexcept { + // 1 sqrt per 16-sample FIR retarget, not each PCM sample. + if(energyLeft_>1.e-8f || energyRight_>1.e-8f) { + const float den=std::sqrt(std::max(energyLeft_*energyRight_,1.e-14f)); + const float rho=std::clamp(cross_/den,-1.f,1.f); + const float target=std::clamp((rho-.25f)/.70f,0.f,1.f); + centerBlend_+=smoothAlpha_*(target-centerBlend_); + } + return std::clamp(centerBlend_,0.f,1.f); + } + template + void compose(const std::array,2>& center, + std::array,2>& left, + std::array,2>& right) noexcept { + const float c=centerBlend(); + for(std::size_t ear=0;ear<2;++ear) + for(std::size_t k=0;k9) || !s.musicCompatibleLowFrequency) && +#else s.renderMode<=8 && ((s.renderMode!=3 && s.renderMode!=4 && s.renderMode!=5 && s.renderMode!=6 && s.renderMode!=7 && s.renderMode!=8) || !s.musicCompatibleLowFrequency) && +#endif #else s.renderMode<=7 && ((s.renderMode!=3 && s.renderMode!=4 && s.renderMode!=5 && s.renderMode!=6 && s.renderMode!=7) || !s.musicCompatibleLowFrequency) && #endif @@ -124,6 +131,9 @@ inline bool valid(const Settings& s) noexcept { ((s.renderMode!=7 #if defined(SONKU_P89_DEPTH_COHERENCE_RESEARCH) && SONKU_P89_DEPTH_COHERENCE_RESEARCH && s.renderMode!=8 +#if defined(SONKU_P90_TRUE_EXTERNAL_RESEARCH) && SONKU_P90_TRUE_EXTERNAL_RESEARCH + && s.renderMode!=9 +#endif #endif ) || (s.directElevationDegrees+s.hrtfElevationTrimDegrees>=-40.f && s.directElevationDegrees+s.hrtfElevationTrimDegrees<=60.f)) && @@ -190,6 +200,9 @@ class SonKuSpatialCore final { #endif #if defined(SONKU_P84_SINGLE_CORE_FUSION_RESEARCH) && SONKU_P84_SINGLE_CORE_FUSION_RESEARCH if(!p84MusicKernel_.prepare(rate))return false; +#if defined(SONKU_P90_TRUE_EXTERNAL_RESEARCH) && SONKU_P90_TRUE_EXTERNAL_RESEARCH + if(!p90Decoder_.prepare(rate))return false; +#endif #endif #if defined(SONKU_P87_MUSIC_BODY_RESEARCH) && SONKU_P87_MUSIC_BODY_RESEARCH if(!p87Body_.prepare(rate))return false; @@ -254,6 +267,9 @@ class SonKuSpatialCore final { room_.reset(); reverb_.reset(); integrity_.reset(); +#if defined(SONKU_P90_TRUE_EXTERNAL_RESEARCH) && SONKU_P90_TRUE_EXTERNAL_RESEARCH + p90Decoder_.reset(); +#endif #if defined(SONKU_P83_PHYSICAL_SPEAKER_RESEARCH) && SONKU_P83_PHYSICAL_SPEAKER_RESEARCH p83LowFrequency_.reset(); #endif @@ -484,6 +500,9 @@ class SonKuSpatialCore final { && p83Mode_!=p83::Mode::MusicSpatialP88 #if defined(SONKU_P89_DEPTH_COHERENCE_RESEARCH) && SONKU_P89_DEPTH_COHERENCE_RESEARCH && p83Mode_!=p83::Mode::MusicSpatialP89 +#if defined(SONKU_P90_TRUE_EXTERNAL_RESEARCH) && SONKU_P90_TRUE_EXTERNAL_RESEARCH + && p83Mode_!=p83::Mode::MusicSpatialP90 +#endif #endif #endif #endif @@ -526,6 +545,9 @@ class SonKuSpatialCore final { || p83Mode_==p83::Mode::MusicSpatialP88 #if defined(SONKU_P89_DEPTH_COHERENCE_RESEARCH) && SONKU_P89_DEPTH_COHERENCE_RESEARCH || p83Mode_==p83::Mode::MusicSpatialP89 +#if defined(SONKU_P90_TRUE_EXTERNAL_RESEARCH) && SONKU_P90_TRUE_EXTERNAL_RESEARCH + || p83Mode_==p83::Mode::MusicSpatialP90 +#endif #endif #endif #endif @@ -544,6 +566,9 @@ class SonKuSpatialCore final { || p83Mode_==p83::Mode::MusicSpatialP88 #if defined(SONKU_P89_DEPTH_COHERENCE_RESEARCH) && SONKU_P89_DEPTH_COHERENCE_RESEARCH || p83Mode_==p83::Mode::MusicSpatialP89 +#if defined(SONKU_P90_TRUE_EXTERNAL_RESEARCH) && SONKU_P90_TRUE_EXTERNAL_RESEARCH + || p83Mode_==p83::Mode::MusicSpatialP90 +#endif #endif #endif #endif @@ -554,6 +579,9 @@ class SonKuSpatialCore final { || p83Mode_==p83::Mode::MusicSpatialP88 #if defined(SONKU_P89_DEPTH_COHERENCE_RESEARCH) && SONKU_P89_DEPTH_COHERENCE_RESEARCH || p83Mode_==p83::Mode::MusicSpatialP89 +#if defined(SONKU_P90_TRUE_EXTERNAL_RESEARCH) && SONKU_P90_TRUE_EXTERNAL_RESEARCH + || p83Mode_==p83::Mode::MusicSpatialP90 +#endif #endif #endif ; @@ -570,6 +598,9 @@ class SonKuSpatialCore final { ((p83Mode_==p83::Mode::MusicSpatialP88 #if defined(SONKU_P89_DEPTH_COHERENCE_RESEARCH) && SONKU_P89_DEPTH_COHERENCE_RESEARCH || p83Mode_==p83::Mode::MusicSpatialP89 +#if defined(SONKU_P90_TRUE_EXTERNAL_RESEARCH) && SONKU_P90_TRUE_EXTERNAL_RESEARCH + || p83Mode_==p83::Mode::MusicSpatialP90 +#endif #endif )?0.27f:0.13f)* #else @@ -583,6 +614,9 @@ class SonKuSpatialCore final { (p83Mode_==p83::Mode::MusicSpatialP88 #if defined(SONKU_P89_DEPTH_COHERENCE_RESEARCH) && SONKU_P89_DEPTH_COHERENCE_RESEARCH || p83Mode_==p83::Mode::MusicSpatialP89 +#if defined(SONKU_P90_TRUE_EXTERNAL_RESEARCH) && SONKU_P90_TRUE_EXTERNAL_RESEARCH + || p83Mode_==p83::Mode::MusicSpatialP90 +#endif #endif )? 1.f/(1.f+0.10f*(settings_.sourceDistanceMeters-1.6f)):1.f; @@ -590,7 +624,11 @@ class SonKuSpatialCore final { #if defined(SONKU_P89_DEPTH_COHERENCE_RESEARCH) && SONKU_P89_DEPTH_COHERENCE_RESEARCH // Room-energy transfer is computed once per callback block; no new // FIR/filter memory. 1.6m/ROOM OFF keeps exact P8.8 PCM. - const bool p89Stage=p83Mode_==p83::Mode::MusicSpatialP89; + const bool p89Stage=p83Mode_==p83::Mode::MusicSpatialP89 +#if defined(SONKU_P90_TRUE_EXTERNAL_RESEARCH) && SONKU_P90_TRUE_EXTERNAL_RESEARCH + ||p83Mode_==p83::Mode::MusicSpatialP90 +#endif + ; const float p89Depth=p89Stage&&roomEnabled? std::clamp((settings_.sourceDistanceMeters-1.6f)/6.4f,0.f,1.f):0.f; const float p89SideGain=1.f-.22f*p89Depth; @@ -621,6 +659,9 @@ class SonKuSpatialCore final { } const float x0=std::isfinite(left[i])?left[i]:0.f; const float x1=monoObject?0.f:(std::isfinite(right[i])?right[i]:0.f); +#if defined(SONKU_P90_TRUE_EXTERNAL_RESEARCH) && SONKU_P90_TRUE_EXTERNAL_RESEARCH + if(p83Mode_==p83::Mode::MusicSpatialP90)p90Decoder_.observe(x0,x1); +#endif // 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. @@ -656,6 +697,9 @@ class SonKuSpatialCore final { // Headlocked SIDE is kept >=78% at maximum distance; early // world-locked measured reflections shoulder the extra space. sideRescue*=p89SideGain; +#if defined(SONKU_P90_TRUE_EXTERNAL_RESEARCH) && SONKU_P90_TRUE_EXTERNAL_RESEARCH + if(p83Mode_==p83::Mode::MusicSpatialP90)sideRescue=0.f; +#endif #endif history_[0][write_]=x0; history_[1][write_]=x1; @@ -910,6 +954,9 @@ class SonKuSpatialCore final { || ((p83Mode_==p83::Mode::MusicSpatialP88 #if defined(SONKU_P89_DEPTH_COHERENCE_RESEARCH) && SONKU_P89_DEPTH_COHERENCE_RESEARCH || p83Mode_==p83::Mode::MusicSpatialP89 +#if defined(SONKU_P90_TRUE_EXTERNAL_RESEARCH) && SONKU_P90_TRUE_EXTERNAL_RESEARCH + || p83Mode_==p83::Mode::MusicSpatialP90 +#endif #endif ) && settings_.hrtfElevationTrimDegrees!=0.f) @@ -922,6 +969,9 @@ class SonKuSpatialCore final { +((p83Mode_==p83::Mode::MusicSpatialP88 #if defined(SONKU_P89_DEPTH_COHERENCE_RESEARCH) && SONKU_P89_DEPTH_COHERENCE_RESEARCH || p83Mode_==p83::Mode::MusicSpatialP89 +#if defined(SONKU_P90_TRUE_EXTERNAL_RESEARCH) && SONKU_P90_TRUE_EXTERNAL_RESEARCH + || p83Mode_==p83::Mode::MusicSpatialP90 +#endif #endif )? settings_.hrtfElevationTrimDegrees:0.f) @@ -966,6 +1016,9 @@ class SonKuSpatialCore final { && p83Mode_!=p83::Mode::MusicSpatialP88 #if defined(SONKU_P89_DEPTH_COHERENCE_RESEARCH) && SONKU_P89_DEPTH_COHERENCE_RESEARCH && p83Mode_!=p83::Mode::MusicSpatialP89 +#if defined(SONKU_P90_TRUE_EXTERNAL_RESEARCH) && SONKU_P90_TRUE_EXTERNAL_RESEARCH + && p83Mode_!=p83::Mode::MusicSpatialP90 +#endif #endif #endif #endif @@ -1004,6 +1057,9 @@ class SonKuSpatialCore final { p83Mode_==p83::Mode::MusicSpatialP88 || #if defined(SONKU_P89_DEPTH_COHERENCE_RESEARCH) && SONKU_P89_DEPTH_COHERENCE_RESEARCH p83Mode_==p83::Mode::MusicSpatialP89 || +#if defined(SONKU_P90_TRUE_EXTERNAL_RESEARCH) && SONKU_P90_TRUE_EXTERNAL_RESEARCH + p83Mode_==p83::Mode::MusicSpatialP90 || +#endif #endif #endif #endif @@ -1029,6 +1085,9 @@ class SonKuSpatialCore final { || p83Mode_==p83::Mode::MusicSpatialP88 #if defined(SONKU_P89_DEPTH_COHERENCE_RESEARCH) && SONKU_P89_DEPTH_COHERENCE_RESEARCH || p83Mode_==p83::Mode::MusicSpatialP89 +#if defined(SONKU_P90_TRUE_EXTERNAL_RESEARCH) && SONKU_P90_TRUE_EXTERNAL_RESEARCH + || p83Mode_==p83::Mode::MusicSpatialP90 +#endif #endif #endif #endif @@ -1042,7 +1101,12 @@ class SonKuSpatialCore final { settings_.stereoSpreadDegrees,p83HeadYaw_); interpolate(targets_[0],positions.leftHead); interpolate(targets_[1],positions.rightHead); - p84MusicKernel_.merge(centerTarget_,targets_[0],targets_[1]); +#if defined(SONKU_P90_TRUE_EXTERNAL_RESEARCH) && SONKU_P90_TRUE_EXTERNAL_RESEARCH + if(p83Mode_==p83::Mode::MusicSpatialP90) + p90Decoder_.compose(centerTarget_,targets_[0],targets_[1]); + else +#endif + p84MusicKernel_.merge(centerTarget_,targets_[0],targets_[1]); if(!haveKernel_)kernels_=targets_; haveKernel_=true; return; @@ -1136,6 +1200,9 @@ class SonKuSpatialCore final { #endif #if defined(SONKU_P84_SINGLE_CORE_FUSION_RESEARCH) && SONKU_P84_SINGLE_CORE_FUSION_RESEARCH p84::FusedMusicHrir p84MusicKernel_{}; +#if defined(SONKU_P90_TRUE_EXTERNAL_RESEARCH) && SONKU_P90_TRUE_EXTERNAL_RESEARCH + p90::StereoDecoder p90Decoder_{}; +#endif #if defined(SONKU_P87_MUSIC_BODY_RESEARCH) && SONKU_P87_MUSIC_BODY_RESEARCH p87::MusicalAirBody p87Body_{}; #endif diff --git a/site/preview-v2/assets/mixer-native-sonku.js b/site/preview-v2/assets/mixer-native-sonku.js index e5d6c1428..5ad8c9597 100644 --- a/site/preview-v2/assets/mixer-native-sonku.js +++ b/site/preview-v2/assets/mixer-native-sonku.js @@ -14,7 +14,7 @@ const elevationLimits=s=>{ const distance=s.sourceDistanceMeters; const height=roomHeights[s.spacePreset]; if(!Number.isFinite(distance)||!height)return {min:0,max:0}; - const spectralOffset=(s.renderMode===7||s.renderMode===8)?(s.hrtfElevationTrimDegrees??0):0; + const spectralOffset=(s.renderMode===7||s.renderMode===8||s.renderMode===9)?(s.hrtfElevationTrimDegrees??0):0; const bottom=Math.max(-40-spectralOffset,Math.asin(Math.max(-1,Math.min(1,(.5-1.45)/distance)))*180/Math.PI); const top=Math.min(60-spectralOffset,Math.asin(Math.max(-1,Math.min(1,(height-.5-1.45)/distance)))*180/Math.PI); // Keep a 0.1 degree safety margin for C++ float boundary rounding. @@ -54,12 +54,12 @@ const valid=s=>s && Number.isFinite(s.startAzimuthDegrees) && 1.45+s.sourceDistanceMeters*Math.sin(s.directElevationDegrees*Math.PI/180)<= roomHeights[s.spacePreset]-.5)) && (s.renderMode===undefined || ( - Number.isInteger(s.renderMode)&&s.renderMode>=0&&s.renderMode<=8 && + Number.isInteger(s.renderMode)&&s.renderMode>=0&&s.renderMode<=9 && typeof s.musicCompatibleLowFrequency==="boolean" && (s.hrtfElevationTrimDegrees===undefined || ( Number.isFinite(s.hrtfElevationTrimDegrees) && s.hrtfElevationTrimDegrees>=-30 && s.hrtfElevationTrimDegrees<=20 && - ((s.renderMode!==7&&s.renderMode!==8) || (s.directElevationDegrees+s.hrtfElevationTrimDegrees>=-40 && + ((s.renderMode!==7&&s.renderMode!==8&&s.renderMode!==9) || (s.directElevationDegrees+s.hrtfElevationTrimDegrees>=-40 && s.directElevationDegrees+s.hrtfElevationTrimDegrees<=60)))) && Number.isFinite(s.headYawDegrees)&&Math.abs(s.headYawDegrees)<=360 && (s.renderMode!==2 || (s.stereoSpreadDegrees>=20&&s.stereoSpreadDegrees<=120)))); @@ -195,7 +195,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,p83Capable=false,p84Capable=false,p85Capable=false,p86Capable=false,p87Capable=false,p88Capable=false,p89Capable=false,musicSafeStereo=false,p8TransparentBass=false,p82MultibandRoom=false, + xyzCapable=false,p83Capable=false,p84Capable=false,p85Capable=false,p86Capable=false,p87Capable=false,p88Capable=false,p89Capable=false,p90Capable=false,musicSafeStereo=false,p8TransparentBass=false,p82MultibandRoom=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; @@ -215,7 +215,18 @@ function render(){ const row=$("skRenderRow");row.hidden=!(p83Capable||p84Capable); if(p83Capable||p84Capable){ const picker=$("skRenderMode"); - if(p89Capable && picker.dataset.nativeModeSet!=="p89"){ + if(p90Capable && picker.dataset.nativeModeSet!=="p90"){ + picker.innerHTML=''+ + ''+ + ''+ + ''+ + ''+ + ''+ + ''+ + ''; + picker.dataset.nativeModeSet="p90"; + root.querySelector(".sk-render-label").textContent="RENDER MODE · P9.0 HEADPHONE FAT"; + }else if(!p90Capable && p89Capable && picker.dataset.nativeModeSet!=="p89"){ picker.innerHTML=''+ ''+ ''+ @@ -268,7 +279,8 @@ function render(){ picker.dataset.nativeModeSet="p83"; root.querySelector(".sk-render-label").textContent="RENDER MODE · P8.3 TEST"; } - const v=p89Capable?(s.renderMode===8?"depth":s.renderMode===7?"align":s.renderMode===6?"body":s.renderMode===5?"focus":s.renderMode===4?"coherence":s.renderMode===3?"clarity":"music"): + const v=p90Capable?(s.renderMode===9?"external":s.renderMode===8?"depth":s.renderMode===7?"align":s.renderMode===6?"body":s.renderMode===5?"focus":s.renderMode===4?"coherence":s.renderMode===3?"clarity":"music"): + p89Capable?(s.renderMode===8?"depth":s.renderMode===7?"align":s.renderMode===6?"body":s.renderMode===5?"focus":s.renderMode===4?"coherence":s.renderMode===3?"clarity":"music"): p88Capable?(s.renderMode===7?"align":s.renderMode===6?"body":s.renderMode===5?"focus":s.renderMode===4?"coherence":s.renderMode===3?"clarity":"music"): p87Capable?(s.renderMode===6?"body":s.renderMode===5?"focus":s.renderMode===4?"coherence":s.renderMode===3?"clarity":"music"): p86Capable?(s.renderMode===5?"focus":s.renderMode===4?"coherence":s.renderMode===3?"clarity":"music"): @@ -276,7 +288,9 @@ function render(){ p84Capable?(s.renderMode===3?"clarity":"music"): s.renderMode===1?"mono":s.renderMode===2? (s.musicCompatibleLowFrequency?"musiclf":"physical"):"music"; - $("skRenderMode").value=v; + // Native readback arrives every 250ms. A no-op assignment to an open native + // select is unnecessary; preserve popup interaction while value is unchanged. + if(picker.value!==v)picker.value=v; $("skHeadYaw").value=String(s.headYawDegrees); $("skYawValue").textContent=Math.round(s.headYawDegrees)+"°"; } @@ -323,7 +337,7 @@ function render(){ $("skElevationValue").textContent=s.directElevationDegrees.toFixed(1)+"°"; } const alignRow=$("skHrtfAlignRow"),align=$("skHrtfAlign"); - alignRow.hidden=!(p88Capable&&(s.renderMode===7||s.renderMode===8)); + alignRow.hidden=!(p88Capable&&(s.renderMode===7||s.renderMode===8||s.renderMode===9)); if(!alignRow.hidden){ const min=Math.max(-30,-40-s.directElevationDegrees); const max=Math.min(20,60-s.directElevationDegrees); @@ -331,7 +345,9 @@ function render(){ if(!rangeEdits.has("skHrtfAlign"))align.value=String(s.hrtfElevationTrimDegrees); $("skHrtfAlignValue").textContent=(s.hrtfElevationTrimDegrees>=0?"+":"")+s.hrtfElevationTrimDegrees.toFixed(1)+"°"; } - root.querySelector(".sk-stage-caption").textContent=p89Capable&&s.renderMode===8? + root.querySelector(".sk-stage-caption").textContent=p90Capable&&s.renderMode===9? + "P9.0 MEASURED TWIN-SPEAKER HRIR · WORLD-LOCKED STEREO · FAT REQUIRED": + p89Capable&&s.renderMode===8? "P8.9 ROOM-ANCHORED STEREO · DIRECT MUSICAL BODY PRESERVED · FAT REQUIRED": p88Capable&&s.renderMode===7? "P8.8 EAR-LEVEL HRTF ALIGNMENT · PHYSICAL XYZ INDEPENDENT · FAT REQUIRED": @@ -356,8 +372,10 @@ function render(){ $("skSpread").closest("label").querySelector(".sk-param-name").textContent= (p83Capable||p84Capable)&&s.renderMode!==0?"SPEAKER ANGLE": musicSafeStereo?"SIDE WIDTH":"SPREAD"; - root.querySelector(".sk-guide").textContent=musicSafeStereo - ?"Stereo WIDTH adjusts preserved L/R SIDE, not two separately located HRIR emitters" + root.querySelector(".sk-guide").textContent=p90Capable&&s.renderMode===9 + ?"Two positioned measured HRIR speakers · 0° co-location cannot preserve anti-phase" + :musicSafeStereo + ?"Legacy music WIDTH adjusts headlocked SIDE; P9 spatializes it" :"Drag monitors to position · rotary knobs: vertical drag, double-click to reset"; if(!rangeEdits.has("skAmbience")) $("skAmbience").value=String(Math.round(s.ambience*100)); @@ -372,7 +390,8 @@ function render(){ // redrawn at 60 Hz. The native audio callback remains the time authority. drawSpeakers(); $("skMode").textContent=native()?(context()? - (p89Capable&&s.renderMode===8?"NATIVE P8.9 STEREO + ROOM · TEST": + (p90Capable&&s.renderMode===9?"NATIVE P9.0 TRUE EXTERNAL · TEST": + p89Capable&&s.renderMode===8?"NATIVE P8.9 STEREO + ROOM · TEST": p88Capable&&s.renderMode===7?"NATIVE P8.8 EAR ALIGN + DISTANCE · TEST": p87Capable&&s.renderMode===6?"NATIVE P8.7 MUSICAL AIR + BODY · TEST": p86Capable&&s.renderMode===5?"NATIVE P8.6 HORIZONTAL FOCUS · TEST": @@ -523,7 +542,7 @@ backend()?.addEventListener?.("arMixBuiltinSonKuSnapshot",r=>{ String(r.deviceEpoch)!==String(c.deviceEpoch)|| String(r.graphRevision)!==String(c.graphRevision))return; const measured=(r.schemaVersion===3 || r.schemaVersion===4 || - r.schemaVersion===5 || r.schemaVersion===6 || r.schemaVersion===7 || r.schemaVersion===8 || r.schemaVersion===9 || r.schemaVersion===10) && + r.schemaVersion===5 || r.schemaVersion===6 || r.schemaVersion===7 || r.schemaVersion===8 || r.schemaVersion===9 || r.schemaVersion===10 || r.schemaVersion===11) && Number.isFinite(r.settings?.directElevationDegrees); if(r.schemaVersion!==2&&!measured)return; const incoming=normalizeSettings(r.settings); @@ -535,7 +554,9 @@ backend()?.addEventListener?.("arMixBuiltinSonKuSnapshot",r=>{ Number.isInteger(incoming.renderMode) && typeof incoming.musicCompatibleLowFrequency==="boolean" && Number.isFinite(incoming.headYawDegrees); - p89Capable=r.schemaVersion===10 && r.p89StereoRoomDepth===true && + p90Capable=r.schemaVersion===11 && r.p90TrueExternalSpeaker===true && + Number.isFinite(incoming.hrtfElevationTrimDegrees); + p89Capable=(r.schemaVersion===10||p90Capable) && r.p89StereoRoomDepth===true && Number.isFinite(incoming.hrtfElevationTrimDegrees); p88Capable=(r.schemaVersion===9||p89Capable) && r.p88PerceptualAlignment===true && Number.isFinite(incoming.hrtfElevationTrimDegrees); @@ -549,7 +570,8 @@ backend()?.addEventListener?.("arMixBuiltinSonKuSnapshot",r=>{ (p86Capable&&incoming.renderMode===5)|| (p87Capable&&incoming.renderMode===6)|| (p88Capable&&incoming.renderMode===7)|| - (p89Capable&&incoming.renderMode===8)) && + (p89Capable&&incoming.renderMode===8)|| + (p90Capable&&incoming.renderMode===9)) && typeof incoming.musicCompatibleLowFrequency==="boolean" && incoming.musicCompatibleLowFrequency===false && Number.isFinite(incoming.headYawDegrees); @@ -584,7 +606,7 @@ backend()?.addEventListener?.("arMixBuiltinSonKuSnapshot",r=>{ } render(); }); -$("skClose").addEventListener("click",()=>{root.hidden=true;current=null;xyzCapable=false;p85Capable=false;p86Capable=false;p87Capable=false;p88Capable=false;p89Capable=false;musicSafeStereo=false;p8TransparentBass=false;p82MultibandRoom=false; +$("skClose").addEventListener("click",()=>{root.hidden=true;current=null;xyzCapable=false;p85Capable=false;p86Capable=false;p87Capable=false;p88Capable=false;p89Capable=false;p90Capable=false;musicSafeStereo=false;p8TransparentBass=false;p82MultibandRoom=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;} @@ -592,7 +614,8 @@ $("skClose").addEventListener("click",()=>{root.hidden=true;current=null;xyzCapa $("skRenderMode").addEventListener("change",()=>{ if(!(p83Capable||p84Capable))return; const v=$("skRenderMode").value; - const mode=p89Capable?(v==="depth"?8:v==="align"?7:v==="body"?6:v==="focus"?5:v==="coherence"?4:v==="clarity"?3:0): + const mode=p90Capable?(v==="external"?9:v==="depth"?8:v==="align"?7:v==="body"?6:v==="focus"?5:v==="coherence"?4:v==="clarity"?3:0): + p89Capable?(v==="depth"?8:v==="align"?7:v==="body"?6:v==="focus"?5:v==="coherence"?4:v==="clarity"?3:0): p88Capable?(v==="align"?7:v==="body"?6:v==="focus"?5:v==="coherence"?4:v==="clarity"?3:0): p87Capable?(v==="body"?6:v==="focus"?5:v==="coherence"?4:v==="clarity"?3:0): p86Capable?(v==="focus"?5:v==="coherence"?4:v==="clarity"?3:0): diff --git a/src/Main.cpp b/src/Main.cpp index 5618ac7b0..3a9937b8d 100644 --- a/src/Main.cpp +++ b/src/Main.cpp @@ -3046,7 +3046,18 @@ class ConsoleWindow final : public juce::DocumentWindow, private juce::Timer, pr armix::sonku::SonKuReflectionProfile::SixSurfaceKemarResearch) reply->setProperty("p8TransparentBass",true); #endif -#if defined(ARMIX_SONKU_EXPERIMENTAL_P89_NATIVE_RT) && ARMIX_SONKU_EXPERIMENTAL_P89_NATIVE_RT +#if defined(ARMIX_SONKU_EXPERIMENTAL_P90_NATIVE_RT) && ARMIX_SONKU_EXPERIMENTAL_P90_NATIVE_RT + if(processor && processor->preparedReflectionProfile()== + armix::sonku::SonKuReflectionProfile::SixSurfaceKemarResearch) { + reply->setProperty("p84MusicFusion",true); + reply->setProperty("p85AcousticCoherence",true); + reply->setProperty("p86HorizontalFocus",true); + reply->setProperty("p87MusicalAirBody",true); + reply->setProperty("p88PerceptualAlignment",true); + reply->setProperty("p89StereoRoomDepth",true); + reply->setProperty("p90TrueExternalSpeaker",true); + } +#elif defined(ARMIX_SONKU_EXPERIMENTAL_P89_NATIVE_RT) && ARMIX_SONKU_EXPERIMENTAL_P89_NATIVE_RT if(processor && processor->preparedReflectionProfile()== armix::sonku::SonKuReflectionProfile::SixSurfaceKemarResearch) { reply->setProperty("p84MusicFusion",true); diff --git a/src/SonKuNativeBridgeContract.h b/src/SonKuNativeBridgeContract.h index 9c9924e78..f5e55bdda 100644 --- a/src/SonKuNativeBridgeContract.h +++ b/src/SonKuNativeBridgeContract.h @@ -8,7 +8,9 @@ #include namespace armix::builtin_fx::sonku_bridge { inline constexpr int schemaVersion() noexcept { -#if defined(ARMIX_SONKU_EXPERIMENTAL_P89_NATIVE_RT) && ARMIX_SONKU_EXPERIMENTAL_P89_NATIVE_RT +#if defined(ARMIX_SONKU_EXPERIMENTAL_P90_NATIVE_RT) && ARMIX_SONKU_EXPERIMENTAL_P90_NATIVE_RT + return 11; +#elif defined(ARMIX_SONKU_EXPERIMENTAL_P89_NATIVE_RT) && ARMIX_SONKU_EXPERIMENTAL_P89_NATIVE_RT return 10; #elif defined(ARMIX_SONKU_EXPERIMENTAL_P88_NATIVE_RT) && ARMIX_SONKU_EXPERIMENTAL_P88_NATIVE_RT return 9; @@ -101,7 +103,11 @@ inline bool decodeSettings(const juce::var& values,armix::sonku::Settings& out) #if defined(ARMIX_SONKU_EXPERIMENTAL_P87_NATIVE_RT) && ARMIX_SONKU_EXPERIMENTAL_P87_NATIVE_RT #if defined(ARMIX_SONKU_EXPERIMENTAL_P88_NATIVE_RT) && ARMIX_SONKU_EXPERIMENTAL_P88_NATIVE_RT #if defined(ARMIX_SONKU_EXPERIMENTAL_P89_NATIVE_RT) && ARMIX_SONKU_EXPERIMENTAL_P89_NATIVE_RT +#if defined(ARMIX_SONKU_EXPERIMENTAL_P90_NATIVE_RT) && ARMIX_SONKU_EXPERIMENTAL_P90_NATIVE_RT + if(proposed.renderMode!=0 && proposed.renderMode!=3 && proposed.renderMode!=4 && proposed.renderMode!=5 && proposed.renderMode!=6 && proposed.renderMode!=7 && proposed.renderMode!=8 && proposed.renderMode!=9)return false; +#else if(proposed.renderMode!=0 && proposed.renderMode!=3 && proposed.renderMode!=4 && proposed.renderMode!=5 && proposed.renderMode!=6 && proposed.renderMode!=7 && proposed.renderMode!=8)return false; +#endif #else if(proposed.renderMode!=0 && proposed.renderMode!=3 && proposed.renderMode!=4 && proposed.renderMode!=5 && proposed.renderMode!=6 && proposed.renderMode!=7)return false; #endif diff --git a/tests/chat_ci_dispatch_contract.test.mjs b/tests/chat_ci_dispatch_contract.test.mjs index 3566a7fb7..135ed6402 100644 --- a/tests/chat_ci_dispatch_contract.test.mjs +++ b/tests/chat_ci_dispatch_contract.test.mjs @@ -295,7 +295,9 @@ test('CI workflow preserves FAT while deduplicating cheaper native builds and up test('FAT upload is independently retryable without a second Windows compiler and rechecks all file digests',()=>{ const wf=readFileSync('.github/workflows/p1-windows.yml','utf8'); const build=wf.split(/\n fat-upload:\n/)[0]; - const upload=wf.split(/\n fat-upload:\n/)[1]; + // The isolated P9 research FAT has its own upload job after fat-upload. + // Verify exactly the two production FAT uploads inside the production lane. + const upload=wf.split(/\n fat-upload:\n/)[1].split(/\n sonku-p90-source:\n/)[0]; assert.ok(upload,'dedicated artifact delivery job must exist'); assert.match(build,/Seal exact-SHA FAT delivery payload after all installer tests/); assert.match(build,/Save completed FAT packages for retryable upload job/); diff --git a/tests/sonku_p90_dropdown_stability_test.cjs b/tests/sonku_p90_dropdown_stability_test.cjs new file mode 100644 index 000000000..890d0de90 --- /dev/null +++ b/tests/sonku_p90_dropdown_stability_test.cjs @@ -0,0 +1,86 @@ +// SPDX-License-Identifier: AGPL-3.0-only +// Exercise the ACTUAL SonKu render-mode DOM-update branch, not a hand-copied +// model. Regression: native schema 11 also advertises schema 10 capabilities; +// prior if(p90) / else if(p89) branches alternately rewrote the open select. +"use strict"; +const assert=require("node:assert/strict"); +const fs=require("node:fs"); +const vm=require("node:vm"); +const source=fs.readFileSync("site/preview-v2/assets/mixer-native-sonku.js","utf8"); +const start=source.indexOf(' if(p90Capable && picker.dataset.nativeModeSet!=="p90"){'); +const end=source.indexOf(" const v=p90Capable?",start); +assert(start!==-1&&end>start,"Locate actual native SonKu mode menu reconciliation"); +const actualReconcile=source.slice(start,end); +const renderMenu=vm.runInNewContext( + '(function(picker,root,cap){ const {'+ + 'p90Capable,p89Capable,p88Capable,p87Capable,p86Capable,'+ + 'p85Capable,p84Capable,p83Capable}=cap;\n'+ + actualReconcile+'\n})',{} +); +const syncMatch=source.match(/if\(picker\.value!==v\)picker\.value=v;/); +assert(syncMatch,"Native render must not reset an unchanged open popup value"); +const syncSelection=vm.runInNewContext( + '(function(picker,v){'+syncMatch[0]+'})',{} +); +const optionWrites=[]; +const picker={dataset:{},isOpen:false,_markup:"",_value:"music", + get innerHTML(){return this._markup;}, + set innerHTML(markup){ + assert.equal(this.isOpen,false, + "Render must not replace