diff --git a/.github/workflows/sonku-p84-clarity-research.yml b/.github/workflows/sonku-p84-clarity-research.yml new file mode 100644 index 000000000..b593eaa73 --- /dev/null +++ b/.github/workflows/sonku-p84-clarity-research.yml @@ -0,0 +1,168 @@ +name: SonKu P8.4 musical fidelity constrained research + +on: + pull_request: + paths: + - 'engine/builtin_fx/sonku/SonKuP84ClarityAnchor.h' + - 'engine/builtin_fx/sonku/SonKuP84FusedMusicHrir.h' + - 'engine/builtin_fx/sonku/SonKuSpatialCore.h' + - 'tests/sonku_p84_clarity_candidate_test.cpp' + - 'tests/sonku_p84_fused_single_core_test.cpp' + - 'tests/sonku_p84_fused_hosted_cpu_benchmark.cpp' + - 'tests/sonku_p84_spatial_impulse_evidence_test.cpp' + - 'tests/sonku_p84_live_v5_modes_source_test.cpp' + - 'tools/sonku_p84_offline_audition.cpp' + - 'docs/SONKU_P84_CLARITY_FIRST_ARCHITECTURE_20261115.md' + - '.github/workflows/sonku-p84-clarity-research.yml' + workflow_dispatch: + +permissions: + contents: read + +jobs: + clarity-source: + runs-on: ubuntu-latest + timeout-minutes: 8 + steps: + - uses: actions/checkout@v4 + - name: Native source P82 reference versus physical P83, PCM music integrity and yaw + shell: bash + 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 \ + -DSONKU_P75_MUSIC_SAFE_RESEARCH=1 \ + -DSONKU_P80_TRANSPARENT_BASS_RESEARCH=1 \ + -DSONKU_P82_MULTIBAND_ROOM_RESEARCH=1 \ + -DSONKU_P83_PHYSICAL_SPEAKER_RESEARCH=1 \ + tests/sonku_p84_clarity_candidate_test.cpp -o /tmp/sonku-p84 + /tmp/sonku-p84 | tee /tmp/sonku-p84.log + grep -q '^PASS P84 RESEARCH:' /tmp/sonku-p84.log + - name: REAL one-PCM-graph 2x2 fused HRTF and P8.2 no-regression gate + shell: bash + 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 \ + -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 \ + tests/sonku_p84_fused_single_core_test.cpp -o /tmp/sonku-p84-fused + /tmp/sonku-p84-fused | tee /tmp/sonku-p84-fused.log + grep -q '^PASS P84 SINGLE CORE:' /tmp/sonku-p84-fused.log + - name: Cross-build bit-exact P8.2 when P8.4 compiled OFF versus compiled ON + shell: bash + run: | + set -euo pipefail + COMMON="-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" + g++ $COMMON tests/sonku_p83_music_bed_byte_parity.cpp -o /tmp/p82-off + g++ $COMMON -DSONKU_P84_SINGLE_CORE_FUSION_RESEARCH=1 tests/sonku_p83_music_bed_byte_parity.cpp -o /tmp/p82-on + /tmp/p82-off /tmp/p82-reference.pcm + /tmp/p82-on /tmp/p82-fused-disabled.pcm + cmp -s /tmp/p82-reference.pcm /tmp/p82-fused-disabled.pcm + echo "PASS P84 BIT EXACT P82: 44.1/48k room OFF/ON mono/anti-phase bytewise identical" + - name: Source binaural orientation ILD IACC and early reflection evidence + shell: bash + 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 \ + -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 \ + tests/sonku_p84_spatial_impulse_evidence_test.cpp -o /tmp/p84-spatial + /tmp/p84-spatial | tee /tmp/p84-spatial.log + grep -q '^PASS P84 SPATIAL SOURCE:' /tmp/p84-spatial.log + - name: Actual one-core WAV audition CLI, ROOM ON/OFF and four calibrated-input files + shell: bash + 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 \ + -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 \ + tools/sonku_p84_offline_audition.cpp -o /tmp/p84-wav-audition + python3 - <<'PY' + import wave, struct, math + with wave.open('/tmp/p84-original.wav','wb') as o: + o.setnchannels(2);o.setsampwidth(2);o.setframerate(48000) + pcm=bytearray() + for i in range(8192): + t=i/48000 + bass=.16*math.sin(2*math.pi*83*t) + vocal=.10*math.sin(2*math.pi*461*t) + side=.11*math.sin(2*math.pi*1703*t) + l=bass+vocal+side + r=bass+vocal-side + pcm+=struct.pack('