test(minimateplus): the walk rebuilds Blastware's own files for the page-crossing events
Brian's Blastware files from the recorded session (events 0, 1, 3, 7 -- three cross a 64 KB page) as fixtures; SFM's walk, fed Blastware's recorded replies, writes each one byte for byte. Live the same day, SFM's own downloads of all 8 events were byte-identical to Blastware's (sha256), the 4 crossings included -- and events 2-5's shorter sample counts (20,490-21,011 vs 21,504) are in Blastware's files too: the unit's own recording. 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
6f31eca366
commit
f61fc3cc78
6 files changed
+26
-1
No files matched your search
@@ -28,3 +28,15 @@ and every 02 / 03 / 04 / 10 byte DLE-escaped (748/748 re-encode byte-identically
|
||||
address; a walk is start, start+0x200, ... carrying into the page byte, then TERM at the next
|
||||
boundary for exactly the remainder. The first event's "metadata pages at 0x1002/0x1004" are
|
||||
its chunks at 0x0200 and 0x0400, escaped (`10 02 00`, `10 04 00`).
|
||||
|
||||
## `blastware/`: the files Blastware wrote in that session (Brian)
|
||||
|
||||
| file | event | crosses a page |
|
||||
|---|---|---|
|
||||
| `K441LTOF.ZI0` | 0 (`01110000`) | no |
|
||||
| `K441LTOF.ZQ0` | 1 (`01118a2c`) | yes, into 0x12 |
|
||||
| `K441LTOG.000` | 3 (`0112a0b6`) | yes, into 0x13 |
|
||||
| `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.
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -21,7 +21,8 @@ sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))
|
||||
|
||||
import minimateplus.protocol as mp # noqa: E402
|
||||
from minimate_replay import fast_clock # noqa: E402
|
||||
from minimateplus.blastware_file import extract_body_bytes # noqa: E402
|
||||
from minimateplus.blastware_file import extract_body_bytes, write_blastware_file # noqa: E402
|
||||
from minimateplus.models import Event # noqa: E402
|
||||
from minimateplus.framing import S3FrameParser, build_5a_request, build_bw_frame, waveform_key_params # noqa: E402
|
||||
from minimateplus.waveform_codec import STREAM_END_ID, decode_waveform_v2, walk_records # noqa: E402
|
||||
|
||||
@@ -152,3 +153,15 @@ def test_the_walk_sends_exactly_blastwares_requests_and_the_event_is_whole(key):
|
||||
assert body[recs[-1]["end"] + 4] == STREAM_END_ID
|
||||
dec = decode_waveform_v2(body)
|
||||
assert len({len(dec[c]) for c in ("Tran", "Vert", "Long")}) == 1
|
||||
|
||||
|
||||
@pytest.mark.parametrize("key,bw", [("01110000", "K441LTOF.ZI0"), ("01118a2c", "K441LTOF.ZQ0"),
|
||||
("0112a0b6", "K441LTOG.000"), ("0114b0b2", "K441LTOG.0S0")])
|
||||
def test_the_file_built_from_the_walk_is_blastwares_own(key, bw, tmp_path):
|
||||
frames = mp.MiniMateProtocol(ByAddress()).read_bulk_waveform_stream(
|
||||
bytes.fromhex(key), stop_after_metadata=False, include_terminator=True, strict=True)
|
||||
ev = Event(index=0)
|
||||
ev.timestamp = None # the builder takes the footer from the TERM frame
|
||||
path = tmp_path / bw
|
||||
write_blastware_file(ev, frames, path)
|
||||
assert path.read_bytes() == (FIX / "blastware" / bw).read_bytes()
|
||||
Reference in new issue
Block a user