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:
@@ -1,5 +1,6 @@
|
||||
#include "cellular_scene.hpp"
|
||||
#include "controls_flow.hpp"
|
||||
#include "evo/biology/cellular_currents.hpp"
|
||||
#include "evo/client/application.hpp"
|
||||
#include "evo/client/auth.hpp"
|
||||
#include "evo/client/launcher.hpp"
|
||||
@@ -486,6 +487,12 @@ int main(int argc, char** argv) try {
|
||||
std::uint64_t seen_deposit_tick{};
|
||||
std::vector<LivePop> live_pops;
|
||||
bool scene_active = false;
|
||||
// Rules 12: the region's current field, regenerated when the perceived configuration
|
||||
// changes, and when the latest perception arrived (to carry bubbles between views).
|
||||
std::optional<evo::network::CellularCurrentsView> flow_config;
|
||||
std::optional<evo::biology::CellularFlowField> flow_field;
|
||||
std::uint64_t flow_view_tick = 0;
|
||||
auto flow_view_at = std::chrono::steady_clock::now();
|
||||
evo::client_app::PanelActions actions;
|
||||
(*app)->set_overlay([&] {
|
||||
evo::client_app::PanelView view;
|
||||
@@ -741,6 +748,7 @@ int main(int argc, char** argv) try {
|
||||
const double width = state.logical_width, height = state.logical_height;
|
||||
// 2026-10-16 microscope view: in cellular play, patches and cells are a scene the
|
||||
// panels draw as granules and living cells; elsewhere organisms stay rectangles.
|
||||
scene.flows.clear();
|
||||
scene.patches.clear();
|
||||
scene.deposits.clear();
|
||||
scene.pops.clear();
|
||||
@@ -773,9 +781,65 @@ int main(int argc, char** argv) try {
|
||||
p.seed = (static_cast<std::uint64_t>(patch.x_um) << 32U) ^ patch.y_um;
|
||||
scene.patches.push_back(p);
|
||||
}
|
||||
// Rules 12 (v13): the current field from the perceived configuration, drawn
|
||||
// as streaks across the visible area.
|
||||
if (const auto* perception = cellular_remote->cellular_perception()) {
|
||||
if (perception->currents != flow_config) {
|
||||
flow_config = perception->currents;
|
||||
flow_field.reset();
|
||||
if (const auto& c = flow_config) {
|
||||
auto made = evo::biology::CellularFlowField::generate(
|
||||
{c->seed, c->width_um, c->height_um, c->pitch_um, c->min_count,
|
||||
c->max_count, c->min_route_width_um, c->max_route_width_um,
|
||||
c->min_speed_um_per_s, c->max_speed_um_per_s});
|
||||
if (made)
|
||||
flow_field = std::move(*made);
|
||||
}
|
||||
}
|
||||
if (perception->tick != flow_view_tick) {
|
||||
flow_view_tick = perception->tick;
|
||||
flow_view_at = std::chrono::steady_clock::now();
|
||||
}
|
||||
const auto low = camera->screen_to_world({0, height});
|
||||
const auto high = camera->screen_to_world({width, 0});
|
||||
if (flow_field && low && high) {
|
||||
const double span = std::max(high->x_mm - low->x_mm, 0.001);
|
||||
const double step = std::max(0.4, span / 28);
|
||||
for (double y = std::floor(low->y_mm / step) * step; y <= high->y_mm;
|
||||
y += step)
|
||||
for (double x = std::floor(low->x_mm / step) * step; x <= high->x_mm;
|
||||
x += step) {
|
||||
const auto flow =
|
||||
flow_field->sample(static_cast<std::int64_t>(x * 1000),
|
||||
static_cast<std::int64_t>(y * 1000));
|
||||
const double vx = flow.x_q10 / 1024.0, vy = flow.y_q10 / 1024.0;
|
||||
const double speed = std::hypot(vx, vy);
|
||||
if (speed < 5)
|
||||
continue;
|
||||
const auto at = camera->world_to_screen({x, y});
|
||||
const auto ahead = camera->world_to_screen(
|
||||
{x + vx / speed * 0.001, y + vy / speed * 0.001});
|
||||
if (!at || !ahead)
|
||||
continue;
|
||||
const double sx = ahead->x - at->x, sy = ahead->y - at->y;
|
||||
const double norm = std::max(std::hypot(sx, sy), 1e-9);
|
||||
const double length = 8 + std::min(speed, 300.0) / 300 * 16;
|
||||
scene.flows.push_back(
|
||||
{static_cast<float>(at->x), static_cast<float>(at->y),
|
||||
static_cast<float>(sx / norm * length),
|
||||
static_cast<float>(sy / norm * length),
|
||||
static_cast<float>(std::min(speed, 300.0) / 300),
|
||||
static_cast<std::uint32_t>(x * 7919 + y * 104729)});
|
||||
}
|
||||
}
|
||||
}
|
||||
// ADR-0136 (v11): pools and bubbles, centred; a vanished bubble pops.
|
||||
if (const auto* perception = cellular_remote->cellular_perception()) {
|
||||
const auto now_pop = std::chrono::steady_clock::now();
|
||||
// Rules 12: carry each bubble along its perceived velocity since the view
|
||||
// arrived (at most 300 ms), so moving food glides between perceptions.
|
||||
const double carried = std::min(
|
||||
std::chrono::duration<double>(now_pop - flow_view_at).count(), 0.3);
|
||||
std::map<std::uint32_t, SeenDeposit> current;
|
||||
for (const auto& d : perception->deposits) {
|
||||
std::array<std::uint64_t, 5> stock{};
|
||||
@@ -785,13 +849,13 @@ int main(int argc, char** argv) try {
|
||||
for (std::size_t c = 1; c < stock.size(); ++c)
|
||||
if (stock.at(c) > stock.at(static_cast<std::size_t>(channel)))
|
||||
channel = static_cast<int>(c);
|
||||
const SeenDeposit seen{static_cast<double>(d.x_um) / 1000,
|
||||
static_cast<double>(d.y_um) / 1000,
|
||||
d.radius_um,
|
||||
channel,
|
||||
d.drained,
|
||||
d.shape ==
|
||||
evo::network::CellularDepositShape::bubble};
|
||||
const SeenDeposit seen{
|
||||
(static_cast<double>(d.x_um) + d.velocity_x_um_s * carried) / 1000,
|
||||
(static_cast<double>(d.y_um) + d.velocity_y_um_s * carried) / 1000,
|
||||
d.radius_um,
|
||||
channel,
|
||||
d.drained,
|
||||
d.shape == evo::network::CellularDepositShape::bubble};
|
||||
current[d.id] = seen;
|
||||
const auto centre = camera->world_to_screen({seen.x_mm, seen.y_mm});
|
||||
const auto edge = camera->world_to_screen(
|
||||
|
||||
Reference in New Issue
Block a user