M11-PT-001: read v10 perceptions from servers built before the bud cost
Foundation / checks (ecs) (push) Successful in 2m16s
Foundation / checks (deploy) (push) Successful in 4m4s
Foundation / checks (tsan) (push) Successful in 11m42s
Foundation / checks (network) (push) Successful in 19m59s
Foundation / checks (client) (push) Successful in 21m12s
Foundation / checks (checks) (push) Successful in 46m11s
Foundation / checks (postgres) (push) Successful in 46m18s
Foundation / postgres-tools (push) Successful in 28s
Foundation / server-image (push) Successful in 3m12s
Foundation / image (push) Successful in 3m28s

The bud cost (d98d71e) grew the v10 cellular perception prefix from 82 to 122 bytes
without a version bump. A rebuilt client connected to the live DEV region (server
3e5b8cef, older) refused every perception as wrong_length, closed the session as a
protocol error and reconnected; each reconnect's birth request answered existing_life
and no view ever arrived ("Existing cell is already bound to this account").

The decoder now also accepts the earlier v10 layout, with no bud cost. The two lengths
never coincide (40 bytes is not a whole 48-byte patch). The client already hides a zero
bud cost.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
dingo
2026-10-16 09:11:41 -04:00
co-authored by Claude Opus 5.5
parent 28629e1001
commit a820ff0984
4 changed files with 58 additions and 9 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-20261016T125355-89029:1792166035"}
- {name: REGION_SESSION_WINDOW, value: "dev-20261016T131141-14531:1792167101"}
- {name: REGION_M10_MAX_GRANT_LIFETIME, value: "14400"}
ports:
# QUIC (ADR-0090): UDP only; nothing listens on TCP 7400.
@@ -60,6 +60,28 @@ No deployment, database mutation or runtime fix was performed for this note.
`kubectl config current-context` reports that no current context is set in this
workspace, so live DEV logs/state were unavailable for confirming these candidates.
### Follow-up diagnosis (2026-10-16, region 5)
The retest reproduced the message against live region 5. Read-only checks showed:
- The life was born and active: `living owned=1`, `lingering=0`, `suspended=0`, and the
reservation was open, born at tick 1.
- Later relaunches only added refused birth requests.
So neither placement nor resume was blocking. The cause was a wire mismatch:
- The live server image (`3e5b8cef…`) predates the bud-cost change (d98d71e). That change
grew the v10 perception prefix from 82 to 122 bytes without a version bump.
- A rebuilt client therefore refused every perception as `wrong_length`, closed the
session as a protocol error and reconnected.
- On each reconnect the birth request got `existing_life` again, and no view ever arrived.
The decoder now also accepts the earlier v10 layout, which carries no bud cost. The two
lengths can never coincide, because 40 bytes is not a whole 48-byte patch.
This explains the reproduced case only. The first report predates d98d71e, and its
cause remains unconfirmed.
## Retest backlog
| Local issue | Priority / scope | Acceptance evidence |
+17 -8
View File
@@ -704,13 +704,20 @@ std::expected<SessionMessage, SessionCodecError> decode_session(std::span<const
if (wire_version != session_protocol_v8 && wire_version != session_protocol_v9 &&
wire_version != session_protocol_v10)
return std::unexpected(SessionCodecError::unsupported_version);
const auto prefix =
wire_version == session_protocol_v10 ? cellular_perception_v10_prefix_bytes
: wire_version == session_protocol_v9 ? cellular_perception_v9_prefix_bytes
: cellular_perception_prefix_bytes;
if (payload.size() < prefix)
if (payload.size() < cellular_perception_prefix_bytes)
return std::unexpected(SessionCodecError::wrong_length);
const auto count = static_cast<std::size_t>(get(payload, 16, 2));
// A v10 server built before the bud cost (ADR-0129 amendment) sends the v9-sized
// prefix; the lengths never coincide (40 bytes is not a whole patch), so a rebuilt
// client still reads its views, with no bud cost (M11-PT-001).
const bool without_bud_cost = wire_version == session_protocol_v10 &&
payload.size() == cellular_perception_v9_prefix_bytes +
count * cellular_perceived_patch_bytes;
const auto prefix = wire_version == session_protocol_v10 && !without_bud_cost
? cellular_perception_v10_prefix_bytes
: wire_version == session_protocol_v9 || without_bud_cost
? cellular_perception_v9_prefix_bytes
: cellular_perception_prefix_bytes;
if (count > max_cellular_perceived_patches ||
payload.size() != prefix + count * cellular_perceived_patch_bytes)
return std::unexpected(SessionCodecError::wrong_length);
@@ -739,9 +746,11 @@ std::expected<SessionMessage, SessionCodecError> decode_session(std::span<const
if (wire_version == session_protocol_v10) {
d.engulf = static_cast<CellularEngulfResult>(payload[77]);
d.bud = static_cast<CellularBudOutcome>(payload[78]);
d.bud_cost_energy_pj = get(payload, 82, 8);
for (std::size_t channel = 0; channel < d.bud_cost_matter_fg.size(); ++channel)
d.bud_cost_matter_fg[channel] = get(payload, 90 + channel * 8, 8);
if (!without_bud_cost) {
d.bud_cost_energy_pj = get(payload, 82, 8);
for (std::size_t channel = 0; channel < d.bud_cost_matter_fg.size(); ++channel)
d.bud_cost_matter_fg[channel] = get(payload, 90 + channel * 8, 8);
}
}
d.movement = static_cast<CellularMovementResult>(payload[74]);
d.intake = static_cast<CellularIntakeResult>(payload[75]);
+18
View File
@@ -354,6 +354,24 @@ void v10_effects_and_life_end_are_owner_only() {
CHECK(!cleared.empty() && decode_session(cleared));
cleared[session_header_bytes + 90] = 1; // A cleared view with a bud cost.
CHECK(!decode_session(cleared));
// M11-PT-001: a v10 server built before the bud cost sends the 82-byte prefix. A
// rebuilt client still reads those views (no bud cost) instead of closing on them.
auto patched = costed;
patched.patches.push_back({5, 6, 70, {1, 2, 3, 4}});
auto legacy = encode_session(SessionMessage{patched}, session_protocol_v10);
legacy.erase(legacy.begin() + session_header_bytes + 82,
legacy.begin() + session_header_bytes + 122);
auto expected = patched;
expected.diagnostics->bud_cost_energy_pj = 0;
expected.diagnostics->bud_cost_matter_fg = {};
const auto legacy_decoded = decode_session(legacy);
CHECK(legacy_decoded && std::get<CellularPerception>(*legacy_decoded) == expected);
auto legacy_cleared = encode_session(
SessionMessage{CellularPerception{40, 0, {}, std::nullopt}}, session_protocol_v10);
legacy_cleared.resize(session_header_bytes + 82);
CHECK(decode_session(legacy_cleared));
legacy.pop_back(); // Neither layout's length.
CHECK(!decode_session(legacy));
const CellularLifeEnded ended{41, 7, CellularDeathReason::engulfed};
const auto ended_bytes = encode_session(SessionMessage{ended});