Represent cellular profile migration manifests
Foundation / checks (deploy) (push) Successful in 5s
Foundation / checks (ecs) (push) Successful in 1m56s
Foundation / checks (checks) (push) Failing after 11m27s
Foundation / checks (network) (push) Failing after 9m31s
Foundation / checks (client) (push) Successful in 13m14s
Foundation / postgres-tools (push) Canceled after 0s
Foundation / server-image (push) Canceled after 0s
Foundation / image (push) Canceled after 0s
Foundation / checks (postgres) (push) Canceled after 1m57s
Foundation / checks (tsan) (push) Canceled after 1m49s

This commit is contained in:
dingo
2026-10-11 04:59:25 -04:00
parent d652291126
commit beffec40d7
5 changed files with 90 additions and 4 deletions
+8
View File
@@ -265,6 +265,14 @@ void retained_feeding_earns_a_persistent_mutation_offer() {
const auto saved = owner.snapshot();
const auto recovered = CellularLives::restore(saved, 93, 1, 1, owner.tick());
CHECK(recovered && (*recovered)->snapshot() == saved);
auto changed_seed = saved;
constexpr std::size_t v2_header_and_single_site = 220;
constexpr std::size_t v1_life_bytes = 168;
constexpr std::size_t mutation_seed_offset = 40;
changed_seed[v2_header_and_single_site + v1_life_bytes + mutation_seed_offset] ^= 1U;
refresh_checksum(changed_seed);
const auto noncanonical = CellularLives::restore(changed_seed, 93, 1, 1, owner.tick());
CHECK(!noncanonical && noncanonical.error() == CellularLivesError::noncanonical);
const auto replayed_offer = (*recovered)->mutation_offer(life_id);
CHECK(replayed_offer && replayed_offer == earned);
const std::array idle{CellularLifeIntent{life_id, {}}};
+25
View File
@@ -457,6 +457,31 @@ void cellular_profile() {
++bad_versions.cellular_versions.archive;
CHECK(!supported(bad_versions));
CHECK(!restore_cellular_payload(payload, bad_versions));
const auto legacy_genesis =
genesis_manifest(key, 9, filled<16>(0x10), 50000, build, payload.size(), filled<32>(0x11),
CheckpointProfile::cellular_lives_v1);
CHECK(legacy_genesis);
const auto legacy_head =
successor_manifest(*legacy_genesis, filled<32>(0x12), filled<16>(0x13), lease(), 1, build,
payload.size(), filled<32>(0x14), batch_for(1, 1));
CHECK(legacy_head && legacy_head->cellular_versions == cellular_v1_versions);
const auto migration =
cellular_profile_migration_manifest(*legacy_head, filled<32>(0x15), filled<16>(0x16),
lease(), build, payload.size(), filled<32>(0x17));
CHECK(migration && supported(*migration) && migration->sequence == 2 &&
migration->begin_tick == 1 && migration->end_tick == 1 &&
migration->cellular_versions == cellular_v2_versions &&
migration->batch == BatchDigests{});
const auto migration_bytes = encode_manifest(*migration);
CHECK(migration_bytes && decode_manifest(*migration_bytes) == *migration);
CHECK(!cellular_profile_migration_manifest(*migration, filled<32>(0x18), filled<16>(0x19),
lease(), build, payload.size(), filled<32>(0x20)));
const auto after_migration =
successor_manifest(*migration, filled<32>(0x21), filled<16>(0x22), lease(), 2, build,
payload.size(), filled<32>(0x23), batch_for(1, 1));
CHECK(after_migration && after_migration->cellular_versions == cellular_v2_versions);
auto bad_identity = *manifest;
bad_identity.key.region = 4;
const auto wrong_identity = restore_cellular_payload(payload, bad_identity);