ierstable: embedded fallback for a corrupt on-disk table; reject empty/truncated tables - #166
Merged
Merged
Conversation
…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
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.
Makes the
ierstable::table()panic unreachable at runtime, which resolves #125 without the breakingResult-threading cascade it planned.Fallback. A
tab5.2*.txtfound in a search directory that cannot be read or parsed now warns (SATKIT_QUIET=1silences) 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):
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; nowInvalidIersTableDef.The real files (embedded copies, verified byte-identical to the IERS originals) pass the stricter checks — the existing
offline_embedded_iers_tables_parsetest 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
frametransformlib tests +ierstable_init/offline_smoke/propertiesintegration tests green; clippy-D warningsand fmt clean.Closes #125
🤖 Generated with Claude Code
https://claude.ai/code/session_01PG969yapJ84DJceKt21Wen