Skip to content

ierstable: embedded fallback for a corrupt on-disk table; reject empty/truncated tables - #166

Merged
ssmichael1 merged 2 commits into
mainfrom
fix/ierstable-embedded-fallback
Aug 31, 2026
Merged

ierstable: embedded fallback for a corrupt on-disk table; reject empty/truncated tables#166
ssmichael1 merged 2 commits into
mainfrom
fix/ierstable-embedded-fallback

Conversation

@ssmichael1

Copy link
Copy Markdown
Owner

Makes the ierstable::table() panic unreachable at runtime, which resolves #125 without the breaking Result-threading cascade it planned.

Fallback. A tab5.2*.txt found in a search directory that cannot be read or parsed now warns (SATKIT_QUIET=1 silences) and loads the compiled-in copy. The embedded table is the same IERS 2010 series, so the fallback is exact — this is not the accuracy degradation #125 rightly rejected (qgcrf2itrf_approx). Since #139 embedded the tables, a corrupt on-disk copy shadowing them was the only remaining path to the panic; after this the only way to reach it is an embedded blob that fails to inflate or parse, i.e. a build defect.

Stricter parser (needed so bad files actually fail instead of loading as garbage):

  • text with no j = header — an HTML notice page, an empty file — used to parse as six empty series and make every transform silently skip the nutation terms; now InvalidIersTableDef.
  • a table whose header promises more rows than the text delivers (truncated transfer) used to leave the missing rows zero; now rejected, checked at each series boundary and at end of file.

The real files (embedded copies, verified byte-identical to the IERS originals) pass the stricter checks — the existing offline_embedded_iers_tables_parse test covers that.

Tests: minimal table accepted; no-header / HTML / unrelated text rejected; truncation rejected (mid-file and at end); corrupt file falls back to embedded for a known name, errors for an unknown name, missing file falls back too. Full frametransform lib tests + ierstable_init / offline_smoke / properties integration tests green; clippy -D warnings and fmt clean.

Closes #125

🤖 Generated with Claude Code

https://claude.ai/code/session_01PG969yapJ84DJceKt21Wen

ssmichael1 and others added 2 commits August 30, 2026 20:24
…s corrupt; reject empty and truncated tables

A tab5.2*.txt in a search directory that fails to read or parse now warns
and loads the compiled-in copy (the same IERS 2010 series, so the fallback
is exact) instead of panicking in `table()`. That panic was the last
reachable one after #139 embedded the tables; with this it is unreachable
short of a build defect, which makes the planned breaking Result-threading
(#125) unnecessary.

The parser also now rejects text with no `j =` header (a proxy notice page
or empty file previously loaded as six empty series and silently zeroed
the nutation terms) and a table whose header promises more rows than the
text delivers (a truncated transfer), so that such files actually trigger
the fallback rather than loading as garbage.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PG969yapJ84DJceKt21Wen
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PG969yapJ84DJceKt21Wen
@ssmichael1
ssmichael1 merged commit 408d1b6 into main Aug 31, 2026
8 checks passed
@ssmichael1
ssmichael1 deleted the fix/ierstable-embedded-fallback branch August 31, 2026 00:31
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.

Next breaking release: thread Result through IERS-table-dependent frame transforms

1 participant