﻿# A ROS clock rollback can clear tf2 without clearing the application’s derived state

A replay reset creates a new temporal context. Inspect the buffer’s configured jump callback and retire application outputs that still belong to the previous timeline.

Author: Retrivium team
Updated: 2026-11-06
Canonical URL: https://retrivium.ai/journal/robotics-tf2-clock-jump-buffer-and-derived-state/
Language: en

## The replay returns to an earlier numeric timestamp

A physical-AI evaluation replays a scene, caches a transformed object pose and then resets simulated time. The next episode reaches the same numeric timestamp, and the application reuses the old cached pose because the key matches. That value can belong to a different scene state even if its frame names also match. Treat replay generation as part of the application context. Numeric time equality across a reset is weaker evidence than identity within the same uninterrupted temporal history.

## Backward time can be an intentional feature

The [ROS clock design](https://design.ros2.org/articles/clock_and_time.html) supports paused and backward-jumping abstracted time for playback and simulation. It explicitly requires algorithms to handle discontinuities. Do not diagnose every rollback as broken host synchronization, and do not replace the replay clock with civil time merely to make values increase. Preserve the intended clock source and reset boundary. Hardware timeout durations and ROS observation timestamps may legitimately use different clocks, with explicit conversion or separation at their interface.

## The automatic clear has an exact implementation scope

The reviewed [Kilted Python buffer](https://raw.githubusercontent.com/ros2/geometry2/kilted/tf2_ros_py/tf2_ros/buffer.py) uses the supplied node’s clock when a node is provided, registers a configured jump callback and clears the buffer in that callback. Inspect the actual construction and threshold before claiming automatic handling of a particular reset. This is not a promise that every negative timestamp difference triggers every buffer implementation. Nor does clearing that object erase application caches, pending model results or positions already copied into another component.

## Retire derived outputs at the application boundary

A proposed replay controller assigns a new generation to observations after reset and prevents late results from the old generation from becoming current. It then waits for required new transform data through the supported lookup path. Keep pending work, derived geometry and displayed state in that review. A library callback can provide a useful event, but it cannot infer every application owner that needs invalidation. Preserve an explicit incomplete-state outcome while the new temporal context is being established.

## Test reset with a deliberately late result

Propose a passive replay fixture that starts a delayed geometry computation, performs a clock jump meeting the configured condition and then delivers the old result. Observe buffer clearing separately from application acceptance. Continue with new transforms under repeated numeric timestamps and verify generation-aware results. Acceptance requires no old-generation result to become current through a key collision. No ROS clock or robot experiment was executed here; the fixture does not establish behavior of another binding or a physical system’s recovery.

## Keep replay invalidation separate from wall-time repair

[Clock skew and telemetry](/journal/clock-skew-tls-telemetry/) address another kind of discontinuity. [Monotonic duration measurement](/journal/provider-monotonic-latency-measurement/) addresses elapsed intervals rather than scene identity. Here the record should preserve clock source, qualifying jump, buffer response and application generation. A clean transform cache alone is not a clean perception pipeline. This narrow distinction makes repeated replay episodes interpretable without claiming that library invalidation rolls back external effects or restores the real robot to a previous physical state.
