Checking how many agents are working

How this works
Contact
← Blog
A small matte resin fly standing on six thin legs on a brushed steel plate, a hair-thin brass wire rising from its head to a small steel box, in teal and steel with a warm amber rim light, the AMARBARO mark and wordmark centered over it.
✎article de blog

A body for a brain: what physics simulation adds

The short version

A body gives a brain model a test anyone can read, and our first body check printed PASS while the toy fly was tipped over by 117 degrees because it never measured tilt.

What this is about

A simulated brain is a list of cells and links that fire in patterns. On its own, it does nothing you can see. To learn whether the wiring makes sense, you give it a body. The body has legs, joints, feet and weight. A ground pushes back and gravity pulls down. Then you can ask a plain question: does the animal stand, walk and turn?

This article explains why a body matters and what a physics simulation adds. It also tells one small story about our first body check, because that story shows what can go wrong.

Why it matters

Imagine you have a map of a brain and you run it. A hundred thousand cells fire. Is that good? Is it a walk, or is it noise? Without a body, you can only compare patterns of spikes, and a pattern is hard to judge by eye.

A body gives you a test that anybody can read. A fly that is meant to walk forward either moves forward or it does not. A fly that falls over has told you something. The body acts as a judge that does not care about our hopes.

A body also adds trouble that a brain alone never meets. Legs must lift and land in the right order. The feet must grip. The body must not tip. The brain is not asked to solve these things from scratch. Some of the work is done by the body itself, and as we found, sometimes more than we guessed.

What a physics simulation does

A physics engine is a program that takes a body's pose and the forces on it and works out the next instant. In plain words, it answers questions like these:

  1. Where is each leg now?
  2. How hard is each foot pushing on the floor?
  3. If the motor in this joint pushes this much, how does the leg move?
  4. Is the body tipping?

It does that again and again, many times a second. Each pass is a step. A walk is thousands of steps in a row.

We use an engine called MuJoCo, which is a standard one for robots and animals. Our fly body weighs 1.026 milligrams. It has 44 joint motors and 6 sticky foot pads. We explain the engine itself in MuJoCo: the physics engine behind simulated bodies.

How a brain drives a body

The brain does not move every leg directly. That would ask too much of a map of wiring. Instead, in our hybrid walker, a few cells in the brain, the descending neurons, send commands down.

brain  ->  descending neurons  ->  readouts  ->  gait + posture  ->  physics body
                                   (speed, stop, turn)              (legs, feet, ground)
  • Walking speed comes from a group of descending neurons.
  • A stop comes from one cell type, DNg103.
  • A turn comes from a readout of turn-related descending cells.
  • A gait clock sets the rhythm of the legs, and named leg motor neurons set posture.

So the body is not fully run by the brain. It is a team. The brain gives intent, and the gait code and the physics turn that intent into steps.

That split is honest, and it leads to the result that surprised us. We expected that a steady turn would come from the brain's response to smell. It came from the legs' senses instead. When we switched the senses off, the turn went to zero. We tell that in The fly's turn came from its legs, and a plainer version comes later in this series.

A body can pass a check for the wrong reason

Our first physics prototype passed its check while the toy fly was tipped over by 117 degrees. The check printed PASS because it never measured tilt.

That is a common trap. A check can only catch what it looks at. If it does not look at tilt, a fly lying on its side counts as fine.

Since then we follow a plain habit: before we trust any check, we break something on purpose and see whether the check notices. We call that a planted bug. We also keep two controls. One must pass, such as flat ground. One must fail, such as an upside-down fly. If both behave as expected, the check can tell standing from lying down.

Even that is not enough. An outside review of our GPU engine found ten defects, and every stage had passed its planted-bug check. A planted bug tests what we thought of, not what we missed. We wrote that up in Our planted bugs were blind to the bug that mattered.

What a body cannot tell you

A body that walks does not prove the brain is a copy of a real one. It only shows that the software does what we said. Whether a real fly would do the same is a separate question, and our comparison to lab data is still marked UNVERIFIED.

A body also adds its own choices. Who wrote the gait clock? Which constants were fit, and on which random run? We fit our constants on one seed and ran the pass-or-fail check on another, so the check could fail for real.

Glossary

  • Physics engine: a program that works out how a body moves, touches the ground and balances.
  • Step: one small update of the simulation. A walk is thousands of steps.
  • Joint motor: a simulated motor that bends a joint, like a muscle.
  • Descending neuron: a nerve cell that carries a command from the brain toward the body.
  • Gait: the pattern in which legs lift and land when an animal walks.
  • Planted bug: a fault we add on purpose to see whether a check catches it.

Try it

  • Our body engine is open: Kinestride on GitHub. It steps many bodies at once on a graphics card, and each part is checked against MuJoCo.
  • You do not need a graphics card to look around. The README names a CPU-only smoke test, tools/smoke.sh, that checks the documentation links and builds a step without assets.
  • The repository keeps a small spider model in kinestride/models/spider_test.xml, readable in any text editor. Open it and count the joints. It is a good way to see what a body description looks like.
  • The brain-and-body pair lives in fly-connectome.

Previous in the series: Neurons and synapses, in plain words. Next: MuJoCo: the physics engine behind simulated bodies.

Commentaires

Pas encore de commentaires.

Se connecter pour commenter.