fix(minimateplus): size the 5A chunk cap from STRT, refuse a misread STRT, TERM only a tail
Follow-ups from the review of 887e75d (verdict: keep, with fixes; no critical).
- The cap: a caller's max_chunks (client.py passes 128) now bounds only a walk
whose end is unknown. With STRT it cut every event past ~66 KB short --
2,545 of 63,500 archived histograms are bigger (the review's count, DL2).
Strict raised; legacy sent a TERM for most of the event, or a bare ValueError.
- A STRT claiming less than one 0x200 chunk, or more than 4 MiB (a sanity bound,
not a measured limit), is refused as a misread, in both modes -- once a bare
ValueError and a 500.
- TERM is sent only for a true tail (< 0x200). After an early end the legacy
walk returns what arrived and sends none.
- build_5a_request wraps build_bw_frame; the old 5A helpers are marked
superseded (kept for tests/test_5a_protocol.py) and their imports dropped.
Tests: all 8 recorded events (were 4) walk exactly as Blastware and rebuild its
own files; an end key holding escaped bytes; a 300 KB event past a 128 cap; both
misread-STRT refusals; the 1A frames BE9441 answered post-fix; the checksum
vectors retargeted. Mutants the review saw survive (no STRT un-escape; a
standard-request escape revert) and 3 new ones are each caught.
Measured on the way: a reply's checksum is SUM8 of its unescaped payload,
748/748. The 'S3 checksums frequently fail' note was the parser summing its
own kept escape bytes; noted, parser unchanged.
Docs: the crossing count corrected to four (events 1, 3, 5, 7); the remaining
stale 5A sections in CLAUDE.md annotated; the write-frame suspicion recorded as
inferred only. No codec, store or DB change.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44
This commit is contained in:
1 parent
f61fc3cc78
commit
8acb9512a9
15 files changed
+285
-73
No files matched your search
+11
-1
@@ -9,7 +9,7 @@ to disk. Both directions, raw:
|
||||
| `blastware_requests.bin` | Blastware → unit (748 requests, each after a `41 03` SESSION_RESET) | 17,757 B |
|
||||
| `unit_replies.bin` | unit → Blastware | 364,972 B |
|
||||
|
||||
Events (key → end), from Blastware's 5A walks. Three cross a 64 KB page:
|
||||
Events (key → end), from Blastware's 5A walks. Four cross a 64 KB page (1, 3, 5, 7):
|
||||
|
||||
| event | start key | end (STRT) | 5A requests |
|
||||
|---|---|---|---|
|
||||
@@ -35,8 +35,18 @@ its chunks at 0x0200 and 0x0400, escaped (`10 02 00`, `10 04 00`).
|
||||
|---|---|---|
|
||||
| `K441LTOF.ZI0` | 0 (`01110000`) | no |
|
||||
| `K441LTOF.ZQ0` | 1 (`01118a2c`) | yes, into 0x12 |
|
||||
| `K441LTOF.ZV0` | 2 (`011216c4`) | no |
|
||||
| `K441LTOG.000` | 3 (`0112a0b6`) | yes, into 0x13 |
|
||||
| `K441LTOG.050` | 4 (`011329d2`) | no |
|
||||
| `K441LTOG.0A0` | 5 (`0113b072`) | yes, into 0x14 |
|
||||
| `K441LTOG.0L0` | 6 (`01143046`) | no |
|
||||
| `K441LTOG.0S0` | 7 (`0114b0b2`) | yes, into 0x15 |
|
||||
|
||||
After the fix (887e75d), SFM's own live downloads of all 8 events were byte-identical to
|
||||
Blastware's files (sha256), the 4 crossings included.
|
||||
|
||||
The unit's replies (measured on all 748): every 02/03/04/10 is escaped with a `10`, exactly as
|
||||
in requests, and the checksum is SUM8 of the **unescaped** payload, 748/748. `S3FrameParser`
|
||||
keeps the escape bytes of `10 02/03/04` in its output and sums those too, which is why its
|
||||
`checksum_valid` is False on 502 of the 540 A5 replies. The "S3 checksums frequently fail"
|
||||
note in `protocol._validate_frame` describes the parser, not the unit.
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Reference in new issue
Block a user