Cellular balance rules 6 (ADR-0132, schema v41)
Foundation / checks (checks) (push) Successful in 42m33s
Foundation / checks (deploy) (push) Successful in 4m11s
Foundation / checks (ecs) (push) Successful in 2m27s
Foundation / checks (network) (push) Successful in 19m23s
Foundation / checks (postgres) (push) Successful in 44m44s
Foundation / checks (tsan) (push) Successful in 9m53s
Foundation / checks (client) (push) Successful in 16m19s
Foundation / postgres-tools (push) Successful in 30s
Foundation / server-image (push) Successful in 3m14s
Foundation / image (push) Successful in 3m16s

The playtest found mutation offers the arena could never pay for. A mutation's
matter cost is the real body difference (ADR-0118), so it cannot be discounted.
Rules 6 cut it honestly:
- genome schema 3 steps a third as far (1/300 of the range);
- development version 3 charges a third of the construction energy (13 instead of
  40 pJ per 1000 fg).

Founder 2 uses both. The cellular-v5 opening creates rules-6 regions on bundle v7,
which schema v41 admits. Existing lineages, regions and committed history are
unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
dingo
2026-10-15 20:53:31 -04:00
co-authored by Claude Opus 5.5
parent 1446d36d26
commit 4d17a0651c
31 changed files with 571 additions and 68 deletions
+6
View File
@@ -64,6 +64,12 @@ std::expected<DevelopmentRules, DevelopmentError> rules_for(std::uint32_t develo
if (development_version == 2) {
return DevelopmentRules{1000, 1200, 10, 15, 40, 60'000, 293'150, 50};
}
// Version 3 (rules 6, 2026-10-15 balance): version 2 with a third of the construction
// energy (13 pJ per 1000 fg built instead of 40). Construction is overhead paid into
// heat, so this changes no matter balance.
if (development_version == 3) {
return DevelopmentRules{1000, 1200, 10, 15, 13, 60'000, 293'150, 50};
}
return std::unexpected{DevelopmentError::unsupported_rules};
}
+7 -6
View File
@@ -3,13 +3,14 @@
#include <limits>
namespace evo::biology {
std::expected<Genome, GenomeError> primitive_founder(std::uint64_t id, std::uint64_t origin_event) {
std::expected<Genome, GenomeError> primitive_founder(std::uint64_t id, std::uint64_t origin_event,
FounderVersion version) {
const auto& p = primitive_founder_parameters;
GenomeDraft draft;
draft.schema_version = genome_schema_version;
draft.schema_version = version.genome_schema;
draft.id = id;
draft.origin_event = origin_event;
draft.development_version = primitive_founder_development_version;
draft.development_version = version.development_version;
draft.capabilities = {{Capability::energy_conversion, p.energy_conversion, 0},
{Capability::membrane, p.membrane, 0},
{Capability::movement, p.movement, 0},
@@ -19,11 +20,11 @@ std::expected<Genome, GenomeError> primitive_founder(std::uint64_t id, std::uint
return Genome::create(draft);
}
std::expected<FounderEndowment, DevelopmentError> primitive_endowment() {
std::expected<FounderEndowment, DevelopmentError> primitive_endowment(FounderVersion version) {
// Identity does not enter development; the published genome gets allocated
// identities at creation, not these analysis-only values.
const auto genome = primitive_founder(1, 1);
const auto rules = rules_for(primitive_founder_development_version);
const auto genome = primitive_founder(1, 1, version);
const auto rules = rules_for(version.development_version);
if (!genome || !rules)
return std::unexpected{DevelopmentError::unsupported_rules};
const auto budget = metabolic_budget(*genome, {1000, 0}, {rules->reference_temperature, {}});
+1 -1
View File
@@ -108,7 +108,7 @@ metabolic_rules_for(std::uint32_t development_version) {
return MetabolicRules{structure_shares, membrane_shares, 20, 50'000};
}
// Version 2: per second; movement at 1000 um/s costs 50 pJ/s per 1000 fg (tunable).
if (development_version == 2) {
if (development_version == 2 || development_version == 3) { // Version 3: same metabolism.
return MetabolicRules{structure_shares, membrane_shares, 50, 50'000};
}
return std::unexpected{DevelopmentError::unsupported_rules};
+9 -5
View File
@@ -28,12 +28,16 @@ constexpr std::array<MutationOperator, 4 * capability_count> catalog = [] {
// One rule rather than a constant per capability: a hundredth of the declared
// range, at least one. Granularity follows the range, which is a stated model
// choice and not a claim about biology.
// The step comes from the genome's own schema, so a schema 1 lineage keeps its steps.
// The step comes from the genome's own schema, so a lineage keeps its steps. Schema 3
// (rules 6, 2026-10-15 balance) takes a third of that step: successor bodies differ a
// third as much, so the matter a mutation needs falls with them (ADR-0118: the cost is
// the body difference, never a discount).
constexpr std::uint32_t adjustment_step(const std::array<CapabilitySpec, capability_count>& table,
Capability kind) noexcept {
Capability kind, std::uint32_t schema) noexcept {
const auto& limits = table[static_cast<std::size_t>(kind)];
const auto span = limits.maximum - limits.minimum;
return span / 100 == 0 ? 1 : span / 100;
const std::uint32_t divisor = schema == genome_schema_v3 ? 300 : 100;
return span / divisor == 0 ? 1 : span / divisor;
}
std::uint64_t mix(std::uint64_t hash, std::uint64_t value) noexcept {
@@ -92,7 +96,7 @@ std::optional<GenomeDraft> apply(const Genome& genome, const MutationOperator& e
if (!present) {
return std::nullopt;
}
const auto step = adjustment_step(table, entry.target);
const auto step = adjustment_step(table, entry.target, genome.schema_version());
// Refused rather than clamped: a clamp would make two operators agree
// and would offer a no-op as a real choice.
if (carried->parameter > limits.maximum - step) {
@@ -105,7 +109,7 @@ std::optional<GenomeDraft> apply(const Genome& genome, const MutationOperator& e
if (!present) {
return std::nullopt;
}
const auto step = adjustment_step(table, entry.target);
const auto step = adjustment_step(table, entry.target, genome.schema_version());
if (carried->parameter < limits.minimum + step) {
return std::nullopt;
}
@@ -168,6 +168,11 @@ provision_cellular_region(Postgres& owner, const FilesystemObjectStore& objects,
// ADR-0128: a rules-5 region starts on the v6 bundle with genome revisions.
manifest->cellular_versions = cellular_v6_versions;
manifest->history_profile = cellular_revision_history_profile;
} else if (manifest && opening.format_version() == server::cellular_lives_presence_format &&
opening.rules_version() == server::cellular_lives_balance_rules) {
// 2026-10-15 balance: a rules-6 region starts on the v7 bundle with genome revisions.
manifest->cellular_versions = cellular_v7_versions;
manifest->history_profile = cellular_revision_history_profile;
} else if (manifest && (opening.format_version() != server::cellular_lives_legacy_format ||
opening.rules_version() != 1))
return std::unexpected{failure(PublicationError::candidate)};
+4 -2
View File
@@ -72,7 +72,8 @@ bool structural(const CheckpointManifest& m) noexcept {
m.cellular_versions != cellular_v3_versions &&
m.cellular_versions != cellular_v4_versions &&
m.cellular_versions != cellular_v5_versions &&
m.cellular_versions != cellular_v6_versions) ||
m.cellular_versions != cellular_v6_versions &&
m.cellular_versions != cellular_v7_versions) ||
(cellular && m.versions != environmental_v1_versions))
return false;
if (primitive && (m.manifest_version != 2 || m.tick_microseconds != 50000 ||
@@ -167,7 +168,8 @@ bool supported(const CheckpointManifest& m) noexcept {
m.cellular_versions == cellular_v3_versions ||
m.cellular_versions == cellular_v4_versions ||
m.cellular_versions == cellular_v5_versions ||
m.cellular_versions == cellular_v6_versions) &&
m.cellular_versions == cellular_v6_versions ||
m.cellular_versions == cellular_v7_versions) &&
m.versions == environmental_v1_versions && m.tick_microseconds == 50000 &&
m.rng_streams == 0 && m.durability == DurabilityPolicy::single_volume_development;
}
+15 -8
View File
@@ -535,7 +535,8 @@ CellularLives::create(const PrimitiveLives& opening,
const auto world = nursery_config.world;
const auto region = nursery_config.region;
const auto frame = nursery_config.frame;
const bool presence = profile == CellularLivesProfile::presence;
const bool balance = profile == CellularLivesProfile::balance; // Rules 6: presence plus.
const bool presence = profile == CellularLivesProfile::presence || balance;
const bool budding = profile == CellularLivesProfile::budding || presence;
const bool engulf = profile == CellularLivesProfile::engulf || budding;
if (engulf)
@@ -548,10 +549,11 @@ CellularLives::create(const PrimitiveLives& opening,
: budding ? cellular_lives_bud_format
: engulf ? cellular_lives_engulf_format
: cellular_lives_format,
presence ? cellular_lives_presence_rules
: budding ? cellular_lives_bud_rules
: engulf ? cellular_lives_engulf_rules
: cellular_lives_rules);
balance ? cellular_lives_balance_rules
: presence ? cellular_lives_presence_rules
: budding ? cellular_lives_bud_rules
: engulf ? cellular_lives_engulf_rules
: cellular_lives_rules);
return std::unique_ptr<CellularLives>{new CellularLives{std::move(state)}};
}
@@ -858,8 +860,11 @@ CellularLives::birth_candidate(LifeRequest request, LifeAllocation allocation) c
state_->archive.find(allocation.genome) || state_->archive.organism(allocation.organism))
return std::unexpected{CellularLivesError::duplicate_life};
const auto endowed = biology::primitive_endowment();
const auto genome = biology::primitive_founder(allocation.genome, allocation.event);
// Rules 6 found version-2 founders: lower construction energy, finer mutations.
const auto founder_version = cellular_founder_version(state_->rules_version);
const auto endowed = biology::primitive_endowment(founder_version);
const auto genome =
biology::primitive_founder(allocation.genome, allocation.event, founder_version);
if (!endowed || !genome)
return std::unexpected{CellularLivesError::biology};
const auto budget = biology::metabolic_budget(
@@ -964,9 +969,11 @@ CellularLives::restore(std::span<const std::uint8_t> bytes, std::uint64_t world,
const bool offer_version = magic == cellular_lives_v2_magic &&
format_version == cellular_lives_format &&
rules_version == cellular_lives_rules;
// Format 6 carries rules 5 or rules 6 (founder 2, no new state).
const bool presence_version = magic == cellular_lives_v6_magic &&
format_version == cellular_lives_presence_format &&
rules_version == cellular_lives_presence_rules;
(rules_version == cellular_lives_presence_rules ||
rules_version == cellular_lives_balance_rules);
// Formats 5 and 6 carry the bud sequence and parent lives (rules 4 and 5).
const bool bud_version = presence_version || (magic == cellular_lives_v5_magic &&
format_version == cellular_lives_bud_format &&