Skip to content

Design and Non Goals

stone edited this page Nov 13, 2026 · 3 revisions

Design and non-goals

These are invariants, not preferences. Changes that violate them are bugs.

1. The LSK is the only source of truth for leap seconds

DELTET/DELTA_T_A, DELTET/K, DELTET/EB, DELTET/M and DELTET/DELTA_AT are read from the kernel. No leap-second value is hard-coded in the conversion logic, and no future leap second is predicted.

Consequence: selecting a different kernel changes results by exactly the leap seconds it contains. That behaviour is demonstrated and tested.

2. TAI is the canonical internal scale

Epoch stores TAI seconds plus nanoseconds. UTC is a civil representation, not an internal time scale. This keeps arithmetic monotonic across leap seconds and makes Epoch comparison meaningful.

3. UTC conversion uses the day-length table

For every UTC day affected by a leap second, the day is 86 400, 86 401 or 86 399 seconds long. The TDB - UTC = 32.184 + DELTA_AT + K*sin(E) expression is not used for UTC conversion, because it cannot represent 23:59:60 or a shortened day.

4. No policy is inferred from a date

A future without leap seconds is an assumption. The crate never guesses it: use LeapSecondPolicy::FrozenAfter and cite the decision that applies.

Pre-1972 UTC is a separate convention (LeapSecondSource::Sofa), and the contract module refuses to mix it with the NAIF contract silently.

5. Kernels are explicit inputs

The library performs no network I/O, bundles one LSK, and bundles no mission SCLK or EOP data. Loading is always explicit, so reproducibility depends only on the files the caller names.

6. Integer representation, checked arithmetic

Epoch and Duration are integer seconds plus nanoseconds and compute in i128 where overflow is possible. Infallible constructors panic on overflow or non-finite input; checked_* variants return Option. A silent wrap is never acceptable in a time library.

7. No unsafe

#![forbid(unsafe_code)] in every configuration.

8. Models are named, not merged

NAIF ET, the compact TDB approximation and the IAU DTDB series are separate functions. The contract module makes the distinction type-level, so a 30 µs model cannot silently stand in for a 3 ns one.

Non-goals

Not implemented Why
Ephemeris computation (SPK/DEF) out of scope; use SPICE
Subdaily EOP terms (ocean tides, libration) documented IERS requirement, not a daily-series job
Leap-second prediction data cannot support it
Full str2et text grammar kernel @date literals and typed constructors cover the exercised forms; general civil text is not guessed
SCLK clock types other than 1 not needed by supported missions
Partition-aware legacy field-vector helpers use the separate native string APIs for partitioned clocks
MCP over network transports stdio only, by design
chrono/time integration avoid a second time model in the dependency graph
Polar motion, nutation, precession separate geodetic problem

Accuracy discipline

  • A number is quoted only if NAIF/IAU/IERS published it, or this repository measured it with a reproducible command.
  • Printed digits are not accuracy. WebGeocalc prints fewer digits of the same number.
  • Representation resolution (f64 spacing, nanosecond fields) is stated separately from model accuracy.
  • Whenever a data product has uncertainty or a coverage limit, that limit is documented rather than smoothed over.

Reproducibility

  • The generated IAU DTDB table carries its source commit and SHA-256 in the file header, and the generator verifies the digest.
  • Golden vectors and WebGeocalc responses are committed, so the checks run offline.
  • Maintained repository version references are checked by tests/version_sync.rs. The separate GitHub Wiki is not part of that test and must be reviewed separately.

Clone this wiki locally