Route cellular perception to its owner
Foundation / checks (deploy) (push) Successful in 5s
Foundation / checks (checks) (push) Failing after 39s
Foundation / checks (ecs) (push) Successful in 1m55s
Foundation / checks (postgres) (push) Failing after 53s
Foundation / checks (tsan) (push) Failing after 34s
Foundation / checks (network) (push) Failing after 3m0s
Foundation / checks (client) (push) Failing after 4m27s
Foundation / postgres-tools (push) Skipped
Foundation / server-image (push) Skipped
Foundation / image (push) Skipped

This commit is contained in:
dingo
2026-10-11 01:08:03 -04:00
parent 5419a579e8
commit 27778def2c
8 changed files with 124 additions and 16 deletions
+6
View File
@@ -140,6 +140,12 @@ void v8_perception_is_bounded_and_canonical() {
const CellularPerception cleared{19, 0, {}};
const auto clear_bytes = encode_session(SessionMessage{cleared});
CHECK(std::get<CellularPerception>(*decode_session(clear_bytes)) == cleared);
auto oversized = perception;
oversized.patches.clear();
for (std::size_t i = 0; i <= max_cellular_perceived_patches; ++i)
oversized.patches.push_back(
{static_cast<std::uint32_t>(i), 0, 0, {0, 0, 0, 0}});
CHECK(encode_session(SessionMessage{oversized}).empty());
}
} // namespace
+22
View File
@@ -589,8 +589,14 @@ void cellular_v5_spawn_and_v7_action_share_region_sessions(const Files& f) {
}};
auto spawn_client = h.connect(h.issuer.grant(account(0xB5), 1), session_protocol_v5);
auto action_client = h.connect(h.issuer.grant(account(0xB7), 1), session_protocol_v7);
const auto owner_account = account(0xB8);
auto perception_owner = h.connect(h.issuer.grant(owner_account, 1), session_protocol_v8);
auto other_owner = h.connect(h.issuer.grant(account(0xB9), 1), session_protocol_v8);
CHECK(h.settled(*spawn_client) && spawn_client->state() == RegionSessionState::established);
CHECK(h.settled(*action_client) && action_client->state() == RegionSessionState::established);
CHECK(h.settled(*perception_owner) &&
perception_owner->state() == RegionSessionState::established);
CHECK(h.settled(*other_owner) && other_owner->state() == RegionSessionState::established);
CHECK(spawn_client->request_primitive_life(44));
std::vector<PrimitiveLifeOutcome> birth_outcomes;
@@ -623,6 +629,22 @@ void cellular_v5_spawn_and_v7_action_share_region_sessions(const Files& f) {
CHECK(action_client->view()->organisms.size() == 1 &&
action_client->view()->organisms.front().id == 901);
CHECK(action_client->set_interest({1, 0, 0, 2}));
const CellularPerception perception{101, 901, {{1'000, 2'000, 3, {4, 5, 6, 7}}}};
CHECK(h.server->send_cellular_perception(owner_account, perception));
CHECK(h.until([&] {
return perception_owner->cellular_perception() &&
perception_owner->cellular_perception()->tick == perception.tick;
}));
CHECK(*perception_owner->cellular_perception() == perception);
CHECK(!other_owner->cellular_perception() && !action_client->cellular_perception());
h.server->clear_cellular_perceptions(102);
CHECK(h.until([&] {
return perception_owner->cellular_perception() &&
perception_owner->cellular_perception()->tick == 102;
}));
CHECK(perception_owner->cellular_perception()->life_identity == 0 &&
perception_owner->cellular_perception()->patches.empty());
}
// M10.4: intentions, actions and their distinct answers against a simulated host.