Skip to content

feat(galileo_e5a): back-patch almanac reference epochs from a later WT5#66

Merged
siebc merged 1 commit into
masterfrom
sc/e5a-almanac-epoch-backpatch
Jul 3, 2026
Merged

feat(galileo_e5a): back-patch almanac reference epochs from a later WT5#66
siebc merged 1 commit into
masterfrom
sc/e5a-almanac-epoch-backpatch

Conversation

@giove-a

@giove-a giove-a commented Jul 1, 2026

Copy link
Copy Markdown

What

Galileo F/NAV broadcasts each almanac's reference epoch (WN_a/t_0a) only
in 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: since WN_a/t_0a are shared by every
almanac 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

  • Epoch back-patch (headline): on every WT5, complete any earlier record
    with a matching IOD_a that is still missing its epoch. Copy-on-write — the
    dictionary shared with raw_data is never mutated in place.
  • Decode-everything policy retained & documented: a WT6 SVID-3 without its
    epoch is still stored (WN_a/t_0a = nothing) rather than discarded. The
    almanacs field docstring now states plainly that a record may be incomplete
    (any field can be nothing, the epoch in particular) so callers check the
    fields they need before use.
  • Per-page scratch reuse: hoist soft_page (488 Float32) and crc_bits
    (238 Bool) into GalileoE5aCache instead of reallocating them per synced
    page, mirroring the CNAV preallocation convention. Consistency cleanup — runs
    once per page, so runtime impact is small.

Testing

  • New testset for the partial-record case: WT6 without its WT5 stores the orbit
    with WN_a/t_0a = nothing.
  • New testset for the back-patch: a later WT5 completes a stranded SVID-21 whose
    only WT6 was seen once.
  • Full suite green (2457 tests).

🤖 Generated with Claude Code

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

codecov Bot commented Jul 1, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.15%. Comparing base (5f3a69c) to head (e7b3f75).

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@siebc
siebc merged commit 1728ed4 into master Jul 3, 2026
9 checks passed
@siebc
siebc deleted the sc/e5a-almanac-epoch-backpatch branch July 3, 2026 08:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants