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

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:
dingo
2026-10-09 16:47:23 -04:00
co-authored by Claude Opus 5.5
parent 51cf23dbc9
commit 93e1ab08ae
9 changed files with 48 additions and 21 deletions
+10 -3
View File
@@ -25,6 +25,16 @@ inline constexpr std::uint64_t development_v1_tick_microseconds = 50'000;
// Development version 2 (ADR-0099, M11.1) is defined per second: its rate constants and
// its rate outputs (maintenance, movement, ingestion) are per second.
inline constexpr std::uint64_t development_v2_rate_microseconds = 1'000'000;
// The period a development version's rates are per (phenotype maintenance, movement and
// ingestion; budget rates): 50 ms for version 1, one second for version 2; 0 when the
// version is unknown. Phenotypes are replicated unchanged, so the period is not a field
// of them: it follows from the genome's development version.
[[nodiscard]] constexpr std::uint64_t
development_rate_microseconds(std::uint32_t development_version) noexcept {
return development_version == 1 ? development_v1_tick_microseconds
: development_version == 2 ? development_v2_rate_microseconds
: 0;
}
// Chosen constants, reviewable as a unit and selected by the genome's
// development version. Declared model parameters, not balance.
struct DevelopmentRules {
@@ -51,9 +61,6 @@ struct Phenotype {
std::uint32_t conversion_per_thousand{};
// Millikelvin beyond the genome's tolerance. A reported quantity, not a rule.
std::uint32_t thermal_shortfall{};
// The period the rates above are per: the development version's (50 ms for version
// 1, one second for version 2). A process converts with accounting::per_tick.
std::uint64_t rate_microseconds{};
auto operator<=>(const Phenotype&) const = default;
};
// A proposal. It reserves nothing, pays for nothing and commits nothing; the
+3 -1
View File
@@ -36,7 +36,7 @@ struct ConstructionTransition {
struct MetabolicBudget {
Phenotype phenotype;
accounting::Inventory body; // matter only; a body is not energy
// Rates are per phenotype.rate_microseconds (the development version's period).
// Rates are per rate_microseconds, the development version's period.
accounting::Picojoules maintenance; // per rate period
accounting::Picojoules movement; // per rate period at full speed, a capacity
accounting::Picojoules demand; // maintenance plus movement
@@ -45,6 +45,8 @@ struct MetabolicBudget {
// Zero without the reproduction capability, rather than a default.
accounting::Inventory reproduction_investment;
std::uint16_t assimilation_per_thousand{};
// The period of the rates above and of the phenotype's (development_rate_microseconds).
std::uint64_t rate_microseconds{};
auto operator<=>(const MetabolicBudget&) const = default;
};
[[nodiscard]] std::expected<MetabolicRules, DevelopmentError>