Skip to content
← Documentation

docs/layout-is-a-line.md


The city is a line, and that is a defect

src/lib/world/layout.ts

The finding

The rendered city is not a diagonal ribbon by style. It is exactly a line.

Pearson r(x, z)                    -1.000000
sd along : sd across               1.16e14 : 1
variance carried by the 2nd axis    0.0000%
Kruskal stress-1                    1.029

A stress-1 above 1 is worse than a null configuration. The second coordinate of every building is a scalar multiple of the first, so the plane the renderer draws on has one real dimension.

The proximate cause: a sign

leadingEigen returns val as the norm of the final iterate — a magnitude, always positive. embed then deflates with it:

const e1 = leadingEigen(B, 0);
const B2 = B.map((row, i) => row.map((x, j) => x - e1.val * e1.vec[i] * e1.vec[j]));

Measured on this repository: the dominant eigenvalue is negative (λ₁ = −6.898e5, by Rayleigh quotient), while e1.val is +6.898e5. Deflating with +|λ₁| adds 2|λ₁| of the component instead of removing it, so the second power iteration converges to the same eigenvector:

deflated with |cos∠(e₁, e₂)|
+|λ₁| (shipped) 1.000000 — e₂ is e₁
signed λ₁ 0.000000 — an independent axis

The same conflation appears again in the coordinates, which take sqrt(max(val, 0)) of a magnitude that is never negative — so a negative eigenvalue is used as though it were positive.

The deeper cause: the metric is not Euclidean

Fixing the sign does not by itself license a 2-D plane. The signed spectrum of the double-centred matrix, deflated correctly:

λ1  -6.898e+5      λ5   2.642e+5
λ2   4.043e+5      λ6   1.929e+5
λ3  -3.836e+5      λ7  -1.793e+5
λ4   3.317e+5      λ8   1.690e+5

The dominant eigenvalue is negative. Classical MDS assumes the distances are Euclidean, which makes the double-centred matrix positive semi-definite. These distances are shortest paths over a directed graph, symmetrised by min, with an arbitrary stand-in for unreachable pairs — and they are not Euclidean by a wide margin. Classical MDS has no valid 2-D configuration to find here; the assumption is violated, not merely the arithmetic.

What this means for the claims already made

  • Position still carries something. Coupled subjects are still drawn near each other along the one real axis, and the review, search and change machinery never depended on the second dimension.
  • docs/geometry-provenance.md and layout.ts both say "onto two dimensions". That is false as shipped and must be corrected wherever it appears.
  • The earlier finding that alignment cuts false motion 78.4% (embedding-stability) was measured on this same 1-D configuration. Its conclusions concerned gauge and attribution, not dimensionality, so they stand — but every number in it describes a line.

What is NOT licensed

Rotating the line to lie along the screen's long axis is a pure gauge change and would raise frame use from 32.8% to 100%. It is also cosmetic: it makes a 1-D city fill the frame without adding a dimension, and would make the picture look more like a city while encoding no more than it does now. Recorded and deliberately not shipped — the question was comprehension, and a wider line is not comprehension.

Any genuine 2-D layout requires deciding what the second axis means, which is a new claim requiring its own warrant. Candidates, none yet measured:

candidate what the second axis would assert
MDS on positive eigenvalues only the largest Euclidean-embeddable part of the coupling metric
SMACOF stress majorisation a configuration minimising stress directly, with no Euclidean assumption
directory as an axis containment, which is observed and currently only carries colour

The third is the only one that adds information rather than rearranging it.