21. Related work
Graph models and their algebra#
Bigraphs separate a place graph from a link graph and give both an algebra and reactive rewriting [247]. RG’s containment forest and incidences have the same split, and add typed ports, role-labelled ordered incidences, layers and attributes. Port graphs and their attributed hierarchical form [108, 133] contribute ports and strategic rewriting, but their edges are binary. Algebraic graph transformation [102, 159, 210] supplies the DPO theory behind Section 9. Attributed C-sets and their rewriting library [42, 280] supply both the formal presentation and a demonstration that it runs efficiently. TypeQL types polymorphic entity–relation–attribute data with reified relations [99], the closest database analogue of hyperedges with roles. Hypergraph categories, string-diagram rewriting, decorated and structured cospans, wiring diagrams and Span(Graph) [23, 35, 135, 136, 193, 315] supply the compositional semantics. We take theorems from these works rather than vocabulary. The contribution here is an engineered signature, an identity and transaction model, and a layered schema on which those theorems apply to production software.
Programming distributed systems#
Actors [7, 169], Erlang/OTP [20] and Orleans’ virtual actors [34] map to the exclusive profile, the mailbox channel and keyed realization; supervision with restarts is a runtime service that the design specifies but this paper does not show. Multiparty session types and choreographies [50, 173, 253] give deadlock freedom by construction; RG uses them as the semantics of Session. Multitier languages [72, 351], X10 [57], Ray [256], Service Weaver [143], Dapr [333], Temporal [329] and Hydro [59] each make one program span machines along one dimension: tiers, places, tasks, deployment, sidecar building blocks, durable steps or dataflow. RG is not a competing language for one tier. It is the substrate in which such programs are one projection. Placement, data, authority, evidence and change are first-class, and Hydro-style monotone analysis is Proposition 8.
Infrastructure from code and durable execution#
Infrastructure-from-code tools derive cloud resources from application code: Encore by static analysis, Wing through preflight and inflight code, Nitric through declared resources and, earlier, Klotho through annotations [107, 204, 267, 353]. Kotless did the same for Kotlin [328], and an empirical study compares language-based and library-based approaches [312]. Ballerina shows network interactions as sequence diagrams and generates deployment artefacts from code [350, 354]. RG’s deployment layer is generated in the same spirit (Section 13), but from a graph that also carries contracts, authority, labels and evidence. Temporal, Restate and DBOS make steps durable, the last by checkpointing workflows into Postgres [223, 299, 313, 329]; RG uses such engines as realizations of durable transitions. The term multi-runtime is also used for sidecar architectures in which a separate process supplies distributed primitives to business logic, as Dapr does [175, 333]. In this paper it means a system whose parts run on different runtimes, which such primitives can serve.
Architecture description languages#
ADLs model components, connectors and configurations explicitly [237]. Darwin composes components through provided and required services, with semantics in the -calculus [233]. Wright types connectors by role protocols and checks ports against roles [11]. Acme gives ADLs a common interchange core [141], and AADL models embedded systems with modes for reconfiguration [132]. Kramer and Magee’s quiescence is the classic condition for safe dynamic change [207]; region closure and draining play its part in Listing 6. RG differs in treating the architecture as the authoritative, executable graph of the running system rather than a description beside it, and in adding layers, data, authority and evidence.
UI, reactivity and code push#
React and the Compose runtime reconcile keyed trees [149, 242]; functional reactive programming and Elm [80, 106] give the dataflow view. Zipline and Redwood ship Kotlin/JS behind typed interfaces into native hosts [52, 53]. Dynamic software updating, version consistency and Erlang release handling [129, 170, 262], together with the update framework [305], define safe replacement. RG composes these with a closure computation and Corollary 5.
Infrastructure#
Borg and Kubernetes [47, 347] established typed desired state with level-triggered controllers, and custom resources, operators and admission webhooks made the schema and its checks open [335, 337, 338]. Their relations are labels and selectors, and they offer no multi-object transactions. Nix [98] and Unison [60] established content-addressed artefacts and code. Ptolemy’s heterogeneous models of computation [104], MLIR’s dialects [218] and typed structure editors [271, 296] inform profiles, open signatures and typed holes.
Game engines and visual programming#
Unreal Engine composes a C++ core through reflection and typed graph languages: Blueprints, which succeeded Kismet, and graphs for materials, animation and AI [110, 120, 124, 126, 128]. Its runtime adds data-oriented entities, replication with an authoritative server, and streaming of a partitioned world [119, 125, 127]. Unity offers visual scripting and a data-oriented entity system [341, 342], and Godot removed its visual scripting language in version 4 [225]. Visual dataflow languages are older: LabVIEW’s graphical language G shipped in 1986 [206], and surveys classify visual languages and trace dataflow programming from the 1970s [187, 260]. Underneath lie Kahn’s determinate networks of processes communicating through FIFO queues [191] and synchronous dataflow, whose fixed rates allow static schedules [220]. Section 4 explains what RG takes from the engines. Relative to dataflow languages, it adds placement across runtimes, families with different laws, and change as a first-class operation.
Statecharts, processes and agent graphs#
Statecharts [163], their standard execution in SCXML [28] and their implementation with actors in XState [320] supply the hierarchy, orthogonal regions and history of navigation, while the Transition family fires as a Petri net (Table 7). BPMN [270] and the workflow patterns [343] describe business processes; in RG a process diagram is a view of a durable Transition net whose gates are sessions. LangGraph makes the workflows of agents durable graphs with human interruption [217]. RG connects all of these to the system they act on: sessions, channels, grants and evidence.
Model-driven engineering and low code#
Model-driven engineering uses domain-specific models and generators that synthesise code from them [307], and low-code platforms share many of its ideas [93]. Architecture description languages, discussed above, model structure in the same spirit. RG differs in where the model lives: it is elaborated from the code and reconciled with the running system, so it does not drift from the code’s declarations or from what runs, although a body can still diverge from its contract. It also carries data, authority and evidence as well as structure.
Interface definition languages#
Protocol Buffers, OpenAPI and Smithy describe interfaces and generate code from them [15, 151, 274]. Protocol Buffers also states rules for evolving a schema: fields are identified by numbers that must never change. RG treats such definitions as sources of contracts. A contract’s fingerprint is a digest of its canonical form, and compatibility between two fingerprints is computed rather than declared (Section 6).
Dataflow systems and placement#
TensorFlow places the operations of a dataflow graph on devices, partitions the graph per device, and replaces every edge that crosses devices with send and receive operations, invisibly to the program [3]. RG partitions by place in the same way but makes the boundary visible: a Bind never crosses a place, and an edge that does is a Session or a Channel whose failures the program handles. FlumeJava defers evaluation, optimises the resulting plan and fuses stages before running it [55]. The Dataflow model treats data as unbounded and makes the trade-offs among correctness, latency and cost explicit [9]. Halide separates an algorithm from its schedule [285]. RG lifts these ideas from one data-parallel program to a system of many runtimes.
Compilers and whole-program optimisation#
Class hierarchy analysis binds dynamic calls statically when the whole program is known [88], and dynamic deoptimisation discards optimised code whose assumptions an edit has broken [172]. Partial evaluation specialises an interpreter to a program [188], which Truffle and Graal turn into fast language runtimes [355]. GraalVM Native Image initialises a closed world at build time [352], ThinLTO makes cross-module optimisation incremental through summaries [186], and profiles guide code layout [283]. Stream fusion, escape analysis and automatic batching of data fetches remove intermediate structures, copies and round trips [61, 77, 235]. R8 shrinks and optimises Android apps from their entry points [152], Dagger resolves injection at compile time [150], and Service Weaver chooses between local and remote calls at deployment [143]. RGL reuses these techniques (Section 10.7). Its contribution is a domain in which they are sound across runtimes: the elements of a release region admitted together on one host, whose facts admission guarantees.
Graph and analytical stores#
Property-graph query languages include Cypher [139] and the ISO standard GQL [176], and their foundations are surveyed in [17]. Columnar storage and vectorised execution made analytics over billions of rows interactive [36, 238, 322]; ClickHouse is a recent open-source example [308]. RG uses such stores as realizations of Stores and compiles traversals into their languages (Section 8.3).
Failures of distributed systems#
Studies of production failures locate where systems break: in error handling [362], upgrades [158, 365], partitions [13], partial and gray failures [174, 229], metastable states [39], configuration [326, 357], interactions between systems [327] and emergent behaviour [249]. Practice supplies the mitigations: idempotent interfaces, retries with budgets, logs instead of dual writes, staged schema change, tracing and live load tests [40, 131, 198, 284, 311, 345], and independent testing shows how often guarantees fail anyway [196]. Section 16 draws its twenty problems from this literature. What RG adds is one place where the mitigations are stated as types and rules and checked before activation.
Tools and agents#
Code property graphs merge syntax, control flow and data dependence for analysis [358]; the Language Server Protocol decouples editors from languages [245]; regression test selection, property-based testing, compositional static analysis and behaviour-preserving refactoring are mature [49, 62, 147, 273]. For agents, the interface between agent and computer matters [359], simple pipelines of localisation and repair compete with open-ended agents [356], graphs of the repository help [25, 276], long contexts are used unevenly [227], and people alternate between accelerating and exploring when they work with code models [27]. These tools and agents each work on one representation of one program. Section 19 places them on one graph of the whole system.
Code as data, incrementality and assurance#
CodeQL and Datalog [4, 21] index code after the fact. In RG the graph is elaborated from source and is authoritative for definitions. Adapton, differential dataflow, DBSP, build systems and incremental attribute grammars [46, 161, 236, 251, 297] make derived facts cheap to maintain. TLA at AWS, Alloy, P, IronFleet and FoundationDB’s simulation testing [92, 165, 178, 264, 366] are the industrial models for Section 15.
Networks and learning#
Multilayer and heterogeneous information networks [26, 197, 265, 323] provide the vocabulary and analyses (centrality for blast radius, community detection for proposing regions, percolation for failure domains) that RG can apply to systems. Message-passing networks and Transformers [29, 145, 344] motivate one primitive over typed incidences.
Systems by class#
The strongest tools for the classes of Section 17 each own one guarantee:
logs and stream processors own ordered, replayable data [51, 208];
ROS 2 owns typed robot computation graphs with quality-of-service profiles [231];
game servers own latency compensation [31];
agent loops and tool protocols own reasoning and tool calling [18, 361];
intercloud brokers own placement across providers [360];
neural simulators, model languages and co-simulation frameworks own the numerics of brain models [97, 142, 146, 171];
neurosymbolic languages own differentiable reasoning [224, 234].
RG treats each as a realization or a component profile and adds what none provides: the guarantees that must hold across tools.
Information flow and authority#
Lattice-based information flow [91] and decentralized labels [259] are the basis of RG’s labels (W11). Capability systems and relationship-based authorization [246, 277] inform Grant. For agents, CaMeL separates a privileged planner from a quarantined model that reads untrusted data and enforces policies at tool calls [89], and FIDES tracks confidentiality and integrity labels in the planner [74]. RG states the same separation as grants and labels over the whole system graph.
Edge platforms#
Cloudflare’s Durable Objects realize keyed single-writer places with co-located storage [64], and Orleans showed how such places become a programming model [34]. RG keeps the platform’s uniqueness and placement, and adds typed protocols, fencing at the external stores that check epochs, and the rest of the system around them.
Programming at scale#
Section 18 builds on four arguments: Brooks on coordination cost [41], Conway on structure following communication [71], Parnas on hiding decisions behind modules [279], and Lamport on specifying before building [215]. Benchmarks of agents on real repositories [185] and studies of assisted programming [282] motivate the scale hypothesis. We do not know of prior work that states it as a falsifiable claim about effort per change.
Reaktor’s lineage#
The engine preprint [288] defined the port multihypergraph, interaction profiles, a live-update model and a reusable evaluation design. The RGL report [294] defined the distributed abstract machine, the operations, the Hermes host profile and region releases. This paper subsumes both. It adds layers, a minimal family signature, compositional semantics, a theory of traversals, a DPO change model, a kernel, a reference realization and an evaluation on the corpus and on a production platform.