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
+8 -2
View File
@@ -32,8 +32,8 @@ inline constexpr std::uint64_t development_v2_rate_microseconds = 1'000'000;
[[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_version <= 4
? development_v2_rate_microseconds // Versions 3 and 4 keep version 2's rates.
: development_version >= 2 && development_version <= 5
? development_v2_rate_microseconds // Versions 3-5 keep version 2's rates.
: 0;
}
// Chosen constants, reviewable as a unit and selected by the genome's
@@ -64,6 +64,12 @@ struct Phenotype {
std::uint32_t thermal_shortfall{};
auto operator<=>(const Phenotype&) const = default;
};
// Development version 5 (ADR-0175; trial values): photosynthetic organelles are membrane
// built inside the cell. At efficiency p per thousand they add p/4 of the structural mass
// as membrane mass (so they are upkept twice, like membrane) and slow movement by p/2 per
// thousand. Light itself is captured by the region's environment owner, never here.
inline constexpr std::uint32_t photosynthesis_organelle_quarter = 4;
inline constexpr std::uint32_t photosynthesis_speed_halving = 2;
// A proposal. It reserves nothing, pays for nothing and commits nothing; the
// matching transfer does not exist until M3.3.
struct DevelopmentPlan {
+3
View File
@@ -34,6 +34,9 @@ inline constexpr FounderVersion primitive_founder_v1{genome_schema_v2, 2};
inline constexpr FounderVersion primitive_founder_v2{genome_schema_v3, 3};
// Founder 3 serves rules 7 (ADR-0137): percentage mutation steps and skilled reproduction.
inline constexpr FounderVersion primitive_founder_v3{genome_schema_v4, 4};
// Founder 4 serves rules 11 (ADR-0175): founder 3 that can evolve photosynthesis. Founders
// start without it; the capability is only ever earned through mutation.
inline constexpr FounderVersion primitive_founder_v4{genome_schema_v5, 5};
inline constexpr std::uint32_t primitive_founder_development_version =
primitive_founder_v1.development_version;
// The founder genome under a world-scoped identity and its origin event. Fails only on
+28 -7
View File
@@ -17,9 +17,10 @@ enum class Capability : std::uint8_t {
ingestion,
reproduction,
target_size,
thermal_tolerance
thermal_tolerance,
photosynthesis // Schema 5 (ADR-0175); unrepresentable in earlier schemas.
};
inline constexpr std::size_t capability_count = 7;
inline constexpr std::size_t capability_count = 8;
// The unit is a schema fact per kind and is never encoded, so no record can
// contradict its own units.
enum class Unit : std::uint8_t {
@@ -55,7 +56,9 @@ inline constexpr std::array<CapabilitySpec, capability_count> capability_schema_
CapabilitySpec{Unit::per_thousand, 1, 1000, false,
capability_bit(Capability::energy_conversion)},
CapabilitySpec{Unit::femtograms, 1, 1'000'000'000, true, 0},
CapabilitySpec{Unit::millikelvin, 1, 100'000, false, 0}};
CapabilitySpec{Unit::millikelvin, 1, 100'000, false, 0},
// An empty range: no schema-1 record can carry photosynthesis.
CapabilitySpec{Unit::per_thousand, 1, 0, false, 0}};
// Schema 2 (ADR-0099): the same capabilities with rates per second. Each rate range is
// schema 1's times 20, so every schema 1 value has an exact schema 2 equivalent.
inline constexpr std::array<CapabilitySpec, capability_count> capability_schema_v2{
@@ -68,7 +71,22 @@ inline constexpr std::array<CapabilitySpec, capability_count> capability_schema_
CapabilitySpec{Unit::per_thousand, 1, 1000, false,
capability_bit(Capability::energy_conversion)},
CapabilitySpec{Unit::femtograms, 1, 1'000'000'000, true, 0},
CapabilitySpec{Unit::millikelvin, 1, 100'000, false, 0}};
CapabilitySpec{Unit::millikelvin, 1, 100'000, false, 0},
CapabilitySpec{Unit::per_thousand, 1, 0, false, 0}}; // Not in schemas 2-4.
// Schema 5 (ADR-0175): schema 2 plus photosynthesis, an efficiency per thousand that
// needs a membrane to hold its organelles.
inline constexpr std::array<CapabilitySpec, capability_count> capability_schema_v5{
CapabilitySpec{Unit::per_thousand, 1, 1000, true, 0},
CapabilitySpec{Unit::micrometres, 1, 10'000, true, 0},
CapabilitySpec{Unit::micrometres_per_second, 0, 2'000'000, false,
capability_bit(Capability::membrane)},
CapabilitySpec{Unit::femtograms_per_second, 0, 20'000'000, false,
capability_bit(Capability::membrane)},
CapabilitySpec{Unit::per_thousand, 1, 1000, false,
capability_bit(Capability::energy_conversion)},
CapabilitySpec{Unit::femtograms, 1, 1'000'000'000, true, 0},
CapabilitySpec{Unit::millikelvin, 1, 100'000, false, 0},
CapabilitySpec{Unit::per_thousand, 1, 1000, false, capability_bit(Capability::membrane)}};
// The current schema's table.
inline constexpr const auto& capability_schema = capability_schema_v2;
// Schema 1 rates are per tick of this quantum.
@@ -114,15 +132,18 @@ inline constexpr std::uint32_t genome_schema_v3 = 3;
// Schema 4 (rules 7, ADR-0137): schema 2's table and units; a mutation step is a tenth of
// the current value (at least 1), and an acquired capability starts at the founder's value.
inline constexpr std::uint32_t genome_schema_v4 = 4;
// Schema 5 (rules 11, ADR-0175): schema 4's steps with the photosynthesis capability.
inline constexpr std::uint32_t genome_schema_v5 = 5;
// The newest schema. Older records stay valid and are never rewritten (ADR-0099).
inline constexpr std::uint32_t genome_schema_version = genome_schema_v4;
// The capability table of a supported schema (1 to 4); nullptr otherwise.
inline constexpr std::uint32_t genome_schema_version = genome_schema_v5;
// The capability table of a supported schema (1 to 5); nullptr otherwise.
[[nodiscard]] constexpr const std::array<CapabilitySpec, capability_count>*
capability_schema_for(std::uint32_t schema) noexcept {
return schema == genome_schema_v1 ? &capability_schema_v1
: schema == genome_schema_v2 || schema == genome_schema_v3 || schema == genome_schema_v4
? &capability_schema_v2
: nullptr;
: schema == genome_schema_v5 ? &capability_schema_v5
: nullptr;
}
inline constexpr std::size_t max_parents = 2;
inline constexpr std::size_t max_genome_bytes = 256;
+2
View File
@@ -68,6 +68,8 @@ enum class MutationError : std::uint8_t {
development
};
inline constexpr std::size_t max_candidates = 8;
// ADR-0175 trial value: an acquired photosynthesis starts at 10 % efficiency.
inline constexpr std::uint32_t photosynthesis_acquired_start = 100;
[[nodiscard]] std::span<const MutationOperator> mutation_catalog() noexcept;
// Identical inputs always yield identical candidates, sorted by operator ID.