Bound runtime sync analysis

This commit is contained in:
Meta Vens 2026-05-22 14:16:50 +01:00
commit 200186d4d5
8 changed files with 112 additions and 37 deletions

View file

@ -42,3 +42,4 @@
{"ts":"2026-05-22T14:10:00+01:00","type":"implementation","status":"partial","note":"Changed MimirChirpletTimeline from anonymous deterministic texture to an explicit order-3 de Bruijn symbol timeline over 32 separated chirp symbols. Any three consecutive correctly detected symbols identify a timeline event within the current operating horizon; reports now expose timelineMatchedEvents and timelineConfidence when event-index refinement is used. A synthetic check rendered two seconds of canonical timeline audio and decoded events 0, 1, and 2 back to a window start of -0.0015 seconds. Real headless app sniff did not provide a clean physical proof because Scarlett loopback capture again stopped advancing early; build remains clean."}
{"ts":"2026-05-22T14:32:00+01:00","type":"implementation","status":"ok","note":"Reworked MimirChirpletTimeline symbols from fixed frequency slots into time/frequency constellations. The order-3 de Bruijn sequence still gives three-chirp timeline placement, but each symbol now carries identity through start band, glide shape, duration, and following inter-chirp gap. Event start times are precomputed over the de Bruijn period instead of using a fixed stride. Synthetic verification rendered two seconds of canonical timeline audio and decoded interior events 9, 10, and 11 back to a zero-second window start, proving placement does not rely on the opening triplet."}
{"ts":"2026-05-22T14:48:00+01:00","type":"verification","status":"partial","note":"Attempted a 20-second real-world Mimir.App chirplet sync run with all configured local mics. The headless path only emitted one telemetry tick before runtime updates stopped. Switching to the normal app path produced telemetry through t=4.26s with all six audio buffers live and sync states for Focusrite, Kiyo, Kiyo Pro, and both PS3 Eye mics. Timeline-symbol refinement appeared on Focusrite, Kiyo, and one PS3 Eye, but delay estimates were unstable and the app did not continue telemetry to 20 seconds. Replaced the coarse acquisition trace with envelope energy to avoid matched-filter scans in the hot acquisition path; symbol decoding remains the refinement step."}
{"ts":"2026-05-22T15:20:00+01:00","type":"implementation","status":"partial","note":"Removed hidden re-entrant synchronization analysis from the live app path. MimirRuntime now calls a bounded rotating AnalyzeAudioSynchronizationStep every 0.1s, MimirSynchronizationHub caches per-source reports/states, and UI/telemetry read cached state instead of invoking the analyzer or BuildAlignedAudioFrame. FitDelayFromEvents now collapses duplicate candidate event observations by strongest energy, fixing the real app crash 'An item with the same key has already been added. Key: 0'. Dotnet build passed. A visible Mimir.App run with all configured mics no longer crashed at the earlier 4s wall and produced telemetry through runtime t=17.28s in a 22s wall-time harness; it did not reach a full 20 runtime seconds because startup consumed wall time. All non-loopback mics produced cached reports/states, but delay estimates remained unstable and timeline event refinement was intermittent, so the next live invariant is robust outlier rejection/state filtering before any actuator drives resampling."}

View file

@ -71,16 +71,19 @@ accepted_design:
timing atoms, symbol/event decoding, and per-band response kernels. Symbol
identity is carried by start band, glide shape, duration, and following
inter-chirp gap. Any three consecutive correctly detected symbols identify a
timeline event within the current operating horizon. `MimirAudioSynchronizationAnalyzer` now treats
`loopback-scarlett-speakers` as timing authority, uses coarse chirplet
energy for acquisition, and refines delay from matched timeline event
indices when symbol decoding succeeds. Positive delay means the
timeline event within the current operating horizon. `MimirAudioSynchronizationAnalyzer`
now treats `loopback-scarlett-speakers` as timing authority, uses coarse
chirplet energy for acquisition, and refines delay from matched timeline
event indices when symbol decoding succeeds. Positive delay means the
candidate mic is late relative to loopback. Reports include rounded delay,
fractional delay, confidence, and per-band matched energy. `MimirAudioSynchronizationStateTracker`
fractional delay, confidence, and per-band matched energy. `MimirSynchronizationHub`
caches the latest per-source reports and `MimirAudioSynchronizationStateTracker`
owns the smoothed per-source belief: latest delay, smoothed delay,
confidence, per-band response evidence, and delay-slope/SRO estimate in
ppm. `MimirRuntime` now runs this analysis online on a fixed cadence and
`MIMIR_SYNC_TELEMETRY_SECONDS` prints live buffer/report/state telemetry.
ppm. `MimirRuntime` now runs this analysis online as a bounded rotating
service on a fixed cadence, while UI and telemetry read cached reports/states
instead of invoking analysis. `MIMIR_SYNC_TELEMETRY_SECONDS` prints live
buffer/report/state telemetry.
`MimirSynchronizationHub.BuildAlignedAudioFrame` exposes the first
provisional loopback-referenced aligned mono frame for channels that clear
the confidence gate.
@ -182,11 +185,12 @@ current_status:
next_action: >
Harden the online state filter before adding the synchronization actuator.
Current app testing proves Aquarium WASAPI output wakes Scarlett speaker
loopback, live mic buffers stay populated, runtime sync analysis runs on
cadence, and the continuous chirplet timeline can produce confident sync
states in the app. Delay estimates are still jumpy, so the actuator needs
outlier rejection and better SRO smoothing before it drives variable-rate
resampling and fractional-delay correction per non-reference stream. Replace
loopback, live mic buffers stay populated, runtime sync analysis now runs as
a bounded rotating service without UI/telemetry re-entry, and the continuous
chirplet timeline can produce confident sync states in the app. Delay
estimates are still jumpy, so the actuator needs outlier rejection and better
SRO smoothing before it drives variable-rate resampling and fractional-delay
correction per non-reference stream. Replace
the diagnostic JSON-line process bridge with direct native capture drivers that push buffer handles into
Mimir.Runtime. Mimir.BufferSmoke still proves loopback-referenced aligned
audio for Scarlett loopback, Focusrite mic, Kiyo mic, and Kiyo Pro mic when