Wire cellular playtest into engineering client
Foundation / checks (deploy) (push) Successful in 5s
Foundation / checks (checks) (push) Failing after 39s
Foundation / checks (postgres) (push) Canceled after 0s
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 (ecs) (push) Canceled after 42s
Foundation / checks (network) (push) Canceled after 12s
Foundation / checks (client) (push) Canceled after 52s
Foundation / checks (deploy) (push) Successful in 5s
Foundation / checks (checks) (push) Failing after 39s
Foundation / checks (postgres) (push) Canceled after 0s
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 (ecs) (push) Canceled after 42s
Foundation / checks (network) (push) Canceled after 12s
Foundation / checks (client) (push) Canceled after 52s
This commit is contained in:
@@ -20,6 +20,7 @@
|
||||
#include <optional>
|
||||
#include <string_view>
|
||||
#include <thread>
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
|
||||
namespace {
|
||||
@@ -32,7 +33,7 @@ constexpr std::uint32_t fixture_mask = (1U << 0) | (1U << 1) | (1U << 2) | (1U <
|
||||
constexpr unsigned frames_per_authority_tick = 60;
|
||||
// Frame composition: environment bound + organisms + 6 host rectangles (capture bar,
|
||||
// intention dot, 4-sided selection highlight). Text and panels are the toolkit overlay.
|
||||
constexpr std::size_t host_rectangles = 6;
|
||||
constexpr std::size_t host_rectangles = 6 + evo::network::max_cellular_perceived_patches;
|
||||
constexpr std::size_t organism_budget =
|
||||
evo::render::max_rectangles - evo::render::max_environment_rectangles - host_rectangles;
|
||||
// Local in-memory stand-in for authoritative region views until M9.7. It is never
|
||||
@@ -200,6 +201,18 @@ void marker_box(std::vector<evo::render::Rectangle>& out, double x, double y, bo
|
||||
: own ? evo::render::Color{250, 190, 40, 255}
|
||||
: evo::render::Color{90, 170, 250, 255}});
|
||||
}
|
||||
void patch_box(std::vector<evo::render::Rectangle>& out, double x, double y, bool stocked,
|
||||
bool selected, double width, double height) {
|
||||
const double half = selected ? 5 : 3;
|
||||
const double x0 = std::max(x - half, 0.0), y0 = std::max(y - half, 0.0);
|
||||
const double x1 = std::min(x + half, width), y1 = std::min(y + half, height);
|
||||
if (x1 > x0 && y1 > y0)
|
||||
out.push_back({static_cast<float>(x0), static_cast<float>(y0), static_cast<float>(x1 - x0),
|
||||
static_cast<float>(y1 - y0),
|
||||
selected ? evo::render::Color{250, 190, 40, 255}
|
||||
: stocked ? evo::render::Color{80, 220, 130, 255}
|
||||
: evo::render::Color{115, 125, 135, 255}});
|
||||
}
|
||||
void outline(std::vector<evo::render::Rectangle>& out, double l, double t, double r, double b,
|
||||
double width, double height) {
|
||||
const auto rect = [&](double x0, double y0, double x1, double y1) {
|
||||
@@ -237,6 +250,7 @@ int main(int argc, char** argv) try {
|
||||
evo::render::EnvironmentDisplay display;
|
||||
evo::client::ConnectForm form;
|
||||
bool connect_now = false;
|
||||
bool cellular_trial = false;
|
||||
for (int i = 1; i < argc; ++i) {
|
||||
const std::string_view arg{argv[i]};
|
||||
if (arg == "--version") { // Build identity for tester reports (ADR-0086).
|
||||
@@ -250,6 +264,8 @@ int main(int argc, char** argv) try {
|
||||
config.hidden = true;
|
||||
else if (arg == "--fixture")
|
||||
start_fixture = true;
|
||||
else if (arg == "--cellular")
|
||||
cellular_trial = true;
|
||||
else if (arg == "--connect" && i + 1 < argc) {
|
||||
form.endpoint = argv[++i];
|
||||
connect_now = true;
|
||||
@@ -294,7 +310,7 @@ int main(int argc, char** argv) try {
|
||||
std::fputs("usage: evo-client [--version] [--renderer NAME] [--hidden] "
|
||||
"[--frames 1..100000] [--size W,H]\n"
|
||||
" [--fixture | --connect HOST:PORT --server-name NAME "
|
||||
"--ca FILE --grants FILE]\n"
|
||||
"--ca FILE --grants FILE [--cellular]]\n"
|
||||
" [--layer water|nitrogen|...|heat|moisture]\n"
|
||||
" [--refresh-every 1..1000] [--pick X,Y] "
|
||||
"[--screenshot FILE.bmp --frames N]\n"
|
||||
@@ -304,7 +320,8 @@ int main(int argc, char** argv) try {
|
||||
return 2;
|
||||
}
|
||||
}
|
||||
if ((start_fixture && connect_now) || (!screenshot.empty() && frames == 0))
|
||||
if ((start_fixture && connect_now) || (start_fixture && cellular_trial) ||
|
||||
(!screenshot.empty() && frames == 0))
|
||||
return 2;
|
||||
// Launcher phase and remote session change together (fixture/live distinction).
|
||||
evo::client::SessionHost<evo::client_app::RemoteSession> host;
|
||||
@@ -318,6 +335,7 @@ int main(int argc, char** argv) try {
|
||||
evo::client::EnvironmentLayer environment;
|
||||
evo::client::OrganismLayer population;
|
||||
std::optional<std::uint64_t> disconnect_dialog;
|
||||
std::optional<std::pair<std::uint32_t, std::uint32_t>> cellular_feed_target;
|
||||
// Validates the form and opens a fresh session; errors stay in the launcher.
|
||||
const auto connect = [&](const evo::client::ConnectForm& f) {
|
||||
form_error.reset();
|
||||
@@ -330,7 +348,7 @@ int main(int argc, char** argv) try {
|
||||
form_error = material.error();
|
||||
return false;
|
||||
}
|
||||
auto opened = evo::client_app::RemoteSession::open(*material);
|
||||
auto opened = evo::client_app::RemoteSession::open(*material, cellular_trial);
|
||||
if (!opened) {
|
||||
form_error = evo::client::LaunchError::endpoint;
|
||||
return false;
|
||||
@@ -347,6 +365,7 @@ int main(int argc, char** argv) try {
|
||||
environment.reset();
|
||||
population.reset();
|
||||
selection.clear();
|
||||
cellular_feed_target.reset();
|
||||
host.enter_fixture(); // Ends any remote attempt: nothing runs behind the banner.
|
||||
return true;
|
||||
};
|
||||
@@ -413,6 +432,7 @@ int main(int argc, char** argv) try {
|
||||
view.launcher = &launcher;
|
||||
view.form_error = form_error;
|
||||
view.remote_available = evo::client_app::remote_available;
|
||||
view.cellular_trial = cellular_trial;
|
||||
view.environment = shown_environment();
|
||||
view.organisms = shown_organisms();
|
||||
view.selection = &selection;
|
||||
@@ -420,6 +440,8 @@ int main(int argc, char** argv) try {
|
||||
if (const auto* remote = host.session(); remote && view.mode == Mode::remote) {
|
||||
view.remote = remote->status();
|
||||
view.outcomes = &remote->outcomes();
|
||||
view.cellular_perception = remote->cellular_perception();
|
||||
view.cellular_feed_target = cellular_feed_target;
|
||||
}
|
||||
view.visible_organisms = drawn_organisms;
|
||||
view.bindings = &(*app)->bindings();
|
||||
@@ -445,11 +467,14 @@ int main(int argc, char** argv) try {
|
||||
// Panel actions from the previous rendered frame.
|
||||
if (actions.fixture && !enter_fixture())
|
||||
return 1;
|
||||
if (actions.cellular_trial)
|
||||
cellular_trial = *actions.cellular_trial;
|
||||
if ((actions.connect || actions.retry) && connect(buffers.form())) {
|
||||
selection.clear();
|
||||
}
|
||||
if (actions.cancel || actions.back) {
|
||||
host.cancel(); // Drops the connection; its unresolved outcomes are unknown.
|
||||
cellular_feed_target.reset();
|
||||
selection.clear();
|
||||
}
|
||||
if (actions.ask_disconnect && !disconnect_dialog)
|
||||
@@ -461,12 +486,19 @@ int main(int argc, char** argv) try {
|
||||
ui.close_dialog(*actions.confirm_dialog)) {
|
||||
disconnect_dialog.reset();
|
||||
host.cancel();
|
||||
cellular_feed_target.reset();
|
||||
selection.clear();
|
||||
}
|
||||
if (actions.cancel_dialog && ui.close_dialog(*actions.cancel_dialog))
|
||||
disconnect_dialog.reset();
|
||||
if (actions.dismiss_notice)
|
||||
static_cast<void>(ui.dismiss(*actions.dismiss_notice));
|
||||
if (actions.stop_feeding)
|
||||
cellular_feed_target.reset();
|
||||
if (actions.feed_patch)
|
||||
cellular_feed_target = actions.feed_patch;
|
||||
if (auto* remote = host.session(); remote && mode() == Mode::remote)
|
||||
remote->set_cellular_feed_target(cellular_trial ? cellular_feed_target : std::nullopt);
|
||||
controls.step(actions, **app, ui);
|
||||
actions = {};
|
||||
// The launcher and modal dialogs own input: no world movement or selection.
|
||||
@@ -551,10 +583,27 @@ int main(int argc, char** argv) try {
|
||||
return 1;
|
||||
drawn_organisms = static_cast<int>(report->drawn);
|
||||
const double width = state.logical_width, height = state.logical_height;
|
||||
if (const auto* remote = host.session(); remote && mode() == Mode::remote)
|
||||
if (const auto* remote = host.session(); remote && mode() == Mode::remote) {
|
||||
if (cellular_trial)
|
||||
if (const auto* perception = remote->cellular_perception())
|
||||
for (const auto& patch : perception->patches) {
|
||||
const auto at = camera->world_to_screen(
|
||||
{(static_cast<double>(patch.x_um) + 500) / 1000,
|
||||
(static_cast<double>(patch.y_um) + 500) / 1000});
|
||||
if (at)
|
||||
patch_box(boxes, at->x, at->y,
|
||||
patch.energy_pj != 0 ||
|
||||
std::ranges::any_of(patch.matter_fg,
|
||||
[](auto v) { return v != 0; }),
|
||||
cellular_feed_target &&
|
||||
cellular_feed_target->first == patch.x_um &&
|
||||
cellular_feed_target->second == patch.y_um,
|
||||
width, height);
|
||||
}
|
||||
for (const auto& m : remote->markers())
|
||||
if (const auto at = camera->world_to_screen({m.x_mm, m.y_mm}))
|
||||
marker_box(boxes, at->x, at->y, m.own, m.stale, m.ghost, width, height);
|
||||
}
|
||||
if (const auto* o = selection.organism(orgs)) {
|
||||
const auto b = evo::render::organism_bounds(*o, *camera);
|
||||
outline(boxes, b.left - 3, b.top - 3, b.right + 3, b.bottom + 3, width, height);
|
||||
|
||||
@@ -124,6 +124,9 @@ void launcher(const PanelView& v, FormBuffers& form, PanelActions& a) {
|
||||
ImGui::InputText("Server name", form.server_name.data(), form.server_name.size());
|
||||
ImGui::InputText("Dev CA file", form.authority.data(), form.authority.size());
|
||||
ImGui::InputText("Grant bundle file", form.grants.data(), form.grants.size());
|
||||
bool cellular_trial = v.cellular_trial;
|
||||
if (ImGui::Checkbox("Cellular trial (v8)", &cellular_trial))
|
||||
a.cellular_trial = cellular_trial;
|
||||
const bool start = phase == LaunchPhase::choosing && ImGui::Button("Connect", {px(160), 0});
|
||||
ImGui::EndDisabled();
|
||||
if (start)
|
||||
@@ -351,7 +354,7 @@ void controls(const PanelView& v, PanelActions& a) {
|
||||
ImGui::End();
|
||||
}
|
||||
|
||||
void session(const PanelView& v) {
|
||||
void session(const PanelView& v, PanelActions& a) {
|
||||
if (!v.remote)
|
||||
return;
|
||||
const auto& io = ImGui::GetIO();
|
||||
@@ -361,6 +364,8 @@ void session(const PanelView& v) {
|
||||
ImGui::SetNextWindowSize({px(360), 0}, when);
|
||||
ImGui::Begin("Session");
|
||||
const auto& s = *v.remote;
|
||||
if (s.cellular_trial)
|
||||
ImGui::TextColored(amber, "CELLULAR TRIAL - exploratory server-authoritative play");
|
||||
if (ImGui::BeginTable("status", 3, ImGuiTableFlags_SizingFixedFit)) {
|
||||
row("Connection", s.phase);
|
||||
row("Session / epoch", std::to_string(s.session) + " / " + std::to_string(s.epoch));
|
||||
@@ -393,6 +398,50 @@ void session(const PanelView& v) {
|
||||
}
|
||||
ImGui::EndTable();
|
||||
}
|
||||
if (s.cellular_trial) {
|
||||
ImGui::Separator();
|
||||
ImGui::TextUnformatted("Nearby food patches (server sensor view)");
|
||||
if (!s.cellular_action.empty())
|
||||
ImGui::TextWrapped("%s", s.cellular_action.c_str());
|
||||
if (!v.cellular_perception) {
|
||||
ImGui::TextDisabled("Waiting for the first cell view...");
|
||||
} else if (v.cellular_perception->life_identity == 0) {
|
||||
ImGui::TextColored(amber, "No living cell is currently bound to this account.");
|
||||
} else {
|
||||
ImGui::Text("Life %llu, tick %llu",
|
||||
static_cast<unsigned long long>(v.cellular_perception->life_identity),
|
||||
static_cast<unsigned long long>(v.cellular_perception->tick));
|
||||
ImGui::TextDisabled("Steer with movement keys. Feeding continues until stopped.");
|
||||
if (v.cellular_feed_target && ImGui::SmallButton("Stop feeding"))
|
||||
a.stop_feeding = true;
|
||||
if (ImGui::BeginChild("cellular-patches", {0, px(142)}, true)) {
|
||||
const auto& patches = v.cellular_perception->patches;
|
||||
if (patches.empty())
|
||||
ImGui::TextDisabled("No provisioned food within sensor range.");
|
||||
for (std::size_t i = 0; i < patches.size(); ++i) {
|
||||
const auto& patch = patches[i];
|
||||
ImGui::PushID(static_cast<int>(i));
|
||||
ImGui::Text("Patch (%u, %u) um", patch.x_um, patch.y_um);
|
||||
ImGui::TextWrapped("Energy %llu pJ | C %llu N %llu P %llu O %llu fg",
|
||||
static_cast<unsigned long long>(patch.energy_pj),
|
||||
static_cast<unsigned long long>(patch.matter_fg[0]),
|
||||
static_cast<unsigned long long>(patch.matter_fg[1]),
|
||||
static_cast<unsigned long long>(patch.matter_fg[2]),
|
||||
static_cast<unsigned long long>(patch.matter_fg[3]));
|
||||
const bool active = v.cellular_feed_target &&
|
||||
v.cellular_feed_target->first == patch.x_um &&
|
||||
v.cellular_feed_target->second == patch.y_um;
|
||||
if (active)
|
||||
ImGui::TextColored(green, "Feeding target");
|
||||
else if (ImGui::SmallButton("Feed this patch"))
|
||||
a.feed_patch = {patch.x_um, patch.y_um};
|
||||
ImGui::Separator();
|
||||
ImGui::PopID();
|
||||
}
|
||||
}
|
||||
ImGui::EndChild();
|
||||
}
|
||||
}
|
||||
disabled_wrapped("Intentions (newest first; this is the record, toasts expire):");
|
||||
if (v.outcomes &&
|
||||
ImGui::BeginTable("outcomes", 3, ImGuiTableFlags_RowBg | ImGuiTableFlags_SizingFixedFit)) {
|
||||
@@ -512,7 +561,7 @@ PanelActions draw_panels(const PanelView& view, FormBuffers& form,
|
||||
banner(view, actions);
|
||||
legend(view, display);
|
||||
inspector(view);
|
||||
session(view);
|
||||
session(view, actions);
|
||||
}
|
||||
controls(view, actions);
|
||||
notices(view, actions);
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
#include <array>
|
||||
#include <cstdint>
|
||||
#include <optional>
|
||||
#include <utility>
|
||||
|
||||
namespace evo::client_app {
|
||||
enum class Mode : std::uint8_t { launcher, fixture, remote };
|
||||
@@ -37,11 +38,14 @@ struct PanelView {
|
||||
const client::Launcher* launcher{};
|
||||
std::optional<client::LaunchError> form_error;
|
||||
bool remote_available{};
|
||||
bool cellular_trial{};
|
||||
const client::EnvironmentLayer* environment{};
|
||||
const client::OrganismLayer* organisms{};
|
||||
const client::Selection* selection{};
|
||||
const client::UiState* ui{};
|
||||
std::optional<RemoteStatus> remote;
|
||||
const network::CellularPerception* cellular_perception{};
|
||||
std::optional<std::pair<std::uint32_t, std::uint32_t>> cellular_feed_target;
|
||||
const client::OutcomeLog* outcomes{};
|
||||
int visible_organisms{-1}; // -1 when unknown.
|
||||
const client::Bindings* bindings{}; // In force (hints).
|
||||
@@ -56,6 +60,9 @@ struct PanelActions {
|
||||
bool open_controls{}, apply_controls{}, reset_controls{}, close_controls{}, cancel_capture{};
|
||||
std::optional<ControlSlot> capture_key;
|
||||
std::optional<client::Action> clear_secondary;
|
||||
std::optional<bool> cellular_trial;
|
||||
std::optional<std::pair<std::uint32_t, std::uint32_t>> feed_patch;
|
||||
bool stop_feeding{};
|
||||
};
|
||||
// Draws every panel for this frame. `display` may be changed by the layer selector.
|
||||
[[nodiscard]] PanelActions draw_panels(const PanelView& view, FormBuffers& form,
|
||||
|
||||
@@ -2,8 +2,9 @@
|
||||
// M10.5c remote dev session for the engineering client (ADR-0093, over ADR-0091/0092
|
||||
// sessions). Without EVO_CLIENT_NETWORK (a build without EVO_BUILD_QUIC) remote mode is
|
||||
// unavailable. The client only presents copies of replicated snapshots and sends bounded
|
||||
// intentions; it never predicts. Grant bytes stay inside the session: each is handed to
|
||||
// one connection and wiped here; never printed, shown or persisted.
|
||||
// bounded intentions; the explicit cellular trial uses reliable v8 actions and its
|
||||
// owner-filtered perception view. Grant bytes stay inside the session: each is handed to one
|
||||
// connection and wiped here; never printed, shown or persisted.
|
||||
//
|
||||
// One connection per grant (ADR-0089): a lost or closed session reconnects with the next
|
||||
// grant of the bundle after a growing pause (2 s .. 30 s, reset by a Welcome), which keeps
|
||||
@@ -37,6 +38,7 @@
|
||||
#include "evo/client/organism_view.hpp"
|
||||
#include "evo/client/outcome_log.hpp"
|
||||
#include "evo/client/ui_state.hpp"
|
||||
#include "evo/network/session_protocol.hpp"
|
||||
#include <chrono>
|
||||
#include <cstdint>
|
||||
#include <cstdio>
|
||||
@@ -87,6 +89,8 @@ struct RemoteStatus {
|
||||
std::uint64_t region{}, handoffs{}; // Region of the current session; crossings followed.
|
||||
std::size_t stale_markers{};
|
||||
bool stale_view{};
|
||||
bool cellular_trial{};
|
||||
std::string cellular_action;
|
||||
};
|
||||
// A probe marker to draw: the own one predicted and smoothed, others as replicated.
|
||||
struct MarkerView {
|
||||
@@ -106,7 +110,8 @@ class RemoteSession {
|
||||
static constexpr std::uint16_t interest_radius = 7;
|
||||
static constexpr double silent_ticks = 3; // Extrapolation limit (2) plus the clock's lead.
|
||||
// Looks the endpoint up once (blocking); nothing connects until the first step().
|
||||
static std::optional<RemoteSession> open(const client::ConnectMaterial& m) {
|
||||
static std::optional<RemoteSession> open(const client::ConnectMaterial& m,
|
||||
bool cellular_trial = false) {
|
||||
const auto address = network::quic::resolve_ipv4(m.endpoint.host);
|
||||
if (!address || m.grants.empty())
|
||||
return std::nullopt;
|
||||
@@ -117,6 +122,15 @@ class RemoteSession {
|
||||
session.transport_.authority_pem = m.authority_pem;
|
||||
session.transport_.authority_pem_file = m.authority_path;
|
||||
session.grants_ = m.grants;
|
||||
session.cellular_trial_ = cellular_trial;
|
||||
session.next_cellular_action_id_ = static_cast<std::uint64_t>(
|
||||
std::chrono::system_clock::now().time_since_epoch().count());
|
||||
if (session.next_cellular_action_id_ == 0)
|
||||
session.next_cellular_action_id_ = 1;
|
||||
session.cellular_birth_request_id_ =
|
||||
session.next_cellular_action_id_ ^ 0x43454C4C00000000ULL;
|
||||
if (session.cellular_birth_request_id_ == 0)
|
||||
session.cellular_birth_request_id_ = 1;
|
||||
session.used_.assign(m.grants.size(), false);
|
||||
// The endpoint typed in the launcher is the first grant's region.
|
||||
session.target_region_ = grant_region(m.grants.front());
|
||||
@@ -144,6 +158,20 @@ class RemoteSession {
|
||||
[[nodiscard]] const client::OutcomeLog& outcomes() const noexcept {
|
||||
return log_;
|
||||
}
|
||||
[[nodiscard]] bool cellular_trial() const noexcept {
|
||||
return cellular_trial_;
|
||||
}
|
||||
[[nodiscard]] const network::CellularPerception* cellular_perception() const noexcept {
|
||||
return client_ && client_->cellular_perception() ? &*client_->cellular_perception()
|
||||
: nullptr;
|
||||
}
|
||||
[[nodiscard]] const std::string& cellular_action_status() const noexcept {
|
||||
return cellular_action_status_;
|
||||
}
|
||||
void set_cellular_feed_target(
|
||||
std::optional<std::pair<std::uint32_t, std::uint32_t>> target) noexcept {
|
||||
cellular_feed_target_ = target;
|
||||
}
|
||||
[[nodiscard]] RemoteStatus status() const {
|
||||
RemoteStatus s;
|
||||
const bool live = client_ && client_->state() == client::RegionSessionState::established;
|
||||
@@ -186,6 +214,8 @@ class RemoteSession {
|
||||
s.interpolation_delay = interpolator_.delay();
|
||||
s.remote_render_tick = render_tick_;
|
||||
s.stale_view = stale_view_;
|
||||
s.cellular_trial = cellular_trial_;
|
||||
s.cellular_action = cellular_action_status_;
|
||||
s.inputs_pending = predictor_.pending();
|
||||
s.lead = lead_.lead();
|
||||
s.corrections = predictor_.stats().corrections;
|
||||
@@ -249,13 +279,20 @@ class RemoteSession {
|
||||
return;
|
||||
if (!established_)
|
||||
welcome(ui, launcher);
|
||||
if (cellular_trial_ && !cellular_birth_request_sent_ &&
|
||||
c.request_primitive_life(cellular_birth_request_id_))
|
||||
cellular_birth_request_sent_ = true;
|
||||
server_tick_ = c.server_tick();
|
||||
if (server_tick_ != observed_tick_) { // Every watermark or snapshot tick times the clock.
|
||||
observed_tick_ = server_tick_;
|
||||
clock_.observe(server_tick_, now);
|
||||
}
|
||||
send(intention);
|
||||
if (cellular_trial_)
|
||||
send_cellular(intention);
|
||||
else
|
||||
send(intention);
|
||||
receipts();
|
||||
cellular_results();
|
||||
snapshot();
|
||||
present(now);
|
||||
if (wanted_ && (!sent_interest_ || *wanted_ != *sent_interest_) &&
|
||||
@@ -325,6 +362,8 @@ class RemoteSession {
|
||||
if (now < retry_at_)
|
||||
return false;
|
||||
client::RegionSessionClientConfig config;
|
||||
if (cellular_trial_)
|
||||
config.protocol_version = network::session_protocol_v8;
|
||||
const auto route = routes_.find(target_region_);
|
||||
config.transport = route != routes_.end() ? route->second : transport_;
|
||||
if (ticket_) { // A handoff: the ticket replaces a grant, once.
|
||||
@@ -430,6 +469,62 @@ class RemoteSession {
|
||||
pending_.pop_front(); // Its log entry was evicted with it.
|
||||
pending_.push_back({*sequence, entry, tick, false});
|
||||
}
|
||||
void send_cellular(const client::Intention& intention) {
|
||||
if (server_tick_ == 0 || (sent_tick_ && server_tick_ <= *sent_tick_) ||
|
||||
next_cellular_action_id_ == 0)
|
||||
return;
|
||||
const auto tick = server_tick_ + 1;
|
||||
if (!client_->send_cellular_action(next_cellular_action_id_, tick, intention.move_x,
|
||||
intention.move_y, cellular_feed_target_))
|
||||
return;
|
||||
++next_cellular_action_id_;
|
||||
sent_tick_ = server_tick_;
|
||||
}
|
||||
void cellular_results() {
|
||||
for (const auto& receipt : client_->take_primitive_life_receipts())
|
||||
if (receipt.status != network::AdmitStatus::admitted)
|
||||
cellular_action_status_ =
|
||||
"Birth request refused (status " +
|
||||
std::to_string(static_cast<unsigned>(receipt.status)) + ")";
|
||||
for (const auto& outcome : client_->take_primitive_life_outcomes()) {
|
||||
switch (outcome.result) {
|
||||
case network::PrimitiveLifeResult::born:
|
||||
cellular_action_status_ = "Cell founded (life " +
|
||||
std::to_string(outcome.life_identity) + ")";
|
||||
break;
|
||||
case network::PrimitiveLifeResult::insufficient_funding:
|
||||
cellular_action_status_ = "Birth refused: nursery funding is insufficient";
|
||||
break;
|
||||
case network::PrimitiveLifeResult::no_placement:
|
||||
cellular_action_status_ = "Birth refused: no open spawn site";
|
||||
break;
|
||||
case network::PrimitiveLifeResult::existing_life:
|
||||
cellular_action_status_ = "Existing cell is already bound to this account";
|
||||
break;
|
||||
case network::PrimitiveLifeResult::cancelled:
|
||||
cellular_action_status_ = "Birth request cancelled";
|
||||
break;
|
||||
case network::PrimitiveLifeResult::pending:
|
||||
cellular_action_status_ = "Cell birth is being committed";
|
||||
break;
|
||||
case network::PrimitiveLifeResult::unknown:
|
||||
cellular_action_status_ = "Birth outcome is unknown; retrying exact request";
|
||||
cellular_birth_request_sent_ = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
for (const auto& receipt : client_->take_action_receipts())
|
||||
if (receipt.status != network::AdmitStatus::admitted)
|
||||
cellular_action_status_ = "Action refused (status " +
|
||||
std::to_string(static_cast<unsigned>(receipt.status)) +
|
||||
")";
|
||||
for (const auto& outcome : client_->take_action_outcomes())
|
||||
cellular_action_status_ =
|
||||
outcome.result == network::ActionResult::committed
|
||||
? "Action committed at tick " + std::to_string(outcome.tick)
|
||||
: "Action ended without commit (result " +
|
||||
std::to_string(static_cast<unsigned>(outcome.result)) + ")";
|
||||
}
|
||||
void receipts() {
|
||||
for (const auto& r : client_->take_intention_receipts()) {
|
||||
const auto it = std::find_if(pending_.begin(), pending_.end(), [&](const Pending& p) {
|
||||
@@ -577,6 +672,7 @@ class RemoteSession {
|
||||
stale_view_ = was_established || stale_view_;
|
||||
predictor_.reset(); // The marker ended with its session.
|
||||
client_.reset();
|
||||
cellular_birth_request_sent_ = false;
|
||||
established_ = false;
|
||||
// A crossing or a redirect is followed at once: no grant for a handoff, no pause.
|
||||
if (reason == SessionCloseReason::handed_off && offer && learn_route(offer->destination)) {
|
||||
@@ -668,12 +764,17 @@ class RemoteSession {
|
||||
bool stale_view_{};
|
||||
bool established_{}, welcomed_{}, exhausted_{};
|
||||
bool following_{true}; // The camera follows the server's (default) view.
|
||||
bool cellular_trial_{};
|
||||
std::uint64_t next_cellular_action_id_{}, cellular_birth_request_id_{};
|
||||
std::optional<std::pair<std::uint32_t, std::uint32_t>> cellular_feed_target_;
|
||||
std::string cellular_action_status_;
|
||||
bool cellular_birth_request_sent_{};
|
||||
};
|
||||
#else
|
||||
inline constexpr bool remote_available = false;
|
||||
class RemoteSession {
|
||||
public:
|
||||
static std::optional<RemoteSession> open(const client::ConnectMaterial&) {
|
||||
static std::optional<RemoteSession> open(const client::ConnectMaterial&, bool = false) {
|
||||
return std::nullopt;
|
||||
}
|
||||
[[nodiscard]] const client::EnvironmentLayer& environment() const noexcept {
|
||||
@@ -685,8 +786,21 @@ class RemoteSession {
|
||||
[[nodiscard]] const client::OutcomeLog& outcomes() const noexcept {
|
||||
return log_;
|
||||
}
|
||||
[[nodiscard]] bool cellular_trial() const noexcept {
|
||||
return false;
|
||||
}
|
||||
[[nodiscard]] const network::CellularPerception* cellular_perception() const noexcept {
|
||||
return nullptr;
|
||||
}
|
||||
[[nodiscard]] const std::string& cellular_action_status() const noexcept {
|
||||
return action_status_;
|
||||
}
|
||||
void set_cellular_feed_target(
|
||||
std::optional<std::pair<std::uint32_t, std::uint32_t>>) noexcept {}
|
||||
[[nodiscard]] RemoteStatus status() const {
|
||||
return {"unavailable in this build"};
|
||||
RemoteStatus status;
|
||||
status.phase = "unavailable in this build";
|
||||
return status;
|
||||
}
|
||||
[[nodiscard]] std::optional<client::WorldPoint> take_recentre() {
|
||||
return std::nullopt;
|
||||
@@ -699,6 +813,7 @@ class RemoteSession {
|
||||
client::Launcher&) {}
|
||||
|
||||
private:
|
||||
std::string action_status_;
|
||||
client::EnvironmentLayer environment_;
|
||||
client::OrganismLayer organisms_;
|
||||
client::OutcomeLog log_;
|
||||
|
||||
@@ -364,6 +364,12 @@ scoped change before starting the next segment.
|
||||
that boundary. The profile bridge now projects authoritative `CellularLives`
|
||||
perception each tick. Client controls and an on-screen view remain to be
|
||||
connected before the hands-on probe.
|
||||
- 11.3e-3: the engineering client now has a cellular-trial connect mode, sends
|
||||
reliable v8 movement/feed actions at the authoritative tick rate, requests
|
||||
the first allocator-backed life with a stable retry ID, draws visible patch
|
||||
markers, lists their exact perceived stocks, and lets the player select a
|
||||
patch for continuous feeding. The client build and live-region probe still
|
||||
need verification before this segment can be called playable.
|
||||
|
||||
## Exit boundary
|
||||
|
||||
|
||||
@@ -6499,3 +6499,20 @@ checking; `git diff --check` passes. The POSIX-only `evo-server/main.cpp` cannot
|
||||
be compiled in this Windows environment (`poll.h` is unavailable). The
|
||||
configured Windows CMake QUIC target previously stalled without output and was
|
||||
interrupted. Linux/PostgreSQL CI and a real region run remain pending.
|
||||
|
||||
## 2026-10-11 — M11.3e v8 cellular playtest client
|
||||
|
||||
The client adds a cellular-trial connect mode, stable first-life request ID,
|
||||
one reliable movement/feed action per server tick, owner perception display,
|
||||
patch selection/continuous feeding, visible patch markers, and action/birth
|
||||
status. Focused strict-warning GCC 13.2 syntax checks pass for the client app
|
||||
with and without `EVO_CLIENT_NETWORK`, `panels.cpp`, and
|
||||
`tests/client_remote_session.cpp`. The v8 protocol unit executable passes.
|
||||
`git diff --check` passes.
|
||||
|
||||
The configured `client-network` CMake build emitted only its initial glob-check
|
||||
line and was interrupted after roughly 50 seconds with no compiler or target
|
||||
result. It is not counted as a build or test result. QUIC runtime, PostgreSQL
|
||||
CI, and the real-region player probe remain pending. `clang-format` is not
|
||||
installed in this Windows environment, so formatting validation is also
|
||||
pending in CI.
|
||||
|
||||
@@ -344,6 +344,9 @@ void refusals(Region& r) {
|
||||
bad.endpoint.host = "no-such-host.invalid";
|
||||
CHECK(!RemoteSession::open(bad));
|
||||
CHECK(!RemoteSession::open(r.material({})));
|
||||
auto cellular = RemoteSession::open(r.material({r.grant(account(6), 1)}), true);
|
||||
CHECK(cellular && cellular->cellular_trial() && cellular->status().cellular_trial &&
|
||||
cellular->cellular_perception() == nullptr);
|
||||
}
|
||||
// M10.8c-2 (ADR-0096): the client follows a crossing into the next region with the offer's
|
||||
// ticket (no grant, no pause, the view kept) and follows a redirect at login, picking grants
|
||||
|
||||
Reference in New Issue
Block a user