feat(cellular): seed dev wildlife and tune budding playtests
Foundation / checks (client) (push) Successful in 5s
Foundation / checks (checks) (push) Successful in 5s
Foundation / checks (ecs) (push) Successful in 4s
Foundation / checks (postgres) (push) Successful in 4s
Foundation / checks (network) (push) Successful in 5s
Foundation / checks (tsan) (push) Successful in 4s
Foundation / checks (deploy) (push) Successful in 4m27s
Foundation / postgres-tools (push) Successful in 30s
Foundation / server-image (push) Successful in 4m16s
Foundation / image (push) Successful in 4m54s
Foundation / checks (client) (push) Successful in 5s
Foundation / checks (checks) (push) Successful in 5s
Foundation / checks (ecs) (push) Successful in 4s
Foundation / checks (postgres) (push) Successful in 4s
Foundation / checks (network) (push) Successful in 5s
Foundation / checks (tsan) (push) Successful in 4s
Foundation / checks (deploy) (push) Successful in 4m27s
Foundation / postgres-tools (push) Successful in 30s
Foundation / server-image (push) Successful in 4m16s
Foundation / image (push) Successful in 4m54s
This commit is contained in:
@@ -31,6 +31,8 @@
|
||||
// --current-seed N (default: derived from the --commit bytes). cellular-v10 (rules 13,
|
||||
// ADR-0179) is cellular-v9 followed by the revamp upgrade: it also requires
|
||||
// --revamp-tuning FILE (the Git revamp tuning file).
|
||||
// A nonzero playtest.starting_wildlife_cells (ADR-0180) additionally requires
|
||||
// --playtest-wildlife-first-id N: an audited unused range below --life-allocator-start.
|
||||
// primitive-v1 and cellular-v1/v2/v3 accept --life-allocator-start N
|
||||
// (ADR-0123): the world's life-identity allocator is created once at the operator-audited
|
||||
// start N; a later run leaves it untouched and refuses one that is below N.
|
||||
@@ -134,6 +136,7 @@ struct Options {
|
||||
std::optional<biology::CellularTuning> tuning; // Parsed from tuning_path.
|
||||
std::optional<std::string> revamp_tuning_path; // cellular-v10
|
||||
std::optional<biology::CellularRevampTuning> revamp_tuning; // Parsed from it.
|
||||
std::optional<std::uint64_t> playtest_wildlife_first_id; // Audited DEV-only reserved range.
|
||||
std::optional<std::uint64_t> life_allocator_start;
|
||||
std::optional<persistence::Sha256Digest> build;
|
||||
bool retain_build{};
|
||||
@@ -365,7 +368,11 @@ std::optional<Options> parse(int argc, char** argv) {
|
||||
o.cellular_mixed = cellular_motes(value);
|
||||
else if (o.command == "provision" && flag == "--revamp-tuning" && !value.empty())
|
||||
o.revamp_tuning_path = std::string{value};
|
||||
else if (o.command == "provision" && flag == "--light-pj" && n && *n > 0)
|
||||
else if (o.command == "provision" && flag == "--playtest-wildlife-first-id") {
|
||||
o.playtest_wildlife_first_id = number(value);
|
||||
if (!o.playtest_wildlife_first_id || *o.playtest_wildlife_first_id == 0)
|
||||
return std::nullopt;
|
||||
} else if (o.command == "provision" && flag == "--light-pj" && n && *n > 0)
|
||||
o.light_pj = n;
|
||||
else if (o.command == "provision" && flag == "--tuning" && !value.empty())
|
||||
o.tuning_path = std::string{value};
|
||||
@@ -480,6 +487,13 @@ std::optional<Options> parse(int argc, char** argv) {
|
||||
return std::nullopt;
|
||||
}
|
||||
o.revamp_tuning = *parsed;
|
||||
const auto count = parsed->playtest_starting_wildlife_cells;
|
||||
if (count != 0 && (!o.playtest_wildlife_first_id || !o.life_allocator_start ||
|
||||
*o.playtest_wildlife_first_id == 0 ||
|
||||
*o.playtest_wildlife_first_id >= *o.life_allocator_start ||
|
||||
static_cast<std::uint64_t>(count) >
|
||||
*o.life_allocator_start - *o.playtest_wildlife_first_id))
|
||||
return std::nullopt;
|
||||
}
|
||||
if (o.tuning_path) {
|
||||
std::ifstream file(*o.tuning_path, std::ios::binary);
|
||||
@@ -534,6 +548,8 @@ std::optional<Options> parse(int argc, char** argv) {
|
||||
return std::nullopt; // The development opening has no lives to allocate.
|
||||
}
|
||||
}
|
||||
if (o.playtest_wildlife_first_id && o.opening != "cellular-v10")
|
||||
return std::nullopt;
|
||||
if (!complete(o.source) || (needs_builds && o.retained.empty()) ||
|
||||
(clone && !complete(o.target)))
|
||||
return std::nullopt;
|
||||
@@ -657,6 +673,10 @@ int finish_photosynthesis_opening(const Options& o, persistence::Postgres& db,
|
||||
const std::optional<server::CellularLiquidRules>& liquid,
|
||||
const std::optional<server::CellularRevampRules>& revamp) {
|
||||
const auto& key = o.source.key;
|
||||
std::uint32_t wildlife_count{};
|
||||
if (o.revamp_tuning)
|
||||
wildlife_count =
|
||||
static_cast<std::uint32_t>(o.revamp_tuning->playtest_starting_wildlife_cells);
|
||||
const auto target = revamp ? persistence::cellular_v15_versions
|
||||
: liquid ? persistence::cellular_v14_versions
|
||||
: persistence::cellular_v13_versions;
|
||||
@@ -744,8 +764,9 @@ int finish_photosynthesis_opening(const Options& o, persistence::Postgres& db,
|
||||
upgraded = persistence::migrate_cellular_liquid_profile(db, store, *lease, *head, id,
|
||||
build, *liquid, timeout);
|
||||
else if (versions == persistence::cellular_v14_versions && liquid && revamp)
|
||||
upgraded = persistence::migrate_cellular_revamp_profile(db, store, *lease, *head, id,
|
||||
build, *revamp, timeout);
|
||||
upgraded = persistence::migrate_cellular_revamp_profile(
|
||||
db, store, *lease, *head, id, build, *revamp, timeout, {}, wildlife_count,
|
||||
wildlife_count == 0 ? 0 : o.playtest_wildlife_first_id.value_or(0));
|
||||
else
|
||||
return finish(4);
|
||||
if (!upgraded) {
|
||||
|
||||
Reference in New Issue
Block a user