feat(cellular): random founder spawns, tunable thrust cost, commit timing
Foundation / checks (checks) (push) Successful in 5s
Foundation / checks (client) (push) Successful in 5s
Foundation / checks (network) (push) Successful in 5s
Foundation / checks (postgres) (push) Successful in 4s
Foundation / checks (tsan) (push) Successful in 4s
Foundation / checks (ecs) (push) Successful in 1m6s
Foundation / checks (deploy) (push) Successful in 5m41s
Foundation / postgres-tools (push) Successful in 1m33s
Foundation / image (push) Successful in 4m42s
Foundation / server-image (push) Successful in 4m55s

Playtest feedback on region 10.

Rules-12 founders now start at a seeded random spot anywhere in the region (1 mm
clear of the edges, clear of other cells; seeded by world, region and the life's
identity so replay is exact). The provisioned sites remain the fallback.

Thrust energy is tunable: founder.thrust_cost_per_mille scales the metabolic
full-speed movement cost for thrust and braking (trial 250, a quarter of today's
cost). It is part of the liquid rules declared when a region opens, persisted in
the format-10 block's reserved slot (zero stands for the original 1,000), so
existing regions keep their meaning.

The server logs every cellular commit slower than 50 ms (and one in 60) with its
tick count and duration, to find what stalls the loop once a second.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
dingo
2026-10-22 06:40:12 -04:00
co-authored by Claude Opus 5.5
parent c94eca7d4e
commit af32af36ee
12 changed files with 108 additions and 12 deletions
+10 -1
View File
@@ -940,7 +940,7 @@ int serve_cellular(Options& o) {
// head per epoch (rules-12 regions commit every flush interval, not every tick).
std::optional<server::CellularSessionBatchBuilder> batch_builder;
std::vector<network::CarriedAction> batch_actions;
std::uint64_t pace_epoch = 0, pace_tick = 0;
std::uint64_t pace_epoch = 0, pace_tick = 0, flushes_logged = 0;
std::vector<network::CarriedAction> awaiting_outcomes;
// A tick that cannot be built is retried every 50 ms; name each distinct cause once.
std::optional<std::pair<std::string_view, server::CellularSessionBatchError>> stalled;
@@ -1120,8 +1120,17 @@ int serve_cellular(Options& o) {
batch_builder.reset();
return;
}
const auto flush_start = std::chrono::steady_clock::now();
const auto flush_ticks_held = batch_builder->batch().ticks.size();
auto published = host.publish(batch_builder->batch(), batch_builder->actions(),
batch_builder->mutation_actions());
// Operator evidence for commit stalls: every slow commit, and one in 60 otherwise.
const auto flush_ms = std::chrono::duration_cast<std::chrono::milliseconds>(
std::chrono::steady_clock::now() - flush_start)
.count();
if (flush_ms > 50 || ++flushes_logged % 60 == 0)
std::printf("cellular commit ticks=%zu ms=%lld ok=%d\n", flush_ticks_held,
static_cast<long long>(flush_ms), published ? 1 : 0);
if (published)
host.refuse_births(batch_builder->refused_births());
if (!published && host.status().phase != server::HostPhase::resolving) {