Skip to content

Releases: MiCkEyZzZ/gnss-time

v0.5.3

25 May 18:27

Choose a tag to compare

Added

  • Introduced CivilDateTime — a proleptic Gregorian UTC datetime representation derived from Time<Utc>.
  • Added bidirectional conversion API between Time<Utc> and CivilDateTime.
  • Added Display implementation for ISO 8601 / RFC 3339 format with nanosecond precision.
  • Added is_whole_second() helper.
  • Added Unix time conversion API for Time<Utc> (seconds and nanoseconds).
  • Added additional epoch constants for UTC/GPS/Unix alignment.
  • Extended serde support and improved Postcard serialization test coverage.
  • Added embedded-friendly serialization documentation improvements.
  • Introduced new integration and round-trip test coverage across time scales.

Changed

  • Refactored civil calendar conversion constants for improved clarity and symmetry.
  • Improved architecture documentation consistency across crate, README, and internal modules.
  • Improved days_to_unix / civil_from_days implementation readability.
  • Updated feature-gated serialization strategy documentation.

Fixed

  • Fixed potential overflow in as_unix_nanos conversion for large timestamps.

Removed

  • Removed legacy benches directory in favor of dedicated benchmark crate.

This release improves correctness, clarity, and extensibility of the time conversion layer while preserving full backward compatibility within the 0.5.x series.

v0.5.2

05 May 12:25

Choose a tag to compare

  • updated the examples in the README file, improved the code documentation
  • updated the examples in the README file, improved the code documentation

v0.5.1

03 May 15:24

Choose a tag to compare

Updated the information in the README file

v0.5.0

03 May 13:42

Choose a tag to compare

Added

  • Deterministic property test suite (tests/prop_deterministic.rs)

    • Fixed coverage for boundary values, all 18 leap-second transitions, uniform u64 space sampling, and real IGS epochs

    • Verified invariants for:

      • GPS ↔ TAI roundtrip
      • GPS ↔ Galileo / BeiDou roundtrips
      • GPS ↔ UTC correctness outside leap windows
      • Arithmetic laws (identity, associativity, double negation)
      • Sub-second boundary correctness
      • Leap-second ambiguity window correctness
  • Randomized property tests (tests/prop_tests.rs) using proptest

    • GPS domain random sampling
    • bounded duration strategies to prevent overflow
    • ±3s leap-second boundary testing
    • strict ambiguity coverage rules (Exact outside leap windows)
  • CI test orchestration in justfile

    • test-deterministic
    • test-props
    • test-all
  • Compile-time leap second validation:

    • _ASSERT_FIRST_ENTRY (TAI−UTC = 19)
    • _ASSERT_TABLE_INVARIANTS (strict monotonic +1 progression)
    • _ASSERT_LAST_ENTRY (2017-01-01, TAI−UTC = 37)
  • Runtime leap second subsystem:

    • RuntimeLeapSeconds (fixed-capacity, heap-free, RUNTIME_CAPACITY = 64)
    • from_builtin(), from_slice(), try_extend()
    • LeapExtendError (NotStrictlyAscending, NonUnitIncrement, BufferFull)
  • Leap second API extensions:

    • LeapSeconds::last_update()
    • LeapSeconds::current_tai_minus_utc()
  • Prelude expansion:

    • RuntimeLeapSeconds, LeapExtendError, LeapEntry, RUNTIME_CAPACITY
    • gps_to_utc, utc_to_gps
  • Cross-verification test:

    • test_builtin_table_matches_iers_bulletin_c (full IERS Bulletin C validation)
  • #[must_use] enforcement across core API:

    • Time, Duration, ConvertResult, GnssTimeError
    • all arithmetic and conversion APIs
    • all critical accessors
  • #[non_exhaustive] added to:

    • GnssTimeError
    • ConvertResult
    • ConversionKind
    • ScaleId
  • clippy.toml introduced as future lint extension point

Changed

  • Property testing architecture split:

    • deterministic tests (no randomness, full reproducibility)
    • proptest-based randomized validation (host-only)
  • proptest dependency updated:

    • default-features = false
    • features = ["std"]
  • Leap second table fully validated against IERS Bulletin C (19 entries, verified)

  • Documentation updated:

    • runtime extension policy
    • compile-time invariants
    • IERS monitoring notes (TAI−UTC = 37 as of 2026)
  • LeapSeconds API improved:

    • from_slice alias added for clarity
  • Enabled crate-wide lint:

    • #![warn(clippy::must_use_candidate)]
  • Improved forward compatibility via #[non_exhaustive]

  • Strengthened developer diagnostics and API safety rules

Fixed

  • Corrected internal type documentation:

    • i64 → u64 for internal time representation consistency

v0.4.0

02 May 05:47

Choose a tag to compare

Deterministic API & Production Readiness

Release focused on determinism, correctness, and production readiness.

⚠️ Breaking Changes

  • Removed all f64-based constructors
  • Introduced DurationParts { seconds, nanos } for exact, deterministic input

Added

  • DurationParts – deterministic replacement for f64 with validation
    • DurationParts::new() with range check
    • DurationParts::as_nanos() -> u128
  • Full CI/CD pipeline (clippy, tests, docs, MSRV, cargo-deny)
  • Embedded validation (no_std, Cortex-M, RISC-V)
  • Automated publishing workflow
  • Extended documentation:
    • architecture, invariants, leap seconds, embedded usage
  • Property-based tests (roundtrip, leap seconds, ordering)
  • Time::NANOS_PER_YEAR

Changed

  • All constructors migrated to DurationParts
  • Updated:
    • all examples (17 files)
    • integration tests
    • benchmarks
  • Added strict input validation

Performance

No regressions:

Operation Cost
Arithmetic (panicking) ~0.5 ns (≈ raw u64)
Checked ops ~4.3 ns
Fixed conversions ~0.8–1.0 ns
UTC conversions ~9–22 ns

Notes

  • Type-safe time domains preserved
  • Fixed conversions remain zero-cost
  • UTC stays explicit and leap-second aware

Upgrade

Replace:

// Before
Time::<Gps>::from_week_tow(week, 432_000.0)

// After
Time::<Gps>::from_week_tow(week, DurationParts {
    seconds: 432_000,
    nanos: 0,
})

v0.3.0

27 Apr 16:48

Choose a tag to compare

Precision & Overflow (#TIME-11)

  • Added Time::MIN constant (alias for EPOCH)
  • Added documentation about value range: Time<S> covers ~584 years from epoch (Time<Gps> up to year 2554)
  • Added test_time_max_behavior to verify overflow handling
  • Added clippy::arithmetic_overflow lint to CI

Benchmarks (#TIME-12)

  • Added benches/arithmetic_bench.rs – proves zero-cost abstractions:
    • Time<Gps> + Duration: 512 ps (raw u64 + u64: 517 ps)
    • Time<Gps> - Duration: 512 ps (raw u64 - u64: 518 ps)
  • Added benches/convert_bench.rs:
    • GPS → TAI: ~0.8 ns
    • GPS → Galileo: ~0.8 ns
    • GPS → BeiDou: ~0.9 ns
    • GPS → UTC (with leap seconds): ~9.5 ns (< 10 ns target)
    • GLONASS → UTC (constant shift): ~0.8 ns
    • GLONASS → GPS (via UTC + LS): ~22.4 ns
  • Uses criterion with HTML reports

Full no_std Compatibility (#TIME-10)

  • All types are Copy – no allocations anywhere
  • defmt::Format implementation behind defmt feature flag
  • Fixed LeapSeconds::builtin() – now uses static instance instead of const fn
  • Cross-compilation tests for embedded targets:
    • thumbv7em-none-eabihf (STM32F4/F7, nRF52)
    • thumbv7em-none-eabi (Cortex-M4/M7)
    • riscv32imac-unknown-none-elf (ESP32-C3, GD32VF103)
  • Added .cargo/config.toml with embedded optimization settings
  • Added tests/no_std_compact.rs – verifies no Drop, Copy semantics, 8-byte alignment, no allocations

CI & Project Infrastructure

  • Added .github/workflows/embedded.yml – cross-compilation checks
  • Added .github/workflows/semantic-pull-request.yml – validates PR titles (feat:, fix:, etc.)
  • Added .github/pull_request_template.md – structured checklist
  • Added .github/ISSUE_TEMPLATE/enhancement.yml – enhancement request template
  • Added CODEOWNERS – automatic reviewer assignment
  • Updated justfile with new commands (check-no-std, ci, etc.)
  • Updated Cargo.toml with defmt feature, docs.rs metadata

Fixed

  • leap.rs: LeapSeconds::builtin() now works in no_std (static instance, not const fn)
  • time.rs: removed const from as_seconds_f64 (no_std compatibility)
  • time.rs: fixed typo "Дипазон значений" → "Диапазон значений"

Full Changelog

See CHANGELOG.md

v0.2.0

26 Apr 03:43

Choose a tag to compare

Full Conversion Matrix & Typed Conversion API

This release introduces a complete 6×6 GNSS time conversion matrix,
a unified conversion API, and improved correctness around leap seconds.

Highlights:

  • Full conversion matrix (30 directions)
  • Runtime conversion graph inspection (ConversionMatrix)
  • Typed conversion traits: IntoScale, IntoScaleWith
  • Leap second–aware conversions with ambiguity handling
  • GLONASS-specific time utilities
  • <1 ns roundtrip accuracy (except intrinsic leap second ambiguity)

This is a foundational release: gnss-time is now a complete,
type-safe core for GNSS time transformations.

v0.1.0

21 Apr 12:51

Choose a tag to compare

Release v0.1.0 — Type‑safe GNSS time core

gnss-time is a zero‑cost, no_std‑friendly Rust library for working with time in satellite navigation systems (GPS, GLONASS, Galileo, BeiDou, TAI, UTC).

What's included

Core types

  • Duration – signed nanosecond interval (i64) with arithmetic, saturating ops, and Display.
  • Time<S> – parametric timestamp (u64) representing nanoseconds since the scale’s epoch.
  • TimeScale sealed trait – markers for Gps, Glonass, Galileo, Beidou, Tai, Utc.

Time scales & epochs

  • Epoch constants: GPS_EPOCH, GLONASS_EPOCH, GALILEO_EPOCH, BEIDOU_EPOCH, TAI_EPOCH, UNIX_EPOCH.
  • CivilDate with const calendar arithmetic.
  • Compile‑time verified offsets between epochs (days, seconds, nanoseconds).
  • GPS: Time<Gps>::from_week_tow(week, tow_s) + accessors week(), tow_seconds(), sub_second_nanos().
  • GLONASS: Time<Glonass>::from_day_tod(day, tod_s) + accessors day(), tod_seconds().

Leap seconds (contextual conversions)

  • LeapSeconds – static built‑in table (19 entries, 1980–2017).
  • LeapSecondsProvider trait for custom / runtime sources.
  • Conversions: gps_to_utc, utc_to_gps, glonass_to_utc, utc_to_glonass, gps_to_glonass, glonass_to_gps.
  • Tests for leap second boundaries (1998-12-31, 2016-12-31).

Display formatting

  • WeekTow (GPS/Galileo/BeiDou): "GPS 2345:432000.000"
  • DayTod (GLONASS): "GLO 10512:43200.000"
  • Simple (TAI/UTC): "TAI +1000000000s 0ns"

Error handling

  • GnssTimeError with Overflow, InvalidInput, LeapSecondsRequired.

Examples

  • basic_usage, gps_week_tow, glonass_day_tod, scale_conversion, display_formats, and more.

Documentation & metadata

  • README.md, CHANGELOG.md, #![deny(missing_docs)].
  • no_std by default, optional std feature.
  • All types are 8 bytes, repr(transparent) – zero overhead.

Full Changelog: CHANGELOG.md