README.md
8.3 kB · markdown
spin-render
- Renders the odd parity-carpet stack with each layer spun about the centre, and measures what survives a change of raster.
- Layer
kis the carpetC_n(u, v) = chi_n(u) chi_n(v)at thek-th odd scalen = 2k - 1,n <= 55, rotated about(1/2, 1/2)bytheta_k, sampled at pixel centres of anR x Rraster. - The stack is the paper coverage
Pin[0, 1], the mean over the 28 layers of the not-inked indicator; the ink field isD = 1 - P, andDtakes valuesk/28. - Peaks are read on
D. In paper coverage the value1is attained on wide regions near the rim and carries no node structure; the isolated features are the ink concentrations, so every peak, plateau and drift number below is a statement aboutD. - Measurement is restricted to the inscribed disc of radius
1/2about the centre, so every layer covers every sampled pixel at every angle; the layers themselves are the periodic extension of the parity rule, so no pixel is ever undefined. - The centre is the fixed point of every rotation and its cell has inradius
1/(2n)in each layer, so a disc of radius1/110about the centre lies inside one cell of all 28 layers whatever the schedule; the centre readsD = 14/28in every schedule at everyR, the 14 scalesn = 3 mod 4(main,dark_layers). - Six schedules (
schedules):unspunat0;degreesatkdegrees;goldenatk * 137.507764degrees;primesat0, 2, 3, 5, 7, ..., layer 1 at0and layerk > 1atp_(k-1), ending at103;randomat a seeded uniform angle,default_rng(1);gaussianatatan2(b, a)fora >= b >= 1witha^2 + b^2 = nand0when no such pair exists, which rotates only the 9 scales5, 13, 17, 25, 29, 37, 41, 45, 53.
RUN
uv run python research/lab/py/spin-render/spin_render.py- From the repo root. One core, about 10 seconds.
- Domain is
R = 256, 512, 1024, 2048for all six schedules, the fade table atR = 1024and layer countL = 4, 8, 14, 28, and a0.02-wide zoom at effectiveR = 51200on each schedule's top peak. - Writes the five PNGs beside this file and nothing else.
WHAT IT PRINTS
reportprints, per schedule and perR: the peak ofD, the unit-square area of all disc pixels at that peak, the mean ofP, the RMS contrast ofD, the centre value, and the top three of the 20 local maxima with the pixel count of each maximum's connected plateau.- Maxima are the pixels equal to their
3 x 3maximum filter (maximum_filter3), taken greedily by value with an exclusion radius0.01in unit-square coordinates (peaks); each is reported at the centroid of its flood-filled plateau (plateau), not at its seed pixel. driftmatches each of the 20 maxima atRto its nearest at2Rand prints the median and maximum displacement, in unit coordinates and in pixels atR, with the count of the 20 that land within one pixel.diagonal_maximumcomputes the unspun maximum and its whole locus exactly, with no raster.D(u, v) = |S(u) inter S(v)|withS(u) = {n : floor(nu) odd}, so a maximum needsS(u) = S(v)of maximal size, and the 1D maxima are read off the636breakpointsk/nin exact rationals; it returns every interval attaining the maximum and every product cell whose two factors carry the sameS.exact_variancesums the paper's rational covariance formula over theL x Lscale pairs, an expectation for the fade table computed without any render.dark_layerslists the scales inked at a peak's seed pixel, independently of the accumulator that measured it.
WHAT IT FINDS
- The unspun global maximum is
18/28, the 18 scalesn = 3, 5 mod 6, attained on two diagonal intervals[1/3, 18/53)and[35/53, 2/3), each of width1/159, and so on four square cells:S(1 - x) = S(x)exactly for odd scales, sincefloor(n(1 - x)) = n - 1 - floor(nx)withn - 1even, so both intervals carry the same scale set and all four products are maxima. The locus is4cells of total area4/25281 = 0.000158222, one cell1/25281 = 3.95554e-05(diagonal_maximum). - The raster finds all four: peak
18/28at(0.33667, 0.33667)and its three mirrors at everyR, plateaus of4, 9, 49, 169pixels atR = 256, 512, 1024, 2048, measured locus area0.000244141, 0.000137329, 0.000186920, 0.000161171against the exact0.000158222, and the zoom measures the single cell at the top peak as3.95523e-05against the exact3.95554e-05(report,main). - Median drift of the unspun top 20 is
0.71, 0.35, 0.35pixels over256 -> 512 -> 1024 -> 2048, under one pixel at every step, with20/20and19/20inside one pixel on the last two steps (drift). - Every whole-degree schedule loses the unspun maximum:
degreespeaks at14/28, exactly the centre's value, at all four resolutions;primespeaks at16/28; neither reaches18/28, and the zoom at effectiveR = 51200finds nothing above the raster peak in any schedule (report). - The spun peaks sit on far smaller cells. The area of the single cell at the top peak, from the zoom, is
3.95523e-05unspun,1.65596e-05primes,9.80453e-06degrees,2.27585e-06random,1.30005e-06gaussian,1.0128e-06golden; the golden peak is one pixel wide even atR = 2048(report). - The discriminator is the single cell, never the whole locus: a schedule whose maximum is lower spreads it over more cells, so the total locus area at the peak runs to
0.000415802underdegreesatR = 2048, larger than the unspun0.000158222at a value four layers higher (report). - Off-centre maxima do stay put for whole-degree schedules: the
primespeak16/28at(0.19469, 0.15501)drifts0.29pixels over1024 -> 2048. A raster cannot read this as an exact coincidence. The stack is piecewise constant on cells of positive area, so any cell wider than a pixel is found at every resolution; plateau stability measures cell area, not lattice coincidence, and the only honest statements a raster supports are resolution-drift statements. - Top-20 lists reshuffle under refinement wherever the peak value is degenerate:
8/20to15/20of the spun maxima land within one pixel of a maximum at2R, against19/20unspun, and the maximum displacement runs to470pixels where a small cell drops out of the top 20 (drift). - The centre is never the strict global maximum:
18/28beats it unspun,16/28or17/28beats it in five schedules, and onlydegreesleaves it tied at the top with14/28(report). - The fade constant
c = rms * sqrt(L)atR = 1024over the full square runs0.309907, 0.390837, 0.427756, 0.460395atL = 4, 8, 14, 28unspun, against the exact0.309477, 0.389754, 0.426869, 0.458411fromexact_variance; the tree'sc = 0.522is theL -> infinitylimit, not the value atL = 28, and0.4604against0.4584is the raster's0.4%discretisation bias (main). - Spinning does not change the fade law:
catL = 28reads0.401417degrees,0.427986golden,0.425189primes,0.423811random,0.440940gaussian, against0.460395unspun, all within13%and all falling as1/sqrt(L)(main). - The mean of
Pover the disc is0.7682in every schedule at every resolution,0.7689unspun atR = 2048; rotation moves no ink (report). float32againstfloat64atR = 512on the golden schedule:8pixels of262144differ, by one layer (main).
FIGURES
stack-unspun.png,stack-degrees.png,stack-primes.png,stack-gaussian.png: theR = 1024render of each schedule, block-averaged to512and quantised to the 29 stack levels,45820, 61142, 63814, 55405bytes;stack-sheet.pngis the four at256,69865bytes (save_png,contact_sheet).- Unspun is a lattice of straight moire rays through the diagonals; the whole-degree fan pleats them into curved bands; the prime and golden schedules wind them into a vortex of arms about the centre, with the centre node visible as a single dark speck.
WITNESSES
farey.mdTHE STACK IS AN ADDRESS: the unspun render this study spins is the same fieldlab/py/carpet-stack-addressrenders at512 x 512, and its global maximum18/28, on four cells of side1/159against the two intervals[1/3, 18/53)and[35/53, 2/3), is the closed form read at a denominator-3 node and its mirror.- The stack's
L^2fade:c = 0.522is the limit ofsqrt(L Var(G_L)), whose exact values0.309477 .. 0.458411atL = 4 .. 28this study reproduces from the raster to0.4%.