codec-re: quiet bundle decodes FULLY (17k samples, zero errors)

User asked the right question: do events without 30 NN blocks decode
fully?  Answer: YES.

  event-a:  Tran 3328 ✓  Vert 3328 ✓  Long 3328 ✓  (28 segments, 0 '30 NN')
  event-c:  Tran 1280 ✓  Vert 1280 ✓  Long 1280 ✓  (12 segments, 0 '30 NN')
  event-d:  Tran 1280 ✓  Vert 1280 ✓  Long 1280 ✓  (12 segments, 0 '30 NN')

17,664 ADC samples decoded byte-exact against BW's ASCII export.
Zero divergences across event-a, event-c, event-d.

This means the codec is FULLY SOLVED for any event without 30 NN
blocks.  The remaining gap is the 30 NN block format only — used for
high-amplitude regions where deltas exceed int8 range.  For quiet
events (or quiet stretches of loud events), the decoder is complete.

9 new regression tests bring the total to 55, all passing.

Files: tests/test_waveform_codec.py + docs/waveform_codec_re_status.md
+ new analysis/verify_quiet_bundle.py.
This commit is contained in:
Claude
2026-05-12 04:07:55 +00:00
committed by serversdown
parent 07675626dc
commit ce5dc640ba
3 changed files with 108 additions and 12 deletions
+22 -10
View File
@@ -18,22 +18,34 @@ previous channel (bytes [0:4]).
**What decodes byte-exact today (verified against BW ASCII export):**
**Quiet events with zero `30 NN` blocks — decode FULLY across all channels:**
| Event | Channel | Samples verified | `30 NN` blocks |
|---|---|---|---|
| **event-a** (5-8-26) | Tran / Vert / Long | **3328 each × 3 = 9984** | 0 |
| **event-c** (5-8-26) | Tran / Vert / Long | **1280 each × 3 = 3840** | 0 |
| **event-d** (5-8-26) | Tran / Vert / Long | **1280 each × 3 = 3840** | 0 |
That's **17,664 ADC samples decoded byte-exact, zero errors**.
**Loud events with `30 NN` blocks — decode up to the first `30 NN`:**
| Event | Channel | Samples verified |
|---|---|---|
| V70 (Mic-heavy) | Tran | 512 (1 segment) |
| V70 | Vert | 512 |
| V70 | Long | 512 |
| V70 (Mic-heavy) | Tran / Vert / Long | 512 each (1 segment) |
| JQ0 (Vert-heavy) | Tran | 512 |
| JQ0 | Vert | 258 |
| SP0 (loud all) | Long | **1536 (all 3 L segments)** |
| SP0 | Tran | 1350 / 2044 produced |
| SP0 | Vert | 650 / 1526 produced |
| SP0 | Tran | 1350 (diverges at first `30 NN`) |
| SP0 | Vert | 650 (diverges at first `30 NN`) |
**What's still open:** the `30 NN` block format. These blocks appear in
high-amplitude regions (deltas exceeding what int8 can express). My
decoder currently steps over them, which is fine for quiet stretches but
breaks the cumulative when a `30 NN` carries information for samples we
need. Cracking this is the last major piece.
**What's still open — ONLY the `30 NN` block format.** These blocks
appear in high-amplitude regions (deltas exceeding what int8 can
express). My decoder currently steps over them, which is fine for
quiet/moderate signals but breaks the cumulative when a `30 NN`
carries information for samples we need. **Quiet events without
`30 NN` decode 100% correctly across all channels.** Cracking
`30 NN` is the last piece.
**Production code in `minimateplus/client.py:_decode_a5_waveform` still
uses the broken legacy int16 LE decoder.** Sample arrays it writes to