Record cellular births in replay traces
Foundation / checks (deploy) (push) Successful in 6s
Foundation / checks (checks) (push) Failing after 39s
Foundation / checks (ecs) (push) Successful in 2m0s
Foundation / checks (postgres) (push) Failing after 52s
Foundation / checks (tsan) (push) Failing after 33s
Foundation / checks (network) (push) Failing after 3m4s
Foundation / checks (client) (push) Failing after 4m22s
Foundation / postgres-tools (push) Skipped
Foundation / server-image (push) Skipped
Foundation / image (push) Skipped

This commit is contained in:
dingo
2026-10-11 00:28:49 -04:00
parent 81866a6897
commit b4fe9e7628
13 changed files with 296 additions and 21 deletions
@@ -21,6 +21,14 @@ struct CellularBatchHeader {
struct CellularTickIntents {
// One intention for each life alive at the start of this tick, sorted by life_id.
std::vector<CellularLifeIntent> lives;
// Owner-authorized births are sorted by (account, request). Biology and
// placement are derived during replay after the existing-life step.
struct Birth {
LifeAccount account{};
std::uint64_t request{}, generation{}, identity{};
friend bool operator==(const Birth&, const Birth&) = default;
};
std::vector<Birth> births;
friend bool operator==(const CellularTickIntents&, const CellularTickIntents&) = default;
};
struct CellularBatch {
@@ -35,14 +43,17 @@ struct CellularActionRecord {
friend bool operator==(const CellularActionRecord&, const CellularActionRecord&) = default;
};
inline constexpr std::uint32_t cellular_batch_format = 1;
inline constexpr std::uint32_t cellular_batch_format = 2;
inline constexpr std::uint32_t cellular_batch_legacy_format = 1;
inline constexpr std::size_t cellular_batch_header_bytes = 112;
inline constexpr std::size_t cellular_batch_tick_header_bytes = 4;
inline constexpr std::size_t cellular_batch_tick_header_bytes = 8;
inline constexpr std::size_t cellular_batch_intent_bytes = 24;
inline constexpr std::size_t cellular_batch_birth_bytes = 40;
inline constexpr std::size_t max_cellular_batch_ticks = 64;
inline constexpr std::size_t max_cellular_batch_bytes = cellular_batch_header_bytes +
max_cellular_batch_ticks * (cellular_batch_tick_header_bytes +
biology::max_cellular_tick_lives * cellular_batch_intent_bytes);
biology::max_cellular_tick_lives *
(cellular_batch_intent_bytes + cellular_batch_birth_bytes));
enum class CellularBatchError : std::uint8_t { format, version, scope, state };
inline constexpr std::size_t cellular_action_record_bytes = 48;
inline constexpr std::size_t max_cellular_action_records = 1'024;