Build bounded cellular session batches
Foundation / checks (deploy) (push) Successful in 5s
Foundation / checks (checks) (push) Failing after 40s
Foundation / checks (ecs) (push) Successful in 1m53s
Foundation / checks (postgres) (push) Failing after 53s
Foundation / checks (tsan) (push) Failing after 31s
Foundation / checks (network) (push) Failing after 3m1s
Foundation / checks (client) (push) Failing after 4m25s
Foundation / postgres-tools (push) Skipped
Foundation / server-image (push) Skipped
Foundation / image (push) Skipped

This commit is contained in:
dingo
2026-10-10 23:36:18 -04:00
parent 0b85aa45c2
commit dae0572426
5 changed files with 131 additions and 1 deletions
+31
View File
@@ -72,6 +72,37 @@ void actions_bind_to_owned_life_and_preserve_other_inputs() {
batch.ticks.push_back(prepared->intents);
CHECK(match_cellular_actions_to_trace(**state, batch, prepared->actions));
persistence::RegionHead head{};
head.frame = (*state)->frame();
head.sequence = 4;
head.end_tick = (*state)->tick();
head.commit.fill(1);
head.digest.fill(2);
auto builder = CellularSessionBatchBuilder::create(**state, head);
CHECK(builder);
CHECK(builder->append(2, baseline, actions));
std::vector<CellularLifeIntent> next_baseline;
for (const auto& life : builder->candidate().lives())
next_baseline.push_back({life.identity.life, {}});
CHECK(builder->append(3, next_baseline, {}));
CHECK(builder->batch().header.begin_tick == 1 && builder->batch().header.end_tick == 3 &&
builder->batch().ticks.size() == 2);
CHECK(builder->actions().size() == 1 && builder->actions()[0] == prepared->actions[0]);
const auto replayed = replay_cellular_batch(**state, builder->batch());
CHECK(replayed && (*replayed)->snapshot() == builder->candidate().snapshot());
const auto repeated_input = network::encode_cellular_action_input({3, 0, 0, false, 0, 0});
const network::CarriedAction repeated{network::AccountId{controlled.account}, 77, 3,
network::ActionKind::cellular, repeated_input};
const std::array repeated_actions{repeated};
CHECK(builder->append(3, next_baseline, repeated_actions).error() ==
CellularSessionBatchError::duplicate_action);
CHECK(builder->append(5, next_baseline, {}).error() == CellularSessionBatchError::tick);
auto wrong_head = head;
++wrong_head.end_tick;
CHECK(CellularSessionBatchBuilder::create(**state, wrong_head).error() ==
CellularSessionBatchError::head);
auto altered = baseline;
altered[1].intent.movement.x = 10;
const auto preserved = prepare_cellular_session_tick(**state, 2, altered, actions);