Submit measurements
Measured values are shared like benchmark results. Anyone who has a part on a test rig can publish what they measured, and every unit anyone measures adds a row, so the page of a part shows how many units were measured, by how many people, and how their values sit against the datasheet: a statistical picture of the true datasheet. Robotparts publishes every record and judges none of them by hand; the build checks shapes, units, intervals and pinned evidence, and a reviewer reads the method.
The step-by-step guide is docs/measurements.md (rendered below); the contract is SCHEMA2.md §6 (Measurements) in the robotparts repository. The guide's own section 4 covers uploads from the checker, which are off for now (how to submit today).
How to submit today
- Write one bundle per run on one unit: which part, which unit, how you measured it, and each value with its unit, scope and evidence. Check it on the bundle checker, which checks it as you type against this release (start one from a part's page: Measured, “check a measurement bundle for this part”), or with
python -m robotparts.measure check my-bundle.jsonfrom the installed package.python -m robotparts.measure new <id>prints one to fill in. - Download it (the checker's “Download the bundle” saves
<id>-<date>.measurement.json) and send the file to Zach Yamaoka, who runs robotparts, by chat or email. robotparts has no public repository or inbox yet, so there is no pull request to open. - The git flow, for whoever holds the repository:
python3 tools/measure.py submit my-bundle.jsonchecks the bundle again and writes it as a new file inparts/<id>/measured/, never editing one; commit that file, and the next release publishes it.
Uploads are off. Signing in on the checker to keep a bundle in your account and send robotparts a read link needs robotparts registered with Simple Hosted Files; until then the checker checks and downloads only, and loads nothing from another site.
What lands in the repository
One new file per run: parts/<id>/measured/YYYY-MM-DD[-slug].json, for example 2026-10-21-bam-one-dof-test-rack.json; tools/measure.py submit writes it from your bundle, every field from the bundle. Never edit a committed file: a correction is a new record that supersedes the old one.
{
"format": "robotparts/2",
"part": "<part id>",
"license": "CC-BY-4.0",
"records": [
{
"key": "gear_ratio",
"value": 9.615,
"unit": ":1",
"ci95": [
9.469,
9.757
],
"method": "how you measured it",
"rig": "what you measured it on",
"scope": "as_mounted",
"mounted_in": "the assembly, as your rig's own record names it",
"specimen": "which unit",
"conditions": {},
"date": "YYYY-MM-DD",
"contributor": "who you are",
"evidence_url": "https://github.com/<owner>/<repo>/blob/<40-hex commit>/<file>#L10-L20",
"raw": "the evidence's own words"
}
]
}
Each record
| Field | Rule |
|---|---|
key | a number-valued registry key, so results from different rigs compare: gear_ratio, rotor_inertia, gearbox_input_inertia, output_inertia, rated_torque, peak_torque, max_output_speed, rated_speed, backlash, range_of_motion, efficiency, kv, kt, pole_pairs, resistance_line_to_line, coulomb_friction, viscous_friction, torque_ripple, twin_tracking_error, nominal_voltage, voltage_min, voltage_max, peak_phase_current, continuous_phase_current, mass, outer_diameter, axial_length, resolution_h, resolution_v, frame_rate_max, fov_h, fov_v, depth_range_min, depth_range_max, output_voltage, rated_power, rated_current, peak_power, peak_current, peak_duration, ovp_max_voltage, continuous_current, bitrate_max, breakaway_torque, stribeck_velocity, friction_load_coefficient, thermal_resistance, thermal_time_constant, inductance_line_to_line, torsional_stiffness, current_loop_bandwidth, command_latency, delivered_stiffness, dof, payload, reach, repeatability, max_tcp_speed, power_typical, stroke, grip_force_max, noise, wear_life_cycles, air_consumption, exchange_rate_max, cpu_cores, cpu_threads, cpu_clock_max, cpu_mark, cpu_single_thread_mark, ram, storage, lan_ports, lan_bitrate_max, usb3_ports, can_ports, gpu_memory, memory_bandwidth, fp32_throughput, fp16_tensor_throughput, int8_throughput, ai_throughput_marketed, power_max |
value, unit | in the key's own definition and direction, with a unit the key allows; a positive key is > 0. Converted from how the evidence states it, with the evidence's words kept in raw |
ci95 | [lo, hi] with lo ≤ value ≤ hi (round outward when you convert), or null |
method, rig | how, and on what |
scope | part (the part alone on a test rig) or as_mounted (with whatever it drives). Required |
mounted_in | required for as_mounted, quoting the rig's own record of the station; null for part |
specimen, conditions | which unit; conditions such as rotor_harmonic, firmware, sim_model_sha256 (required where the key says so) |
date, contributor | when it was measured (not when a stored value was read back), and by whom; the site credits the contributor |
evidence_url, evidence_sha256 | pinned evidence: a GitHub blob link at a full 40-hex commit with #L lines, a raw.githubusercontent.com link at a commit, a DOI, a Software Heritage id, or any other https URL with the sha256 of the bytes you read |
raw | the evidence's own words. Required |
supersedes, supersede_reason | "<file>#<index>" of an earlier record of the same key, specimen and contributor that this one corrects, and why |
Scope: the part or the assembly
- Keys measured on the part alone only (scope
part): rotor_inertia, gearbox_input_inertia, output_inertia, mass, outer_diameter, axial_length, dof, payload, reach, repeatability, max_tcp_speed, power_typical, stroke, grip_force_max, noise, wear_life_cycles, air_consumption, cpu_cores, cpu_threads, cpu_clock_max, cpu_mark, cpu_single_thread_mark, ram, storage, lan_ports, lan_bitrate_max, usb3_ports, can_ports, gpu_memory, memory_bandwidth, fp32_throughput, fp16_tensor_throughput, int8_throughput, ai_throughput_marketed, power_max. Mounted, they would measure the assembly. - Keys the load cannot change, so an as-mounted value is still the part's: gear_ratio, pole_pairs, resistance_line_to_line, resolution_h, resolution_v, inductance_line_to_line.
- Any other as-mounted value is shown beside the datasheet and never judged against it.
What happens next
tools/measure.py submitchecks the bundle against the working tree, then the part's folder with the build's own rules, and creates the new file; it never opens an existing one for writing.- A reviewer reads your method and evidence, and commits the file.
- The next release's deploy runs the acceptance tests (schema, units, scope, interval, pinned evidence, supersedes, append-only) and publishes it: the part page shows it under Measured, beside the datasheet value with a verdict (within or outside your interval), and in the statistics across units per key.
- Licence: a file may name an SPDX licence from the registry's redistributable list; once set it never changes.
Parts measured so far
| Part | Records | Contributors | Keys |
|---|---|---|---|
| Steadywin GIM4305-10 | 9 | 1 | coulomb_friction, gear_ratio, torque_ripple |
The guide: docs/measurements.md
As written in the robotparts repository; the file itself is at /authoring/measurements.md.
Measurements, shared like benchmark results
Many people measure many units of one motor model, and robotparts turns their records into a statistical picture of the true datasheet, the way GPU benchmark sites do for graphics cards (Zach, 2026-10-22). The record format is SCHEMA2.md §6, and it is unchanged. This page covers what sits around it:
- The submission bundle: what a contributor sends for one run on one unit, and what gets refused.
- `robotparts measure`:
submitwrites a bundle as a new file inparts/<id>/measured/, andstatsprints the picture. - The statistics: per part and key, with scope
partandas_mountedkept apart. - How friends and family upload: the
/measure/page on robotparts.dev, backed by Simple Hosted Files. Uploads are off until robotparts is registered with it; today the page checks a bundle and downloads it to send.
| file | what |
|---|---|
schemas/measurement-bundle.schema.json | the bundle's shape |
python/robotparts/measure.py | the rules (bundle_problems), bundle → §6 file (measured_document, measured_file_name), the statistics (stats_of_record, stats), and python -m robotparts.measure |
tools/measure.py | the repository's robotparts measure command: submit, check, stats, new |
site/measure/ | the upload page (index.html, app.js) and the same rules in the browser (rules.js) |
tests/measure/ | the lane's tests (synthetic parts only, built in temporary directories) |
1. The submission bundle
One contributor, one run, one physical unit (the *specimen*). For example:
{
"format": "robotparts-measurement-bundle/1",
"part": "aifitlab-8541438771336",
"contributor": "Ada Example",
"specimen": {"label": "unit A", "serial": "GIM-SN-0001", "board_id": null,
"purchased_on": "2026-09-01", "purchased_from": "aifitlab.com", "shared_note": null},
"rig": "Ada's bench: encoder on the rotor, camera on the output",
"method": "Counted rotor turns per output turn over 20 output turns, both read by encoders.",
"date": "2026-10-20",
"versions": {"firmware": "moteus 2024-06-12"},
"evidence": {"url": "https://github.com/ada/rig-data/blob/<40-hex commit>/runs/2026-10-20.csv#L1-L40", "sha256": null},
"raw_data": [{"url": "https://example.org/ada/run.mp4", "sha256": "<64 hex>", "title": "video"}],
"records": [
{"key": "gear_ratio", "value": 10.02, "unit": ":1", "ci95": [9.98, 10.06], "scope": "part", "mounted_in": null,
"raw": "200.4 rotor turns for 20.00 output turns"}
]
}
| field | rule |
|---|---|
part | a robotparts id: an atlas id (current or retired), or a part folder. A same_as duplicate is refused, and the message names the part it duplicates |
contributor | who measured it. The site credits them |
specimen.label | your name for this unit, used verbatim as every record's specimen. Keep it the same every time you measure that unit |
specimen.serial, board_id | the maker's serial, or the id of a board fixed to the unit (its driver's). Optional, but they are what tells units apart across contributors |
specimen.purchased_on, purchased_from | optional: when and where the unit was bought (batch effects) |
specimen.mask | optional boolean, default false. true publishes a masked token in place of serial and board_id (see Masking a unit's ids below) |
specimen.shared_note | required when someone else already measured this very unit (it was lent or sold): say how it is the same one |
rig, method, date | on what, how, and when it was measured. A record may give its own method and date |
versions | firmware, driver and analysis versions, by name. Each becomes a condition of every record (conditions.firmware) |
evidence | {url, sha256}: the run's raw data, used by every record that names no evidence_url of its own |
raw_data | more links (logs, video), listed in each record's note |
license | optional: the data licence of the new file, from registry.redistributable_licenses |
records[] | §6 values: key, value, unit, ci95 (or null), scope, mounted_in (as_mounted only), raw (the evidence's own words), optional conditions, note, evidence_url and evidence_sha256, and supersedes plus supersede_reason for a correction |
conditions.bench | optional, in a record's conditions (or in versions, for every record): the standard protocol the run followed, a non-empty string such as "robotparts-bench/1". The statistics pool only records of the same bench (§3). robotparts does not care how the data was produced; it keeps what you state |
Evidence must be pinned (§6): a GitHub blob link at a full 40-hex commit with #L lines, a raw.githubusercontent.com link at a commit, a DOI (Zenodo gives one for free), a Software Heritage id, or any https link plus the sha256 of the bytes you read (sha256sum run.csv). A Simple Hosted Files read link expires, so it is never evidence.
Refused, with a stable code. Each code is checked the same way in Python and in the browser (tests/measure/test_page_rules.py):
| code | what is wrong |
|---|---|
scope_missing | a record has no scope: part (the part alone on a rig) or as_mounted (with whatever it drives). §6 has no unknown scope |
evidence_missing, evidence_not_pinned | no evidence on the record or the bundle; or a link that is not pinned |
unknown_part, duplicate_part | the id is not a robotparts part; or it is a same_as duplicate |
unit_missing, unit_not_allowed | a value without a unit ("" only for a dimensionless key such as gear_ratio); or a unit the key does not allow |
specimen_claimed | another contributor already measured this unit (same serial or board id, or that id named in their label, e.g. the rack's CAN 14, moteus-c1 c3414184) and specimen.shared_note is empty |
bench_invalid | conditions.bench is not a non-empty string |
key_unknown, key_not_measurable, value_not_number, value_not_positive, scope_not_allowed, mounted_in_missing, mounted_in_unexpected, ci_invalid, condition_missing, conditions_reserved, conditions_conflict, raw_missing, method_missing, date_missing, date_invalid, supersedes_unknown, supersedes_mismatch, supersedes_twice, supersede_reason_missing, unknown_field, … | the other §6 rules (registry units and scopes, the interval holds the value, required conditions, corrections of the same key, unit and contributor), plus typos |
What a record becomes. Every field of the written record comes from the bundle, so nothing is invented:
| §6 record | from the bundle |
|---|---|
key, value, unit, ci95, scope, mounted_in, raw | the record |
method, date, evidence_url, evidence_sha256 | the record's own, else the bundle's |
rig, contributor | the bundle |
specimen | specimen.label, verbatim |
conditions | the record's, then versions, then specimen_serial, specimen_board_id (masked tokens when specimen.mask is true), specimen_purchased_on, specimen_purchased_from |
note | the record's note, then Specimen: <shared_note>, then Raw data: … |
supersedes, supersede_reason | the record's, for a correction |
Masking a unit's ids. A contributor who would rather not publish a unit's serial or board id sets "mask": true in the specimen. tools/measure.py submit then writes masked: plus the first 16 hex digits of HMAC-SHA256(salt, id) as conditions.specimen_serial and conditions.specimen_board_id; the raw ids appear nowhere in the published file. The id is lower-cased and its spacing collapsed first, as when two records are matched to one unit, so SN-1 and sn-1 give one token.
- The salt is yours. It is a file,
~/.config/robotparts/specimen-salt(in the directory of$ROBOTPARTS_CONFIGwhen that is set, as the live config is found), 32 random bytes at mode 0600.submitcreates it the first time a masked bundle needs it, after every check has passed;checkandsubmit --dry-runnever write it. It is never published or printed, and an existing file is never replaced (a new salt would orphan every token already published). Back it up with your own files: lose it and later runs make new tokens for the same units. - What pools. The token is the same for one salt, so your own runs of a unit stay one unit however you label them. It differs under another salt, so it never links to another contributor's record of the same unit, and the
specimen_claimedcheck cannot see a unit someone else masked. That is the cost of masking. - The label is published as written (every record's
specimen).checkwarns (mask_label_leaks_id) when a masked bundle's label contains its own serial or board id, since masking the ids would then hide nothing. - The page cannot mask. The salt cannot live in a browser, so
/measure/keepsserialandboard_idin the bundle you download or send, and says that masking happens attools/measure.py submit. Whoever runssubmiton a bundle sees the ids, and the tokens are made with their salt.
2. robotparts measure
python3 tools/measure.py submit bundle.json
submit takes a file, - for stdin, or a link: an https URL, or a contributor's Simple Hosted Files read link (…/a/<token>, fetched once from its /content). The token is never printed. Nothing is written until every step passes:
- It checks the bundle against this working tree. The build runs in process, so the part's record, its
same_asand its measurements are the onesbuild/build.pywould publish. - It turns the bundle into a §6 file named
YYYY-MM-DD-<contributor>-<rig>.json: the run's date, three words of the contributor and five of the rig. A second run on the same day becomes…rack2.json, which sorts after…rack.json. A correction always sorts after the file it corrects. - It checks the folder, new file included, with the build's own folder rules (the ones the deploy runs).
- It creates the file exclusively (
open(…, "x")), so an existing file is never opened for writing. Corrections are new records withsupersedes(§6).
Then it prints the statistics of the keys it touched. The other commands:
| command | does |
|---|---|
tools/measure.py check <bundle or link> | what submit would refuse, or the file it would write. Writes nothing |
tools/measure.py submit --dry-run <bundle> | the same, plus the file's content |
tools/measure.py stats <id> [key] [--scope part|as_mounted] [--json] | the statistics of the working tree |
tools/measure.py new <id> | a bundle to fill in: every required field is null until you write it |
python -m robotparts.measure stats|check|new … | the same from the installed package, against the release it ships |
Publishing is then the usual pull request (§6): commit the new file, run tests/acceptance_v2, and the next release puts it on the site.
3. The statistics
from robotparts import measure
for s in measure.stats("aifitlab-8541438771336"):
print(s.key, s.scope, s.n_specimens, s.median, s.interval, s.share_consistent)
stats(part, key=None, scope=None) takes an id, a RobotPart or a robotparts/2 record, and reads only the published record (measured and comparisons). There is no contract change: nothing new is published under /v2/.
- Groups. One group per key and scope,
partandas_mountedkept apart. A key with a required condition is split by its value:torque_rippleperrotor_harmonic,twin_tracking_errorpersim_model_sha256. - Bench. A record whose
conditions.benchnames a standard protocol (robotparts-bench/1) pools only with records of the same bench; records with no bench form a group of their own. A unit measured on two benches counts once in each. The bench isKeyStats.bench(Nonewithout one), is printed bydescribe()(gear_ratio · part · bench robotparts-bench/1) and appears in the Conditions column and the unit list of the part page's Measured statistics. robotparts does not define or check a bench's protocol: it is a name you state, and a name that differs by one character is another bench. - A unit counts once. Records of one physical unit are linked when they share a label from the same contributor, a serial, or a board id. An id another record names inside its label counts too, and must be at least 4 characters. Each unit's value is the median of its active records. Superseded records are left out and counted (
n_superseded). - Across units.
n_specimens,n_contributors,median,mean,std(n−1, from 2 units),mad,minandmax. Values are in the key's SI unit, never rounded.unitandfactorgive the records' own unit when they all used one. - The interval for the median is distribution-free, from order statistics: [x(k), x(n+1−k)], whose coverage is 1 − 2·P(B ≤ k−1) with B ~ Binomial(n, ½). The narrowest one at ≥ 95% is used: n = 6 to 8 gives [min, max] (96.9 %, 98.4 %, 99.2 %), n = 9 gives [x(2), x(8)] at 96.1 %, n = 20 gives [x(6), x(15)] at 95.9 %. With n ≤ 5 no pair reaches 95%, so the interval is [min, max] at its own coverage (93.75 % at 5, 50 % at 2), and n = 1 has none. *Why not a bootstrap:* resampling a handful of values under-covers, and the same records must always give the same interval.
- The datasheet. Its value is the one §6
comparisonsuses (specs[canonical[key]], in SI). A unit is *consistent* when every interval it has holds that value, *outside* when none does, and *mixed* otherwise.share_consistent= consistent ÷ (consistent + outside + mixed). Units without an interval are counted asno_ci, never guessed.as_mountedvalues of a key the load can change are shown and never judged, as in §6. A mount-invariant key such asgear_ratiois judged in both scopes. The model-level check isdatasheet_in_interval: does the median's interval hold the datasheet value?
Nine synthetic units of one model, from three contributors (a test fixture, never in parts/):
gear_ratio · part
9 specimens, 3 contributors (Ada, Bea, Cy), 9 records
median 10 :1 mean 10.0089 std 0.12985 min 9.8 max 10.3
interval for the median: [9.95, 10.04] :1 (coverage 96.09%, order statistics)
datasheet 10.0 :1 (manufacturer, https://maker.example/gim)
median vs datasheet: +0.00%; datasheet inside the median's interval
consistent with the datasheet: 5 of 9 judged specimens (56%); outside 4, mixed 0, no interval 0
The real GIM4305-10 (python3 tools/measure.py stats aifitlab-8541438771336) has one unit per key, and says so:
gear_ratio · as_mounted
1 specimen, 1 contributor (BAM Robotics), 1 record
median 9.615 :1 mean 9.615 std — min 9.615 max 9.615
interval for the median: — (one specimen)
datasheet 10.0 :1 (aifitlab-text, https://aifitlab.com/products/steadywin-gim4305-planetary-reducer-servo-motor)
median vs datasheet: -3.85%
consistent with the datasheet: 0 of 1 judged specimens (0%); outside 1, mixed 0, no interval 0
· CAN 1, moteus-c1 32bb145a, board unconfigured so its encoder reads the rotor [BAM Robotics]: 9.615 :1 (outside)
note: one specimen: no spread across units and no interval; one unit says little about the model
Its friction and ripple records are as_mounted, so they are shown and never judged. The ripple is split into three groups, one per harmonic (k = 14, 24, 28).
4. How friends and family upload
Status (integration round 3, 2026-10-22): uploads are off. The published /measure/ page checks and downloads only, and loads nothing from another site: UPLOADS in site/measure/app.js is false until steps 1 and 2 of "What needs Zach" below are done. Until then a contributor downloads the bundle and sends the file (A below), and whoever holds the repository runs tools/measure.py submit <file>; robotparts.dev's Submit measurements page says so.
The server switch. ?server=<url> still turns sending on, which is how the journey test runs, but only for a server on the visitor's own computer (127.0.0.1, localhost or [::1]) or the default server, and only that origin: any other value is ignored, with a console warning. WHY (review V1): the page imports the accounts SDK from that server and runs it, so a link naming another site would run that site's code on robotparts.dev. As a second fence, robotparts.dev serves /measure/ with a script-src policy (site/_headers) naming the same servers, so the browser refuses a script from anywhere else whatever app.js does. A policy cannot name an IPv6 address, so on robotparts.dev a [::1] server is refused; use localhost or 127.0.0.1 there. A new default server changes DEFAULT_SERVER in app.js and that policy together (tests/measure/test_site_page.py pins both and drives the page on hostile values).
Criteria (weight): works for someone with neither git nor Python (3); no hand-rolled accounts or storage (must); reaches robotparts with who sent it (3); checked before it is sent (2); Zach's setup (2); works today (1).
| option | no git/Python | stock accounts and storage | who sent it | checked first | Zach's setup | today |
|---|---|---|---|---|---|---|
| A. send the file (chat, email) | partly: a JSON file to edit | yes (none needed) | the sender, by chat | only with Python | none | yes |
| B. pull request on a public git remote | no | yes (GitHub) | GitHub account | in CI | a public remote plus CI | no: robotparts has no remote |
| C. `/measure/` page + Simple Hosted Files | yes | yes | their sign-in | as they type | register, deploy SHF | local, proved |
Chosen: C, with A built into the same page. The page checks a bundle as it is typed, using site/measure/rules.js, the registry, and the part's /v2/parts/<id>.json. It downloads the file at any time. Signed in, it keeps the bundle in the contributor's account (autosave, versions, trash) and makes a 7-day read link (createAgentLink, mode read) for them to send to robotparts. Then:
python3 tools/measure.py submit https://simple-hosted-files.zach-yamaoka.workers.dev/a/<token>
robotparts never stores anything for the page: the bundle lives in the contributor's account until they trash it. Simple Hosted Files has no shared inbox (its v1 lists sharing as out of scope), which is why the read link travels by chat. B becomes worth it if robotparts gets a public remote: the same bundle, in a pull request.
Proved end to end against a local Simple Hosted Files server (tests/measure/test_upload_journey.py): headless Chromium opens the page, sees a template refused, a missing scope refused and a claimed unit refused, then signs in through the stock card, saves, and gets the link. submit <link> writes the file into a throwaway tree, where the frozen reference accepts the folder.
What needs Zach, in this order (each touches his accounts):
- Register the app, in a Simple Hosted Files checkout:
node scripts/register-app.mjs robotparts "robotparts" https://robotparts.dev https://www.robotparts.dev --extension .measurement.json. It editsserver/apps.jsonin that repo only. - Deploy Simple Hosted Files, from its checkout:
node scripts/deploy-live.mjs. Until then, the live server refuses robotparts.dev (CORS, sign-in), and the page can only check and download. - Google sign-in is the only production sign-in (email codes need a sender). If the Google Auth Platform app is still in *Testing*, only listed test users can sign in: add the friends' Google accounts, or publish the app.
- The free plan is 3 files per person per app, which is enough when a bundle is trashed once it is submitted. A bigger number (
"free": {"filesPerApp": N}inapps.json) is a pricing decision. - Cut and deploy a robotparts release, which publishes
/measure/(build/build.pycopiessite/measure/andschemas/registry.json). - Turn uploads on:
const UPLOADS = trueinsite/measure/app.js, with its pin intests/measure/test_site_page.pyand the "Uploads are off" lines ofsite/measure/index.htmlandbuild/site_pages.py(how_to_submit), then release again.