Expand description
for adaptive deadlines on every wire round-trip.
Sits alongside super::address_book::AddressBook in the
framework. Keyed by crate::ids::NodeSiteId so a single
physical peer hosting two logical sites (a fast ping handler +
an async GPU compute handler) keeps independent EMAs.
§Hierarchical fallback for estimate_budget_ns
When the engine needs a deadline for a Send to a site, it walks these tiers in order, stopping at the first warm hit:
- Per-edge stats for
(site, chain_id, hop_index)- exact match in this chain context. - Per-site aggregate Jacobson - every round-trip to this site feeds this EMA regardless of context.
- Per-chain prior - refines the global “what’s typical for the kind of topology this chain represents” based on any peer that’s carried chain traffic before.
- Global prior - every round-trip in the runtime feeds this EMA with a small learning rate.
- Static
NodeConfig.per_hop_budget_nsfallback.
§Reverse-path piggyback (consumed in Phase 3e-iii)
On response landing, the runtime parses [EdgeRttReport] entries
that downstream sites attached. Each report becomes a
reported_outgoing entry on the caller’s per-site
RttTrackerEntry so multi-hop chain budgets can compose from
one address-book entry per direct neighbor.
Structs§
- Chain
Context - Optional chain context the engine threads to
RttTracker::estimate_budget_nsandRttTracker::observe_round_trip. - EdgeKey
- Per-(chain, hop) refinement key.
- PhiAccrual
State - φ-accrual failure detector per direct chain neighbor. Heartbeat = any wire round-trip in the last window; rising φ indicates the peer is silent relative to its historical inter-arrival distribution.
- RttEma
- Jacobson/Karels RTT EMA: smoothed SRTT + smoothed RTTVAR with sample-count tracking. Mirrors RFC 6298 §2 with α = 1/8 and β = 1/4.
- RttTracker
- Runtime-owned RTT tracker.
- RttTracker
Entry - One AddressBook-side entry per logical site we’ve ever observed.
Enums§
- PhiState
- Discrete states tracked by
RttTracker::scan_phifor each per-site φ-accrual detector. - PhiTransition
- State transitions surfaced by
RttTracker::scan_phi. The engine maps each entry onto a buscrate::bus::InfraEvent::PeerSuspect/crate::bus::InfraEvent::PeerDown/crate::bus::InfraEvent::PeerLive.
Functions§
- chain_
id_ from_ targets - Hash the compiler’s
ai.bytesandbrains.wire.chain_targetsmetadata value into a stableChainId. The hash is FNV-1a over the raw bytes - fast, no allocations, deterministic across runs.
Type Aliases§
- ChainId
- Stable identifier for a chain. Hash of the compiler-stamped
comma-separated
chain_targetsstring. Producer and consumer derive the same value from the same string, so cross-site EMAs align without exchanging the raw chain composition.