File size: 5,471 Bytes
11c954b
49ef597
 
 
 
4055d08
49ef597
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4055d08
49ef597
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4055d08
49ef597
 
 
 
 
11c954b
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover">
<title>CablePilot: Clear the Playroom</title>
<meta name="description" content="A cable robot clears a playroom. A 28k-parameter world model imagines 128 futures every 0.2 s; furniture is only a cost.">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link href="https://fonts.googleapis.com/css2?family=Archivo:wght@500;700;800&family=JetBrains+Mono:wght@400;500&display=swap" rel="stylesheet">
<link rel="stylesheet" href="style.css">
<link rel="icon" href="data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 32 32%22%3E%3Cpath d=%22M4 4L16 18L28 4M4 28L16 18L28 28%22 stroke=%22%23e68e0d%22 stroke-width=%222.5%22 fill=%22none%22/%3E%3Ccircle cx=%2216%22 cy=%2218%22 r=%223.5%22 fill=%22%235fb68b%22/%3E%3C/svg%3E">
<script type="importmap">{ "imports": { "three": "./vendor/three.module.js", "three/addons/": "./vendor/addons/" } }</script>
</head>
<body>
<main class="app">
  <section class="stage" aria-label="The playroom, in 3D">
    <canvas id="view"></canvas>
    <div class="hint" id="hint">Click the floor to drop a toy · drag furniture · click a toy to take it back · drag empty space to turn the view</div>
    <div class="toast" id="toast" role="status" hidden></div>
    <div class="legend">
      <span><i class="sw ember"></i>the plan it chose</span>
      <span><i class="sw future"></i>futures it imagined</span>
      <span><i class="sw shadow"></i>line shadow</span>
    </div>
  </section>

  <aside class="panel">
    <header>
      <p class="mark">MacroSwan <span>·</span> CablePilot</p>
      <h1>Clear the playroom</h1>
      <p class="lede">A cable robot hangs from four lines in a playroom. Every 0.2 s it imagines 128 futures with a small learned world model and follows the cheapest. Furniture is only a cost, so move it and watch the plans bend.</p>
    </header>

    <div class="controls">
      <button id="run" class="primary">Start</button>
      <div class="seg" role="group" aria-label="Speed">
        <button data-speed="1" class="on">1×</button><button data-speed="2">2×</button><button data-speed="4">4×</button><button data-speed="0">max</button>
      </div>
      <button id="reset" class="ghost">Reset</button>
    </div>

    <section class="status">
      <div class="phase"><span class="dot" id="phaseDot"></span><span id="phase">waiting for toys</span></div>
      <div class="kpis">
        <div><b id="toys">0/5</b><span>toys in the hamper</span></div>
        <div><b id="clock">0 s</b><span>robot time</span></div>
        <div><b id="contacts">0</b><span>furniture contacts</span></div>
      </div>
    </section>

    <section class="card">
      <h2>What one decision costs</h2>
      <div class="kpis">
        <div><b id="ms">–</b><span>ms per plan, this browser</span></div>
        <div><b id="fps">–</b><span>futures imagined per CPU-second</span></div>
        <div><b id="cpuToy">–</b><span>CPU-seconds per toy</span></div>
      </div>
      <div class="split" id="split" aria-label="Where the time goes"></div>
      <p class="fine">28,401 parameters. 128 futures × 2 s ahead, 5 times a second, on one CPU thread. No GPU.</p>
    </section>

    <section class="card">
      <h2>Why it chose this plan</h2>
      <ul class="terms" id="terms"></ul>
      <p class="fine">The chosen plan's cost terms over its 2 s horizon. Furniture and lines rise when you crowd the robot.</p>
    </section>

    <section class="card">
      <h2>Furniture</h2>
      <div class="add">
        <button data-add="chair">+ Chair</button><button data-add="table">+ Table</button><button data-add="shelf">+ Shelf</button><button data-add="box">+ Box</button>
      </div>
      <div id="furn" class="furn"></div>
      <label class="check"><input type="checkbox" id="showShadow" checked> Show line shadows on the floor</label>
      <label class="check"><input type="checkbox" id="showFutures" checked> Show imagined futures</label>
      <label class="check"><input type="checkbox" id="follow"> Follow the robot</label>
    </section>

    <section class="card">
      <h2>Log</h2>
      <ol class="log" id="log"></ol>
    </section>

    <footer class="fine">
      <p><b>Planner:</b> the released <a href="https://huggingface.co/MacroSwan/cablepilot" target="_blank" rel="noopener">MacroSwan/cablepilot</a> world model, trained on our own simulated motion and ported to JavaScript. It matches PyTorch to 0.0005 mm.</p>
      <p><b>Robot:</b> simulated by the same world model plus noise. Against the MuJoCo twin it is off by about 2 cm over 2 s, and a real robot would differ more. <b>Room:</b> a fictional 4.6 × 4.0 m playroom with the line anchors in its corners.</p>
      <p><b>The pilots:</b> <b>CablePilot</b> (a cable robot clears a playroom) · <a href="https://huggingface.co/spaces/MacroSwan/DronePilot" target="_blank" rel="noopener">DronePilot</a> (a quadrotor flies your task card) · <a href="https://huggingface.co/spaces/MacroSwan/ArmPilot" target="_blank" rel="noopener">ArmPilot</a> (an SO-101 puts a pen in a cup). The same idea on three bodies, by <a href="https://huggingface.co/MacroSwan" target="_blank" rel="noopener">MacroSwan</a>: small world models and planning, with their compute bill.</p>
    </footer>
  </aside>
</main>
<script type="module" src="main.js"></script>
</body>
</html>