feat(cellular): region ticks of up to 4,096 lives for testing (schema 68)
Foundation / checks (checks) (push) Successful in 5s
Foundation / checks (client) (push) Successful in 5s
Foundation / checks (ecs) (push) Successful in 4s
Foundation / checks (deploy) (push) Successful in 5s
Foundation / checks (network) (push) Successful in 4s
Foundation / checks (postgres) (push) Successful in 5s
Foundation / checks (tsan) (push) Successful in 4s
Foundation / postgres-tools (push) Successful in 31s
Foundation / server-image (push) Successful in 4m29s
Foundation / image (push) Successful in 5m43s
Foundation / checks (checks) (push) Successful in 5s
Foundation / checks (client) (push) Successful in 5s
Foundation / checks (ecs) (push) Successful in 4s
Foundation / checks (deploy) (push) Successful in 5s
Foundation / checks (network) (push) Successful in 4s
Foundation / checks (postgres) (push) Successful in 5s
Foundation / checks (tsan) (push) Successful in 4s
Foundation / postgres-tools (push) Successful in 31s
Foundation / server-image (push) Successful in 4m29s
Foundation / image (push) Successful in 5m43s
ADR-0182 section 17. The plan's 2,000-organism cap became the rules-12 key region.organism_cap, which was parsed but never enforced; the real bound was max_cellular_tick_lives = 256 (ADR-0106), which rules 13's organism cap could not exceed. The bound is now 4,096, for testing limits only; the DEV tuning file keeps 256. - max_cellular_tick_lives (4,096) bounds the raw region path: step, owner state, batch trace (cellular_batch_bytes_for) and current checkpoint traces. max_cellular_frozen_lives (256) keeps cohort populations, population batches, migration traces and pre-v3 cellular traces, whose database checks are fixed. - Tuning: reproduction.organism_cap and wildlife_cap accept up to 4,096. - Schema 68: the trace checker under the current publishers (cellular_births_v45) accepts 4,096 intents, births and mutations per tick; spawn_wildlife takes up to 256 cells a command. - Region view and portal: the lineage archive's fill (births of 65,536, genomes of 4,096), at which a region stops ticking. - PostgreSQL suite: 256 wildlife spawned in one command, then a 289-life tick published and recovered exactly. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -1593,6 +1593,7 @@ void run_starting_wildlife_publication_tests() {
|
||||
auto tuned_rules = recovered->state->revamp_rules();
|
||||
auto& upkeep = tuned_rules.body.essential_upkeep_per_thousand;
|
||||
upkeep = upkeep == 100 ? 101 : 100;
|
||||
tuned_rules.organism_cap = 4'096; // Section 17: room for the crowded tick below.
|
||||
CHECK(evo::server::cellular_revamp_valid(tuned_rules) &&
|
||||
tuned_rules != recovered->state->revamp_rules());
|
||||
const auto tuned_digest = checked_value(
|
||||
@@ -1637,6 +1638,42 @@ void run_starting_wildlife_publication_tests() {
|
||||
recovered = recover_cellular_checkpoint(*runtime, **objects, key, *lease, builds, 5s);
|
||||
CHECK(recovered && recovered->state->snapshot() == adopted_bytes &&
|
||||
recovered->state->revamp_rules() == tuned_rules);
|
||||
|
||||
// ADR-0182 section 17 (schema 68): 256 wildlife in one command, then a tick of more than
|
||||
// 256 lives, publish and recover exactly.
|
||||
const auto [crowd_id, crowd_first] = enqueue(6, 256, 0, 0);
|
||||
const std::vector<evo::server::CellularAdminCommand> crowd{
|
||||
{static_cast<std::uint64_t>(crowd_id), Kind::spawn_wildlife, 256, crowd_first, {}}};
|
||||
auto spawn_batch = admin_batch(crowd);
|
||||
spawn_batch.header = {key.world, key.region, 1, head.head.commit, head.head.digest, 4, 5};
|
||||
spawn_batch.ticks.front().lives = checked_value(wildlife_intents(*recovered->state, 5));
|
||||
CHECK(recovered->state->advance_tick(spawn_batch.ticks.front().lives));
|
||||
std::vector<evo::server::CellularAdminResult> crowd_results;
|
||||
auto spawned = recovered->state->admin_candidate(crowd, &crowd_results);
|
||||
CHECK(spawned && crowd_results.size() == 1 && crowd_results.front().applied &&
|
||||
(*spawned)->lives().size() > 256);
|
||||
auto spawn_publish = publish_cellular_batch(*runtime, **objects, *lease, head, spawn_batch,
|
||||
**spawned, identity(13), build, 5s);
|
||||
CHECK(spawn_publish);
|
||||
head = spawn_publish->committed;
|
||||
recovered = recover_cellular_checkpoint(*runtime, **objects, key, *lease, builds, 5s);
|
||||
CHECK(recovered && recovered->state->snapshot() == (*spawned)->snapshot());
|
||||
auto& crowded = recovered->state;
|
||||
CellularBatch crowded_batch{
|
||||
{key.world, key.region, 1, head.head.commit, head.head.digest, 5, 6}, {{}}};
|
||||
crowded_batch.ticks.front().lives = checked_value(wildlife_intents(*crowded, 6));
|
||||
CHECK(crowded_batch.ticks.front().lives.size() > 256);
|
||||
CHECK(crowded->advance_tick(crowded_batch.ticks.front().lives));
|
||||
const auto crowded_bytes = crowded->snapshot();
|
||||
auto crowded_publish = publish_cellular_batch(*runtime, **objects, *lease, head, crowded_batch,
|
||||
*crowded, identity(14), build, 5s);
|
||||
CHECK(crowded_publish);
|
||||
head = crowded_publish->committed;
|
||||
recovered = recover_cellular_checkpoint(*runtime, **objects, key, *lease, builds, 5s);
|
||||
CHECK(recovered && recovered->state->snapshot() == crowded_bytes &&
|
||||
recovered->state->lives().size() > 256);
|
||||
std::printf("crowded tick: %zu lives, %zu snapshot bytes (%zu at 33 lives)\n",
|
||||
recovered->state->lives().size(), crowded_bytes.size(), applied_bytes.size());
|
||||
CHECK(release_region_lease(*runtime, key, *lease, 5s));
|
||||
std::puts("starting wildlife publication and replacement-owner replay passed");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user