Wire M10.7b interpolation and the stale loss view into the client
Foundation / checks (deploy) (push) Successful in 5s
Foundation / checks (ecs) (push) Successful in 1m55s
Foundation / checks (client) (push) Successful in 12m27s
Foundation / checks (network) (push) Successful in 12m46s
Foundation / checks (tsan) (push) Successful in 7m59s
Foundation / postgres-tools (push) Canceled after 0s
Foundation / server-image (push) Canceled after 0s
Foundation / image (push) Canceled after 0s
Foundation / checks (checks) (push) Canceled after 25m13s
Foundation / checks (postgres) (push) Canceled after 12m48s

ADR-0095. The engineering client times presentation with the tick clock:
its own marker between ticks, other markers interpolated a few ticks behind
(grey when stale). Silence beyond 3 ticks and long-gap holds are stale. A lost
session leaves its last view frozen and labelled stale until the reconnect's
fresh baseline; nothing is predicted or sent meanwhile.

evo-motion-trace --remote measures remote-marker error between two clients
through the relay, with a 1.5 s outage (motion-trace-remote-smoke CTest).
Prediction errors are recorded only for ticks inputs are scheduled for.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
dingo
2026-10-06 17:50:41 -04:00
co-authored by Claude Opus 5.5
parent 90cdb61e30
commit 5728e7682e
17 changed files with 651 additions and 210 deletions
+10 -1
View File
@@ -26,6 +26,7 @@ double TickClock::raw(double base, Clock::time_point now) const {
void TickClock::observe(std::uint64_t tick, Clock::time_point now) {
newest_ = std::max(newest_, tick);
seen_ = now;
const auto sample = static_cast<double>(tick);
if (!base_tick_) {
base_tick_ = sample;
@@ -43,6 +44,12 @@ void TickClock::observe(std::uint64_t tick, Clock::time_point now) {
base_time_ = now;
}
std::optional<double> TickClock::silence(Clock::time_point now) const {
if (!base_tick_)
return std::nullopt;
return ms(now - seen_) / limits_.tick_ms;
}
std::optional<double> TickClock::at(Clock::time_point now) {
if (!base_tick_)
return std::nullopt;
@@ -123,8 +130,10 @@ std::vector<PresentedMarker> MarkerInterpolator::at(double render_tick) {
snapshots_, [&](const Snapshot& s) { return static_cast<double>(s.tick) > render_tick; });
const auto& a = *std::prev(b);
if (b->tick - a.tick > limits_.max_gap) {
++stats_.gap_snaps; // Too far apart to interpolate: hold the older until the newer.
++stats_.gap_snaps; // Too far apart to interpolate: hold the older (stale) until b.
show(a);
for (auto& m : out)
m.stale = true;
return out;
}
const auto t =
+8 -4
View File
@@ -66,6 +66,10 @@ void MotionPredictor::authoritative(const AuthoritativeMarker& a) {
}
std::optional<network::motion::State> MotionPredictor::predict(std::uint64_t tick) {
return predict(tick, true);
}
std::optional<network::motion::State> MotionPredictor::predict(std::uint64_t tick, bool record) {
if (!authority_)
return std::nullopt;
const auto authority_tick = authority_->tick;
@@ -73,7 +77,7 @@ std::optional<network::motion::State> MotionPredictor::predict(std::uint64_t tic
if (!state)
return std::nullopt;
presented_tick_ = tick;
if (tick > authority_tick) {
if (record && tick > authority_tick) {
history_[tick] = *state;
while (history_.size() > limits_.max_history)
history_.erase(history_.begin());
@@ -81,9 +85,9 @@ std::optional<network::motion::State> MotionPredictor::predict(std::uint64_t tic
return state;
}
std::optional<MotionPredictor::Point> MotionPredictor::predict_between(std::uint64_t tick,
double fraction) {
const auto from = predict(tick);
std::optional<MotionPredictor::Point>
MotionPredictor::predict_between(std::uint64_t tick, double fraction, bool record) {
const auto from = predict(tick, record);
if (!from)
return std::nullopt;
const auto to = replay(tick + 1);