A robot fleet records every shift, labels every step, and picks the few hours of data that fix its worst failure. Dyna reports that this loop took napkin folding from 35 an hour to 95.
Pick the failure mode to spend the next few hours of data on, then turn the flywheel once. Watch per-step success, napkin time and fleet uptime move. One failure here does not come from the policy. Find it. Then we build every stage of the loop from zero.
You need what a learned robot policy is and what a training set is. We build the rest from zero.
Site A is slipping: a napkin takes 46 s, and it makes about 1,270 table-ready napkins a shift against a target of 1,500.
Dyna's numbers: the 1,500 table-ready napkins per 18-hour shift, the 93% quality rate, a healthy napkin of 38 s against 46 s at the slipping site, Step 1 rising from 6.4 s to 10.8 s, the six failure-mode names, and the worn gripper as the cause (Dyna, "Not Just a Model, But a Product", August 2026). Everything else is a toy: the five stage groups, the failure rates, how fast data cuts them, the 2-minute stop cost and the ten-robot fleet.
Chapter 0
See why a working model is the start of the job, not the end
In June 2025 Dyna Robotics showed a robot that folded napkins for 24 hours by itself. Dyna reports 850+ napkins in that run, a 99.4% success rate, and zero interventions. The Dyna-1 lesson works through that claim. It is a strong demo. It is not yet a product.
Then a customer arrived with a number. Din Tai Fung, a restaurant chain, needs each robot to produce 1,500 table-ready napkins in an 18-hour shift. Dyna reports that when it first launched, Dyna-1 produced about 480. It folded roughly 35 napkins an hour, and only 75% cleared the quality bar.
Work the launch number by hand. An 18-hour shift at 35 napkins an hour is 35 × 18 = 630 folds. If 75% pass, 630 × 0.75 = 472.5 table-ready napkins. Dyna rounds this to "about 480"; with 850 / 24 = 35.4 an hour you get 35.4 × 18 × 0.75 = 478.
35 /h × 18 h × 0.75 = 473 table-ready against a target of 1,500
So the robot that set a reliability record made less than a third of what the customer needed. Dyna says it had to "nearly triple throughput and significantly cut the defect rate at the same time". The two goals fight. A neater fold takes more flattening, and more flattening takes seconds from a fixed budget.
Today, Dyna reports, Dyna-2 folds 95 napkins an hour and 93% meet the bar. That is 95 × 18 = 1,710 folds, and 1,710 × 0.93 = 1,590 table-ready napkins, just above the target. Try the presets below, then move the sliders to see how throughput and quality trade.
Each tick on the bar is one napkin folded in the 18-hour shift. Solid ticks pass the quality bar; faint ticks fail it. Pick a preset, or set the rate and the pass rate yourself.
Dyna's numbers: the 1,500 target, the 18-hour shift, Dyna-1 at 35 /h and 75%, Dyna-2 at 95 /h and 93% (1,590 a day). The slipping site's 46 s per napkin is from Dyna's Figure 6.1; Dyna does not state its quality rate, so this preset assumes 93%.
Notice what Dyna does not claim. It does not say that one clever trick closed the gap. It says neither improvement "came from one-off solutions engineering". They came from "better pretraining, new model capabilities, stronger tooling, and the systems we built around them".
That last phrase is this lesson. The systems around the model form a loop. The robots work. Every minute is recorded. Software cuts each recording into the steps of the task and labels what went wrong. Engineers count the failures, pick the data that would fix the worst one, train a new model, check it, and send it back to the robots. Then the robots work again.
People call this a data flywheel. A flywheel is a heavy wheel that is hard to start and easy to keep turning. Each turn of the loop makes the next turn cheaper, because the tools, labels and model carry forward. Dyna's own phrase is "the deployment flywheel".
A word on sources, because it matters. Dyna's posts are company claims, not peer-reviewed papers, so we write "Dyna reports" for every number. Dyna describes the logging, the automatic labels, the queries and the curation in detail. It does not describe how it records human corrections or how it gates a new checkpoint. For those stages we use published methods (DAgger, HG-DAgger and π*0.6's RECAP) and label them as context, not as Dyna's method.
Here is the road. Each chapter builds one stage of the loop, and one part of the hero.
Chapter 1
Name the eleven stages and the data that passes between them
A robot has two loops, and they run at very different speeds. The fast loop is the control loop. Many times a second the policy reads the cameras and joints and writes the next motor targets. The full-body robot hub built that loop in detail.
The slow loop is this lesson. It turns once every few days or weeks. Its input is a pile of recorded work. Its output is a new checkpoint: a saved set of model weights that replaces the old one on the robots. Between those two ends sit eleven stages.
Each dot is one stage. Tap a stage to see what goes in, what comes out, who does the work, and what Dyna says about it. Press Next stage to walk the loop in order.
Stages 1 to 6 and 11 follow Dyna's post closely. Dyna says new checkpoints "return to the fleet, where the same instrumentation tells us whether it helped", but does not describe corrections, the gate or the rollout; those stages use published methods as context.
Read the stages as a pipeline of data types. Each stage takes one kind of record and makes another. If you can name the record, you can build the stage. Here they are in order.
Each stage writes a record the next stage reads. Here is a sketch of the main one, the label record for one step of one napkin. The field names are ours; Dyna lists the same contents ("which step the robot was performing, when it began and ended, whether it succeeded, and which failure mode applied").
Now count the records. Dyna says a robot repeats the napkin task "more than a thousand times a day", and its SOP chart shows 11 steps. So one robot makes at least 1,000 × 11 = 11,000 step records a day. Dyna says its fleet will reach "hundreds of robots by the first half of 2027". At 200 robots that is 200 × 11,000 = 2.2 million step records a day.
200 robots × 1,000 napkins × 11 steps = 2,200,000 step records a day (our arithmetic)
No person can watch that. Dyna makes the same point: finding a few informative moments "would mean watching through hours of otherwise unremarkable work". That is why stages 3 to 5 must be automatic, and why people are kept for the places where they add the most. Chapter 4 shows where those places are.
The loop also runs on three axes, in Dyna's words. Across time: how one robot changes. Across the fleet: how behaviour varies by site, hardware and checkpoint. Across the task: what happened inside a single attempt. Dyna says all three "point at one decision: which production data shapes the next model".
from dataclasses import dataclass @dataclass class StepLabel: # the record stages 3-4 write, stage 5 reads episode: str # site/robot/time of the recording step: int # index into the SOP, 1..11 t_start: float t_end: float success: bool mode: str | None # "missed_grab", "drop", ... or None conf: float # 0..1, used in chapter 4 to route to people ckpt: str # which model was running site: str hw: str # which gripper, which arm def turn_once(fleet, model): episodes = fleet.collect() # 1-2 run and log labels = [l for e in episodes for l in autolabel(e)] # 3-4 worst = rank_failures(labels) # 5 slice_ = curate(episodes, labels, worst, hours=4) # 6 slice_ += fleet.corrections(worst) # 7 cand = finetune(model, slice_) # 8 if gate(cand, model): # 9 fleet.rollout(cand, first=1) # 10 return watch(fleet, cand, model) # 11: cand, or model on regression return model
Chapter 2
Build a recorder that survives crashes and bad networks
Start with a simple question that Dyna puts in bold: what did the robot do today? It sounds easy. Dyna says it is not, because "a robot can emit clean logs for an entire shift and still perform the task poorly". A log line that says "step 1 complete" cannot tell a clean grab from a grab that took three tries.
So the fleet needs two levels of observation. End to end: did the napkin succeed and meet the customer's standard? Granular: which grasp slipped, which step ran long, which joint is drifting? To answer both, Dyna records five kinds of stream:
All five need "enough timing information to reconstruct how the streams line up". Without shared timestamps you cannot say that the gripper closed 80 ms before the camera saw the napkin slip. Dyna says the fleet's record is "already over a terabyte of raw data every day".
How big is one robot's share? Dyna does not give a per-robot figure, so here is our estimate with a number from Dyna's own infrastructure post. After compression, Dyna's Dyna-2 training format stores one camera at about 25.1 MB per camera-minute (infrastructure post, Figure 3). The on-robot format is not stated, so treat this as a rough rate. If a robot runs three cameras for an 18-hour shift (the camera count is our assumption), then:
25.1 MB × 3 cameras × 60 min × 18 h = 81,324 MB ≈ 81 GB per robot-shift (our arithmetic)
So "over a terabyte a day" is the camera output of about 1,000 / 81 ≈ 12 robots at this rate, before robot state and telemetry, which are small. That fits a fleet that was still growing. It also says why the network matters: 81 GB over an 8-hour overnight window needs 81,000 MB / 28,800 s ≈ 2.8 MB/s of upload, every night, from a restaurant's internet line.
The robot runtime records formal episodes: one model rollout, from an explicit start to an explicit end. But Dyna notes that "a service can crash between them, and a robot can enter an unexpected state when no episode is active". The most interesting moment of the day can fall outside every recording.
Dyna's fix is an always-on recorder. The runtime keeps "a fixed-size, in-memory window of recent activity". New data replaces the oldest data, like a loop of tape. When the system or an operator raises an alert, the runtime freezes the window, keeps recording "a short interval after it", and promotes the whole span to durable storage as a replayable episode. The lead-up to the problem is saved, even though nobody knew to press record.
Time runs left to right. Purple blocks are formal episodes. The bracket is the always-on window. Press Raise an alert between episodes to save the lead-up. Then cut the network and see what the upload rule protects.
The mechanism follows Dyna's description: a fixed-size in-memory window, promotion on an alert with a short tail, local disk first, asynchronous upload, local copy deleted only after the upstream copy is verified. Dyna does not state the window length or tail length; the 20-second tail, the event times and the 8% chance that an upload arrives corrupt are our toy.
The window costs the same memory all day, because it never grows. That is its point. Work out the size for one camera at the rate above: 25.1 MB per minute is 0.42 MB per second, so a 60-second window holds 25 MB per camera, and three cameras hold 75 MB. That fits in a robot computer's memory with room to spare. A 10-minute window would hold 750 MB, which starts to compete with the policy for memory.
The upload path has three rules, and each one prevents a specific loss. Episodes land on local disk first, so a crash after promotion does not lose them. Upload runs asynchronously "as connectivity allows", so a slow network never blocks the robot. And the local copy is deleted only after the upstream copy is verified, so an upload that arrives truncated or corrupt can be sent again.
Here is the recorder as code. A deque with a maximum length is exactly "a fixed-size window that replaces the oldest data".
from collections import deque import hashlib, json, os, time class AlwaysOnRecorder: def __init__(self, hz=30, window_s=60, tail_s=20, spool="spool/"): self.buf = deque(maxlen=hz * window_s) # oldest frame falls off the left self.hz, self.tail_left, self.pending = hz, 0, None self.tail_n, self.spool = hz * tail_s, spool os.makedirs(spool, exist_ok=True) def push(self, frame): # called every tick with all streams self.buf.append(frame) # frame = {"t":..., "cams":..., "q":..., "cmd":..., "events":...} if self.pending is not None: self.pending.append(frame); self.tail_left -= 1 if self.tail_left == 0: self._promote(self.pending); self.pending = None def alert(self, reason): # freeze the lead-up, keep recording the tail if self.pending is None: self.pending = list(self.buf); self.tail_left = self.tail_n; self.reason = reason def _promote(self, frames): # local disk first path = os.path.join(self.spool, f"{int(time.time())}-{self.reason}.json") blob = json.dumps(frames).encode() open(path, "wb").write(blob) open(path + ".sha256", "w").write(hashlib.sha256(blob).hexdigest()) def upload_loop(spool, put, head): # runs in its own thread for f in sorted(os.listdir(spool)): if not f.endswith(".json"): continue p = os.path.join(spool, f); want = open(p + ".sha256").read() try: put(f, open(p, "rb").read()) # may fail: no network except OSError: return # try again later if head(f) == want: # upstream hash matches os.remove(p); os.remove(p + ".sha256") # only now delete the local copy
Two numbers set the recorder's design. The window must be longer than the usual lead-up to a failure, or the cause falls off the left edge before the alert. The local disk must hold every episode that piles up while the network is down. At 81 GB a shift, a 1 TB disk covers about 12 shifts without a network, which is the length of outage you can survive without losing data.
Chapter 3
Turn a day of video into a staircase you can read at a glance
A recording is evidence, not an answer. Dyna puts it plainly: "Camera streams and structured signals do not by themselves identify each SOP step, its outcome, or its failure mode in a form we can query across the fleet." Before you can ask "which step fails most?", something must say where each step starts and ends.
The steps come from the customer. Dyna says many tasks "are defined by clear standard operating procedures". At Din Tai Fung "a napkin fold follows a specific sequence of steps". Dyna's chart shows 11 of them, S1 to S11. It names only the first: Step 1, "where the robot pulls a single napkin off the stack".
Segmentation is harder than it sounds for two reasons. First, in continuous work there are no clean episode edges. The Dyna-1 post says "robot data does not naturally come with episodic boundaries". Second, steps repeat. A missed grab sends the robot back to Step 1, so the sequence is not always 1, 2, 3, but sometimes 1, 1, 1, 2, 3.
Dyna's autolabeler works "from the aligned views derived from the recording" and processes every episode. Dyna does not say what model it uses. So here are three ways you could build one, from crude to strong. They are our examples, not Dyna's recipe.
cheap, brittle
Use signals you already have. The gripper closes: a grab starts. The gripper opens over the bin: a place ends. Good for coarse steps; blind to anything a sensor does not flag, such as a bad fold.
the usual workhorse
A small network reads each frame (images plus joint state) and outputs a probability for each of the 11 steps. Train it on a few hundred hand-cut episodes. Its raw guesses flicker, so you clean them up.
what Dyna-1 describes
Dyna-1's post says its reward model can "automatically segment the streaming data and provide accurate progress estimation and subtask labeling". A progress score that climbs, drops back, then climbs again marks a retry.
Take the classifier route and look at the flicker. The classifier guesses one step per frame. It is right most of the time, but near a boundary, or when an arm hides the napkin, it jumps between steps for a frame or two. Raw guesses like that would count dozens of fake steps per napkin.
Top row: the true steps of one napkin, with one retry of Step 1. Middle row: the classifier's raw guess per frame. Bottom: the staircase after smoothing. Raise the noise, then widen the smoothing window until the fake steps vanish.
A toy: 6 steps instead of Dyna's 11, 10 frames per second, step lengths loosely shaped like Dyna's Figure 6.1, a classifier that is wrong at the error rate you set, more often near boundaries. The smoother is a sliding majority vote followed by merging runs shorter than 4 frames.
The smoother is a majority vote over a sliding window. Each frame takes the step that most frames around it agree on. Work a tiny case by hand at 10 frames per second. Here are 12 raw guesses for steps 1 to 3:
raw: 1 1 2 1 1 2 2 2 3 2 3 3 (7 switches; the truth has 2)
Use a window of 3: each frame looks at itself and its two neighbours. Frame 3 sees (1, 2, 1), so it becomes 1. Frame 9 sees (2, 3, 2), so it becomes 2. Frame 10 sees (3, 2, 3), so it becomes 3. The ends keep their own vote. The result has two switches, the right number:
smoothed: 1 1 1 1 1 2 2 2 2 3 3 3 → step 1 for 0.5 s, step 2 for 0.4 s, step 3 for 0.3 s
The window is a trade. A wide window removes flicker but blurs real short events. A real retry of Step 1 that lasts 0.8 s vanishes under a 2-second window. So the clean-up usually has two parts: a modest vote window, then a rule that merges any run shorter than the shortest real step. Try both in the device: watch the retry disappear when the window gets too wide.
The output is what Dyna calls a staircase. "Every SOP step is a stair, its width is the time spent on that step, and outcome and failure mode labels run underneath." Lay a day's staircases end to end and the routine shape repeats. A step that "suddenly stretches or starts collecting failures stands out immediately". Your eye does the anomaly detection.
from collections import Counter def majority(raw, k): # k odd: frames each side = k // 2 h = k // 2 return [Counter(raw[max(0, i - h): i + h + 1]).most_common(1)[0][0] for i in range(len(raw))] def runs(labels): # [(step, start, length), ...] out = [] for i, s in enumerate(labels): if out and out[-1][0] == s: out[-1][2] += 1 else: out.append([s, i, 1]) return out def merge_short(rs, min_len=4): # fold blips into the longer neighbour while len(rs) > 1: i = min(range(len(rs)), key=lambda j: rs[j][2]) if rs[i][2] >= min_len: break j = i - 1 if i == len(rs) - 1 or (i > 0 and rs[i-1][2] >= rs[i+1][2]) else i + 1 rs[j][2] += rs[i][2]; rs[j][1] = min(rs[j][1], rs[i][1]); rs.pop(i) merged = [] # re-join equal neighbours for r in rs: if merged and merged[-1][0] == r[0]: merged[-1][2] += r[2] else: merged.append(r) rs = merged return rs raw = [1,1,2,1,1,2,2,2,3,2,3,3] print(runs(majority(raw, 3))) # [[1, 0, 5], [2, 5, 4], [3, 9, 3]] -> 0.5 s, 0.4 s, 0.3 s at 10 fps
A retry shows up in the staircase in one of two ways, and your labeller must choose one and stick to it. Either Step 1 appears twice in a row as two stairs, or it appears once as a wider stair with a retry count. Dyna's chart of time per step suggests the second view: Step 1 simply got wider as missed grabs rose. Chapter 5 reads that chart.
Chapter 4
Name each failure, then spend people only where labels are unsure
A staircase says where each step was. A label says how it went. For each step, Dyna's autolabeler records "whether it succeeded, and which failure mode applied when it did not". Its fleet platform also shows grades underneath each staircase. Those two fields turn video into rows you can count.
The list of allowed names is called the label ontology. For napkins, Dyna's chart uses six failure modes:
| Failure mode | What it means (our gloss) | Likely step |
|---|---|---|
| Missed grab | the gripper closes on nothing | Step 1, pull a napkin |
| Double grab | two napkins come off the stack together | Step 1 |
| Imprecise fold | a fold lands off its line | fold steps |
| Poor flattening | wrinkles or a lifted corner remain | flatten steps |
| Drop | the napkin falls out of the gripper | any carry |
| Imprecise bin placement | the napkin misses its instructed stack | the last step |
Dyna names the six modes and Step 1. The glosses and the step mapping are our reading. An ontology must obey the same rule as plain writing: one name for one meaning. If one reviewer calls a slipped napkin a "drop" and another calls it a "missed grab", the counts mix two problems and point the data at the wrong fix.
An automatic labeller makes mistakes. That matters twice. The fleet's headline metrics are computed from labels, so label errors become metric errors. And Chapter 6 picks training data by label, so a wrong label puts the wrong clip in the training set.
Dyna's answer is a "deliberately hybrid" workflow. The autolabeler covers everything. People look where they carry "the most information". Dyna lists five places:
Dyna says those reviews "do double duty". They protect the metrics, and "they produce the corrections that improve the labeling system". One warning about words: in this lesson, a label fix is a person correcting a label. A correction, from Chapter 7 on, is a person correcting the robot. They are different data with different uses.
The histogram shows the labeller's confidence for a day of step labels. Grey bars are right; red bars are wrong. Everything left of the line goes to a person. Slide the line and watch the review hours and the errors that slip through.
A toy labeller: 11,000 step labels per robot per day (1,000 napkins × 11 steps, from Dyna's "more than a thousand times a day" and 11 SOP steps), 4% of labels wrong, wrong labels skewed to low confidence, 8 seconds of review per label. Dyna does not state its labeller's error rate or review volume.
The device shows the trade. Review only the bottom few percent and the person-hours stay small, but errors at high confidence pass straight through. Raise the threshold and errors fall, but review grows with the fleet. At 50 robots there are 550,000 step labels a day; reviewing even 5% at 8 seconds each is 27,500 labels × 8 s = 220,000 s, about 61 person-hours a day.
How do you know the auto-accepted labels are good? You cannot check them all. So people check a random sample, the fifth item on Dyna's list. It must be random, not the low-confidence ones, or it measures only the hard cases. Work an example. Reviewers check 200 random labels and find 6 wrong.
error rate = 6 / 200 = 3.0%
How sure is that 3%? A sample proportion has a standard error: the typical distance between the sample's rate and the true rate. For a rate p from n samples:
√(0.03 × 0.97 / 200) = √0.0001455 = 0.0121, so 95% range ≈ 3.0% ± 1.96 × 1.21% = 0.6% to 5.4%
That range is wide. To pin the error rate to ±1 point you need 1.96² × 0.03 × 0.97 / 0.01² = 3.84 × 0.0291 / 0.0001 ≈ 1,118 checked labels. Note what the sample buys: it is small next to 550,000 labels a day, and it still tells you how far to trust every metric built on top.
import math, random def route(labels, thresh=0.70, audit_n=200, new_task=set()): to_people, auto = [], [] for l in labels: unsure = l.conf < thresh rare = l.mode in {"unknown", "other"} if unsure or rare or l.task in new_task: to_people.append(l) else: auto.append(l) audit = random.sample(auto, min(audit_n, len(auto))) # random, not the hard ones return to_people, auto, audit def error_rate(n_wrong, n): # with a 95% range p = n_wrong / n se = math.sqrt(p * (1 - p) / n) return p, max(0, p - 1.96 * se), p + 1.96 * se print(error_rate(6, 200)) # (0.03, 0.0064, 0.0536)
Chapter 5
Follow Dyna's slipping site from a throughput drop to a worn gripper
With labels in place, the fleet can answer the questions Dyna lists. Which step takes the longest? Where does the model fail most often? Which step has the most missed grasps? How do these patterns change across sites, robots and model checkpoints? Each is now a query, not a week of watching video.
Dyna tells one case in full, and it is worth slowing down for. A few months before the post, one Din Tai Fung site "started slipping on throughput". Nothing in the logs explained it. Nobody on site had reported anything unusual. Then the autolabels "narrowed it down quickly".
These are Dyna's own charts, redrawn. Switch between failures by week and time per step. Tap a bar to read its number.
Failure counts are exact: Dyna's chart carries them in its markup. Step times are our reading of Dyna's bar heights; Dyna's caption gives the endpoints (a napkin from 38 s to 46 s, Step 1 from 6.4 s to 10.8 s). Only Step 1 is named; S2 to S11 are Dyna's labels. Dyna does not state how many robots or napkins the counts cover.
Now do the arithmetic Dyna's captions summarise. Total labelled failures went from 357 two weeks ago to 502, then 725 this week.
725 / 357 = 2.03 Dyna: "Total failures roughly doubled"
Where did the increase come from? Missed grabs rose from 108 to 380, an increase of 272. The total rose by 725 − 357 = 368. So missed grabs are 272 / 368 = 74% of the increase. Imprecise folds rose from 74 to 169, another 95, or 26%. The other four modes together went from 175 to 176: flat.
(380 − 108) / (725 − 357) = 272 / 368 = 74% of the rise is missed grabs
The time chart tells the same story in seconds. A napkin went from 38 s to 46 s, so 8 s slower. Step 1 went from 6.4 s to 10.8 s, so 4.4 s of the 8, which is 55%. Dyna's caption says "Step 1 accounted for more than half of the increase". Every missed grab means a retry, "and the retries showed up as time".
Turn seconds into napkins. At 38 s a napkin, a robot makes 3,600 / 38 = 94.7 an hour, which matches Dyna-2's 95. At 46 s it makes 3,600 / 46 = 78.3 an hour, 17% fewer. Over an 18-hour shift at 93% quality, that is 1,587 against 1,310 table-ready napkins (our arithmetic; the site's quality rate is not stated). One slipping site fell below the customer's 1,500.
One more thing is visible in our reading of the bars. Steps 2 to 11 each got about 12% slower too, not just Step 1. Dyna does not comment on this, so we do not explain it. It is a reminder to read the whole chart, not just the caption.
So the policy got worse at grabbing? No. Dyna: "It turned out to be a worn gripper." And then the key sentence: "That is a fix the labels could locate but never diagnose: a worn gripper and a bad policy look the same in an episode, and telling them apart is a different problem."
Think about what that means for the flywheel. If the fleet had simply fed the top failure mode back into training, it would have spent hours of data teaching the policy to grab with a broken tool. The hero shows this trap. Spend data on missed grabs at Site A and the numbers barely move. Swap the gripper and they snap back.
Mechanical parts wear "gradually and continuously". Dyna wants to catch that before it costs a shift, because the default, reactive maintenance means "unplanned downtime, the most expensive way to learn anything". The episodes already hold the signals. Robot state shows "a joint that's drawing more current or tracking its commanded path less precisely". Cameras show "a gripper that closes differently, a fold that lands a few millimeters off".
Dyna builds a degradation index for a component and tracks it against "the robot's own baseline", plus regular calibration checks. Its Figure 7 is labelled "Illustrative: the pattern is real, the values are not shown". The pattern: the index wobbles in a narrow band, steps up at an acute event, gets flagged the same day, then climbs for weeks until wear would start to limit the model. The gap between the flag and that point is the maintenance window.
A year of one gripper's daily degradation index, measured against its own baseline. A real fault starts on day 240. Lower the threshold to catch it sooner; watch false alarms pile up across the fleet.
A toy that follows the shape of Dyna's illustrative Figure 7 (a narrow band, an acute step, a slow climb toward the point where hardware limits the model). Values, noise, the fault day and the 100-robot fleet are ours. False alarms per year use the normal-tail rate for the threshold.
The threshold is a trade, and you can compute it. If daily noise is roughly normal, a one-sided 3σ threshold is crossed by chance on 0.135% of days. That is 0.00135 × 365 = 0.49 false alarms per gripper per year. Across 100 robots, about 49 a year: one a week. At 2σ the chance is 2.28% a day, so 8.3 per gripper per year, or 830 across the fleet, and the technicians stop trusting the alarm.
import pandas as pd # labels: one row per StepLabel, from chapters 3-4 def where_it_fails(labels: pd.DataFrame, site, weeks=3): df = labels[labels.site == site] by_mode = (df[~df.success].groupby(["week", "mode"]).size() .unstack(fill_value=0).tail(weeks)) # Figure 6.2 by_step = (df.assign(dur=df.t_end - df.t_start) .groupby(["week", "step"]).dur.mean() .unstack().tail(weeks)) # Figure 6.1 return by_mode, by_step def policy_or_hardware(labels, mode, site, robot): me = labels[(labels.robot == robot) & (labels["mode"] == mode)] peers = labels[(labels.ckpt.isin(me.ckpt.unique())) & (labels.robot != robot) & (labels["mode"] == mode)] # same checkpoint elsewhere is fine but this robot is not -> suspect hardware return "hardware?" if rate(me) > 2 * rate(peers) else "policy?"
Chapter 6
Spend a data budget where each hour buys the most seconds
Suppose the gripper is fixed and the remaining failures really are the policy's. You can afford a few more hours of training data before the next checkpoint. Which hours? Dyna's answer is the heart of the post: "The problem becomes curation rather than volume. Training on the right few hours can beat training on more of the wrong data."
Dyna also says what makes hours "right". The record supplies the dimensions: "task step, outcome, failure mode, quality, site, hardware state, checkpoint". In other words, every label field from Chapter 4 is a filter you can put on the training set. Dyna does not say how it weighs them. The rest of this chapter is our worked method for one way to choose.
Most of a robot's day is routine success. Work out how little of it shows a missed grab. With a healthy gripper, say 6% of napkins have a missed grab (a toy rate), and each costs about 5 s of a 38 s napkin. Then the share of footage that shows a missed grab is:
0.06 × 5 s / 38 s = 0.8% of random footage → 4 random hours hold about 4 × 60 × 0.008 ≈ 1.9 minutes of missed grabs
A curated 4 hours can be nothing but missed grabs, with their lead-up and recovery. That is about 125 times more of what you need. Can you find 4 hours of them? A clip of 15 s each (lead-up, the miss, the recovery) means 14,400 / 15 = 960 clips. At 6% of 1,000 napkins a day, one robot makes 60 a day, so 960 clips is 16 robot-days. With a fleet of 16 robots, that is one day. This is the quiet reason a fleet matters: it makes rare moments common enough to curate.
The most frequent failure is not always the most expensive. Each failure costs time (a retry) and sometimes a stop (the robot needs a person). Put both on one scale. If a step takes b seconds per attempt and succeeds with chance s, the expected time on that step is:
Why 1 / s? Each attempt succeeds with chance s, independently. On average you need 1 / s tries, the mean of a geometric distribution. At s = 0.9 that is 1.11 attempts. Now compare two fixes with toy numbers. Halve missed grabs from 6% to 3% on a 5.8 s pick step, where double grabs add 4%: success goes from 0.90 to 0.93.
5.8 / 0.90 − 5.8 / 0.93 = 6.444 − 6.237 = 0.21 s per napkin × 1,700 napkins = 352 s a day
Now halve drops from 2% to 1% on a 5.0 s carry step: 5.0 / 0.98 − 5.0 / 0.99 = 5.102 − 5.051 = 0.05 s per napkin, only 87 s a day. But in our toy a quarter of drops land on the floor and stop the robot for 2 minutes. Stops per napkin fall from 0.02 × 0.25 = 0.005 to 0.0025. Over 1,700 napkins that is 4.25 fewer stops, × 120 s = 510 s a day. The rare failure is worth more, because of the stop.
Each row is one failure mode with its rate per napkin; the tick is the floor that data cannot get below. Dots are hours you spent on that mode. Pick a strategy and a budget, or choose Your mix and tap rows to place hours yourself.
The same toy fleet as the hero, with Site A's gripper already swapped: five stage groups, six modes, toy rates, floors, data scales and stop chances. Random hours count only the share of footage that shows each failure. Dyna does not state how it allocates data; "By value" is our greedy rule.
The device's "By value" strategy is a greedy rule. For each next hour, compute how many seconds per napkin that hour would save on each mode, including stops, and give it to the best one. Each mode has diminishing returns, so the best mode changes as you spend. In the toy, each hour cuts the part of a mode's rate above its floor by a fixed fraction:
Work it once. Missed grabs start at p₀ = 0.06 with floor f = 0.015 and H = 3 hours. After h = 3 hours, e−1 = 0.368, so p = 0.015 + 0.045 × 0.368 = 0.0316. The first 3 hours cut the rate almost in half. The next 3 hours cut it only to 0.015 + 0.045 × 0.135 = 0.0211. Same price, a third of the gain. That is why the greedy rule moves on.
import math MODES = { # toy numbers: rate, floor, hours scale, step, stop chance "missed_grab": dict(p=.06, f=.015, H=3, step="pick", stop=.01), "double_grab": dict(p=.04, f=.010, H=4, step="pick", stop=.08), "imprecise_fold": dict(p=.05, f=.015, H=5, step="fold", stop=0), "poor_flattening": dict(p=.05, f=.012, H=4, step="flatten", stop=0), "drop": dict(p=.02, f=.004, H=3, step="carry", stop=.25), "bin_place": dict(p=.04, f=.006, H=2.5, step="place", stop=.02), } STEP_S = {"pick": 5.8, "fold": 12.6, "flatten": 8.0, "carry": 5.0, "place": 4.5} STOP_S = 120 def rate(m, h): M = MODES[m]; return M["f"] + (M["p"] - M["f"]) * math.exp(-h / M["H"]) def napkin_cost(hours): # expected seconds per napkin, stops included fail = {s: 0.0 for s in STEP_S}; stops = 0.0 for m, M in MODES.items(): r = rate(m, hours.get(m, 0)); fail[M["step"]] += r; stops += r * M["stop"] return sum(b / (1 - fail[s]) for s, b in STEP_S.items()) + stops * STOP_S def greedy(budget): hours = {} for _ in range(budget): now = napkin_cost(hours) best = max(MODES, key=lambda m: now - napkin_cost({**hours, m: hours.get(m, 0) + 1})) hours[best] = hours.get(best, 0) + 1 return hours, napkin_cost(hours) print(round(napkin_cost({}), 2)) # 39.07 s: 37.92 s of steps plus 1.15 s of stops print(greedy(6)) # drop 2, double 2, missed 1, fold 1 -> 38.41 s
Two cautions keep this honest. First, the toy's "hours scale" H is the big unknown. In practice you learn it by trying: spend a few hours, retrain, measure, and update your guess for that mode. Second, focusing data on one mode can make another worse. A policy pushed to grab more firmly may start double grabbing. Chapter 8's gate exists to catch exactly that.
Chapter 7
Record the fix in exactly the states the policy gets itself into
Curation finds the failures you already have. Sometimes the fleet has plenty of failures but very few good recoveries from them. The policy misses the napkin, then flails, because nobody ever showed it what to do from a half-missed grab. More clean demonstrations will not help. They all start from a good grab.
This is a classic problem with a name. A policy trained on demonstrations sees the states a human visits. When it runs, small errors push it into states a human rarely visits. There it makes bigger errors, which push it further off. This drift is called covariate shift, and the errors compound: each mistake makes the next one more likely.
How fast does it compound? Take a toy napkin with 40 decision points (say, 40 action chunks). If the policy has a 1% chance at each point of drifting outside what the demonstrations covered, the chance it stays covered for the whole napkin is:
0.9940 = 0.67 so one napkin in three leaves the covered states at least once
Ross and Bagnell showed the theory behind this. With plain imitation, the expected number of mistakes over a task of length T can grow with T², because one early mistake spoils the rest of the run. Their fix, DAgger (Dataset Aggregation, Ross, Gordon and Bagnell, 2011), brings it down to grow with T. The idea is simple: run the learner, ask an expert what it should have done in the states the learner actually reached, add those labels, retrain, repeat.
On a real robot, labelling every state after the fact is awkward. A person cannot easily say, frame by frame, what a 6-joint arm should have done. HG-DAgger (human-gated DAgger, Kelly and others, 2019) makes it natural. The person watches the robot run. When it is about to fail, they take control and drive it to safety. Only the segments where the human was in control become new labels.
A leader and follower pair like the SO-101 is built for this. The leader arm is a copy of the robot that you move by hand; the follower copies its joint angles. During autonomous runs the follower obeys the policy. When you grab the leader and press a switch, the follower obeys you instead. Release the switch and the policy takes back control from the state you left it in.
Two details make the takeover useful as data. First, the leader must be moved to match the follower before the switch, or the follower jumps. Second, the recording must tag every frame with who was in control. That tag, an intervention flag, is what turns a teleop session into correction data.
Keep the policy's proposed action next to the human's executed action. The gap between the two at the moment of takeover is the most informative number in the clip: it says exactly what the policy got wrong. Keep the seconds before the takeover too, because they hold the state that led to the mistake.
Each line is one grab: the gripper's sideways offset from the napkin's edge over time. The shaded band is where the training data covers the states. Outside it, the policy guesses. Add a round of data and compare the two kinds.
A toy in one dimension. Demonstrations mostly cover the narrow band a skilled operator stays in; corrections start from the states where the policy drifted, so they widen the band where the policy needs it. Inside the band the policy steers back; outside it, it drifts. Success means ending within 1.5 cm of the edge. The rates are ours.
The device shows the asymmetry. An hour of demos mostly adds more examples near the centre, where the policy already does well. An hour of corrections adds examples exactly at the edges where it fails. The band widens where the lines were escaping, and the success rate climbs faster.
Does Dyna use corrections? Its posts do not say. Dyna-1's headline is "zero interventions", which tells you interventions were counted, but neither post describes a takeover tool or a correction dataset. The closest published system on this site is π*0.6. Its recipe, RECAP, trains on three kinds of data at once: demonstrations, the robot's own autonomous attempts (including failures), and human interventions during execution. Our π*0.6 lesson reports that on the hardest tasks it more than doubled throughput.
import time class CorrectionRecorder: """HG-DAgger style: the policy drives; a switch hands control to the leader arm.""" def __init__(self, robot, leader, policy, switch, hz=30): self.robot, self.leader, self.policy, self.switch, self.dt = robot, leader, policy, switch, 1 / hz def run(self, seconds): frames, human = [], False for _ in range(int(seconds / self.dt)): obs = self.robot.observe() # images + joint angles proposed = self.policy(obs) # what the policy wants want_human = self.switch.pressed() if want_human and not human: # takeover: leader must match follower first self.leader.move_to(obs["q"]); self.leader.release_torque() human = want_human executed = self.leader.read() if human else proposed self.robot.send(executed) frames.append(dict(t=time.time(), obs=obs, proposed=proposed, executed=executed, intervention=human)) time.sleep(self.dt) return frames def correction_clips(frames, lead_s=3, hz=30): """Cut each human segment plus the seconds before it; label = the executed action.""" clips, i = [], 0 while i < len(frames): if frames[i]["intervention"]: j = i while j < len(frames) and frames[j]["intervention"]: j += 1 clips.append(frames[max(0, i - lead_s * hz): j]); i = j else: i += 1 return clips # train on the human frames; keep the lead-up for context and analysis
Chapter 8
Count how many trials it takes to trust a new checkpoint
The curated slice and the corrections go into training. The usual move is to fine-tune: start from the current checkpoint and train a little more on the old data mixed with the new slice. Keep the old data in the mix. A model trained only on missed grabs can forget how to fold. Dyna does not state its retraining recipe, cadence or mix. Its Dyna-2 post says post-training used "at most 10 hours of robot data" per task, which gives a sense of how small a curated set can be.
Now the dangerous moment. You have a candidate checkpoint. Is it better? The candidate saw new data on one failure mode; it might be worse at something else. Before it reaches a customer's shift, it must pass a gate: a test that compares it with the checkpoint it would replace.
Dyna describes the lab habit: "Run the model for tens of trials, have a grader watch the robot live, score the results." It says this catches a model that does not work. "It doesn't catch one that fails once every two hundred trials, degrades over a week, or runs fine on this robot and badly on the one beside it." You can put a number on that sentence.
If a failure happens on each trial with chance p, independently, the chance that n trials show it at least once is one minus the chance that every trial passes:
30 trials: 1 − 0.99530 = 1 − 0.860 = 14% · one robot-day of 1,000 napkins: 1 − 0.9951000 = 99.3%
Thirty trials miss a 1-in-200 failure 86% of the time. To see it with 90% certainty you need n = ln(0.1) / ln(0.995) = −2.303 / −0.00501 ≈ 460 trials. A robot at a customer site runs that many before lunch. This is what Dyna means by "deployment is the eval": the fleet is the only test bench big enough.
Left view: the chance a test sees a rare failure, against the number of trials. Right view: the chance a canary comparison spots a real rise in a failure rate. Move the sliders and watch where "tens of trials" and "one robot-day" land.
Formulas, not a toy: independent trials; the regression view uses a one-sided two-proportion z-test at the 5% level against a baseline rate of 3%. The "1 in 200" and "tens of trials" phrasing is Dyna's; the 1,000 napkins per robot-day follows Dyna's "more than a thousand times a day".
Spotting a regression is harder still. Say the candidate raises missed grabs from 3% to 4%. To detect that difference reliably (80% of the time, at the 5% significance level) you need about this many napkins on each checkpoint:
n ≈ (1.96 + 0.84)² × (0.03 × 0.97 + 0.04 × 0.96) / 0.01² = 7.84 × 0.0675 / 0.0001 ≈ 5,300 per checkpoint
That is about five robot-days on each side. No live grader watches 10,600 napkins. Automatic per-step labels can. This is why the labels of Chapter 4 are also the gate's instrument: Dyna says "each new checkpoint returns to the fleet, where the same instrumentation tells us whether it helped".
Dyna does not describe its rollout. The standard engineering pattern, used for any software that touches customers, is a canary rollout. It runs in four stages:
Watching never stops after the push. Dyna's three axes apply: across time (did it hold for a week?), across the fleet (is one site worse?), across the task (which step moved?). A regression found this way is not a disaster. It is the next turn of the flywheel, already labelled.
import math from statistics import NormalDist def p_seen(p, n): return 1 - (1 - p) ** n def trials_for(p, conf): return math.ceil(math.log(1 - conf) / math.log(1 - p)) def n_per_arm(p_old, p_new, alpha=0.05, power=0.8): z = NormalDist().inv_cdf(1 - alpha / 2) + NormalDist().inv_cdf(power) return math.ceil(z * z * (p_old * (1 - p_old) + p_new * (1 - p_new)) / (p_new - p_old) ** 2) def gate_step(canary, control, z_block=1.645): """canary/control: {step: (failures, attempts)}. Block if any step is clearly worse.""" worse = [] for s, (f1, n1) in canary.items(): f0, n0 = control[s] p1, p0, pp = f1 / n1, f0 / n0, (f1 + f0) / (n1 + n0) se = math.sqrt(pp * (1 - pp) * (1 / n1 + 1 / n0)) or 1e-9 if (p1 - p0) / se > z_block: worse.append(s) return ("block", worse) if worse else ("widen", []) print(round(p_seen(1/200, 30), 3), trials_for(1/200, 0.9), n_per_arm(0.03, 0.04)) # 0.14 460 5299
Chapter 9
Learn why on-site work took weeks to months, and what makes the next site faster
In May 2026, Dyna's York Yang wrote an unusually frank post about deployment. Dyna's longest-running deployment was then about 10 months of daily use. But getting each customer from "sale" to "running reliably without us" took "weeks-to-months of on-site engineering, and most of that work didn't transfer cleanly to the next customer".
It goes further. "Deployment didn't self-accelerate." The expected pattern, where each new customer is faster than the last, "hasn't happened", and "as far as we can tell from peers, it hasn't happened anywhere in the industry yet". The post blames the primitives: model, hardware and deployment system were not yet good enough "to let deployment run as an independent loop".
Three months later, the August post reports the opposite end: "a new Dyna deployment, from setup to meeting production ROI bar, is as short as three days". Both are Dyna's claims, and "as short as" describes the best case, not the average. Still, the two posts bracket the question this chapter asks: what changed?
The May post lists what a real deployment needs: "scene assessment, task boundary definition, data capture and feedback, on-site debugging, remote diagnostics, continuous updates, reliability maintenance, and tooling that turns each deployment into a reusable artifact for the next one". Each item can be done in two ways. You can patch it for this site, or build it once for every site.
Some things are truly local. Dyna's August post names them: "stations get rearranged, lighting shifts, suppliers change materials". Robots run on "networks we don't control". Bins differ: "Some sites use smaller bins that hold five stacks, others use larger ones that hold 10". A patch for any of these, such as hard-coded bin positions or a model trained on one bin, works "until the bins changed". Our reading: that kind of patch is the work that did not transfer.
Dyna's examples
A failure mode found at one site "becomes a query we run across the fleet". A hardware check "protects every robot with the same components". A production slice that improves a checkpoint "raises quality and throughput everywhere that model is deployed". Language following: "a new bin configuration is a different instruction rather than a different model".
our reading
Hard-coded positions for one station, a model tuned to one bin, a workaround for one site's lighting, a script around one site's network, a fix nobody wrote down. Each costs a day and must be paid again at the next site, in a slightly different form.
Each bar is the engineering days to get one new site running. Slide the share of problems you solve generally (in the model, tooling or a reusable integration) instead of with a site patch. A general fix costs more once, then carries forward.
A toy: 20 problems per new site, a site patch costs 1 day, a general fix costs 3 days and removes 35% of that kind of problem from every later site. Dyna's anchors, drawn as labels, are its claims: "weeks-to-months" per site (May 2026) and "as short as three days" (August 2026).
Work the toy by hand. With every problem patched locally, each site costs 20 problems × 1 day = 20 days, about four working weeks, forever. That is Dyna's "weeks-to-months", and the line never bends. Now solve everything generally. Site 1 costs 20 × 3 = 60 days, three times worse. But site 2 starts with 35% of its problems already solved: 20 × 0.65 × 3 = 39 days. Site 3: 20 × 0.65² × 3 = 25 days.
site k costs 20 × 0.65k−1 × 3 days → site 10: 20 × 0.021 × 3 = 1.2 days
The general path is slower at first and much faster later. Dyna says the same thing in words: "We got there by choosing the slower path early: reusable models, tooling and infrastructure instead of a fix for every site." The May post gives the test: "The test of a channel is whether the next deployment is faster than the last one."
The model itself is the biggest general fix. The Dyna-1 post said that at a new site "zero-shot generalization often sees quality and throughput drop", and on-site training fixed it. The Dyna-2 post reports that at customer sites neither model had seen, Dyna-1 passed 46% and production Dyna-2 models passed 87%. Every point of zero-shot success is on-site work that never has to happen.
One more transfer reaches all the way back. Dyna says what it learns about where models struggle in production "is starting to shape what we pre-train on, not just what we post-train on, and that is the bigger lever". The May post makes the same argument about the field: "The post-training signal has to come from real deployments." The loop's output is not just the next checkpoint. It is the next pre-training mix.
def days_per_site(general_share, sites=10, problems=20, patch=1, fix=3, carry=0.35): covered, out = 0.0, [] for _ in range(sites): left = problems * (1 - covered) # problems this site still has out.append(left * (general_share * fix + (1 - general_share) * patch)) covered += (1 - covered) * general_share * carry # general fixes carry forward return [round(d, 1) for d in out] print(days_per_site(0.0)) # [20.0, 20.0, 20.0, ...] never gets faster print(days_per_site(1.0)) # [60.0, 39.0, 25.4, 16.5, 10.7, 7.0, 4.5, 2.9, 1.9, 1.2]
Chapter 10
Turn a scripted picker into a collector, a referee and a correction rig
You do not need a fleet to run the loop. You need the same stages at desk scale. If you own an SO-101 leader and follower pair with a scripted, calibrated pick-and-place loop, you already have three of the hardest parts. You just have not given them their new jobs yet.
stages 1 and 2
Your script runs all night by itself. Record every run in a policy-learning format: camera frames, joint angles and the commanded joints. The successes become demonstrations for the first learned policy.
stages 3 to 5
The script's "did the object land in the zone" check is a success label, a crude reward of 1 or 0. The script's phases (reach, grasp, lift, carry, release) are free step labels, your SOP.
stage 7
The leader arm. When the learned policy fumbles a step, grab the leader, press a foot switch, fix it, release. The recorder tags those frames as an intervention.
Start with the referee, because every later stage trusts it. A zone check is a crude reward: cheap and automatic, but not the same as "a good placement". A cube pushed into the zone counts. A cube placed well but 2 mm over the line does not. If you train only on what the referee accepts, its mistakes become your policy's habits.
A top view of the zone. Each dot is where a cube ended after one episode. Hollow dots were good placements; crossed dots were pushed or tossed in. Slide the tolerance and watch what the referee accepts.
A toy batch of 100 episodes: about 70 good placements scattered near the centre, about 30 failures, some of them pushed or tossed into the zone. The second check stands in for any step label your script already knows (here: the release happened over the zone). Your real rates will differ; measure them by hand on 50 episodes.
Work the device's default batch by hand. Out of 100 episodes, 70 are good placements and 30 are not. With a 40 mm tolerance the referee accepts 66 of the good ones and 13 bad ones that were pushed or tossed in. The filtered training set has 66 + 13 = 79 episodes, and 66 / 79 = 84% of it is what you want. It also rejects 4 good placements that landed just outside the line. Add the step check (the gripper opened over the zone) and most pushed-in cubes drop out: 66 good and 4 bad, so 66 / 70 = 94%.
purity = accepted good / all accepted = 66 / 79 = 84% → with the step check, 66 / 70 = 94%
The lesson is the same one Dyna learned at fleet scale: an end-to-end check alone is not enough. You want the granular view too. Your script knows its own phases, so it can tell "released over the zone" from "knocked it in while retreating". Use that.
Be honest about the gate at desk scale. With 40 trials each, a policy has to improve by a lot before you can tell. From Chapter 8, a change from 60% to 75% success needs about (1.96 + 0.84)² × (0.24 + 0.1875) / 0.15² = 7.84 × 0.4275 / 0.0225 ≈ 149 trials per side to detect reliably. So at your desk, look for big jumps, and keep each checkpoint's numbers so trends show over several cycles.
Here is the whole loop in runnable Python. It runs as-is with a simulated arm, so you can read the output before touching hardware. Replace FakeArm with your scripted picker and the retrain body with your LeRobot training call; everything around them stays.
"""A desk-scale deployment flywheel for an SO-101 pick-and-place cell. Runs as-is with a simulated arm: python3 so101_flywheel.py""" import json, math, random STEPS = ["reach", "grasp", "lift", "carry", "release"] ZONE = (0.20, 0.00, 0.04) # zone centre x, y and half-width, metres class FakeArm: """Stand-in for the real robot. Each policy has a per-step success chance.""" def __init__(self, seed=0): self.rng = random.Random(seed) def run_episode(self, skill, takeover=None): """skill: step -> success chance. takeover(step) -> True if you grab the leader arm.""" frames, t = [], 0.0 for step in STEPS: ok = self.rng.random() < skill[step] human = False if not ok and takeover and takeover(step): ok, human = True, True # you fixed it with the leader arm frames.append({"t": round(t, 2), "step": step, "ok": ok, "intervention": human}) t += 1.0 + self.rng.random() if not ok: break placed = all(f["ok"] for f in frames) and len(frames) == len(STEPS) spread = 0.025 if placed else 0.12 # where the cube ends up xy = (ZONE[0] + self.rng.gauss(0, spread), ZONE[1] + self.rng.gauss(0, spread)) return {"frames": frames, "cube_xy": xy, "true_success": placed} def referee(cube_xy, tol=ZONE[2]): """The scripted 'did it land in the zone' check: a crude reward, 1 or 0.""" return int(abs(cube_xy[0] - ZONE[0]) < tol and abs(cube_xy[1] - ZONE[1]) < tol) def label(ep): """Per-step labels for free: the script knows its phases.""" last = ep["frames"][-1] mode = None if last["ok"] else "failed_" + last["step"] return {"steps": [f["step"] for f in ep["frames"]], "mode": mode, "reward": referee(ep["cube_xy"]), "corrected": any(f["intervention"] for f in ep["frames"])} def collect(arm, skill, n, takeover=None): eps = [arm.run_episode(skill, takeover) for _ in range(n)] for e in eps: e["label"] = label(e) return eps def failure_table(eps): counts = {s: 0 for s in STEPS} for e in eps: m = e["label"]["mode"] if m: counts[m.replace("failed_", "")] += 1 return counts def curate(eps, focus, max_clips=40): """Every corrected episode that touches the focus step, plus accepted successes.""" keep = [e for e in eps if e["label"]["corrected"] and focus in e["label"]["steps"]] keep += [e for e in eps if e["label"]["reward"] == 1 and not e["label"]["corrected"]][:max_clips] return keep def retrain(skill, data, focus): """Toy training: corrections at a step raise its success, with diminishing returns. Swap in: LeRobot training on (old dataset + data), started from the current checkpoint.""" new = dict(skill) n_fix = sum(1 for e in data if e["label"]["corrected"]) for s in STEPS: room = 0.99 - new[s] gain = (1 - math.exp(-n_fix / 15)) if s == focus else 0.05 * (1 - math.exp(-len(data) / 60)) new[s] = round(new[s] + room * gain, 3) return new def gate(arm, cand, cur, trials=40): """Same cell, same number of trials for both. Ship only if no step got clearly worse.""" a, b = collect(arm, cand, trials), collect(arm, cur, trials) sa = sum(e["label"]["reward"] for e in a) / trials sb = sum(e["label"]["reward"] for e in b) / trials fa, fb = failure_table(a), failure_table(b) worse = [s for s in STEPS if fa[s] > fb[s] + 3] # crude: 3 more failures out of 40 return sa >= sb and not worse, sa, sb if __name__ == "__main__": arm = FakeArm(seed=1) skill = {"reach": .97, "grasp": .80, "lift": .96, "carry": .90, "release": .95} for cycle in range(1, 4): eps = collect(arm, skill, 100) # 1-2: run and log table = failure_table(eps) # 3-5: segment, label, measure focus = max(table, key=table.get) fixes = collect(arm, skill, 30, takeover=lambda s: s == focus) # 7: you, at the leader arm data = curate(eps + fixes, focus) # 6: the few right clips cand = retrain(skill, data, focus) # 8 ok, sa, sb = gate(arm, cand, skill) # 9 print(f"cycle {cycle}: failures {table} -> focus {focus}; " f"gate {'PASS' if ok else 'BLOCK'} ({sb:.0%} -> {sa:.0%})") if ok: skill = cand # 10: push to your one robot print(json.dumps(skill)) # cycle 1: failures {'reach': 5, 'grasp': 26, 'lift': 4, 'carry': 11, 'release': 6} -> focus grasp; gate PASS (55% -> 65%) # cycle 2: failures {'reach': 2, 'grasp': 10, 'lift': 2, 'carry': 16, 'release': 2} -> focus carry; gate PASS (62% -> 68%) # cycle 3: failures {'reach': 2, 'grasp': 13, 'lift': 3, 'carry': 12, 'release': 4} -> focus grasp; gate PASS (50% -> 50%)
Read the printed output. In cycle 1 grasping is the top failure, the corrections target it, and the gate passes. In cycle 2 grasp failures fell from 26 to 10, so carrying takes the top spot: the bottleneck moved. Cycle 3 shows the desk-scale gate's weakness. The referee scores both checkpoints at 50% on 40 trials, because 40 trials are noisy. Keep the history; trust trends over single gates.
Chapter 11
Gather every number, the loop as code, and the lessons to read next
Here is the whole lesson in one paragraph. A model that works in a demo still has to meet a customer's number every day. Dyna reports going from about 480 to 1,590 table-ready napkins per shift against a target of 1,500. The loop that does it records every shift, cuts each episode into SOP steps, labels each step's outcome and failure mode, and counts failures per step, site, robot and checkpoint. It checks whether a failure is hardware before treating it as data. Then it curates the few right hours, adds corrections from the policy's own mistakes, retrains, gates on fleet-scale numbers, and pushes in stages. Each fix that lives in the model, tools or data carries to the next site; each site patch does not.
Each dot is a lesson, placed by the stage of the loop it goes deeper on. Tap one to read what it adds.
Every dot links to a lesson on this site.
| What | Number | Source |
|---|---|---|
| Customer target | 1,500 table-ready napkins per 18-hour shift | Dyna, Aug 2026 |
| Dyna-1 at launch | ~35 /h, 75% pass, about 480 a shift | Dyna, Aug 2026 |
| Dyna-2 today | 95 /h, 93% pass, 1,590 a day; 2.7× Dyna-1's rate | Dyna, Aug 2026 |
| Fleet data | over 1 TB of raw data a day; a robot repeats the task 1,000+ times a day | Dyna, Aug 2026 |
| SOP | 11 steps (S1 to S11); Step 1 pulls one napkin off the stack | Dyna, Figure 6.1 |
| Slipping site, time | 38 s to 46 s a napkin; Step 1 from 6.4 s to 10.8 s | Dyna, Figure 6.1 |
| Slipping site, failures | 357, 502, 725 a week; missed grabs 108, 210, 380 | Dyna, Figure 6.2 |
| Cause | a worn gripper | Dyna, Aug 2026 |
| New site | "weeks-to-months" of on-site engineering (May 2026); "as short as three days" (Aug 2026) | Dyna posts |
| Longest deployment | ~10 months of daily use (May 2026) | Dyna, May 2026 |
| Zero-shot at customer sites | Dyna-1 46%, production Dyna-2 87% | Dyna-2 post |
| See a 1-in-200 failure | 30 trials: 14%; 460 trials: 90%; 1,000: 99.3% | our arithmetic |
| Spot 3% → 4% | about 5,300 napkins per checkpoint | our arithmetic |
# the deployment flywheel in 24 lines: one turn of the slow loop def turn(fleet, model, budget_h=4): episodes = fleet.upload_verified() # ch2: streams + always-on window labels = [l for e in episodes for l in autolabel(e)] # ch3-4: SOP steps, outcome, mode, conf review(l for l in labels if l.conf < 0.7) # ch4: people where labels are unsure audit = sample(labels, 1118) # ch4: +-1 point on the label error rate table = failures_by(labels, "step", "mode", "site", "robot", "ckpt") # ch5 for issue in table.top(): if issue.one_robot_only or issue.hw_drift: # ch5: locate, then diagnose fleet.service(issue.robot); continue hours = greedy_allocate(table, budget_h) # ch6: seconds saved per hour slice_ = query(episodes, labels, hours) # ch6: the few right hours slice_ += fleet.corrections(issue, leader_arm=True) # ch7: intervention-flagged cand = finetune(model, old_mix + slice_) # ch8 if not bench(cand, trials=30): return model # ch8: catches "does not work" canary = fleet.rollout(cand, share=0.1) # ch8: same sites, same days verdict = gate_step(canary.per_step(), fleet.control.per_step()) if verdict[0] == "widen": fleet.rollout(cand, share=1.0); model = cand else: fleet.rollback(canary) # the regression is next turn's top issue break keep_as_query(table.top()) # ch9: every fix leaves something behind return model
Now press Present or Teach and explain, from memory, how a labelled failure at one site becomes a better checkpoint for every site, and where a worn gripper breaks that story. Then go back to the flywheel, and find the failure that data cannot fix.