feat(galileo_e5a): back-patch almanac reference epochs from a later WT5#66
Merged
Conversation
WN_a/t_0a are shared by every almanac of a given IOD_a but are broadcast only in WT5, while a WT6 can carry an otherwise-complete SVID-3. If the paired WT5 was missed (mid-stream acquisition or IOD cutover), that SVID-3 was left without its reference epoch. Add `backpatch_almanac_epochs` so a later WT5 back-fills WN_a/t_0a into any such stranded record, completing a one-shot WT6 orbit even if that WT6 never reappears. This keeps the decode-everything policy: a WT6 SVID-3 without its epoch is still stored (WN_a/t_0a `nothing`) rather than discarded. A decoded almanac may therefore be incomplete — any field can be `nothing`, and a record's reference epoch in particular may be absent until a matching WT5 arrives. The `almanacs` field docs spell this out so callers check the fields they need before use. Also hoist the per-page `soft_page` (488 Float32) and `crc_bits` (238 Bool) scratch into `GalileoE5aCache`, reused across synced pages rather than reallocated, mirroring the CNAV preallocation convention (consistency; runs once per page, so the runtime impact is small). New tests cover the partial-record and epoch back-patch cases. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #66 +/- ##
==========================================
+ Coverage 98.13% 98.15% +0.01%
==========================================
Files 14 14
Lines 1505 1515 +10
==========================================
+ Hits 1477 1487 +10
Misses 28 28 ☔ 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
Galileo F/NAV broadcasts each almanac's reference epoch (
WN_a/t_0a) onlyin Word Type 5, but a WT6 can carry an otherwise-complete SVID-3. If the
paired WT5 is missed — mid-stream acquisition, or an IOD cutover that lands a
WT6 without its WT5 — that SVID-3 record is stored without its epoch and, until
now, stayed permanently incomplete.
This PR adds
backpatch_almanac_epochs: sinceWN_a/t_0aare shared by everyalmanac of a given
IOD_a, a later WT5 back-fills them into any stranded record.A one-shot WT6 orbit therefore becomes usable even if that WT6 never reappears —
something a "store only when complete" policy could never recover, because the
WT5 alone carries none of SVID-3's orbital data.
Details
with a matching
IOD_athat is still missing its epoch. Copy-on-write — thedictionary shared with
raw_datais never mutated in place.epoch is still stored (
WN_a/t_0a=nothing) rather than discarded. Thealmanacsfield docstring now states plainly that a record may be incomplete(any field can be
nothing, the epoch in particular) so callers check thefields they need before use.
soft_page(488Float32) andcrc_bits(238
Bool) intoGalileoE5aCacheinstead of reallocating them per syncedpage, mirroring the CNAV preallocation convention. Consistency cleanup — runs
once per page, so runtime impact is small.
Testing
with
WN_a/t_0a=nothing.only WT6 was seen once.
🤖 Generated with Claude Code