From 93fc743ad85a249a5c2e8dae111c18d5a2c070ea Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Mon, 16 Nov 2026 14:58:41 +0700 Subject: [PATCH 1/4] feat(sonku): P9.8 typed Signature/Cinema/Studio scene voicing; freeze operator-loved Venue P9.7 PCM --- .github/workflows/p1-windows.yml | 56 +++++--- CMakeLists.txt | 23 +++- ...NUE_CHECKPOINT_AND_VOICING_FAT_20261116.md | 30 +++++ engine/builtin_fx/SonKuSpatialProcessor.h | 21 +++ .../builtin_fx/sonku/SonKuP98SceneVoicing.h | 121 ++++++++++++++++++ engine/builtin_fx/sonku/SonKuSpatialCore.h | 49 +++++++ scripts/verify_sonku_p98_scenes.py | 43 +++++++ site/preview-v2/assets/mixer-native-sonku.js | 39 ++++-- src/Main.cpp | 3 + src/SonKuNativeBridgeContract.h | 17 ++- tests/sonku_p90_native_juce_v11_test.cpp | 68 +++++++++- tests/sonku_p98_integrated_scene_test.cpp | 81 ++++++++++++ tests/sonku_p98_scene_voicing_source_test.cpp | 68 ++++++++++ 13 files changed, 577 insertions(+), 42 deletions(-) create mode 100644 docs/SONKU_P98_OPERATOR_VENUE_CHECKPOINT_AND_VOICING_FAT_20261116.md create mode 100644 engine/builtin_fx/sonku/SonKuP98SceneVoicing.h create mode 100644 scripts/verify_sonku_p98_scenes.py create mode 100644 tests/sonku_p98_integrated_scene_test.cpp create mode 100644 tests/sonku_p98_scene_voicing_source_test.cpp diff --git a/.github/workflows/p1-windows.yml b/.github/workflows/p1-windows.yml index 19a93f451..1b5ac9eb3 100644 --- a/.github/workflows/p1-windows.yml +++ b/.github/workflows/p1-windows.yml @@ -660,7 +660,7 @@ jobs: 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-') || (startsWith(github.event.pull_request.head.ref, 'research/sonku-p91-p92-') || (startsWith(github.event.pull_request.head.ref, 'feat/sonku-p93-') || (startsWith(github.event.pull_request.head.ref, 'research/sonku-p94-') || startsWith(github.event.pull_request.head.ref, 'feat/sonku-p95-'))))) }} + if: ${{ github.event_name == 'pull_request' && (startsWith(github.event.pull_request.head.ref, 'research/sonku-p90-') || (startsWith(github.event.pull_request.head.ref, 'research/sonku-p91-p92-') || (startsWith(github.event.pull_request.head.ref, 'feat/sonku-p93-') || (startsWith(github.event.pull_request.head.ref, 'research/sonku-p94-') || startsWith(github.event.pull_request.head.ref, 'feat/sonku-p95-') || startsWith(github.event.pull_request.head.ref, 'feat/sonku-p98-'))))) }} runs-on: ubuntu-latest timeout-minutes: 10 steps: @@ -684,10 +684,10 @@ jobs: g++ $FLAGS -DSONKU_P94_FRONT_BACK_DEPTH_RESEARCH=1 tests/sonku_p94_front_back_depth_source_test.cpp -o /tmp/sonku-p94 /tmp/sonku-p94 python3 scripts/verify_sonku_p94_acoustic_levels.py /tmp/sonku-p94-reference /tmp/sonku-p94 - if [[ "${{ github.head_ref }}" == feat/sonku-p95-* ]]; then + if [[ "${{ github.head_ref }}" == feat/sonku-p95-* || "${{ github.head_ref }}" == feat/sonku-p98-* ]]; then g++ $FLAGS -DSONKU_P94_FRONT_BACK_DEPTH_RESEARCH=1 -DSONKU_P95_MUSICAL_PRESENCE_RESEARCH=1 tests/sonku_p95_musical_presence_source_test.cpp -o /tmp/sonku-p95 /tmp/sonku-p95 - if [[ "${{ github.head_ref }}" == feat/sonku-p95-p96-* ]]; then + if [[ "${{ github.head_ref }}" == feat/sonku-p95-p96-* || "${{ github.head_ref }}" == feat/sonku-p98-* ]]; then g++ -std=c++20 -O2 -Wall -Wextra -Werror -pedantic tests/sonku_p96_distance_reinforcement_source_test.cpp -o /tmp/sonku-p96-bands /tmp/sonku-p96-bands g++ $FLAGS -DSONKU_P94_FRONT_BACK_DEPTH_RESEARCH=1 -DSONKU_P95_MUSICAL_PRESENCE_RESEARCH=1 -DSONKU_P96_DISTANCE_REINFORCEMENT_RESEARCH=1 tests/sonku_p95_musical_presence_source_test.cpp -o /tmp/sonku-p96-full @@ -698,7 +698,7 @@ jobs: /tmp/sonku-p96-candidate > /tmp/sonku-p96-candidate.csv cat /tmp/sonku-p96-reference.csv /tmp/sonku-p96-candidate.csv python3 scripts/verify_sonku_p96_bands.py /tmp/sonku-p96-reference.csv /tmp/sonku-p96-candidate.csv - if [[ "${{ github.head_ref }}" == feat/sonku-p95-p96-p97-* ]]; then + if [[ "${{ github.head_ref }}" == feat/sonku-p95-p96-p97-* || "${{ github.head_ref }}" == feat/sonku-p98-* ]]; then g++ -std=c++20 -O2 -Wall -Wextra -Werror -pedantic tests/sonku_p97_stage_impact_source_test.cpp -o /tmp/sonku-p97-unit /tmp/sonku-p97-unit g++ $FLAGS -DSONKU_P94_FRONT_BACK_DEPTH_RESEARCH=1 -DSONKU_P95_MUSICAL_PRESENCE_RESEARCH=1 -DSONKU_P96_DISTANCE_REINFORCEMENT_RESEARCH=1 tests/sonku_p97_full_pcm_test.cpp -o /tmp/sonku-p97-reference @@ -707,6 +707,17 @@ jobs: /tmp/sonku-p97-candidate > /tmp/sonku-p97-candidate.csv cat /tmp/sonku-p97-reference.csv /tmp/sonku-p97-candidate.csv python3 scripts/verify_sonku_p97_stage_impact.py /tmp/sonku-p97-reference.csv /tmp/sonku-p97-candidate.csv + if [[ "${{ github.head_ref }}" == feat/sonku-p98-* ]]; then + g++ -std=c++20 -O2 -Wall -Wextra -Werror -pedantic tests/sonku_p98_scene_voicing_source_test.cpp -o /tmp/sonku-p98-unit + /tmp/sonku-p98-unit + PRESET_FLAGS="$FLAGS -DSONKU_P94_FRONT_BACK_DEPTH_RESEARCH=1 -DSONKU_P95_MUSICAL_PRESENCE_RESEARCH=1 -DSONKU_P96_DISTANCE_REINFORCEMENT_RESEARCH=1 -DSONKU_P97_STAGE_IMPACT_RESEARCH=1" + g++ $PRESET_FLAGS tests/sonku_p98_integrated_scene_test.cpp -o /tmp/sonku-p98-venue-reference + /tmp/sonku-p98-venue-reference > /tmp/sonku-p98-venue-reference.csv + g++ $PRESET_FLAGS -DSONKU_P98_SCENE_VOICING_RESEARCH=1 tests/sonku_p98_integrated_scene_test.cpp -o /tmp/sonku-p98-scene-candidate + /tmp/sonku-p98-scene-candidate > /tmp/sonku-p98-scene-candidate.csv + cat /tmp/sonku-p98-venue-reference.csv /tmp/sonku-p98-scene-candidate.csv + python3 scripts/verify_sonku_p98_scenes.py /tmp/sonku-p98-venue-reference.csv /tmp/sonku-p98-scene-candidate.csv + fi fi fi fi @@ -717,7 +728,7 @@ jobs: 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-') || (startsWith(github.event.pull_request.head.ref, 'research/sonku-p91-p92-') || (startsWith(github.event.pull_request.head.ref, 'feat/sonku-p93-') || (startsWith(github.event.pull_request.head.ref, 'research/sonku-p94-') || startsWith(github.event.pull_request.head.ref, 'feat/sonku-p95-'))))) }} + if: ${{ github.event_name == 'pull_request' && (startsWith(github.event.pull_request.head.ref, 'research/sonku-p90-') || (startsWith(github.event.pull_request.head.ref, 'research/sonku-p91-p92-') || (startsWith(github.event.pull_request.head.ref, 'feat/sonku-p93-') || (startsWith(github.event.pull_request.head.ref, 'research/sonku-p94-') || startsWith(github.event.pull_request.head.ref, 'feat/sonku-p95-') || startsWith(github.event.pull_request.head.ref, 'feat/sonku-p98-'))))) }} runs-on: windows-2022 timeout-minutes: 55 steps: @@ -739,9 +750,10 @@ jobs: - name: Configure the actual native app with P9 OFF by default except FAT shell: pwsh run: | - $p95flag = if ($env:GITHUB_HEAD_REF -like 'feat/sonku-p95-*') { 'ON' } else { 'OFF' } - $p96flag = if ($env:GITHUB_HEAD_REF -like 'feat/sonku-p95-p96-*') { 'ON' } else { 'OFF' } - $p97flag = if ($env:GITHUB_HEAD_REF -like 'feat/sonku-p95-p96-p97-*') { 'ON' } else { 'OFF' } + $p95flag = if ($env:GITHUB_HEAD_REF -like 'feat/sonku-p95-*' -or $env:GITHUB_HEAD_REF -like 'feat/sonku-p98-*') { 'ON' } else { 'OFF' } + $p96flag = if ($env:GITHUB_HEAD_REF -like 'feat/sonku-p95-p96-*' -or $env:GITHUB_HEAD_REF -like 'feat/sonku-p98-*') { 'ON' } else { 'OFF' } + $p97flag = if ($env:GITHUB_HEAD_REF -like 'feat/sonku-p95-p96-p97-*' -or $env:GITHUB_HEAD_REF -like 'feat/sonku-p98-*') { 'ON' } else { 'OFF' } + $p98flag = if ($env:GITHUB_HEAD_REF -like 'feat/sonku-p98-*') { 'ON' } else { 'OFF' } 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" ` @@ -761,6 +773,7 @@ jobs: -DARMIX_SONKU_EXPERIMENTAL_P95_MUSICAL_PRESENCE=$p95flag ` -DARMIX_SONKU_EXPERIMENTAL_P96_DISTANCE_REINFORCEMENT=$p96flag ` -DARMIX_SONKU_EXPERIMENTAL_P97_STAGE_IMPACT=$p97flag ` + -DARMIX_SONKU_EXPERIMENTAL_P98_SCENE_VOICING=$p98flag ` -DBUILD_TESTING=ON if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE } $cache = Get-Content build/CMakeCache.txt -Raw @@ -774,18 +787,20 @@ jobs: shell: pwsh run: | $targets = @('ARMixSonKuP94SourceTests','ARMixSonKuP94ReferenceTests','ARMixSonKuP91P92MusicBassTests','ARMixSonKuP90NativeTests','ARMixSonKuP90SourceTests','ARMixSonKuP89NativeTests','ARMixSonKuP89SourceTests','ARMixConsole') - if ($env:GITHUB_HEAD_REF -like 'feat/sonku-p95-*') { $targets += 'ARMixSonKuP95MusicTests' } - if ($env:GITHUB_HEAD_REF -like 'feat/sonku-p95-p96-*') { $targets += 'ARMixSonKuP96DistanceTests' } - if ($env:GITHUB_HEAD_REF -like 'feat/sonku-p95-p96-p97-*') { $targets += 'ARMixSonKuP97StageTests' } + if ($env:GITHUB_HEAD_REF -like 'feat/sonku-p95-*' -or $env:GITHUB_HEAD_REF -like 'feat/sonku-p98-*') { $targets += 'ARMixSonKuP95MusicTests' } + if ($env:GITHUB_HEAD_REF -like 'feat/sonku-p95-p96-*' -or $env:GITHUB_HEAD_REF -like 'feat/sonku-p98-*') { $targets += 'ARMixSonKuP96DistanceTests' } + if ($env:GITHUB_HEAD_REF -like 'feat/sonku-p95-p96-p97-*' -or $env:GITHUB_HEAD_REF -like 'feat/sonku-p98-*') { $targets += 'ARMixSonKuP97StageTests' } + if ($env:GITHUB_HEAD_REF -like 'feat/sonku-p98-*') { $targets += 'ARMixSonKuP98VoicingTests' } cmake --build build --config Release --parallel 2 --target $targets 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' } $tests = '^NativeSonKuP(89RoomAnchoredStereoAndP88GoldenParity|89JuceV10AppliedAckAndV9Restore|90StereoExternalizationSource|90JuceV11AppliedAckAndLegacyRestore|91P92MusicFidelityWorldBassAndRoom|94FrontBackDepthA_BSource|94LevelMatchedAB' - if ($env:GITHUB_HEAD_REF -like 'feat/sonku-p95-*') { $tests += '|95MusicPresenceVenue' } - if ($env:GITHUB_HEAD_REF -like 'feat/sonku-p95-p96-*') { $tests += '|96DistanceBassAndTrebleRetention' } - if ($env:GITHUB_HEAD_REF -like 'feat/sonku-p95-p96-p97-*') { $tests += '|97BassVocalExternalAirSafety' } + if ($env:GITHUB_HEAD_REF -like 'feat/sonku-p95-*' -or $env:GITHUB_HEAD_REF -like 'feat/sonku-p98-*') { $tests += '|95MusicPresenceVenue' } + if ($env:GITHUB_HEAD_REF -like 'feat/sonku-p95-p96-*' -or $env:GITHUB_HEAD_REF -like 'feat/sonku-p98-*') { $tests += '|96DistanceBassAndTrebleRetention' } + if ($env:GITHUB_HEAD_REF -like 'feat/sonku-p95-p96-p97-*' -or $env:GITHUB_HEAD_REF -like 'feat/sonku-p98-*') { $tests += '|97BassVocalExternalAirSafety' } + if ($env:GITHUB_HEAD_REF -like 'feat/sonku-p98-*') { $tests += '|98SceneVoicingVenueLock' } $tests += ')$' ctest --test-dir build -C Release --output-on-failure -R $tests if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE } @@ -802,12 +817,15 @@ jobs: Copy-Item docs/SONKU_P90_TRUE_EXTERNAL_SPEAKER_FAT_20261115.md dist/SONKU_P90_FIELD_FAT.md Copy-Item docs/SONKU_P91_P92_RECONCILED_MUSIC_FIDELITY_BASS_FAT_20261116.md dist/SONKU_P91_P92_FIELD_FAT.md Copy-Item docs/SONKU_P94_FRONT_REAR_EXTERNALIZATION_FAT_20261116.md dist/SONKU_P94_FRONT_REAR_FAT.md - if ($env:GITHUB_HEAD_REF -like 'feat/sonku-p95-*') { + if ($env:GITHUB_HEAD_REF -like 'feat/sonku-p95-*' -or $env:GITHUB_HEAD_REF -like 'feat/sonku-p98-*') { Copy-Item docs/SONKU_P95_IMMERSIVE_MUSIC_VENUE_FAT_20261116.md dist/SONKU_P95_MUSIC_VENUE_FAT.md - if ($env:GITHUB_HEAD_REF -like 'feat/sonku-p95-p96-*') { + if ($env:GITHUB_HEAD_REF -like 'feat/sonku-p95-p96-*' -or $env:GITHUB_HEAD_REF -like 'feat/sonku-p98-*') { Copy-Item docs/SONKU_P96_DISTANCE_REINFORCEMENT_FAT_20261116.md dist/SONKU_P96_DISTANCE_FAT.md - if ($env:GITHUB_HEAD_REF -like 'feat/sonku-p95-p96-p97-*') { + if ($env:GITHUB_HEAD_REF -like 'feat/sonku-p95-p96-p97-*' -or $env:GITHUB_HEAD_REF -like 'feat/sonku-p98-*') { Copy-Item docs/SONKU_P97_STAGE_IMPACT_FAT_20261116.md dist/SONKU_P97_STAGE_FAT.md + if ($env:GITHUB_HEAD_REF -like 'feat/sonku-p98-*') { + Copy-Item docs/SONKU_P98_OPERATOR_VENUE_CHECKPOINT_AND_VOICING_FAT_20261116.md dist/SONKU_P98_SCENE_VOICING_FAT.md + } } } } @@ -816,8 +834,8 @@ jobs: throw 'SONKU_P90_SOURCE_COMMIT_MISMATCH' } $provenance | Add-Member -Force -NotePropertyName sonkuExperiment -NotePropertyValue @{ - mode = if ($env:GITHUB_HEAD_REF -like 'feat/sonku-p95-p96-p97-*') { 'P9.7_STAGE_IMPACT_EXTERNAL_PRESENCE_RESEARCH' } elseif ($env:GITHUB_HEAD_REF -like 'feat/sonku-p95-p96-*') { 'P9.6_STAGE_BASS_AIR_DISTANCE_RESEARCH' } elseif ($env:GITHUB_HEAD_REF -like 'feat/sonku-p95-*') { 'P9.5_IMMERSIVE_MUSIC_VENUE_FOUNDATION' } else { 'P9.4_FRONT_REAR_DEPTH_EXPERIMENT' } - stateSchema = 11 + mode = if ($env:GITHUB_HEAD_REF -like 'feat/sonku-p98-*') { 'P9.8_SCENE_VOICING_VENUE_LOCKED_RESEARCH' } elseif ($env:GITHUB_HEAD_REF -like 'feat/sonku-p95-p96-p97-*') { 'P9.7_STAGE_IMPACT_EXTERNAL_PRESENCE_RESEARCH' } elseif ($env:GITHUB_HEAD_REF -like 'feat/sonku-p95-p96-*') { 'P9.6_STAGE_BASS_AIR_DISTANCE_RESEARCH' } elseif ($env:GITHUB_HEAD_REF -like 'feat/sonku-p95-*') { 'P9.5_IMMERSIVE_MUSIC_VENUE_FOUNDATION' } else { 'P9.4_FRONT_REAR_DEPTH_EXPERIMENT' } + stateSchema = if ($env:GITHUB_HEAD_REF -like 'feat/sonku-p98-*') { 12 } else { 11 } headphoneFat = 'PENDING' publicRelease = $false physicalAsioQualified = $false diff --git a/CMakeLists.txt b/CMakeLists.txt index cc0df0b81..5ad2cdd5d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -124,6 +124,13 @@ if(ARMIX_SONKU_EXPERIMENTAL_P97_STAGE_IMPACT AND NOT ARMIX_SONKU_EXPERIMENTAL_P96_DISTANCE_REINFORCEMENT) message(FATAL_ERROR "P9.7 requires the P9.6 sound-reinforced world-speaker engine") endif() +# Typed native v12 voicing of Signature/Cinema/Studio: P9.7 Venue remains immutable. +option(ARMIX_SONKU_EXPERIMENTAL_P98_SCENE_VOICING + "Private P9.8 scene bass/voice/air voicing; preserve approved P9.7 Venue" OFF) +if(ARMIX_SONKU_EXPERIMENTAL_P98_SCENE_VOICING AND + NOT ARMIX_SONKU_EXPERIMENTAL_P97_STAGE_IMPACT) + message(FATAL_ERROR "P9.8 requires P9.7 approved stage; public default OFF") +endif() set(CMAKE_CXX_STANDARD 20) set(CMAKE_CXX_STANDARD_REQUIRED ON) @@ -348,7 +355,9 @@ target_compile_definitions(ARMixConsole PRIVATE $<$:SONKU_P96_DISTANCE_REINFORCEMENT_RESEARCH=1> $<$:ARMIX_SONKU_EXPERIMENTAL_P96_DISTANCE_REINFORCEMENT=1> $<$:SONKU_P97_STAGE_IMPACT_RESEARCH=1> - $<$:ARMIX_SONKU_EXPERIMENTAL_P97_STAGE_IMPACT=1>) + $<$:ARMIX_SONKU_EXPERIMENTAL_P97_STAGE_IMPACT=1> + $<$:SONKU_P98_SCENE_VOICING_RESEARCH=1> + $<$:ARMIX_SONKU_EXPERIMENTAL_P98_SCENE_VOICING=1>) if(WIN32) # Windows retains its proven ASIO-first / WASAPI / static WebView2 distribution. # Never link Windows loader or sound APIs into macOS/Linux builds. @@ -884,7 +893,8 @@ if(BUILD_TESTING) SONKU_P94_FRONT_BACK_DEPTH_RESEARCH=1 SONKU_P95_MUSICAL_PRESENCE_RESEARCH=1 $<$:SONKU_P96_DISTANCE_REINFORCEMENT_RESEARCH=1> - $<$:SONKU_P97_STAGE_IMPACT_RESEARCH=1>) + $<$:SONKU_P97_STAGE_IMPACT_RESEARCH=1> + $<$:SONKU_P98_SCENE_VOICING_RESEARCH=1>) add_test(NAME NativeSonKuP95MusicPresenceVenue COMMAND ARMixSonKuP95MusicTests) endif() @@ -902,6 +912,13 @@ if(BUILD_TESTING) add_test(NAME NativeSonKuP97BassVocalExternalAirSafety COMMAND ARMixSonKuP97StageTests) endif() + if(ARMIX_SONKU_EXPERIMENTAL_P98_SCENE_VOICING) + add_executable(ARMixSonKuP98VoicingTests + tests/sonku_p98_scene_voicing_source_test.cpp) + target_compile_features(ARMixSonKuP98VoicingTests PRIVATE cxx_std_20) + add_test(NAME NativeSonKuP98SceneVoicingVenueLock + COMMAND ARMixSonKuP98VoicingTests) + endif() juce_add_console_app(ARMixSonKuP90NativeTests PRODUCT_NAME "ArSonMix SonKu P90 JUCE v11 State Tests") target_sources(ARMixSonKuP90NativeTests PRIVATE @@ -919,6 +936,8 @@ if(BUILD_TESTING) ARMIX_SONKU_EXPERIMENTAL_P88_NATIVE_RT=1 ARMIX_SONKU_EXPERIMENTAL_P89_NATIVE_RT=1 ARMIX_SONKU_EXPERIMENTAL_P90_NATIVE_RT=1 + $<$:ARMIX_SONKU_EXPERIMENTAL_P98_SCENE_VOICING=1> + $<$:SONKU_P98_SCENE_VOICING_RESEARCH=1> SONKU_P7_MEASURED_ELEVATION_RESEARCH=1 SONKU_P71_DIRECT_XYZ_RESEARCH=1 SONKU_P72_NATIVE_XYZ_RT=1 diff --git a/docs/SONKU_P98_OPERATOR_VENUE_CHECKPOINT_AND_VOICING_FAT_20261116.md b/docs/SONKU_P98_OPERATOR_VENUE_CHECKPOINT_AND_VOICING_FAT_20261116.md new file mode 100644 index 000000000..ce31e8cc8 --- /dev/null +++ b/docs/SONKU_P98_OPERATOR_VENUE_CHECKPOINT_AND_VOICING_FAT_20261116.md @@ -0,0 +1,30 @@ +# SonKu P9.8 — operator-approved Venue lock & Signature/Studio/Cinema voicing + +**Operator audible acceptance (16 November 2026):** VENUE · MEGA SPACE produces goosebumps. Preserve **exact** P9.7 master scene on branch `checkpoint/sonku-p97-venue-mega-space-approved-20261116` at `fda0eef669e0a59575c489e149662c1bf878c998`. Do not edit that branch, its preset (10m, 106° spread, Large 28.8m, 100% room, 100% ambience, gain 1.8) or P9.7 engine. No release/main merge before user listening. + +## Specific requested retune + +1. **Cinema · Grand Stage** (7.5m, room 100%, late 84%): more credible low-frequency pressure/impact without adding exaggerated broad midrange reverb. +2. **Large Studio · Live** (4.8m): only a little extra punch/warmth. +3. **Signature · Immersive** (3.1m): flagship musical clarity, upfront center-panned vocal/instrument detail, punch/body, coherent first-reflection air; should compete with or perceptually outperform Venue *for music*, not simply louder output. +4. **Venue**: sacred approved P9.7 baseline, no additional DSP and no changed preset numbers. **Live Orbit** also neutral unless explicitly requested. +5. "Vocal/instrument separation" is a gentle center-panned tonal emphasis only. There is NO stem demixing or true vocal isolation. + +## Architecture + +A named, typed native **`sceneVoicing`** integer 0..3 removes all fragile guesswork based on floating-point distance/reverb. 0=approved Venue/Custom neutral, 1=Signature, 2=Live Studio, 3=Cinema. Browser only picks complete scenes and sends them via existing native FX transaction; **native readback/ACK** must validate type. Existing custom .smix, P9.7 presets, and older state must not be rewritten behind the operator's back. A native P9.8 candidate **v12 (67 bytes)** *append-only* stores the explicit voicing; existing v1..v11 load as neutral 0. Older P9.7 binaries still use v11 and refuse unsupported properties; UI removes sceneVoicing when capability absent. P9.8 is OFF by default and requires P9.7, P9.6, P9.5 stack. + +The same authoritative measured two-world-speaker KEMAR PCM engine processes: +- **Center clarity:** modest doubly bandpassed 2.05kHz center sum injected into the two virtual speaker source feeds pre-HRTF. Never dry to headphone MID. Enhances *all* centered elements (vocal, kick, lead), not a voice stem. +- **Low-frequency pressure:** low-Q 86Hz punch and smooth 130Hz low body *after* the current P9.5 dynamic makeup, and *before* existing sample-peak guard; no subharmonic oscillator, no modified room RT60/feedback or headlocked LFE. +- **Directional external air:** modest highpass 5.2kHz enhancement on actual two-ear early reflection outputs, and gentle coherent per-ear sparkle in the final world binaural field; no synthetic Haas crossfeed. +- **Scene-specific gains, at full articulation:** Signature: center .22, bass body .15, kick .17, voice .15, ER air .16, end air .07; Studio .035/.045/.055/.045/.04/.02; Cinema .075/.15/.15/.06/.065/.035; Venue ALL ZERO. These constants are *audition hypotheses*, not perceptual ratings. +- All gains interpolate over 55ms, coefficients calculated only during prepare, fixed memory, no extra JUCE processor, FFT or delay. + +## Gates + +- Output sample peak <=0.9805 at 44.1/48k, front/back, real **wet** Signature/Studio/Cinema/Venue and ROOM OFF/0% MIX. +- Full integrated P9.7-vs-P9.8 per-sample **PCM hash exact** at approved Venue 10m with 100% room/ambience and existing 106° spread, plus ROOM OFF and 0% MIX. +- Cinema LF component >P9.7, Studio modest LF enhancement, Signature LF and vocal presence >P9.7 with no severe loss of treble. Compare at input matched and *also* match final loudness in owner headphone FAT. +- Native Windows JUCE schema v12 ACK/round-trip and v11 restore default0; invalid enum/rejected JSON, device restart and corrupt 67-byte snapshot; Chromium editor native mode/ACK; exact-head portable artifact. +- Operator FAT must verify actual perceived live stage, singer intelligibility, bass tightness/transient decay and no presence harshness or limiter pumping. Do not claim Signature is better to everyone's ears, or that a pre-defined room is a measured cinema/hall BRIR. diff --git a/engine/builtin_fx/SonKuSpatialProcessor.h b/engine/builtin_fx/SonKuSpatialProcessor.h index 28955fd2f..78c2f94cf 100644 --- a/engine/builtin_fx/SonKuSpatialProcessor.h +++ b/engine/builtin_fx/SonKuSpatialProcessor.h @@ -182,7 +182,11 @@ class SonKuSpatialProcessor final : public juce::AudioProcessor, #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 defined(ARMIX_SONKU_EXPERIMENTAL_P98_SCENE_VOICING) && ARMIX_SONKU_EXPERIMENTAL_P98_SCENE_VOICING + out.writeInt(12); // P9.8 append-only typed voicing, 67 bytes +#else out.writeInt(11); // unchanged 63-byte state; P9 mode 9 +#endif #else out.writeInt(10); // 63 bytes v9 layout, opt-in mode 8 #endif @@ -231,6 +235,9 @@ class SonKuSpatialProcessor final : public juce::AudioProcessor, #endif #if defined(ARMIX_SONKU_EXPERIMENTAL_P88_NATIVE_RT) && ARMIX_SONKU_EXPERIMENTAL_P88_NATIVE_RT out.writeFloat(accepted_.hrtfElevationTrimDegrees); +#endif +#if defined(ARMIX_SONKU_EXPERIMENTAL_P98_SCENE_VOICING) && ARMIX_SONKU_EXPERIMENTAL_P98_SCENE_VOICING + out.writeInt(accepted_.sceneVoicing); #endif } bool restoreUnpublishedState(const void* data,int size) { @@ -238,7 +245,11 @@ class SonKuSpatialProcessor final : public juce::AudioProcessor, #if defined(ARMIX_SONKU_EXPERIMENTAL_NATIVE_XYZ_RT) && ARMIX_SONKU_EXPERIMENTAL_NATIVE_XYZ_RT #if defined(ARMIX_SONKU_EXPERIMENTAL_P83_NATIVE_RT) && ARMIX_SONKU_EXPERIMENTAL_P83_NATIVE_RT #if defined(ARMIX_SONKU_EXPERIMENTAL_P88_NATIVE_RT) && ARMIX_SONKU_EXPERIMENTAL_P88_NATIVE_RT +#if defined(ARMIX_SONKU_EXPERIMENTAL_P98_SCENE_VOICING) && ARMIX_SONKU_EXPERIMENTAL_P98_SCENE_VOICING + (size!=30&&size!=46&&size!=50&&size!=59&&size!=63&&size!=67)|| +#else (size!=30&&size!=46&&size!=50&&size!=59&&size!=63)|| +#endif #else (size!=30&&size!=46&&size!=50&&size!=59)|| #endif @@ -271,6 +282,9 @@ class SonKuSpatialProcessor final : public juce::AudioProcessor, &&version!=10 #if defined(ARMIX_SONKU_EXPERIMENTAL_P90_NATIVE_RT) && ARMIX_SONKU_EXPERIMENTAL_P90_NATIVE_RT &&version!=11 +#if defined(ARMIX_SONKU_EXPERIMENTAL_P98_SCENE_VOICING) && ARMIX_SONKU_EXPERIMENTAL_P98_SCENE_VOICING + &&version!=12 +#endif #endif #endif #endif @@ -299,6 +313,9 @@ class SonKuSpatialProcessor final : public juce::AudioProcessor, ||(version==10&&size!=63) #if defined(ARMIX_SONKU_EXPERIMENTAL_P90_NATIVE_RT) && ARMIX_SONKU_EXPERIMENTAL_P90_NATIVE_RT ||(version==11&&size!=63) +#if defined(ARMIX_SONKU_EXPERIMENTAL_P98_SCENE_VOICING) && ARMIX_SONKU_EXPERIMENTAL_P98_SCENE_VOICING + ||(version==12&&size!=67) +#endif #endif #endif #endif @@ -397,6 +414,10 @@ class SonKuSpatialProcessor final : public juce::AudioProcessor, #endif #if defined(ARMIX_SONKU_EXPERIMENTAL_P88_NATIVE_RT) && ARMIX_SONKU_EXPERIMENTAL_P88_NATIVE_RT if(version>=9)next.hrtfElevationTrimDegrees=in.readFloat(); +#endif +#if defined(ARMIX_SONKU_EXPERIMENTAL_P98_SCENE_VOICING) && ARMIX_SONKU_EXPERIMENTAL_P98_SCENE_VOICING + if(version>=12)next.sceneVoicing=in.readInt(); + // Old v11 sessions restore neutral (exact P9.7) until preset chosen. #endif // v1 OFF, v2 original scene; experimental v3 includes direct // elevation, and is rejected by ordinary public v2 builds. diff --git a/engine/builtin_fx/sonku/SonKuP98SceneVoicing.h b/engine/builtin_fx/sonku/SonKuP98SceneVoicing.h new file mode 100644 index 000000000..78d8ff28a --- /dev/null +++ b/engine/builtin_fx/sonku/SonKuP98SceneVoicing.h @@ -0,0 +1,121 @@ +// SPDX-License-Identifier: AGPL-3.0-only +#pragma once +#include +#include +#include + +// P9.8 PRIVATE named-scene voicings, never a second PCM graph or fake stem +// separator. All bands are processed on world-positioned KEMAR ears or +// genuine directional first images; center emphasis enters the two measured +// loudspeaker HRIRs BEFORE ear rendering. Mode 0 = exact P9.7 Venue/Custom. +// This class never guesses a preset from distance/reverb/gain floats. +namespace armix::sonku::p98 { +class SceneVoicing final { +public: + struct Stereo {float left=0.f,right=0.f;}; + // These IDs are stable native-serialized values, NOT native ROOM sizes. + enum : int { Neutral=0, Signature=1, LiveStudio=2, Cinema=3 }; + bool prepare(double sampleRate) noexcept { + if (!std::isfinite(sampleRate) || + (std::abs(sampleRate-44100.)>.1 && std::abs(sampleRate-48000.)>.1)) + return false; + constexpr double pi=3.1415926535897932384626433832795; + punchCoeff_=bandpass(sampleRate,86.,.85); + voiceCoeff_=bandpass(sampleRate,2050.,.92); + bassAlpha_=static_cast(1.-std::exp(-2.*pi*130./sampleRate)); + airAlpha_=static_cast(1.-std::exp(-2.*pi*5200./sampleRate)); + slew_=static_cast(1.-std::exp(-1./(sampleRate*.055))); + reset(); + return true; + } + void reset() noexcept { + gains_={};center1_={};center2_={};punch_={};voice_={}; + bass_={};air_={};earlyAir_={}; + } + static constexpr bool valid(int scene) noexcept { + return scene>=Neutral && scene<=Cinema; + } + // Only explicit preset changes set an ID. 55ms interpolates changes in + // gains, with no per-sample coefficient recompute, memory allocation or + // trigonometry. Silent profile defaults never alter P9.7 float order. + Stereo source(float left,float right,int scene,bool enabled) noexcept { + const auto target=curves_[enabled && valid(scene)?scene:Neutral]; + for(unsigned i=0;i x{left,right}; + float out[2]{}; + for(int c=0;c<2;++c){ + earlyAir_[c]+=airAlpha_*(x[c]-earlyAir_[c]); + out[c]=gains_[4]==0.f?x[c]: + x[c]+gains_[4]*(x[c]-earlyAir_[c]); + } + return {out[0],out[1]}; + } + Stereo finish(float left,float right) noexcept { + const std::array x{left,right}; + float out[2]{}; + for(int c=0;c<2;++c){ + const float kick=punch_[c].run(punchCoeff_,x[c]); + const float vocal=voice_[c][1].run(voiceCoeff_, + voice_[c][0].run(voiceCoeff_,x[c])); + bass_[c]+=bassAlpha_*(x[c]-bass_[c]); + air_[c]+=airAlpha_*(x[c]-air_[c]); + if(gains_[1]==0.f&&gains_[2]==0.f&&gains_[3]==0.f&& + gains_[5]==0.f){ + out[c]=x[c]; + }else{ + out[c]=x[c]+gains_[1]*bass_[c]+gains_[2]*kick+ + gains_[3]*vocal+gains_[5]*(x[c]-air_[c]); + } + } + return {out[0],out[1]}; + } +private: + // channels: center-source, bass body, bass kick, vocal presence, + // real first-image air, already-binaural direct/final air. + // Signature is designed for high clarity AND physical music body. + // Studio adjustment deliberately gentler than Cinema. Venue profile + // is ALL ZEROS: its approved P9.7 acoustic graph is immutable. + static constexpr std::array,4> curves_{{ + {{0.f,0.f,0.f,0.f,0.f,0.f}}, // Venue / Custom: EXACT + {{.22f,.15f,.17f,.15f,.16f,.070f}}, // Signature flagship + {{.035f,.045f,.055f,.045f,.04f,.020f}}, // Live Studio subtle + {{.075f,.15f,.15f,.060f,.065f,.035f}} // Cinema LF weight + }}; + struct Coeff {float b0=0,b1=0,b2=0,a1=0,a2=0;}; + struct Filter { + float z1=0,z2=0; + float run(const Coeff& c,float x) noexcept { + const float y=c.b0*x+z1; + z1=c.b1*x-c.a1*y+z2; + z2=c.b2*x-c.a2*y; + return y; + } + }; + static Coeff bandpass(double rate,double hz,double q) noexcept { + constexpr double pi=3.1415926535897932384626433832795; + const double w=2.*pi*hz/rate; + const double a=std::sin(w)/(2.*q); + const double inv=1./(1.+a); + return {static_cast(a*inv),0.f,static_cast(-a*inv), + static_cast(-2.*std::cos(w)*inv), + static_cast((1.-a)*inv)}; + } + Coeff punchCoeff_{},voiceCoeff_{}; + Filter center1_{},center2_{}; + std::array punch_{}; + std::array,2> voice_{}; + std::array bass_{},air_{},earlyAir_{}; + std::array gains_{}; + float bassAlpha_=0.f,airAlpha_=0.f,slew_=0.f; +}; +} // namespace armix::sonku::p98 diff --git a/engine/builtin_fx/sonku/SonKuSpatialCore.h b/engine/builtin_fx/sonku/SonKuSpatialCore.h index a5b95b3f2..72f88ea64 100644 --- a/engine/builtin_fx/sonku/SonKuSpatialCore.h +++ b/engine/builtin_fx/sonku/SonKuSpatialCore.h @@ -31,6 +31,9 @@ #if defined(SONKU_P97_STAGE_IMPACT_RESEARCH) && SONKU_P97_STAGE_IMPACT_RESEARCH #include "SonKuP97StageImpact.h" #endif +#if defined(SONKU_P98_SCENE_VOICING_RESEARCH) && SONKU_P98_SCENE_VOICING_RESEARCH +#include "SonKuP98SceneVoicing.h" +#endif #if defined(SONKU_P94_FRONT_BACK_DEPTH_RESEARCH) && SONKU_P94_FRONT_BACK_DEPTH_RESEARCH #include "SonKuP94FrontBackDepthCue.h" #endif @@ -88,6 +91,9 @@ struct Settings { int renderMode = 0; bool musicCompatibleLowFrequency = false; float headYawDegrees = 0.f; // deterministic world/head separation +#if defined(SONKU_P98_SCENE_VOICING_RESEARCH) && SONKU_P98_SCENE_VOICING_RESEARCH + int sceneVoicing=0; // 0=unchanged Venue/Custom; 1=Signature; 2=Studio; 3=Cinema +#endif #if defined(SONKU_P88_PERCEPTUAL_ALIGNMENT_RESEARCH) && SONKU_P88_PERCEPTUAL_ALIGNMENT_RESEARCH float hrtfElevationTrimDegrees=0.f; // spectral only, never room XYZ #endif @@ -107,6 +113,10 @@ inline bool valid(const Settings& s) noexcept { s.sourceDistanceMeters<=10.f && std::isfinite(s.roomAmount) && s.roomAmount>=0.f && s.roomAmount<=1.f && std::isfinite(s.ambience) && s.ambience>=0.f && s.ambience<=1.f && +#if defined(SONKU_P98_SCENE_VOICING_RESEARCH) && SONKU_P98_SCENE_VOICING_RESEARCH + p98::SceneVoicing::valid(s.sceneVoicing) && + (s.sceneVoicing==0 || s.renderMode==9) && +#endif #if defined(SONKU_P83_PHYSICAL_SPEAKER_RESEARCH) && SONKU_P83_PHYSICAL_SPEAKER_RESEARCH s.renderMode>=0 && #if defined(SONKU_P84_SINGLE_CORE_FUSION_RESEARCH) && SONKU_P84_SINGLE_CORE_FUSION_RESEARCH @@ -222,6 +232,9 @@ class SonKuSpatialCore final { #if defined(SONKU_P97_STAGE_IMPACT_RESEARCH) && SONKU_P97_STAGE_IMPACT_RESEARCH if(!p97Stage_.prepare(rate))return false; #endif +#if defined(SONKU_P98_SCENE_VOICING_RESEARCH) && SONKU_P98_SCENE_VOICING_RESEARCH + if(!p98Voicing_.prepare(rate))return false; +#endif #if defined(SONKU_P95_MUSICAL_PRESENCE_RESEARCH) && SONKU_P95_MUSICAL_PRESENCE_RESEARCH if(!p95Presence_.prepare(rate))return false; #endif @@ -302,6 +315,9 @@ class SonKuSpatialCore final { #if defined(SONKU_P97_STAGE_IMPACT_RESEARCH) && SONKU_P97_STAGE_IMPACT_RESEARCH p97Stage_.reset(); #endif +#if defined(SONKU_P98_SCENE_VOICING_RESEARCH) && SONKU_P98_SCENE_VOICING_RESEARCH + p98Voicing_.reset(); +#endif #if defined(SONKU_P95_MUSICAL_PRESENCE_RESEARCH) && SONKU_P95_MUSICAL_PRESENCE_RESEARCH p95Presence_.reset(); #endif @@ -365,6 +381,9 @@ class SonKuSpatialCore final { #if defined(SONKU_P97_STAGE_IMPACT_RESEARCH) && SONKU_P97_STAGE_IMPACT_RESEARCH p97Stage_.reset(); #endif +#if defined(SONKU_P98_SCENE_VOICING_RESEARCH) && SONKU_P98_SCENE_VOICING_RESEARCH + p98Voicing_.reset(); +#endif #if defined(SONKU_P95_MUSICAL_PRESENCE_RESEARCH) && SONKU_P95_MUSICAL_PRESENCE_RESEARCH p95Presence_.reset(); #endif @@ -789,6 +808,18 @@ class SonKuSpatialCore final { history_[0][write_]=x0; history_[1][write_]=x1; } +#if defined(SONKU_P98_SCENE_VOICING_RESEARCH) && SONKU_P98_SCENE_VOICING_RESEARCH + if(p90World && settings_.spatialMix>0.f){ + const auto fed=p98Voicing_.source(history_[0][write_], + history_[1][write_],settings_.sceneVoicing,roomEnabled); + history_[0][write_]=fed.left; + history_[1][write_]=fed.right; + }else{ + // Smoothly return private voicing to neutral without ever + // injecting headphone-dry voice or mutating the original PCM. + (void)p98Voicing_.source(0.f,0.f,0,false); + } +#endif float ears[2]{0.f,0.f}; for(int tap=0;tap0.f && roomEnabled){ + const auto air=p98Voicing_.early(reflection.left,reflection.right); + reflection.left=air.left;reflection.right=air.right; + } #endif float spatialL=directL+ smoothedErPresence_*calibratedEarly*reflection.left+ @@ -1059,6 +1096,15 @@ class SonKuSpatialCore final { const auto finished=p97Stage_.finish(outL,outR); outL=finished.left;outR=finished.right; } +#endif +#if defined(SONKU_P98_SCENE_VOICING_RESEARCH) && SONKU_P98_SCENE_VOICING_RESEARCH + if(p90World && settings_.spatialMix>0.f && roomEnabled){ + // Post-adaptive-makeup, PRE-existing 0.98 linked guard. + // The cinema low-end cannot attenuate the whole mix + // via the upstream automatic compensation meter. + const auto voiced=p98Voicing_.finish(outL,outR); + outL=voiced.left;outR=voiced.right; + } #endif // Zero-lookahead *linked* sample-peak safety guard. Quiet // signals are linear; peaks are gently returned below unity @@ -1378,6 +1424,9 @@ class SonKuSpatialCore final { #if defined(SONKU_P97_STAGE_IMPACT_RESEARCH) && SONKU_P97_STAGE_IMPACT_RESEARCH p97::StageImpact p97Stage_{}; #endif +#if defined(SONKU_P98_SCENE_VOICING_RESEARCH) && SONKU_P98_SCENE_VOICING_RESEARCH + p98::SceneVoicing p98Voicing_{}; +#endif #if defined(SONKU_P95_MUSICAL_PRESENCE_RESEARCH) && SONKU_P95_MUSICAL_PRESENCE_RESEARCH p95::MusicalPresence p95Presence_{}; #endif diff --git a/scripts/verify_sonku_p98_scenes.py b/scripts/verify_sonku_p98_scenes.py new file mode 100644 index 000000000..163da06c6 --- /dev/null +++ b/scripts/verify_sonku_p98_scenes.py @@ -0,0 +1,43 @@ +#!/usr/bin/env python3 +"""P9.8 proof: approved P9.7 Venue is PCM-bit-exact; only typed scenes voiced.""" +from pathlib import Path +import sys + +def load(path): + rows={} + for line in Path(path).read_text().splitlines(): + if not line.startswith("P98_SCENE,"): continue + p=line.split(",") + assert len(p)==10,line + key=(int(p[1]),int(p[2]),int(p[3]),p[4]) + assert key not in rows + rows[key]=(tuple(float(x) for x in p[5:9]),p[9]) + assert len(rows)==24,(path,len(rows)) + return rows + +def main(): + assert len(sys.argv)==3 + old=load(sys.argv[1]);new=load(sys.argv[2]) + assert old.keys()==new.keys() + for key,(base,oldHash) in old.items(): + cand,newHash=new[key] + rate,az,index,scene=key + if index in (0,4,5): + assert oldHash==newHash, f"APPROVED_VENUE_P97_PCM_CHANGED {key}" + print("P98_APPROVED_VENUE_BIT_EXACT",key) + else: + ratios=tuple(cand[i]/base[i] for i in range(3)) + print("P98_SCENE_RESPONSE",key,*[round(x,4) for x in ratios]) + # Intended subtle vs meaningful scene-specific LF signature, + # while a lower instrument/voice band may never disappear. + assert all(.801.04 and ratios[1]>1.03,(key,ratios) + if index==2: # Studio small adjustment + assert ratios[0]>1.005,(key,ratios) + if index==3: # Cinema bass meaningful + assert ratios[0]>1.045,(key,ratios) + print("P98_APPROVED_VENUE_PCM_BIT_EXACT_AND_SCENE_GAINS_PASSED") + +if __name__=="__main__": + main() diff --git a/site/preview-v2/assets/mixer-native-sonku.js b/site/preview-v2/assets/mixer-native-sonku.js index 5758c1a4f..0869c5ccb 100644 --- a/site/preview-v2/assets/mixer-native-sonku.js +++ b/site/preview-v2/assets/mixer-native-sonku.js @@ -43,22 +43,24 @@ const roomMaxDistance=[10,3.1,6.7,10]; const factoryPresets=Object.freeze({ music:Object.freeze({moving:true,clockwise:true,startAzimuthDegrees:0, revolutionSeconds:6.5,stereoSpreadDegrees:82,spatialMix:1,outputTrim:1.9, - spacePreset:3,sourceDistanceMeters:3.1,roomAmount:1,ambience:.62}), + spacePreset:3,sourceDistanceMeters:3.1,roomAmount:1,ambience:.62,sceneVoicing:1}), studio:Object.freeze({moving:false,clockwise:true,startAzimuthDegrees:0, revolutionSeconds:12,stereoSpreadDegrees:76,spatialMix:1,outputTrim:1.65, - spacePreset:3,sourceDistanceMeters:4.8,roomAmount:.94,ambience:.72}), + spacePreset:3,sourceDistanceMeters:4.8,roomAmount:.94,ambience:.72,sceneVoicing:2}), wide:Object.freeze({moving:false,clockwise:true,startAzimuthDegrees:0, revolutionSeconds:12,stereoSpreadDegrees:98,spatialMix:1,outputTrim:1.7, - spacePreset:3,sourceDistanceMeters:7.5,roomAmount:1,ambience:.84}), + spacePreset:3,sourceDistanceMeters:7.5,roomAmount:1,ambience:.84,sceneVoicing:3}), deep:Object.freeze({moving:false,clockwise:true,startAzimuthDegrees:0, revolutionSeconds:12,stereoSpreadDegrees:106,spatialMix:1,outputTrim:1.8, - spacePreset:3,sourceDistanceMeters:10,roomAmount:1,ambience:1}), + spacePreset:3,sourceDistanceMeters:10,roomAmount:1,ambience:1,sceneVoicing:0}), orbit:Object.freeze({moving:true,clockwise:true,startAzimuthDegrees:0, revolutionSeconds:8.5,stereoSpreadDegrees:82,spatialMix:1,outputTrim:1.75, - spacePreset:3,sourceDistanceMeters:6.5,roomAmount:1,ambience:.83}) + spacePreset:3,sourceDistanceMeters:6.5,roomAmount:1,ambience:.83,sceneVoicing:0}) }); const matchFactoryPreset=s=>Object.entries(factoryPresets).find(([id,p])=> - s.renderMode===9 && Object.keys(p).every(k=>Math.abs(Number(s[k])-Number(p[k]))<.00002))?.[0]||"CUSTOM"; + s.renderMode===9 && Object.keys(p).every(k=> + (k==="sceneVoicing" && s[k]===undefined) || + Math.abs(Number(s[k])-Number(p[k]))<.00002))?.[0]||"CUSTOM"; const valid=s=>s && Number.isFinite(s.startAzimuthDegrees) && Math.abs(s.startAzimuthDegrees)<=360 && Number.isFinite(s.revolutionSeconds)&&s.revolutionSeconds>=.5&&s.revolutionSeconds<=120 && @@ -71,6 +73,8 @@ const valid=s=>s && Number.isFinite(s.startAzimuthDegrees) && s.sourceDistanceMeters<=roomMaxDistance[s.spacePreset]+.0001 && Number.isFinite(s.roomAmount) && s.roomAmount>=0 && s.roomAmount<=1 && Number.isFinite(s.ambience) && s.ambience>=0 && s.ambience<=1 && + (s.sceneVoicing===undefined || + (Number.isInteger(s.sceneVoicing) && s.sceneVoicing>=0 && s.sceneVoicing<=3)) && (s.directElevationDegrees===undefined || ( Number.isFinite(s.directElevationDegrees) && s.directElevationDegrees>= -40 && s.directElevationDegrees<=60 && @@ -232,7 +236,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,p90Capable=false,p91p92Capable=false,p94Capable=false,p95Capable=false,p96Capable=false,p97Capable=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,p91p92Capable=false,p94Capable=false,p95Capable=false,p96Capable=false,p97Capable=false,p98Capable=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; @@ -434,7 +438,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=p97Capable&&s.renderMode===9? + root.querySelector(".sk-stage-caption").textContent=p98Capable&&s.renderMode===9? + "SIGNATURE / CINEMA / STUDIO VOICING · VENUE P9.7 PRESERVED": + p97Capable&&s.renderMode===9? "IMMERSIVE STAGE · BASS IMPACT · CENTER PRESENCE · EARLY AIR": p96Capable&&s.renderMode===9? "IMMERSIVE STAGE · REINFORCED BASS + AIR · CINEMA / VENUE": @@ -489,7 +495,8 @@ function render(){ // redrawn at 60 Hz. The native audio callback remains the time authority. drawSpeakers(); $("skMode").textContent=native()?(context()? - (p97Capable&&s.renderMode===9?"NATIVE IMMERSIVE · STAGE IMPACT + EXTERNAL AIR": + (p98Capable&&s.renderMode===9?"NATIVE IMMERSIVE · SCENE VOICING · VENUE LOCKED": + p97Capable&&s.renderMode===9?"NATIVE IMMERSIVE · STAGE IMPACT + EXTERNAL AIR": p96Capable&&s.renderMode===9?"NATIVE IMMERSIVE · STAGE BASS + AIR": p95Capable&&s.renderMode===9?"NATIVE IMMERSIVE · MUSIC PRESENCE · WORLD BASS": p94Capable&&s.renderMode===9?"NATIVE IMMERSIVE SPATIAL · WORLD BASS": @@ -646,7 +653,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===11) && + r.schemaVersion===5 || r.schemaVersion===6 || r.schemaVersion===7 || r.schemaVersion===8 || r.schemaVersion===9 || r.schemaVersion===10 || r.schemaVersion===11 || r.schemaVersion===12) && Number.isFinite(r.settings?.directElevationDegrees); if(r.schemaVersion!==2&&!measured)return; const incoming=normalizeSettings(r.settings); @@ -658,7 +665,7 @@ backend()?.addEventListener?.("arMixBuiltinSonKuSnapshot",r=>{ Number.isInteger(incoming.renderMode) && typeof incoming.musicCompatibleLowFrequency==="boolean" && Number.isFinite(incoming.headYawDegrees); - p90Capable=r.schemaVersion===11 && r.p90TrueExternalSpeaker===true && + p90Capable=(r.schemaVersion===11||r.schemaVersion===12) && r.p90TrueExternalSpeaker===true && Number.isFinite(incoming.hrtfElevationTrimDegrees); // Separate from schema v11: old P9.0 DSP must not receive the P9.1/9.2 label. p91p92Capable=p90Capable && r.p91p92MusicBassFoundation===true; @@ -668,6 +675,9 @@ backend()?.addEventListener?.("arMixBuiltinSonKuSnapshot",r=>{ p95Capable=p91p92Capable && r.p95MusicalPresence===true; p96Capable=p95Capable && r.p96DistanceReinforcement===true; p97Capable=p96Capable && r.p97StageImpact===true; + p98Capable=p97Capable && r.schemaVersion===12 && + r.p98SceneVoicing===true && Number.isInteger(incoming.sceneVoicing) && + incoming.sceneVoicing>=0 && incoming.sceneVoicing<=3; p89Capable=(r.schemaVersion===10||p90Capable) && r.p89StereoRoomDepth===true && Number.isFinite(incoming.hrtfElevationTrimDegrees); p88Capable=(r.schemaVersion===9||p89Capable) && r.p88PerceptualAlignment===true && @@ -771,9 +781,12 @@ $("skPreset").addEventListener("change",()=>{ } const scene=fitElevation({...draft,...preset,renderMode:9, musicCompatibleLowFrequency:false}); + // P9.7/v11 native MUST NOT accept speculative v12 voicing fields. + // Venue's acoustic numbers and stage ID=0 are identical to the checkpoint. + if(!p98Capable)delete scene.sceneVoicing; if(!send(scene))render(); }); -$("skClose").addEventListener("click",()=>{root.hidden=true;current=null;xyzCapable=false;p85Capable=false;p86Capable=false;p87Capable=false;p88Capable=false;p89Capable=false;p90Capable=false;p91p92Capable=false;p94Capable=false;p95Capable=false;p96Capable=false;p97Capable=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;p91p92Capable=false;p94Capable=false;p95Capable=false;p96Capable=false;p97Capable=false;p98Capable=false;musicSafeStereo=false;p8TransparentBass=false;p82MultibandRoom=false; cancelLiveTimer();pending=null;latest=null;readId="";readSentAt=0;dialDrag=null; drag=null;windowGesture=null;rangeEdits.clear();gestureStart.clear();lastLiveAt=0; if(clock!==null){clearInterval(clock);clock=null;} @@ -972,7 +985,7 @@ const api={ drag=null;rangeEdits.clear();gestureStart.clear(); accepted=defaults();draft=defaults();xyzCapable=false; p83Capable=p84Capable=p85Capable=p86Capable=p87Capable=p88Capable= - p89Capable=p90Capable=p91p92Capable=p94Capable=p95Capable=p96Capable=p97Capable=false; + p89Capable=p90Capable=p91p92Capable=p94Capable=p95Capable=p96Capable=p97Capable=p98Capable=false; musicSafeStereo=p8TransparentBass=p82MultibandRoom=false; current={track,slot,instanceId:null}; const s=snapshot(),id=window.__ARMIX_NATIVE_M2__?.nativeIdFor?.(track); diff --git a/src/Main.cpp b/src/Main.cpp index b9762c5ac..8aafc8cd0 100644 --- a/src/Main.cpp +++ b/src/Main.cpp @@ -3135,6 +3135,9 @@ class ConsoleWindow final : public juce::DocumentWindow, private juce::Timer, pr #if defined(ARMIX_SONKU_EXPERIMENTAL_P97_STAGE_IMPACT) && ARMIX_SONKU_EXPERIMENTAL_P97_STAGE_IMPACT reply->setProperty("p97StageImpact",true); #endif +#if defined(ARMIX_SONKU_EXPERIMENTAL_P98_SCENE_VOICING) && ARMIX_SONKU_EXPERIMENTAL_P98_SCENE_VOICING + reply->setProperty("p98SceneVoicing",true); +#endif #if defined(ARMIX_SONKU_EXPERIMENTAL_P94_FRONT_BACK_DEPTH) && ARMIX_SONKU_EXPERIMENTAL_P94_FRONT_BACK_DEPTH // Branch-only measured-engine A/B. A previous v11 binary cannot // advertise this front/rear perceptual depth research capability. diff --git a/src/SonKuNativeBridgeContract.h b/src/SonKuNativeBridgeContract.h index f5e55bdda..bce0fb491 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_P90_NATIVE_RT) && ARMIX_SONKU_EXPERIMENTAL_P90_NATIVE_RT +#if defined(ARMIX_SONKU_EXPERIMENTAL_P98_SCENE_VOICING) && ARMIX_SONKU_EXPERIMENTAL_P98_SCENE_VOICING + return 12; +#elif 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; @@ -63,6 +65,16 @@ inline bool decodeSettings(const juce::var& values,armix::sonku::Settings& out) if(!number(values,"sourceDistanceMeters",proposed.sourceDistanceMeters,false)|| !number(values,"roomAmount",proposed.roomAmount,false)|| !number(values,"ambience",proposed.ambience,false))return false; +#if defined(ARMIX_SONKU_EXPERIMENTAL_P98_SCENE_VOICING) && ARMIX_SONKU_EXPERIMENTAL_P98_SCENE_VOICING + const auto voicing=values.getProperty("sceneVoicing",{}); + if(!voicing.isVoid()){ + if(!voicing.isInt())return false; + proposed.sceneVoicing=static_cast(voicing); + } +#else + // Do not silently ACK an unsupported voicing to an older v11 engine. + if(!values.getProperty("sceneVoicing",{}).isVoid())return false; +#endif #if defined(ARMIX_SONKU_EXPERIMENTAL_NATIVE_XYZ_RT) && ARMIX_SONKU_EXPERIMENTAL_NATIVE_XYZ_RT // Legacy clients legitimately omit elevation; default exactly zero. if(!number(values,"directElevationDegrees", @@ -143,6 +155,9 @@ inline juce::var acceptedSettings(const armix::sonku::Settings& s) { values->setProperty("sourceDistanceMeters",s.sourceDistanceMeters); values->setProperty("roomAmount",s.roomAmount); values->setProperty("ambience",s.ambience); +#if defined(ARMIX_SONKU_EXPERIMENTAL_P98_SCENE_VOICING) && ARMIX_SONKU_EXPERIMENTAL_P98_SCENE_VOICING + values->setProperty("sceneVoicing",s.sceneVoicing); +#endif #if defined(ARMIX_SONKU_EXPERIMENTAL_NATIVE_XYZ_RT) && ARMIX_SONKU_EXPERIMENTAL_NATIVE_XYZ_RT values->setProperty("directElevationDegrees",s.directElevationDegrees); #endif diff --git a/tests/sonku_p90_native_juce_v11_test.cpp b/tests/sonku_p90_native_juce_v11_test.cpp index 5bd11e201..b68b96b2c 100644 --- a/tests/sonku_p90_native_juce_v11_test.cpp +++ b/tests/sonku_p90_native_juce_v11_test.cpp @@ -76,7 +76,13 @@ static juce::MemoryBlock legacy(int version,int oldMode=2){ return bytes; } int main(){ +#if defined(ARMIX_SONKU_EXPERIMENTAL_P98_SCENE_VOICING) && ARMIX_SONKU_EXPERIMENTAL_P98_SCENE_VOICING + static_assert(schemaVersion()==12); + constexpr int activeVersion=12,activeBytes=67; +#else static_assert(schemaVersion()==11); + constexpr int activeVersion=11,activeBytes=63; +#endif auto fx=std::make_unique(); fx->prepareToPlay(48000.,128); assert(fx->isReady()); @@ -114,9 +120,9 @@ int main(){ assert(fx->acceptedSettings().renderMode==9); juce::MemoryBlock snapshot; fx->getStateInformation(snapshot); - assert(snapshot.getSize()==63); + assert(snapshot.getSize()==static_cast(activeBytes)); juce::MemoryInputStream input(snapshot.getData(),snapshot.getSize(),false); - assert(input.readInt()==0x534f4e4b&&input.readInt()==11); + assert(input.readInt()==0x534f4e4b&&input.readInt()==activeVersion); auto restored=std::make_unique(); restored->prepareToPlay(44100.,128); assert(restored->restoreUnpublishedState( @@ -195,6 +201,54 @@ int main(){ assert(p87->acceptedSettings().renderMode==6); assert(p87->acceptedSettings().hrtfElevationTrimDegrees==0.f); } +#if defined(ARMIX_SONKU_EXPERIMENTAL_P98_SCENE_VOICING) && ARMIX_SONKU_EXPERIMENTAL_P98_SCENE_VOICING + // Old operator-approved v11 Venue has no voicing: restore exactly neutral. + { + const auto oldVenue=legacy(11,9); + auto v11=std::make_unique(); + v11->prepareToPlay(48000.,128); + assert(v11->restoreUnpublishedState(oldVenue.getData(),63)); + assert(v11->acceptedSettings().renderMode==9); + assert(v11->acceptedSettings().sceneVoicing==0); + } + // P9.8 round-trip and negative validation of native scene identity. + { + Settings voiced=s; + voiced.renderMode=9;voiced.sceneVoicing=1; + auto accepted=acceptedSettings(voiced); + Settings decodedScene{}; + assert(decodeSettings(accepted,decodedScene)); + assert(decodedScene.sceneVoicing==1); + for(const int invalid : {-1,4,127}){ + accepted.getDynamicObject()->setProperty("sceneVoicing",invalid); + assert(!decodeSettings(accepted,decodedScene)); + } + accepted.getDynamicObject()->setProperty("sceneVoicing",juce::String("1")); + assert(!decodeSettings(accepted,decodedScene)); + accepted=acceptedSettings(voiced); + auto v12=std::make_unique(); + v12->prepareToPlay(48000.,128); + assert(v12->queueSettings(voiced,977)); + v12->consumeRealtimeEdits(); + SonKuSpatialProcessor::Completion done{}; + assert(v12->pollCompletion(done)&&done.applied&&done.requestId==977); + assert(done.settings.sceneVoicing==1); + juce::MemoryBlock saved; + v12->getStateInformation(saved); + assert(saved.getSize()==67); + auto reopened=std::make_unique(); + reopened->prepareToPlay(44100.,128); + assert(reopened->restoreUnpublishedState(saved.getData(),67)); + assert(reopened->acceptedSettings().sceneVoicing==1); + assert(reopened->acceptedSettings().renderMode==9); + // v12 corrupt ID cannot bypass valid() or restore a partial blob. + auto invalidData=saved; + auto* bytes=static_cast(invalidData.getData()); + bytes[63]=0xff;bytes[64]=bytes[65]=bytes[66]=0; + assert(!reopened->restoreUnpublishedState(invalidData.getData(),67)); + assert(!reopened->restoreUnpublishedState(saved.getData(),66)); + } +#endif // Existing v10 P8.9 session must remain byte-compatible and mode 8. { const auto v10=legacy(10,8); @@ -235,17 +289,17 @@ int main(){ assert(!downgrade->acceptedSettings().musicCompatibleLowFrequency); auto broken=std::make_unique(); broken->prepareToPlay(48000.,128); - assert(!broken->restoreUnpublishedState(snapshot.getData(),62)); + assert(!broken->restoreUnpublishedState(snapshot.getData(),activeBytes-1)); juce::MemoryBlock corrupt(snapshot); auto* ptr=static_cast(corrupt.getData()); ptr[54]=0xff; // signed JUCE bool, 0xff must never become true - assert(!broken->restoreUnpublishedState(corrupt.getData(),63)); + assert(!broken->restoreUnpublishedState(corrupt.getData(),activeBytes)); corrupt=snapshot;ptr=static_cast(corrupt.getData()); ptr[50]=2;ptr[51]=ptr[52]=ptr[53]=0; // old physical mode in v10 forbidden - assert(!broken->restoreUnpublishedState(corrupt.getData(),63)); + assert(!broken->restoreUnpublishedState(corrupt.getData(),activeBytes)); restored->sealForRealtime(); - assert(!restored->restoreUnpublishedState(snapshot.getData(),63)); + assert(!restored->restoreUnpublishedState(snapshot.getData(),activeBytes)); std::printf("PASS P90 JUCE v11: audio ACK fade, single native graph A/B, " - "safe v1-v10 migration, v11 63-byte state and device reopen; " + "safe v1-v11 migration, opt-in v12 state and device reopen; " "P90_vs_P82_RMS_dB=%.3f; ASIO/headphone NOT PROVEN\n",relativeDb); } diff --git a/tests/sonku_p98_integrated_scene_test.cpp b/tests/sonku_p98_integrated_scene_test.cpp new file mode 100644 index 000000000..b60f23879 --- /dev/null +++ b/tests/sonku_p98_integrated_scene_test.cpp @@ -0,0 +1,81 @@ +// SPDX-License-Identifier: AGPL-3.0-only +#if defined(NDEBUG) +#undef NDEBUG +#endif +#include "../engine/builtin_fx/sonku/SonKuSpatialCore.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +using namespace armix::sonku; +struct Scene { + int id;const char* name;float meters,room,late,spread,trim,mix; +}; +constexpr Scene scenes[]{ + // Same exact user-approved native values as P9.7 Venue; 0=neutral. + {0,"VENUE",10.f,1.f,1.f,106.f,1.8f,1.f}, + {1,"SIGNATURE",3.1f,1.f,.62f,82.f,1.9f,1.f}, + {2,"STUDIO",4.8f,.94f,.72f,76.f,1.65f,1.f}, + {3,"CINEMA",7.5f,1.f,.84f,98.f,1.7f,1.f}, + {0,"OFF",10.f,1.f,1.f,106.f,1.8f,1.f}, + {0,"BYPASS",10.f,1.f,1.f,106.f,1.8f,0.f} +}; +void run(int rate,int az,int index){ + const auto& scene=scenes[index]; + auto core=std::make_unique(); + assert(core->prepare(rate,SonKuReflectionProfile::SixSurfaceKemarResearch)); + Settings s{}; + s.renderMode=9;s.moving=false;s.startAzimuthDegrees=static_cast(az); + s.stereoSpreadDegrees=scene.spread; + s.spatialMix=scene.mix;s.outputTrim=scene.trim; + s.spacePreset=index==4?0:3;s.sourceDistanceMeters=scene.meters; + s.roomAmount=scene.room;s.ambience=scene.late; +#if defined(SONKU_P98_SCENE_VOICING_RESEARCH) && SONKU_P98_SCENE_VOICING_RESEARCH + s.sceneVoicing=scene.id; +#endif + assert(valid(s)&&core->setSettings(s)); + const int n=rate; + constexpr double pi=3.1415926535897932384626433832795; + std::vector l(n),r(n); + for(int i=0;iprocess(l.data()+i,r.data()+i,std::min(256,n-i)); + std::uint64_t hash=14695981039346656037ull; + for(int i=0;i(value); + hash*=1099511628211ull; + } + constexpr std::array hz{86,2050,7500}; + std::array amp{}; + for(int k=0;k<3;++k){ + double c=0,d=0; + for(int i=n/2;i0); + } + std::printf("P98_SCENE,%d,%d,%d,%s,%.9f,%.9f,%.9f,%.9f,%016llx\n", + rate,az,index,scene.name,amp[0],amp[1],amp[2],double(peak), + static_cast(hash)); +} +int main(){ + for(int rate:{44100,48000})for(int az:{0,180}) + for(int scene=0;scene<6;++scene)run(rate,az,scene); +} diff --git a/tests/sonku_p98_scene_voicing_source_test.cpp b/tests/sonku_p98_scene_voicing_source_test.cpp new file mode 100644 index 000000000..18e85bb49 --- /dev/null +++ b/tests/sonku_p98_scene_voicing_source_test.cpp @@ -0,0 +1,68 @@ +// SPDX-License-Identifier: AGPL-3.0-only +#if defined(NDEBUG) +#undef NDEBUG +#endif +#include "../engine/builtin_fx/sonku/SonKuP98SceneVoicing.h" +#include +#include +#include +using armix::sonku::p98::SceneVoicing; +static double measure(int rate,int scene,int stage,double hz) { + SceneVoicing e; + assert(e.prepare(rate)); + constexpr double pi=3.1415926535897932384626433832795; + double before=0,after=0; + for(int i=0;irate/2){before+=x*x;after+=y*y;} + } + return std::sqrt(after/before); +} +int main(){ + SceneVoicing bad; + assert(!bad.prepare(96000)); + assert(!SceneVoicing::valid(-1)&&!SceneVoicing::valid(4)); + for(int rate:{44100,48000}){ + // Voice and bass gains are physically bounded; Studio < Cinema. + const auto signatureBass=measure(rate,1,1,86.); + const auto studioBass=measure(rate,2,1,86.); + const auto cinemaBass=measure(rate,3,1,86.); + const auto signatureVoice=measure(rate,1,0,2050.); + const auto studioVoice=measure(rate,2,0,2050.); + const auto cinemaVoice=measure(rate,3,0,2050.); + const auto signatureEarly=measure(rate,1,2,7500.); + assert(studioBass>1.035&&studioBass<1.20); + assert(cinemaBass>studioBass+.07); + assert(signatureBass>cinemaBass-.035); + assert(signatureVoice>1.16); + assert(signatureVoice>cinemaVoice&&cinemaVoice>studioVoice); + assert(signatureEarly>1.04&&signatureEarly<1.25); + for(int stage=0;stage<3;++stage) + for(double hz:{86.,2050.,7500.}) + assert(std::abs(measure(rate,0,stage,hz)-1.)<1.e-7); + // Mono-safe antiphase: no synthetic center vocal, no channel crossing. + SceneVoicing p; + assert(p.prepare(rate)); + for(int i=0;i Date: Mon, 16 Nov 2026 15:04:40 +0700 Subject: [PATCH 2/4] fix(sonku): new P9.8 inserts actually use Signature voicing; add scene-native GUI proof --- .github/workflows/p1-windows.yml | 3 ++ ...NUE_CHECKPOINT_AND_VOICING_FAT_20261116.md | 2 +- engine/builtin_fx/SonKuSpatialProcessor.h | 5 ++ tests/sonku_p98_gui_contract_test.cjs | 48 +++++++++++++++++++ 4 files changed, 57 insertions(+), 1 deletion(-) create mode 100644 tests/sonku_p98_gui_contract_test.cjs diff --git a/.github/workflows/p1-windows.yml b/.github/workflows/p1-windows.yml index 1b5ac9eb3..365be3805 100644 --- a/.github/workflows/p1-windows.yml +++ b/.github/workflows/p1-windows.yml @@ -675,6 +675,9 @@ jobs: node --check site/preview-v2/assets/mixer-native-sonku.js node tests/sonku_p90_dropdown_stability_test.cjs node tests/sonku_p93_circular_gui_contract_test.cjs + if [[ "${{ github.head_ref }}" == feat/sonku-p98-* ]]; then + node tests/sonku_p98_gui_contract_test.cjs + fi 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 diff --git a/docs/SONKU_P98_OPERATOR_VENUE_CHECKPOINT_AND_VOICING_FAT_20261116.md b/docs/SONKU_P98_OPERATOR_VENUE_CHECKPOINT_AND_VOICING_FAT_20261116.md index ce31e8cc8..31131c697 100644 --- a/docs/SONKU_P98_OPERATOR_VENUE_CHECKPOINT_AND_VOICING_FAT_20261116.md +++ b/docs/SONKU_P98_OPERATOR_VENUE_CHECKPOINT_AND_VOICING_FAT_20261116.md @@ -12,7 +12,7 @@ ## Architecture -A named, typed native **`sceneVoicing`** integer 0..3 removes all fragile guesswork based on floating-point distance/reverb. 0=approved Venue/Custom neutral, 1=Signature, 2=Live Studio, 3=Cinema. Browser only picks complete scenes and sends them via existing native FX transaction; **native readback/ACK** must validate type. Existing custom .smix, P9.7 presets, and older state must not be rewritten behind the operator's back. A native P9.8 candidate **v12 (67 bytes)** *append-only* stores the explicit voicing; existing v1..v11 load as neutral 0. Older P9.7 binaries still use v11 and refuse unsupported properties; UI removes sceneVoicing when capability absent. P9.8 is OFF by default and requires P9.7, P9.6, P9.5 stack. +A named, typed native **`sceneVoicing`** integer 0..3 removes all fragile guesswork based on floating-point distance/reverb. 0=approved Venue/Custom neutral, 1=Signature, 2=Live Studio, 3=Cinema. Browser only picks complete scenes and sends them via existing native FX transaction; **native readback/ACK** must validate type. Existing custom .smix, P9.7 presets, and older state must not be rewritten behind the operator's back. Newly inserted P9.8 SonKu starts at the actual Signature voicing (typed ID=1) because its P9.5 default scene already has 3.1m Signature parameters. Old loaded .smix/v11 state remains ID=0, never retuned without user preset selection. A native P9.8 candidate **v12 (67 bytes)** *append-only* stores the explicit voicing; existing v1..v11 load as neutral 0. Older P9.7 binaries still use v11 and refuse unsupported properties; UI removes sceneVoicing when capability absent. P9.8 is OFF by default and requires P9.7, P9.6, P9.5 stack. The same authoritative measured two-world-speaker KEMAR PCM engine processes: - **Center clarity:** modest doubly bandpassed 2.05kHz center sum injected into the two virtual speaker source feeds pre-HRTF. Never dry to headphone MID. Enhances *all* centered elements (vocal, kick, lead), not a voice stem. diff --git a/engine/builtin_fx/SonKuSpatialProcessor.h b/engine/builtin_fx/SonKuSpatialProcessor.h index 78c2f94cf..cef5dcde5 100644 --- a/engine/builtin_fx/SonKuSpatialProcessor.h +++ b/engine/builtin_fx/SonKuSpatialProcessor.h @@ -35,6 +35,11 @@ class SonKuSpatialProcessor final : public juce::AudioProcessor, accepted_.sourceDistanceMeters=3.1f; accepted_.roomAmount=1.f; accepted_.ambience=.62f; +#if defined(ARMIX_SONKU_EXPERIMENTAL_P98_SCENE_VOICING) && ARMIX_SONKU_EXPERIMENTAL_P98_SCENE_VOICING + // Only brand-new P9.8 inserts start in its actual flagship voicing. + // A restored v11 operator session still uses typed neutral 0. + accepted_.sceneVoicing=1; // SIGNATURE; not Venue. +#endif #endif } const juce::String getName() const override {return "8D-SonKu";} diff --git a/tests/sonku_p98_gui_contract_test.cjs b/tests/sonku_p98_gui_contract_test.cjs new file mode 100644 index 000000000..5d9a7e403 --- /dev/null +++ b/tests/sonku_p98_gui_contract_test.cjs @@ -0,0 +1,48 @@ +// SPDX-License-Identifier: AGPL-3.0-only +"use strict"; +const assert=require("node:assert/strict"); +const fs=require("node:fs"); +const vm=require("node:vm"); +const ui=fs.readFileSync("site/preview-v2/assets/mixer-native-sonku.js","utf8"); +const bridge=fs.readFileSync("src/SonKuNativeBridgeContract.h","utf8"); +const native=fs.readFileSync("engine/builtin_fx/SonKuSpatialProcessor.h","utf8"); +const core=fs.readFileSync("engine/builtin_fx/sonku/SonKuSpatialCore.h","utf8"); +function slice(a,b){ + const i=ui.indexOf(a),j=ui.indexOf(b,i); + assert(i>=0&&j>i,"missing "+a); + return ui.slice(i,j); +} +const f=slice("const factoryPresets=Object.freeze(","const valid=s=>"); +const values=vm.runInNewContext( + "(function(){"+f+"\nreturn {factoryPresets,matchFactoryPreset}})()",{}); +const {factoryPresets,matchFactoryPreset}=values; +const expected={music:1,studio:2,wide:3,deep:0,orbit:0}; +for(const [id,scene] of Object.entries(factoryPresets)){ + assert.equal(scene.sceneVoicing,expected[id]); + assert.equal(matchFactoryPreset({...scene,renderMode:9}),id); + const legacy={...scene,renderMode:9}; + delete legacy.sceneVoicing; + assert.equal(matchFactoryPreset(legacy),id, + "P9.7 v11 without voicing must keep its old preset labels"); +} +const venue=factoryPresets.deep; +assert.equal(venue.sourceDistanceMeters,10); +assert.equal(venue.stereoSpreadDegrees,106); +assert.equal(venue.roomAmount,1); +assert.equal(venue.ambience,1); +assert.equal(venue.outputTrim,1.8); +assert.equal(venue.spatialMix,1); +assert.match(ui,/if\(!p98Capable\)delete scene\.sceneVoicing/); +assert.match(ui,/r\.schemaVersion===12/); +assert.match(ui,/r\.p98SceneVoicing===true/); +assert.match(ui,/p90Capable=\(r\.schemaVersion===11\|\|r\.schemaVersion===12\)/); +assert.match(bridge,/return 12;/); +assert.match(bridge,/if\(!voicing\.isInt\(\)\)return false;/); +assert.match(bridge,/values->setProperty\("sceneVoicing",s\.sceneVoicing\)/); +assert.match(native,/out\.writeInt\(12\)/); +assert.match(native,/out\.writeInt\(accepted_\.sceneVoicing\)/); +assert.match(native,/if\(version>=12\)next\.sceneVoicing=in\.readInt\(\)/); +assert.match(native,/accepted_\.sceneVoicing=1; \/\/ SIGNATURE/); +assert.match(core,/p98::SceneVoicing::valid\(s\.sceneVoicing\)/); +assert.match(core,/p98Voicing_\.finish\(outL,outR\)/); +console.log("P98_GUI_ACK_FACTORY_SIGNATURE_AND_IMMUTABLE_VENUE_CONTRACT_PASSED"); From 6e13289ae5132b0f46f4505a45b45cf67bb524f1 Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Mon, 16 Nov 2026 15:55:01 +0700 Subject: [PATCH 3/4] fix(sonku): unify native P9.8 mode admission across JSON/PCM/v12 restore; scope retired P8.3 FAT --- .../sonku-p83-native-speaker-gates.yml | 7 +++++++ engine/builtin_fx/SonKuSpatialProcessor.h | 6 ++++-- engine/builtin_fx/sonku/SonKuSpatialCore.h | 6 ++++++ tests/sonku_p90_native_juce_v11_test.cpp | 19 +++++++++++++++++++ tests/sonku_p98_integrated_scene_test.cpp | 11 +++++++++++ 5 files changed, 47 insertions(+), 2 deletions(-) diff --git a/.github/workflows/sonku-p83-native-speaker-gates.yml b/.github/workflows/sonku-p83-native-speaker-gates.yml index ff7353ca2..71ce62232 100644 --- a/.github/workflows/sonku-p83-native-speaker-gates.yml +++ b/.github/workflows/sonku-p83-native-speaker-gates.yml @@ -22,6 +22,13 @@ concurrency: jobs: native-source: name: Native C++ P8.3 source, PCM/stems/no-null and Music Bed invariants + # P8.3 mono/physical research was acoustically REJECTED. Its strict + # negative FAT is preserved (and remains hard-failing) for explicitly + # targeted P8.3 research branches or manual workflow_dispatch. + # Running its known-rejected physical mode on every newer P9 source + # change makes unrelated approved P9 candidate PRs falsely red. + # New P9.8 tests explicitly verify that modes 1/2 cannot be admitted. + if: ${{ github.event_name == 'workflow_dispatch' || startsWith(github.head_ref, 'research/sonku-p83-') || startsWith(github.head_ref, 'feat/sonku-p83-') }} runs-on: ubuntu-latest timeout-minutes: 10 steps: diff --git a/engine/builtin_fx/SonKuSpatialProcessor.h b/engine/builtin_fx/SonKuSpatialProcessor.h index cef5dcde5..68ebc006a 100644 --- a/engine/builtin_fx/SonKuSpatialProcessor.h +++ b/engine/builtin_fx/SonKuSpatialProcessor.h @@ -403,11 +403,13 @@ class SonKuSpatialProcessor final : public juce::AudioProcessor, 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 && + // Both v11 and append-only v12 forbid retired P8.3 modes. + // A v12 state with voicing=0 still cannot restore mode 1/2. + 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; + if(version>=11 && next.musicCompatibleLowFrequency)return false; #endif #endif #endif diff --git a/engine/builtin_fx/sonku/SonKuSpatialCore.h b/engine/builtin_fx/sonku/SonKuSpatialCore.h index 72f88ea64..808cb1b9a 100644 --- a/engine/builtin_fx/sonku/SonKuSpatialCore.h +++ b/engine/builtin_fx/sonku/SonKuSpatialCore.h @@ -115,6 +115,12 @@ inline bool valid(const Settings& s) noexcept { std::isfinite(s.ambience) && s.ambience>=0.f && s.ambience<=1.f && #if defined(SONKU_P98_SCENE_VOICING_RESEARCH) && SONKU_P98_SCENE_VOICING_RESEARCH p98::SceneVoicing::valid(s.sceneVoicing) && + // v12 deliberately excludes the retired P8.3 physical/mono + // modes 1/2 even when neutral voicing=0. The old P8.3 renderer + // was rejected by the operator; JSON, realtime edits and .smix + // restore must use ONE admission rule, not three distinct gates. + (s.renderMode==0 || (s.renderMode>=3 && s.renderMode<=9)) && + !s.musicCompatibleLowFrequency && (s.sceneVoicing==0 || s.renderMode==9) && #endif #if defined(SONKU_P83_PHYSICAL_SPEAKER_RESEARCH) && SONKU_P83_PHYSICAL_SPEAKER_RESEARCH diff --git a/tests/sonku_p90_native_juce_v11_test.cpp b/tests/sonku_p90_native_juce_v11_test.cpp index b68b96b2c..830d969fa 100644 --- a/tests/sonku_p90_native_juce_v11_test.cpp +++ b/tests/sonku_p90_native_juce_v11_test.cpp @@ -241,6 +241,25 @@ int main(){ assert(reopened->restoreUnpublishedState(saved.getData(),67)); assert(reopened->acceptedSettings().sceneVoicing==1); assert(reopened->acceptedSettings().renderMode==9); + // All native admission routes must reject the old P8.3 physical + // modes, even if a v12 blob declares neutral sceneVoicing=0. + for(int legacyMode : {1,2}){ + auto rejected=voiced; + rejected.sceneVoicing=0; + rejected.renderMode=legacyMode; + assert(!armix::sonku::valid(rejected)); + assert(!v12->queueSettings(rejected,979)); + auto data=acceptedSettings(rejected); + assert(!decodeSettings(data,decodedScene)); + // v12 binary is append-only: the render-mode field retains v11 + // offset 50; force that field without touching sceneVoicing=0. + auto corrupted=saved; + auto* b=static_cast(corrupted.getData()); + b[50]=static_cast(legacyMode); + b[51]=b[52]=b[53]=0; + b[63]=b[64]=b[65]=b[66]=0; + assert(!reopened->restoreUnpublishedState(corrupted.getData(),67)); + } // v12 corrupt ID cannot bypass valid() or restore a partial blob. auto invalidData=saved; auto* bytes=static_cast(invalidData.getData()); diff --git a/tests/sonku_p98_integrated_scene_test.cpp b/tests/sonku_p98_integrated_scene_test.cpp index b60f23879..6dad427a7 100644 --- a/tests/sonku_p98_integrated_scene_test.cpp +++ b/tests/sonku_p98_integrated_scene_test.cpp @@ -76,6 +76,17 @@ void run(int rate,int az,int index){ static_cast(hash)); } int main(){ +#if defined(SONKU_P98_SCENE_VOICING_RESEARCH) && SONKU_P98_SCENE_VOICING_RESEARCH + // A falsified v12 neutral voicing ID must not resurrect obsolete + // physical-speaker P8.3 modes. PCM reference with P98 disabled + // intentionally retains older compile-time behavior. + for(int mode:{1,2}){ + Settings invalid{}; + invalid.renderMode=mode; + invalid.sceneVoicing=0; + assert(!valid(invalid)); + } +#endif for(int rate:{44100,48000})for(int az:{0,180}) for(int scene=0;scene<6;++scene)run(rate,az,scene); } From 4a9e5b2c455818c7a0dc8507ec2b7863be215033 Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Mon, 16 Nov 2026 16:05:01 +0700 Subject: [PATCH 4/4] fix(ci): repair malformed P89/P90 zero-job YAML, isolate legacy FAT and guard source workflow integrity --- .github/workflows/p1-windows.yml | 3 + .github/workflows/sonku-p89-windows-field.yml | 147 ++---------------- .github/workflows/sonku-p90-windows-field.yml | 123 +-------------- ...NKU_P98_CI_ROOT_CAUSE_RECOVERY_20261116.md | 27 ++++ scripts/verify_sonku_legacy_workflows.py | 46 ++++++ 5 files changed, 89 insertions(+), 257 deletions(-) create mode 100644 docs/SONKU_P98_CI_ROOT_CAUSE_RECOVERY_20261116.md create mode 100644 scripts/verify_sonku_legacy_workflows.py diff --git a/.github/workflows/p1-windows.yml b/.github/workflows/p1-windows.yml index 365be3805..0962b87c1 100644 --- a/.github/workflows/p1-windows.yml +++ b/.github/workflows/p1-windows.yml @@ -675,6 +675,9 @@ jobs: node --check site/preview-v2/assets/mixer-native-sonku.js node tests/sonku_p90_dropdown_stability_test.cjs node tests/sonku_p93_circular_gui_contract_test.cjs + # Keep retired P8.9/P9.0 research workflows YAML-valid, but never + # rebuild their heavy Windows FAT on a P9.8 audio tuning PR. + python3 scripts/verify_sonku_legacy_workflows.py if [[ "${{ github.head_ref }}" == feat/sonku-p98-* ]]; then node tests/sonku_p98_gui_contract_test.cjs fi diff --git a/.github/workflows/sonku-p89-windows-field.yml b/.github/workflows/sonku-p89-windows-field.yml index 912fb6de0..3f0b85289 100644 --- a/.github/workflows/sonku-p89-windows-field.yml +++ b/.github/workflows/sonku-p89-windows-field.yml @@ -1,5 +1,5 @@ -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. +name: SonKu P8.9 room-anchored stereo native mixer portable FAT x64 +# Private JUCE app, no release. P8.9 native v10 field A/B, P9.0 disabled. on: pull_request: paths: @@ -8,10 +8,12 @@ on: permissions: contents: read concurrency: - group: sonku-p90-field-${{ github.event.pull_request.number || github.ref }} + group: sonku-p89-field-${{ github.event.pull_request.number || github.ref }} cancel-in-progress: true jobs: preflight: + # Standalone P8.9 research, not the P9.8 current release candidate. + if: ${{ github.event_name == 'workflow_dispatch' || startsWith(github.head_ref,'research/sonku-p89-') || startsWith(github.head_ref,'feat/sonku-p89-') }} name: Isolated fast PCM and GUI preflight runs-on: ubuntu-latest timeout-minutes: 8 @@ -48,9 +50,6 @@ 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 @@ -72,7 +71,6 @@ jobs: 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' @@ -170,7 +168,6 @@ 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 @@ -184,8 +181,7 @@ 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' -or - $cache -notmatch 'ARMIX_SONKU_EXPERIMENTAL_P90_NATIVE_RT:BOOL=ON') { + $cache -notmatch 'ARMIX_SONKU_EXPERIMENTAL_P89_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) @@ -209,9 +205,7 @@ jobs: 'NativeSonKuP88MeasuredEarHeightAndDistanceDrr', 'NativeSonKuP88JuceV9AppliedAckAndV8Restore', 'NativeSonKuP89RoomAnchoredStereoAndP88GoldenParity', - 'NativeSonKuP89JuceV10AppliedAckAndV9Restore', - 'NativeSonKuP90StereoExternalizationSource', - 'NativeSonKuP90JuceV11AppliedAckAndLegacyRestore') + 'NativeSonKuP89JuceV10AppliedAckAndV9Restore') $available = @($tests.tests | ForEach-Object { $_.name }) foreach ($test in $required) { if ($test -notin $available) { throw "SONKU_P82_MISSING_CTEST:$test" } @@ -219,130 +213,9 @@ 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 ARMixSonKuP90NativeTests + cmake --build build --config Release --parallel 2 --target ARMixSonKuP89NativeTests 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 - + ctest --test-dir build -C Release --output-on-failure -R '^NativeSonKuP89JuceV10AppliedAckAndV9Restore$' if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE } - name: Compile actual ARMixConsole Windows GUI and focused real JUCE tests shell: pwsh @@ -406,7 +279,7 @@ jobs: publicRelease = $false physicalAsioQualified = $false dearVrPerceptualParityProven = $false - qualification = 'SONKU_P89_SCOPED_NATIVE_PCM_JUCE_20_CTESTS_HEADPHONE_FAT_PENDING' + qualification = 'SONKU_P89_ROOM_ANCHORED_PCM_JUCE_V10_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() diff --git a/.github/workflows/sonku-p90-windows-field.yml b/.github/workflows/sonku-p90-windows-field.yml index c3b922e23..46dd3937a 100644 --- a/.github/workflows/sonku-p90-windows-field.yml +++ b/.github/workflows/sonku-p90-windows-field.yml @@ -13,6 +13,8 @@ concurrency: cancel-in-progress: true jobs: preflight: + # Historical P9.0 field FAT is not the latest P9.8 release gate. + if: ${{ github.event_name == 'workflow_dispatch' || github.event_name == 'workflow_call' || startsWith(github.head_ref,'research/sonku-p90-') || startsWith(github.head_ref,'feat/sonku-p90-') }} name: Isolated fast PCM and GUI preflight runs-on: ubuntu-latest timeout-minutes: 8 @@ -222,7 +224,7 @@ jobs: 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 + 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 @@ -343,122 +345,3 @@ jobs: 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/docs/SONKU_P98_CI_ROOT_CAUSE_RECOVERY_20261116.md b/docs/SONKU_P98_CI_ROOT_CAUSE_RECOVERY_20261116.md new file mode 100644 index 000000000..262ddb9fd --- /dev/null +++ b/docs/SONKU_P98_CI_ROOT_CAUSE_RECOVERY_20261116.md @@ -0,0 +1,27 @@ +# P9.8 / PR #729 — actual red-CI root causes and controlled repair (2026-11-16) + +## Operator checkpoint + +The approved *Venue · Mega Space* P9.7 commit `fda0eef669e0a59575c489e149662c1bf878c998` remains immutable on `checkpoint/sonku-p97-venue-mega-space-approved-20261116`. No public release or main merge is authorized by this repair. No Venue curve/preset/PCM coefficients change. + +## 1. True v12 Windows CTest failure + +Exact-head workflow run [43828402066](https://github.com/masarray/arsonmix/actions/runs/43828402066) compiled Windows ARMixConsole and JUCE tests successfully, then failed **1/11** in `NativeSonKuP90JuceV11AppliedAckAndLegacyRestore`, test line 299. The negative fixture writes retired physical/mono `renderMode=2` to bytes 50..53 of a 67-byte v12 state. The v11 restoration code rejected this; v12 was accidentally omitted from the v11-only mode whitelist. With typed `sceneVoicing=0`, the generic SonKu core validator also permitted the operator-rejected legacy P8.3 modes. This is a genuine native state-acceptance defect, not an unrelated flaky Windows build. + +**Repair:** P9.8-gated `SonKuSpatialCore::valid` requires mode 0 or 3..9, no legacy LF480, and selected voicing only for mode9. `SonKuSpatialProcessor::restoreUnpublishedState` checks the same whitelist for v11 *and* v12. Negative tests now cover modes 1 and 2 in native JSON, native PCM queue and corrupt v12 restore; also retain positive v11 restore and v12 round-trip, exact Venue/ROOM-OFF/MIX=0 hashing. Do not simply delete the failing assertion. + +## 2. Retired P8.3 negative FAT caused unrelated PR to look red + +[Run 43828402288](https://github.com/masarray/arsonmix/actions/runs/43828402288) failed with `P83_HEADPHONE_FAT_CANDIDATE ... REJECTED_LOW_ENERGY_OR_SPECTRAL_HOLE`. This intentionally negative research mode is neither the current accepted P9.7 Venue nor supported by P9.8. It is NOT repaired or made musically qualified. Its strict test is retained for dedicated `research/sonku-p83-*`/`feat/sonku-p83-*` branches and manual `workflow_dispatch`, instead of firing for every shared SonKu core edit. + +## 3. Two broken 0-job GitHub workflow runs, not a DSP fault + +[Run 43835166813](https://github.com/masarray/arsonmix/actions/runs/43835166813) reports `Invalid workflow file: .github/workflows/sonku-p89-windows-field.yml#L346`. The independent P90 workflow also produced an immediate 0-job push failure. Both files had a **pasted duplicate Windows test block after the first upload-artifact `with:` map**, including an executable PowerShell `if ($LASTEXITCODE ...)` line illegally indented inside YAML. A quoted `ctest -R` PowerShell expression was also unterminated. Both needed source repair. + +**Repair:** Remove the duplicated tail and wrong YAML indentation. Close native CTest regular-expression quoting. Maintain exactly one Windows compile/CTest/portable artifact workflow each. P8.9 is genuinely v10 (without P9.0 CMake flag, no P9.0 tests, state schema 10, P8.9 docs/ZIP/provenance); P9.0 remains v11 (state schema 11). They are scoped to their own historical research branch, explicit manual dispatch, or P9.0 reusable workflow call. No duplicated heavy x64 build on the newer P9.8 PR. + +`scripts/verify_sonku_legacy_workflows.py` runs in the existing P9 source preflight with only Python standard library and blocks reintroducing duplicated artifact steps, unterminated CTest commands, schema mismatch, or accidental P9.0 runtime in P8.9. + +## Verification rule + +Use **exact SHA** of this repair commit, not an older run, and require the full Windows P9.8 JUCE CTest plus exact-head portable provenance and Chromium smoke. Source/PCM spectral ratios do not prove subjective quality; the user still performs level-matched headphone FAT before promoting Signature or Cinema. Historical failed runs remain in GitHub history even if the newly corrected workflow validates successfully. diff --git a/scripts/verify_sonku_legacy_workflows.py b/scripts/verify_sonku_legacy_workflows.py new file mode 100644 index 000000000..3e41c8e6d --- /dev/null +++ b/scripts/verify_sonku_legacy_workflows.py @@ -0,0 +1,46 @@ +#!/usr/bin/env python3 +"""Protect retired SonKu field workflow YAML from duplicated paste errors. + +On 2026-11-16, GitHub produced zero-job failures because a copied Windows +step fragment was appended beneath the artifact upload with-map. Run this +lightweight structural gate before Windows, with no extra dependencies. +GitHub's actual workflow parser remains authoritative. +""" +from pathlib import Path +import re + +for flavor, path in { + "P89": Path(".github/workflows/sonku-p89-windows-field.yml"), + "P90": Path(".github/workflows/sonku-p90-windows-field.yml"), +}.items(): + source = path.read_text(encoding="utf-8") + lines = source.splitlines() + assert len(lines) < 375, (path, "duplicate field job", len(lines)) + assert source.count("actions/upload-artifact@v4") == 1, path + assert source.count("- name: Compile actual ARMixConsole Windows GUI") == 1, path + assert source.count("compression-level: 0") == 1, path + assert "workflow_dispatch:" in source + assert f"sonku-{flavor.lower()}-field-" in source + assert f"NativeSonKu{flavor}JuceV" in source + assert f"ARMixSonKu{flavor}NativeTests" in source + assert f"stateSchema = {10 if flavor == 'P89' else 11}" in source + if flavor == "P89": + assert "ARMIX_SONKU_EXPERIMENTAL_P90_NATIVE_RT=ON" not in source + assert "P90JuceV11AppliedAckAndLegacyRestore" not in source + assert "p90TrueExternalSpeaker = $true" not in source + else: + assert "ARMIX_SONKU_EXPERIMENTAL_P90_NATIVE_RT=ON" in source + assert "workflow_call:" in source + assert re.search( + rf"ctest --test-dir build -C Release --output-on-failure -R " + rf"'\^NativeSonKu{flavor}JuceV\d+AppliedAckAnd\w+\$'", + source, + ), (path, "unterminated native CTest expression") + trailer = source.split("- uses: actions/upload-artifact@v4", 1)[1] + assert not re.search(r"(?m)^\s+- name:", trailer), path + assert not re.search(r"(?m)^\s+if \(\$LASTEXITCODE", trailer), path + allowed = ("name:", "with:", "path:", "if-no-files-found:", + "retention-days:", "compression-level:", "#") + assert all(not line.strip() or line.lstrip().startswith(allowed) + for line in trailer.splitlines()), (path, "invalid upload trailer") +print("SONKU_LEGACY_P89_P90_WORKFLOW_STRUCTURE_PASSED")