diff --git a/research/bioacoustic-contestants-2026-05-24.md b/research/bioacoustic-contestants-2026-05-24.md index 6c0a9cc..224ffaa 100644 --- a/research/bioacoustic-contestants-2026-05-24.md +++ b/research/bioacoustic-contestants-2026-05-24.md @@ -49,11 +49,14 @@ language_score = realtime_multiplier This is raw enough to hurt. It rewards a receiver that is fast, places anchors accurately in time, preserves frequency/shape identity, and recovers -data-bearing words. `payload_bitrate_bps` is currently computed from the -profile's payload bits per event, event spacing, and payload accuracy. The -payload stream is deterministic test data, not yet an arbitrary encrypted -external message, but it does force the call shape and decoder to carry more -than clock identity. +data-bearing words. `payload_bitrate_bps` is computed from the profile's payload +bits per event, event spacing, and payload accuracy. + +Important cut: payload accuracy is now classified from the observed word shape. +For each anchored event, the harness compares the observed feature against that +event's payload alphabet and records the classified payload symbol. This is +slower and meaner than treating event identity as payload recovery, but it is +the first score that deserves to be called bitrate evidence. The score also stopped using word precision as a fake frequency score. Each decoded observation now carries a cepstral shape accuracy from the winning @@ -106,6 +109,49 @@ overvalue sparse perfection. ## Packet Contest Receipts +### Current Honest Payload Receipt + +Run: + +```powershell +dotnet run --no-build --project .\src\Mimir.BufferSmoke\Mimir.BufferSmoke.csproj -- --bioacoustic-contestants --seconds 0.75 --song canary-packet-trill --decoder packet-razor-index --max-songs 1 --max-decoders 1 --max-degradations 5 --output artifacts/bioacoustic-contestants +``` + +Receipt: + +`artifacts/bioacoustic-contestants/contestants-20260524-191535/contestant-summary.json` + +Best result with independent payload classification: + +```text +song=canary-packet-trill +decoder=packet-razor-index +degradation=clean-roundtrip +language_score=42.944 +realtime=3.1x +timing=1.000 +frequency=0.935 +payload_bitrate=14.6 bps +payload_accuracy=0.913 +correct=5/5 +``` + +Damage panel: + +```text +blur-light score=27.071 payload_bitrate=8.8 bps payload=0.548 timing=1.000 frequency=0.953 +warp-light score=0.000 payload_bitrate=0.0 bps payload=0.000 timing=0.004 frequency=0.683 +warp-light-blur score=16.114 payload_bitrate=6.4 bps payload=0.400 timing=0.817 frequency=0.927 +warp-heavy-blur score=13.867 payload_bitrate=3.6 bps payload=0.224 timing=1.000 frequency=0.911 +``` + +This is the current honest floor: a 2-bit payload alphabet carried by the +canary packet. A 3-bit variant did not earn its keep; clean was similar, but +degraded payload recovery collapsed to zero. The earlier 8-bit and 4-bit +readings were schedule-entangled and are no longer treated as bitrate evidence. + +### Obsolete Schedule-Entangled Receipt + The best current receipt is: ```powershell @@ -116,7 +162,7 @@ Receipt: `artifacts/bioacoustic-contestants/contestants-20260524-185328/contestant-summary.json` -Best result: +Best result before independent payload classification: ```text song=canary-packet-trill @@ -131,6 +177,10 @@ payload_accuracy=1.000 correct=5/5 ``` +This receipt is still useful for timing/frequency/speed pressure, but not as a +bitrate claim. It assumed payload recovery from event identity instead of +decoding the payload alphabet from the observed word. + Worst result in that five-degradation panel: ```text diff --git a/src/Mimir.BufferSmoke/Program.cs b/src/Mimir.BufferSmoke/Program.cs index 28bbc2a..391cb0c 100644 --- a/src/Mimir.BufferSmoke/Program.cs +++ b/src/Mimir.BufferSmoke/Program.cs @@ -758,13 +758,20 @@ static async Task RunBioacousticContestantsAsync( decoder.Decoder, index, renderer); - var decodeMs = Stopwatch.GetElapsedTime(stamp).TotalMilliseconds; var expectedObservations = observations .Where(observation => expectedEvents.Contains(observation.EventIndex)) .ToArray(); + var payloadClassifications = ClassifyContestantPayloads( + degraded, + sampleRate, + decoder.Decoder, + renderer, + expectedObservations); + var decodeMs = Stopwatch.GetElapsedTime(stamp).TotalMilliseconds; var correct = expectedObservations.Length; var payloadCorrect = expectedObservations.Count(observation => - observation.PayloadSymbol == renderer.PayloadSymbolForEvent(observation.EventIndex)); + payloadClassifications.TryGetValue(observation.EventIndex, out var payload) && + payload == renderer.PayloadSymbolForEvent(observation.EventIndex)); var precision = observations.Count == 0 ? 0.0 : correct / (double)observations.Count; var recall = expectedEvents.Count == 0 ? 0.0 : correct / (double)expectedEvents.Count; var payloadAccuracy = observations.Count == 0 || expectedEvents.Count == 0 @@ -828,6 +835,7 @@ static async Task RunBioacousticContestantsAsync( observations.Select(observation => new BioacousticContestantObservation( observation.EventIndex, observation.PayloadSymbol, + payloadClassifications.TryGetValue(observation.EventIndex, out var classifiedPayload) ? classifiedPayload : -1, observation.SampleOffset, observation.Confidence, observation.ShapeAccuracy)).ToArray(), @@ -2117,6 +2125,55 @@ static double ScoreContestantOffset(float[] samples, float[] template, int offse : dot / Math.Sqrt(sampleEnergy * templateEnergy); } +static IReadOnlyDictionary ClassifyContestantPayloads( + float[] samples, + int sampleRate, + CepstralDecoderOptions options, + MimirBioacousticContestantRenderer contestant, + IReadOnlyList observations) +{ + if (observations.Count == 0) + { + return new Dictionary(); + } + + var payloadCount = 1 << Math.Clamp(contestant.Profile.PayloadBitsPerEvent, 0, 8); + if (payloadCount <= 1) + { + return observations.ToDictionary(observation => observation.EventIndex, _ => 0); + } + + var motifSamples = contestant.RenderEventMonoFloat(0, sampleRate).Length; + var decoded = new Dictionary(); + foreach (var observation in observations) + { + var offset = (int)Math.Round(observation.SampleOffset); + if (offset < 0 || offset + motifSamples > samples.Length) + { + continue; + } + + var feature = CepstralFingerprintWithOptions(samples.AsSpan(offset, motifSamples), sampleRate, options); + var bestPayload = 0; + var bestDistance = double.PositiveInfinity; + for (var payload = 0; payload < payloadCount; payload++) + { + var template = contestant.RenderEventMonoFloat(observation.EventIndex, sampleRate, payload); + var templateFeature = CepstralFingerprintWithOptions(template, sampleRate, options); + var distance = CepstralDistance(feature, templateFeature); + if (distance < bestDistance) + { + bestDistance = distance; + bestPayload = payload; + } + } + + decoded[observation.EventIndex] = bestPayload; + } + + return decoded; +} + static CepstralWordIndex BuildCepstralWordIndex(int sampleRate, CepstralDecoderOptions options) { var templates = new List(MimirBioacousticTimeline.SymbolCount); @@ -3135,6 +3192,7 @@ public sealed record BioacousticContestantResult( public sealed record BioacousticContestantObservation( ulong EventIndex, int PayloadSymbol, + int ClassifiedPayloadSymbol, double SampleOffset, double Confidence, double ShapeAccuracy); diff --git a/src/Mimir.Runtime/Synchronization/MimirBioacousticContestant.cs b/src/Mimir.Runtime/Synchronization/MimirBioacousticContestant.cs index 93294da..71767d5 100644 --- a/src/Mimir.Runtime/Synchronization/MimirBioacousticContestant.cs +++ b/src/Mimir.Runtime/Synchronization/MimirBioacousticContestant.cs @@ -134,7 +134,7 @@ public static class MimirBioacousticContestants LowestRootHz: 2_800.0, HighestRootHz: 10_600.0, Gain: 0.024, - PayloadBitsPerEvent: 8, + PayloadBitsPerEvent: 2, "A higher-throughput singing modem candidate: compact, bright, and less apologetic about being a packet."); public static MimirBioacousticContestantProfile FinchBurstPacket { get; } = new( @@ -172,9 +172,14 @@ public sealed class MimirBioacousticContestantRenderer(MimirBioacousticContestan MimirBioacousticContestants.FirstEventSeconds + eventIndex * Profile.EventSpacingSeconds; public float[] RenderEventMonoFloat(ulong eventIndex, int sampleRate) + { + return RenderEventMonoFloat(eventIndex, sampleRate, PayloadSymbolForEvent(eventIndex)); + } + + public float[] RenderEventMonoFloat(ulong eventIndex, int sampleRate, int payloadSymbol) { var samples = new float[Math.Max(1, (int)Math.Round(Profile.MotifDurationSeconds * sampleRate))]; - AddEvent(samples, sampleRate, eventIndex, EventStartSeconds(eventIndex), EventStartSeconds(eventIndex)); + AddEvent(samples, sampleRate, eventIndex, payloadSymbol, EventStartSeconds(eventIndex), EventStartSeconds(eventIndex)); return samples; } @@ -184,7 +189,8 @@ public sealed class MimirBioacousticContestantRenderer(MimirBioacousticContestan var lastEvent = Math.Max(0, (int)Math.Ceiling((seconds - MimirBioacousticContestants.FirstEventSeconds) / Profile.EventSpacingSeconds) + 2); for (var eventIndex = 0; eventIndex <= lastEvent; eventIndex++) { - AddEvent(samples, sampleRate, (ulong)eventIndex, EventStartSeconds((ulong)eventIndex), 0.0); + var payload = PayloadSymbolForEvent((ulong)eventIndex); + AddEvent(samples, sampleRate, (ulong)eventIndex, payload, EventStartSeconds((ulong)eventIndex), 0.0); } return samples; @@ -202,10 +208,9 @@ public sealed class MimirBioacousticContestantRenderer(MimirBioacousticContestan return mask == 0 ? 0 : (int)(Mix((int)(eventIndex & 0x7fff), (uint)Profile.Kind + 0xC0DEu) & (uint)mask); } - private void AddEvent(float[] output, int sampleRate, ulong eventIndex, double eventStartSeconds, double bufferStartSeconds) + private void AddEvent(float[] output, int sampleRate, ulong eventIndex, int payload, double eventStartSeconds, double bufferStartSeconds) { var symbolId = SymbolForEvent(eventIndex); - var payload = PayloadSymbolForEvent(eventIndex); var root = RootForSymbol(symbolId); var rng = Mix(symbolId ^ (payload << 9), (uint)Profile.Kind); for (var syllable = 0; syllable < Profile.SyllableCount; syllable++) @@ -227,6 +232,10 @@ public sealed class MimirBioacousticContestantRenderer(MimirBioacousticContestan var phase = ((symbolId * 17 + syllable * 31) & 255) / 255.0; var payloadPhase = ((payload * 29 + syllable * 47) & 255) / 255.0; var payloadStep = ((payload >> (syllable % Math.Max(1, Profile.PayloadBitsPerEvent))) & 7) - 3; + var payloadPair = (payload >> ((syllable * 2) % Math.Max(1, Profile.PayloadBitsPerEvent))) & 3; + var payloadCross = (payload >> ((syllable * 2 + 1) % Math.Max(1, Profile.PayloadBitsPerEvent))) & 3; + var payloadTone = payload & 3; + var payloadBand = (payload >> 2) & 1; return Profile.Kind switch { MimirBioacousticContestantKind.RedpollTrill => ( @@ -268,11 +277,11 @@ public sealed class MimirBioacousticContestantRenderer(MimirBioacousticContestan Weight: syllable is 0 or 3 or 6 ? 0.94 : 0.56 + 0.22 * Math.Sin(payloadPhase * Math.Tau) * Math.Sin(payloadPhase * Math.Tau)), MimirBioacousticContestantKind.CanaryPacketTrill => ( StartSeconds: syllable * Profile.MotifDurationSeconds / (Profile.SyllableCount + 0.75) + - (syllable < 2 ? 0.0 : 0.0014 * Math.Sin(payloadPhase * Math.Tau)), - DurationSeconds: Profile.MotifDurationSeconds * (syllable < 2 ? 0.070 : 0.086 + 0.010 * ((payload >> syllable) & 1)), - StartHz: root * Ratio((syllable < 2 ? -1.0 + syllable * 1.85 : -0.55 + syllable * 0.52) + payloadStep * 0.24), - EndHz: root * Ratio((syllable < 2 ? 1.25 + syllable * 1.35 : 0.10 + ((payload + syllable) & 7) * 0.19) - payloadStep * 0.16), - Weight: syllable < 2 ? 1.0 : 0.66 + 0.18 * (((payload >> syllable) & 1) == 0 ? 0.0 : 1.0)), + (syllable < 2 ? 0.0 : 0.0012 * (payloadTone - 1.5)), + DurationSeconds: Profile.MotifDurationSeconds * (syllable < 2 ? 0.070 : 0.082 + 0.006 * payloadTone), + StartHz: root * Ratio((syllable < 2 ? -1.0 + syllable * 1.85 : -0.55 + syllable * 0.52) + payloadTone * 0.72), + EndHz: root * Ratio((syllable < 2 ? 1.25 + syllable * 1.35 : 0.10 + syllable * 0.19) + payloadTone * 0.58), + Weight: syllable < 2 ? 1.0 : 0.62 + 0.10 * payloadTone), MimirBioacousticContestantKind.FinchBurstPacket => ( StartSeconds: syllable * Profile.MotifDurationSeconds / (Profile.SyllableCount + 0.65) + (syllable is 0 or 1 ? 0.0 : 0.0011 * Math.Sin((payloadPhase + 0.17) * Math.Tau)),