Skip to content

fix(core): a run's times cross in microseconds, so a run under a millisecond keeps its time - #4684

Merged
datlechin merged 6 commits into
mainfrom
fix/core-history-microseconds
Nov 28, 2026
Merged

datlechin merged 6 commits into
mainfrom
fix/core-history-microseconds

Conversation

@datlechin

Copy link
Copy Markdown
Member

Summary

  • A run's times cross in integer microseconds: the history_entry wire schema's duration_us, first_row_us and server_us replace the millisecond fields, so a run under a millisecond reaches another device with its time, not 0. Sync has not shipped, so the fields change in place.
  • A history migration renames the three columns and multiplies kept values by 1000.
  • Storage, sync, FFI (HistoryRun, HistoryRunDetails, HistoryEntryInfo, HistoryEntryRecord) and MCP use microseconds; C# bindings regenerated.
  • Windows maps TimeSpan microseconds both ways; Linux records microseconds and shows a run under a millisecond as <1 ms, as the Mac does.
  • The Mac's core mirror sends durationUs from its seconds.
  • The CSV export keeps its duration_ms column with the fraction (0.09).

Test plan

  • history_tests.rs: a 90 µs run recorded on one device arrives on another with its microseconds, first-row and server times too.
  • microseconds_migration_tests.rs: a run kept as 12 ms reads as 12000 µs after the upgrade.
  • export.rs: a 90 µs run exports as 0.09 and 0.09 ms.
  • Windows HistoryTests: a 90 µs run keeps its microseconds through the FFI.
  • Linux history_formatting: a run under a millisecond reads <1 ms.
  • QueryHistoryCoreMirrorTests: a 0.09 ms run reaches the core as 90 µs.
  • Local: storage, sync, records, mcp and ffi tests and clippy on macOS; Linux container tests and clippy; C# bindings and Windows history tests; Mac core library and the mirror suite.

@datlechin
datlechin merged commit 99b8ec6 into main Nov 28, 2026
1 check passed
@datlechin
datlechin deleted the fix/core-history-microseconds branch November 28, 2026 19:18
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