Skip to content

Derive a UTC instant from the offset the PAS log records - #194

Merged
abrignoni merged 1 commit into
mainfrom
feat/pas-derived-utc
Sep 8, 2026
Merged

abrignoni merged 1 commit into
mainfrom
feat/pas-derived-utc

Conversation

@abrignoni

Copy link
Copy Markdown
Owner

Adds a derived UTC instant beside the PAS log reading.

Timestamp stays the head unit's reading as recorded. Timestamp UTC and UTC Offset Applied are new.

  • The offset comes from the log's own VS_CLOCK_QUEUE lines, only where flagged valid, taken from the nearest one within 10 minutes and blank when there is none.
  • Nothing is extrapolated: the offset belongs to the moment, and on a Sync Gen3 extraction it was 4 hours in most periods, 5 in one and 6 in another.
  • The boot-time GPS comparison is not used as a reference, because on the boots that report a correction it carries the clock as it was before being corrected.

All 24,581 readings in the committed case derive, every one at -04:00, and agree with all 409 published UTC lines in the log. Row counts unchanged.

🤖 Generated with Claude Code

Timestamp stays the head unit's reading as recorded. Two columns are added
beside it: Timestamp UTC, typed as an instant, and UTC Offset Applied.

The offset is not assumed. The clock subsystem records it in two forms, a
published UTC time and a stated total_offset, both carrying a validity flag,
and only lines flagged valid are used. Each reading takes the nearest such
line within 10 minutes and is left blank when there is none, so nothing is
extrapolated across a gap. That matters because the offset belongs to the
moment: on a Sync Gen3 extraction it was 4 hours in most periods, 5 in one
and 6 in another, with the head unit reporting its clock already correct.

The boot-time GPS comparison is deliberately not used as a reference. On the
boots where it reports a correction, the reading it carries is the clock as
it was before being corrected, so it measures the fault rather than the zone.

The published value carries second: [0] on every line and is not written at
the same instant as the line holding it, so the raw difference lands within a
minute of the offset rather than on it. Civil UTC offsets are whole multiples
of 15 minutes, so the derived value is snapped to that. On the committed case
this agrees with the total_offset the head unit states outright.

All 24,581 readings in that case derive, every one at -04:00, and the derived
instants agree with all 409 published UTC lines the log carries. Row counts
are unchanged. LAVA now stores a real epoch for the derived column and keeps
the recorded reading as text beside it.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@abrignoni
abrignoni merged commit fa220cc into main Sep 8, 2026
10 checks passed
@abrignoni
abrignoni deleted the feat/pas-derived-utc branch September 10, 2026 03:29
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.

1 participant