feat: durable liquid regions (bundle 14, schema 58), cellular-v9 and session v13
Foundation / checks (checks) (push) Successful in 5s
Foundation / checks (client) (push) Successful in 5s
Foundation / checks (ecs) (push) Successful in 4s
Foundation / checks (network) (push) Successful in 4s
Foundation / checks (postgres) (push) Successful in 4s
Foundation / checks (tsan) (push) Successful in 5s
Foundation / checks (deploy) (push) Successful in 4m25s
Foundation / postgres-tools (push) Successful in 1m12s
Foundation / server-image (push) Successful in 4m20s
Foundation / image (push) Successful in 4m54s
Foundation / checks (checks) (push) Successful in 5s
Foundation / checks (client) (push) Successful in 5s
Foundation / checks (ecs) (push) Successful in 4s
Foundation / checks (network) (push) Successful in 4s
Foundation / checks (postgres) (push) Successful in 4s
Foundation / checks (tsan) (push) Successful in 5s
Foundation / checks (deploy) (push) Successful in 4m25s
Foundation / postgres-tools (push) Successful in 1m12s
Foundation / server-image (push) Successful in 4m20s
Foundation / image (push) Successful in 4m54s
ADR-0178. Bundle 14 (rules 12 on owner format 10) is admitted by schema 58 through parser-local normalization to bundle 13, with an exact fenced 13 -> 14 upgrade whose only input, the liquid rules, recovery reads from the target. Schema 58 also widens the canonical action input: byte 13 bit 0 is brake. evo-world-clone gains the cellular-v9 opening: cellular-v8 followed by the liquid upgrade from --tuning FILE (region size must match) and an optional --current-seed; resumable and idempotent at bundle 14. Session v13 adds the owner's velocity, heading and the region's current configuration to its perception, each deposit's world velocity, and a brake on cellular actions; older sessions keep their layouts. A rules-12 server lists every pool and the nearest 256 moving bubbles. The client speaks v13, brakes on Space (rebindable; older controls files take the default), draws currents as drifting streaks and carries bubbles along their velocities between perceptions. Tests: protocol v13 round trips and refusals, action-input brake, controls files, and a PostgreSQL cellular-v9 provisioning test whose player is born, swims and brakes through the live host. Full local PostgreSQL qualification, the Linux debug suite and the Windows client suite pass. Refreshes the DEV session window. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -41,19 +41,28 @@ inline constexpr std::uint16_t session_protocol_v11 = 11;
|
||||
// v12 (ADR-0176) is v11 plus the owner's captured light and visible producers in its
|
||||
// perception, and the photosynthesis capability (7) in mutation offers.
|
||||
inline constexpr std::uint16_t session_protocol_v12 = 12;
|
||||
// v10, v11 and v12 share every cellular message but the perception's contents.
|
||||
// v13 (rules 12, ADR-0177) is v12 plus liquid motion: the owner's velocity and heading and the
|
||||
// region's current configuration in its perception, each deposit's world velocity, and a brake
|
||||
// flag on cellular actions.
|
||||
inline constexpr std::uint16_t session_protocol_v13 = 13;
|
||||
// v10 to v13 share every cellular message but the perception's contents and v13's brake.
|
||||
[[nodiscard]] constexpr bool cellular_v10_family(std::uint16_t version) noexcept {
|
||||
return version == session_protocol_v10 || version == session_protocol_v11 ||
|
||||
version == session_protocol_v12;
|
||||
version == session_protocol_v12 || version == session_protocol_v13;
|
||||
}
|
||||
// Versions whose perception lists pools and bubbles (ADR-0136) instead of square patches.
|
||||
[[nodiscard]] constexpr bool cellular_deposit_version(std::uint16_t version) noexcept {
|
||||
return version == session_protocol_v11 || version == session_protocol_v12;
|
||||
return version == session_protocol_v11 || version == session_protocol_v12 ||
|
||||
version == session_protocol_v13;
|
||||
}
|
||||
// Versions that carry captured light and producers (ADR-0176).
|
||||
[[nodiscard]] constexpr bool cellular_light_version(std::uint16_t version) noexcept {
|
||||
return version == session_protocol_v12 || version == session_protocol_v13;
|
||||
}
|
||||
// The highest capability a version's mutation offers may name.
|
||||
[[nodiscard]] constexpr std::uint8_t
|
||||
cellular_offer_capability_limit(std::uint16_t version) noexcept {
|
||||
return version == session_protocol_v12 ? 7 : 6;
|
||||
return cellular_light_version(version) ? 7 : 6;
|
||||
}
|
||||
inline constexpr std::size_t max_cellular_perceived_patches = 256;
|
||||
inline constexpr std::size_t max_cellular_perceived_deposits = 512;
|
||||
@@ -197,7 +206,8 @@ struct CellularActionInput {
|
||||
bool has_intake_target{};
|
||||
std::uint32_t intake_x_um{}, intake_y_um{};
|
||||
bool engulf{};
|
||||
bool bud{}; // Kind 3 (ADR-0125): fund one wildlife bud, zero coordinates, v10 only.
|
||||
bool bud{}; // Kind 3 (ADR-0125): fund one wildlife bud, zero coordinates, v10 only.
|
||||
bool brake{}; // Byte 13 bit 0 (schema 58, rules 12): oppose relative velocity.
|
||||
friend bool operator==(const CellularActionInput&, const CellularActionInput&) = default;
|
||||
};
|
||||
inline constexpr std::size_t cellular_action_input_bytes = 24;
|
||||
@@ -212,6 +222,8 @@ struct CellularAction {
|
||||
bool engulf{};
|
||||
// v10 (ADR-0125): fund one wildlife bud; exclusive with intake and engulfment.
|
||||
bool bud{};
|
||||
// v13 (rules 12): brake against relative velocity instead of following the movement.
|
||||
bool brake{};
|
||||
friend bool operator==(const CellularAction&, const CellularAction&) = default;
|
||||
};
|
||||
// v10 reliable choice. The server binds these values to the authenticated account and
|
||||
@@ -270,6 +282,8 @@ struct CellularPerceivedDeposit {
|
||||
CellularDepositShape shape{CellularDepositShape::bubble};
|
||||
bool drained{};
|
||||
std::array<std::uint16_t, 5> amount_codes{}; // Energy, then C, N, P, other.
|
||||
// v13 only: world velocity in um/s (current plus induced drift); zero for pools.
|
||||
std::int16_t velocity_x_um_s{}, velocity_y_um_s{};
|
||||
friend bool operator==(const CellularPerceivedDeposit&,
|
||||
const CellularPerceivedDeposit&) = default;
|
||||
};
|
||||
@@ -339,6 +353,10 @@ struct CellularLifeDiagnostics {
|
||||
std::uint64_t bud_cost_energy_pj{};
|
||||
std::array<std::uint64_t, 4> bud_cost_matter_fg{};
|
||||
std::uint64_t light_pj{}; // v12 only (ADR-0176): light this cell captured last tick.
|
||||
// v13 only (rules 12): velocity relative to the liquid (Q10 um/s) and heading (65,536 per
|
||||
// turn), the authoritative motion state the client predictor reconciles against.
|
||||
std::int32_t velocity_x_q10{}, velocity_y_q10{};
|
||||
std::uint16_t heading{};
|
||||
friend bool operator==(const CellularLifeDiagnostics&,
|
||||
const CellularLifeDiagnostics&) = default;
|
||||
};
|
||||
@@ -350,6 +368,16 @@ struct CellularPerceivedProducer {
|
||||
friend bool operator==(const CellularPerceivedProducer&,
|
||||
const CellularPerceivedProducer&) = default;
|
||||
};
|
||||
// v13 (rules 12): the region's current configuration; the client regenerates the identical
|
||||
// flow field from it (biology::CellularFlowField).
|
||||
struct CellularCurrentsView {
|
||||
std::uint64_t seed{};
|
||||
std::uint32_t width_um{}, height_um{}, pitch_um{};
|
||||
std::uint32_t min_count{}, max_count{};
|
||||
std::uint32_t min_route_width_um{}, max_route_width_um{};
|
||||
std::uint32_t min_speed_um_per_s{}, max_speed_um_per_s{};
|
||||
friend bool operator==(const CellularCurrentsView&, const CellularCurrentsView&) = default;
|
||||
};
|
||||
struct CellularPerception {
|
||||
std::uint64_t tick{}, life_identity{}; // zero life plus no patches clears the view.
|
||||
std::vector<CellularPerceivedPatch> patches; // strictly ordered by (x_um, y_um).
|
||||
@@ -360,6 +388,8 @@ struct CellularPerception {
|
||||
std::vector<CellularPerceivedDeposit> deposits{};
|
||||
// v12 only: visible producers by ascending organism.
|
||||
std::vector<CellularPerceivedProducer> producers{};
|
||||
// v13 only, with an owner life in a liquid region.
|
||||
std::optional<CellularCurrentsView> currents{};
|
||||
friend bool operator==(const CellularPerception&, const CellularPerception&) = default;
|
||||
};
|
||||
struct IntentionReceipt {
|
||||
|
||||
Reference in New Issue
Block a user