feat(lifecycle): rules 12 liquid owner on format 10 with brake traces
Foundation / checks (checks) (push) Successful in 5s
Foundation / checks (client) (push) Successful in 5s
Foundation / checks (ecs) (push) Successful in 4s
Foundation / checks (network) (push) Successful in 4s
Foundation / checks (postgres) (push) Successful in 4s
Foundation / checks (tsan) (push) Successful in 5s
Foundation / checks (deploy) (push) Successful in 4m23s
Foundation / postgres-tools (push) Successful in 29s
Foundation / server-image (push) Successful in 4m10s
Foundation / image (push) Successful in 4m31s
Foundation / checks (checks) (push) Successful in 5s
Foundation / checks (client) (push) Successful in 5s
Foundation / checks (ecs) (push) Successful in 4s
Foundation / checks (network) (push) Successful in 4s
Foundation / checks (postgres) (push) Successful in 4s
Foundation / checks (tsan) (push) Successful in 5s
Foundation / checks (deploy) (push) Successful in 4m23s
Foundation / postgres-tools (push) Successful in 29s
Foundation / server-image (push) Successful in 4m10s
Foundation / image (push) Successful in 4m31s
The cellular owner gains rules 12 on owner format 10: an explicit no-tick format-9/rules-11 upgrade declares the region's liquid rules (current configuration, founder handling and deposit motion, from the tuning file and a seed when the region opens), converts the habitat to format 3 and starts lives at rest. Founders born afterwards are founder 5 (genome schema 6). Each tick derives every life's handling from its genome and the declared founder handling, samples the current at its footprint and steps the shared liquid motion; afterwards bubbles move with the current and the drift moving cells induce, and touching bubbles merge. Format 10 persists the rules and each life's motion state; restore regenerates the identical current field. Brake is a new step intent, valid only under rules 12, carried in trace 4 as flag bit 1 (SQL never parses that byte; player action records keep it zero). Tests cover the upgrade, exact restore, swimming and braking, moving food with fixed pools, restore continuing a live run, and brake traces replaying exactly. Genomes from before schema 6 handle as founders. Refreshes the DEV session window. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -252,17 +252,20 @@ CellularHandling founder_cellular_handling(const CellularTuning& tuning,
|
||||
std::expected<CellularHandling, CellularHandlingError>
|
||||
derive_cellular_handling(const Genome& genome, const MetabolicBudget& budget,
|
||||
const CellularTuning& tuning) {
|
||||
const auto& arrangement = genome.movement_arrangement();
|
||||
if (!arrangement || genome.development_version() < 6)
|
||||
return std::unexpected{CellularHandlingError::unsupported_genome};
|
||||
return derive_cellular_handling(genome, budget, founder_cellular_handling(tuning, {}, {}));
|
||||
}
|
||||
|
||||
std::expected<CellularHandling, CellularHandlingError>
|
||||
derive_cellular_handling(const Genome& genome, const MetabolicBudget& budget,
|
||||
const CellularHandling& founder) {
|
||||
// Genomes from before schema 6 carry no arrangement and handle as founders do.
|
||||
const auto a = genome.movement_arrangement().value_or(founder_movement_arrangement);
|
||||
if (budget.rate_microseconds != accounting::microseconds_per_second)
|
||||
return std::unexpected{CellularHandlingError::unsupported_rate};
|
||||
const auto full_cost = accounting::per_tick(
|
||||
budget.movement.value, cellular_motion_tick_microseconds, accounting::Rounding::up);
|
||||
if (!full_cost || *full_cost > std::uint64_t{1} << 40U)
|
||||
return std::unexpected{CellularHandlingError::overflow};
|
||||
const auto founder = founder_cellular_handling(tuning, {}, {});
|
||||
const auto& a = *arrangement;
|
||||
constexpr std::uint64_t reference = movement_reference_points;
|
||||
const auto scale = [](std::uint64_t value, std::uint64_t index) {
|
||||
return value * index / reference;
|
||||
|
||||
Reference in New Issue
Block a user