Add M10.5b snapshot wiring: sessions, evo-server, client and probe
Foundation / checks (deploy) (push) Successful in 5s
Foundation / checks (ecs) (push) Successful in 1m54s
Foundation / checks (client) (push) Successful in 12m40s
Foundation / checks (network) (push) Successful in 11m27s
Foundation / checks (tsan) (push) Successful in 8m6s
Foundation / checks (checks) (push) Successful in 31m54s
Foundation / checks (postgres) (push) Successful in 40m43s
Foundation / server-image (push) Successful in 25s
Foundation / postgres-tools (push) Successful in 1m2s
Foundation / image (push) Successful in 2m32s

RegionSessions owns the replication server: interest and acks per session, a
host-set default interest, and per-tick snapshots sized to each connection's
datagram limit. evo-server builds each interest's view from the region's own
habitat sites (default: the first site, radius 7). RegionSessionClient assembles,
acknowledges and presents snapshots and can change its interest; the probe prints
them. Loopback and real-process evidence. ADR-0093.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
dingo
2026-10-06 10:47:47 -04:00
co-authored by Claude Opus 5.5
parent e640b6d3a3
commit 33e91458e7
15 changed files with 428 additions and 23 deletions
+24 -2
View File
@@ -8,6 +8,7 @@
#include "evo/network/dev_credentials.hpp"
#include "evo/network/session_grant.hpp"
#include "fixtures/server_process.hpp"
#include <algorithm>
#include <chrono>
#include <fcntl.h>
#include <functional>
@@ -219,6 +220,25 @@ void end_to_end() {
auto server = std::make_unique<Server>(s);
auto a = connect(s, *server, s.grant(alice, 1));
CHECK(established(*server, *a));
// Snapshots of the real region (ADR-0093): the default interest is the first habitat
// site with radius 7; every cell lies in one slice and one 15 x 15 square.
const auto first_tick = a->server_tick();
CHECK(until(*server, *a, [&] { return a->view() && !a->view()->environment.empty(); }));
const auto shown = a->environment();
CHECK(shown && !shown->cells().empty() && shown->cells().size() <= 225);
const auto [min_x, max_x] =
std::ranges::minmax(shown->cells(), {}, [](const auto& c) { return c.voxel.x; });
const auto [min_y, max_y] =
std::ranges::minmax(shown->cells(), {}, [](const auto& c) { return c.voxel.y; });
CHECK(max_x.voxel.x - min_x.voxel.x <= 14 && max_y.voxel.y - min_y.voxel.y <= 14);
CHECK(std::ranges::all_of(shown->cells(),
[&](const auto& c) { return c.voxel.z == shown->slice_z(); }));
CHECK(until(*server, *a, [&] { return a->server_tick() >= first_tick + 40; }));
std::printf("m10 snapshot report cells=%zu ticks=%llu chunks=%llu bytes=%llu\n",
shown->cells().size(),
static_cast<unsigned long long>(a->server_tick() - first_tick),
static_cast<unsigned long long>(a->snapshot_chunks()),
static_cast<unsigned long long>(a->snapshot_bytes()));
// Intentions: receipts, then the watermark.
// Datagrams may be refused until the QUIC datagram extension is negotiated: retry.
std::optional<std::uint64_t> sequence;
@@ -298,7 +318,8 @@ void end_to_end() {
"--intents", "3",
"--actions", "2",
"--action-base", "10",
"--query", "10"}};
"--query", "10",
"--snapshots", "3"}};
int code = -1;
for (const auto end = Clock::now() + 30s; Clock::now() < end && code < 0;) {
server->pump();
@@ -307,7 +328,8 @@ void end_to_end() {
code = p.wait_exit(10s);
}
CHECK(code == 0 && p.printed("welcome ") && p.printed("intention 1 0") &&
p.printed("outcome 10 1 ") && p.printed("outcome 11 1 "));
p.printed("outcome 10 1 ") && p.printed("outcome 11 1 ") && p.printed("snapshot ") &&
p.printed("snapshot-bytes "));
CHECK(!record(bob, 10).empty() && !record(bob, 11).empty());
server->child->signal(SIGTERM);
CHECK(server->child->wait_exit(30s) == 0);