Distributed Systems Playground Open the Playground

The interface#

A tour of every panel and control. For a guided first session, see Getting started.

Layout#

AreaPosition on a wide screenContent
Top bartopexamples, seed, run, export and import
Topologytop leftthe graph and its animation, editing tools, properties of the selection
Side paneltop rightCode, Timing, Scenario, State and Stack tabs
Runbottomplayback controls, summary, space-time diagram, event log

On screens narrower than 960 pixels the areas stack in one column: graph, run, side panel.

Top bar#

Topology#

Tools#

ToolClick on empty spaceClick on a processClick on a link
Selectclears the selectionselects it; drag to move itselects it
Nodeadds a processselects it
Linkcancelsfirst click chooses the source, second the destination
Deletedeletes it with its links and faultsdeletes it

Directed makes new links one-way. A pair of opposite directed links is drawn as two curves.

Generate replaces the topology with a ring, complete graph, star, grid, line, random connected graph or binary tree with the given number of processes (2 to 40). Ring, star, line and tree respect Directed.

Fit zooms the graph to its processes.

Labels shows the type of each message on its packet.

Layers colors packets and diagram arrows by the module that originated them, and replaces the color legend with a list of those modules.

Changing the topology discards the last run. Moving processes does not.

Properties bar#

The bar under the graph shows the selection.

A process: its neighbors, the number of faults that concern it, and Delete. After a run it also offers, at the cursor time:

A link: Enabled (unchecked means the link is down for the whole run), Directed, its own Loss and Delay (empty means the global value), and Delete. After a run it also offers Cut here, which takes the link down for the given duration from the cursor.

A message (click a packet, or an arrow on the diagram): sender, recipient, payload, status, send and arrival times, and buttons to jump to the send or the arrival.

Every here action adds an input or a fault to the scenario, re-runs, and continues from the cursor. The history before the cursor stays the same. See How the engine works.

Code tab#

Timing tab#

Invalid values are outlined in red with an explanation. The histogram line reports the median, the 99th percentile and the share of messages above DELTA.

Everything is explained in The timing model.

Scenario tab#

Batch runs#

Run over many seeds in the Scenario tab answers the question a single run cannot: does this hold in general?

Write the seeds as 1..50, 7, or 1,4,9, press Run over seeds, and the runs happen in the background: the page stays usable while they go.

The three fields (Seeds, Faults per run, Window) are the suite of the scenario: they are saved with it, so a scenario opened again, shared as a link or handed to somebody else runs the same batch. From a terminal, dsp run scenario.json --suite uses exactly those.

Faults per run adds a generated schedule to every run, drawn from its seed: crash:1, partition:1, pause:1, link:1, omission:1, recover:1, or several separated by commas. Window says when they happen. The schedule of a run that had a problem is shown next to its seed, and opening that seed adds exactly those faults to the scenario, so the failure is in front of you, reproducible and editable. The panel reports, as results arrive:

Behaviour profile runs the same algorithm over a grid of fault conditions, one row each: no faults, one crash, two crashes, crash and recovery, a pause, a partition, overlapping partitions, link failures, omissions, a zone crashing. A sentence above the table says what the algorithm holds under and what breaks it, and Copy report puts the whole profile on the clipboard as Markdown. Each row carries a verdict (● held, ◐ held with fewer processes reporting, ✕ something broke), how often each property held, the average messages, the reach as a bar, the median time of the last output, and a button to open a failing seed. It is the quickest answer to "what does this algorithm survive".

Runs that failed with more than one generated fault also offer minimize: it shrinks the schedule to the faults that still produce the same failure, usually turning four into one, and shows the result in place.

Click a seed to load that run in the page, with everything in place to watch what happened. Stop ends a batch early.

The runs use Web Workers, as many as a few cores allow, each with its own copy of the engine. Where a browser does not allow them, for example when the page is opened from disk in some configurations, the batch falls back to running one seed at a time on the page, still without freezing it.

The same thing from a terminal, with exit codes for continuous integration, is in Running scenarios outside the browser.

State tab#

Select a process to see, at the cursor time:

Stack tab#

Shows the module tree of a process: the application on top, the modules in the middle, the network at the bottom.

Choose the process with the menu at the top, or by selecting it on the graph. Step through a run with Event by event to follow a message from the network up to the application.

Playback#

ControlEffect
⏮ ⏭go to the start or the end of the run
◀ ▶|previous or next moment when something happens
▶play or pause
SpeedEvent by event animates each step at a constant pace; Auto speed plays the interesting part of the run in about 25 seconds; the other values are simulated time per real second
Autoplaystart playing after every run
Scrubbermove to any time

Playback stops shortly after the last message, output or fault, even if timers or rounds keep the run going. End and the All view still reach the real end.

The summary shows messages sent, delivered and lost, violations and outputs.

Space-time diagram#

One horizontal line per process, time from left to right.

MarkMeaning
blue arrowa delivered message
red arrowa message that broke the assumed model
amber dashed arrow ending in a crossa message lost or dropped
gray dashed arrow ending in a crossa message that reached a crashed process
small cross on a linea message dropped as it was sent: no link, or the link was down
light bar on a linethe process handling an event
green diamond with textan output
red circlea violation at that process
red squarea failed assertion or a runtime error
violet dashed line, cross, green circlethe process is down, the crash, the recovery
amber band on a process linethe process is paused
red shadinga partition (full height) or a link failure (between two rows)
dashed vertical lines, r1, r2lockstep rounds
short ticks on a lineemulated round starts of that process
amber vertical lineGST
blue vertical linethe cursor

Interaction. Click to move the cursor; click an arrow to select its message. Drag horizontally to pan. Ctrl + wheel zooms around the pointer. − and + zoom around the cursor, Action fits the interesting part of the run, All shows all of it. Follow keeps the cursor in view. Future shows events after the cursor, faded. Hovering an arrow shows the message.

Causality. With Causality checked, a click selects the nearest event of the clicked process and computes its causal cone. Blue shading covers what could have caused the event, amber shading what it could affect, and unrelated messages fade. A line above the diagram gives the counts, with Clear. On the graph, the origin gets a thick border, processes whose current events could still affect the origin are dashed blue, and processes the event has already reached are amber. The rules are in Assumptions.

Event log#

Entries in time order: inputs, outputs, faults, dropped messages, violations, broken properties, warnings, errors, log and failed assert statements. The chips above the diagram also count how many declared properties held. Entries after the cursor are faded, and the current one is highlighted.

Click an entry to move the cursor there. The filter shows one kind at a time. The log shows up to 3,000 entries per filter.

Reading the animation#

On the graphMeaning
blue packeta message in transit
red packeta message breaking the assumed model
amber packeta message the network will drop
gray packeta message to a process that is down
dashed outline on a packeta duplicate
trail behind a packetthe path covered so far
expanding ring on a processa message just arrived (red if late)
cross on a linka message was dropped there
glow around a processit is handling an event
⏱ next to a processa timeout fired
r3 next to a processits current round
bubble above a processan output
text under a processits latest output
dashed, crossed-out processthe process is down
dashed amber outline with ⏸the process is paused
violet or green flasha crash or a recovery
dashed red link with ✂the link is interrupted

Packets are placed on the part of the link away from the processes, so that labels stay readable. With more than 120 packets in flight, labels are hidden; with more than 200, trails too; at most 400 are drawn.

Saving and sharing#

Automatic saving. The scenario is saved in the browser after every change and restored when you come back. It stays on that browser only.

Export shows:

Import accepts a JSON file or pasted JSON. The scenario is checked before loading; if it is not valid, nothing changes.

An exported scenario includes topology, code, main algorithm, timing model, inputs, faults, seed and duration. It does not include the run itself: the run is recomputed on opening, identically.

Keyboard shortcuts#

Shortcuts work everywhere except while typing in a text field.

KeyAction
Ctrl / Cmd + Enterrun (also while typing)
?list of shortcuts
Ppresentation mode
Ffull screen
Page Up, Page Downprevious or next event, as a clicker sends them
Spaceplay or pause
← →previous or next event
Home Endstart or end of the run
V N L DSelect, Node, Link, Delete tools
Delete, Backspacedelete the selected process or link
Escleave presentation mode, cancel a link in progress, or clear the selection
Ctrl + wheel on the diagramzoom

Settings#

The ⚙ button opens:

Settings are saved in the browser.

Presentation mode#

Press P, or use the button in the settings. The side panel, the event log, the editing tools and the top bar controls are hidden; the graph and the diagram take the whole screen, with larger text and wider rows. The browser switches to full screen when it allows it.

→, Page Down and most presentation clickers move to the next event; ← and Page Up go back. Space plays and pauses. P, Esc or the Exit presentation button leave the mode; leaving full screen by any other means leaves it too, since some browsers handle Esc themselves.

A tip for lessons: select Event by event speed and a process before entering, so that its state and the next steps are what the audience sees.

Welcome tour#

On the first visit, a short tour points at the graph, the code, the timing model, inputs and faults, Run, playback, the diagram and the gallery. Use Next, Back or the arrow keys, and Skip or Esc to close it. It does not open again unless you choose Welcome tour in the settings.

Screens and devices#