Enforce cellular patch perception
Foundation / checks (deploy) (push) Successful in 5s
Foundation / checks (checks) (push) Failing after 39s
Foundation / checks (ecs) (push) Successful in 1m57s
Foundation / checks (postgres) (push) Failing after 51s
Foundation / checks (tsan) (push) Failing after 32s
Foundation / checks (network) (push) Failing after 3m3s
Foundation / checks (client) (push) Failing after 4m19s
Foundation / postgres-tools (push) Skipped
Foundation / server-image (push) Skipped
Foundation / image (push) Skipped

This commit is contained in:
dingo
2026-10-10 23:41:47 -04:00
parent dae0572426
commit 82bef03138
8 changed files with 74 additions and 4 deletions
+19 -2
View File
@@ -41,15 +41,24 @@ void actions_bind_to_owned_life_and_preserve_other_inputs() {
CHECK((*primitive)->spawn(request, {2, 102, 202, 302, {1}}));
biology::CellularHabitatConfig habitat_config{
90, 1, 7, 3'000, 2'000, {{{0, 0}, 29, {{10}, {{{10}, {10}, {10}, {10}}}}}}};
90,
1,
7,
20'000,
20'000,
{{{0, 0}, 29, {{10}, {{{10}, {10}, {10}, {10}}}}},
{{15'000, 15'000}, 30, {{10}, {{{10}, {10}, {10}, {10}}}}}}};
auto habitat = biology::CellularHabitat::create(std::move(habitat_config));
CHECK(habitat);
auto state = CellularLives::create(**primitive, std::move(*habitat),
{{3'000, 2'000}, 1, 293'150});
{{20'000, 20'000}, 1, 293'150});
CHECK(state && (*state)->lives().size() == 2);
const auto& controlled = (*state)->lives()[0];
const auto& other = (*state)->lives()[1];
const auto visible = (*state)->perceive(controlled.identity.life);
CHECK(visible && visible->size() == 1 &&
visible->front().address == (biology::CellularPatchAddress{0, 0}));
const std::array baseline{CellularLifeIntent{controlled.identity.life, {{5, 6}, {}}},
CellularLifeIntent{other.identity.life, {{7, 8}, {}}}};
const auto input = network::encode_cellular_action_input({2, -3, 4, true, 0, 0});
@@ -65,6 +74,14 @@ void actions_bind_to_owned_life_and_preserve_other_inputs() {
CHECK(prepared->actions[0] ==
CellularActionRecord{controlled.account, 77, input});
const auto guessed_input =
network::encode_cellular_action_input({2, 0, 0, true, 15'000, 15'000});
const network::CarriedAction guessed{network::AccountId{controlled.account}, 78, 2,
network::ActionKind::cellular, guessed_input};
const std::array guessed_actions{guessed};
CHECK(prepare_cellular_session_tick(**state, 2, baseline, guessed_actions).error() ==
CellularSessionBatchError::unperceived_target);
CellularBatch batch;
batch.header = {(*state)->world(), (*state)->region(), (*state)->frame(), {}, {}, 1, 2};
batch.header.predecessor.fill(1);