Keep the cell through a lone empty view (no-cell panel blinking)
Foundation / checks (ecs) (push) Successful in 2m22s
Foundation / checks (deploy) (push) Successful in 4m17s
Foundation / checks (network) (push) Successful in 21m4s
Foundation / checks (client) (push) Successful in 22m10s
Foundation / checks (tsan) (push) Successful in 28m58s
Foundation / postgres-tools (push) Canceled after 0s
Foundation / server-image (push) Canceled after 0s
Foundation / image (push) Canceled after 0s
Foundation / checks (postgres) (push) Canceled after 42m32s
Foundation / checks (checks) (push) Canceled after 42m39s

The DEV server still runs a build that sends every session an empty view each tick
around the owner's real one. fcc6c57's client guard covered only an empty view after
the real one of the same tick; the next tick's empty view arriving first still made the
cell vanish for a frame, so the no-cell panel blinked a few times a minute.

While a cell is shown, the client now counts empty views only after 20 ticks (one
second) with no real view. A death is unaffected: it arrives as CellularLifeEnded. The
session test covers both orders and the grace running out.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
dingo
2026-10-19 11:14:36 -04:00
co-authored by Claude Opus 5.5
parent 5e168d67c3
commit ae2a2d78ba
3 changed files with 50 additions and 16 deletions
@@ -12,7 +12,7 @@ spec:
env:
- {name: REGION_SESSION, value: "dev"}
- {name: REGION_SESSION_LISTEN, value: "0.0.0.0:7400"}
- {name: REGION_SESSION_WINDOW, value: "dev-20261019T130838-2a437d9d:1792429718"}
- {name: REGION_SESSION_WINDOW, value: "dev-20261019T151436-42953:1792433676"}
- {name: REGION_M10_MAX_GRANT_LIFETIME, value: "14400"}
ports:
# QUIC (ADR-0090): UDP only; nothing listens on TCP 7400.
+15 -4
View File
@@ -29,6 +29,8 @@ struct RegionSessionClient::Impl {
std::vector<network::PrimitiveLifeOutcome> primitive_life_outcomes;
std::optional<network::SnapshotAssembler> snapshots;
std::optional<network::CellularPerception> cellular_perception;
// First tick of a run of empty views while a cell was shown (0: none). See message().
std::uint64_t empty_since{};
std::optional<network::CellularMutationOffer> mutation_offer;
std::optional<network::CellularLifeEnded> life_ended;
std::uint64_t snapshot_chunks{}, snapshot_bytes{};
@@ -145,11 +147,20 @@ struct RegionSessionClient::Impl {
return keep(action_outcomes, *m);
if (const auto* m = std::get_if<network::CellularPerception>(&*decoded)) {
seen_tick(m->tick);
// An empty view never replaces a real one of the same tick: older servers
// sent both, and the cell vanished for a frame (input stopped, panels opened).
// Older servers send every session an empty view each tick around the real
// one, in either order, so a lone empty view made the cell vanish for a frame
// (input stopped, the no-cell panel blinked). While a cell is shown, empty
// views count only after a second of ticks with no real view; a death still
// arrives at once as CellularLifeEnded.
constexpr std::uint64_t empty_grace_ticks = 20;
if (m->life_identity == 0 && cellular_perception &&
cellular_perception->tick == m->tick && cellular_perception->life_identity != 0)
return;
cellular_perception->life_identity != 0) {
if (empty_since == 0)
empty_since = m->tick;
if (m->tick < empty_since + empty_grace_ticks)
return;
}
empty_since = 0;
cellular_perception = *m;
return;
}
+34 -11
View File
@@ -780,17 +780,16 @@ void cellular_v5_spawn_and_v7_action_share_region_sessions(const Files& f) {
auto legacy_perception = perception;
legacy_perception.diagnostics.reset();
CHECK(*legacy_owner->cellular_perception() == legacy_perception);
// An empty view reaches every v8+ session; a session showing a cell keeps it for now
// (the client's grace, below), one with none shows the empty view.
h.server->clear_cellular_perceptions(102);
CHECK(h.until([&] {
return perception_owner->cellular_perception() &&
perception_owner->cellular_perception()->tick == 102;
return other_owner->cellular_perception() &&
other_owner->cellular_perception()->tick == 102;
}));
CHECK(h.until([&] {
return legacy_owner->cellular_perception() &&
legacy_owner->cellular_perception()->tick == 102;
}));
CHECK(perception_owner->cellular_perception()->life_identity == 0 &&
perception_owner->cellular_perception()->patches.empty());
CHECK(other_owner->cellular_perception()->life_identity == 0 &&
other_owner->cellular_perception()->patches.empty());
CHECK(perception_owner->cellular_perception()->life_identity == 901);
// A session given a view this tick is never cleared in the same tick (the cell would
// vanish for a frame); one without a view still is.
auto later = perception;
@@ -798,15 +797,39 @@ void cellular_v5_spawn_and_v7_action_share_region_sessions(const Files& f) {
CHECK(h.server->send_cellular_perception(owner_account, later));
h.server->clear_cellular_perceptions(103);
CHECK(h.until([&] {
return legacy_owner->cellular_perception() &&
legacy_owner->cellular_perception()->tick == 103;
return other_owner->cellular_perception() &&
other_owner->cellular_perception()->tick == 103;
}));
CHECK(legacy_owner->cellular_perception()->life_identity == 0);
CHECK(other_owner->cellular_perception()->life_identity == 0);
CHECK(h.until([&] {
return perception_owner->cellular_perception() &&
perception_owner->cellular_perception()->tick == 103;
}));
CHECK(*perception_owner->cellular_perception() == later);
// An older server cleared before the real view: the client keeps the cell through a
// lone empty view, and drops it only after a second (20 ticks) of nothing else.
auto next = later;
next.tick = 104;
h.server->clear_cellular_perceptions(104); // No view yet this tick: an empty one goes.
CHECK(h.server->send_cellular_perception(owner_account, next));
CHECK(h.until([&] {
return perception_owner->cellular_perception() &&
perception_owner->cellular_perception()->tick == 104;
}));
CHECK(*perception_owner->cellular_perception() == next);
h.server->clear_cellular_perceptions(110);
h.server->clear_cellular_perceptions(123);
CHECK(h.until([&] {
return other_owner->cellular_perception() &&
other_owner->cellular_perception()->tick == 123;
}));
CHECK(perception_owner->cellular_perception()->life_identity == 901); // Within the grace.
h.server->clear_cellular_perceptions(131);
CHECK(h.until([&] {
return perception_owner->cellular_perception() &&
perception_owner->cellular_perception()->tick == 131;
}));
CHECK(perception_owner->cellular_perception()->life_identity == 0);
}
// M10.4: intentions, actions and their distinct answers against a simulated host.