From 1d4d33ee0278205d3e624325e6912512558179eb Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Sat, 14 Nov 2026 21:48:49 +0700 Subject: [PATCH 1/9] dsp(sonku P8.2): shared six-wall bandwise absorption and Eyring room decay calibration --- engine/builtin_fx/sonku/SonKuRoomMaterials.h | 89 ++++++++++++++++++++ 1 file changed, 89 insertions(+) create mode 100644 engine/builtin_fx/sonku/SonKuRoomMaterials.h diff --git a/engine/builtin_fx/sonku/SonKuRoomMaterials.h b/engine/builtin_fx/sonku/SonKuRoomMaterials.h new file mode 100644 index 000000000..99b00bb23 --- /dev/null +++ b/engine/builtin_fx/sonku/SonKuRoomMaterials.h @@ -0,0 +1,89 @@ +// SPDX-License-Identifier: AGPL-3.0-only +#pragma once +#include +#include +#include +#include + +// Independent, parametric acoustic research material: NOT a measured room IR. +// One surface absorption TABLE is used by both 6-boundary image-source ER +// and the late FDN Eyring-style RT60 calibration. Frequencies are *coarse* +// LF (<250Hz), MID (250-4.8kHz) and HF (>4.8kHz); no proprietary assets. +// All sqrt/log/exp occur at prepare(), NEVER in the PCM callback. +namespace armix::sonku::room82 { +enum class Family : std::uint8_t { Studio=0, Chamber=1, Hall=2 }; +static constexpr int boundaries=6, bands=3; +using Bands=std::array; +using Surfaces=std::array; +struct Dimensions {float width,depth,height;}; +inline constexpr std::array dimensions{{ + {7.2f,7.2f,3.2f}, + {14.4f,14.4f,4.8f}, + {28.8f,28.8f,7.2f} +}}; +// Order: left,right,front,back,floor,ceiling. +// This is INTENSITY ABSORPTION (0..1), not impulse amplitude nor a known +// dearVR preset. Profiles are plausible illustrative materials only. +inline constexpr std::array absorption{{ + {{ // damped studio, realistic shorter MID/HF decay + {{.16f,.26f,.35f}}, {{.16f,.26f,.35f}}, + {{.16f,.28f,.40f}}, {{.16f,.28f,.40f}}, + {{.14f,.25f,.48f}}, {{.23f,.38f,.54f}} + }}, + {{ // lightly furnished medium chamber + {{.22f,.24f,.32f}}, {{.22f,.24f,.32f}}, + {{.22f,.25f,.34f}}, {{.22f,.25f,.34f}}, + {{.20f,.24f,.40f}}, {{.24f,.27f,.43f}} + }}, + {{ // larger reverberant hall + {{.19f,.26f,.37f}}, {{.19f,.26f,.37f}}, + {{.18f,.25f,.36f}}, {{.18f,.25f,.36f}}, + {{.20f,.28f,.48f}}, {{.22f,.28f,.50f}} + }} +}}; +constexpr Family familyForWidth(float width) noexcept { + return width<10.f?Family::Studio:width<20.f?Family::Chamber:Family::Hall; +} +constexpr int index(Family family) noexcept { + return static_cast(family); +} +constexpr bool validMaterials() noexcept { + for(const auto& room:absorption) + for(const auto& surface:room) + for(float a:surface) + if(!(a>0.f && a<.95f))return false; + return true; +} +static_assert(validMaterials()); +inline std::array preparePressure() noexcept { + std::array pressure{}; + for(int room=0;room<3;++room) + for(int wall=0;wall area{side,side,front,front,floor,floor}; + const float surface=2.f*(side+front+floor); + const float volume=d.width*d.depth*d.height; + Bands seconds{}; + for(int band=0;band Date: Sat, 14 Nov 2026 21:49:55 +0700 Subject: [PATCH 2/9] dsp(sonku P8.2): six-image wall-specific 3-band absorption after directional HRIR, zero RT heap/workers --- .../builtin_fx/sonku/SonKuEarlyReflections.h | 78 ++++++++++++++++++- 1 file changed, 75 insertions(+), 3 deletions(-) diff --git a/engine/builtin_fx/sonku/SonKuEarlyReflections.h b/engine/builtin_fx/sonku/SonKuEarlyReflections.h index 4af600b96..745c0910b 100644 --- a/engine/builtin_fx/sonku/SonKuEarlyReflections.h +++ b/engine/builtin_fx/sonku/SonKuEarlyReflections.h @@ -6,6 +6,9 @@ #include #include #include "SonKuMeasuredHrir.h" +#if defined(SONKU_P82_MULTIBAND_ROOM_RESEARCH) && SONKU_P82_MULTIBAND_ROOM_RESEARCH +#include "SonKuRoomMaterials.h" +#endif // The full licensed multi-elevation dataset and geometry are excluded from // default/public builds at preprocess time: no extra DSP or data cost. #if defined(SONKU_P7_MEASURED_ELEVATION_RESEARCH) && SONKU_P7_MEASURED_ELEVATION_RESEARCH @@ -60,6 +63,15 @@ class SonKuEarlyReflections final { if(!std::isfinite(rate) || (std::abs(rate-44100.)>.1 && std::abs(rate-48000.)>.1))return false; rate_=static_cast(rate); +#if defined(SONKU_P82_MULTIBAND_ROOM_RESEARCH) && SONKU_P82_MULTIBAND_ROOM_RESEARCH + multibandRoom_=profile==SonKuReflectionProfile::SixSurfaceKemarResearch; + // All per-wall material pressure coefficients and crossover poles + // are prepared OFF the realtime callback; audio only multiplies. + preparedWallPressure_=room82::preparePressure(); + constexpr double pi=3.14159265358979323846; + roomLowAlpha_=static_cast(1.-std::exp(-2.*pi*250./rate)); + roomHighAlpha_=static_cast(1.-std::exp(-2.*pi*4800./rate)); +#endif delaySlew_=static_cast(1.-std::exp(-1./(rate*0.024))); gainSlew_=static_cast(1.-std::exp(-1./(rate*0.012))); amountSlew_=static_cast(1.-std::exp(-1./(rate*0.010))); @@ -183,6 +195,15 @@ class SonKuEarlyReflections final { #endif if(!active() && enabled && amount>0.f){ validFrames_=0; lowpass_.fill(0.f); +#if defined(SONKU_P82_MULTIBAND_ROOM_RESEARCH) && SONKU_P82_MULTIBAND_ROOM_RESEARCH + // No stale material-filter energy after OFF→ON. Small, fixed + // 2-source×6-wall state reset; never clear the 8192-frame ring. + if(multibandRoom_) + for(auto& source:tap_)for(auto& tap:source) { + tap.bandLowL=tap.bandWideL=0.f; + tap.bandLowR=tap.bandWideR=0.f; + } +#endif } if(enabled){ geometry_=g;custom_=true;shape_=SonKuRoomShape::Square; @@ -219,8 +240,17 @@ class SonKuEarlyReflections final { for(int s=0;s4800Hz. + const auto bandpass=[&](float sample, + float& low,float& wide) noexcept -> float { + low+=roomLowAlpha_*(sample-low); + wide+=roomHighAlpha_*(sample-wide); + return p.materialPressure[0]*low+ + p.materialPressure[1]*(wide-low)+ + p.materialPressure[2]*(sample-wide); + }; + l=bandpass(l,p.bandLowL,p.bandWideL); + r=bandpass(r,p.bandLowR,p.bandWideR); + } +#endif output.left+=p.gainL*l; output.right+=p.gainR*r; }else{ @@ -360,6 +408,10 @@ class SonKuEarlyReflections final { float targetGainL=0.f,targetGainR=0.f; using EarBank=std::array,2>; EarBank kernel{},targetKernel{}; +#if defined(SONKU_P82_MULTIBAND_ROOM_RESEARCH) && SONKU_P82_MULTIBAND_ROOM_RESEARCH + room82::Bands materialPressure{1.f,1.f,1.f}; + float bandLowL=0.f,bandWideL=0.f,bandLowR=0.f,bandWideR=0.f; +#endif }; float delayed(int source,float delay) const noexcept { // Fractional delay interpolated in a fixed-size power-of-two ring. @@ -422,9 +474,19 @@ class SonKuEarlyReflections final { // New distance studies use fixed 1.6m acoustic reference: // pressure at a reflected path falls with 1/path. Legacy // calculations are untouched at the accepted radius. - const float level=.28f*walls[wall]* +#if defined(SONKU_P82_MULTIBAND_ROOM_RESEARCH) && SONKU_P82_MULTIBAND_ROOM_RESEARCH + const float wallGain=multibandRoom_?1.f:walls[wall]; +#else + const float wallGain=walls[wall]; +#endif + const float level=.28f*wallGain* ((custom_?1.6f:sourceDistance)/path); auto& tap=tap_[source][wall]; +#if defined(SONKU_P82_MULTIBAND_ROOM_RESEARCH) && SONKU_P82_MULTIBAND_ROOM_RESEARCH + if(multibandRoom_)tap.materialPressure= + preparedWallPressure_[room82::index( + room82::familyForWidth(geometry_.widthMeters))][wall]; +#endif tap.targetDelayL=std::clamp(common+(directionalHrir_?0.f:earDelta),1.f, static_cast(ringFrames-3)); tap.targetDelayR=std::clamp(common-(directionalHrir_?0.f:earDelta),1.f, @@ -484,6 +546,11 @@ class SonKuEarlyReflections final { const auto arrival=sixsurface::image( heights,horizontalDistance,sourceAz,boundary,rate_); auto& p=tap_[source][wallCount+i]; +#if defined(SONKU_P82_MULTIBAND_ROOM_RESEARCH) && SONKU_P82_MULTIBAND_ROOM_RESEARCH + if(multibandRoom_)p.materialPressure= + preparedWallPressure_[room82::index( + room82::familyForWidth(geometry_.widthMeters))][wallCount+i]; +#endif // Measured HRIR already contains directional ITD/ILD. // No invented extra ear delay, EQ or pseudo elevation. const float delay=std::clamp(arrival.delaySamples,1.f, @@ -508,6 +575,11 @@ class SonKuEarlyReflections final { std::array,sourceCount> history_{}; std::array,sourceCount> tap_{}; std::array lowpass_{}; +#if defined(SONKU_P82_MULTIBAND_ROOM_RESEARCH) && SONKU_P82_MULTIBAND_ROOM_RESEARCH + std::array preparedWallPressure_{}; + float roomLowAlpha_=0.f,roomHighAlpha_=0.f; + bool multibandRoom_=false; +#endif using Bank=const std::int16_t (*)[2][hrir::taps]; Bank hrirBank_=nullptr; float rate_=0.f,delaySlew_=0.f,gainSlew_=0.f,amountSlew_=0.f,kernelSlew_=0.f; From 761c1433854029a99f1125dd29d453eb1fe1e501 Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Sat, 14 Nov 2026 21:51:00 +0700 Subject: [PATCH 3/9] dsp(sonku P8.2): shared Eyring-derived LF/MID/HF RT60 in 8-line FDN feedback, fully prepared coefficient tables --- engine/builtin_fx/sonku/SonKuMusicalReverb.h | 78 +++++++++++++++++++- 1 file changed, 74 insertions(+), 4 deletions(-) diff --git a/engine/builtin_fx/sonku/SonKuMusicalReverb.h b/engine/builtin_fx/sonku/SonKuMusicalReverb.h index ab76c230e..c2f273ef7 100644 --- a/engine/builtin_fx/sonku/SonKuMusicalReverb.h +++ b/engine/builtin_fx/sonku/SonKuMusicalReverb.h @@ -4,6 +4,9 @@ #include #include #include +#if defined(SONKU_P82_MULTIBAND_ROOM_RESEARCH) && SONKU_P82_MULTIBAND_ROOM_RESEARCH +#include "SonKuRoomMaterials.h" +#endif // Compact eight-line stereo FDN for musical late ambience. The 8x8 Hadamard // feedback matrix is orthogonal (unit-energy): stability depends solely on @@ -29,6 +32,16 @@ class SonKuMusicalReverb final { preset_=SonKuReverbPreset::StudioGlue; configure(); // All room-aware coefficients prepared once OFF the PCM callback. +#if defined(SONKU_P82_MULTIBAND_ROOM_RESEARCH) && SONKU_P82_MULTIBAND_ROOM_RESEARCH + constexpr double pi=3.14159265358979323846; + multibandRoom_=true; // compile-time isolated research-only mode + bandLowAlpha_=static_cast(1.-std::exp(-2.*pi*250./rate)); + bandHighAlpha_=static_cast(1.-std::exp(-2.*pi*4800./rate)); + for(int room=0;room<3;++room) + preparedBands_[room]=prepareBandProgram(static_cast(room)); + targetBandGain_=preparedBands_[0].gains; + bandGain_=targetBandGain_; +#endif prepared_[0]=makeCoefficients(.78f,5900.f); prepared_[1]=makeCoefficients(1.28f,7000.f); prepared_[2]=makeCoefficients(2.05f,6000.f); @@ -41,6 +54,9 @@ class SonKuMusicalReverb final { void reset() noexcept { for(auto& line:memory_)line.fill(0.f); lowpass_.fill(0.f); +#if defined(SONKU_P82_MULTIBAND_ROOM_RESEARCH) && SONKU_P82_MULTIBAND_ROOM_RESEARCH + bandLow_.fill(0.f);bandWide_.fill(0.f); +#endif write_=0;amount_=0.f;validFrames_=0; // The target amount is a CONTROL-side setting and survives resetting // host transport/processor so the same program can restart cleanly. @@ -69,7 +85,20 @@ class SonKuMusicalReverb final { preset!=SonKuReverbPreset::AiryChamber && preset!=SonKuReverbPreset::LargeRoom)|| !std::isfinite(amount)||amount<0.f||amount>1.f)return false; - if(!active() && amount>0.f){validFrames_=0;lowpass_.fill(0.f);} + if(!active() && amount>0.f){ + validFrames_=0;lowpass_.fill(0.f); +#if defined(SONKU_P82_MULTIBAND_ROOM_RESEARCH) && SONKU_P82_MULTIBAND_ROOM_RESEARCH + bandLow_.fill(0.f);bandWide_.fill(0.f); +#endif + } +#if defined(SONKU_P82_MULTIBAND_ROOM_RESEARCH) && SONKU_P82_MULTIBAND_ROOM_RESEARCH + if(multibandRoom_) { + // A complete 3-band per-delay RT60 program is precomputed at + // prepare. Native SPSC/audio edit only copies fixed POD tables. + targetBandGain_=preparedBands_[static_cast(preset)].gains; + if(!realtimeMode_)bandGain_=targetBandGain_; + } +#endif const auto& coefficients=prepared_[static_cast(preset)]; targetGain_=coefficients.gains; targetDamp_=coefficients.damping; @@ -94,10 +123,27 @@ class SonKuMusicalReverb final { const int index=(write_-delay_[i])&(ringFrames-1); const float sample=(realtimeMode_&&validFrames_ gains{}; float damping=0.f; }; +#if defined(SONKU_P82_MULTIBAND_ROOM_RESEARCH) && SONKU_P82_MULTIBAND_ROOM_RESEARCH + struct BandProgram { + std::array,room82::bands> gains{}; + room82::Bands estimatedRt60{}; + }; + BandProgram prepareBandProgram(room82::Family family) const noexcept { + BandProgram program{}; + program.estimatedRt60=room82::eyringRt60(family); + for(int band=0;band(delay_[i])/ + (sampleRate_*program.estimatedRt60[band])); + return program; + } +#endif Coefficients makeCoefficients(float rt60,float cutoff) const noexcept { Coefficients prepared{}; constexpr float pi=3.14159265358979323846f; @@ -164,6 +226,14 @@ class SonKuMusicalReverb final { static_assert((ringFrames&(ringFrames-1))==0); std::array,lineCount> memory_{}; std::array lowpass_{}; +#if defined(SONKU_P82_MULTIBAND_ROOM_RESEARCH) && SONKU_P82_MULTIBAND_ROOM_RESEARCH + std::array bandLow_{},bandWide_{}; + std::array preparedBands_{}; + std::array,room82::bands> + bandGain_{},targetBandGain_{}; + float bandLowAlpha_=0.f,bandHighAlpha_=0.f; + bool multibandRoom_=false; +#endif std::array gain_{},targetGain_{}; std::array prepared_{}; std::array delay_{}; From cf8d37ac5673397b966b8228ffc4fd0e48edcc20 Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Sat, 14 Nov 2026 21:51:47 +0700 Subject: [PATCH 4/9] build(sonku P8.2): separate fail-closed three-band room research switch, native JUCE and objective CTest --- CMakeLists.txt | 32 +++++++++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5ea4fc092..ba32b706b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -28,6 +28,15 @@ if(ARMIX_SONKU_EXPERIMENTAL_P8_TRANSPARENT_BASS AND NOT ARMIX_SONKU_EXPERIMENTAL_MUSIC_SAFE) message(FATAL_ERROR "P8 requires the isolated P7.5 music-safe research profile") endif() +# P8.2 six-wall frequency-dependent material + shared LF/MID/HF late RT60. +# Separate from the P8.1 listening checkpoint and always OFF publicly. +option(ARMIX_SONKU_EXPERIMENTAL_P82_ROOM + "Enable independently gated P8.2 six-surface 3-band research room" + OFF) +if(ARMIX_SONKU_EXPERIMENTAL_P82_ROOM AND + NOT ARMIX_SONKU_EXPERIMENTAL_P8_TRANSPARENT_BASS) + message(FATAL_ERROR "P8.2 room requires P8.1 transparent-bass experiment") +endif() set(CMAKE_CXX_STANDARD 20) set(CMAKE_CXX_STANDARD_REQUIRED ON) @@ -227,7 +236,8 @@ target_compile_definitions(ARMixConsole PRIVATE $<$:SONKU_P71_DIRECT_XYZ_RESEARCH=1> $<$:SONKU_P72_NATIVE_XYZ_RT=1> $<$:SONKU_P75_MUSIC_SAFE_RESEARCH=1> - $<$:SONKU_P80_TRANSPARENT_BASS_RESEARCH=1>) + $<$:SONKU_P80_TRANSPARENT_BASS_RESEARCH=1> + $<$:SONKU_P82_MULTIBAND_ROOM_RESEARCH=1>) if(WIN32) # Windows retains its proven ASIO-first / WASAPI / static WebView2 distribution. # Never link Windows loader or sound APIs into macOS/Linux builds. @@ -374,6 +384,26 @@ if(BUILD_TESTING) SONKU_P80_TRANSPARENT_BASS_RESEARCH=1) add_test(NAME NativeSonKuP80TransparentBassStereoPhaseAndRoomDiagnostic COMMAND ARMixSonKuP80TonalEvidenceTests) + if(ARMIX_SONKU_EXPERIMENTAL_P82_ROOM) + # This is the actual live JUCE SonKu instance, not an offline + # room-only approximation. Preserve P8.1 as an unmodified fallback. + target_compile_definitions(ARMixSonKuP72NativeTests PRIVATE + SONKU_P82_MULTIBAND_ROOM_RESEARCH=1) + target_compile_definitions(ARMixSonKuP80TonalEvidenceTests PRIVATE + SONKU_P82_MULTIBAND_ROOM_RESEARCH=1) + add_executable(ARMixSonKuP82RoomTests + tests/sonku_p82_sixsurface_multiband_room_test.cpp) + target_compile_features(ARMixSonKuP82RoomTests PRIVATE cxx_std_20) + target_compile_definitions(ARMixSonKuP82RoomTests PRIVATE + SONKU_P7_MEASURED_ELEVATION_RESEARCH=1 + SONKU_P71_DIRECT_XYZ_RESEARCH=1 + SONKU_P72_NATIVE_XYZ_RT=1 + SONKU_P75_MUSIC_SAFE_RESEARCH=1 + SONKU_P80_TRANSPARENT_BASS_RESEARCH=1 + SONKU_P82_MULTIBAND_ROOM_RESEARCH=1) + add_test(NAME NativeSonKuP82SixWallThreeBandRoomTimingDecayAndParity + COMMAND ARMixSonKuP82RoomTests) + endif() endif() endif() endif() From 5d1e0e87b1d7953de358a0ab5e3cf1e6422ea0d5 Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Sat, 14 Nov 2026 21:53:22 +0700 Subject: [PATCH 5/9] test(sonku P8.2): measure six-wall timing, three-band RT60 and live block invariance against real source --- ...nku_p82_sixsurface_multiband_room_test.cpp | 167 ++++++++++++++++++ 1 file changed, 167 insertions(+) create mode 100644 tests/sonku_p82_sixsurface_multiband_room_test.cpp diff --git a/tests/sonku_p82_sixsurface_multiband_room_test.cpp b/tests/sonku_p82_sixsurface_multiband_room_test.cpp new file mode 100644 index 000000000..12e76f12a --- /dev/null +++ b/tests/sonku_p82_sixsurface_multiband_room_test.cpp @@ -0,0 +1,167 @@ +// SPDX-License-Identifier: AGPL-3.0-only +// P8.2 acoustic evidence from same source compiled by the Windows JUCE host. +// Parametric model evidence, NOT an empirical RIR/dearVR comparison. +#if defined(NDEBUG) +#undef NDEBUG +#endif +#if !defined(SONKU_P82_MULTIBAND_ROOM_RESEARCH) || !SONKU_P82_MULTIBAND_ROOM_RESEARCH +#error This contract must run with the P8.2 3-band room enabled +#endif +#include "../engine/builtin_fx/sonku/SonKuRoomMaterials.h" +#include "../engine/builtin_fx/sonku/SonKuSpatialCore.h" +#include "../engine/builtin_fx/sonku/SonKuEarlyReflections.h" +#include "../engine/builtin_fx/sonku/SonKuMusicalReverb.h" +#include +#include +#include +#include +#include +#include +#include + +using namespace armix::sonku; +namespace ac=armix::sonku::room82; +constexpr float pi=3.14159265358979323846f; +constexpr auto measured=SonKuReflectionProfile::SixSurfaceKemarResearch; + +static SonKuRoomGeometry geometry(ac::Family f){ + const auto& d=ac::dimensions[ac::index(f)]; + return {d.width,d.depth,1.6f,d.height,1.45f,1.45f}; +} +static void materialsAndRt60(){ + assert(ac::validMaterials()); + const auto p=ac::preparePressure(); + std::array rt{}; + for(int room=0;room<3;++room){ + const auto fam=static_cast(room); + rt[room]=ac::eyringRt60(fam); + assert(SonKuEarlyReflections::validGeometry(geometry(fam))); + for(int wall=0;wall0.f&&pressure<1.f); + assert(std::abs(pressure*pressure+ + ac::absorption[room][wall][band]-1.f)<1e-5f); + } + assert(rt[room][0]>rt[room][1]); + assert(rt[room][1]>rt[room][2]); + for(float seconds:rt[room])assert(seconds>=.18f&&seconds<3.2f); + std::printf("P82_RT60_MODEL,%d,LF=%.3f,MID=%.3f,HF=%.3f\n", + room,rt[room][0],rt[room][1],rt[room][2]); + } + assert(rt[0][1] < rt[1][1] && rt[1][1] < rt[2][1]); + // These are deliberate illustrative rooms, not measured lab RT60. + assert(rt[0][1]>.28f&&rt[0][1]<.55f); + assert(rt[1][1]>.65f&&rt[1][1]<1.1f); + assert(rt[2][1]>1.0f&&rt[2][1]<1.6f); +} +static double erImpulse(double rate,ac::Family family){ + SonKuEarlyReflections room; + assert(room.prepare(rate,measured)); + const auto g=geometry(family); + assert(room.setRealtimeRoom(g,.65f,true)); + constexpr int frames=9000; + double energy=0.,energyAfterWall=0.; + int first=-1; + for(int i=0;i1e-13&&first<0)first=i; + energy+=p; + if(i>350)energyAfterWall+=p; + } + std::printf("P82_ER,%.0f,%d,first=%d,total=%.10f,after350=%.10f\n", + rate,ac::index(family),first,energy,energyAfterWall); + assert(first>0 && first<5000); + assert(energy>1e-7); + assert(energyAfterWall>1e-9); + return energyAfterWall; +} +static std::array reverbTail(double rate,ac::Family family,float hz){ + SonKuMusicalReverb reverb; + assert(reverb.prepare(rate)); + assert(reverb.setRealtimeProgram( + static_cast(ac::index(family)),.7f)); + const int stimulus=static_cast(rate*.13); + const int duration=static_cast(rate*1.6); + double early=0.,late=0.; + for(int i=0;i(rate)):0.f; + const auto y=reverb.process(x,x); + assert(std::isfinite(y.left)&&std::isfinite(y.right)); + assert(std::abs(y.left)<.99f&&std::abs(y.right)<.99f); + const double power=y.left*y.left+y.right*y.right; + const double time=static_cast(i)/rate; + if(time>.24&&time<.46)early+=power; + if(time>.93&&time<1.15)late+=power; + } + const double ratio=late/(early+1e-20); + std::printf("P82_FDN,%.0f,%d,%.0fHz,early=%.9f,late=%.9f,ratio=%.8f\n", + rate,ac::index(family),static_cast(hz),early,late,ratio); + assert(early>1e-10); + assert(std::isfinite(ratio)); + return {early,ratio}; +} +static void blockParityAndDynamicRoom(double rate){ + Settings s{}; + s.spacePreset=1;s.roomAmount=.55f;s.ambience=.4f; + s.sourceDistanceMeters=1.6f;s.startAzimuthDegrees=47.f; + s.directElevationDegrees=17.f; + s.stereoSpreadDegrees=65.f; + s.moving=true;s.revolutionSeconds=2.8f;s.outputTrim=.55f; + s.spatialMix=1.f; + assert(valid(s)); + auto make=[&](){ + auto p=std::make_unique(); + assert(p->prepare(rate,measured)); + assert(p->setSettings(s)); + return p; + }; + auto whole=make(),chunks=make(); + constexpr int frames=12288; + std::vector l(frames),r(frames),a(frames),b(frames); + for(int i=0;i(rate)); + const float side=.04f*std::sin(2.f*pi*2100.f*i/static_cast(rate)); + l[i]=a[i]=mid+side; + r[i]=b[i]=mid-side; + } + whole->process(l.data(),r.data(),frames); + for(int i=0;iprocess(a.data()+i,b.data()+i,n); + i+=n; + } + double e=0.; + for(int i=0;i1e-4); +} +int main(){ + materialsAndRt60(); + for(double rate:{44100.,48000.}){ + const auto small=erImpulse(rate,ac::Family::Studio); + const auto large=erImpulse(rate,ac::Family::Hall); + assert(std::abs(small-large)>1e-7); + const auto studioLow=reverbTail(rate,ac::Family::Studio,125.f); + const auto studioHigh=reverbTail(rate,ac::Family::Studio,6000.f); + const auto hallLow=reverbTail(rate,ac::Family::Hall,125.f); + const auto hallHigh=reverbTail(rate,ac::Family::Hall,6000.f); + // The model predicts longer LF than HF decay within each room; + // check that feedback really follows the prepared band-dependent law. + assert(studioLow[1]>studioHigh[1]); + assert(hallLow[1]>hallHigh[1]); + assert(hallLow[1]>studioLow[1]); + blockParityAndDynamicRoom(rate); + } + std::puts("PASS P8.2: six-wall distinct material bands; Eyring 3-band RT60 ordering; independent spatial ER; LF/HF diffuse decay; native PCM block parity at 44.1/48k"); +} From ecf422cca40e8b61dd33113b3e04634b20db9330 Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Sat, 14 Nov 2026 21:54:55 +0700 Subject: [PATCH 6/9] docs(sonku P8.2): explicit room-material/decay model, integrity gates and preserved P8.1 A/B protocol --- ...KU_P82_ACOUSTIC_ROOM_FIELD_FAT_20261114.md | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 docs/SONKU_P82_ACOUSTIC_ROOM_FIELD_FAT_20261114.md diff --git a/docs/SONKU_P82_ACOUSTIC_ROOM_FIELD_FAT_20261114.md b/docs/SONKU_P82_ACOUSTIC_ROOM_FIELD_FAT_20261114.md new file mode 100644 index 000000000..1b3e7904e --- /dev/null +++ b/docs/SONKU_P82_ACOUSTIC_ROOM_FIELD_FAT_20261114.md @@ -0,0 +1,30 @@ +# SonKu P8.2 — six-wall multiband acoustic research / physical FAT + +2026-11-14. **Research only, not a public release.** + +The owner reports that P8.1 audio quality is much better than P7.4/P7.5. The P8.1 tonal and LF preservation code is an immutable A/B checkpoint; the separate P8.2 build must not replace it without physical listening approval. + +## Implementation + +- Same full stereo L/R and measured KEMAR direct HRTF, P8.1 original bass retention, and bank-derived presence compensation. ROOM OFF must remain unchanged. +- Six physically delayed directional image paths: left, right, front, back, floor and ceiling. Each uses a separate three-band intensity absorption material. Pressure reflection = sqrt(1-alpha), with original two-ear HRTF interaural cues intact. The band crossovers are 250 Hz and 4.8 kHz, after each path's binaural HRTF. +- One shared original material model drives a cheap 8-line stereo FDN with prepared, per-delay LF/MID/HF feedback gain and the Eyring room-decay formula. All sqrt, log, exp and coefficient design occurs at prepare time, not inside the PCM callback. +- Mode is isolated under ARMIX_SONKU_EXPERIMENTAL_P82_ROOM=ON and requires the three previous XYZ, P7.5 and P8.1 research switches. All switches default OFF. No second PCM, worker, heap, mutex, GUI DSP authority, FX state schema change or session migration. +- The parameter tables are **illustrative**, not measured RIR or copies of dearVR. Estimated LF / MID / HF RT60 in seconds: Studio 0.717 / 0.392 / 0.231; Chamber 0.933 / 0.802 / 0.483; Hall 1.716 / 1.219 / 0.650. These are model predictions only, not verified measured T20/T30. + +## Automated gates + +1. Source P8.2 test checks material absorption and pressure identity, geometry, theoretical RT60 ordering, time-domain six-wall image reflections, early/late energy, LF/HF decay separation, and native dynamic Room + motion chunk parity at 44.1/48 kHz. +2. Existing P8.1 frequency/anti-phase/bypass evidence must PASS again under the P8.2 flag, plus previously passed XYZ/native ACK and v1/v2/v3 state CTests. +3. Full Windows JUCE executable, approved embedded GUI resource hashes, exact source commit, PE provenance, MIT KEMAR attribution notice and FAT guide checksum must match the uploaded portable artifact. +4. **Not yet passed:** real room impulse response EDC, measured DRR, IACC, T20/T30, blind loudness matched dearVR A/B, physical ASIO p95/p99/XRUN and real music listening. Synthetic tests alone cannot certify equivalent sound. + +## Listening A/B (separate folders) + +Keep the P8.1 artifact (Actions artifact 14117224898) in its own writable extracted folder; unpack P8.2 separately with portable_mode.txt. Low headphone volume, ASIO 48k/256, real stereo input, WIRE to MAIN, Master Mono OFF, one FX insert, ORBIT OFF, SIDE WIDTH 60 degrees, GAIN -6 dB. Compare direct and bass with ROOM OFF first: P8.1 and P8.2 must sound the same. + +Then enable Square 7.2, Reflections 55%, Ambience 30%, source 1.6m; audition solo vocal, bass/drums, acoustic percussion and natural recorded room tails. Change room to 14.4 and 28.8 and move XYZ near each surface. ROOM ON should increase credible spaciousness, direction and decay without making center vocal hollow or bass thin. + +For dearVR PRO 2 comparison, record actual Stereo Width, source XYZ, room reflection and late reverb settings, Clarity and Bass Boost OFF and ON separately. Match loudness and headphone/ASIO chain. If P8.2 sounds worse than P8.1, stop and reject this experimental build; do not increase blanket wet gain. + +No release, merge, or 'dearVR-equivalent' claim until owner approval and objective/perceptual room tests. Architecture: docs/SONKU_P8_DEARVR_BENCHMARK_ACOUSTIC_ARCHITECTURE_20261114.md. From 184cc37b6f0686ef3c92f5a9df32e659d0230abe Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Sat, 14 Nov 2026 21:55:52 +0700 Subject: [PATCH 7/9] bridge(sonku P8.2): expose honest room capability only from admitted native measured FX snapshot --- src/Main.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/Main.cpp b/src/Main.cpp index 3f7c73889..c80a14b07 100644 --- a/src/Main.cpp +++ b/src/Main.cpp @@ -3045,6 +3045,13 @@ class ConsoleWindow final : public juce::DocumentWindow, private juce::Timer, pr if(processor && processor->preparedReflectionProfile()== armix::sonku::SonKuReflectionProfile::SixSurfaceKemarResearch) reply->setProperty("p8TransparentBass",true); +#endif +#if defined(SONKU_P82_MULTIBAND_ROOM_RESEARCH) && SONKU_P82_MULTIBAND_ROOM_RESEARCH + // Read-only P8.2 room capability; only a real admitted measured + // SonKu FX instance can claim it in the identity-bound snapshot. + if(processor && processor->preparedReflectionProfile()== + armix::sonku::SonKuReflectionProfile::SixSurfaceKemarResearch) + reply->setProperty("p82MultibandRoom",true); #endif if(processor) { reply->setProperty("settings", From 9739356623fb023b6f7edbb62cff56256dbf94e8 Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Sat, 14 Nov 2026 21:56:06 +0700 Subject: [PATCH 8/9] ux(sonku P8.2): label native six-surface multiband research room only on identity-bound ACK --- site/preview-v2/assets/mixer-native-sonku.js | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/site/preview-v2/assets/mixer-native-sonku.js b/site/preview-v2/assets/mixer-native-sonku.js index bff33a351..d2721f16d 100644 --- a/site/preview-v2/assets/mixer-native-sonku.js +++ b/site/preview-v2/assets/mixer-native-sonku.js @@ -173,7 +173,7 @@ const depthLayers={far:$("skFarSources"),near:$("skNearSources")}; const mount=()=>{if(!root.isConnected)document.body.append(root)}; if(document.readyState==="loading")document.addEventListener("DOMContentLoaded",mount,{once:true});else mount(); let current=null,accepted=defaults(),draft=defaults(),pending=null,latest=null, - xyzCapable=false,musicSafeStereo=false,p8TransparentBass=false, + xyzCapable=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; @@ -231,8 +231,9 @@ function render(){ if(!rangeEdits.has("skElevation"))elevation.value=String(s.directElevationDegrees); $("skElevationValue").textContent=s.directElevationDegrees.toFixed(1)+"°"; } - root.querySelector(".sk-stage-caption").textContent=p8TransparentBass - ?"HEADPHONES · P8 STEREO BASS + MEASURED 3D HRTF · EXPERIMENT" + root.querySelector(".sk-stage-caption").textContent=p82MultibandRoom + ?"HEADPHONES · P8.2 SIX-WALL 3-BAND ROOM · EXPERIMENT" + :p8TransparentBass?"HEADPHONES · P8 STEREO BASS + MEASURED 3D HRTF · EXPERIMENT" :musicSafeStereo?"HEADPHONES · MEASURED CENTER 3D HRTF + MUSIC SIDE · EXPERIMENT" :xyzCapable?"HEADPHONES · MEASURED 3D HRIR · 44.1 / 48 kHz" :"HEADPHONES · HRIR 0° ELEVATION · 44.1 / 48 kHz"; @@ -254,7 +255,8 @@ function render(){ // redrawn at 60 Hz. The native audio callback remains the time authority. drawSpeakers(); $("skMode").textContent=native()?(context()? - (p8TransparentBass?"NATIVE P8 ACOUSTICS · RESEARCH": + (p82MultibandRoom?"NATIVE P8.2 ROOM · RESEARCH": + p8TransparentBass?"NATIVE P8 ACOUSTICS · RESEARCH": musicSafeStereo?"NATIVE MUSIC SAFE · RESEARCH":"NATIVE HRTF"): "NATIVE UNAVAILABLE"):"VISUAL ONLY · NO AUDIO"; } @@ -403,6 +405,7 @@ backend()?.addEventListener?.("arMixBuiltinSonKuSnapshot",r=>{ xyzCapable=measured; musicSafeStereo=measured && r.musicSafeStereo===true; p8TransparentBass=musicSafeStereo && r.p8TransparentBass===true; + p82MultibandRoom=p8TransparentBass && r.p82MultibandRoom===true; readId="";readSentAt=0; if(pending) { if(!pending.ack || r.appliedRequestId!==pending.requestId){ @@ -425,7 +428,7 @@ backend()?.addEventListener?.("arMixBuiltinSonKuSnapshot",r=>{ } render(); }); -$("skClose").addEventListener("click",()=>{root.hidden=true;current=null;xyzCapable=false;musicSafeStereo=false;p8TransparentBass=false; +$("skClose").addEventListener("click",()=>{root.hidden=true;current=null;xyzCapable=false;musicSafeStereo=false;p8TransparentBass=false;p82MultibandRoom=false; cancelLiveTimer();pending=null;latest=null;readId="";readSentAt=0;dialDrag=null; drag=null;rangeEdits.clear();gestureStart.clear();lastLiveAt=0; if(clock!==null){clearInterval(clock);clock=null;} From 751ff03fa27fbf1cf623eda002af50978c7888e5 Mon Sep 17 00:00:00 2001 From: Ari Sulistiono Date: Sat, 14 Nov 2026 21:56:33 +0700 Subject: [PATCH 9/9] ci(sonku P8.2): six-wall/FDN evidence plus full native Windows executable, exact-source portable FAT --- .../sonku-p82-acoustic-windows-field.yml | 235 ++++++++++++++++++ 1 file changed, 235 insertions(+) create mode 100644 .github/workflows/sonku-p82-acoustic-windows-field.yml diff --git a/.github/workflows/sonku-p82-acoustic-windows-field.yml b/.github/workflows/sonku-p82-acoustic-windows-field.yml new file mode 100644 index 000000000..15ff4e144 --- /dev/null +++ b/.github/workflows/sonku-p82-acoustic-windows-field.yml @@ -0,0 +1,235 @@ +name: SonKu P8.2 six-wall and three-band room acoustic native field candidate +# Isolated opt-in full JUCE app build; no public installer, tag or release. +on: + pull_request: + types: [opened, reopened, synchronize] + paths: + - '.github/workflows/sonku-p82-acoustic-windows-field.yml' + - 'src/Main.cpp' + - 'src/SonKuNativeBridgeContract.h' + - 'src/LiveAudioEngine.h' + - 'engine/builtin_fx/SonKuSpatialProcessor.h' + - 'engine/builtin_fx/sonku/**' + - 'site/preview-v2/assets/mixer-native-sonku.js' + - 'CMakeLists.txt' + - 'tests/sonku_p72_*' + - 'tests/sonku_p75_*' + - 'tests/sonku_p80_*' + - 'tests/sonku_p82_*' + workflow_dispatch: +permissions: + contents: read +concurrency: + group: sonku-p82-physical-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true +jobs: + preflight: + name: Isolated fast PCM and GUI preflight + runs-on: ubuntu-latest + timeout-minutes: 8 + steps: + - uses: actions/checkout@v4 + with: + ref: ${{ github.event.pull_request.head.sha || github.sha }} + persist-credentials: false + - name: Native JS and source GUI capability checks + run: | + set -euo pipefail + node --check site/preview-v2/assets/mixer-native-sonku.js + node tests/sonku_p73_gui_contract_test.js + grep -q "'FIELD_PREVIEW_FULL_CTEST_NOT_RUN'" scripts/m3e_fat_evidence_gate.mjs + python -m unittest discover -s tests -p native_peq_assembly_test.py + - name: 44.1 and 48 kHz prepared PCM source regression + run: | + set -euo pipefail + g++ -std=c++20 -O2 -Wall -Wextra -Werror -pedantic \ + -DSONKU_P7_MEASURED_ELEVATION_RESEARCH=1 \ + -DSONKU_P71_DIRECT_XYZ_RESEARCH=1 \ + -DSONKU_P72_NATIVE_XYZ_RT=1 \ + tests/sonku_p72_realtime_xyz_test.cpp -o /tmp/sonku-p75-pcm + /tmp/sonku-p75-pcm + g++ -std=c++20 -O2 -Wall -Wextra -Werror -pedantic \ + -DSONKU_P7_MEASURED_ELEVATION_RESEARCH=1 \ + -DSONKU_P71_DIRECT_XYZ_RESEARCH=1 \ + -DSONKU_P72_NATIVE_XYZ_RT=1 \ + -DSONKU_P75_MUSIC_SAFE_RESEARCH=1 \ + tests/sonku_p75_stereo_integrity_test.cpp -o /tmp/sonku-p75-music + /tmp/sonku-p75-music + g++ -std=c++20 -O2 -Wall -Wextra -Werror -pedantic \ + -DSONKU_P7_MEASURED_ELEVATION_RESEARCH=1 \ + -DSONKU_P71_DIRECT_XYZ_RESEARCH=1 \ + -DSONKU_P72_NATIVE_XYZ_RT=1 \ + -DSONKU_P75_MUSIC_SAFE_RESEARCH=1 \ + -DSONKU_P80_TRANSPARENT_BASS_RESEARCH=1 \ + tests/sonku_p80_tonal_room_evidence_test.cpp -o /tmp/sonku-p80-evidence + /tmp/sonku-p80-evidence | tee /tmp/sonku-p80-acoustic-evidence.csv + grep -q '^PASS P8:' /tmp/sonku-p80-acoustic-evidence.csv + g++ -std=c++20 -O2 -Wall -Wextra -Werror -pedantic \ + -DSONKU_P7_MEASURED_ELEVATION_RESEARCH=1 \ + -DSONKU_P71_DIRECT_XYZ_RESEARCH=1 \ + -DSONKU_P72_NATIVE_XYZ_RT=1 \ + -DSONKU_P75_MUSIC_SAFE_RESEARCH=1 \ + -DSONKU_P80_TRANSPARENT_BASS_RESEARCH=1 \ + -DSONKU_P82_MULTIBAND_ROOM_RESEARCH=1 \ + tests/sonku_p82_sixsurface_multiband_room_test.cpp -o /tmp/sonku-p82-room + /tmp/sonku-p82-room | tee /tmp/sonku-p82-room-evidence.csv + grep -q '^PASS P8.2:' /tmp/sonku-p82-room-evidence.csv + windows-field: + name: Actual full Windows JUCE executable and verified portable field ZIP + needs: preflight + runs-on: windows-2022 + timeout-minutes: 55 + steps: + - uses: actions/checkout@v4 + with: + ref: ${{ github.event.pull_request.head.sha || github.sha }} + persist-credentials: false + - name: Verify immutable PR head and physical candidate identity + shell: pwsh + env: + EXPECTED_SHA: ${{ github.event.pull_request.head.sha || github.sha }} + run: | + $actual = (& git rev-parse HEAD).Trim() + if ($LASTEXITCODE -ne 0 -or $actual -ne $env:EXPECTED_SHA -or $actual -notmatch '^[0-9a-f]{40}$') { + throw "SONKU_P82_SOURCE_MISMATCH:$actual" + } + Write-Host "SONKU_P75_EXACT_SOURCE=$actual" + - uses: actions/checkout@v4 + with: + repository: juce-framework/JUCE + ref: 8.0.15 + path: third_party/JUCE + persist-credentials: false + - name: Obtain pinned WebView2 compilation SDK + shell: pwsh + run: | + nuget install Microsoft.Web.WebView2 -Version 1.0.3485.44 -OutputDirectory .deps -NonInteractive + if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE } + - name: Configure full native app with research XYZ explicit ON + shell: pwsh + run: | + cmake -S . -B build -G "Visual Studio 17 2022" -A x64 ` + -DJUCE_ROOT="$env:GITHUB_WORKSPACE/third_party/JUCE" ` + -DJUCE_WEBVIEW2_PACKAGE_LOCATION="$env:GITHUB_WORKSPACE/.deps" ` + -DARMIX_SONKU_EXPERIMENTAL_NATIVE_XYZ_RT=ON ` + -DARMIX_SONKU_EXPERIMENTAL_MUSIC_SAFE=ON ` + -DARMIX_SONKU_EXPERIMENTAL_P8_TRANSPARENT_BASS=ON ` + -DARMIX_SONKU_EXPERIMENTAL_P82_ROOM=ON ` + -DBUILD_TESTING=ON + if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE } + $cache = Get-Content -LiteralPath build/CMakeCache.txt -Raw + if ($cache -notmatch 'ARMIX_SONKU_EXPERIMENTAL_NATIVE_XYZ_RT:BOOL=ON' -or + $cache -notmatch 'ARMIX_SONKU_EXPERIMENTAL_MUSIC_SAFE:BOOL=ON' -or + $cache -notmatch 'ARMIX_SONKU_EXPERIMENTAL_P8_TRANSPARENT_BASS:BOOL=ON' -or + $cache -notmatch 'ARMIX_SONKU_EXPERIMENTAL_P82_ROOM:BOOL=ON') { + throw "SONKU_P82_RESEARCH_NOT_ENABLED" + } + $tests = (& ctest --test-dir build -C Release --show-only=json-v1 | Out-String | ConvertFrom-Json) + if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE } + $required = @('NativeSonKuP72AtomicXyzLiveEditSource', + 'NativeSonKuP72JuceV3XyzLiveAckV1V2Restore', + 'NativeSonKuSessionV1V2AndAudioAppliedAck', + 'NativeSonKuP75MusicStereoPhaseNoNullAndChunkParity', + 'NativeSonKuP80TransparentBassStereoPhaseAndRoomDiagnostic', + 'NativeSonKuP82SixWallThreeBandRoomTimingDecayAndParity') + $available = @($tests.tests | ForEach-Object { $_.name }) + foreach ($test in $required) { + if ($test -notin $available) { throw "SONKU_P82_MISSING_CTEST:$test" } + } + - name: Compile actual ARMixConsole Windows GUI and focused real JUCE tests + shell: pwsh + run: | + cmake --build build --config Release --parallel 2 --target ` + ARMixConsole ARMixSonKuP72SourceTests ARMixSonKuP72NativeTests ARMixSonKuNativeStateTests ARMixSonKuP75MusicIntegrityTests ARMixSonKuP80TonalEvidenceTests ARMixSonKuP82RoomTests + if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE } + $exe = 'build/ARMixConsole_artefacts/Release/AR MIX Studio.exe' + if (-not (Test-Path -LiteralPath $exe -PathType Leaf)) { throw "SONKU_P75_NO_GUI_EXE" } + if ((Get-Item -LiteralPath $exe).Length -lt 4MB) { throw "SONKU_P75_WRONG_GUI_TARGET" } + - name: Scoped native XYZ state, callback ACK and legacy restoration + shell: pwsh + run: | + ctest --test-dir build -C Release --output-on-failure ` + -R '^NativeSonKu(P72AtomicXyzLiveEditSource|P72JuceV3XyzLiveAckV1V2Restore|SessionV1V2AndAudioAppliedAck|P75MusicStereoPhaseNoNullAndChunkParity|P80TransparentBassStereoPhaseAndRoomDiagnostic|P82SixWallThreeBandRoomTimingDecayAndParity)$' + 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_P82_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 + 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 = 3 + fullWindowsExecutable = $true + publicRelease = $false + physicalAsioQualified = $false + dearVrPerceptualParityProven = $false + qualification = 'SONKU_P82_FULL_JUCE_APP_6_SCOPED_CTEST_PASS_REAL_ASIO_LISTENING_PENDING' + licenseRedistributionApproval = $false + mitKemarNoticeSha256 = (Get-FileHash -LiteralPath docs/THIRD_PARTY_8D_SONKU_HRTF.md -Algorithm SHA256).Hash.ToLowerInvariant() + fieldFatGuideSha256 = (Get-FileHash -LiteralPath docs/SONKU_P82_ACOUSTIC_ROOM_FIELD_FAT_20261114.md -Algorithm SHA256).Hash.ToLowerInvariant() + } -Force + $p | ConvertTo-Json -Depth 20 | Set-Content -LiteralPath $path -Encoding utf8 + - name: Independent GUI PE, approved resources, provenance and ZIP verification + shell: pwsh + run: | + & ./scripts/verify_native_windows_artifact.ps1 -OutputDir dist + if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE } + $p = Get-Content -LiteralPath dist/BUILD_PROVENANCE.json -Raw | ConvertFrom-Json + if (-not $p.sonkuExperiment.enabled -or + -not $p.sonkuExperiment.musicSafeStereo -or + -not $p.sonkuExperiment.p8TransparentBass -or + -not $p.sonkuExperiment.p82MultibandRoom -or + $p.sonkuExperiment.stateSchema -ne 3 -or $p.sonkuExperiment.publicRelease) { + throw 'SONKU_P75_WRONG_FIELD_ARTIFACT' + } + - name: Include mandatory MIT KEMAR notice and physical FAT guide + shell: pwsh + run: | + # Standard distribution allowlist was verified above. Field-only notice. + Copy-Item -LiteralPath docs/THIRD_PARTY_8D_SONKU_HRTF.md -Destination dist/THIRD_PARTY_8D_SONKU_HRTF.md + Copy-Item -LiteralPath docs/SONKU_P82_ACOUSTIC_ROOM_FIELD_FAT_20261114.md -Destination dist/SONKU_P82_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_P82_FIELD_FAT.md' = [string]$p.sonkuExperiment.fieldFatGuideSha256 + } + foreach ($item in $checks.GetEnumerator()) { + $file = Join-Path dist $item.Key + if ($item.Value -notmatch '^[0-9a-f]{64}$' -or + -not (Test-Path -LiteralPath $file -PathType Leaf)) { + throw "SONKU_P75_FIELD_NOTICE_MISSING:$($item.Key)" + } + $actual = (Get-FileHash -LiteralPath $file -Algorithm SHA256).Hash.ToLowerInvariant() + if ($actual -ne $item.Value) { throw "SONKU_P75_FIELD_NOTICE_HASH_MISMATCH:$($item.Key)" } + } + if (Test-Path -LiteralPath dist/Studio) { throw 'SONKU_FIELD_USER_DATA_MUST_NOT_SHIP' } + Write-Host 'SONKU_P75_FIELD_READY: GUI EXE + verified MIT notice + FAT guide' + - uses: actions/upload-artifact@v4 + name: Upload isolated SonKu Windows x64 field candidate + with: + name: ArSonMix-SonKu-P82-Multiband-Room-Windows-x64-${{ github.run_id }} + path: dist/ + if-no-files-found: error + retention-days: 21 + compression-level: 0