M3.6 joins the M3 pieces: strategy_for derives a StrategyConfig from the metabolic budget, founders are pre-diverged variants admitted to the lineage archive, and evo-sim --ensemble runs them over a resource and temperature grid with every cell's seeds split in half and never merged. ADR-0029's driver is untouched, so the M2.6 fingerprint still holds. Nothing mutates during an episode, so NPC mutation stays open. Three things measurement found, kept rather than smoothed over. The report aggregates were default-initialized, leaving their scalar counters indeterminate. The resource level never reaches strategy derivation at all, so the header now says where each axis acts instead of claiming both shape a strategy. And the resource axis is not monotonic: a sweep peaks near 8000 femtograms and falls away on both sides, because only one consumer may bite a target per tick, so scarcity concentrates mass into individuals that reach the threshold while abundance spreads the same income too thin. The test asserts that an axis moves the outcome and never a direction; an earlier draft asserted a direction that held at two cells and the sweep disproves. Earning a birth at all required pinning the investment fraction to the schema floor, since intake scales with surface and investment with mass. That is a finding about the ADR-0031/0032 cost model, now the second priority in STATUS. Release 33/33, analysis, ASan 33/33 and clang-format all ran and passed here; no Clang or GCC compile happens on this host, so Linux CI is still the first result for this increment. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
72 lines
3.1 KiB
C++
72 lines
3.1 KiB
C++
#pragma once
|
|
|
|
#include "evo/biology/lineage.hpp"
|
|
#include "evo/biology/mutation.hpp"
|
|
#include "evo/processes/genome_strategy.hpp"
|
|
|
|
namespace evo::processes {
|
|
// One point of the gradient. The two axes reach a run by different routes, and
|
|
// neither route is the other's. Temperature enters the derivation: it sets the
|
|
// phenotype's thermal shortfall, which reaches the ecology through the scheduling
|
|
// rule below. Resource level does not enter the derivation at all. Founders are
|
|
// derived fully grown, so their construction transition is empty and
|
|
// `EnvironmentState::available` cannot move `intake_limit`, assimilation or
|
|
// reproduction investment; the resource level reaches a run only as the nutrient
|
|
// pool an episode starts with, which bounds producer growth.
|
|
struct GradientCell {
|
|
std::uint32_t temperature_millikelvin;
|
|
std::uint64_t nutrients;
|
|
auto operator<=>(const GradientCell&) const = default;
|
|
};
|
|
struct EnsembleConfig {
|
|
std::vector<GradientCell> gradient;
|
|
std::uint64_t seeds_per_cell;
|
|
std::uint64_t tick_limit;
|
|
std::uint32_t base_lifespan;
|
|
// Ticks of scheduled life lost per kelvin of thermal shortfall. This extends
|
|
// ADR-0029's lifespan rule, which is a harness scheduling device and not
|
|
// biology. It is not a mortality model and no contract knows about it.
|
|
std::uint32_t lifespan_lost_per_kelvin;
|
|
};
|
|
// What one strategy did in one half of one cell's seeds. Reported per half so an
|
|
// effect that only appears in one of them is visible as the artifact it is.
|
|
struct StrategyOutcome {
|
|
std::uint64_t genome;
|
|
std::uint64_t episodes;
|
|
std::uint64_t births;
|
|
std::uint64_t organisms;
|
|
std::uint64_t lived_ticks;
|
|
std::uint64_t thermal_shortfall; // summed over the episodes of this half
|
|
std::uint32_t scheduled_lifespan;
|
|
auto operator<=>(const StrategyOutcome&) const = default;
|
|
};
|
|
struct CellReport {
|
|
GradientCell cell;
|
|
std::vector<StrategyOutcome> first_half;
|
|
std::vector<StrategyOutcome> second_half;
|
|
std::uint64_t ticks;
|
|
std::uint64_t extinctions;
|
|
auto operator<=>(const CellReport&) const = default;
|
|
};
|
|
struct EnsembleReport {
|
|
std::vector<CellReport> cells;
|
|
std::uint64_t episodes;
|
|
std::uint64_t ticks;
|
|
std::uint64_t archived_genomes;
|
|
std::uint64_t archived_organisms;
|
|
std::uint64_t fingerprint;
|
|
auto operator<=>(const EnsembleReport&) const = default;
|
|
};
|
|
|
|
// Produces the founder strategies by diverging one ancestor before any episode
|
|
// runs. Nothing mutates during an episode: an organism diverging on its own is
|
|
// the NPC-mutation question that remains open.
|
|
[[nodiscard]] std::expected<std::vector<biology::Genome>, EcosystemError>
|
|
diverge_founders(const biology::Genome& ancestor, std::size_t wanted, std::uint64_t seed);
|
|
// Runs the grid, recording every birth and death in the archive as it happens, so
|
|
// the diversity a report carries comes from retained records.
|
|
[[nodiscard]] std::expected<EnsembleReport, EcosystemError>
|
|
run_ensemble(biology::LineageArchive& archive, std::span<const biology::Genome> founders,
|
|
const EcosystemConfig& base, const EnsembleConfig& plan, std::uint64_t seed);
|
|
} // namespace evo::processes
|