M12.4: retain and settle owned population intervals
Foundation / checks (deploy) (push) Successful in 5s
Foundation / checks (ecs) (push) Successful in 2m28s
Foundation / checks (tsan) (push) Failing after 18m22s
Foundation / checks (network) (push) Successful in 20m38s
Foundation / checks (client) (push) Failing after 21m6s
Foundation / postgres-tools (push) Canceled after 0s
Foundation / server-image (push) Canceled after 0s
Foundation / image (push) Canceled after 0s
Foundation / checks (postgres) (push) Canceled after 46m54s
Foundation / checks (checks) (push) Canceled after 47m3s

This commit is contained in:
dingo
2026-10-17 17:31:05 -04:00
parent 627411983f
commit 0a8962b57e
34 changed files with 1032 additions and 75 deletions
+40 -3
View File
@@ -17,6 +17,42 @@ CellularBatchHeader header(const CellularPopulation& state, std::uint64_t ticks)
return {s.world(), s.region(), s.frame(), filled<16>(1),
filled<32>(2), s.tick(), s.tick() + ticks};
}
Owner interval_source() {
auto source = cellular_descendants();
const auto stop = source->tick() + cellular_linger_ticks + 1;
while (source->tick() < stop) {
const CellularBatchHeader h{source->world(),
source->region(),
source->frame(),
filled<16>(1),
filled<32>(2),
source->tick(),
std::min(stop, source->tick() + 64)};
auto inputs = checked(unattended_population_inputs(*source, h), "suspension prefix inputs");
source = checked(replay_cellular_batch(*source, inputs), "suspension prefix replay");
}
require(population_interval_safe(*source), "controlled life did not finish lingering");
return source;
}
void lingering_is_not_new_population_work() {
auto active =
checked(CellularPopulation::create(cellular_descendants()), "legacy active source");
require(!population_interval_safe(active->state()), "active controlled source admitted");
auto biology = checked(unattended_population_inputs(active->state(), header(*active, 1)),
"legacy frozen tick");
require(!prepare_population_batch(*active, biology),
"new interval bypassed vulnerable lingering");
auto biological =
checked(replay_cellular_batch(active->state(), biology), "legacy recorded biology");
require(!population_interval_safe(*biological), "lingering controlled source admitted");
auto expected =
checked(CellularPopulation::create(std::move(biological)), "legacy population result");
// Existing profile-5 records retain their meaning. They can be verified and
// materialized to profile 4; new interval preparation rejects this state.
const CellularPopulationBatch legacy{biology.header, biology, {}, {{0, {}}}};
auto replayed = checked(replay_population_batch(*active, legacy), "retained legacy trace");
require(replayed->snapshot() == expected->snapshot(), "old recorded prefix changed meaning");
}
CellularBatch inputs_batch(const CellularPopulation& base) {
CellularBatch batch{header(base, 64), {}};
auto biological = restore(base.state());
@@ -37,8 +73,8 @@ CellularBatch inputs_batch(const CellularPopulation& base) {
return batch;
}
void traces() {
auto population = checked(
CellularPopulation::create(cellular_descendants(), {true, 1200, 1800}), "batch population");
auto population = checked(CellularPopulation::create(interval_source(), {true, 1200, 1800}),
"batch population");
std::uint64_t converted = 0;
for (unsigned interval = 0; interval < 6; ++interval) {
auto inputs = inputs_batch(*population);
@@ -83,7 +119,7 @@ void traces() {
"manual materialization changed biology");
}
void manifests() {
auto state = cellular_descendants();
auto state = interval_source();
auto population = checked(CellularPopulation::create(restore(*state), {true, 1200, 1800}),
"manifest population");
CheckpointManifest source;
@@ -151,6 +187,7 @@ void manifests() {
} // namespace
int main() try {
traces();
lingering_is_not_new_population_work();
manifests();
return 0;
} catch (const std::exception& error) {