M10.9d: watermark coalescing, budgets v2, evo-load action ids
Foundation / checks (client) (push) Successful in 14s
Foundation / checks (checks) (push) Successful in 16s
Foundation / checks (deploy) (push) Successful in 15s
Foundation / checks (network) (push) Successful in 18s
Foundation / checks (postgres) (push) Successful in 1m34s
Foundation / checks (ecs) (push) Successful in 1m53s
Foundation / checks (tsan) (push) Successful in 5m44s
Foundation / server-image (push) Successful in 1m0s
Foundation / postgres-tools (push) Successful in 1m38s
Foundation / image (push) Successful in 2m34s

- IntentLimits::watermark_coalesce (evo-server: every 4, coalesce 4); ADR-0092 amendment.
- m10 load-report splits poll/replicate and commit-tick/other-tick maxima.
- Budgets v2: work p95 <= 25 ms over all ticks, commit ticks <= 50 ms (ADR-0097);
  moving the commit off the tick is a recorded follow-up.
- evo-load: time-based action ids, duplicate_actions, receipts before outcomes;
  drill ramps at 500 ms and judges by v2.
- Refresh the dev session window.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
dingo
2026-10-08 18:00:41 -04:00
co-authored by Claude Opus 5.5
parent 1b266b12be
commit 9f9a93d4c8
12 changed files with 267 additions and 28 deletions
+44 -4
View File
@@ -104,6 +104,10 @@ template <typename Host> class M10Bridge {
if (issuer.size() != network::grant_public_key_bytes)
return fail("error m10-issuer");
server::RegionSessionsConfig config;
// ADR-0097: snapshots carry the server tick every tick (10.5), so watermarks need not;
// an advancing one goes out at most every 4 ticks (cumulative, nothing is lost).
config.intents.watermark_every = 4;
config.intents.watermark_coalesce = 4;
config.transport.listen_address = o.listen.substr(0, colon);
config.transport.port = port;
config.transport.certificate_pem_file = o.certificate;
@@ -206,6 +210,8 @@ template <typename Host> class M10Bridge {
const server::HostFacts facts{s.ready && s.phase == server::HostPhase::running, s.epoch,
s.simulated_tick};
sessions_->poll(facts, wall_seconds(), std::chrono::steady_clock::now());
const auto polled = std::chrono::steady_clock::now();
poll_busy_ += polled - started;
if (facts.ready && host.state() != nullptr && s.simulated_tick > replicated_) {
replicated_ = s.simulated_tick;
const auto& c = community(*host.state());
@@ -219,6 +225,7 @@ template <typename Host> class M10Bridge {
sessions_->replicate(s.simulated_tick, [&](const network::SessionInterest& in) {
return source(c, in, s.simulated_tick);
});
replicate_busy_ += std::chrono::steady_clock::now() - polled;
}
if (facts.ready)
for (const auto& a : sessions_->carry(s.simulated_tick + m10_carry_ahead_ticks)) {
@@ -286,9 +293,24 @@ template <typename Host> class M10Bridge {
static_cast<std::int64_t>(ticks));
};
const auto per_tick = per(busy_), session_per_tick = per(session_busy_);
busy_ = session_busy_ = {};
const auto poll_per_tick = per(poll_busy_), replicate_per_tick = per(replicate_busy_);
busy_ = session_busy_ = poll_busy_ = replicate_busy_ = {};
// A tick whose host step committed a batch (ADR-0097 measures those separately).
const bool commit = s.commits != commits_seen_;
commits_seen_ = s.commits;
if (!counted)
return;
interval_.ticks += ticks;
interval_.poll_us += poll_per_tick * ticks;
interval_.replicate_us += replicate_per_tick * ticks;
interval_.poll_max_us = std::max(interval_.poll_max_us, poll_per_tick);
interval_.replicate_max_us = std::max(interval_.replicate_max_us, replicate_per_tick);
if (commit) {
++interval_.commit_ticks;
interval_.commit_max_us = std::max(interval_.commit_max_us, per_tick);
} else {
interval_.other_max_us = std::max(interval_.other_max_us, per_tick);
}
const auto now_us =
static_cast<std::uint64_t>(std::chrono::duration_cast<std::chrono::microseconds>(
std::chrono::steady_clock::now().time_since_epoch())
@@ -311,15 +333,28 @@ template <typename Host> class M10Bridge {
return;
reported_us_ = now_us;
const auto& load = governor_.state();
const auto ticks = std::max<std::uint64_t>(interval_.ticks, 1);
// Since the last report: commit ticks (host committed a batch) apart from the others,
// and the session layer split into poll (transport, control, intents) and replicate.
std::printf("m10 load-report sessions=%zu p95_us=%llu p99_us=%llu max_us=%llu "
"session_p95_us=%llu session_p99_us=%llu refusing=%d shed=%u tick_debt=%llu\n",
"session_p95_us=%llu session_p99_us=%llu refusing=%d shed=%u tick_debt=%llu "
"commit_ticks=%llu commit_max_us=%llu other_max_us=%llu poll_avg_us=%llu "
"poll_max_us=%llu replicate_avg_us=%llu replicate_max_us=%llu\n",
sessions_->sessions(), static_cast<unsigned long long>(load.p95_us),
static_cast<unsigned long long>(load.p99_us),
static_cast<unsigned long long>(load.max_us),
static_cast<unsigned long long>(load.session_p95_us),
static_cast<unsigned long long>(load.session_p99_us),
governed_ && load.refusing ? 1 : 0, governed_ ? load.shed : 0U,
static_cast<unsigned long long>(s.tick_debt));
static_cast<unsigned long long>(s.tick_debt),
static_cast<unsigned long long>(interval_.commit_ticks),
static_cast<unsigned long long>(interval_.commit_max_us),
static_cast<unsigned long long>(interval_.other_max_us),
static_cast<unsigned long long>(interval_.poll_us / ticks),
static_cast<unsigned long long>(interval_.poll_max_us),
static_cast<unsigned long long>(interval_.replicate_us / ticks),
static_cast<unsigned long long>(interval_.replicate_max_us));
interval_ = {};
}
static const processes::EnvironmentalCommunity&
community(const processes::EnvironmentalCommunity& c) {
@@ -467,7 +502,12 @@ template <typename Host> class M10Bridge {
server::LoadGovernor governor_{*server::LoadGovernor::create({})};
bool governed_{true};
std::uint64_t reported_us_{};
std::chrono::nanoseconds busy_{}, session_busy_{};
std::chrono::nanoseconds busy_{}, session_busy_{}, poll_busy_{}, replicate_busy_{};
std::uint64_t commits_seen_{};
struct Interval { // Since the last load-report.
std::uint64_t ticks{}, poll_us{}, replicate_us{}, poll_max_us{}, replicate_max_us{},
commit_ticks{}, commit_max_us{}, other_max_us{};
} interval_;
std::uint64_t measured_tick_{};
std::unique_ptr<server::PostgresProbeLedger> probes_; // Handoff mode only.
std::unique_ptr<server::PostgresHandoffLedger> handoff_; // Handoff mode only.