Close cellular starvation into corpse transfer
Foundation / checks (deploy) (push) Successful in 5s
Foundation / checks (checks) (push) Failing after 39s
Foundation / checks (ecs) (push) Successful in 1m53s
Foundation / checks (tsan) (push) Canceled after 0s
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 50s
Foundation / checks (client) (push) Canceled after 2m59s
Foundation / checks (network) (push) Canceled after 2m22s
Foundation / checks (deploy) (push) Successful in 5s
Foundation / checks (checks) (push) Failing after 39s
Foundation / checks (ecs) (push) Successful in 1m53s
Foundation / checks (tsan) (push) Canceled after 0s
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 50s
Foundation / checks (client) (push) Canceled after 2m59s
Foundation / checks (network) (push) Canceled after 2m22s
This commit is contained in:
@@ -17,8 +17,9 @@ struct CellularLifeStepInput {
|
||||
CellularPosition position;
|
||||
std::uint32_t extent_um{};
|
||||
CellularStepIntent intent;
|
||||
accounting::Inventory body; // Structural matter; energy must be zero.
|
||||
accounting::Inventory reserve;
|
||||
accounting::Inventory heat;
|
||||
accounting::Inventory heat; // Energy-only owner; matter channels must be zero.
|
||||
MetabolicBudget budget;
|
||||
auto operator<=>(const CellularLifeStepInput&) const = default;
|
||||
};
|
||||
@@ -32,11 +33,19 @@ struct CellularPatchStockUpdate {
|
||||
accounting::Inventory stock;
|
||||
auto operator<=>(const CellularPatchStockUpdate&) const = default;
|
||||
};
|
||||
struct CellularCorpseCandidate {
|
||||
std::uint64_t life_id{};
|
||||
CellularPosition position;
|
||||
accounting::Inventory inventory; // Body and reserve; accumulated heat is transferred out.
|
||||
auto operator<=>(const CellularCorpseCandidate&) const = default;
|
||||
};
|
||||
struct CellularRegionStepCandidate {
|
||||
std::uint64_t begin_tick{}, end_tick{};
|
||||
// Sorted by stable life_id, independent of connection or input order.
|
||||
std::vector<CellularLifeStepResult> lives;
|
||||
std::vector<CellularPatchStockUpdate> patches;
|
||||
std::vector<CellularCorpseCandidate> starved;
|
||||
accounting::Picojoules heat_released{};
|
||||
auto operator<=>(const CellularRegionStepCandidate&) const = default;
|
||||
};
|
||||
enum class CellularRegionStepError : std::uint8_t {
|
||||
@@ -44,13 +53,18 @@ enum class CellularRegionStepError : std::uint8_t {
|
||||
too_many_lives,
|
||||
invalid_life_id,
|
||||
duplicate_life_id,
|
||||
invalid_body,
|
||||
invalid_heat,
|
||||
overflow,
|
||||
life_step,
|
||||
habitat
|
||||
};
|
||||
|
||||
// Detached shared-habitat candidate. Same-tick claims resolve by ascending stable life id;
|
||||
// the first valid claimant spends from each patch's remaining per-channel stock. Any refused
|
||||
// life step rejects the complete candidate; the caller publishes nothing.
|
||||
// life step rejects the complete candidate; the caller publishes nothing. If maintenance
|
||||
// cannot be paid, the life dies in this tick: body and reserve move to one corpse candidate,
|
||||
// and its accumulated heat is reported separately for transfer to the world heat owner.
|
||||
[[nodiscard]] std::expected<CellularRegionStepCandidate, CellularRegionStepError>
|
||||
propose_cellular_region_step(std::uint64_t begin_tick, CellularArea area,
|
||||
std::span<const CellularLifeStepInput> lives,
|
||||
|
||||
Reference in New Issue
Block a user