∛ Cube Root Money must move once, even when machines fail.
ContactTry the IDE in your browser →
← Back

Introduction to Cube Root

Write for the perfect machine and run on real ones: why durable engines matter, and what changes when a compiler derives the durability from plain code.

Write for the perfect machine. Run on real ones. Developers want to write simple code: if, else, a loop. Production runs it on machines that fail. The perfect machine: never crashes, unlimited memory, one processor as fast as unlimited cores, waiting costs nothing; on it, plain code, one step after another, still scales, with no threads, no retries, no recovery code. Real machines: many ordinary computers, each with a few CPU cores, that crash, restart, run out of memory and lose the network; no one computer has it all, and the gap is where the hard work lives. Generation 1, today's durable engines: they narrow the gap, but not enough; you write the flow in the engine's own way and keep it deterministic by your own care. Generation 2, Cube Root: it bridges the gap; a compiler at its heart derives the durability and the determinism from your plain code. You write for the perfect machine. The compiler makes real machines behave like it.
Why it matters now. Enterprises are moving from simple request and response to AI agents and services that talk by events . An AI agent waits for tools, for people, for other agents. Every run is a flow of many steps. Durable execution is becoming the foundation layer of the cloud .
Two generations of durable engines. GENERATION 1 Framework & infrastructure plumbing Temporal AWS Lambda durable functions Azure Durable Functions Restate Inngest DBOS You write the flow with the engine’s framework . Each call wrapped in a step; promises to run calls together. After a crash, your code is replayed against a recorded history. Determinism is your burden: the price of durability. GENERATION 2 Compiler-derived infrastructure Cube Root You write only the business flow , as plain code. A compiler reads it and derives the infrastructure: what runs together, the waits, the records. After a crash, the run goes on from its rows. Your code is not replayed. Determinism is the Cube Root compiler’s proof. Generation 1 is like writing assembly: it works, and experts do it well. Generation 2 is the compiler.
Two parallel loops. The contrast with Temporal. Cube Root 2 labels PaymentFileRun.java public class PaymentFileRun { private Function<Transfer, String> transfer; public String invoke(PaymentFile file) { int n = file.batches().size(); parallel: for (int i = 0; i < n; i++) { PaymentBatch batch = file.batches().get(i); int m = batch.transfers().size(); parallel_transfers: for (int j = 0; j < m; j++) { String outcome = transfer.apply(batch.transfers().get(j)); } } return "file " + file.fileId() + " processed"; } } Two labels ask for “together”. The compiler does the rest. Temporal Infrastructure lines in the business code FileWorkflowImpl.java public class FileWorkflowImpl implements FileWorkflow { @Override public String process(PaymentFile file) { String fileWorkflowId = Workflow.getInfo().getWorkflowId(); List<Promise<String>> outcomes = new ArrayList<>(); for (PaymentBatch batch : file.batches()) { ChildWorkflowOptions options = ChildWorkflowOptions.newBuilder() .setWorkflowId(fileWorkflowId + "/batch-" + batch.batchId()) .build(); BatchWorkflow child = Workflow.newChildWorkflowStub(BatchWorkflow.class, options); outcomes.add(Async.function(child::process, batch)); } Promise.allOf(outcomes).get(); return "file " + file.fileId() + " processed"; } } BatchWorkflowImpl.java public class BatchWorkflowImpl implements BatchWorkflow { @Override public String process(PaymentBatch batch) { List<Promise<String>> outcomes = new ArrayList<>(); for (Transfer transfer : batch.transfers()) { ChildWorkflowOptions options = ChildWorkflowOptions.newBuilder() .setWorkflowId("transfer-" + transfer.endToEndId()) .build(); TransferWorkflow child = Workflow.newChildWorkflowStub(TransferWorkflow.class, options); outcomes.add(Async.function(child::transfer, transfer)); } Promise.allOf(outcomes).get(); return "batch " + batch.batchId() + " processed"; } } Shaded: in Temporal, every line of infrastructure (each one names the engine); in Cube Root, the two labels. (Its field is Java’s own Function: nothing of ours is imported.) The Temporal side was written from its documentation, compiled and run by us.
The infrastructure should be derived, not written. “AI made the gap between generation 1 and generation 2 more glaring . So we use AI where its work can be checked, and a compiler where the work must be proved.” Here is how. →
AI writes what you can validate. The business logic, yes. The infrastructure, never. THE BUSINESS LOGIC Easy to write. Easy to read. An AI writes it in a minute. You read it and say yes or no. → you validate it THE INFRASTRUCTURE Repetitive. Hard to get right. In generation 1 the AI writes it too, inside the flow, and a person who knows the engine must check every line. No test can show that an ordering is safe. → in generation 2, a compiler proves it Writing got faster. Proving did not. Generation 2 hands the proof to a compiler.
What cannot be tested must be proved. A compiler for the flow. A Rust engine under it. 1 · YOU, OR YOUR AI Plain, linear code Standard Java or TypeScript, top to bottom. No YAML: one type and the language’s own labels. 2 · THE CUBE ROOT COMPILER Proves and parallelizes It reads the flow of the data and runs steps together only where it proves that safe. 3 · THE ENGINE, IN RUST A small runtime core Memory safe. It keeps the state and routes each message to its contract. 4 · AFTER A CRASH Resumes where it stopped From its recorded rows, not by replaying your code. No answer is asked twice; a card is never charged twice. You write Java or TypeScript. Nobody writes the Rust.
Embedded, or remote. The same code. You choose at deployment. EMBEDDED YOUR OWN PROCESS Your code the flow and its services The engine inside your process Your database The engine runs inside your own process. No server to run. REMOTE YOUR OWN PROCESS Your code your services only A SERVER The engine in Rust Its database The engine runs on a server. Your process keeps only your services. One endpoint uses one form at a time. Both forms have run: embedded in Java, remote on the Rust server.
Embedded or remote, the same code? The same flow code runs either inside your process or on a separate server, chosen at deployment, without changing the code. Cube Root ✓ both: embedded or on a server, chosen at deployment Temporal ✗ a Temporal service or Temporal Cloud; its embedded server is for tests only AWS Lambda durable functions ✗ AWS’s managed service only Azure Durable Functions ✗ the Azure Functions host; elsewhere, a different SDK Inngest ✗ the Inngest server Restate ✗ the Restate server DBOS ✗ embedded only: a library in your process ✗: one of the two forms, not both with the same code, as each engine’s own documentation describes it. Each of them is useful in the form it offers.
Embedded, down to an AI training loop. Calls stay local. Durability moves to the batch. ONE BATCH · IN YOUR PROCESS · MANY QUICK CALLS, NO NETWORK HOP Embedding the words to numbers Attention which words matter Middle a hidden layer Score the loss Durability moves to the batch Batch 1 recorded Batch 2 recorded Batch 3 a crash: resumes here Batch 4 goes on Between layers the calls are many and quick: a network hop each time is too slow . So the layers run in one process, and the run is recorded once per batch . A crash resumes at the batch in flight, with the same numbers, bit for bit . What ran: a small word model (embedding, attention, a middle layer, the score) trained through Cube Root on simulated GPUs; durability per run or per batch; killed and resumed at the batch; every grid equal, bit for bit, to the reference.

cube-root.com · Contact