Skip to content

Module 1 — Exterior calculus, the exactness rule and area-preserving phase space

Lecture notes, adapted to midi-sink as shipped (libsumi 1.12.0, Voxo 0.26.0, 2026-10-25). Section references: §4, §10.2, §10.3, §13 are docs/PROJECT_SPEC.md — spec v6 since the fold of 2026-10-26, §10.7, §10.8 and §13.13 with them; KESSHO §n is the Kessho proposal, in git history (21ff974:_work/specs/medium_specs_v3.md), its substance §10.7. Every number quoted below is a gate’s printout (the headless suite, the desktop bench’s --dev gates, the decision log) — none is estimated.

1.1 Historical prologue: from crystal optics to symplectic geometry

Section titled “1.1 Historical prologue: from crystal optics to symplectic geometry”

Symplectic geometry was born in 1832 not in mechanics but in crystal optics, when William Rowan Hamilton used his characteristic function to predict conical refraction in biaxial crystals. midi-sink keeps the lineage in two places. The crystal drop of the Kessho medium (SUMI_MEDIUM_KESSHO, libsumi 1.6.0; the minerals 1.7.0) is written in Hamilton’s action-angle coordinates, where Jaffer’s expansion becomes a translation and a crystal habit becomes a kick generated by a function of the angle alone (§1.4, Family 3). And the Barite mineral carries Hamilton’s hollow cone as a stylisation: where the trace discriminant is near zero and the sheet strains, the caustic’s light is read through a ring kernel of eight points (conical_ring, §10.7.8) — a line on the fold doubling into two. The engine does not solve Fresnel’s wave surface; it reads a strained sheet between crossed polarizers.

Whether we track light through strained calcite, pigment rings floating on water (Sumi, the suminagashi medium), or the phase-space trajectory of an oscillator (Suzu, the synth inside Voxo), the governing structure is the same closed, non-degenerate differential 2-form ω\omega, and the one rule that is never broken is the canvas’s own: no element may create area it was not handed (the DSP class table).

1.2 Differential forms and symplectomorphisms in 2D and 4D

Section titled “1.2 Differential forms and symplectomorphisms in 2D and 4D”

Let M=R2nM = \mathbb{R}^{2n} (or a cotangent bundle T∗QT^*Q) be phase space with canonical coordinates (q1,…,qn,p1,…,pn)(q_1, \dots, q_n, p_1, \dots, p_n).

  1. The tautological 1-form. On T∗QT^*Q the canonical 1-form is θ=∑ipi dqi\theta = \sum_i p_i\, dq_i. Integrating θ\theta around a closed loop γ=∂Σ\gamma = \partial\Sigma measures the action I=12π∮γp dqI = \frac{1}{2\pi}\oint_\gamma p\, dq.

  2. The symplectic 2-form. Its exterior derivative is the canonical 2-form

    ω=−dθ=∑i=1ndqi∧dpi.\omega = -d\theta = \sum_{i=1}^{n} dq_i \wedge dp_i .

    Because d2=0d^2 = 0, ω\omega is exact on R2n\mathbb{R}^{2n} and therefore closed: dω=0d\omega = 0. (On a general symplectic manifold only closedness is required; exactness is the special gift of R2n\mathbb{R}^{2n} and of cotangent bundles, and it is what lets §1.4 write every exact operator from a generating function.)

  3. Symplectomorphisms and det⁡J=1\det J = 1. A smooth map Φ:M→M\Phi: M \to M is a symplectomorphism if it preserves the 2-form under pullback, Φ∗ω=ω\Phi^*\omega = \omega. In 2D (n=1n = 1: the libsumi canvas (x,y)(x, y), or a single Suzu cell (x,y)(x, y)), ω=dx∧dy\omega = dx \wedge dy is the oriented area form. For Φ(x,y)=(u(x,y),v(x,y))\Phi(x, y) = (u(x, y), v(x, y)) with Jacobian

    J=DΦ=(uxuyvxvy),J = D\Phi = \begin{pmatrix} u_x & u_y \\ v_x & v_y \end{pmatrix},

    the pullback is evaluated directly by the wedge product:

    Φ∗(dx∧dy)=du∧dv=(uxvy−uyvx) dx∧dy=(det⁡J) dx∧dy.\Phi^*(dx \wedge dy) = du \wedge dv = (u_x v_y - u_y v_x)\, dx \wedge dy = (\det J)\, dx \wedge dy .

    Thus on a 2D manifold Φ\Phi is symplectic if and only if det⁡J=1\det J = 1 everywhere. This is the sentence the whole engine is built on: the operator book’s exact class is “det J = 1 at any magnitude” (§10.2), and Suzu’s symplectic row is “det of the per-sample map = 1 exactly” (§13.1).

1.3 Why Eulerian grids fail and why libsumi stores displacements

Section titled “1.3 Why Eulerian grids fail and why libsumi stores displacements”

Advect pigment on a grid with an Eulerian velocity solver and the bilinear interpolation of pigment density introduces numerical diffusion that blurs sharp suminagashi rings into mud within seconds (§4, the founding rule: no Navier–Stokes solvers; the Lamb–Oseen swirl is Navier–Stokes entering as an exact solution, §4.3(7)).

libsumi instead models deformation as a group composition of closed-form inverse-lookup symplectomorphisms on two ping-pong textures, tex_A and tex_B, RGBA16F by default (RGBA32F behind a desktop quality flag; §4.1). For every output texel PP the engine asks where that water came from, Psrc=Φ−1(P)P_{src} = \Phi^{-1}(P), and reads the ink there.

Rather than storing the raw pre-image coordinates (u,v)(u, v) — where half-float precision degrades to 2−112^{-11} across the outer half of the canvas — each texel stores, since libsumi 1.2.0 (Phase 8 step 55b, DECISIONS_7 #1), the accumulated displacement from the identity:

d(P)=Ppre(P)−P=(u−x,  v−y),payload (u−x,  v−y,  ink,  aux).d(P) = P_{pre}(P) - P = (u - x,\; v - y), \qquad \text{payload } (u - x,\; v - y,\; \text{ink},\; \text{aux}).

At rest d(P)=(0,0)d(P) = (0, 0), so the half-float quantum follows the displacement: 2−242^{-24} canvas heights at rest, 2−152^{-15} at a sixteenth of the canvas. When a new pass with inverse map Φ−1(P)=Psrc\Phi^{-1}(P) = P_{src} is applied, the shader re-bases the lookup (§4.2):

d′(P)=d(Psrc)+(Psrc−P).d'(P) = d(P_{src}) + (P_{src} - P).

Because the Jacobian of a composition is the product of Jacobians, J(Φ2∘Φ1)=(JΦ2)(JΦ1)J(\Phi_2 \circ \Phi_1) = (J\Phi_2)(J\Phi_1), composing any number of det⁡J=1\det J = 1 passes preserves det⁡J=1\det J = 1 to floating-point rounding — and the regression check that proves the composition is exact is that forty passes of a z/40z/40 tine equal one pass of a zz tine (§4.6).

1.4 The exactness rule (§10.2 additions, KESSHO §2.1)

Section titled “1.4 The exactness rule (§10.2 additions, KESSHO §2.1)”

In interactive graphics we want deformations that are spatially localized — decaying away from a note’s cell. But multiply a symplectic kick or shear by a naive radial window W(r)W(r) and you immediately break det⁡J=1\det J = 1.

Proposition 1.1 (the windowed-kick defect)

Section titled “Proposition 1.1 (the windowed-kick defect)”

Take action-angle polar coordinates (ρ,θ)(\rho, \theta) about a drop centre, with ρ=12r2\rho = \tfrac12 r^2 so that dx∧dy=r dr∧dθ=dρ∧dθdx \wedge dy = r\, dr \wedge d\theta = d\rho \wedge d\theta is canonical. Apply a radially windowed action kick without touching the angle:

ρ1=ρ−W(ρ) V′(θ),θ1=θ.\rho_1 = \rho - W(\rho)\, V'(\theta), \qquad \theta_1 = \theta .

Then

J=(1−W′(ρ)V′(θ)−W(ρ)V′′(θ)01)⟹det⁡J=1−W′(ρ) V′(θ)≠1.J = \begin{pmatrix} 1 - W'(\rho) V'(\theta) & -W(\rho) V''(\theta) \\ 0 & 1 \end{pmatrix} \quad\Longrightarrow\quad \det J = 1 - W'(\rho)\, V'(\theta) \neq 1 .

Any spatial window on the coordinate being kicked breaks area conservation by (window slope) × (kick). This is not a hypothetical: it is the desktop bench’s red control. midi-sink --dev --kessho-flat evaluates the first draft’s windowed Arnol’d kick on the CPU beside the shipped operators and reads ∣det⁡J−1∣|\det J - 1| of 50 at the maximum and 0.35 rms, as required (DECISIONS_10 #4).

From this the spec states the rule every new operator is written under (§10.2 additions):

Exact + localised ⟹ twist-type, or generating-function (implicit, Newton in the shader), or a kick generated by a function of the angle alone. Everything else is sub-stepped and must say so.

These notes sort the shipped operators into four constructions. The spec’s three families are Families 2, 4b and 3 below; Family 1 is the “shear that ignores its own coordinate” the spec’s first sentence names, and Family 4a is the pinch’s own trick, exact but not compactly supported.

Family 1 — pure coordinate shears (tines, cleavage profiles, the sine ripple, the chord wave)

Section titled “Family 1 — pure coordinate shears (tines, cleavage profiles, the sine ripple, the chord wave)”

In a local frame (x,y)(x, y) aligned with a stroke direction D^\hat D, let

xsrc=x−F(y),ysrc=y.x_{src} = x - F(y), \qquad y_{src} = y .

Because FF depends only on yy, the Jacobian is upper-triangular with ones on the diagonal:

J=(1−F′(y)01)⟹det⁡J=1∀F.J = \begin{pmatrix} 1 & -F'(y) \\ 0 & 1 \end{pmatrix} \quad\Longrightarrow\quad \det J = 1 \quad \forall F .

This holds for every tine profile the engine ships (tine_profile, §10.7.8, deform.glsl’s tine_fs), with d=∣y∣d = |y| the perpendicular distance, H=4αH = 4\alpha and u=d/Hu = d/H:

profileFFwhere JJ jumps
SUMI_TINE_SMOOTH (0) — Jafferz α/(α+d)z\,\alpha/(\alpha + d), bitwise the v2 tinenowhere
SUMI_TINE_TWIN_KINK (1) — Baumhauer’s lamella11 for u<1/3u < 1/3, then 1.5(1−u)1.5(1 - u) to zero at u=1u = 1two kink lines, which Kessho draws as the lamella’s edges
SUMI_TINE_TERRACE (2) — phyllosilicate slipv−sin⁡(2πNv)/(2πN)v - \sin(2\pi N v)/(2\pi N), v=1−uv = 1 - u clamped, N=4N = 4 flat terracesthe terrace risers

Every profile is a bump, zero beyond HH. The first draft’s monotone ramp and staircase were exact too, but a monotone shear pulls texels in from outside the canvas and fabricates ink — the soak measured −99.9 % of the mass in 500 “pairs” (an odd profile reversed is the same shear, so ±z\pm z is not a pair). The bench keeps that fault as profile 3, dev only, as --tine-fault’s red control (DECISIONS_10 #6). The sine ripple Asin⁡(ky+ϕ)A\sin(ky + \phi) (§4.3(6)) and the chord wave — a ripple-tine windowed across its band, i.e. by the coordinate the shear ignores (§10.8.2) — are the same family.

Family 2 — twist maps in action-angle coordinates (vortices, Lamb–Oseen, torsion, Chladni)

Section titled “Family 2 — twist maps in action-angle coordinates (vortices, Lamb–Oseen, torsion, Chladni)”

In (ρ=r2/2,θ)(\rho = r^2/2, \theta), rotate the angle by a function of ρ\rho alone:

ρsrc=ρ,θsrc=θ−Θ(ρ)⟹J(ρ,θ)=(10−Θ′(ρ)1),det⁡J=1.\rho_{src} = \rho, \qquad \theta_{src} = \theta - \Theta(\rho) \quad\Longrightarrow\quad J_{(\rho,\theta)} = \begin{pmatrix} 1 & 0 \\ -\Theta'(\rho) & 1 \end{pmatrix}, \quad \det J = 1 .

Twist maps are the one explicit family that is both exact and compactly supported in rr (§10.2 additions). That is why, as shipped in vortex_fs, swirl_fs and cells_fs, none of these needs sub-stepping at any amplitude and every ±A\pm A pair inverts analytically:

  • the exponential vortex Θ(r)=A e−r/R\Theta(r) = A\, e^{-r/R} and the Rankine vortex (rigid for r<Rr < R, ωR2/r2\omega R^2/r^2 outside — all the shear in the crease ring at RR) — §4.3(3);
  • the Lamb–Oseen swirl Θ(r)=S2πr2(1−e−r2/rc2)\Theta(r) = \dfrac{S}{2\pi r^2}\left(1 - e^{-r^2/r_c^2}\right), S=Γ ΔtS = \Gamma\,\Delta t — §4.3(7), the viscous rotation, C∞C^\infty;
  • the wave torsion Θ(r)=Asin⁡(kr−ϕ) e−r/R\Theta(r) = A\sin(kr - \phi)\, e^{-r/R} — §10.3, rings of alternating angular shear, an outward wave when ϕ\phi sweeps;
  • the Chladni eddy, the exact rotation of one disc of radius RR by Θ=θ0 w (4s2(1−s2))2\Theta = \theta_0\, w\, \big(4 s^2 (1 - s^2)\big)^2 with s=r/Rs = r/R — the ring peaks at s=1/2s = 1/\sqrt2 and vanishes at the centre and the rim (cells_fs, mode 0; its mode 1, the summed “inverse Chladni” field, is the sub-stepped class).

Family 3 — angle-generated kicks: the symplectic crystal-drop theorem (§10.7.8)

Section titled “Family 3 — angle-generated kicks: the symplectic crystal-drop theorem (§10.7.8)”

Exchange the roles of ρ\rho and θ\theta and kick ρ\rho by a potential V(θ)=12R(θ)2V(\theta) = \tfrac12 R(\theta)^2 that depends on the angle alone:

ρsrc=ρ−12R(θ)2,θsrc=θ(r≥R(θ)).\rho_{src} = \rho - \tfrac12 R(\theta)^2, \qquad \theta_{src} = \theta \qquad (r \ge R(\theta)).

In the Cartesian radius r=2ρr = \sqrt{2\rho} this maps each ray θ\theta monotonically onto itself, rsrc=r2−R(θ)2r_{src} = \sqrt{r^2 - R(\theta)^2}. Its Jacobian in (ρ,θ)(\rho, \theta) is

J(ρ,θ)=(1−R(θ)R′(θ)01)⟹det⁡J=1 identically.J_{(\rho,\theta)} = \begin{pmatrix} 1 & -R(\theta) R'(\theta) \\ 0 & 1 \end{pmatrix} \quad\Longrightarrow\quad \det J = 1 \text{ identically.}

For R≡r0R \equiv r_0 this is Jaffer’s circular drop, the translation ρsrc=ρ−r02/2\rho_{src} = \rho - r_0^2/2; drop_habit 0 is bitwise the v2 drop.

Consequences, as ratified in §10.7.8 and built in drop_fs: (1) a drop need not be circular to be exact — any star-shaped habit R(θ)>0R(\theta) > 0 conserves area identically, at any amplitude, with no sub-stepping; (2) boundary growth is free — scaling R→sRR \to sR is the same map; (3) the interior ink phase is assigned from r/R(θ)r / R(\theta), so the rings inside are homothetic copies of the habit; (4) corners crease — where R′R' jumps, JJ jumps across the vertex ray, and the bands outside crease along it; in Kessho that crease is a birefringence line and reads as cleavage. The shipped habits, in the drop’s own frame (the strike’s angle), softened by a log-sum-exp with k=2+40(1−roundness)2k = 2 + 40(1 - \text{roundness})^2 and then mixed toward the circle by habit_roundness:

drop_habitR(θ)R(\theta)paired by the presets with
SUMI_HABIT_RHOMB (1) — the calcite cleavage rhomb, faces 78.1° / 101.9°r0/max⁡(∣sin⁡θ∣,∣sin⁡(θ−A)∣)r_0 / \max\big(\lvert\sin\theta\rvert, \lvert\sin(\theta - A)\rvert\big), A=78.1°A = 78.1°, r0r_0 the inradiusCalcite, Selenite (gypsum’s cleavage plate)
SUMI_HABIT_HEX (2) — the regular hexagonr0/max⁡i∣cos⁡(θ−60° i)∣r_0 / \max_i \lvert\cos(\theta - 60°\, i)\rvertQuartz, Muscovite’s pseudo-hexagonal sheet, Fluorite (the cube on its diagonal)
SUMI_HABIT_ROSETTE (3) — mm tabular blades, habit_bladesr0 (1+βcos⁡8(mθ))/(1+β⋅35/128)r_0\,(1 + \beta\cos^{8}(m\theta)) / (1 + \beta\cdot 35/128), β=0.6\beta = 0.6, the mean radius r0r_0Barite, m=5m = 5

The pairing is the shells’ and the six presets/kessho_<mineral>.json; the optical half and the mechanical half are independent parameters, and a Calcite optic over a Barite rosette is allowed.

Family 4 — invariant-streamline windows and generating functions

Section titled “Family 4 — invariant-streamline windows and generating functions”

4a. The Hamiltonian pinch (§4.3(5)). The global hyperbolic saddle xsrc=xekx_{src} = x e^{k}, ysrc=ye−ky_{src} = y e^{-k} is generated by H(x,y)=xyH(x, y) = xy. Because s=xys = xy is conserved along every trajectory, windowing the exponent by w(s)=e−∣s∣/Sw(s) = e^{-|s|/S} keeps the map closed-form:

xsrc=x e+k w(xy),ysrc=y e−k w(xy),x_{src} = x\, e^{+k\, w(xy)}, \qquad y_{src} = y\, e^{-k\, w(xy)},

and with w′=dw/dsw' = dw/ds,

det⁡J=(1+ksw′)(1−ksw′)−(kx2w′)(−ky2w′)=1−k2s2w′2+k2s2w′2=1.\det J = \big(1 + k s w'\big)\big(1 - k s w'\big) - \big(k x^2 w'\big)\big(-k y^2 w'\big) = 1 - k^2 s^2 w'^2 + k^2 s^2 w'^2 = 1 .

The caveat the spec states as a feature: the window cannot decay along the two fold axes themselves (s=0s = 0 there), so the pinch’s arms run outward as fading creases — which is what pinched paper does. The window is in ss, not in rr, so the pinch is exact but not compactly supported: it is not a counterexample to Family 2’s uniqueness.

4b. Type-2 generating functions — the Arnol’d tongue lock (SUMI_DEFORM_ARNOLD, §10.8.1). When a kick must be radially windowed by W(ρ1)W(\rho_1), derive the map from a mixed-variable generating function F2(θ,ρ1)=θρ1+KqW(ρ1)cos⁡q(θ−φ)F_2(\theta, \rho_1) = \theta\rho_1 + \frac{K}{q} W(\rho_1)\cos q(\theta - \varphi):

ρ=∂F2∂θ=ρ1−K W(ρ1)sin⁡q(θ−φ),θ1=∂F2∂ρ1=θ+Kq W′(ρ1)cos⁡q(θ−φ).\rho = \frac{\partial F_2}{\partial \theta} = \rho_1 - K\, W(\rho_1) \sin q(\theta - \varphi), \qquad \theta_1 = \frac{\partial F_2}{\partial \rho_1} = \theta + \frac{K}{q}\, W'(\rho_1) \cos q(\theta - \varphi).

The radial slope W′W' is compensated by an angular twist, and det⁡J=1\det J = 1 exactly because the map is canonical by construction. As shipped in arnold_fs: one iteration M=T∘KickM = T \circ \text{Kick} about a voice’s drop, the twist TT a Lamb–Oseen-shaped rotation with Θ(R)=2πΩ0\Theta(R) = 2\pi\Omega_0 turns, C2C^2-windowed to zero by 2.5R2.5R; W=1W = 1 on [ρdrop/2,ρdrop][\rho_{drop}/2, \rho_{drop}] with quintic ramps to zero at the centre (a bijection needs W(0)=0W(0) = 0) and at 1.5ρdrop1.5\rho_{drop}; the lookup is M−1M^{-1} — the twist undone, then the kick’s inverse by one scalar Newton iteration on θ\theta, five steps, monotone while ∣KW′∣<1|K W'| < 1, hence K≤Kmax=0.8/max⁡∣W′∣K \le K_{max} = 0.8 / \max|W'|. It is Kessho’s press default (press_mode 3): the tempered fifth’s two-cent beat precesses the islands.

1.5 Reading the Jacobian with shaders: Sumi, Anod and Kessho (§10.7.1–§10.7.4)

Section titled “1.5 Reading the Jacobian with shaders: Sumi, Anod and Kessho (§10.7.1–§10.7.4)”

From the stored displacement d(x,y)=(u−x,v−y)d(x, y) = (u - x, v - y) the composite shader reconstructs the inverse-lookup Jacobian J=I+∇dJ = I + \nabla d by finite differences:

J=(1+∂xdx∂ydx∂xdy1+∂ydy).J = \begin{pmatrix} 1 + \partial_x d_x & \partial_y d_x \\ \partial_x d_y & 1 + \partial_y d_y \end{pmatrix}.

Two stencils, as shipped in composite.glsl: the short one (Anod’s, one-sided minimum, the half-float rounding bias subtracted) gives ψ\psi and σ\sigma; the trace for Layer B is read from a wide window (±3 texels at 512), because the fold at a large zz sits a few hundredths above tr⁡J=2\operatorname{tr} J = 2 and a texel-wide difference would read the quantum.

Take the polar decomposition J=Rϕ U(ψ,λ)J = R_\phi\, U(\psi, \lambda), with RϕR_\phi a rotation and UU symmetric positive-definite, principal stretches λ≥1≥λ−1\lambda \ge 1 \ge \lambda^{-1} along the axis ψ\psi. JJ is the inverse map’s Jacobian, so C=JTJC = J^T J is the forward flow’s left Cauchy–Green tensor — Eulerian, which is what a polarizer on the screen sees (§10.7.1). Because det⁡J=1\det J = 1, every spectral invariant reduces to the Frobenius norm ∥J∥F2\lVert J\rVert_F^2 and the trace tr⁡J\operatorname{tr} J:

  1. Principal strain and the birefringence retardation (Anod, Kessho Layer A). Since λ2+λ−2=tr⁡(JTJ)=∥J∥F2\lambda^2 + \lambda^{-2} = \operatorname{tr}(J^T J) = \lVert J\rVert_F^2, (λ−λ−1)2=∥J∥F2−2(\lambda - \lambda^{-1})^2 = \lVert J\rVert_F^2 - 2, so the scalar shear strain is

    σ=λ−λ−1=∥J∥F2−2,\sigma = \lambda - \lambda^{-1} = \sqrt{\lVert J\rVert_F^2 - 2},

    and the principal axis is

    ψ=12atan2⁡(2C12,  C11−C22),C=JTJ.\psi = \tfrac12 \operatorname{atan2}\big(2 C_{12},\; C_{11} - C_{22}\big), \qquad C = J^T J .

    Since 3.0 Layer A reads σ\sigma through the strain buffer — averaged over the afterglow’s seconds (§10.10) — so the fringes build and settle instead of snapping. Layer A is then the mineral’s optical law (§10.7.8):

    IA=Ibacklight⋅body⋅brush(ψ,α)⋅ML(Γσ),I_A = I_{\text{backlight}} \cdot \text{body} \cdot \text{brush}(\psi, \alpha) \cdot \mathrm{ML}(\Gamma\sigma),

    with the brush by optic class — isotropic: dark (Fluorite shows Layer B alone); uniaxial: sin⁡22(ψ−α)\sin^2 2(\psi - \alpha), the isoclinic brush that paints the dark Maltese cross in a vortex’s shear annulus (Quartz, Calcite, Selenite); biaxial: the cross splits into two brushes 2V2V apart, ∣cos⁡22V−cos⁡22(ψ−α)∣/max⁡(cos⁡22V,sin⁡22V)\lvert\cos^2 2V - \cos^2 2(\psi - \alpha)\rvert / \max(\cos^2 2V, \sin^2 2V) — a stylisation of the conoscopic figure, since that law lives in angle space, which a texel does not have (Muscovite 2V=40°2V = 40°, Barite 37°37°). Γ\Gamma is the mineral’s retardation at unit strain scaled by the Exposure knob (kessho_retard/2000 — the ratios between minerals are physical, Δn\Delta n), and ML\mathrm{ML} is the Michel–Lévy chart as a 1024-texel LUT the engine builds from a spectral integration against the CIE 1931 curves (core/src/kessho_lut.h, tools/kessho_lut.py; beyond 2200 nm the orders wash to high-order white). The sensitive-tint plate (Selenite, Γ0=550\Gamma_0 = 550 nm) replaces the brush by Γeff=∣Γ0+Γσsin⁡2ψ∣\Gamma_{\text{eff}} = \lvert\Gamma_0 + \Gamma\sigma\sin 2\psi\rvert: the sign of the strain becomes visible. The three-channel sin⁡2(πΓσ/ΛRGB)\sin^2(\pi\Gamma\sigma/\Lambda_{RGB}) form is the fallback for the web demo only (KESSHO §1.2) — it is what the standalone lab below uses.

  2. The trace discriminant: the elliptic/hyperbolic partition (Kessho Layer B). The eigenvalues of J∈SL(2,R)J \in SL(2, \mathbb{R}) satisfy μ2−(tr⁡J)μ+1=0\mu^2 - (\operatorname{tr} J)\mu + 1 = 0, with discriminant Δ=(tr⁡J)2−4\Delta = (\operatorname{tr} J)^2 - 4:

    • elliptic, Δ<0  ⟺  ∣tr⁡J∣<2\Delta < 0 \iff \lvert\operatorname{tr} J\rvert < 2: purely rotational motion (μ=e±iϕ\mu = e^{\pm i\phi}; vortex cores, Chladni eddies) — the cool tint;
    • hyperbolic, Δ>0\Delta > 0: exponential stretching along unstable manifolds (saddles, wakes, Chirikov chaos) — the warm tint;
    • parabolic, Δ=0\Delta = 0: the order-to-chaos boundary.

    The tint’s weight is smoothstep(0.05,0.8,∣Δ∣)\text{smoothstep}(0.05, 0.8, \lvert\Delta\rvert) — the staircase’s noise sits under 0.05. The honest headline (§10.7.1): rigid rotation has C=IC = I, so σ=0\sigma = 0 and ψ\psi is undefined — Layer A is dark exactly where Anod is dark, and tr⁡J=2cos⁡ϕ\operatorname{tr} J = 2\cos\phi is the only local observable that detects rigid elliptic rotation. What Kessho adds over Anod is orientation (ψ\psi) and rotation (tr⁡J\operatorname{tr} J).

  3. The collapsed Lagrangian caustic and the z=1z = 1 flatness gate (§10.7.3). Refract rays through the displacement gradient ∇d=J−I\nabla d = J - I onto a bed at depth zz; the light focuses inversely to the ray-map determinant. For any 2×22\times2 matrix, expanding det⁡((1−z)I+zJ)\det((1 - z)I + zJ) gives

    det⁡(I+z∇d)=(1−z)2+z(1−z)tr⁡J+z2det⁡J.\det(I + z\nabla d) = (1 - z)^2 + z(1 - z)\operatorname{tr} J + z^2 \det J .

    • When det⁡J=1\det J = 1: (1−z)2+z2=1−2z(1−z)(1 - z)^2 + z^2 = 1 - 2z(1 - z), and the determinant collapses to Kessho’s one line, exactly as kessho_caustic_w evaluates it:

      det⁡(I+z∇d)=1+z(1−z) (tr⁡J−2).\det(I + z\nabla d) = 1 + z(1 - z)\,(\operatorname{tr} J - 2).

      The fold (det⁡=0\det = 0) is an iso-trace contour, not the parabolic horizon: for z>1z > 1 it sits on tr⁡J=2+1z(z−1)\operatorname{tr} J = 2 + \dfrac{1}{z(z - 1)} and sweeps from +∞+\infty toward 2+2^+ as z→∞z \to \infty, so the depth control (caustic_z, 1.05..8, log-spaced) scans a level set of tr⁡J\operatorname{tr} J through the hyperbolic regime toward the parabolic horizon. The shader draws it as a line (by fwidth) over a soft glow, and Barite’s dispersion reads it at three depths z/1+d, z, z1+dz/\sqrt{1 + d},\, z,\, z\sqrt{1 + d} — a rainbow on the fold.

    • When z=1z = 1: the uncollapsed determinant is det⁡J\det J itself. Evaluating it at z=1z = 1 is therefore a direct detector of dω≠0d\omega \ne 0: any exact operator renders flat, and a windowed kick lights up. The depth 1 is reachable only through the dev flag, and --kessho-flat <operator|all> is the gate — as measured (DECISIONS_10 #4), not as proposed: the identity sheet reads 0 exactly; an exact Lamb–Oseen twist on the CPU reads 1.4⋅10−31.4\cdot10^{-3} at the maximum (the stencil’s truncation); the GPU’s three-drop scene reads a median of 2⋅10−32\cdot10^{-3} (±3 texels) to 5⋅10−35\cdot10^{-3} (±1), with a p99 of 0.2–0.8 and a maximum of 8–30 owned by the drops’ rims, where the inverse of an exact expansion has an unbounded radial derivative — the pre-image’s one singularity, exact and unresolvable by any stencil, so the rims are masked. A few thousandths is the field’s floor; the proposal’s 10−410^{-4} cannot be held by a half-float field, and the class stays declared, with the gate as its runtime check.

1.6 Phase space in audio: Suzu’s magic circle, retuning and twisted 2-forms (§13)

Section titled “1.6 Phase space in audio: Suzu’s magic circle, retuning and twisted 2-forms (§13)”

Now drop from the 512 × 512 canvas to a single oscillator voice in Suzu (voxo/src/suzu.h, struct Cell). Where the canvas says area-preserving, the synth says amplitude-stable.

1. The symplectic magic circle versus the naive update (§13.2)

Section titled “1. The symplectic magic circle versus the naive update (§13.2)”

A harmonic oscillator of frequency ff at sample rate fsf_s has the step parameter ε=2sin⁡(πf/fs)\varepsilon = 2\sin(\pi f / f_s) — the prewarp, so the discrete rotation angle is exactly 2πf/fs2\pi f/f_s.

The naive simultaneous update (update_mode 1, the lab’s red control; Cell::step_naive, the suite’s negative control):

xn+1=xn−εyn,yn+1=yn+εxn⟹J=(1−εε1),det⁡J=1+ε2>1.x_{n+1} = x_n - \varepsilon y_n, \quad y_{n+1} = y_n + \varepsilon x_n \quad\Longrightarrow\quad J = \begin{pmatrix} 1 & -\varepsilon \\ \varepsilon & 1 \end{pmatrix}, \quad \det J = 1 + \varepsilon^2 > 1 .

Phase-space area grows by 1+ε21 + \varepsilon^2 every sample. The suite’s drift gate at 440 Hz, A=0.5A = 0.5, 48 kHz: over the 0.1 dB bound at 1.0 s and +690.2 dB after 600 s.

The symplectic leapfrog, the magic circle (update_mode 0, Cell::step): using the already-updated xn+1x_{n+1} in the yy update composes two exact shears:

xn+1=xn−εyn,yn+1=yn+εxn+1=εxn+(1−ε2)yn,x_{n+1} = x_n - \varepsilon y_n, \qquad y_{n+1} = y_n + \varepsilon x_{n+1} = \varepsilon x_n + (1 - \varepsilon^2) y_n ,

J=(10ε1)(1−ε01)=(1−εε1−ε2)⟹det⁡J=1 identically.J = \begin{pmatrix} 1 & 0 \\ \varepsilon & 1 \end{pmatrix}\begin{pmatrix} 1 & -\varepsilon \\ 0 & 1 \end{pmatrix} = \begin{pmatrix} 1 & -\varepsilon \\ \varepsilon & 1 - \varepsilon^2 \end{pmatrix} \quad\Longrightarrow\quad \det J = 1 \text{ identically.}

Moreover tr⁡J=2−ε2=2−4sin⁡2(πf/fs)=2cos⁡(2πf/fs)∈(−2,2)\operatorname{tr} J = 2 - \varepsilon^2 = 2 - 4\sin^2(\pi f/f_s) = 2\cos(2\pi f/f_s) \in (-2, 2) for all f<fs/2f < f_s/2, so Δ<0\Delta < 0: the oscillator is strictly elliptic — §1.5’s partition, one octave down — with the exact rotation angle ϕ=2πf/fs\phi = 2\pi f/f_s. The same gate: ten minutes undriven and undamped, amplitude +0.0001 dB, frequency +0.000 cent; the tuning within 0.000 cent across MIDI 21–108 at 44.1 and 48 kHz.

2. The skewed invariant and MPE retuning (Cell::retune)

Section titled “2. The skewed invariant and MPE retuning (Cell::retune)”

det⁡J=1\det J = 1 guarantees bounded orbits, but the magic circle’s level curves are not circles x2+y2=A2x^2 + y^2 = A^2; they are the ε\varepsilon-sheared ellipses

Iε(x,y)=x2+y2−εxy=A2(1−ε24),I_\varepsilon(x, y) = x^2 + y^2 - \varepsilon x y = A^2\Big(1 - \frac{\varepsilon^2}{4}\Big),

on which xx peaks at AA where y=εx/2y = \varepsilon x/2 — the point the strike sets (Cell::kick: x=Ax = A, y=εA/2y = \varepsilon A/2).

When an MPE performer glides a note, ε\varepsilon changes every frame. Change ε→ε′\varepsilon \to \varepsilon' with the state left as it is and the state sits on an orbit of a different amplitude: the plain retune (retune_mode 1, Cell::retune_plain, “the printed justification, never the shipped sound”). What ships is a re-base onto the orbit of the held amplitude: with the new ε′\varepsilon', read the invariant the state would have, q=x2+y2−ε′xyq = x^2 + y^2 - \varepsilon' x y, the xx-amplitude it implies, a=q/(1−ε′2/4)a = \sqrt{q / (1 - \varepsilon'^2/4)}, and scale the state by s=A/as = A/a:

(x,y)  ↦  Aa (x,y),one rsqrt per retuned sample, none while ε holds.(x, y) \;\mapsto\; \frac{A}{a}\,(x, y), \qquad \text{one rsqrt per retuned sample, none while } \varepsilon \text{ holds.}

Note what this is and is not. It is a homothety, det⁡=s2\det = s^2 — not itself a symplectic map, and the engine’s class table says so in its own words: “symplectic (a rescale to the same orbit)”. What makes it legitimate is the discipline of the projected row of the DSP class table: it measures a no-op whenever ε\varepsilon holds (s=1s = 1 exactly) and its work during a glide is bounded and gated. The suite’s glide gate, −48 to +48 semitones over 2 s through the ABI (step 86’s run): re-based 0.097 dB of amplitude ripple (the bound 0.5); the plain recurrence under the per-sample ramp 0.057 dB and stepped once per block 0.062 dB, both printed, not gated. (The cells chapter quotes 0.63 dB for a one-block jump from the first landing; the suite’s current printout is the number to teach from, and the two should be reconciled.) Problem 1.3 compares this rescale with the shear-scale alternative that keeps xx and moves yy onto the new ellipse.

3. Non-canonical closed 2-forms: the Boris–leapfrog magnetic gyroscope (voice_kind 11, §13.13)

Section titled “3. Non-canonical closed 2-forms: the Boris–leapfrog magnetic gyroscope (voice_kind 11, §13.13)”

Must a symplectic 2-form be the canonical ω0=dp1∧dx1+dp2∧dx2\omega_0 = dp_1 \wedge dx_1 + dp_2 \wedge dx_2? Take a charged 2D oscillator in a perpendicular magnetic field BB. The Lorentz force is encoded not by changing H=12∣p∣2+V(x)H = \tfrac12\lvert p\rvert^2 + V(x) but by twisting the 2-form:

ωB=dp1∧dx1+dp2∧dx2+B(x1,x2) dx1∧dx2.\omega_B = dp_1 \wedge dx_1 + dp_2 \wedge dx_2 + B(x_1, x_2)\, dx_1 \wedge dx_2 .

On R4\mathbb{R}^4, d(B dx1∧dx2)=∂x1B dx1∧dx1∧dx2+∂x2B dx2∧dx1∧dx2=0d(B\, dx_1 \wedge dx_2) = \partial_{x_1}B\, dx_1 \wedge dx_1 \wedge dx_2 + \partial_{x_2}B\, dx_2 \wedge dx_1 \wedge dx_2 = 0, so ωB\omega_B is closed for any smooth B(x1,x2)B(x_1, x_2). (Suzu’s field is uniform over the voice and varies only in time: boris_b in hertz, 0..50, the poly pressure’s — rest + (full − rest) · swirl.)

The scheme, suzu::Gyro::step, with y=x˙/ω0y = \dot x/\omega_0 in the cell’s units so that a free orbit is a circle of radius AA: the half kick y−=(ε/2) xy \mathrel{-}= (\varepsilon/2)\, x; the Cayley rotation of the velocity by θB\theta_B, written as three shears — y1−=t y2y_1 \mathrel{-}= t\, y_2, y2+=s y1y_2 \mathrel{+}= s\, y_1, y1−=t y2y_1 \mathrel{-}= t\, y_2 with t=tan⁡(θB/2)t = \tan(\theta_B/2), s=sin⁡θBs = \sin\theta_B, exactly the rotation matrix — the Lorentz force does no work, so ∣y∣\lvert y\rvert is left as it was; the half kick again; the drift x+=ε yx \mathrel{+}= \varepsilon\, y. Every factor is a shear, so det⁡J=1\det J = 1 on the 4D state and the energy breathes with the kick’s splitting but does not drift: ten minutes at 96 kHz under a 20 Hz field, HH within ±0.031 dB, the minute means drifting 0.000000 dB. The reason for three shears rather than a cos/sin matrix is a Module-1 lesson in itself: a matrix whose c2+s2c^2 + s^2 misses 1 by a unit in the last place scales the energy by that every step — e±1.7e^{\pm 1.7} over ten minutes — where the shears round as a walk, not a bias.

Both the spring and the field are prewarped, ε=2sin⁡(ω0dt/2)\varepsilon = 2\sin(\omega_0 dt/2) and θB=ωBdt\theta_B = \omega_B dt (the Boris angle 2arctan⁡(Bnumdt/2)2\arctan(B_{num}dt/2) with Bnum=(2/dt)tan⁡(ωBdt/2)B_{num} = (2/dt)\tan(\omega_B dt/2)). The degenerate 2D oscillator then splits into a chiral Zeeman doublet, one circular mode each way round the field:

ω±=ω02+(ωB2)2±ωB2.\omega_\pm = \sqrt{\omega_0^2 + \Big(\frac{\omega_B}{2}\Big)^2} \pm \frac{\omega_B}{2}.

On z=x1+ix2z = x_1 + i x_2, w=y1+iy2w = y_1 + i y_2 the step is complex-linear with determinant eiθe^{i\theta} and the two angles θ/2±ψ\theta/2 \pm \psi, cos⁡ψ=cos⁡(θ/2)(1−ε2/2)\cos\psi = \cos(\theta/2)(1 - \varepsilon^2/2): the doublet to (ωBdt/2)2/6(\omega_B dt/2)^2/6, measured within 0.001 cent of the formula over five notes and six fields; with the prewarp off (boris_prewarp 0, the lab’s red) the pair is 1.21 cents sharp at B6. Sending (x1,x2)(x_1, x_2) straight to (L,R)(L, R) makes it the engine’s first stereo voice — a mono line without the field, a precessing rosette under the finger’s pressure — and the orbit trace draws the same pair into the water as a spirograph; the strobe’s own clock is the cyclotron period.

Beyond the cell. The same discipline carries the voices Phase 14 added, each in the class table with its red control: the Toda ring’s leapfrog in double with the minute-mean HH drifting 0.000017 dB over ten lossless minutes (Toda ring); the billiard’s exact rotation and specular reflection, det⁡J=+1\det J = +1 on the 4D state to 2⋅10−122\cdot10^{-12} dB over 66 000 collisions (Billiard); the Dirac network’s Cayley step M=(I−h2A)−1(I+h2A)M = (I - \tfrac{h}{2}A)^{-1}(I + \tfrac{h}{2}A), lossless over a random skew JJ to 2⋅10−162\cdot10^{-16} (Dirac network). Module 2 takes them up.


Module 1 Lab: exactness, Kessho flatness, and Suzu phase space

Section titled “Module 1 Lab: exactness, Kessho flatness, and Suzu phase space”
  1. Task 1 — the symplectic crystal drop and its cleavage creases (shader). On the desktop bench: midi-sink --dev --habit-test (the homothety, the growth, the crease pair, calcite with the twin kink, the pass count) and --habit-corner <dir>, which renders the crease pair at roundness 0 and 1 and prints both contrasts; then --soak crystal_drop and --kessho-flat drop. Report ∣det⁡J−1∣|\det J - 1|‘s median, p99 and maximum and say which texels own the maximum (the rims) and why the gate masks them. In the standalone lab, replace the circle with the calcite rhomb or the five-bladed Barite rosette and watch the vertex rays appear in Layer A as the roundness goes to zero.

  2. Task 2 — catching the non-symplectic leak at z=1z = 1 (shader). Compare the Hamiltonian pinch (w(s)=e−∣xy∣/Sw(s) = e^{-|xy|/S}) with a naively radial-windowed kick (ρsrc=ρ−k e−r2/R2sin⁡3θ\rho_{src} = \rho - k\,e^{-r^2/R^2}\sin 3\theta, θsrc=θ\theta_{src} = \theta). On the bench, --kessho-flat pinch prints the shipped operator beside the estimator’s CPU controls — the exact twist and the first draft’s windowed kick — in one run. In the standalone lab, toggle the z=1z = 1 view (u_viewMode 2): prove analytically and visually why the pinch stays flat while the windowed kick glows, det⁡J=1−W′(ρ)V′(θ)\det J = 1 - W'(\rho) V'(\theta).

  3. Task 3 — the magic circle, Cell::retune and the gyroscope (audio). Open the engine’s own lab page, /marble/suzu/cell.html (the book’s Cells chapter embeds it): the strip under the orbit tracks x2+y2−εxyx^2 + y^2 - \varepsilon xy; the checkbox The naive update (update_mode 1) is the red control — at A3 the orbit grows twenty-thousandfold a second until the worklet mutes full scale and restarts the engine; the retune select switches retune_mode. Then on the desktop, the Gyroscope (Zeeman stereo) patch with the synth trace on: raise the field with pressure, hear the doublet open, set boris_prewarp 0 and measure the pair against the formula. The standalone lab repeats the three with its own state.

module_01_lab.html, beside these notes, is a single-file WebGL2 + WebAudio harness: it implements the ping-pong displacement field (in RGBA32F, where the engine’s is RGBA16F), the four operators above plus the red control, Kessho’s Layer A and Layer B, the z=1z = 1 diagnostic, and a two-plane Suzu oscillator with the Boris rotation and a phase-space scope. It is a teaching re-implementation, not the engine — the book’s rule is that there is no second implementation of any operator or voice on the site, so this file stays with the lessons and is never embedded in the book. Where it departs from the engine it says so in its comments; where it could follow the engine it does: the habit profiles are drop_fs’s support forms with the same log-sum-exp softening, the retune is Cell::retune’s rescale (with the plain form and the shear-scale of Problem 1.3 beside it), the gyroscope step is suzu::Gyro::step’s half kick, three shears, half kick and drift, and the Michel–Lévy colour is the three-channel fallback KESSHO §1.2 names for the web. It also obeys §4.6’s orientation rule — one texture space in every pass, the only flip at the pointer — and the rule earns its place here: with a flip inside the chain the passes mirror instead of composing, and the z=1z = 1 view lights the whole canvas. Read back from the lab’s field (±1 texel, the band boundaries skipped), its exact operators sit at the estimator’s floor — the swirl at a median of 3⋅10−43\cdot10^{-4}, the crystal drops at 2⋅10−42\cdot10^{-4} with their rims owning the maximum, the pinch at 8⋅10−68\cdot10^{-6} — and the windowed kick reads a p99 of 0.25 and a maximum of 0.52: the same picture as the engine’s gate, two orders of magnitude apart in resolution.

  1. Problem 1.1 — the collapsed Kessho caustic identity (§10.7.3). Let d=(u−x,v−y)d = (u - x, v - y) be the stored displacement, J=I+∇dJ = I + \nabla d.

    • (a) Prove that for any differentiable 2D map, det⁡(I+z∇d)=(1−z)2+z(1−z)tr⁡J+z2det⁡J\det(I + z\nabla d) = (1 - z)^2 + z(1 - z)\operatorname{tr} J + z^2 \det J.
    • (b) Show that if the chain consists of exact symplectomorphisms only, this is Kessho’s det⁡(I+z∇d)=1+z(1−z)(tr⁡J−2)\det(I + z\nabla d) = 1 + z(1 - z)(\operatorname{tr} J - 2), and locate the fold for z=12z = \tfrac12, z=2z = 2 and z→∞z \to \infty.
    • (c) Explain why a vortex’s rigid core (J=RϕJ = R_\phi, λ=1\lambda = 1) gives zero birefringence in Layer A (σ=∥J∥F2−2=0\sigma = \sqrt{\lVert J\rVert_F^2 - 2} = 0) yet is tinted by Layer B, Δ=(tr⁡J)2−4=4(cos⁡2ϕ−1)<0\Delta = (\operatorname{tr} J)^2 - 4 = 4(\cos^2\phi - 1) < 0 — and why the Maltese cross forms in the Lamb–Oseen vortex’s shear annulus, not in a Rankine core.
  2. Problem 1.2 — the crystal-drop theorem and cleavage creases (§10.7.8). Under SUMI_MEDIUM_KESSHO a crystal drop of profile R(θ)>0R(\theta) > 0 has the inverse lookup rsrc=r2−R(θ)2r_{src} = \sqrt{r^2 - R(\theta)^2} along each ray for r≥R(θ)r \ge R(\theta).

    • (a) In (ρ=r2/2,θ)(\rho = r^2/2, \theta) compute the pullback Φ∗(dρ∧dθ)\Phi^*(d\rho \wedge d\theta) and verify det⁡J=1\det J = 1 for any piecewise-C1C^1 profile.
    • (b) Compute ∂ρsrc/∂θ=−R(θ)R′(θ)\partial\rho_{src}/\partial\theta = -R(\theta)R'(\theta). With habit_roundness 0 on SUMI_HABIT_RHOMB, R′R' jumps at the four vertex angles; show that the jump produces a ray of discontinuous shear strain σ\sigma from each vertex outward — the line Kessho draws and reads as cleavage — and explain what the log-sum-exp softening k=2+40(1−roundness)2k = 2 + 40(1 - \text{roundness})^2 does to it.
  3. Problem 1.3 — the skewed invariant and MPE retuning (§13.2). Consider the magic circle xn+1=xn−εynx_{n+1} = x_n - \varepsilon y_n, yn+1=yn+εxn+1y_{n+1} = y_n + \varepsilon x_{n+1}.

    • (a) Substitute into Iε=x2+y2−εxyI_\varepsilon = x^2 + y^2 - \varepsilon xy and prove Iε(xn+1,yn+1)=Iε(xn,yn)I_\varepsilon(x_{n+1}, y_{n+1}) = I_\varepsilon(x_n, y_n) for all 0<ε<20 < \varepsilon < 2.
    • (b) Two ways to re-base a state when ε→ε′\varepsilon \to \varepsilon': the shipped rescale (x,y)↦(A/a)(x,y)(x, y) \mapsto (A/a)(x, y) with a2=Iε′(x,y)/(1−ε′2/4)a^2 = I_{\varepsilon'}(x, y)/(1 - \varepsilon'^2/4), and the shear-scale that keeps xx and moves yy onto the new ellipse, v=y−ε2x1−ε2/4v = \dfrac{y - \tfrac{\varepsilon}{2}x}{\sqrt{1 - \varepsilon^2/4}}, y′=ε′2x+v1−ε′2/4y' = \tfrac{\varepsilon'}{2}x + v\sqrt{1 - \varepsilon'^2/4}. Show that both land on Iε′=A2(1−ε′2/4)I_{\varepsilon'} = A^2(1 - \varepsilon'^2/4); compute each map’s determinant (the shear-scale’s is (4−ε′2)/(4−ε2)\sqrt{(4 - \varepsilon'^2)/(4 - \varepsilon^2)}, the rescale’s A2/a2A^2/a^2); say which preserves the orbit’s phase and which preserves the canonical area, and why neither is a symplectomorphism of the same ω\omega (the ellipse itself moved). Then explain why the engine’s measured ripple, 0.097 dB over ±48 semitones in two seconds, is the criterion that decides between them, not the determinant.

midi-sink 2.0.0 · AGPL-3.0 · source