A humanoid learns backflips and other acrobatics by imitating motion capture. The physics is a rigid-body engine written from scratch in C++, the learning is PPO in PyTorch, and the two talk over UDP while 25 humanoids train in parallel.
Everything above runs in the browser. The C++ engine was ported to JavaScript and the trained actor networks were pulled out of their checkpoints, so the same policies that trained against the C++ sim are stepping the same physics here - same 1/30s timestep, 40 substeps, 15 solver iterations. The port was checked against the original: over 30 steps from an identical pose the two agree to about 1e-4, and the network reproduces PyTorch's actions to 1e-7.
The interesting part is where the episodes start. A backflip cannot be learned from frame zero, because the landing is only reachable if the takeoff and the flight already went right - so a policy that always starts at the beginning fails at the landing forever. Instead the start window runs backwards: episodes begin in the last stretch of the clip where all that is left is to land, and once that is solid the window widens back toward the takeoff. Every stage starts from something the previous stage already solved.
That is why each motion here has a handoff phase. Up to it the clip is replayed kinematically, giving the body the reference pose and the reference momentum; past it the policy is on its own and the physics is real. The grey part of the bar is the replay, the blue part is the policy actually doing the move. Push the handoff earlier than a policy was trained for and it falls, which is the curriculum made visible.
The 2D tab is the earlier version of the project: a 2D biped that only has to stay standing while being shoved, where the curriculum grew the size of the shove instead of moving the start point.