Keep the phenotype wire-stable: rate period on the budget, not the phenotype
Foundation / checks (deploy) (push) Successful in 3m28s
Foundation / checks (ecs) (push) Successful in 1m55s
Foundation / checks (client) (push) Successful in 12m43s
Foundation / checks (network) (push) Successful in 13m32s
Foundation / checks (tsan) (push) Successful in 7m48s
Foundation / checks (checks) (push) Successful in 32m55s
Foundation / checks (postgres) (push) Successful in 46m26s
Foundation / postgres-tools (push) Successful in 1m41s
Foundation / server-image (push) Successful in 4m13s
Foundation / image (push) Successful in 2m35s
Foundation / checks (deploy) (push) Successful in 3m28s
Foundation / checks (ecs) (push) Successful in 1m55s
Foundation / checks (client) (push) Successful in 12m43s
Foundation / checks (network) (push) Successful in 13m32s
Foundation / checks (tsan) (push) Successful in 7m48s
Foundation / checks (checks) (push) Successful in 32m55s
Foundation / checks (postgres) (push) Successful in 46m26s
Foundation / postgres-tools (push) Successful in 1m41s
Foundation / server-image (push) Successful in 4m13s
Foundation / image (push) Successful in 2m35s
CI run 136 failed network: Phenotype::rate_microseconds (added with development version 2) is not carried by either session protocol, so the organism view no longer re-encoded canonically. The phenotype keeps its replicated shape; the period follows from the development version (development_rate_microseconds) and MetabolicBudget carries it. No protocol change; first-bud times unchanged. Refresh the dev session window. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -107,12 +107,9 @@ derive_phenotype(const Genome& genome, GrowthState growth, EnvironmentState envi
|
||||
// Version 1 is defined in 50 ms ticks: genome rates (per second) enter it at that
|
||||
// quantum, rounded down as capacities (ADR-0099; exact for schema 1 records).
|
||||
// Version 2 is defined per second and reads them as they are.
|
||||
const bool v1 = genome.development_version() == 1;
|
||||
phenotype.rate_microseconds =
|
||||
v1 ? development_v1_tick_microseconds : development_v2_rate_microseconds;
|
||||
const auto rate_per_tick = [&](std::uint64_t per_second) {
|
||||
return accounting::per_tick(per_second, phenotype.rate_microseconds,
|
||||
accounting::Rounding::down);
|
||||
const auto period = development_rate_microseconds(genome.development_version());
|
||||
const auto rate_per_tick = [period](std::uint64_t per_second) {
|
||||
return accounting::per_tick(per_second, period, accounting::Rounding::down);
|
||||
};
|
||||
if (genome.carries(Capability::movement)) {
|
||||
const auto speed = rate_per_tick(*genome.per_second(Capability::movement));
|
||||
|
||||
@@ -130,6 +130,7 @@ metabolic_budget(const Genome& genome, GrowthState growth, EnvironmentState envi
|
||||
}
|
||||
MetabolicBudget budget;
|
||||
budget.phenotype = *phenotype;
|
||||
budget.rate_microseconds = development_rate_microseconds(genome.development_version());
|
||||
budget.assimilation_per_thousand =
|
||||
static_cast<std::uint16_t>(phenotype->conversion_per_thousand);
|
||||
budget.body = compose(phenotype->structural_mass, rules->structure);
|
||||
@@ -212,7 +213,7 @@ metabolic_budget(const Genome& genome, GrowthState growth, EnvironmentState envi
|
||||
|
||||
std::optional<std::uint64_t> bud_funding_seconds(const MetabolicBudget& budget,
|
||||
std::uint32_t feeding_per_thousand) noexcept {
|
||||
const auto period = budget.phenotype.rate_microseconds;
|
||||
const auto period = budget.rate_microseconds;
|
||||
if (period == 0 || accounting::microseconds_per_second % period != 0 ||
|
||||
feeding_per_thousand == 0 || feeding_per_thousand > thousand ||
|
||||
matter_total(budget.reproduction_investment) == 0)
|
||||
|
||||
@@ -10,7 +10,7 @@ consumer_for(const biology::Genome& genome, biology::GrowthState growth,
|
||||
}
|
||||
// The M2 fixtures step in tick-abstract units that match development version 1's
|
||||
// 50 ms rates; a per-second version would be read twenty times too fast (ADR-0099).
|
||||
if (budget->phenotype.rate_microseconds != biology::development_v1_tick_microseconds) {
|
||||
if (budget->rate_microseconds != biology::development_v1_tick_microseconds) {
|
||||
return std::unexpected{biology::DevelopmentError::unsupported_rules};
|
||||
}
|
||||
return ConsumerConfig{opening, budget->intake_limit, budget->assimilation_per_thousand};
|
||||
@@ -24,7 +24,7 @@ strategy_for(const biology::Genome& genome, biology::GrowthState growth,
|
||||
if (!budget) {
|
||||
return std::unexpected{budget.error()};
|
||||
}
|
||||
if (budget->phenotype.rate_microseconds != biology::development_v1_tick_microseconds) {
|
||||
if (budget->rate_microseconds != biology::development_v1_tick_microseconds) {
|
||||
return std::unexpected{biology::DevelopmentError::unsupported_rules};
|
||||
}
|
||||
return StrategyConfig{opening,
|
||||
|
||||
Reference in New Issue
Block a user