Multiplications in a hierarchical solve and in a dense factorisation, and where they cross
At its defaults it draws multiplications in a hierarchical solve and in a dense factorisation, and where they cross. Both counted rather than estimated: the recursion carries a counter and reports what it actually did. The dense factorisation is n³/3 and rises at exactly three per doubling. The hierarchical solve rises at 2.13, 1.93, 1.74 — falling, because the cost is n log²n and its exponent is on its way to one. The two cross between n = 64 and n = 128: below it the format is the more expensive way to solve the system, at 1.48 times the dense count, and at n = 512 it is 6.2 times cheaper. Every point returns an answer at a backward error of about 1.4·10⁻¹⁰, so the comparison is between two ways of getting the same thing.
solve-cost is one function in lib/figures/hsolve.js —
solving with it — the recursion that assembles nothing, and the backward error that was chosen. Everything below came out of it during this build, at
arguments taken from the essays rather than invented for this page. A figure here is the
figure a reader meets in an essay, and if the generator changes, this page changes with it.
At its defaults
Drawn even though every essay passes arguments — which on this site is every essay, at 100% of placements since the standard pass. A default nothing exercises is a trap for the next essay to call this with none, and this is the page where a default that has drifted from the figures around it becomes visible.
Both counted rather than estimated: the recursion carries a counter and reports what it actually did. The dense factorisation is n³/3 and rises at exactly three per doubling. The hierarchical solve rises at 2.13, 1.93, 1.74 — falling, because the cost is n log²n and its exponent is on its way to one. The two cross between n = 64 and n = 128: below it the format is the more expensive way to solve the system, at 1.48 times the dense count, and at n = 512 it is 6.2 times cheaper. Every point returns an answer at a backward error of about 1.4·10⁻¹⁰, so the comparison is between two ways of getting the same thing.
show: "ct-curve", count: 20
The arguments are the ones The preconditioner that knew how many passes. A value nobody placed would be a picture no essay asked for and no claim was ever checked against.
512 unknowns, easiest: 1.78 at 0.3, 1.20 at 0.1, 1.10 at 0.03, 0.97 at 0.01, 0.93 at 10⁻³, 0.82 at 10⁻⁴, 0.95 at 10⁻⁵, 1.10 at 10⁻⁶, 1.30 at 10⁻⁷, 1.13 at 10⁻⁸; cheapest 10⁻⁴ at 0.82. 512 unknowns, harder: 5.60 at 0.3, 5.38 at 0.1, 3.66 at 0.03, 2.15 at 0.01, 1.45 at 10⁻³, 1.29 at 10⁻⁴, 1.08 at 10⁻⁵, 1.33 at 10⁻⁶, 1.47 at 10⁻⁷, 1.17 at 10⁻⁸; cheapest 10⁻⁵ at 1.08. Below one the iteration is cheaper than the direct route.
show: "ct-steps"
The arguments are the ones The preconditioner that knew how many passes. A value nobody placed would be a picture no essay asked for and no claim was ever checked against.
512 unknowns, easiest: 10 at 0.3, 6 at 0.1, 5 at 0.03, 4 at 0.01, 3 at 10⁻³, 2 at 10⁻⁴, 2 at 10⁻⁵, 2 at 10⁻⁶, 2 at 10⁻⁷, 1 at 10⁻⁸; 512 unknowns, harder: 23.3 at 0.3, 21 at 0.1, 13.3 at 0.03, 7 at 0.01, 4 at 10⁻³, 3 at 10⁻⁴, 2 at 10⁻⁵, 2 at 10⁻⁶, 2 at 10⁻⁷, 1 at 10⁻⁸; 256 unknowns, easiest: 9.3 at 0.3, 6 at 0.1, 5 at 0.03, 4 at 0.01, 3 at 10⁻³, 2 at 10⁻⁴, 2 at 10⁻⁵, 2 at 10⁻⁶, 2 at 10⁻⁷, 1 at 10⁻⁸; 256 unknowns, harder: 18.3 at 0.3, 17 at 0.1, 12 at 0.03, 6.3 at 0.01, 4 at 10⁻³, 3 at 10⁻⁴, 2 at 10⁻⁵, 2 at 10⁻⁶, 2 at 10⁻⁷, 1 at 10⁻⁸.
show: "ct-best"
The arguments are the ones The preconditioner that knew how many passes. A value nobody placed would be a picture no essay asked for and no claim was ever checked against.
512 unknowns, easiest: 0.1 for 1, 0.1 for 2, 0.01 for 5, 0.01 for 10, 10⁻⁴ for 20, 10⁻⁴ for 50, 10⁻⁸ for 100, 10⁻⁸ for 200, 10⁻⁸ for 500; 512 unknowns, harder: 0.01 for 1, 10⁻³ for 2, 10⁻³ for 5, 10⁻⁵ for 10, 10⁻⁵ for 20, 10⁻⁸ for 50, 10⁻⁸ for 100, 10⁻⁸ for 200, 10⁻⁸ for 500; 256 unknowns, easiest: 0.1 for 1, 0.1 for 2, 0.01 for 5, 10⁻⁴ for 10, 10⁻⁴ for 20, 10⁻⁸ for 50, 10⁻⁸ for 100, 10⁻⁸ for 200, 10⁻⁸ for 500; 256 unknowns, harder: 0.01 for 1, 10⁻³ for 2, 10⁻⁵ for 5, 10⁻⁵ for 10, 10⁻⁸ for 20, 10⁻⁸ for 50, 10⁻⁸ for 100, 10⁻⁸ for 200, 10⁻⁸ for 500.
show: "ct-each"
The arguments are the ones The preconditioner that knew how many passes. A value nobody placed would be a picture no essay asked for and no claim was ever checked against.
512 unknowns, easiest: 6.74 at 0.3, 4.46 at 0.1, 3.97 at 0.03, 3.39 at 0.01, 2.91 at 10⁻³, 2.16 at 10⁻⁴, 2.33 at 10⁻⁵, 2.52 at 10⁻⁶, 2.75 at 10⁻⁷, 1.49 at 10⁻⁸; least 1.49; 512 unknowns, harder: 17.03 at 0.3, 16.31 at 0.1, 10.99 at 0.03, 6.28 at 0.01, 3.97 at 10⁻³, 3.27 at 10⁻⁴, 2.38 at 10⁻⁵, 2.68 at 10⁻⁶, 2.84 at 10⁻⁷, 1.52 at 10⁻⁸; least 1.52; 256 unknowns, easiest: 6.39 at 0.3, 4.50 at 0.1, 4.08 at 0.03, 3.45 at 0.01, 2.93 at 10⁻³, 2.19 at 10⁻⁴, 2.33 at 10⁻⁵, 2.53 at 10⁻⁶, 2.73 at 10⁻⁷, 1.49 at 10⁻⁸; least 1.49; 256 unknowns, harder: 14.18 at 0.3, 13.67 at 0.1, 10.40 at 0.03, 5.89 at 0.01, 4.10 at 10⁻³, 3.37 at 10⁻⁴, 2.44 at 10⁻⁵, 2.72 at 10⁻⁶, 2.86 at 10⁻⁷, 1.53 at 10⁻⁸; least 1.53.
show: "ct-cross"
The arguments are the ones The preconditioner that knew how many passes. A value nobody placed would be a picture no essay asked for and no claim was ever checked against.
the plain iteration: 0.32 at 1, 1.50 at 5, 4.82 at 20, 8.67 at 50, 11.82 at 100, 16.65 at 500; preconditioned at a hundredth: 0.18 at 1, 0.39 at 5, 0.97 at 20, 1.65 at 50, 2.20 at 100, 3.05 at 500; preconditioned, tuned to the count: 0.14 at 1, 0.39 at 5, 0.82 at 20, 1.19 at 50, 1.31 at 100, 1.44 at 500. The fixed hundredth crosses the direct route at 20.8 right-hand sides, the tuned one at 32.0, the plain iteration at 3.2.
What it checked while drawing
Every figure above checked its own claims on the way to being drawn, and a claim that failed
would have stopped the picture rather than shipped a wrong one. Those checks used to leave
no trace at all: a passing one returned true and the only evidence the figure had
checked anything was that nothing crashed. The list below is what they actually said, collected
by running this generator with an observer installed — not a description of
what it is believed to check.
19 distinct claims across 6 sets of arguments, grouped below by shape — because most of them are one sentence with a different number in it, and how many separate times that sentence was put to the test is the informative part.
and the answer is still an answer at n = 64 — checked 4 times
a count the dial offers
a kernel this file defines
a power of two, so the bisection is exact at every level
a shift inside the range the matrix stays positive definite and the geometry stays the geometry
a size and a shift this file measures
a size and a softening this file measures
a size the dense reference below is affordable at
a size the dial offers
an accuracy the blocks have singular values across
an accuracy, not a rank
at least one row
curves with points on them
LU is for square matrices
matmul shapes agree
the multiplication count grows well below the dense factorisation's cube
Against the rule
It draws a decomposition and prints its residual. It calls
costAgainstSize,
and every figure above carries the badge — which residualcheck verifies by looking
for it in the emitted SVG rather than by finding the call that builds one. A badge that is
constructed and then left out of the body is the failure that check exists for.
Across the library: the rule bites on 217
of 397 generators —
199 print a residual and
18 are exempt with a published reason;
180 factorise nothing.
Read from lib/residual-rule.js, which is the same body the gate enforces from,
and the gate's last check fails the build if this page and it disagree about any generator.
Where it is called
Changing this generator changes every figure on this list. That is what makes the list worth publishing rather than keeping in a check script.
The preconditioner that knew how many
A coarse hierarchical preconditioner set at a hundredth loses to the direct solve after 20.8 right-hand sides on the easiest matrix at 512 unknowns. Choose its tolerance for the count instead and the best is a tenth for one or two, a hundredth for five or ten, 10⁻⁴ for twenty and fifty, and the full accuracy of the direct solve from a hundred on. Every best sits at the coarse edge of a plateau of equal step counts, because steps are whole numbers and nothing else falls as the tolerance tightens. Tuning moves the crossing from 21 to 32, and on the harder matrix from 7 to 16. It does not make the two routes one: the cheapest step of an iteration is a coarse solve and a product with the operator, and the product is half a solve, so the iteration's floor is 1.49 direct solves a right-hand side and it loses from about thirty on, however it is tuned.
Where the flop count stopped predicting the timeThe second right-hand side
A hierarchical solve was priced at 0.16 of a dense factorisation at 512 unknowns, for one right-hand side. The second right-hand side costs one fifty-eighth of the first, and against the iteration the same format makes possible that is what decides everything. Plain conjugate gradients is overtaken after three right-hand sides on the easiest matrix and at the first on the harder ones. A coarse format inside the iteration holds out for twenty-one, at the same accuracy, and for one or two when the kernel is soft enough. The count was never a property of the method: it runs from under one to twenty-one on one size of matrix and depends on the conditioning.
Where the flop count stopped predicting the timeWhere the format starts paying
A hierarchical solve costs 1.48 times a dense factorisation at 64 unknowns and 0.16 times it at 512. The crossover is between 64 and 128, it walks right when the accuracy is tightened, and the exponent between consecutive sizes is 2.13, 1.93, 1.74 — falling towards one and never arriving.