Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

fieldtrial

Find out whether your robot policy actually got better.

CI PyPI License: Apache-2.0

fieldtrial is an open-source Python framework for statistically rigorous, real-world evaluation of robot policies. LeRobot trains the policy; fieldtrial tells you whether it actually got better.

Why

Real-world evaluation is slow, noisy and ad hoc. With 40 rollouts, the 95% confidence interval for a success rate is 12 to 15 percentage points wide on each side, so many apparent improvements from a fine-tuning run are just noise. fieldtrial helps at every stage:

  • Before: how many rollouts do I need? What is the smallest difference this evaluation can detect?
  • During: a randomized, blinded schedule, and a phone-friendly operator console that records the outcome, the furthest stage reached and the failure mode of each rollout.
  • After: the right statistics for the design (exact tests, paired analyses, multiplicity control), honest wording, and a self-contained report.

30-second demo

$ uvx fieldtrial compare 74/80 91/120
Arm 1: 74/80 = 92.5% (95% CI 84.6%–96.5%)
Arm 2: 91/120 = 75.8% (95% CI 67.4%–82.6%)
Difference +16.7 pp, Newcombe 95% CI [+6.2 pp, +26.0 pp]
Boschloo p = 0.0020 (two-sided); rejects H0 at α = 0.05
Fisher p = 0.0022

$ uvx fieldtrial power --p1 0.76 --p2 0.90      # rollouts needed to detect 76% → 90%
112 per arm (pooled-z)

$ uvx fieldtrial demo                           # a simulated study in the console

fieldtrial demo opens a half-run, blinded study with a simulated robot. Run the rest from the keyboard (Space, Space, Enter), unblind, and read the report.

The operator console on a phone: a trial in progress with its blind code, timer and a large Stop button Labelling a trial: furthest stage reached, why it ended, failure tags

The HTML report: summary, success rate per arm with confidence intervals, primary analysis and a forest plot

Quickstart

$ uv tool install fieldtrial              # or: pip install fieldtrial
$ fieldtrial init my-study                # writes my-study/study.yaml
$ fieldtrial plan my-study --baseline 0.75
$ fieldtrial lock my-study                # freezes the design and randomizes the schedule
$ fieldtrial serve my-study --lan         # scan the QR code with a phone at the robot
$ fieldtrial unblind my-study
$ fieldtrial report my-study              # my-study/reports/report.html

A study is one folder: study.yaml (the design) and a SQLite database. Everything is local and works offline; fieldtrial sends no telemetry.

What you get

  • Design: randomized complete blocks with balanced arm order, blind codes, a design hash, locking and logged amendments.
  • Console: sessions with a rig checklist, a timer, stage and failure-tag labels, 10-second undo, invalid trials with automatic rescheduling, a live mirror screen, keyboard and foot-pedal keys, LAN access with a QR code.
  • Analysis: the primary test follows from the locked design (exact McNemar with a Tango interval, Cochran–Mantel–Haenszel, or Cochran's Q with Holm), plus an independent-samples sensitivity analysis, stage funnels, time to success, drift checks and a list of every deviation from the plan.
  • Reports: self-contained HTML with charts, Markdown for pull requests, and a versioned JSON results model.
  • Integration: a REST API with a dependency-free Python client for custom runtimes, CSV import and export, and fieldtrial.stats as a library.

Every statistical function is tested against an independent reference implementation. Reports only describe a difference when the pre-registered test rejects; otherwise they say what the study could have detected.

How it fits with LeRobot and openpi

fieldtrial complements LeRobot and openpi and never forks them. It is not a training framework, a simulation benchmark, a robot driver, a labeling platform or a cloud service. In manual mode, fieldtrial schedules and records the trials and you run the robot however you like. For real blinding, the command runner launches your rollout command (for example lerobot-rollout) for each arm, and the openpi_router runner routes an openpi client's traffic to each trial's policy server; see Real blinding with runners.

How to cite

If fieldtrial helps your research, please cite it (see CITATION.cff):

@software{benko_fieldtrial,
  author  = {Benko, Rok},
  title   = {fieldtrial: statistically rigorous real-world evaluation for robot policies},
  url     = {https://github.com/rokbenko/fieldtrial},
  license = {Apache-2.0}
}

For evaluation practice in general, see Kress-Gazit et al. (2024), Robot Learning as an Empirical Science: Best Practices for Policy Evaluation, arXiv:2409.09491.

Development

See CONTRIBUTING.md.

Metadata

Release files for fieldtrial 0.2.0a2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for fieldtrial 0.2.0a2
File Size Uploaded
fieldtrial-0.2.0a2.tar.gz 260.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for fieldtrial 0.2.0a2
File Interpreter ABI Platform
fieldtrial-0.2.0a2-py3-none-any.whl Python 3 none any Details

Total release size: 493.1 kB

Release files / fieldtrial-0.2.0a2.tar.gz

Download URL fieldtrial-0.2.0a2.tar.gz
Size 260.2 kB
Tags Source
SHA-256 checksum
How to use checksums
542be6d0c173a6180c44e257d2be3606de9bd25eeb0aed113eb97501de4caa82
BLAKE2b-256 checksum
How to use checksums
cc06372f588230c0ca4b67ef1a0a0b1e77bb57edf2ebe0526c7226b6484e0a26
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.12

Release files / fieldtrial-0.2.0a2-py3-none-any.whl

Download URL fieldtrial-0.2.0a2-py3-none-any.whl
Size 232.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
323de67d42e4261b917cc86c698f2032bc6b808f2b8efbd8ae7ab2053c9bf65e
BLAKE2b-256 checksum
How to use checksums
de7fb683ffedc4f86b5782693c48d229c9fe35dc7cb7ee9e195cf9dc4a37c609
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.12
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page