Real 26-Cubelet Physics, Solved Live in Your Browser
Every move you watch above happens through genuine rigid-body contact physics inside MuJoCo compiled to WebAssembly. The Rubik's cube is not a rigid block with swapped textures: it is a 27-body articulated puzzle consisting of a free-floating core, 6 center hinges, and 20 edge and corner cubelets mounted on ball joints with beveled collision meshes. The cube itself has zero motors—only the 20 position actuators of the Shadow Dexterous Hand can push, cradle, flip, and twist its layers.
Physics
MuJoCo 3.14 WASM (250 Hz, 117 DoF)
Robot
Shadow Hand (24 joints, 20 actuators)
Policies
Reorient (140D) & Twist (143D) PPO
Planner
Live Two-Phase Kociemba (JS)
Full Cube State & Closed-Loop Manipulation
At 50 Hz, the control loop reads the complete physical state of both the Shadow Hand and the Rubik's cube: 24 hand joint angles and velocities, 20 actuator targets, all 5 fingertip positions relative to the cube, the cube's 3D pose and velocities, and all 6 internal face hinge angles and angular velocities. Rather than forcing a single policy to compromise between rotating the whole cube rigidly and clamping the bottom two layers while torqueing the top layer, solving is factored into two specialized PPO policies trained on Google Colab GPU with MuJoCo-Warp:
Reorient brings any requested face normal straight up (+Z) while keeping all
six internal faces locked to multiples of 90° and squaring the cube's yaw with the palm.
Twist starts from real terminal grasp states collected from Reorient and clamps
the bottom two layers with the palm and fingers while rotating the top face by +90° or −90°.
Reorient is then fine-tuned on real post-Twist grasp states so handovers between flipping
and twisting remain smooth across dozens of consecutive moves.
Live Kociemba Re-Planning
A pure-JavaScript two-phase Kociemba solver decodes the exact 54-sticker configuration directly from the 20 physical cubelet quaternions in MuJoCo and computes a ≤22-move solution in a few milliseconds. Because planning reads the live physics state rather than an abstract mirror, you can grab and perturb the cube with your mouse mid-solve—if a layer slips or the cube gets bumped, the hand stabilizes it and Kociemba re-plans from whatever physical state the cube ended up in.
Measured Performance (MuJoCo WASM)
Evaluated deterministically in Node.js on the exact same @mujoco/mujoco WebAssembly physics
engine and pure-JS neural network evaluator running on this page.
| Benchmark | Success Rate | Mean Time / Steps |
|---|---|---|
| Single-move Reorient | – | – |
| Top-Face Twist (±90°) | – | – |
| 5-Move Scramble (~6 turns) | – | – |
| 12-Move Scramble (~21 turns) | – | – |
| Full 20-Move Scramble (~29 turns) | – | – |