merge: dev into feat/series4-sfm-parity -- v0.32.0, #42, #47/#49, #44/#45, the S3 decode checker
Brings the branch up to dev (41 commits) before the 1c bench fixes, which touch code dev changed: the histogram reader (#47/#49, bench finding #2), the v0.32.0 event-time rules, the Blastware file's setup-block fields (#44/#45), and the decode checker for verifying stored S3 downloads. One conflict: the top of the Series-III reference's change table -- both sides added rows; kept all, in date order, CRLF preserved. CLAUDE.md, README, blastware_file.py, models.py and database.py merged cleanly. Suite: the known 16 failures only (15 test_bw_ascii_report, test_save_imported_bw_without_report_ works_unchanged, which also fails on dev); 1237 passed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44
This commit is contained in:
commit
342c69602d
54 files changed
+22279
-264
No files matched your search
@@ -12,6 +12,7 @@
|
||||
| Date | Section | Change |
|
||||
|---|---|---|
|
||||
| 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. |
|
||||
| 2026-10-26 (4) | §3, §10 | **Replies follow the request rule; a write-frame suspicion (inferred).** Measured on all 748 reply frames of the 10-26 recording: the unit escapes exactly 02/03/04/10 with a `10`, and the checksum is **SUM8 of the unescaped payload**, 748/748. The long-held "S3 response checksums frequently fail SUM8" (`protocol._validate_frame`) is `S3FrameParser`'s own doing: it keeps the `10` of `10 02/03/04` in its output (consumers rely on that) and sums it, so 502/540 A5 replies read invalid. 🔶 **Inferred only:** `build_bw_write_frame`'s model ("raw except BW_CMD", "DLE-aware checksum") shows the same fingerprints as the retracted 5A model -- SUB 71's "offset 0x1004" reads as length 0x0400 escaped, and Blastware escapes `03` in write data (§3 note, 2026-04-20). A write whose payload holds a bare 02/03/04/10 may be malformed; one Blastware config-write capture settles it. Not acted on. |
|
||||
| 2026-10-26 (3) | §3, §7.8, §10 | **⚠ RETRACTS the 5A "non-standard frame" model; the 64 KB page bug is FIXED (measured).** A bridge recorded Blastware downloading all 8 of BE9441's events, 4 crossing a 64 KB page (`tests/fixtures/minimate-bench-10-26-26-blastware/`). **Every request** is the standard 16-byte payload with a SUM8 checksum and **every 02, 03, 04 and 10 DLE-escaped**, payload and checksum alike: 748/748 re-encode byte-identically. §10's "only 0x10 is stuffed" is half the rule. **A 5A request is an ordinary request** `[10 00 5A 00][length BE 2][address BE 4][zeros 6]`, where length is 0x0200 per chunk and the remainder for TERM. The walk: the event's start address, +0x200 at a time as plain 32-bit addresses (carrying into the page byte), then TERM at the next boundary for exactly the remainder, ending at STRT's full 32-bit end key. **Misreadings retracted:** the fixed "offset 0x1002" is length 0x0200 escaped (`10 02 00`); the "metadata pages at 0x1002 / 0x1004, global, read once per session" are the first event's own chunks at 0x0200 and 0x0400; the "11-byte params" counted the length's low byte; the "partial DLE stuffing" carve-outs were the escape rule seen half; the 16-bit counter is why a walk could not leave its page. **Verified live on BE9441:** all 8 events downloaded whole, the 4 crossings included, each matching the unit's own 0C peaks. Code `887e75d`. |
|
||||
| 2026-10-26 (2) | §7.8 | **The 64 KB page bug, narrowed (measured, BE9441).** Blastware's own downloads of all 20 events (Brian, `example-events/10-25-26 - thumps`) give byte-exact ground truth. SFM's downloads of events 0, 1, 3, 4 and 10 are **byte-identical** to Blastware's. Importing Blastware's files first (the watcher route) makes SFM's downloads of the same events return `already_stored`: the unit's 0C and Blastware's file agree on (serial, timestamp). For an event that crosses a page (event 2, `0111c92c` → STRT end key `01122f06`, full 32 bits) a read-only test walk with the page byte carried (params `00 01 12 01 2c`) got a proper A5 reply for the first chunk in page 0x12, echoing `01 12 01 2c`. The second chunk, `00 01 12 03 2c`, got no reply frame: a raw 0x03 (ETX) inside the params. Page 0x11 never shows this, because event 1 skips 0x0000–0x05FF, so no counter there has a 02/03/04 byte. Every later page does. ⚠ How Blastware encodes a lone 02/03/04 inside params is unknown: §7.8 says `10 02/03/04` is kept as a literal pair, which would shift the address. A wire capture of Blastware downloading BE9441 event 2 or 19 settles it. Blastware's files are fixtures (`tests/fixtures/minimate-bench-10-25-26/blastware/`). |
|
||||
@@ -2248,6 +2249,82 @@ bulk stream protocol from §7.8.5. Use the `0x46` keys, not the `0x2C` keys, as
|
||||
|
||||
---
|
||||
|
||||
#### 7.8.9 The embedded event record — the instrument's trigger time, inside the 5A stream ✅ 2026-10-26
|
||||
|
||||
Every Blastware waveform file carries a copy of the instrument's **event record**, and it
|
||||
holds the event's **trigger time to the second**. It is the instrument's data, not
|
||||
Blastware's: it arrives in the unit's own 5A stream (provenance below). Found by reading a
|
||||
dump in `seismo_lab.py`'s Inspector, where it sits in the trailing region the Inspector
|
||||
labels "unknown", after the notes and channel blocks.
|
||||
|
||||
**Layout** — offsets relative to `M`, the position of the marker:
|
||||
|
||||
| bytes | content | measured on 7,935 waveforms (DL2 archive 6,541 + prod store 1,394) |
|
||||
|---|---|---|
|
||||
| `[M-6:M-2]` | `00 28 05 00` | constant, 7,935/7,935 ✅ (meaning ❓) |
|
||||
| `[M-2:M]` | 2 bytes | vary; not decoded ❓ |
|
||||
| `[M:M+2]` | `fe 80` — marker | 7,935/7,935 ✅. Histogram files carry `fe f5` here instead (#51) |
|
||||
| `[M+2:M+10]` | **trigger** — `dd mm yyyy(BE) 00 hh mm ss` | = Blastware's report Event Time 1,320/1,320; = the filename's time 7,935/7,935; = the unit's `0C` record 10/10 ✅ |
|
||||
| `[M+10:M+18]` | **stop**, same format | = the footer's `ts2` on 7,836; one second before it on 99 ✅ |
|
||||
| `[M+18:M+40]` | `[+18]` `00` (7,933/7,935), `[+22:24]` `00 00`, `[+26:34]` eight `00`, `[+36]` `00`, `[+37:39]` `16 32`, `[+39]` `00` | constant; meaning ❓ |
|
||||
|
||||
**Relations** (7,935/7,935): footer `ts1` (session start) ≤ trigger ≤ stop; and
|
||||
`(stop - trigger) - record time` lies in −3 … +6 s.
|
||||
|
||||
**Ambiguity:** 30 files hold a second `fe 80`; it never passes the checks below, and every
|
||||
file has exactly one candidate that does.
|
||||
|
||||
**Provenance** (where it comes from — measured):
|
||||
- **Blastware's download of 8 BE9441 events** (2026-10-26 recording,
|
||||
`tests/fixtures/minimate-bench-10-26-26-blastware/`). Each event's 18-byte record, with
|
||||
the 24 bytes before it and the 22 after, occurs **exactly once in the unit's own A5 reply
|
||||
payloads**. Its trigger equals the unit's separate `0C` (SUB F3) record 8/8: F3 data
|
||||
`[11:19]` is the same `dd mm yyyy 00 hh mm ss` form.
|
||||
- **SFM's own downloads of BE9441 events 0 and 1** (2026-10-25, no Blastware anywhere). The
|
||||
record is present, and its trigger = the `0C` record, 2/2.
|
||||
- So it is instrument-transmitted. An event SFM receives directly carries it, with no
|
||||
Blastware name involved.
|
||||
|
||||
**What it replaces.** The footer alone gives only an estimate. `ts2` is the stop to the
|
||||
second (its byte `[4]` is `00` in all 1,330 report-paired files, so it holds no fraction),
|
||||
and `ts2 - record time` is exact on 1,113/1,330 report-paired waveforms and a second late
|
||||
on 217. On prod's 1,394 it is a second off on 260: 199 late, 61 early.
|
||||
|
||||
**Decoder** (`event_file_io._embedded_event_record`).
|
||||
- **What qualifies.** A candidate counts only when it has the lead bytes, the marker, two
|
||||
well-formed times (zero byte zero), `ts1 ≤ trigger ≤ stop`, a stop equal to `ts2` or one
|
||||
second before it, and a length that agrees with the record time.
|
||||
- **One answer or none.** Exactly one candidate must qualify. With none, or more than one,
|
||||
the event keeps the footer estimate and carries a `decode_problems` entry; nothing is
|
||||
guessed.
|
||||
- **Names and reports are cross-checks only.** A Blastware filename is never a time source:
|
||||
a disagreement is logged and the record kept. A paired report's time fills in only when
|
||||
there is no validated record.
|
||||
- Decoded from raw bytes with no name: every waveform the codec recognises takes the
|
||||
record's time, 7,961/7,961 (DL2 6,538, prod 1,394, bench 29), with 0 disagreements
|
||||
against the filename or a report. The 3 it does not recognise are the open case below.
|
||||
|
||||
🔶 **For the decoder audit (#53), inferred only.** The `0C` timestamp layouts documented in §7.5
|
||||
look like this same 8-byte form, read without its escapes:
|
||||
- the "sub_code 0x10" 9-byte form;
|
||||
- the 10-byte "continuous mode" form, whose own example `10 03 10 04 07 ea 00 0f 14 11` reads
|
||||
as day 3, month 4, escaped, at 15:20:17.
|
||||
|
||||
The early captures were all in April (month `04`, sent as `10 04`). Not changed here.
|
||||
|
||||
⚠ **Open:** 3 DL2 files named as waveforms (`K440I4LG.JK0W`, `K888HW07.7K0W`,
|
||||
`R349KPNU.FK0W`) carry a valid record, but their body is not recognised by the waveform
|
||||
codec. They are decoded as histograms and stamped with the footer start, 4 s off; `dev`
|
||||
behaves the same. Prod's store has none. Tracked in #53.
|
||||
|
||||
⚠ **Corrected 2026-10-29 (measured against their Blastware `_XML.XML` reports):** they
|
||||
do **not** decode as histograms. All three decode as waveforms with Blastware's full
|
||||
sample count (4,352 / 4,352 / 13,280 rows), and their record time and sample rate are
|
||||
read. Only the time is wrong: no footer stop time (`ts2`) is read, so the decoder falls
|
||||
back to the footer start -- 11:14:12 / 11:14:12 / 16:14:11 against Blastware's
|
||||
11:14:08 / 11:14:08 / 16:14:08 -- and records no `decode_problems` entry. 🔶 Inferred,
|
||||
from the decode-checker design review: the decoder takes an earlier, false footer.
|
||||
|
||||
## 7.9 Compliance Config Field Inventory (Blastware UI, 2026-04-08) ✅
|
||||
|
||||
Fields visible in the Blastware "Compliance Setup" dialog. ✅ = byte offset confirmed in code. ❓ = not yet located in raw bytes.
|
||||
|
||||
Reference in new issue
Block a user