feat(biology): evolve photosynthetic producers that capture light
Foundation / checks (ecs) (push) Successful in 2m25s
Foundation / checks (deploy) (push) Successful in 5m15s
Foundation / checks (network) (push) Successful in 21m56s
Foundation / checks (client) (push) Successful in 22m54s
Foundation / checks (tsan) (push) Successful in 47m4s
Foundation / checks (postgres) (push) Successful in 1h15m49s
Foundation / checks (checks) (push) Failing after 1h30m4s
Foundation / postgres-tools (push) Skipped
Foundation / server-image (push) Skipped
Foundation / image (push) Skipped

ADR-0175 implements ADR-0136 step C with trial costs to be balanced after
playtesting. Genome schema 5 adds a photosynthesis efficiency (empty in
schemas 1-4, so earlier offers and draws are unchanged; mutation operators
29-32 are appended). Development version 5 builds the organelles as
internal membrane (p/4 of structure, upkept twice) and slows movement by
p/2 per thousand. Founder 4 and cellular rules 11 let lineages earn the
capability as an offspring plan that children express.

Owner format 9 declares the region's light. Inside each tick's detached
candidate, active unfrozen producers capture cross-section x irradiance x
efficiency (a quarter while moving), credited to the reserve and boundary
inflow together and replayed from recorded intentions. Well-lit wildlife
producers hold still. The joint owner keeps infall, water and radiation and
nests a rules-11 owner unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
dingo
2026-10-19 18:06:02 -04:00
co-authored by Claude Opus 5.5
parent 51991ac7ff
commit 108f29eda5
34 changed files with 856 additions and 128 deletions
+15 -2
View File
@@ -69,7 +69,8 @@ std::expected<DevelopmentRules, DevelopmentError> rules_for(std::uint32_t develo
// heat, so this changes no matter balance.
// Version 4 (rules 7, ADR-0137) keeps version 3's rules; only what reproduction
// means changes (metabolism.cpp).
if (development_version == 3 || development_version == 4) {
// Version 5 (ADR-0175) keeps them too; it adds photosynthetic organelles below.
if (development_version >= 3 && development_version <= 5) {
return DevelopmentRules{1000, 1200, 10, 15, 13, 60'000, 293'150, 50};
}
return std::unexpected{DevelopmentError::unsupported_rules};
@@ -101,6 +102,16 @@ derive_phenotype(const Genome& genome, GrowthState growth, EnvironmentState envi
!multiply(phenotype.membrane_mass, shell, rules->membrane_density)) {
return std::unexpected{DevelopmentError::overflow};
}
const auto photosynthesis =
genome.development_version() >= 5 && genome.carries(Capability::photosynthesis)
? *genome.parameter(Capability::photosynthesis)
: 0U;
if (photosynthesis != 0 &&
!add(
phenotype.membrane_mass, phenotype.membrane_mass,
scaled(phenotype.structural_mass / photosynthesis_organelle_quarter, photosynthesis))) {
return std::unexpected{DevelopmentError::overflow};
}
if (!add(phenotype.total_mass, phenotype.structural_mass, phenotype.membrane_mass)) {
return std::unexpected{DevelopmentError::overflow};
}
@@ -124,7 +135,9 @@ derive_phenotype(const Genome& genome, GrowthState growth, EnvironmentState envi
if (!speed || *speed > std::numeric_limits<std::uint32_t>::max()) {
return std::unexpected{DevelopmentError::overflow};
}
phenotype.movement_speed = static_cast<std::uint32_t>(*speed);
// Organelles slow the cell: p/2 per thousand off its speed (version 5).
const auto kept = thousand - photosynthesis / photosynthesis_speed_halving;
phenotype.movement_speed = static_cast<std::uint32_t>(scaled(*speed, kept));
}
if (genome.carries(Capability::ingestion)) {
const auto intake = rate_per_tick(*genome.per_second(Capability::ingestion));