CyberNative AI LLC commited on
Commit
f2f54c2
·
1 Parent(s): f4df413

holdcheck 0.5.1: simulated seat success and supervisor thresholds (SO-100/101)

Browse files
Files changed (7) hide show
  1. app.js +73 -0
  2. holdcheck.css +29 -0
  3. index.html +13 -2
  4. py/engine.py +60 -0
  5. py/holdcheck.py +103 -2
  6. py/seatmap.json +717 -0
  7. worker.js +1 -1
app.js CHANGED
@@ -327,6 +327,78 @@ function downloads(view, compact) {
327
  return box;
328
  }
329
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
330
  function showCorrection(c) {
331
  // The card's play correction: the engine's own sentences (correction_text) and its row formats.
332
  const box = $("hc-fix");
@@ -438,6 +510,7 @@ function show(view) {
438
  $("hc-tip-limit").parentElement.hidden = true;
439
  }
440
  setPlate(t.one_side_p95_mm ? t : null);
 
441
  showCorrection(view.correction);
442
 
443
  const tbl = el("table", "hc-joints");
 
327
  return box;
328
  }
329
 
330
+ function seatBar(f) {
331
+ // The share of placements that seat on a 0-100% track: solid to the band's low end, the lookup's
332
+ // 9-in-10 band as a lighter segment, a tick at the figure.
333
+ // Decorative: the figure and its band are in the words beside it.
334
+ const bar = el("div", "hc-seat-bar");
335
+ bar.setAttribute("aria-hidden", "true");
336
+ const pc = (n) => Math.max(0, Math.min(100, n * 100)) + "%";
337
+ const fill = el("span", "hc-seat-fill");
338
+ fill.style.setProperty("--a", pc(f.v - f.band_v));
339
+ const band = el("span", "hc-seat-band");
340
+ band.style.setProperty("--a", pc(f.v - f.band_v));
341
+ band.style.setProperty("--b", pc(f.v + f.band_v));
342
+ const mark = el("span", "hc-seat-mark");
343
+ mark.style.setProperty("--a", pc(f.v));
344
+ bar.append(fill, band, mark);
345
+ return bar;
346
+ }
347
+
348
+ function showSeat(s) {
349
+ // The card's pick-and-place figures: seat_text()'s own lines, as the engine sorts them (engine.seat).
350
+ const box = $("hc-seat");
351
+ box.hidden = !s;
352
+ if (!s) return;
353
+ const figs = $("hc-seat-figs");
354
+ if (s.not_computed) {
355
+ $("hc-seat-lead").textContent = `Not computed: ${s.not_computed}.`;
356
+ figs.replaceChildren();
357
+ figs.hidden = true;
358
+ $("hc-seat-call").hidden = true;
359
+ return;
360
+ }
361
+ $("hc-seat-lead").textContent = s.lead;
362
+ figs.hidden = false;
363
+ figs.replaceChildren(...s.figs.map((f) => {
364
+ const d = el("div", "hc-seat-fig");
365
+ d.append(el("span", "label", `${f.lead_in} mm lead-in`));
366
+ if (f.not_computed) {
367
+ d.append(el("p", "hc-seat-nc", `Not computed: ${f.not_computed}`));
368
+ return d;
369
+ }
370
+ const n = el("p", "hc-seat-num", f.success);
371
+ d.append(n, el("p", "hc-seat-what", f.what), seatBar(f));
372
+ if (f.band) d.append(el("p", "hc-place", f.band));
373
+ return d;
374
+ }));
375
+ const calls = s.figs.filter((f) => f.call);
376
+ $("hc-seat-call").hidden = !calls.length;
377
+ $("hc-seat-ask").textContent = s.ask;
378
+ const tbl = el("table", "hc-seatt");
379
+ tbl.append(el("caption", "hc-vh", "When a cell supervisor should call a person, per lead-in"));
380
+ const hr = el("tr");
381
+ for (const h of ["Lead-in", "Call a person when"]) {
382
+ const th = el("th", null, h);
383
+ th.scope = "col";
384
+ hr.append(th);
385
+ }
386
+ const head = el("thead");
387
+ head.append(hr);
388
+ const body = el("tbody");
389
+ for (const f of calls) {
390
+ const tr = el("tr");
391
+ const th = el("th", null, `${f.lead_in} mm`);
392
+ th.scope = "row";
393
+ // no threshold (an arm that misses more than 1 in 3): the engine's line reads as a limit
394
+ tr.append(th, el("td", f.call_none ? "hc-seat-none" : null, f.call));
395
+ body.append(tr);
396
+ }
397
+ tbl.append(head, body);
398
+ $("hc-seat-rows").replaceChildren(tbl);
399
+ $("hc-seat-close").textContent = s.close;
400
+ }
401
+
402
  function showCorrection(c) {
403
  // The card's play correction: the engine's own sentences (correction_text) and its row formats.
404
  const box = $("hc-fix");
 
510
  $("hc-tip-limit").parentElement.hidden = true;
511
  }
512
  setPlate(t.one_side_p95_mm ? t : null);
513
+ showSeat(view.seat);
514
  showCorrection(view.correction);
515
 
516
  const tbl = el("table", "hc-joints");
holdcheck.css CHANGED
@@ -415,3 +415,32 @@ table.hc-fixt { table-layout: fixed; }
415
  /* Code keeps its lines: a phone scrolls the block sideways (it is focusable for keyboards). */
416
  .hc-usage { font-size: var(--wp-text-cite); margin: var(--wp-4) 0 0; max-width: 46rem; padding: var(--wp-4) var(--wp-6); white-space: pre; }
417
  .hc-usage:focus-visible { outline: 2px solid var(--wp-focus); outline-offset: 3px; }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
415
  /* Code keeps its lines: a phone scrolls the block sideways (it is focusable for keyboards). */
416
  .hc-usage { font-size: var(--wp-text-cite); margin: var(--wp-4) 0 0; max-width: 46rem; padding: var(--wp-4) var(--wp-6); white-space: pre; }
417
  .hc-usage:focus-visible { outline: 2px solid var(--wp-focus); outline-offset: 3px; }
418
+
419
+ /* Pick-and-place cell: under the gripper figures, a simulation of this arm in a one-direction cell.
420
+ Two figures side by side (also on a phone: 3 mm against 5 mm is the comparison), then the
421
+ supervisor's call per lead-in. Light, on the sheet: the dark field stays the gripper's answer. */
422
+ .hc-seat { border-top: var(--wp-rule-strong) solid var(--wp-ink); margin: var(--wp-8) 0 0; padding: var(--wp-6) 0 0; }
423
+ .hc-seat h3.label { margin: 0 0 var(--wp-3); }
424
+ .hc-seat > p { max-width: var(--wp-measure); }
425
+ .hc-seat-figs { display: grid; gap: var(--wp-4); grid-template-columns: repeat(2, minmax(0, 1fr)); margin: var(--wp-6) 0; max-width: 40rem; }
426
+ .hc-seat-fig { background: var(--wp-panel); border-top: var(--wp-rule-strong) solid var(--wp-ink); padding: var(--wp-4) var(--wp-6) var(--wp-6); }
427
+ .hc-seat-fig .label { display: block; }
428
+ .hc-seat-num { font: 500 clamp(2.5rem, 5vw, 3.25rem)/1 var(--wp-font-body); font-variant-numeric: tabular-nums lining-nums; letter-spacing: -0.03em; margin: var(--wp-3) 0 var(--wp-1); }
429
+ .hc-seat-what { font-size: var(--wp-text-meta); margin: 0 0 var(--wp-3); }
430
+ .hc-seat-nc { color: var(--wp-muted); font-size: var(--wp-text-meta); margin: var(--wp-3) 0 0; }
431
+ .hc-seat-bar { background: var(--wp-hair); height: 0.5rem; margin: var(--wp-3) 0 var(--wp-2); position: relative; }
432
+ .hc-seat-bar span { position: absolute; }
433
+ .hc-seat-fill { background: var(--wp-ink); inset: 0 calc(100% - var(--a)) 0 0; }
434
+ .hc-seat-band { background: var(--oa-blue); inset: 0 calc(100% - var(--b)) 0 var(--a); }
435
+ .hc-seat-mark { background: var(--wp-ink); height: 1rem; left: var(--a); top: -0.25rem; transform: translateX(-1px); width: 2px; }
436
+ .hc-seat-call { max-width: 40rem; }
437
+ .hc-seat-call .hc-table { margin: var(--wp-4) 0; }
438
+ table.hc-seatt { table-layout: fixed; }
439
+ .hc-seatt thead th:first-child { width: 22%; }
440
+ .hc-seatt th, .hc-seatt td { vertical-align: top; }
441
+ .hc-seatt tbody th { font-weight: 600; }
442
+ .hc-seatt td.hc-seat-none { color: var(--wp-rust); }
443
+ @media (max-width: 720px) {
444
+ .hc-seat-figs { gap: var(--wp-3); }
445
+ .hc-seat-fig { padding: var(--wp-3) var(--wp-3) var(--wp-4); }
446
+ }
index.html CHANGED
@@ -77,6 +77,16 @@
77
  <div class="hc-answer" id="hc-tip"></div>
78
  <p class="hc-do" id="hc-do"></p>
79
  <div class="limit"><span class="label">Limit</span><span id="hc-tip-limit">A placement whose lead-in or tolerance is smaller than these will miss about 1 time in 20 or more from this arm's servos alone, before camera, calibration and printed-part play are added. Approaching every target from the same side removes the lost-motion part; so does the play correction below.</span></div>
 
 
 
 
 
 
 
 
 
 
80
  <div class="hc-fix" id="hc-fix" hidden>
81
  <h3 class="label" id="hc-fix-h">Or cancel the play in software</h3>
82
  <p id="hc-fix-lead"></p>
@@ -85,7 +95,7 @@
85
  <div class="limit hc-untried"><span class="label">Limit</span><span id="hc-fix-caution"></span></div>
86
  <div class="hc-fix-get" id="hc-fix-get">
87
  <a class="hc-dl" href="py/playfix.py" download="playfix.py" type="text/x-python">Download playfix.py</a>
88
- <p class="hc-note">4 KB of Python, no dependencies. Wraps a LeRobot follower's <code>send_action</code>, reading the card JSON from 03 below; give its file name in place of <code>card.json</code>.</p>
89
  </div>
90
  <pre class="hc-usage" id="hc-usage" tabindex="0" role="region" aria-label="Usage, three lines of Python"><code>import json
91
  from playfix import PlayCorrection, wrap_send_action
@@ -128,6 +138,7 @@ robot = wrap_send_action(robot, PlayCorrection.from_card(json.load(open("card.js
128
  <p>A LeRobot teleoperation recording stores the leader arm (the command, <code>action</code>) and the follower arm (<code>observation.state</code>) at every frame. When you hold the leader still for half a second after moving a joint at least a degree, the follower should settle on the command. The check takes where it settled at the end of every such hold and splits the holds by the direction the joint arrived from.</p>
129
  <p>Lost motion is the width of a play band fitted to those settled errors, replaying the command from where the approach began; the 90% interval comes from resampling the holds. Scatter is the robust spread of the settled error from one side. A joint needs at least 8 holds from above and 8 from below. The step size is read from the recording itself, so degrees and the -100..100 range both work.</p>
130
  <p>At the gripper, each joint's scatter and half its lost motion go through the SO-101 arm's geometry at 64 table poses 13 to 25 cm in front of the base, tool pointing down. The figure is the sideways distance that holds 95% of arrivals. SO-100 links differ slightly; the same geometry is used.</p>
 
131
  <p>The comparison is 371 SO-100 and SO-101 arms measured the same way from public LeRobot recordings, one value per arm; 280 of them have all five joints measured for the gripper figures.</p>
132
  <div class="limit"><span class="label">Limit</span>The servo's encoder sits on its output shaft, so play between the shaft and the link (horn screws, printed parts, link bending) does not appear. Every figure here is a lower bound on the play at the tool.</div>
133
  <div class="limit"><span class="label">Limit</span>A hold where the arm presses on the table or an object reads as error; medians limit this, they do not remove it. Your recording is read from Hugging Face by your browser and measured in this tab. Private and gated datasets cannot be read here.</div>
@@ -140,7 +151,7 @@ robot = wrap_send_action(robot, PlayCorrection.from_card(json.load(open("card.js
140
  <footer class="close">
141
  <div class="wrap">
142
  <p class="label">Prepared by CyberNative AI LLC, an AI-run company, using AI agents</p>
143
- <p class="label">Arm play check · method 0.4.2</p>
144
  </div>
145
  </footer>
146
  </body>
 
77
  <div class="hc-answer" id="hc-tip"></div>
78
  <p class="hc-do" id="hc-do"></p>
79
  <div class="limit"><span class="label">Limit</span><span id="hc-tip-limit">A placement whose lead-in or tolerance is smaller than these will miss about 1 time in 20 or more from this arm's servos alone, before camera, calibration and printed-part play are added. Approaching every target from the same side removes the lost-motion part; so does the play correction below.</span></div>
80
+ <div class="hc-seat" id="hc-seat" hidden>
81
+ <h3 class="label" id="hc-seat-h">Simulated pick-and-place cell</h3>
82
+ <p id="hc-seat-lead"></p>
83
+ <div class="hc-seat-figs" id="hc-seat-figs"></div>
84
+ <div class="hc-seat-call" id="hc-seat-call">
85
+ <p id="hc-seat-ask"></p>
86
+ <div class="hc-table" id="hc-seat-rows"></div>
87
+ <p class="hc-note" id="hc-seat-close"></p>
88
+ </div>
89
+ </div>
90
  <div class="hc-fix" id="hc-fix" hidden>
91
  <h3 class="label" id="hc-fix-h">Or cancel the play in software</h3>
92
  <p id="hc-fix-lead"></p>
 
95
  <div class="limit hc-untried"><span class="label">Limit</span><span id="hc-fix-caution"></span></div>
96
  <div class="hc-fix-get" id="hc-fix-get">
97
  <a class="hc-dl" href="py/playfix.py" download="playfix.py" type="text/x-python">Download playfix.py</a>
98
+ <p class="hc-note">About 8 KB of Python, no dependencies. Wraps a LeRobot follower's <code>send_action</code>, reading the card JSON from 03 below; give its file name in place of <code>card.json</code>.</p>
99
  </div>
100
  <pre class="hc-usage" id="hc-usage" tabindex="0" role="region" aria-label="Usage, three lines of Python"><code>import json
101
  from playfix import PlayCorrection, wrap_send_action
 
138
  <p>A LeRobot teleoperation recording stores the leader arm (the command, <code>action</code>) and the follower arm (<code>observation.state</code>) at every frame. When you hold the leader still for half a second after moving a joint at least a degree, the follower should settle on the command. The check takes where it settled at the end of every such hold and splits the holds by the direction the joint arrived from.</p>
139
  <p>Lost motion is the width of a play band fitted to those settled errors, replaying the command from where the approach began; the 90% interval comes from resampling the holds. Scatter is the robust spread of the settled error from one side. A joint needs at least 8 holds from above and 8 from below. The step size is read from the recording itself, so degrees and the -100..100 range both work.</p>
140
  <p>At the gripper, each joint's scatter and half its lost motion go through the SO-101 arm's geometry at 64 table poses 13 to 25 cm in front of the base, tool pointing down. The figure is the sideways distance that holds 95% of arrivals. SO-100 links differ slightly; the same geometry is used.</p>
141
+ <p>In a pick-and-place cell, a simulated SO-101 picks a part and seats it in a socket, with automatic calibration, 0.5 mm of camera noise and every target approached from one side; each joint gets this arm's own play and scatter. Running that cell takes seconds per arm, so the card looks the arm up in a table fitted on 686 corpus recordings run through it: for 9 in 10 held-out recordings the table is within 3.3 points of the recording's own simulation at 3 mm, and 2.7 at 5 mm. The cross-validation split recordings, not arms, so one arm's recordings can be on both sides; this is not a figure for an arm the table has never seen. The supervisor counts are the smallest that this arm's simulated misses would reach by chance less than 1 time in 1,000 in 60 placements (at least 4), or 1 in 10,000 in a row (at least 3). No physical cell was run.</p>
142
  <p>The comparison is 371 SO-100 and SO-101 arms measured the same way from public LeRobot recordings, one value per arm; 280 of them have all five joints measured for the gripper figures.</p>
143
  <div class="limit"><span class="label">Limit</span>The servo's encoder sits on its output shaft, so play between the shaft and the link (horn screws, printed parts, link bending) does not appear. Every figure here is a lower bound on the play at the tool.</div>
144
  <div class="limit"><span class="label">Limit</span>A hold where the arm presses on the table or an object reads as error; medians limit this, they do not remove it. Your recording is read from Hugging Face by your browser and measured in this tab. Private and gated datasets cannot be read here.</div>
 
151
  <footer class="close">
152
  <div class="wrap">
153
  <p class="label">Prepared by CyberNative AI LLC, an AI-run company, using AI agents</p>
154
+ <p class="label">Arm play check · method 0.5.1</p>
155
  </div>
156
  </footer>
157
  </body>
py/engine.py CHANGED
@@ -44,6 +44,7 @@ def measure(repo: str, sub: str, info_bytes, files, blobs, seed: int = 0) -> dic
44
  card["files"] = files
45
  if card.get("joints"):
46
  card["tip"] = hc.tip_figures(card["joints"])
 
47
  src = {"repo": repo, "subdir": sub}
48
  except Exception as e: # noqa: BLE001 - a bad dataset is a result, not a crash
49
  card, src = {"error": f"{type(e).__name__}: {e}"}, {"repo": repo, "subdir": sub, "local": None}
@@ -137,11 +138,70 @@ def view(card: dict) -> dict:
137
  for key in ("one_side_p95_mm", "either_side_p95_mm"):
138
  tip[key] = {"text": f"{t[key]:.1f}", "v": t[key], "place": hc._place(t[key], ts.get(key, {})), "pct": _pct(ts.get(key))}
139
  out["tip"] = tip
 
 
140
  out["correction"] = correction(card)
141
  out["state"] = "measured" if out["measured"] else "few"
142
  return out
143
 
144
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
145
  def correction(card: dict) -> dict | None:
146
  """The card's play correction for the page: correction_text()'s own sentences and its rows' formats.
147
 
 
44
  card["files"] = files
45
  if card.get("joints"):
46
  card["tip"] = hc.tip_figures(card["joints"])
47
+ card["seat"] = hc.seat_figures(card)
48
  src = {"repo": repo, "subdir": sub}
49
  except Exception as e: # noqa: BLE001 - a bad dataset is a result, not a crash
50
  card, src = {"error": f"{type(e).__name__}: {e}"}, {"repo": repo, "subdir": sub, "local": None}
 
138
  for key in ("one_side_p95_mm", "either_side_p95_mm"):
139
  tip[key] = {"text": f"{t[key]:.1f}", "v": t[key], "place": hc._place(t[key], ts.get(key, {})), "pct": _pct(ts.get(key))}
140
  out["tip"] = tip
141
+ # report_text prints the cell figures only under the gripper figures; so does the page
142
+ out["seat"] = seat(card) if "one_side_p95_mm" in t else None
143
  out["correction"] = correction(card)
144
  out["state"] = "measured" if out["measured"] else "few"
145
  return out
146
 
147
 
148
+ def seat(card: dict) -> dict | None:
149
+ """The card's pick-and-place figures for the page: seat_text()'s own lines, sorted into blocks.
150
+
151
+ seat_text() prints prose lines and indented rows (" 3 mm lead-in ..."; a row's continuation is
152
+ indented further). The prose runs before the first row group go in `lead`, between the groups in
153
+ `ask`, after them in `close`; each row's words after its lead-in go in `rows[c]` or `calls[c]`.
154
+ A seated row's line splits into `success`, `what` and `band` for the figure (`v`, `band_v` raw, for its bar).
155
+ None when the card carries no seat block; {"not_computed": reason} when no lead-in has a figure."""
156
+ lines = hc.seat_text(card)
157
+ if not lines:
158
+ return None
159
+ st = card.get("seat") or {}
160
+ rows = st.get("lead_in_mm") or {}
161
+ if not any("success" in r for r in rows.values()):
162
+ return {"not_computed": lines[1].split(": not computed: ", 1)[1]}
163
+ blocks, cur = [], None
164
+ for x in lines[1:]:
165
+ kind = "row" if x.startswith(" ") else "prose"
166
+ if cur is None or cur[0] != kind:
167
+ cur = (kind, [])
168
+ blocks.append(cur)
169
+ cur[1].append(x)
170
+
171
+ def join(ls):
172
+ return " ".join(x.strip() for x in ls)
173
+
174
+ def keyed(ls):
175
+ out, last = {}, None
176
+ for x in ls:
177
+ m = re.match(r" (\d+) mm lead-in (.*)$", x)
178
+ if m:
179
+ last = m.group(1)
180
+ out[last] = m.group(2).strip()
181
+ else:
182
+ out[last] += " " + x.strip()
183
+ return out
184
+
185
+ prose = [join(b) for k, b in blocks if k == "prose"]
186
+ groups = [keyed(b) for k, b in blocks if k == "row"]
187
+ figs = []
188
+ for c, r in rows.items():
189
+ line = groups[0][c]
190
+ # call_none: no threshold for this lead-in (the arm misses more than the rule was tested on)
191
+ f = {"lead_in": c, "line": line, "call": groups[1].get(c) if len(groups) > 1 else None,
192
+ "call_none": "success" in r and "escalate_misses_in_60" not in r}
193
+ if "success" in r:
194
+ # "66% of placements seat (within 3 points for 9 in 10 held-out recordings)": figure, what it counts, its band
195
+ m = re.match(r"(\S+) (.+?) \((.+)\)$", line)
196
+ f.update({"success": m.group(1), "what": m.group(2), "band": m.group(3), "v": r["success"], "band_v": r["band"]}
197
+ if m else {"success": f"{r['success']:.0%}", "what": line, "band": "", "v": r["success"], "band_v": r["band"]})
198
+ else:
199
+ f["not_computed"] = line.split("not computed: ", 1)[-1]
200
+ figs.append(f)
201
+ return {"lead": prose[0], "ask": prose[1] if len(prose) > 1 else "", "close": prose[2] if len(prose) > 2 else "",
202
+ "figs": figs, "model": st.get("model"), "band_note": st.get("band")}
203
+
204
+
205
  def correction(card: dict) -> dict | None:
206
  """The card's play correction for the page: correction_text()'s own sentences and its rows' formats.
207
 
py/holdcheck.py CHANGED
@@ -36,7 +36,7 @@ import urllib.request
36
 
37
  import numpy as np
38
 
39
- VERSION = "0.4.2"
40
  STEP_DEG = 360.0 / 4096.0
41
  HF = "https://huggingface.co"
42
  SO_JOINTS = ["shoulder_pan", "shoulder_lift", "elbow_flex", "wrist_flex", "wrist_roll", "gripper"]
@@ -507,11 +507,73 @@ def tip_figures(joints: dict, tipmap: dict | None = None, per_pose: int = 200, s
507
  "one_side_p95_mm": round(float(np.percentile(lat[0], 95)), 2),
508
  "one_side_p50_mm": round(float(np.percentile(lat[0], 50)), 2),
509
  "either_side_p95_mm": round(float(np.percentile(lat[1], 95)), 2),
 
510
  "scatter_from": {k: ("free holds" if joints[k].get("scatter_sd_free_deg") is not None else "all holds") for k in TIP_JOINTS},
511
  "geometry": "SO-101 tool point, pointing down, 64 poses 13-25 cm in front of the base (SO-100 links differ slightly)",
512
  }
513
 
514
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
515
  def _place(v: float, p: dict) -> str:
516
  if not p:
517
  return ""
@@ -548,6 +610,11 @@ def report_text(card: dict, summary: dict | None = None) -> str:
548
  ]
549
  fam = family(card.get("robot_type"))
550
  table = compare_table(summary, fam)
 
 
 
 
 
551
  for k in SO_JOINTS[:-1]:
552
  j = card["joints"].get(k, {})
553
  if "lost_motion_deg" not in j:
@@ -579,10 +646,43 @@ def report_text(card: dict, summary: dict | None = None) -> str:
579
  "A placement whose lead-in or tolerance is smaller than these will miss about 1 time in 20 or more from",
580
  "this arm's servos alone, before camera, calibration and printed-part play are added. Approaching every",
581
  *("target from the same side removes the lost-motion part" + same_side_clause(card)).split("\n"),
582
- ]
583
  return "\n".join(L + correction_text(card))
584
 
585
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
586
  def correction_left(card: dict) -> list:
587
  """Tip joints with play (fitted lost motion above 0) that the card's correction does not cover.
588
 
@@ -661,6 +761,7 @@ def main(argv=None):
661
  card["files"] = files
662
  if card.get("joints"):
663
  card["tip"] = tip_figures(card["joints"])
 
664
  except Exception as e: # noqa: BLE001 - a bad dataset is a result, not a crash
665
  card, src = {"error": f"{type(e).__name__}: {e}"}, {"repo": a.repo, "subdir": a.subdir, "local": a.local}
666
  card["source"] = src
 
36
 
37
  import numpy as np
38
 
39
+ VERSION = "0.5.1"
40
  STEP_DEG = 360.0 / 4096.0
41
  HF = "https://huggingface.co"
42
  SO_JOINTS = ["shoulder_pan", "shoulder_lift", "elbow_flex", "wrist_flex", "wrist_roll", "gripper"]
 
507
  "one_side_p95_mm": round(float(np.percentile(lat[0], 95)), 2),
508
  "one_side_p50_mm": round(float(np.percentile(lat[0], 50)), 2),
509
  "either_side_p95_mm": round(float(np.percentile(lat[1], 95)), 2),
510
+ "one_side_within": {str(c): round(float((lat[0] <= c).mean()), 6) for c in SEAT_LEAD_IN_MM},
511
  "scatter_from": {k: ("free holds" if joints[k].get("scatter_sd_free_deg") is not None else "all holds") for k in TIP_JOINTS},
512
  "geometry": "SO-101 tool point, pointing down, 64 poses 13-25 cm in front of the base (SO-100 links differ slightly)",
513
  }
514
 
515
 
516
+ SEATMAP = os.path.join(os.path.dirname(os.path.abspath(__file__)), "seatmap.json")
517
+ SEAT_LEAD_IN_MM = (3, 5)
518
+ SEAT_FAMILIES = ("so100", "so101")
519
+ SEAT_P0_TESTED = 0.33 # the own-rate escalation was tested in simulation up to a miss rate of 0.327
520
+
521
+
522
+ def escalation(p0: float, window: int = 60, alpha: float = 1e-3, run_p: float = 1e-4) -> tuple:
523
+ """A supervisor's seat escalation set from an arm's own miss rate p0:
524
+ k misses in the last `window` cycles, k = max(4, smallest k with P(Binomial(window, p0) >= k) < alpha),
525
+ or s misses in a row, s = max(3, smallest s with p0**s < run_p). p0 = 0 gives the published 4 and 3."""
526
+ k, s = 4, 3
527
+ if p0 > 0:
528
+ tail = 1.0
529
+ for j in range(window + 1):
530
+ if tail < alpha:
531
+ k = max(4, j)
532
+ break
533
+ tail -= math.comb(window, j) * p0 ** j * (1 - p0) ** (window - j)
534
+ else:
535
+ k = window + 1 # never below alpha: no k in the window is unlikely by chance
536
+ s = max(3, math.ceil(math.log(run_p) / math.log(p0))) if p0 < 1 else window + 1
537
+ return k, s
538
+
539
+
540
+ def seat_figures(card: dict, seatmap: dict | None = None) -> dict:
541
+ """Simulated seat success of this arm in a calibrated pick-and-place cell that approaches every target
542
+ from one side, and the supervisor thresholds that follow from its own miss rate.
543
+
544
+ The card's P(one-side tip error <= c) goes through a monotone lookup (`seatmap.json`, made by
545
+ the seatmap builder) fitted on 686 corpus cards, each run through the cell with its own play and scatter.
546
+ A model figure: no physical cell was run. Only for SO-100/101 arms with all five tip joints measured,
547
+ and only inside the range the lookup was fitted on."""
548
+ fam = family(card.get("robot_type"))
549
+ if fam not in SEAT_FAMILIES:
550
+ return {"not_computed": "the cell simulates an SO-101 arm; this is not an SO-100 or SO-101 arm"}
551
+ within = (card.get("tip") or {}).get("one_side_within")
552
+ if not within:
553
+ return {"not_computed": (card.get("tip") or {}).get("not_computed", "the gripper figures were not computed")}
554
+ if seatmap is None:
555
+ with open(SEATMAP) as f:
556
+ seatmap = json.load(f)
557
+ out = {}
558
+ for c in SEAT_LEAD_IN_MM:
559
+ m = seatmap["lead_in_mm"][str(c)]
560
+ p = within.get(str(c))
561
+ if p is None or p < m["p_min"]:
562
+ out[str(c)] = {"not_computed": "this arm is looser than every arm the lookup was fitted on"}
563
+ continue
564
+ succ = float(np.interp(p, m["p_one_side"], m["success"]))
565
+ out[str(c)] = {"success": round(succ, 3), "band": m["band_p90_abs"]}
566
+ if 1.0 - succ <= SEAT_P0_TESTED:
567
+ k, s = escalation(1.0 - succ)
568
+ out[str(c)].update(escalate_misses_in_60=k, escalate_in_a_row=s)
569
+ return {"lead_in_mm": out,
570
+ "model": "simulated: this arm's play and scatter in a calibrated pick-and-place cell that approaches "
571
+ "every target from one side (camera 0.5 mm); not measured on a physical cell",
572
+ "band": "for 9 in 10 held-out corpus recordings, the lookup was within this many points of the recording's "
573
+ "own simulation (five-fold cross-validation split by recording, not by arm: recordings of one arm "
574
+ "can be in both the fitted and the held-out part, so this is not a figure over held-out arms)"}
575
+
576
+
577
  def _place(v: float, p: dict) -> str:
578
  if not p:
579
  return ""
 
610
  ]
611
  fam = family(card.get("robot_type"))
612
  table = compare_table(summary, fam)
613
+ if summary and not table:
614
+ n = summary.get("arms_by_family", {}).get(fam, 0)
615
+ L.insert(-1, f"Not placed among other arms: the corpus behind this check has {n} {card.get('robot_type')} "
616
+ f"arm{'' if n == 1 else 's'}, and a comparison needs at least {COMPARE_MIN_ARMS}.")
617
+ L.insert(-1, "")
618
  for k in SO_JOINTS[:-1]:
619
  j = card["joints"].get(k, {})
620
  if "lost_motion_deg" not in j:
 
646
  "A placement whose lead-in or tolerance is smaller than these will miss about 1 time in 20 or more from",
647
  "this arm's servos alone, before camera, calibration and printed-part play are added. Approaching every",
648
  *("target from the same side removes the lost-motion part" + same_side_clause(card)).split("\n"),
649
+ ] + seat_text(card)
650
  return "\n".join(L + correction_text(card))
651
 
652
 
653
+ def share(p: float) -> str:
654
+ """A model share as a percentage that never reads as a certainty: one token, ">99%" or "<1%" at the ends."""
655
+ return ">99%" if p >= 0.995 else "<1%" if p < 0.005 else f"{min(max(round(p * 100), 1), 99)}%"
656
+
657
+
658
+ def seat_text(card: dict) -> list:
659
+ st = card.get("seat") or {}
660
+ rows = st.get("lead_in_mm") or {}
661
+ ok = {c: r for c, r in rows.items() if "success" in r}
662
+ if not ok:
663
+ return ["", f"In a pick-and-place cell: not computed: {st.get('not_computed') or next((r['not_computed'] for r in rows.values()), 'no card figures')}"] if st else []
664
+ L = ["", "In a pick-and-place cell that approaches every target from one side (a simulation of this arm's",
665
+ "play and scatter, camera 0.5 mm; not measured on a physical cell). Each band is the lookup's error on",
666
+ "held-out corpus recordings; the folds split recordings, not arms, so one arm's recordings can be on",
667
+ "both sides of a split:"]
668
+ for c, r in rows.items():
669
+ if "success" not in r:
670
+ L.append(f" {c} mm lead-in not computed: {r['not_computed']}")
671
+ continue
672
+ L.append(f" {c} mm lead-in {share(r['success'])} of placements seat (within {r['band'] * 100:.0f} points for 9 in 10 held-out recordings)")
673
+ L += ["A supervisor that calls a person on repeated misses should allow for this arm's own misses, or it",
674
+ "will call for the wrong fix. From this arm's simulated miss rate, call when"]
675
+ for c, r in ok.items():
676
+ if "escalate_misses_in_60" in r:
677
+ L.append(f" {c} mm lead-in {r['escalate_misses_in_60']} of the last 60 placements miss, or {r['escalate_in_a_row']} in a row")
678
+ else:
679
+ L.append(f" {c} mm lead-in no threshold: this arm misses more than 1 placement in 3, beyond what the rule was")
680
+ L.append(f" {'':<14}tested on; a larger lead-in or a tighter arm comes first")
681
+ L += ["A supervisor set for an arm with no misses of its own would call at 4 of 60 or 3 in a row.",
682
+ "Count the cell's own misses when it is set up, and use that count instead of this one."]
683
+ return L
684
+
685
+
686
  def correction_left(card: dict) -> list:
687
  """Tip joints with play (fitted lost motion above 0) that the card's correction does not cover.
688
 
 
761
  card["files"] = files
762
  if card.get("joints"):
763
  card["tip"] = tip_figures(card["joints"])
764
+ card["seat"] = seat_figures(card)
765
  except Exception as e: # noqa: BLE001 - a bad dataset is a result, not a crash
766
  card, src = {"error": f"{type(e).__name__}: {e}"}, {"repo": a.repo, "subdir": a.subdir, "local": a.local}
767
  card["source"] = src
py/seatmap.json ADDED
@@ -0,0 +1,717 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "version": 1,
3
+ "what": "simulated seat success of the arm in a calibrated pick-and-place cell that approaches every target from one side (each joint: its own play band and settle scatter; camera 0.5 mm), looked up from the card's P(one-side tip error <= c)",
4
+ "fitted_on": "686 SO-100/101 corpus cards, 10 simulated units of 500 placements each",
5
+ "lead_in_mm": {
6
+ "3": {
7
+ "p_one_side": [
8
+ 0.0,
9
+ 0.01,
10
+ 0.02,
11
+ 0.03,
12
+ 0.04,
13
+ 0.05,
14
+ 0.06,
15
+ 0.07,
16
+ 0.08,
17
+ 0.09,
18
+ 0.1,
19
+ 0.11,
20
+ 0.12,
21
+ 0.13,
22
+ 0.14,
23
+ 0.15,
24
+ 0.16,
25
+ 0.17,
26
+ 0.18,
27
+ 0.19,
28
+ 0.2,
29
+ 0.21,
30
+ 0.22,
31
+ 0.23,
32
+ 0.24,
33
+ 0.25,
34
+ 0.26,
35
+ 0.27,
36
+ 0.28,
37
+ 0.29,
38
+ 0.3,
39
+ 0.31,
40
+ 0.32,
41
+ 0.33,
42
+ 0.34,
43
+ 0.35,
44
+ 0.36,
45
+ 0.37,
46
+ 0.38,
47
+ 0.39,
48
+ 0.4,
49
+ 0.41,
50
+ 0.42,
51
+ 0.43,
52
+ 0.44,
53
+ 0.45,
54
+ 0.46,
55
+ 0.47,
56
+ 0.48,
57
+ 0.49,
58
+ 0.5,
59
+ 0.51,
60
+ 0.52,
61
+ 0.53,
62
+ 0.54,
63
+ 0.55,
64
+ 0.56,
65
+ 0.57,
66
+ 0.58,
67
+ 0.59,
68
+ 0.6,
69
+ 0.61,
70
+ 0.62,
71
+ 0.63,
72
+ 0.64,
73
+ 0.65,
74
+ 0.66,
75
+ 0.67,
76
+ 0.68,
77
+ 0.69,
78
+ 0.7,
79
+ 0.71,
80
+ 0.72,
81
+ 0.73,
82
+ 0.74,
83
+ 0.75,
84
+ 0.76,
85
+ 0.77,
86
+ 0.78,
87
+ 0.79,
88
+ 0.8,
89
+ 0.81,
90
+ 0.82,
91
+ 0.83,
92
+ 0.84,
93
+ 0.85,
94
+ 0.86,
95
+ 0.87,
96
+ 0.88,
97
+ 0.89,
98
+ 0.9,
99
+ 0.910875,
100
+ 0.920567,
101
+ 0.929205,
102
+ 0.936904,
103
+ 0.943766,
104
+ 0.949881,
105
+ 0.955332,
106
+ 0.960189,
107
+ 0.964519,
108
+ 0.968377,
109
+ 0.971816,
110
+ 0.974881,
111
+ 0.977613,
112
+ 0.980047,
113
+ 0.982217,
114
+ 0.984151,
115
+ 0.985875,
116
+ 0.987411,
117
+ 0.98878,
118
+ 0.99,
119
+ 0.991087,
120
+ 0.992057,
121
+ 0.992921,
122
+ 0.99369,
123
+ 0.994377,
124
+ 0.994988,
125
+ 0.995533,
126
+ 0.996019,
127
+ 0.996452,
128
+ 0.996838,
129
+ 0.997182,
130
+ 0.997488,
131
+ 0.997761,
132
+ 0.998005,
133
+ 0.998222,
134
+ 0.998415,
135
+ 0.998587,
136
+ 0.998741,
137
+ 0.998878,
138
+ 0.999,
139
+ 0.999109,
140
+ 0.999206,
141
+ 0.999292,
142
+ 0.999369,
143
+ 0.999438,
144
+ 0.999499,
145
+ 0.999553,
146
+ 0.999602,
147
+ 0.999645,
148
+ 0.999684,
149
+ 0.999718,
150
+ 0.999749,
151
+ 0.999776,
152
+ 0.9998,
153
+ 0.999822,
154
+ 0.999842,
155
+ 0.999859,
156
+ 0.999874,
157
+ 0.999888,
158
+ 0.9999,
159
+ 0.999911,
160
+ 0.999921,
161
+ 0.999929,
162
+ 0.999937,
163
+ 0.999944,
164
+ 0.99995,
165
+ 0.999955,
166
+ 0.99996,
167
+ 0.999965,
168
+ 0.999968,
169
+ 0.999972,
170
+ 0.999975,
171
+ 0.999978,
172
+ 0.99998,
173
+ 0.999982,
174
+ 0.999984,
175
+ 0.999986,
176
+ 0.999987,
177
+ 0.999989,
178
+ 0.99999
179
+ ],
180
+ "success": [
181
+ 0.0393,
182
+ 0.0393,
183
+ 0.0393,
184
+ 0.0393,
185
+ 0.0393,
186
+ 0.0393,
187
+ 0.0393,
188
+ 0.0393,
189
+ 0.0393,
190
+ 0.0393,
191
+ 0.0393,
192
+ 0.0393,
193
+ 0.0393,
194
+ 0.0393,
195
+ 0.0393,
196
+ 0.0393,
197
+ 0.0393,
198
+ 0.0393,
199
+ 0.0393,
200
+ 0.0408,
201
+ 0.0426,
202
+ 0.0445,
203
+ 0.0464,
204
+ 0.0497,
205
+ 0.0551,
206
+ 0.0644,
207
+ 0.075,
208
+ 0.0853,
209
+ 0.0949,
210
+ 0.104,
211
+ 0.104,
212
+ 0.1082,
213
+ 0.1255,
214
+ 0.1345,
215
+ 0.1436,
216
+ 0.1607,
217
+ 0.1688,
218
+ 0.1707,
219
+ 0.1714,
220
+ 0.1714,
221
+ 0.1714,
222
+ 0.202,
223
+ 0.208,
224
+ 0.2128,
225
+ 0.2281,
226
+ 0.2281,
227
+ 0.2671,
228
+ 0.273,
229
+ 0.285,
230
+ 0.285,
231
+ 0.3132,
232
+ 0.3217,
233
+ 0.3244,
234
+ 0.3294,
235
+ 0.3363,
236
+ 0.3364,
237
+ 0.354,
238
+ 0.3688,
239
+ 0.3688,
240
+ 0.3817,
241
+ 0.3909,
242
+ 0.4116,
243
+ 0.4185,
244
+ 0.4332,
245
+ 0.4485,
246
+ 0.4521,
247
+ 0.4684,
248
+ 0.4684,
249
+ 0.4919,
250
+ 0.5018,
251
+ 0.5251,
252
+ 0.5251,
253
+ 0.5467,
254
+ 0.5467,
255
+ 0.5652,
256
+ 0.567,
257
+ 0.567,
258
+ 0.5857,
259
+ 0.6086,
260
+ 0.6136,
261
+ 0.6277,
262
+ 0.641,
263
+ 0.6515,
264
+ 0.6767,
265
+ 0.6775,
266
+ 0.6994,
267
+ 0.7068,
268
+ 0.7068,
269
+ 0.7068,
270
+ 0.7345,
271
+ 0.7533,
272
+ 0.7724,
273
+ 0.7724,
274
+ 0.791,
275
+ 0.8152,
276
+ 0.8152,
277
+ 0.8358,
278
+ 0.8358,
279
+ 0.8588,
280
+ 0.8672,
281
+ 0.8672,
282
+ 0.8692,
283
+ 0.8855,
284
+ 0.8869,
285
+ 0.8965,
286
+ 0.8977,
287
+ 0.901,
288
+ 0.903,
289
+ 0.903,
290
+ 0.9115,
291
+ 0.9279,
292
+ 0.9279,
293
+ 0.9285,
294
+ 0.9318,
295
+ 0.9325,
296
+ 0.933,
297
+ 0.933,
298
+ 0.933,
299
+ 0.9523,
300
+ 0.9523,
301
+ 0.9523,
302
+ 0.953,
303
+ 0.953,
304
+ 0.9568,
305
+ 0.9577,
306
+ 0.961,
307
+ 0.9621,
308
+ 0.9621,
309
+ 0.9644,
310
+ 0.9644,
311
+ 0.9673,
312
+ 0.9673,
313
+ 0.9706,
314
+ 0.9706,
315
+ 0.9706,
316
+ 0.9706,
317
+ 0.9759,
318
+ 0.9759,
319
+ 0.9759,
320
+ 0.9759,
321
+ 0.9759,
322
+ 0.9776,
323
+ 0.9776,
324
+ 0.979,
325
+ 0.979,
326
+ 0.979,
327
+ 0.979,
328
+ 0.9821,
329
+ 0.9827,
330
+ 0.9833,
331
+ 0.9838,
332
+ 0.9843,
333
+ 0.9847,
334
+ 0.9894,
335
+ 0.9894,
336
+ 0.9894,
337
+ 0.9894,
338
+ 0.9894,
339
+ 0.9895,
340
+ 0.9895,
341
+ 0.9895,
342
+ 0.9895,
343
+ 0.9895,
344
+ 0.9895,
345
+ 0.9895,
346
+ 0.9895,
347
+ 0.9895,
348
+ 0.9895,
349
+ 0.9895,
350
+ 0.9895,
351
+ 0.9895
352
+ ],
353
+ "p_min": 0.180781,
354
+ "band_p90_abs": 0.0334,
355
+ "band_median_abs": 0.0122,
356
+ "share_within_plan_bound": 0.9767,
357
+ "plan_bound": 0.05,
358
+ "ungridded_cv_p90_abs": 0.0337,
359
+ "grid_vs_fit_max_abs": 0.0247
360
+ },
361
+ "5": {
362
+ "p_one_side": [
363
+ 0.0,
364
+ 0.01,
365
+ 0.02,
366
+ 0.03,
367
+ 0.04,
368
+ 0.05,
369
+ 0.06,
370
+ 0.07,
371
+ 0.08,
372
+ 0.09,
373
+ 0.1,
374
+ 0.11,
375
+ 0.12,
376
+ 0.13,
377
+ 0.14,
378
+ 0.15,
379
+ 0.16,
380
+ 0.17,
381
+ 0.18,
382
+ 0.19,
383
+ 0.2,
384
+ 0.21,
385
+ 0.22,
386
+ 0.23,
387
+ 0.24,
388
+ 0.25,
389
+ 0.26,
390
+ 0.27,
391
+ 0.28,
392
+ 0.29,
393
+ 0.3,
394
+ 0.31,
395
+ 0.32,
396
+ 0.33,
397
+ 0.34,
398
+ 0.35,
399
+ 0.36,
400
+ 0.37,
401
+ 0.38,
402
+ 0.39,
403
+ 0.4,
404
+ 0.41,
405
+ 0.42,
406
+ 0.43,
407
+ 0.44,
408
+ 0.45,
409
+ 0.46,
410
+ 0.47,
411
+ 0.48,
412
+ 0.49,
413
+ 0.5,
414
+ 0.51,
415
+ 0.52,
416
+ 0.53,
417
+ 0.54,
418
+ 0.55,
419
+ 0.56,
420
+ 0.57,
421
+ 0.58,
422
+ 0.59,
423
+ 0.6,
424
+ 0.61,
425
+ 0.62,
426
+ 0.63,
427
+ 0.64,
428
+ 0.65,
429
+ 0.66,
430
+ 0.67,
431
+ 0.68,
432
+ 0.69,
433
+ 0.7,
434
+ 0.71,
435
+ 0.72,
436
+ 0.73,
437
+ 0.74,
438
+ 0.75,
439
+ 0.76,
440
+ 0.77,
441
+ 0.78,
442
+ 0.79,
443
+ 0.8,
444
+ 0.81,
445
+ 0.82,
446
+ 0.83,
447
+ 0.84,
448
+ 0.85,
449
+ 0.86,
450
+ 0.87,
451
+ 0.88,
452
+ 0.89,
453
+ 0.9,
454
+ 0.910875,
455
+ 0.920567,
456
+ 0.929205,
457
+ 0.936904,
458
+ 0.943766,
459
+ 0.949881,
460
+ 0.955332,
461
+ 0.960189,
462
+ 0.964519,
463
+ 0.968377,
464
+ 0.971816,
465
+ 0.974881,
466
+ 0.977613,
467
+ 0.980047,
468
+ 0.982217,
469
+ 0.984151,
470
+ 0.985875,
471
+ 0.987411,
472
+ 0.98878,
473
+ 0.99,
474
+ 0.991087,
475
+ 0.992057,
476
+ 0.992921,
477
+ 0.99369,
478
+ 0.994377,
479
+ 0.994988,
480
+ 0.995533,
481
+ 0.996019,
482
+ 0.996452,
483
+ 0.996838,
484
+ 0.997182,
485
+ 0.997488,
486
+ 0.997761,
487
+ 0.998005,
488
+ 0.998222,
489
+ 0.998415,
490
+ 0.998587,
491
+ 0.998741,
492
+ 0.998878,
493
+ 0.999,
494
+ 0.999109,
495
+ 0.999206,
496
+ 0.999292,
497
+ 0.999369,
498
+ 0.999438,
499
+ 0.999499,
500
+ 0.999553,
501
+ 0.999602,
502
+ 0.999645,
503
+ 0.999684,
504
+ 0.999718,
505
+ 0.999749,
506
+ 0.999776,
507
+ 0.9998,
508
+ 0.999822,
509
+ 0.999842,
510
+ 0.999859,
511
+ 0.999874,
512
+ 0.999888,
513
+ 0.9999,
514
+ 0.999911,
515
+ 0.999921,
516
+ 0.999929,
517
+ 0.999937,
518
+ 0.999944,
519
+ 0.99995,
520
+ 0.999955,
521
+ 0.99996,
522
+ 0.999965,
523
+ 0.999968,
524
+ 0.999972,
525
+ 0.999975,
526
+ 0.999978,
527
+ 0.99998,
528
+ 0.999982,
529
+ 0.999984,
530
+ 0.999986,
531
+ 0.999987,
532
+ 0.999989,
533
+ 0.99999
534
+ ],
535
+ "success": [
536
+ 0.0712,
537
+ 0.0712,
538
+ 0.0712,
539
+ 0.0712,
540
+ 0.0712,
541
+ 0.0712,
542
+ 0.0712,
543
+ 0.0712,
544
+ 0.0712,
545
+ 0.0712,
546
+ 0.0712,
547
+ 0.0712,
548
+ 0.0712,
549
+ 0.0712,
550
+ 0.0712,
551
+ 0.0712,
552
+ 0.0712,
553
+ 0.0712,
554
+ 0.0712,
555
+ 0.0712,
556
+ 0.0712,
557
+ 0.0712,
558
+ 0.0712,
559
+ 0.0712,
560
+ 0.0712,
561
+ 0.0712,
562
+ 0.0712,
563
+ 0.0712,
564
+ 0.0712,
565
+ 0.0712,
566
+ 0.0712,
567
+ 0.0735,
568
+ 0.0764,
569
+ 0.0793,
570
+ 0.0822,
571
+ 0.0851,
572
+ 0.0881,
573
+ 0.091,
574
+ 0.0977,
575
+ 0.1065,
576
+ 0.1149,
577
+ 0.1238,
578
+ 0.1326,
579
+ 0.1414,
580
+ 0.1502,
581
+ 0.1583,
582
+ 0.1638,
583
+ 0.1692,
584
+ 0.1746,
585
+ 0.2074,
586
+ 0.2074,
587
+ 0.2087,
588
+ 0.2194,
589
+ 0.2341,
590
+ 0.2546,
591
+ 0.275,
592
+ 0.2891,
593
+ 0.2891,
594
+ 0.2893,
595
+ 0.2895,
596
+ 0.2895,
597
+ 0.3008,
598
+ 0.3283,
599
+ 0.3285,
600
+ 0.3393,
601
+ 0.3703,
602
+ 0.3766,
603
+ 0.3771,
604
+ 0.3846,
605
+ 0.3846,
606
+ 0.4491,
607
+ 0.4491,
608
+ 0.4591,
609
+ 0.4688,
610
+ 0.4688,
611
+ 0.4925,
612
+ 0.5145,
613
+ 0.5266,
614
+ 0.5473,
615
+ 0.5616,
616
+ 0.5756,
617
+ 0.5993,
618
+ 0.5993,
619
+ 0.6222,
620
+ 0.6222,
621
+ 0.6452,
622
+ 0.6559,
623
+ 0.6599,
624
+ 0.696,
625
+ 0.6993,
626
+ 0.7297,
627
+ 0.7443,
628
+ 0.7628,
629
+ 0.7914,
630
+ 0.8171,
631
+ 0.824,
632
+ 0.824,
633
+ 0.8529,
634
+ 0.8577,
635
+ 0.8694,
636
+ 0.8811,
637
+ 0.8811,
638
+ 0.8925,
639
+ 0.9014,
640
+ 0.9097,
641
+ 0.9153,
642
+ 0.9153,
643
+ 0.931,
644
+ 0.931,
645
+ 0.9421,
646
+ 0.9421,
647
+ 0.9421,
648
+ 0.9467,
649
+ 0.9467,
650
+ 0.9467,
651
+ 0.9561,
652
+ 0.9592,
653
+ 0.9644,
654
+ 0.9647,
655
+ 0.9662,
656
+ 0.9665,
657
+ 0.9711,
658
+ 0.9711,
659
+ 0.9753,
660
+ 0.9769,
661
+ 0.9801,
662
+ 0.9801,
663
+ 0.9801,
664
+ 0.9801,
665
+ 0.9801,
666
+ 0.9849,
667
+ 0.9849,
668
+ 0.9863,
669
+ 0.9865,
670
+ 0.9894,
671
+ 0.9899,
672
+ 0.9909,
673
+ 0.9916,
674
+ 0.9916,
675
+ 0.9916,
676
+ 0.9916,
677
+ 0.9916,
678
+ 0.9916,
679
+ 0.9928,
680
+ 0.9928,
681
+ 0.9928,
682
+ 0.9928,
683
+ 0.995,
684
+ 0.9951,
685
+ 0.9952,
686
+ 0.9953,
687
+ 0.9954,
688
+ 0.9954,
689
+ 0.9973,
690
+ 0.9974,
691
+ 0.9976,
692
+ 0.9977,
693
+ 0.9979,
694
+ 0.998,
695
+ 0.9981,
696
+ 0.9982,
697
+ 0.9982,
698
+ 0.9983,
699
+ 0.9984,
700
+ 0.9984,
701
+ 0.9985,
702
+ 0.9985,
703
+ 0.9986,
704
+ 0.9986,
705
+ 0.9986,
706
+ 0.9987
707
+ ],
708
+ "p_min": 0.302266,
709
+ "band_p90_abs": 0.0268,
710
+ "band_median_abs": 0.0045,
711
+ "share_within_plan_bound": 0.9155,
712
+ "plan_bound": 0.03,
713
+ "ungridded_cv_p90_abs": 0.0277,
714
+ "grid_vs_fit_max_abs": 0.0206
715
+ }
716
+ }
717
+ }
worker.js CHANGED
@@ -56,7 +56,7 @@ async function boot() {
56
  { messageCallback: () => {}, errorCallback: () => {} },
57
  );
58
  p.FS.mkdirTree("/hc");
59
- for (const f of ["holdcheck.py", "engine.py", "tipmap.json", "corpus_summary.json"]) {
60
  const r = await fetch(new URL("py/" + f, base));
61
  if (!r.ok) throw new Error("engine file " + f);
62
  p.FS.writeFile("/hc/" + f, new Uint8Array(await r.arrayBuffer()));
 
56
  { messageCallback: () => {}, errorCallback: () => {} },
57
  );
58
  p.FS.mkdirTree("/hc");
59
+ for (const f of ["holdcheck.py", "engine.py", "tipmap.json", "seatmap.json", "corpus_summary.json"]) {
60
  const r = await fetch(new URL("py/" + f, base));
61
  if (!r.ok) throw new Error("engine file " + f);
62
  p.FS.writeFile("/hc/" + f, new Uint8Array(await r.arrayBuffer()));