Gossamer Threaded Intelligence
Gossamer decides what agents do, and measures how well the collective did it. Where Leviathan supplies physics and communication cost, Gossamer supplies coordination: the primitives that turn a local view of peers into an acceleration, the tasks that define what “coordinated” means, the predictors that let an agent reason about a peer it can only see in the past, and the metrics that score all of it.
It is a Python library with NumPy underneath. It runs against Leviathan through an adapter, or standalone against its own lightweight simulator when a prototype does not need the C++ core.
Availability. Gossamer is proprietary and is not distributed. This page documents its structure and semantics. The algorithms it implements are drawn from the open literature and are described independently under Techniques and Foundations.
Why it exists
Comparing coordination algorithms fairly is harder than implementing any one of them. A comparison is only meaningful if every algorithm sees the same world under the same constraints and is scored by the same yardstick. In practice that yardstick does not exist: flocking papers report alignment, consensus papers report disagreement, coverage papers report cells visited, and nothing puts them on a single axis.
Gossamer’s central design commitment is one interface — the CoordinationPrimitive — behind which flocking, gossip consensus, density-modulated Boids, CRDT-intent propagation, a market mechanism, and a deliberately non-communicating reference all sit interchangeably, plus one scalar coordination quality that every task exposes. That is what makes the central finding of Phase Diagram of Coordination Under Delay sayable at all. The collapse is primitive-independent is a sentence you can only write if the primitives are genuinely swappable and the score is genuinely shared.
Coordination primitives
A primitive is an object that, given the positions and velocities its agent can currently see, returns an acceleration. It knows nothing about how stale that view is — staleness is imposed from outside, by the delay-coupled harness in Maneuver.Map. That separation is what lets delay be a controlled variable rather than a buried assumption.
The primitives available through the experiment runner:
no_comm ignores peers entirely. Its score is the delay-independent floor,
and every other primitive is interesting only insofar as it beats this one.
flocking is classical Boids —
weighted alignment, cohesion, and separation.
vicsek is a faithful constant-speed
Vicsek update, used to anchor the
simulator against a known external order–disorder transition before its
coordination numbers are trusted.
gossip is Laplacian average
consensus
over local exchanges.
dmb is density-modulated Boids, whose cohesion weight responds to locally
sensed density. tf_aco overlays a task-field
stigmergic term, and dmb_tf_aco
composes the two.
iccd propagates mission intent as a replicated data type over a contact
plan, with relay selection. periodic_broadcast, epidemic_flooding,
and mappo_relay are dispatch variants over the same substrate that swap the
relay-selection rule, providing that paper’s baselines.
hma allocates tasks through a hierarchical energy-aware
market
rather than a central planner.
levy, greedy, and mappo_weight are dispersal and exploration
baselines, the last driven by a learned weighting.
Dispatch is a registry mapping an algorithm name to an ordered list of handlers,
which is how a composite like dmb_tf_aco is expressed without a special case. A
stateless-friendly subset — flocking, no_comm, dmb, gossip — is also
exposed directly as CoordinationPrimitive classes. The stateful primitives,
CRDT-intent and the market, are driven through the runner’s seam instead: they
carry per-run replica and auction state the runner already owns, and maintaining
two copies of that orchestration would guarantee the copies diverge.
The internal bidding rule of the market, the modulation law of DMB, and ICCD’s bundle-prioritization rule are not published.
Tasks and coordination quality
A task defines an objective and exposes a normalized quality . Four ship: rendezvous (gather at a common point), consensus (agree on a value), formation_hold (attain and hold a relative geometry), and coverage_hold (occupy and hold a spatial distribution).
Each is scored against a peer-derived target — a quantity no isolated agent can compute alone. That is deliberate. It guarantees the task genuinely requires coordination, so a high score cannot be obtained by an agent that ignores its neighbours. The normalizers scale with the domain, which makes invariant to domain size, which is in turn why collapse curves at different swarm sizes coincide rather than merely running parallel.
coverage_hold carries a caveat: no current primitive achieves it. It is
collected, reported, and excluded from headline figures — rather than quietly
dropped.
Peer-state prediction
An agent whose view of its peers is stale by steps can act on the stale data or try to guess where those peers went. Gossamer’s predictors take a peer history and extrapolate forward by the delay horizon; the coordination primitive then acts on the estimate.
Constant-velocity extrapolation is exact on any constant-velocity trajectory and is the minimal anticipatory model. Linear fits a least-squares line over a recent window (default length 8). Kalman runs a per-agent constant-velocity Kalman filter over position and velocity per axis, re-filtering the window each step and rolling forward.
Predictions are scored against the realized state for calibration and never mutate ground truth. The empirical ranking — constant-velocity ≳ linear > Kalman > none — is the result of Anticipatory Coordination via Peer-State Prediction, and it is a result rather than an implementation detail: the Kalman filter’s process and measurement priors add variance that smooth, boundedly actuated trajectories never repay.
Eventually consistent state
Three separate parts of the stack need replicas that converge under partition without a central arbiter. Gossamer provides one abstraction for all of them: conflict-free replicated data types , composed.
The primitives are a last-writer-wins register for scalars ordered by timestamp; a grow-only counter and a positive-negative counter for scalars ordered by cause; an observed-remove set for membership by tag; and a vector clock for causal context. A composite assembles these into a product type. Because each primitive forms a join-semilattice under its merge, the finite product does too — so the composite inherits associativity, commutativity, idempotence, and convergence for free. The argument is made once and reused for mission intent, the stigmergic pheromone field, and the market’s depot inventory alike. One fix to the merge layer fixes all three.
Metrics
Swarm quality — cohesion, alignment, and separation, in consistent units.
Criticality — susceptibility, the Binder cumulant, velocity correlation and correlation length, branching ratio, and avalanche-size distribution. This is the instrument set for any claim that a system exhibits a phase transition rather than a steep slope.
Information flow — mutual information by histogram and by the Kraskov–Stögbauer–Grassberger nearest-neighbour estimator; pairwise transfer entropy ; and collective transfer entropy, which estimates directed information flow from the leave-one-out collective aggregate of a per-agent signal into that agent’s own future, averaged across agents.
That last metric replaced something that did not work, and the failure is instructive. Transfer entropy computed on a global scalar summary of a swarm comes out at approximately zero regardless of what the swarm is doing: the aggregation destroys precisely the directed dependency you are trying to detect. Conditioning per-agent recovers the signal, and it tracks communication delay cleanly.
Graph structure — adjacency and degree distribution over the interaction graph, algebraic connectivity, spectral gap, and clustering coefficient.
Determinism
Every stochastic entry point takes an explicit random generator or seed. There are no module-level global-random calls anywhere in the library. One seed produces byte-identical output, which is a precondition for the seed tree that Maneuver.Map records in each experiment’s provenance block.
Learning components
A graph substrate exposes an interaction graph and a message-passing policy interface, under which hand-crafted Boids and Laplacian consensus are also expressible as zero-parameter graph-neural-network layers. That is the point: a classical baseline and a learned MAPPO agent run behind the same interface, so a comparison between them is not confounded by a difference in plumbing.
A PyTorch toolkit supplies a parameter-shared centralized-training/decentralized-execution actor-critic, a learnable communication channel with bandwidth, latency, loss, and energy accounting, a reference MAPPO driver, and a domain-randomization wrapper. Torch is an optional dependency; nothing else in Gossamer requires it.
Related
Leviathan supplies the physics and communication cost model the primitives run inside. Maneuver.Map orchestrates sweeps and imposes the delay coupling. The scenario and baseline suite is documented at Arboria Swarm Benchmark.