Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

When two runs disagree

The question. Run the arm’s 2 kg curl twice, with a change to the solver that should make no physical difference, and the two runs disagree by almost half a degree. Is one of them wrong? And how can a faster solver be judged, if the default solver does not even agree with itself?

How the simulator is checked asked whether the equations are solved correctly. This page asks a narrower question, the one every proposed speed-up runs into. How large a difference between two runs is just the model’s own spread, and how large means that something changed?

By the end you will be able to say why the curl’s spread does not shrink with the size of the change that causes it. You will also be able to say what a reproducibility band is and how its margin is set, and why a solver option that saves a third of the work is not yet the default.

Every number on this page is a report value, quoted from solver rounds P19 and P20 (reports/p19-solver-cost.md, reports/p20-solver-band.md). They were measured on the model as it stood on 28 November 2026 (commit af85a62f for P20’s “new default”). The model has changed since, so they show the size of the effect, not today’s digits.

The idea, in small steps

Each balance is found only to a tolerance. In every time step the simulator searches for the shape in which the tissue’s forces balance (Finding the shape that balances). The search stops when no free coordinate carries more than a set unbalanced force, and the default is 10 mN. So the answer of each step is one of many shapes that pass the test, not one exact shape. A search may also stop on a test of its energy, so it can end above the 10 mN tolerance. Over the first twelve steps of a test arm without the fascia, P20 measured a median of 52 mN left unbalanced where the searches stopped.

A change that is physically nothing. Each Newton step adds a shift, a small stiffness added to every coordinate, to keep the matrix it solves with bowl-shaped (Steps near a saddle). The default shift is 100 N/m, scaled by how far the search is from balance. A shift of this kind is known as a Levenberg–Marquardt shift. Changing 100 to 100.001 is a perturbation of one part in 10⁵: it changes which shapes the searches try on their way, not the equations they solve.

What the perturbation does to the curl (P20, the largest difference of each run from the reference run over the curl’s 35 recorded frames):

RunShiftElbow angleJoint momentA muscle’s pullActivation
n1100.001 (10⁻⁵)0.283°1.111 N·m33.4 N0.027
n299.999 (10⁻⁵)0.197°0.242 N·m13.1 N0.015
n3100.0001 (10⁻⁶)0.443°0.446 N·m16.7 N0.054

Two earlier runs on the model before its last change differed by up to 0.567°. Every run met the curl’s aim: to follow its path, peak within a degree of 110° and end there at rest.

The spread is saturated. A ten times smaller perturbation, in n3, moved the curl as far as the larger ones did, and further than two of them. If the differences were the perturbation’s doing, they would shrink with it. They do not. A spread that stays the same size however small its cause is called saturated.

Why it saturates (P20’s diagnosis, partly judgement):

  1. The paths part at once. Any change makes the searches stop at slightly different shapes. Each still passes the same test, so the two runs differ at the level of the stopping tolerance, whatever the size of the change. After the setup, before the curl begins, the two runs already differ by 3–4 mN·m in joint moment.
  2. The move amplifies the difference. Until about 0.35 s the runs stay within 0.01–0.07 N·m of each other, at the stopping level. The difference grows in the fast part of the move, 0.6 to 1.0 s, and is largest in the overshoot and settling around 110°. The controller feeds the elbow’s state back into the muscles’ activations, so a small difference in angle becomes a difference in drive.
  3. Two muscles can share one load in more than one way. The long head of biceps and brachialis lie side by side and touch, and the long head runs under the fascia. At the end of the hold the long head of biceps pulls 34–38 N in the four runs of the new default. On the earlier model it pulled 22, 40 and 27 N. Brachialis makes up the difference (166–186 N), and the joint moment is the same. In one pair of runs the split starts at 0.85 s and then stays. P20 reads this as a balance that is not unique, not a stopping error (judgement).

Tighter stopping, measured on twelve steps only. Asking the searches to stop ten times tighter lowers what they leave unbalanced from a median of 52 mN to 1.7 mN. It costs 261 → 415 iterations over the twelve steps. By the twelfth step, the default’s angle is about 1 × 10⁻³° from the converged path. Whether tighter stopping would shrink the whole curl’s spread was not measured: the two whole curls were queued and not reached. The split between the two muscles points to a spread that would stay (P20, judgement, untested).

First, the same model. One disagreement had a plainer cause. The committed recording of the curl differs from a fresh run of the “new default” by up to 0.88°, 0.60 N·m and 52.6 N. That is more than the spread above, because the model had changed: a merge of the hand’s model entered after the recording was made. Before two runs are compared, check that they ran the same model.

Then, one change at a time. Tissue round 20 met the same question about cost. On a merged model the default curl took 4,393 iterations to reach 0.66 s, against 2,106 for the round before: about twice as dear. Three changes had come in together. The round rebuilt the tissue with each undone in turn and counted the setup and first twelve steps of each. A binding of the long head of triceps over 459 mm² beside the lengthened olecranon was the cause: it took 4.5 times the first balance’s iterations and 18 times its line-search trials. The other two changes were within the noise, for a change of 10⁻⁵ in one solver constant moved the twelve steps’ count by 12 to 27 %. With the long head bound on its measured insertion instead, the whole curl took 12,340 iterations, against 12,763 in the round before (tissue round 20, sections 9.3 and 9.4).

The reproducibility band

A difference can only be judged against the model’s own spread. P20 built a rule for that, a reproducibility band: the range within which runs of the default fall when nothing physical has changed. The rule is in tools/research/p20/curl_band.py. It has three parts.

(a) The envelope, frame by frame. The envelope is, at each recorded frame, the range from the smallest to the largest value of the default runs, for the angle, the moment, each muscle’s pull and each activation. Its centre and half-width define the band. A new run must lie within the centre ± (1 + margin) × the half-width at every frame.

  • The half-width is widened over one frame either side, because the settling’s phase differs a little from run to run.
  • The band is never narrower than the curl’s earlier fixed tolerances: 0.13°, 1.1 % of the peak moment, 4.6 N and 0.012 of activation.

The new default’s envelope (P20, four runs) is this:

Part of the curlAngleMomentWidest pullWidest activation
Before 0.45 sunder 0.03°under 0.08 N·m
The moveup to 0.07°up to 0.2 N·m
Overshoot and settling, 1.0–1.7 sup to 0.44° (1.35 s)up to 0.45 N·mup to 23.5 Nup to 0.054
The end, 1.70 s0.11°0.08 N·m20.9 N

One run has a single-frame spike at 0.85 s, of 1.1 N·m and 38 N.

(b) The claim and the contacts. The run must still meet the curl’s aim and its limits on how far muscles press into bone and into each other.

(c) The end of the hold. Over the hold’s last 0.2 s, the run’s mean must lie within twice the largest departure of any default run from the default runs’ mean. The four runs’ means agree to ±0.012° and ±0.07 N·m, so the window is 0.024° and 0.139 N·m. This is the part of the curl the model determines best: angle and moment settle, even where the two muscles’ shares do not.

The margin, by leave-one-out. How wide should the margin in (a) be? P20’s rule sets it from the default runs themselves, by leave-one-out: build the band from all the default runs but one, check the one left out against it, and repeat for each run. The margin is the smallest one under which every default run lies inside the band of the others. A band that rejects the default itself is too narrow.

With four runs, no margin up to 6 passes. These counts are of frame-quantities: one quantity, such as the angle or one muscle’s pull, at one frame.

Margin0136
Frame-quantities still outside125683923

Four runs understate the default’s spread, above all the long head’s two ways of sharing the load. P20 judges that 6–8 default runs are needed. If no reasonable margin passes even then, P20 proposes judging on summary measures instead, such as the largest difference in each window of the curl. Until then the band is built but not calibrated, and it cannot pass or fail anything.

A worked example: a faster option

The option. When a step’s first search fails at its very start, the simulator carries the bones’ move again in halves (Tissue and skeleton together). predict-carry starts each of those carried searches from the tangent prediction of the move, instead of from a shape whose bricks beside the bones are sheared. Only the starting guess changes. Every search still ends at the same 10 mN test.

What it costs. Cost is counted in units of work. An iteration is one Newton step. An assembly builds the stiffness matrix and forces. A line-search trial tries one length of step. A factorisation prepares the matrix to be solved. Measured on one run, pc1 (P20):

pc1Default, mean of four runs (range)Ratio
Iterations7,20611,137 (10,267–12,439)0.65
Assemblies8,01011,8930.67
Line-search trials12,77323,7170.54
Factorisations15,13424,0070.63

To check the first ratio: . P19 found the same on an earlier model: 0.65 of the default’s iterations, over two pairs of runs.

Is it the same answer? Work through the three parts of the band:

  1. Its largest difference from the reference default run is 0.198°, 0.174 N·m and 12.1 N. That is smaller than three of the four default perturbations, so by this measure it looks like the default’s own spread (judgement).
  2. The end of the hold. It ends +0.008° and +0.050 N·m from the default runs’ mean, inside the 0.024° and 0.139 N·m of (c).
  3. The envelope. At margin 6 no frame is outside. At margin 1, 26 frame-quantities are outside: the long head’s pull in 14 frames between 1.05 and 1.2 s, by up to 4.8 N, activations in 11, and the angle at 0.90 s by 0.046°. Left out against each three-run band, pc1 is outside more often than the default run left out: 31–70 frame-quantities at margin 1, against 4–48.

The verdict: not adopted. predict-carry is close to the default, but it has not been shown to be interchangeable with it. Its long head of biceps carries a little less in the settling (P20, judgement). Two things are missing before it can be judged:

  • a calibrated margin, because the band does not yet pass the default’s own runs;
  • a second run, because one run cannot show whether the option’s differences are its own or chance.

The rule is never to widen the band until a change fits. The band is set by the default alone, and a candidate is judged against it afterwards.

Counting work, not seconds

The table above compares counts, not clock times. During P20 the machine’s power setting changed: it was raised part way through the runs, so some ran before the change, some after and one across it. The machine was also shared with other work, which slowed some runs more than others. A wall time measured at one setting cannot be compared with one measured at another.

Counts of iterations, assemblies, line-search trials and factorisations do not depend on how fast the processor runs or how busy it is. So a solver’s cost is compared by counts, and wall times are quoted only for runs at the same setting. Measured that way, pc1‘s steps took 3,510 s against 4,781 s for a default run at the same setting, a ratio of 0.73. That differs from the counts’ 0.54–0.67, because each kind of work takes its own time and the time also depends on the machine’s load. Only the counts can be compared across settings.

Counts have a spread of their own. The default’s iterations ranged from 10,267 to 12,439 over four runs, about ±10 % under perturbations that change nothing physical. A speed-up must beat that spread, and twelve steps are too few to show it (Fast methods and what they converge to).

What this page leaves out

  • A calibrated band. Four default runs are too few. The fifth was stopped part way through the curl.
  • Whether tighter stopping removes the spread. It was measured over twelve steps, not over a whole curl.
  • A second run of predict-carry, and any whole-curl run of the other options.
  • Today’s model. The numbers are from P20’s model of 28 November 2026. The committed recording was made again later that day, by tissue round 20 on the passive round’s model; P20’s band has not been re-run on it.
  • Which points of contact switch. The runs record how many contacts switch in each step, not which, so a fork in the contacts inside a step is not ruled out.

Summary

  • Each time step’s balance is found only to a tolerance, so a change that is physically nothing still moves the searches to a different shape that passes the same test.
  • On the 2 kg curl, a change of 10⁻⁵ or 10⁻⁶ in the solver’s shift moved the elbow by up to 0.44–0.57°, 1.1 N·m and 33 N, largest in the overshoot and settling. A ten times smaller change moved it as far: the spread is saturated.
  • The long head of biceps and brachialis can share the same joint moment in more than one way. So P20 judges that one run’s muscle pulls cannot be quoted to better than about ±10 N, while the end of the hold’s angle and moment agree to ±0.012° and ±0.07 N·m.
  • A reproducibility band judges a run against the default’s own envelope, frame by frame, with a margin set by leave-one-out, and against a tight window at the end of the hold. With four runs no margin up to 6 passes, so the band is not yet calibrated.
  • predict-carry takes 0.65 of the default’s iterations and meets the curl’s aim. It is not adopted until a calibrated band and a second run can judge it.
  • Solver cost is compared by counts of work, because the machine’s power setting changed during the runs and wall times at different settings do not compare.

Next: games and films use far cheaper methods than these; what does each of them give when it is run to the end? Fast methods and what they converge to.