#!/usr/bin/env python3
"""Build the static Hugging Face Space (showcase page) from results/leaderboard.json.
python scripts/make_space.py OUT_DIR -> OUT_DIR/index.html, OUT_DIR/README.md
Media are served from the dataset repo (resolve URLs), so the Space stays small and never drifts from it.
"""
import html
import json
import sys
from pathlib import Path
ROOT = Path(__file__).resolve().parents[1]
DS = "Nabidnur/RoboRACE-Bench"
RES = f"https://huggingface.co/datasets/{DS}/resolve/main"
GH = "https://github.com/Hisernberg/robotics"
def pct(x, d=1):
return "–" if x is None or x != x else f"{100 * x:.{d}f}"
def table(rows, cols, highlight=lambda r: False):
head = "".join(f"
{c}
" for c, _ in cols) # column titles are trusted literals (may contain entities)
body = ""
for r in rows:
cls = ' class="ours"' if highlight(r) else ""
body += f"
" + "".join(f"
{f(r)}
" for _, f in cols) + "
"
return f'
{head}
{body}
'
def lb_rows(lb, key, n=9):
rs = lb.get(key, [])
rs = rs[:n] + [r for r in rs[n:] if r["method"].startswith("REF")]
return table(rs, [("rank", lambda r: f"{r['rank']:.0f} ({r['rank_lo']}–{r['rank_hi']})" if "rank" in r else "ref"),
("method", lambda r: html.escape(r["method"])),
("mean", lambda r: f"{pct(r['mean_acc'])}"),
("clean", lambda r: pct(r["clean"])),
("liars < 50%", lambda r: pct(r["minority_liars"])),
("liars ≥ 50%", lambda r: pct(r["majority_liars"])),
("worst cell", lambda r: pct(r["worst_cell"]))],
highlight=lambda r: "new" in r["method"] or r["method"].startswith(("race_c", "race_map", "race_net_m")))
def fig(path, caption, width="100%"):
return (f''
f"{caption}")
def video(path, caption, autoplay=False):
ap = " autoplay" if autoplay else ""
return (f''
f"{caption}")
def build(out):
out = Path(out)
out.mkdir(parents=True, exist_ok=True)
lb = json.loads((ROOT / "results/leaderboard.json").read_text())
rep, sw, pb = lb.get("ERQA_reproduction", {}), lb.get("ERQA_swarm", {}), lb.get("PlanBench", {})
rep768 = lb.get("ERQA_reproduction_768", {})
A = {r["method"]: r for r in lb.get("A", [])}
B = {r["method"]: r for r in lb.get("B", [])}
csys = {r["system"]: r for r in lb.get("C_systems", [])}
zs = [r["acc"] for n, r in csys.items() if n.endswith("zero-shot") and not n.startswith("swarm")]
en = [r["acc"] for n, r in csys.items() if n.endswith("engineered") and not n.startswith(("swarm", "small"))]
a_best = max((r for r in lb.get("A", []) if not r["method"].startswith("REF")), key=lambda r: r["mean_acc"])
AP = {r["method"]: r for r in lb.get("AP", [])}
Dm = {r["method"]: r for r in lb.get("D", [])}
net = "race_net (new, learned)"
extra_cards = []
if AP:
ap_best = max((r for r in lb["AP"] if not r["method"].startswith("REF")), key=lambda r: r["mean_acc"])
extra_cards.append(("Track A-Panda · new robot, frozen methods", f"{pct(ap_best['mean_acc'])}%",
f"{html.escape(ap_best['method'])} · majority vote {pct(AP['majority']['mean_acc'])}%"))
if Dm:
dbest = "race_net_m + reach-repair" if "race_net_m + reach-repair" in Dm else "race_map"
extra_cards.append(("Track D · maze swarm · RACE-Net-M", f"{pct(Dm[dbest]['mean_acc'])}",
f"SPL×100 · rank 1 of 10 fusion rules · hand-written RACE map {pct(Dm['race_map']['mean_acc'])} · best literature baseline "
f"{pct(max(Dm[m]['mean_acc'] for m in ('wmsr_trim', 'reputation', 'eigentrust', 'dawid_skene', 'majority') if m in Dm))}"
+ (f" · oracle {pct(Dm['REF oracle']['mean_acc'])}" if "REF oracle" in Dm else "")))
if net in A:
hs_ = {r["method"]: r for r in lb.get("AH_so101", [])}
hp_ = {r["method"]: r for r in lb.get("AH_panda", [])}
extra_cards.append(("RACE-Net-V · our learned verification model", f"{pct(A[net]['mean_acc'])}%",
f"0.2 M params, trained on synthetic swarms only · zero-shot on SO-101"
+ (f" · Panda {pct(AP[net]['mean_acc'])}%" if net in AP else "")
+ (f" · on the hold-out {pct(hs_[net]['mean_acc'])} / {pct(hp_[net]['mean_acc'])}, behind our EM methods" if net in hs_ and net in hp_ else "")))
if hs_ and hp_:
rs_, pl_ = "race_s_online (new)", "race_pool (new)"
extra_cards.append(("Hold-out · new episodes, nothing tuned on it", f"{pct(hs_[rs_]['mean_acc'])} / {pct(hp_[pl_]['mean_acc'])}%",
f"SO-101: RACE-S online rank 1 · Panda: RACE-Pool rank 1 · majority vote {pct(hs_['majority']['mean_acc'])} / "
f"{pct(hp_['majority']['mean_acc'])}%"))
panda_html = "" if not AP else f"""
RoboRACE · Track A-Panda — replication on a different robot
All methods and hyper-parameters were frozen before this data existed. Same tasks, cameras and physics labels, new arm (Franka Panda).
{video("media/videos/panda_rollouts.mp4", "Franka Panda rollouts with the camera swarm's verdicts.")}
{lb_rows(lb, "AP")}
{fig("media/figures/cross_embodiment.png", "Every method's mean accuracy on SO-101 vs Panda.")}
{fig("media/figures/panda_gallery.png", "Panda episodes seen by the five cameras.")}
"""
AHs, AHp = {r["method"]: r for r in lb.get("AH_so101", [])}, {r["method"]: r for r in lb.get("AH_panda", [])}
hold_html = "" if not (AHs and AHp) else f"""
Hold-out: a test nothing was tuned on
New episodes of both arms (new seeds). Their views were scored by the frozen VLM pipeline, and no fusion method was run on them until a commit had
frozen every model, rule and threshold (results/holdout/FREEZE.json).
SO-101 hold-out
{lb_rows(lb, "AH_so101", 7)}
Franka Panda hold-out
{lb_rows(lb, "AH_panda", 7)}
"""
net_html = "" if net not in A else f"""
Our two models: one design
Both models answer the same question in two domains: a robot receives reports from peers, some of whom lie in a structured way; what is true?
They share one design from RACE and AIP: anchor on the receiver's own evidence, estimate every peer's channel in context, and invert consistent liars
instead of discarding them. Peers and items are sets, and both models are trained on simulated swarms only.
(design note)
{fig("media/architecture/racenet.png", "RACE-Net-V (pick-and-place): axial set transformer over agents × episodes, 0.2 M parameters.")}
{fig("media/architecture/racenet_m.png", "RACE-Net-M (maze): anchored channel encoder, peer transformer, signed read-out, 3 refinement rounds, 45 K parameters.")}
RACE-Net-V — the learned verification model
A 0.2 M-parameter axial set transformer that has learned receiver-anchored truth inference from synthetic swarms and is applied
unchanged to the real camera swarms. RACE-Pool is the AIP-style pool of RACE-Net-V, RACE-S and RACE. Weights:
Nabidnur/RoboRACE-Net.
{fig("media/figures/racenet.png", "Training curve and zero-shot transfer to real VLM camera swarms.")}
{fig("media/figures/racenet_scaling.png", "Scaling study on an independent synthetic generator.")}{hold_html}"""
d_html = "" if not Dm else f"""
RoboRACE · Track D — maze exploration with lying robots · RACE-Net-M
Six mobile robots explore an unknown maze and share what they sense; up to four corrupt their broadcasts. RACE-Net-M (45 K parameters,
trained on simulated mazes with random liars; the benchmark's attack names never appear in training) verifies each peer against cells the robot
sensed itself and inverts consistent liars. It is compared with six rules from the literature and with our hand-written RACE map. Score = SPL of honest robots.
Weights: Nabidnur/RoboRACE-Net-M.
{video("media/videos/maze_swarm.mp4", "Three of six robots invert their reports: majority map (false walls in red) vs RACE map. This is the maze with the largest gap; averages below.")}
{lb_rows(lb, "D", 11)}
{fig("media/figures/trackD_vs_liars.png", "SPL as liars take over the maze swarm.")}""" + (
"" if not (ROOT / "media/figures/racenet_m_scaling.png").exists() else fig("media/figures/racenet_m_scaling.png", "RACE-Net-M, unchanged, on swarm and map sizes it was never trained on.")) + (
"" if not lb.get("maze_llm") else fig("media/figures/maze_llm.png", "LLM agents on text mazes: one-shot vs validator-feedback repair.", "70%"))
pub_html = "" if not lb.get("published") else f"""
In context: published numbers
{fig("media/figures/published_context.png", "Grey = numbers from the cited papers' tables; teal = measured here. Context only: models, dates and instance subsets differ.")}"""
cards = [
("ERQA reproduction", f"{pct(rep.get('acc'))}%", f"Cosmos-Reason2-2B on CPU · NVIDIA reports {pct(rep.get('published'), 2)}% · inside our 95% CI ({pct(rep.get('lo'))}–{pct(rep.get('hi'))})"),
("Track A · SO-101 camera swarm", f"{pct(a_best['mean_acc'])}%", f"{html.escape(a_best['method'])} · rank 1 · liar-majority {pct(a_best['majority_liars'])}% vs majority vote {pct(A['majority']['majority_liars'])}%"),
("Track B · Byzantine rendezvous", f"{pct(B['race_c+wmsr']['mean_acc'])}%", f"RACE-C + W-MSR · rank 1 · W-MSR {pct(B['wmsr']['mean_acc'])}%"),
("Track C · LLM planners", f"{pct(sum(en) / len(en))}%", f"engineered (spec + validator + repair) · zero-shot {pct(sum(zs) / len(zs))}%"),
]
cards_html = "".join(f'
Byzantine-robust multi-agent robotics: when some of your robots, cameras or AI agents are wrong on purpose.
Two public benchmarks (ERQA, PlanBench) and five RoboRACE tracks, run on a CPU with real VLMs, real LLMs, two simulated robot arms and a maze swarm.
Every number below is generated from cached agent outputs in the dataset repository.
{video("media/videos/robot_rollouts.mp4", "SO-101 arm (MuJoCo Menagerie) rollouts judged by five Cosmos-Reason2-2B camera agents; then 3 of 5 cameras lie. Majority vote flips; RACE-S learns negative weights for the liars without labels and stays correct.", autoplay=True)}
{cards_html}
The idea
Majority vote and classical truth inference (Dawid–Skene, GLAD, MACE) fail once liars are the majority, because the latent-truth model becomes
symmetric. RACE (from the Liars Are Information program) anchors on the receiver's own honesty and gives every peer a signed
channel weight: trust, invert or discard. This work adds RACE-S (score level), online variants against sleepers, RACE-C + W-MSR for robot
consensus, confidence-gated anchoring (reported as a compromise, not a free lunch), and an engineered / LLM-Modulo planning layer.
{fig("media/figures/overview.png", "Best method per family on the three RoboRACE tracks.")}
Architecture
{fig("media/architecture/cosmos_reason2_verifier.png", "Cosmos-Reason2-2B (Qwen3-VL) as the success verifier — numbers from the real checkpoint (2.44 B params).")}
{fig("media/architecture/race_s.png", "RACE-S: anchored EM over rank-Gaussianized scores with signed weights.")}
{fig("media/architecture/roborace_system.png", "The three agent swarms.")}
{fig("media/architecture/plotnn/cosmos_verifier_plotnn.png", "PlotNeuralNet view of the verifier: one 448×448 view → 196 image tokens → P(yes).")}
Public benchmark · ERQA
Cosmos-Reason2-2B reproduced on 4 CPU cores: {pct(rep.get('acc'))}% (95% CI {pct(rep.get('lo'))}–{pct(rep.get('hi'))}, n = {rep.get('n')}),
reported {pct(rep.get('published'), 2)}%. At ≤768² px: {pct(rep768.get('acc'))}% ({rep768.get('n_changed_answers', '–')} of 400 answers change).
Swarm of {len(sw.get('agents', []))} VLM agents on {sw.get('n_questions')} shared questions:
{erqa_tbl}
{fig("media/figures/erqa_results.png", "Reproduction by category (left) and the multi-agent swarm without attackers (right).")}
{fig("media/figures/erqa_pareto_cga.png", "Robustness vs clean accuracy with the robot's own CPU model as receiver.")}
{fig("media/figures/verifier_calibration.png", "Cosmos-Reason2 as a binary success verifier: calibration matters (56% → 83%).")}
Public benchmark · PlanBench Blocksworld
An exact simulator (accepts all 500 official ground-truth plans) turns into a repair signal: LLM-Modulo with ≤3 repairs.
{fig("media/figures/planbench.png", f"{pb.get('n_instances')} instances answered by all {len(pb.get('agents', []))} agents.")}
{video("media/videos/planbench_modulo.mp4", "A real cached LLM plan: the validator rejects step 11, the repaired plan reaches the goal.")}
{pb_tbl}
RoboRACE · Track A — SO-101 camera swarm
{fig("media/figures/so101_gallery.png", "220 physics rollouts × 5 cameras; ground truth = final physics state.")}
{lb_rows(lb, "A")}
{fig("media/figures/trackA_vs_liars.png", "Accuracy as liars take over the camera swarm.")}
{fig("media/figures/race_s_weights.jpg", "RACE-S signed weights learned without labels: liars get negative weight.")}
{fig("media/figures/trackA_cameras.png", "Per-camera quality of the five agents.")}
{panda_html}
{net_html}
RoboRACE · Track B — Byzantine rendezvous
{video("media/videos/swarm_rendezvous.mp4", "12 robots, 4 colluding Byzantine robots: DeGroot vs W-MSR vs RACE-C + W-MSR.")}
{lb_rows(lb, "B")}
{fig("media/figures/trackB_vs_liars.png", "Mission success vs number of Byzantine robots.")}