M11.1: genome schema 2 with per-second rates (ADR-0099, segment 2)
Foundation / checks (deploy) (push) Successful in 3m32s
Foundation / checks (ecs) (push) Successful in 1m56s
Foundation / checks (client) (push) Successful in 12m56s
Foundation / checks (network) (push) Successful in 13m46s
Foundation / checks (tsan) (push) Successful in 7m59s
Foundation / checks (checks) (push) Successful in 33m36s
Foundation / checks (postgres) (push) Successful in 45m30s
Foundation / postgres-tools (push) Successful in 20s
Foundation / server-image (push) Successful in 25s
Foundation / image (push) Successful in 2m36s

Movement and ingestion are stored per second in schema 2 (ranges x20). Schema 1 records
stay valid, are never rewritten, and read as exactly x20 via Genome::per_second; drafts
default to schema 1 so existing literals keep their meaning. Development version 1
converts genome rates at its own 50 ms quantum (round down), so phenotypes are
unchanged. Mutation keeps the parent's schema and step; the lineage archive header names
exactly the highest schema held (all-schema-1 archives keep their bytes); the
development-v1 opening names schema 1. No golden changed; two tests that used 2 as an
unknown schema now use the next one. Refresh the dev session window.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
dingo
2026-10-09 13:16:55 -04:00
co-authored by Claude Opus 5.5
parent a4c6181540
commit 17fe23e5f0
17 changed files with 385 additions and 56 deletions
+25
View File
@@ -117,6 +117,30 @@ void capability_prerequisites() {
CHECK(with->maintenance == without->maintenance);
}
// ADR-0099: development version 1 reads genome rates per second at its 50 ms quantum.
// A schema 1 genome and its exact schema 2 translation develop identically, and a schema
// 2 rate that is not a whole number per tick rounds down (a capacity).
void schema_v2_rates_develop_identically() {
auto old = draft();
old.capabilities.push_back({Capability::movement, 250, 0});
old.capabilities.push_back({Capability::ingestion, 120'000, 0});
auto now = old;
now.schema_version = genome_schema_version;
now.capabilities[3].parameter = 5'000; // 250 per tick, per second.
now.capabilities[4].parameter = 2'400'000; // 120000 per tick, per second.
for (const std::uint32_t realized : {250U, 500U, 1000U}) {
const auto a = derive_phenotype(build(old), {realized, 0}, temperate);
const auto b = derive_phenotype(build(now), {realized, 0}, temperate);
CHECK(a && b && *a == *b);
const auto pa = plan_development(build(old), {realized, 0}, temperate);
const auto pb = plan_development(build(now), {realized, 0}, temperate);
CHECK(pa && pb && *pa == *pb);
}
now.capabilities[3].parameter = 5'019; // 250.95 per tick.
const auto rounded = derive_phenotype(build(now), {1000, 0}, temperate);
CHECK(rounded && rounded->movement_speed == 250);
}
void thermal_shortfall_is_reported_not_enforced() {
auto source = draft();
source.capabilities.push_back({Capability::thermal_tolerance, 5'000, 0});
@@ -272,6 +296,7 @@ int main() try {
damage_is_not_genome();
identical_inputs_give_identical_phenotypes();
capability_prerequisites();
schema_v2_rates_develop_identically();
thermal_shortfall_is_reported_not_enforced();
rule_versions_and_invalid_growth();
availability_bounds_do_not_wrap();