merge: dev into feat/series4-sfm-parity -- the decode checker's file-only fields (job number, codec by STRT[18], last-26-byte footer)
Brings be5bab4 and its history from the decode checker's branch: a Blastware
file's job number; decode_blastware_bytes choosing the codec by STRT[18] and the
histogram layout check by peak <= PVS <= sqrt(3) peak; the footer as the file's
last 26 bytes (no day-late histograms); docs (reference Appendix D.6, the
file-only status).
Conflicts, both kept whole:
- CLAUDE.md: this branch's 'Narrowed 2026-10-26' 5A block stays, followed by
dev's 'Open, not blocking' line (the 8x sensitive-range item struck out --
resolved by the file's range).
- docs/instantel_protocol_reference.md (CRLF, byte-safe): the change-log rows in
date order -- dev's 2026-11-03 and 2026-11-02, this branch's 2026-11-03
(call home), 2026-10-29 and 2026-10-27 (#46, this branch only).
Suite on the merged tree: 1399 passed, the 16 known failures.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44
This commit is contained in:
commit
cbce00f8e1
27 files changed
+1797
-84
No files matched your search
@@ -11,7 +11,9 @@
|
||||
|
||||
| Date | Section | Change |
|
||||
|---|---|---|
|
||||
| 2026-11-03 | Appendix D.3.3, D.6.1, D.6.3, D.6.5, D.6.7, §8 | ✅ **File-only decode, second pass (on `dev`).** **D.3.3:** the footer is the file's last 26 bytes (70,041 / 70,041); an earlier stop-time record fooled the first-match search on 14 files, making histograms a day late. Its `[18:24]` is **not** fixed (retracted). **D.6.1:** STRT[18] now picks the codec; the waveform codec had claimed 2018 5 s histograms. **D.6.3:** the job number (flags `k − 9` bit `0x02`, uint16 at `k − 8`; 2,997 / 2,997). **D.6.5:** the PVS² high word is non-zero above 1.28 in/s (retracted "reads 0000"), so the layout check now uses peak ≤ PVS ≤ √3·peak (34,502,955 / 34,502,955); Blastware's "Number of Intervals" is the monitoring time ÷ the interval. **§8:** where the 1995 default-clock events come from. 18 of 88 report fields now match on every DL2 event. |
|
||||
| 2026-11-03 | call home (SUB 2C / 7E / 7F) | **SFM's call-home write, measured both ways.** SFM's 0x7E image (`write_image` of the 0x2C read with byte 5 set, framed ONCE) and its 0x7F confirm reproduce Blastware's 2026-04-20 enable and disable writes byte for byte (BE11529; `tests/test_s3_call_home_bw_frames.py`). Live on BE9441, idle: a no-op, on and off were all acked (0x81 / 0x80) and read back, and the unit's menu agreed. Only byte 5 changes: no unit-maintained field, unlike Series 4's `[118:120]`. Byte 5 is read from the UNESCAPED block. ⚠ Unescaping is not idempotent, so a built image must never pass through `write_image` again: a call-in time of 16:02-16:04 is `10 02`-`10 04` in the image. ⚠ **While monitoring, the unit answers the 0x2C read with its DEVICE-INFO block** ('Instantel', 'MiniMate Plus', its serial), as it answers 1A. Idle again, minutes later, it returns the call-home block. So a monitoring unit's call-home cannot be read-modify-written; SFM refuses with 'stop monitoring first'. A blind write while monitoring stays untested on purpose. |
|
||||
| 2026-11-02 | Appendix D.3.1, D.6 (NEW), §15 | ✅ **Event fields SFM reads from the file alone (v0.33.0, plus the range on `dev`).** New D.6 records the bytes and the DL2 verification for each field: the record type `STRT[18]`, the recording-setup block (sample rate, pre-trigger, record time, the four notes), the geophone range (label + 29 in the setup's channel blocks), each histogram interval's PVS², and the mic scale (one count = 0.25 Pa). **Retracted in place:** D.3.1's `STRT[20]` = record time (it is `00` on every DL2 file; the "70 s" SFM used to report was `STRT[18]`, the record-type byte), and the 2026-08-26 reading of sub-minute histogram records as little-endian (big-endian from byte 5 since v0.32.0, #47/#49). **For #48:** the file's copy of the block puts the pre-trigger where the 1A "stable anchor" `be 80 00 00 00 00` sits. In the file, though, it is each event's own pre-trigger, which varies on the same unit on the same day (253–256 samples at 1024 sps), and Blastware reports it per event. So the file says little about whether the live 1A loses its anchor, and #48 stays open. |
|
||||
| 2026-10-29 | §7.6.1, §6 | **The SUB 1A settings fields are read AFTER unescaping (measured, BE9441).** The unit escapes 02/03/04/10 in its replies and `S3FrameParser` keeps the `10` of `10 02/03/04`, so on the raw bytes an escaped mode, sample rate or interval shifts every field after it: BE9441 at Histogram / 4096 sps / 2 s read 0 sps and a 4098 s interval, and a Continuous unit read as Single Shot. After `unescape_reply`, every recorded reply (4 settings, two of them Blastware's own writes: 15 min, then 2 s) has one layout: **mode anchor−7, sample rate anchor−6 (u16 BE), histogram interval anchor−4 (u16 BE, s), record time anchor+6 (f32 BE)**. ⚠ The older table's "anchor−7 = constant 0x10" (and mode at anchor−8) was the escape in front of `04` at 1024 sps — right only at that rate. The channel block (`Tran`+28 scale, +33 range, +34 trigger) and the note strings are correct on the RAW bytes and wrong unescaped; 🔶 open: a trigger/alarm float that itself contains 02/03/04/10 would read shifted there. Also measured: **while monitoring, BE9441 answered the 1A reads with its device-info block** (`BE9441`, `Instantel` — the 0x01 reply), so no settings can be read then; the decoder leaves them unknown. The 2026-10-17 anchor question is untouched: every reply measured so far carries the anchor. Fixed in SFM `b320a53`. ⚠ **The write side was not moved:** `_encode_compliance_config` still patches the raw bytes at the 1024-sps offsets (mode anchor−8), which at 2048/4096 sps rewrite the byte in front of the mode (measured on BE9441's 10-25 block); it now refuses a patch whose four fields do not read back as asked (`a72d3a9`) until rewritten on unescaped bytes (#46). |
|
||||
| 2026-10-27 | §3 writes | **⚠ RETRACTS the write-frame model (#46, measured).** Every Blastware request on record re-encodes under the uniform rule (02/03/04/10 escaped, SUM8): 3,869/3,869 frames in the Feb–Apr 2026 captures, plus BE9441's 26 write frames of 2026-10-26. A write's [4:6] is its data LENGTH. Config blocks are their header N + 2 bytes: event index (68) and trigger (82) are written as read plus `02 00` / `00 00` (constant on 15 sends); waveform data (69) and the 2,092-byte compliance image (71) are written whole, the latter in addressed chunks (params[2:4] = address; 1,024 B in March, 512 B with Blastware 10.74). The trailing two bytes are not a CRC and went out stale, so the unit evidently ignores them. "Only BW_CMD doubled", the "DLE-aware checksum", "offset = data[1] + 2" and "chunks 1,027 / 1,055 at offset 0x1004" were these frames read with their escape bytes in. The trigger block is read first (SUB 0x2E, 26 bytes); its byte 5 has been 01 / 03 / 04 by unit and session (meaning unknown). |
|
||||
| 2026-10-26 (5) | §7.8.9 | ✅ **The embedded event record: the instrument's trigger time, inside the 5A stream.** Every Blastware waveform file carries `00 28 05 00 ?? ?? fe 80 [trigger 8 B][stop 8 B]`, times as `dd mm yyyy(BE) 00 hh mm ss`. The trigger equals Blastware's report 1,320/1,320, the filename 7,935/7,935 and the unit's 0C record 10/10. It occurs once in the unit's own A5 payloads (8/8 events) and in SFM-only downloads (2/2): instrument data, not Blastware's. The footer's `ts2 - record time` is only an estimate, a second off on ~19%. Decoder rule, validation and an open case (3 waveform-named files the codec does not recognise) in §7.8.9. 🔶 The §7.5 `0C` "sub_code" timestamp variants look like the same 8-byte form read with its escapes. |
|
||||
@@ -21,7 +23,7 @@
|
||||
| 2026-10-26 | §7.8 | **5A requests must DLE-escape a checksum that is a framing byte (measured, BE9441).** The request for chunk 0x7D06 of event 01122f06 ends `… 02 03`: a bare 0x02 checksum (STX) before ETX. BE9441 never answered it, twice on two days, and rebooted ~11 s later each time; that was the 'mid-download reboot' of 2026-10-25 (row below). Sent as `… 10 02 03` it answered in 28 ms. So did chunk 0x7F06 (checksum 0x04 → `10 04`) and 0x8B06 (checksum 0x10 → `10 10`; sent bare, that reads as DLE+ETX), and the event downloaded whole and matched the unit's peaks. Escape set {02, 03, 04, 10}: a Micromate's for every byte (251/251 THOR requests), and consistent with §7.8's de-stuffing rule (`10 02/03/04` literal). About 1 chunk request in 64 has such a checksum. ⚠ Not known: whether standard (non-5A) requests need the same. No such keyed-read checksum has been sent. Also measured on the re-run: events that end in the next 64 KB page (BE9441 events 2 and 19) read an end offset lower than their start (the known page bug); every other event downloaded whole and verified. |
|
||||
| 2026-10-25 | §7.2, §7.8, §6 | **MiniMate bench check, BE9441 (S338.17, mic disabled, serial cable). SFM read its 24-entry event index, listed 20 events, and downloaded 4.** Measured: (1) **§7.2: the 0x15 serial is a C string.** `"BE9441\x00?"`: a six-character serial leaves a stray byte after its NUL. (2) **§7.8: every A5 reply echoes the address it answers at `data[2:6]`.** The metadata pages come back as `01 11 10 02` and `01 11 10 04`; sample chunks as their own address, e.g. `01 11 66 6a`. The event-1 walk fetches the metadata pages as frames 1 and 2. A non-first event's walk fetches none and goes straight from the probe to sample chunks. SFM's body builder assumed metadata pages in every stream, so every non-first event it assembled was 2 bytes short and decoded truncated; it now checks the echoed addresses. The bug was in SFM's assembly; the protocol was as already documented. (3) **§6: the unit boots when its serial port opens.** It sent `Operating System` ~3 s after the port opened (twice) and ignored a POLL sent before that. After a mid-download reboot it answered 8.8 s after its banner (one data point). (4) **The unit rebooted once mid-download.** The chunk at 0x7D06 got one stray `0x41`, then silence, then the banner 11 s later. Cause unknown, inferred not measured: battery 6.33–6.37 V, a firmware reset. ⚠ **RETRACTED 2026-10-26:** the cause is measured, and it was our request. The chunk request had a bare 0x02 checksum. See the 2026-10-26 row. (5) The event index said 24 while the header walk listed 20 full records. **Inferred:** the other 4 are monitor-log entries. Single-shot events at 4096 sps with a 5 s record give **21,504 samples per channel** (5 s record + 0.25 s pre-trigger = 5.25 s at 4096 sps), all three channels equal, peaks equal to the unit's own 0C values. |
|
||||
| 2026-10-17 | §7.6.1 | 🔶 **OPEN — the 6-byte "stable anchor" may be two settings at their defaults, not a constant.** Series IV's `0x1A` has the same field order as the S3 compliance block, and a keypad diff pass on a Micromate (UM20147) measured the bytes in the anchor's position: `[f32 BE pre-trigger, negative seconds][record stop mode, 00 00 = Fixed]`. `be 80 00 00` is exactly −0.25 s. If S3 matches — **inferred, not measured on S3** — then any S3 unit set to Record Stop Mode = Auto (a basic Blastware Compliance Setup option) or a non-default pre-trigger loses the anchor, and `client.py` silently decodes no recording mode / sample rate / interval / record time and skips them on write. No S3 capture has ever been taken in Auto stop mode (see the 2026-03-09 Auto Window rows), which would explain why the anchor never broke. To settle: one BW capture with Record Stop Mode = Auto. See `docs/micromate_protocol_reference.md` → *The `0x1A` field map from a keypad pass*. |
|
||||
| 2026-08-26 | S7.6.2, S15 | **MULTI-INTERVAL HISTOGRAM BLOCKS - sub-minute intervals pack several per block.** The device always writes one minute of data per block, so a shorter histogram interval means more intervals packed into a longer block: 1 min -> 1 (the standard 32-byte block), 15 s -> 4 (stride 92), 2 s -> 30 (stride 612), with `stride = 12 + n * 20`. Each 20-byte record holds 8 x uint16 **little**-endian values (peak/half-period per channel) plus a 2-word tail whose first word is `0000` on every real interval. The standard block is big-endian - the variant is not. This recovers **415 files** (216 on BE18193 at 2 s, 199 on BE9440 at 15 s) that previously decoded to nothing, and before that were being accepted by the WAVEFORM codec and returning garbage up to 400x the device-reported PPV. |
|
||||
| 2026-08-26 | S7.6.2, S15 | **MULTI-INTERVAL HISTOGRAM BLOCKS - sub-minute intervals pack several per block.** ⚠ *Corrected 2026-11-02: the records are big-endian from byte 5, not little-endian (v0.32.0, #47/#49), and the "2-word tail" is the interval's PVS². See D.6.5.* The device always writes one minute of data per block, so a shorter histogram interval means more intervals packed into a longer block: 1 min -> 1 (the standard 32-byte block), 15 s -> 4 (stride 92), 2 s -> 30 (stride 612), with `stride = 12 + n * 20`. Each 20-byte record holds 8 x uint16 **little**-endian values (peak/half-period per channel) plus a 2-word tail whose first word is `0000` on every real interval. The standard block is big-endian - the variant is not. This recovers **415 files** (216 on BE18193 at 2 s, 199 on BE9440 at 15 s) that previously decoded to nothing, and before that were being accepted by the WAVEFORM codec and returning garbage up to 400x the device-reported PPV. |
|
||||
| 2026-08-25 (3) | S7.6.1, S15 | **THE WAVEFORM BODY IS A RECORD CHAIN, NOT A TAG STREAM — supersedes the segment-header model entirely.** Records are self-delimiting: `off+2` is a uint16 BE length and `next = off + 2 + len`; the chain ends on a record whose chan_id is `0x06`. `off+8` holds a 3-valued mode enum - `02 00` (14-byte header, anchors, cumulative deltas), `01 00` (10-byte, no anchors, ABSOLUTE values), `00 03` (10-byte, no tags at all, raw 12-bit absolute). **`40 NN` is an ordinary int16 BE data block of length 2*NN+2**, never a header; reading it as a 2*NN+16 header is what made walks drift, and the 'variable prefix' of 0/2/4/6/8 bytes reported earlier the same day was walker drift, exactly `4 - (old_stop - true_record_start)`. Verified: chain terminates on `06` in 1387/1388 files; all four channels equal length in **1388/1388** (was 156/1388); ASCII sample-count exact 72/75 -> **75/75**, fully exact 70/75 -> **73/75**; device PPV on a live decode **1306/1306** waveform (mean abs ratio error 0.00000) and **4458/4459** histogram. Also eliminated the walker-over-read class: 24 of those files were histograms the waveform codec was wrongly accepting. The superseded model is retained as `decode_waveform_legacy` because `micromate/idf_file.py` pins it for Thor IDFW body-offset search. |
|
||||
| 2026-08-25 (2) | S7.6.2, S15 | **HISTOGRAM BLOCK IS BIG-ENDIAN + terminal block tail.** The 32-byte histogram block's per-channel fields are uint16 **big-endian** (`T_peak` [5:7], `T_halfperiod` [7:9], `V_peak` [9:11], `V_halfperiod` [11:13], `L_peak` [13:15], `L_halfperiod` [15:17], `M_peak` [17:19], `M_halfperiod` [19:21]); only `block_ctr` [2:4] is little-endian. The marker is `block[4]` alone - the previous uint16 LE marker test at [4:6] forced `block[5] == 0` and thereby capped every geo peak at 255 counts (1.275 in/s), silently clipping larger peaks. The byte previously documented as a per-channel "annotation" is the high byte of the big-endian half-period, which is why it was non-zero exactly on sub-Hz intervals. Separately, the **final block of each stream carries tail `9c 06 00 42`** rather than `1e 0a 00 00` and holds arbitrary bytes at [21:23]; rejecting it dropped the last interval of nearly every histogram. Verified against 1211 production histograms paired with their Blastware ASCII exports: 1211/1211 decode exactly, plus 842,442 per-interval frequency comparisons with zero mismatches (previously 1 of 1196 files fully correct). |
|
||||
| 2026-08-25 | §7.6.1, §15, Appendix E (NEW) | **BODY CODEC + SCALE PASS — five findings, all verified against 75 production events paired with their preserved Blastware ASCII exports.** (1) **Geo full scale is 32000 ADC counts, not 32768** — one decoder unit (16 counts) is exactly 0.005 in/s, so 10.000 in/s = 32000 counts. Consumers dividing by 32768 read every geophone sample and derived peak **2.34% low**; the error scales with amplitude so it was invisible on quiet events and worst on loud ones. 216 per-channel comparisons: 32768 → 151/216 exact (worst 0.238 in/s on a 10 in/s event); 32000 → 216/216 exact, worst 1 LSB. Affects waveforms, histograms and series-4 alike. (2) **Wide-NN RLE `0X NN`** — the 12-bit NN encoding already known for `1X`/`2X` also applies to the `00 NN` RLE tag (runs > 252 samples). (3) **`30 NN` is not capped at NN=0x10** — data-section blocks reach at least 0x18; the length formula was already right. (4) **`40 NN` segment headers are variable width** — NN counts the previous-channel continuation deltas, so the header is `2*NN + 16` bytes; `40 01` and `40 03` occur alongside `40 02`. A header can also appear **tagless** (the NN=0 case): just the 14-byte tail. (5) **The header field documented as a "monotonic uint32 LE counter" is really `[channel_id][00][00][segment_index]`** with 0x46=Tran 0x47=Vert 0x48=Long 0x49=MicL — verified on 1697/1697 segment headers, zero disagreements. Decoders should take the channel from this field, not from rotation position. Items (2)–(5) each caused **silent channel truncation**: an unhandled tag ends the walk and the decoder returns short channels with no error. Corpus result end-to-end: exact 37 → 72, truncated 23 → 3, full-length value errors 15 → 0. New Appendix E documents the field-observed "offset" device fault. |
|
||||
@@ -2678,6 +2680,11 @@ Appears in event index blocks. Time-of-day fields (hour/min/sec) are absent.
|
||||
| `1E` | 30 | Day (0x1E = 30 decimal) | ✅ CONFIRMED |
|
||||
|
||||
> ✅ **2026-02-26 — CONFIRMED:** The year 1995 is the **MiniMate Plus factory default RTC date**, which the device reverts to whenever the internal battery is disconnected or the real-time clock loses power. Any event timestamped around 1995 means the clock was not set. This is known device behavior, not an encoding anomaly.
|
||||
>
|
||||
> **2026-11-03 — where they come from (operator account, Brian):** units come back from calibration with the internal battery unplugged, so an event triggered while testing communications, before anyone sets the date, carries the default.
|
||||
> - **DL2 (measured):** 17 such events on 6 units (BE9440, BE9557, BE11529, BE17354, BE18189, BE18190). All fall between 1995-09-01 12:02:02 and 1995-09-03 11:24:06, most of them between 12:02 and 13:01 on 1 September.
|
||||
> - 🔶 **Inferred:** the clock restarts at a fixed default near 1995-09-01 12:00 and runs from power-up.
|
||||
> - These files still end in a valid footer. SFM reads the 1995 times and reports them as `CLOCK_NOT_SET` (`models.Timestamp`).
|
||||
|
||||
### 8.2 9-byte format (Full Waveform Record / SUB 0C, sub_code=0x10)
|
||||
> ✅ **CONFIRMED 2026-04-01** — Cross-referenced against Blastware event report
|
||||
@@ -3180,7 +3187,7 @@ The `.bin` files produced by `s3_bridge` are **not raw wire bytes**. The logger
|
||||
| **RV55 DCD/DTR default** — newer Sierra Wireless RV55 firmware does not assert DCD/DTR by default, so the MiniMate Plus never detects TCP disconnect and stays idle instead of resuming monitoring. Root cause: RV55 ACEmanager `DCD Control` setting. Workaround not yet found. | MEDIUM | 2026-04-11 | Still open |
|
||||
| ~~**Variable-prefix segment descriptors**~~ - **RESOLVED 2026-08-25:** there is no variable prefix. The body is a chain of self-delimiting records (see S7.6.1); the 0/2/4/6/8-byte prefix was walker drift from reading `40 NN` as a segment header. All 25 affected files now chain cleanly to the `06` terminator. | RESOLVED | 2026-08-25 | Resolved 2026-08-25 |
|
||||
| ~~**Histogram codec drops trailing intervals (series-3)**~~ - **RESOLVED 2026-08-25.** Two errors, both in the block model. (1) The block is **uniformly big-endian**: peaks and half-periods are uint16 BE (`T_peak` [5:7], `T_halfperiod` [7:9], `V_peak` [9:11], ...); only `block_ctr` [2:4] is LE. The old uint8-peak + "annotation"-byte model silently clipped any peak above 1.275 in/s, and the "annotation" byte was really the half-period high byte - non-zero exactly on the sub-Hz intervals BW renders `<1.0`. The marker is `block[4]` alone; testing [4:6] as a uint16 LE marker forced `block[5] == 0`, which is what capped the peak at one byte. (2) The **final block of the stream carries tail `9c 06 00 42`** instead of `1e 0a 00 00`, with arbitrary bytes at [21:23]; rejecting it dropped the last interval of nearly every histogram - often the one holding the event peak. Verified on 1211 production histograms vs their BW ASCII exports: **1211/1211 exact** (interval count + every per-interval peak) and 842,442 frequency comparisons with zero mismatches; was 1/1196. | RESOLVED | 2026-08-25 | Resolved 2026-08-25 |
|
||||
| ~~**Unmapped histogram block variant (415 files, 2 units)**~~ - **RESOLVED 2026-08-26.** When the histogram interval is SHORTER than one minute the device packs several intervals into a single block so each block still covers exactly one minute: 1 min -> 1 interval (the standard 32-byte block), 15 s -> 4 (stride 92), 2 s -> 30 (stride 612). `stride = 12 + n * 20`. Block is `[00][segment][ctr uint16 LE][0a][00]` then n x 20-byte records of 8 x uint16 **LITTLE**-endian `T_peak,T_halfp,V_peak,V_halfp,L_peak,L_halfp,M_peak,M_halfp` plus a 2-word tail whose first word is `0000` on every real interval (a session ending mid-block leaves buffer garbage in the remaining slots), then a 6-byte block trailer. **Note the endianness flip** - the standard 32-byte block is big-endian. Ground truth `BE9440/K440L3AQ.T70H` (5,710 intervals at 15 s) decodes with 17,130/17,130 geo peaks, 22,840/22,840 frequencies and 5,710/5,710 mic dB(L) matching its Blastware ASCII export exactly; across all 455 affected files 1,354/1,365 channel peaks (99.2%) match the device-reported PPV. | RESOLVED | 2026-08-25 | Resolved 2026-08-26 |
|
||||
| ~~**Unmapped histogram block variant (415 files, 2 units)**~~ - **RESOLVED 2026-08-26.** ⚠ *Corrected 2026-11-02: the records are big-endian from byte 5, not little-endian (v0.32.0, #47/#49), and the "2-word tail" is the interval's PVS². See D.6.5.* When the histogram interval is SHORTER than one minute the device packs several intervals into a single block so each block still covers exactly one minute: 1 min -> 1 interval (the standard 32-byte block), 15 s -> 4 (stride 92), 2 s -> 30 (stride 612). `stride = 12 + n * 20`. Block is `[00][segment][ctr uint16 LE][0a][00]` then n x 20-byte records of 8 x uint16 **LITTLE**-endian `T_peak,T_halfp,V_peak,V_halfp,L_peak,L_halfp,M_peak,M_halfp` plus a 2-word tail whose first word is `0000` on every real interval (a session ending mid-block leaves buffer garbage in the remaining slots), then a 6-byte block trailer. **Note the endianness flip** - the standard 32-byte block is big-endian. Ground truth `BE9440/K440L3AQ.T70H` (5,710 intervals at 15 s) decodes with 17,130/17,130 geo peaks, 22,840/22,840 frequencies and 5,710/5,710 mic dB(L) matching its Blastware ASCII export exactly; across all 455 affected files 1,354/1,365 channel peaks (99.2%) match the device-reported PPV. | RESOLVED | 2026-08-25 | Resolved 2026-08-26 |
|
||||
| **Micromate (UM-series) IDF decode is ~1000x low** — e.g. `UM11402_20260406130113.IDFW` decodes a Tran peak of 0.0009 in/s against a device-reported 1.1168. Distinct from the Thor IDF path, which decodes sanely. Suspect a different per-count LSB or a body offset that does not hold for UM-series files. | MEDIUM | 2026-08-25 | Still open |
|
||||
| **Thor IDF per-count LSB** — after the 32000 geo full-scale correction, series-4 Thor peaks sit at a median 0.983 of the device-reported peak (was 0.960 under 32768). Closer, but the residual ~1.7% suggests Thor uses its own per-count LSB rather than the BW 16-count/0.005 in/s convention. A code comment in `sfm/waveform_store.py` claims Thor's LSB is 0.0003 in/s, which would predict Thor reading *high* — the measurement shows the opposite, so that comment is unverified. | LOW | 2026-08-25 | Still open |
|
||||
|
||||
@@ -3407,8 +3414,16 @@ The STRT record immediately follows the 22-byte header.
|
||||
| 4 | 2 | `ff fe` | Fixed |
|
||||
| 6 | 4 | event key (key4) | 4-byte waveform key |
|
||||
| 10 | 4 | device-specific | NOT a repeat of key4 — device-internal field |
|
||||
| 14 | 6 | device-specific | NOT zero-padded — device-internal fields |
|
||||
| 20 | 1 | rectime | uint8 seconds |
|
||||
| 14 | 4 | device-specific | not identified (see the retraction below) |
|
||||
| 18 | 1 | **record type** ✅ | `0x46` waveform, `0x0A` histogram: 6,541 / 6,541 `…W` and 63,500 / 63,500 `…H` DL2 files (2026-11-02). See D.6.1 |
|
||||
| 19 | 2 | `00 00` | zero on 70,041 / 70,041 DL2 files |
|
||||
|
||||
> ⚠ **RETRACTED 2026-11-02.** This table used to end `| 14 | 6 | device-specific |` and
|
||||
> `| 20 | 1 | rectime | uint8 seconds |`. `STRT[20]` is `0x00` on every DL2 file, so it is not
|
||||
> the record time. Until v0.33.0, SFM read a record time from `STRT[18]`, the record-type byte,
|
||||
> which is why every waveform reported "70 s" (`0x46`). It also read pre-trigger and sample count
|
||||
> from `[16:18]`; both were wrong (#45). The record time and pre-trigger live in the
|
||||
> recording-setup block (D.6.2).
|
||||
|
||||
**Critical:** The STRT record must be copied verbatim from A5[0].data[7+strt_pos:] — bytes [10:20] contain device-specific values that cannot be reconstructed from protocol-level Event fields alone.
|
||||
|
||||
@@ -3437,12 +3452,16 @@ The body is reconstructed from the raw A5 bulk waveform stream frames by strippi
|
||||
|
||||
The footer terminates the N00 file. Its bytes come directly from the terminator A5 frame's inner content — do NOT reconstruct from event metadata.
|
||||
|
||||
✅ **It is the file's last 26 bytes** (2026-11-03): `0e 08` and two valid times end every one of 70,041 DL2 files.
|
||||
- ⚠ **Do not search for the first `0e 08` + plausible year.** 14 DL2 files also hold an earlier record of that shape, about 1.1 KB before the end, carrying the stop time followed by zeros.
|
||||
- Taking it made a histogram start at its own stop (a day late on BE9558's daily histograms). It also cost a waveform its stop, and with it the trigger time.
|
||||
|
||||
| Offset | Length | Field | Notes |
|
||||
|---|---|---|---|
|
||||
| 0 | 2 | `0e 08` | Fixed marker |
|
||||
| 2 | 8 | ts1 | Start timestamp (8B big-endian) |
|
||||
| 10 | 8 | ts2 | Stop timestamp (8B big-endian) |
|
||||
| 18 | 6 | `00 01 00 02 00 00` | Fixed |
|
||||
| 18 | 6 | varies | ⚠ **Not fixed** (2026-11-03). `00 01 00 02 00 00` in M529LIY6.N00. Elsewhere: `00 21 04 00 00 00` (K558L9XP.FK0H, K439I2WY.RK0H, T1895KDW.6J0H), `00 01 02 00 00 00` (K5575KDW.5L0W), `00 01 00 01 00 00` (S3545KFL.S60W). Not identified |
|
||||
| 24 | 2 | CRC | 2-byte CRC — algorithm unconfirmed |
|
||||
|
||||
**CRC:** The 2-byte CRC at footer[24:26] has an unconfirmed algorithm. In M529LIY6.N00 it reads `fe da`. Attempts to match CRC-16/CCITT, CRC-16/IBM, CRC-32 (truncated), and 40+ polynomial/init combinations all failed. The writer copies it verbatim from the terminator frame.
|
||||
@@ -3586,6 +3605,10 @@ observed) and does NOT follow the AB0T formula.
|
||||
|
||||
**DLE-shift offset note for reading recording_mode from N00/9T0 body:**
|
||||
|
||||
> ⚠ **2026-11-02:** this note finds the block by the 6-byte anchor. In an event file that anchor
|
||||
> exists only when the event's own pre-trigger is exactly −0.25 s: 3,886 / 6,541 DL2 waveforms,
|
||||
> and no histogram. Find the block by its setup name instead (D.6.2).
|
||||
|
||||
The compliance block in the file body has been through `_strip_inner_frame_dles`. The 0x10 constant at logical `anchor−7` (between recording_mode and sample_rate_HI) gets stripped when sample_rate_HI = `0x04` (1024 sps), because `0x10` precedes `0x04 ∈ {0x02,0x03,0x04}`. After stripping, the anchor shifts left by 1, so:
|
||||
|
||||
| 1024 sps (strip occurs) | 2048 or 4096 sps (no strip) |
|
||||
@@ -3604,6 +3627,201 @@ file[anc−4]: histogram_interval_HI
|
||||
file[anc−3]: histogram_interval_LO
|
||||
```
|
||||
|
||||
### D.6 Event fields read from the file alone ✅ 2026-10-29 → 2026-11-02
|
||||
|
||||
Since v0.33.0, SFM decodes the fields below from an event file's bytes alone: no filename, no
|
||||
Blastware report. The code is in `minimateplus/event_file_io.py`, `histogram_codec.py` and
|
||||
`waveform_codec.py`.
|
||||
|
||||
Each field was proven by the decode checker, `scratch/check_s3_decode.py`. It compares SFM's
|
||||
decode with Blastware's `_XML.XML` report for every DL2 event: 70,042 events, 2016–2026, local
|
||||
copy in `~/dl2-archive`. Counts below are from that archive unless stated otherwise.
|
||||
|
||||
#### D.6.1 Record type — `STRT[18]` ✅
|
||||
|
||||
| `STRT[18]` | Type | DL2 |
|
||||
|---|---|---|
|
||||
| `0x46` | Waveform | 6,541 / 6,541 `…W` files |
|
||||
| `0x0A` | Histogram | 63,500 / 63,500 `…H` files |
|
||||
|
||||
- The 5A stream shows the same byte after the STRT keys (§7.8.5, `data[35]`).
|
||||
- The filename's `W` / `H` is only a cross-check. On a disagreement SFM logs it and keeps the
|
||||
byte (#41).
|
||||
- Checker, event type: 70,042 / 70,042.
|
||||
- **It also picks the codec** (2026-11-03). Trying the waveform codec first handed it BE9440,
|
||||
BE9557 and BE17354's 2018 5 s histograms. It accepted them and returned about 5× too many
|
||||
"samples" (K440HDXX.XH0H: 44,504 for Blastware's 6,976).
|
||||
|
||||
#### D.6.2 Recording-setup block — sample rate, pre-trigger, record time ✅
|
||||
|
||||
**Find the block by structure:** `1c 08`, then the setup name (1–40 printable ASCII), then `00`.
|
||||
That pattern occurs exactly once in every DL2 file. Do not search for the name "Standard
|
||||
Recording Setup": 37% of DL2 files use another name.
|
||||
|
||||
Offsets are from `k`, the first byte of the setup name:
|
||||
|
||||
| Offset | Type | Field | Notes |
|
||||
|---|---|---|---|
|
||||
| `k − 42` | uint16 BE | sample rate | 1024 / 2048 / 4096 |
|
||||
| `k − 36` | float32 BE | pre-trigger | seconds, ≤ 0: `−0.25` is a quarter second before the trigger. **This event's own length, not the unit's setting** (below) |
|
||||
| `k − 32` | 2 bytes | — | `00 00` on 70,041 / 70,041 files |
|
||||
| `k − 30` | float32 BE | record time | seconds |
|
||||
|
||||
- Pre-trigger samples = `round(−pre-trigger × sample rate)`.
|
||||
- A histogram carries the block too, with pre-trigger `0.0` (63,500 / 63,500). Blastware reports
|
||||
no record time or pre-trigger for a histogram, and SFM reports none.
|
||||
- Sample rate, record time and pre-trigger match Blastware on every DL2 event that reports them
|
||||
(#44, #45).
|
||||
|
||||
⚠ **The file's pre-trigger is the event's, not the setting (measured 2026-11-02).**
|
||||
- **It varies from event to event on the same unit, often on the same day.** BE18193 has both
|
||||
−0.25 and −0.248 on 2026-08-21.
|
||||
- At 1024 sps the common values −0.25, −0.249, −0.248 and −0.2471 are 256, 255, 254 and 253
|
||||
samples.
|
||||
- At 4096 sps, BE18193's events range from −0.002 to −0.249 s.
|
||||
- **Blastware reports the same per-event value** as `Pre-triggerLength`, for example
|
||||
`-0.094 sec` for `T193KMX5.4Z0W`.
|
||||
- 🔶 Inferred: the unit's setting stays fixed while the captured length falls short of it. Why it
|
||||
falls short is unknown.
|
||||
|
||||
**What this means for #48 (the 1A "stable anchor"):**
|
||||
- This is the 1A compliance layout. Sample rate at anchor − 6 and record time at anchor + 6
|
||||
(§7.6.1) put the anchor at `k − 36`, so the 6-byte `be 80 00 00 00 00` is a pre-trigger of
|
||||
−0.25 s followed by the `00 00` at `k − 32`.
|
||||
- **In a file**, the anchor bytes appear only when that event's pre-trigger is exactly −0.25 s:
|
||||
3,886 / 6,541 waveforms, and no histogram (histogram files store 0.0). A file parser that
|
||||
searches for the anchor breaks on the rest. SFM's file decoder finds the block by its setup
|
||||
name instead.
|
||||
- **The live 1A read holds the setting, not an event's length.** So these files say little about
|
||||
whether the live read loses its anchor; #48 is still unsettled.
|
||||
- `k − 32 : k − 30` is `00 00` on all 70,041 files. 🔶 If `[17]` is the stop mode, as on
|
||||
Series IV, no DL2 event was recorded in Auto stop mode, so the archive cannot test that case.
|
||||
- The two blocks differ in at least one field. A live 1A in Histogram mode showed the anchor
|
||||
(−0.25 s), but histogram files store 0.0.
|
||||
|
||||
#### D.6.3 Notes — four label/value pairs after the name ✅
|
||||
|
||||
- After the name's `00`, NUL-terminated `label`, `value` pairs fill four slots, in order:
|
||||
project, client, operator ("User Name") and sensor location ("Seis Loc").
|
||||
- **Read them by position, never by label.** Blastware lets the operator relabel the slots
|
||||
("Seis. Loc:", "Location:", "Project: ").
|
||||
- An empty value means none.
|
||||
- They match Blastware on every DL2 event.
|
||||
- Not read yet: extended notes.
|
||||
|
||||
**Job number** ✅ 2026-11-02, in Series IV's `0x1A` layout (`[39]` report flags, `[40:42]` the
|
||||
number):
|
||||
|
||||
| Offset | Type | Field |
|
||||
|---|---|---|
|
||||
| `k − 9` | uint8 | report flags: bit `0x02` = job number shown |
|
||||
| `k − 8` | uint16 BE | job number, kept while not shown |
|
||||
|
||||
- **The flag** matches Blastware's `JobNumber` on 2,997 / 2,997 DL2 events that print one, and
|
||||
66,986 / 66,986 that don't.
|
||||
- **The value** matches on all 2,997, but every printed value is 1, so it is only proven for 1.
|
||||
Hidden ones hold real numbers (802, 1012, 1013, 622).
|
||||
- Bit `0x04` is also seen (2,311 files); it is not identified.
|
||||
|
||||
#### D.6.4 Geophone range — the setup's channel blocks ✅ 2026-11-01
|
||||
|
||||
The channel blocks follow the notes, within 2,000 bytes of the name: `00 00 01` then `Tran` /
|
||||
`Vert` / `Long`. The range is the byte at label + 29, where label is the first byte of
|
||||
`Tran` / `Vert` / `Long`:
|
||||
|
||||
| label + 29 | Range | Full scale |
|
||||
|---|---|---|
|
||||
| `0x00` | Normal | 10.000 in/s |
|
||||
| `0x01` | Sensitive | 1.250 in/s |
|
||||
|
||||
- It matches the report's `GeoRange` on 70,042 / 70,042 events. The three channels agree on
|
||||
every event, and 35 are Sensitive.
|
||||
- The live 1A carries the same byte at label + 33 (§7.6, confirmed 2026-04-20).
|
||||
- Full scale is 32,000 counts at either range, so a Sensitive count is 8× smaller.
|
||||
- Until `dev` `057df47` (2026-11-02), SFM assumed Normal and read every Sensitive event 8× high.
|
||||
- If the channels disagree, a value is unknown or a block is missing, SFM reports no range, logs
|
||||
a decode problem and assumes Normal.
|
||||
|
||||
#### D.6.5 Histogram interval peak vector sum ✅ 2026-10-30
|
||||
|
||||
Each interval stores its peak vector sum **squared**:
|
||||
|
||||
| Block | Where | Type |
|
||||
|---|---|---|
|
||||
| Standard 32-byte block (intervals of a minute or more) | `[21:25]` | uint32 BE |
|
||||
| Sub-minute record | the record's last 4 bytes | uint32 BE |
|
||||
|
||||
- `PVS = √value × unit`. The unit is 16 counts: 0.005 in/s at Normal, 0.000625 in/s at
|
||||
Sensitive.
|
||||
- **The event's PVS is the largest interval's.** Combining the three channel peaks instead read
|
||||
high on 86% of DL2 histograms, because the peaks can come from different moments.
|
||||
- **Verified:** √value matches Blastware's "Geo PVS" on 34.5 M DL2 sub-minute intervals, and the
|
||||
event PVS matches on 69,989 / 70,042 events (`dev`, 2026-11-03).
|
||||
- **A consistency check** (2026-11-03): an interval's vector sum is never below its largest
|
||||
channel peak, nor above √3 times it, give or take one unit of rounding. That holds on
|
||||
34,502,955 / 34,502,955 DL2 sub-minute intervals, and is what the codec now uses to recognise
|
||||
a sub-minute record layout.
|
||||
- 🔶 On the stream's last block, the "arbitrary bytes at [21:23]" in the 2026-08-25 note are
|
||||
probably the high half of this field (inferred from the layout, not measured).
|
||||
|
||||
**Sub-minute records (corrected in v0.32.0, #47/#49):**
|
||||
- They are **big-endian, starting at byte 5** of the block.
|
||||
- Each holds, per channel, a uint16 peak and a uint16 half-period (Tran, Vert, Long, and MicL
|
||||
when the mic is on), then the uint32 PVS².
|
||||
- Record = 4 × channels + 4 bytes: 20 with the mic, 16 without. `stride = 12 + n × record`.
|
||||
|
||||
> ⚠ **RETRACTED:** the 2026-08-26 notes (Changelog, §15) read these records as 8 × uint16
|
||||
> little-endian after a 6-byte header. That was the same big-endian words shifted by one byte.
|
||||
> Their "2-word tail whose first word is 0000" is the PVS², whose high word reads `0000`.
|
||||
>
|
||||
> ⚠ **RETRACTED 2026-11-03:** "the high word reads `0000`" holds only on quiet intervals. It is
|
||||
> non-zero above 1.28 in/s. The layout check required it, so a one-block histogram with a loud
|
||||
> interval was not recognised at all (T193KR5M.X90H, K440HA3C.JM0H, R352HFZ7.530H). The check is
|
||||
> now the consistency test above.
|
||||
|
||||
**Blastware's "Number of Intervals" is the monitoring time ÷ the interval** (measured
|
||||
2026-11-03), from the footer's start and stop:
|
||||
- It is exact on T193KSWP.FF0H (2,880), M462KSWR.1R0H (1,650) and T193KY0A.740H (6,390).
|
||||
- When the unit never wrote the last minute, the file holds one block fewer (30 intervals at
|
||||
2 s). Blastware's own interval table lists only the stored intervals, which is what SFM
|
||||
decodes.
|
||||
- A decode-checker carve-out (`interval-count-is-duration`) covers the 8 DL2 events where the
|
||||
two differ.
|
||||
|
||||
#### D.6.6 Mic ✅ v0.33.0
|
||||
|
||||
- One count = **0.25 Pa**, so psi = count × 0.25 / 6894.757.
|
||||
- dB(L) = **81.9384** + 20·log10(|count|).
|
||||
- The exact value, 20·log10(0.25 Pa / 20 µPa), is 81.9382. Blastware's printed values pin the
|
||||
offset in [81.9383, 81.9385] instead.
|
||||
- With the exact value, 280 events mismatched, all at count 129.
|
||||
- float32 rounding does not explain the difference.
|
||||
- **Verified:** interval psi mismatches fell from 42,783 to 26, and mic peak mismatches from 345
|
||||
to 40.
|
||||
|
||||
#### D.6.7 Not read from the file yet
|
||||
|
||||
*Updated 2026-11-03. 18 of 88 report fields now match on every DL2 event.*
|
||||
- **Fields not read yet:**
|
||||
- trigger source and levels, stop mode, mic type, display units, firmware version, serial
|
||||
number, calibration, battery
|
||||
- per-interval frequencies (#50: they assume 1024 sps), per-interval PVS, interval size,
|
||||
histogram stop time
|
||||
- extended notes
|
||||
- the values Blastware computes: ZC frequency, acceleration, displacement, time of peak
|
||||
- sensor check results
|
||||
- monitor log
|
||||
- **Open cases:**
|
||||
- histogram start times are 1 s early (#51)
|
||||
- about 20 one-minute histograms with a mic peak an interval or two off
|
||||
- Blastware prints `OORANGE` when the vector sum alone exceeds the range (a carve-out still to
|
||||
prove)
|
||||
- **Resolved on `dev`, 2026-11-02 → 03:**
|
||||
- the 37 histograms that decoded wrongly (D.6.1, D.6.5)
|
||||
- the 26 histogram start dates a day off (D.3.3; 17 of them were the same 5 s files, timed
|
||||
as waveforms)
|
||||
- the job number (D.6.3)
|
||||
|
||||
---
|
||||
|
||||
*All findings reverse-engineered from live RS-232 bridge captures.*
|
||||
|
||||
Reference in new issue
Block a user