Skip to main content

Correctness and Expressiveness

View as Markdown

Dex has two computer-checked proofs. Under the conditions they assume, a crash, a takeover, or a retry can change only one thing you observe: an external effect can repeat, and the repeat can arrive late. Otherwise the run produces the same events as a run without failures. The proofs cover every well-formed program of a small concurrent language. What this means for your code says how to make repeats safe.

The proofs are about a model of Dex and hold only under a limited scope, such as one Flow, SYNC methods only, and retries that never run out. What the proof assumes lists every condition.

Expressiveness

The Expressiveness proof shows that any program in a small concurrent language, with threads, locks, timers, and cancellation, can be written as a Dex Flow that behaves the same. The proof is written in the Lean proof assistant, which checks every step. The paper has the full argument.

The Workflow Patterns evaluation rates Dex against the 43 control-flow Workflow Patterns. Researchers use these patterns to compare workflow languages and engines. Each rating comes with a runnable example and an integration test.

Correctness

Advanced Step Guarantees states what Dex promises when a Step method fails or runs again.

The Failure transparency proof shows that server crashes, takeovers, retries, late Workers, and duplicate results add only repeated external effects. In fair runs the ending is also unchanged. The proof page lists its conditions.

What covers each feature

FeatureLean failure proofDeterministic simulationServer integration tests
SYNC StepsYesYesYes
ASYNC StepsNoNoYes
RPCs, including transactional RPCsNoYesYes
Attribute locksNoYesYes
SubFlowsNoYesYes
Failure policies and recovery StepsNoYes, in the apply-level stageYes
HeartbeatsPartly: resuming from a heartbeat checkpoint is outside the proofYes, with and without valuesYes
Time TravelNoNo: the simulated clients do not call itYes
StopFlowNoYesYes

The proof column follows What the proof assumes. How it was checked describes the simulation and names the integration test for each feature.