test(flexiband): self-terminate demux at first malformed frame#59
Merged
Conversation
The III-7a capture is only well-formed for its first ~13.68 s; the trailing ~2 s has broken `0x55 0xAA` preambles and demuxes to noise (cf. Tracking.jl #157/#158). `iii7a_read_bands!` didn't validate the preamble, so it fed those garbage tail frames into `track!`/`decode`. Stop at the first bad preamble and return only the valid prefix. When a window comes back short the next read returns empty and the existing `isempty(l1) && break` ends the tracking loop cleanly. The demux was already windowed (one 0.2 s chunk read straight from the decompressing zip stream, never materializing the full ~1.93 GB `.usb`), so memory stays bounded; document that alongside the new termination. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #59 +/- ##
=======================================
Coverage 97.67% 97.67%
=======================================
Files 10 10
Lines 1336 1336
=======================================
Hits 1305 1305
Misses 31 31 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
The III-7a integration test now stops the demux at the first malformed USB frame instead of reading all the way to EOF.
Why
The Flexiband III-7a capture is only well-formed for its first ~13.68 s; the trailing ~2 s has broken
0x55 0xAApreambles and demuxes to noise. This is the same capture-tail artifact diagnosed in Tracking.jl #157 / #158.iii7a_read_bands!did not validate the frame preamble, so it fed those garbage tail frames intotrack!/decode.Change
0x55 0xAApreamble on each frame; stop at the first bad one and return only the valid prefix. When a window comes back short, the next read returns empty and the existingisempty(l1) && breakends the tracking loop cleanly..usb, so memory stays bounded (lighter than #158's retain-then-@viewapproach; no OOM risk here).Notes
The integration test is opt-in (
GNSSDECODER_RUN_INTEGRATION_TEST=true) and downloads a 1.6 GB capture, so it was not run end-to-end here. The preamble logic mirrors the verifiedread_payloadin Tracking.jl #158. Change is JuliaFormatter 2.8.5 clean.🤖 Generated with Claude Code