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
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:
@@ -243,7 +243,13 @@ void views_interest_and_intentions(Region& r) {
|
||||
CHECK(s.environment().freshness() == client::Freshness::stale);
|
||||
CHECK(s.outcomes().entries().size() == 2 && s.outcomes().entries()[1].sequence == 2 &&
|
||||
s.outcomes().entries()[1].state == OutcomeState::unknown);
|
||||
// The lost session's view stays frozen and stale (ADR-0095): the own marker at its last
|
||||
// authoritative position, nothing moving while reconnecting.
|
||||
const auto frozen = s.status();
|
||||
CHECK(frozen.stale_view && frozen.marker && frozen.stale_markers == s.markers().size() &&
|
||||
std::ranges::all_of(s.markers(), [](const auto& m) { return m.stale; }));
|
||||
CHECK(c.until(r, [&] { return s.status().phase == "connected"; }, 20));
|
||||
CHECK(!s.status().stale_view);
|
||||
CHECK(s.status().epoch == 4 && s.status().session != old_session &&
|
||||
s.status().grants_left == 0 && c.phase() == LaunchPhase::connected);
|
||||
// Views restart for the new epoch, at the camera's interest (sent again).
|
||||
@@ -263,6 +269,45 @@ void views_interest_and_intentions(Region& r) {
|
||||
CHECK(c.host.launcher().error() == LaunchError::grant_refused && !c.host.session());
|
||||
}
|
||||
|
||||
// Two sessions: each sees the other's marker interpolated a few ticks behind its
|
||||
// authoritative path; a session that leaves takes its marker with it (ADR-0095).
|
||||
void remote_markers(Region& r) {
|
||||
Client a, b;
|
||||
CHECK(a.host.connect(RemoteSession::open(r.material({r.grant(account(7), 1)}))));
|
||||
CHECK(b.host.connect(RemoteSession::open(r.material({r.grant(account(8), 1)}))));
|
||||
const auto both = [&] {
|
||||
a.host.step(Clock::now(), a.intention, a.ui);
|
||||
return a.phase() == LaunchPhase::connected && b.phase() == LaunchPhase::connected &&
|
||||
a.host.session()->status().marker && b.host.session()->status().other_markers == 1;
|
||||
};
|
||||
CHECK(b.until(r, both, 20));
|
||||
auto& sa = *a.host.session();
|
||||
auto& sb = *b.host.session();
|
||||
a.intention.move_y = 1000; // A walks +y at 100 mm per tick.
|
||||
const auto drive = [&](auto done) {
|
||||
return b.until(
|
||||
r,
|
||||
[&] {
|
||||
a.host.step(Clock::now(), a.intention, a.ui);
|
||||
return done();
|
||||
},
|
||||
20);
|
||||
};
|
||||
const auto remote = [&] {
|
||||
const auto it = std::ranges::find_if(sb.markers(), [](const auto& m) { return !m.own; });
|
||||
CHECK(it != sb.markers().end());
|
||||
return *it;
|
||||
};
|
||||
CHECK(drive([&] { return remote().y_mm > 4500; }));
|
||||
// B shows A in the recent past: behind A's own (predicted) view, never ahead of it.
|
||||
const auto seen = remote();
|
||||
CHECK(!seen.stale && seen.x_mm == 3500 && seen.y_mm < sa.status().marker_y_mm &&
|
||||
sb.status().interpolation_delay >= 2 && sb.status().interpolation_delay <= 6);
|
||||
// A leaves: its marker disappears from B's view.
|
||||
a.host.cancel();
|
||||
CHECK(drive([&] { return sb.status().other_markers == 0; }));
|
||||
}
|
||||
|
||||
void refusals(Region& r) {
|
||||
// A grant for another region: refused before any Welcome; the launcher stops.
|
||||
Client wrong;
|
||||
@@ -289,6 +334,7 @@ int main() try {
|
||||
{
|
||||
Region r{files};
|
||||
views_interest_and_intentions(r);
|
||||
remote_markers(r);
|
||||
refusals(r);
|
||||
}
|
||||
std::filesystem::remove_all(files.dir);
|
||||
|
||||
Reference in New Issue
Block a user