AmperesFailure Lab

Failure analysis for robot manipulation

Every robot failure, caught, explained and fixed.

Amperes Failure Lab records every attempt your robot makes, labels each failure, traces it to a root cause and verifies the fix by replay, with the data kept on your own machine.

Proved on real hardware: a UFactory xArm6 that plays chess, where every move is a trial the lab can triage.

The chess console during a game on the real xArm6
Chess console during a game on the real xArm6.

In the lab so far

Real xArm6 chess trials since the first chess game on 29 Oct, counted from the lab's own store at 2:39 PM on 30 Oct.

193chess trials recorded in 36 sessions over two days; 142 succeeded
38failures labelled: 30 missed grasps, 7 slips, 1 piece not moved
13invalid trials kept out of training data: 8 safety stops, 5 infrastructure errors
2flagged critical by rule O002: the recorded outcome contradicted independent verification

How it works

What the lab does

Point it at a robot cell. Every attempt becomes an episode with its evidence, and every failure gets a name, a cause and a fix you can check.

01

Record

Every attempt: camera images, depth, poses, the gripper reading and the outcome.

02

Label

Each failure gets a name: missed grasp, slip, collision stop, unsafe motion refused.

03

Triage

Recurring failures are grouped into incidents and traced to a root cause.

04

Verify

Replay and regression cases show whether a fix helped and what it broke.

05

Export

Clean, labelled datasets in LeRobot format, plus incident and readiness reports in Markdown and JSON.

One console, eleven views

Robot labLive robotLabelOverviewEpisodesQualityIncidentsOperationsReplay & regressionEvaluationExport

Local-first. Episodes, findings and incidents live in a SQLite store under amperes_data/ on your own machine. Only two things send data out: opt‑in MongoDB Atlas sync, and Claude piece recognition in the chess robot, which sends camera photos to Anthropic's API and runs only when an ANTHROPIC_API_KEY is set.

Fleet memory on MongoDB Atlas

Find the same failure in other sessions

Opt‑in, with MONGODB_URI set. Sync sends episode index rows, quality findings, incidents, events and one failure-signature vector per episode. No raw streams leave the machine. Similar failures are then found with Atlas Vector Search.

All 39 robot sessions are synced. A missed grasp from a chess game on 30 Oct (ep_3a3941af689d14f7) matched 6 missed grasps with identical recorded evidence in other sessions, one of them from the evening before.

# opt-in: needs MONGODB_URI
python -m amperes.cli atlas sync <dataset_id>
python -m amperes.cli atlas similar <episode_id> -k 6

A signature is a deterministic vector built from recorded evidence: the quality rules that fired, the quality status, the event classes and the failure category. There is no learned embedding. In the console, the same actions are the Sync to MongoDB Atlas and …across all stations (Atlas Vector Search) buttons, shown only when Atlas is configured.

Episode detail in the Failure Lab console after an Atlas Vector Search on a missed grasp: eight matches, each a GRASP_FAILURE on sfhack1-main with similarity 1.000
Atlas Vector Search from the console, on a missed grasp. The console asks for 8 matches; each is another missed grasp (GRASP_FAILURE) on sfhack1-main with identical recorded evidence (similarity 1.000).

Proof

The proof: a robot that plays chess

Chess is a hard, honest test for a pick-and-place robot. If the lab can debug that in two days, it can debug your pick-and-place cell.

32 pieces

Small objects in six different shapes, crowded together.

Millimetres

Every piece has to land in the middle of its square.

Hands nearby

A person reaches into the workspace, right next to the arm.

Checkable

The rules of chess and the wrist camera check every move; the tripod camera records it.

The tripod camera's view of the xArm6 behind a game in progress on the real board
Tripod camera. The xArm6 behind a game in progress on the real board.
The wrist camera's overhead view of the board, with every square located and labelled
Wrist camera. The robot's own view from above, every square located and labelled.

What the chess robot does

  • Sets up the board from a messy table: it identifies the upright pieces and puts each one on its start square.
  • Plays a person. The wrist camera sees your move, or you type it, and the arm answers.
  • Plays both sides by itself: robot against robot, with the arm making every move.
  • Calls every move out loud in plain words, with squares in capitals: White knight to F3, check.
  • Never records a move that did not happen. The gripper reading and the camera must both confirm it; a missed grip is retried at once.
  • Stops for hands under the gripper and waits until they are gone; after 20 s it stops the session.
  • Resets the board after the game. It tracks every piece, uses slots beside the board and keeps spare queens in reserve for promotion.

The rig

Arm
UFactory xArm6 with a G2 gripper, on the Viam machine sfhack1
Cameras
Intel RealSense on the wrist, a second RealSense on a tripod
Motion
Viam motion service with the table and obstacles modelled
Moves
Stockfish picks the robot's move
Pieces
Claude vision names each piece, cross-checked against its depth-measured height

Measured

Robot moves confirmed by the camera, game 1 (29 Oct)10 of 10
Pick-and-places in a row after the camera fix (30 Oct)14 of 14
Simulated board resets of all 34 pieces, zero gripper contact600 of 600
Workspace scan, max error over 186 commanded poses0.34 mm

Failures fixed

Seven failures, traced and fixed

Every chess move is recorded as a trial. These are the failures found while building and running the chess robot over two days, what caused them and what changed.

01

Grasping air beside pieces

CauseThe survey camera placed pieces about 15 mm off, measured on pieces the arm had put down itself.
FixA fitted correction for the camera's position bias.
Result4.5 mm mean error, then 14 of 14 pick-and-places in a row.
02

Retried grips pressed pieces into the board

CauseThe place height ignored where the piece had actually been gripped, so a retried grip pushed it into the board, with a risk of breaking it.
FixPlace height follows the real grip height. The last 60 mm above the board run at 10 deg/s; transit runs at 75 deg/s.
ResultA re-gripped piece is set down at its own height, slowly.
03

Moves recorded that never happened

CauseThe gripper closed on air and the move was still logged as played.
FixA gripper-position check flags an empty grip and the arm retries at small offsets right away. The camera must see the board change before a move is committed.
ResultOnly moves that physically happened reach the game record.
04

Collision stops on long, fast swings

CauseBig wrist turns at speed tripped the arm's overcurrent collision detection.
FixBig wrist turns are split into two half-turns, and transit is routed through the motion service in shorter moves.
ResultThe motion changed; the arm's collision detection stays at its configured sensitivity.
05

Board reset going in circles

CauseThe reset planner moved the same piece back and forth.
FixA loop guard: remembered board states, forced follow-up moves and an operation limit.
ResultA reset can no longer repeat itself; it makes progress or stops at the limit.
06

A typed move was ignored

CauseThe console kept waiting for the camera after a move had been typed in.
FixTyping a move ends the camera watch, and the Play button stays enabled while the camera watches.
ResultA typed move and a seen move both work, whichever comes first.
07

Pieces mislabelled: a rook read as a pawn, a bishop misread

CauseFrom straight above, piece shapes are hard to tell apart.
FixClaude vision plus a depth-measured height check and a confidence gate. An operator's correction stays attached to the piece as it moves.
ResultAn unsure piece is left alone and looked at again; an operator's correction is made once and follows the piece.

Demo

See it run

Both consoles run locally at localhost:8765. Play a game in the chess console; when it ends, End game + import brings every move into the Failure Lab as a trial, next to everything else the arm did.

Chess console with the live board, game settings and the robot's last move
Chess console. The live board, the game settings (who the robot plays, call out every move) and the robot's last move with its camera views.
Episodes tab of the Failure Lab console, listing recorded trials
Episodes. Every recorded attempt with its outcome, failure category and quality status.
Incidents tab of the Failure Lab console, listing recurring failures and one incident in detail
Incidents. Failures grouped into incidents. This one is rule O002, a recorded outcome that contradicts independent verification, with observed facts, possible causes and next steps.
Label tab of the Failure Lab console, with a real chess move queued for review, the verifier's call and both camera views
Label. A real chess move queued for review, with the verifier's call and both camera views.

Rehearsal, 30 Oct, 2:33 PM

Robot against robot on the real arm, from a mid-game position.

6 of 6half-moves confirmed by the wrist camera and called out loud

9 of 9pick-and-places succeeded, 0 failures

Calls included Black knight takes D4. White knight takes D4. Black pawn takes D4. White queen to B4. Black queen to F6. and, at the end, Game over: stopped after 6 half-moves.

Run it

# Python 3.12
git clone \
  https://github.com/vnmoorthy/amperes-haunted-chess \
  failure-lab
cd failure-lab
python3.12 -m venv .venv
.venv/bin/pip install -r requirements.txt
cp .env.example .env   # your Viam machine keys
.venv/bin/python -m amperes.cli serve --port 8765

Then

  1. Open http://localhost:8765/ for the Failure Lab and /chess for the chess robot.
  2. To bring a game into the lab, press End game + import only when the phase reads your move or game over. Ending a game while the arm is moving stops it mid-move.
  3. No robot? python -m amperes.integrations.chess_sim replays the reset planner offline, and .venv/bin/python -m pytest -q runs the 132 tests.
  4. Giving the talk? Follow the 3-minute storyboard.

Safety

Built to work next to people

A person plays from the other side of the board, so the guard rails are in code, not in a checklist.

Hand guard

Before every descent the wrist depth camera looks under the gripper. Anything more than 110 mm above the board makes the arm hold still; if it is still there after 20 s, the session stops.

Safety envelope

Every target is checked against a box around the board with clearance margins, and no move may turn the gripper more than 100 degrees.

Slow near the pieces

Transit runs at 75 deg/s; the last 60 mm above the board run at 10 deg/s.

Telemetry watchdog

A separate connection watches the arm while it moves. If telemetry stops, the arm stops.

Operator acknowledgement

Dry run by default. The arm moves only after the operator confirms the e-stop is in reach, and STOP works mid-move.

Recorded, not hidden

Refused motions and safety stops are recorded in the lab with the evidence attached. Safety stops are marked invalid and kept out of training data.

Built to reuse

Bring your own robot

Chess was the test. Nothing in the lab is specific to it.

Any Viam arm, gripper and camera

Components are chosen by name: AMPERES_ARM, AMPERES_GRIPPER, AMPERES_MOTION, AMPERES_CAMERAS.

Any recorded session

The lab ingests recorded Viam sessions through a read-only recorder, along with JSONL, CSV and LeRobot datasets.

Clean datasets out

LeRobot export, incident and readiness reports in Markdown and JSON, and opt‑in MongoDB Atlas sync.

Pick-and-place modules

Multi-view survey with a fitted camera correction, a clearance-aware reset planner and a supervised Viam session you can lift as they are.

Tested

132 automated tests, and an offline simulator that replays reset plans and counts gripper contacts.

Runs on your machine

The lab's API, console and SQLite store run locally, next to the robot. Data leaves only through opt‑in Atlas sync and Claude piece recognition.

Honest limitations

  • It cannot stand a fallen piece back up; a top-down parallel gripper can't.
  • Telling pieces apart from straight above needs the height check and, now and then, an operator's correction.
  • Speed is capped by the arm's own collision detection.
  • Arm errors are cleared by hand; nothing in the lab clears them automatically.