Markdown version: https://ai.hiina.space/reports/magic-circle-programming-languages/04-five-designs-five-computational-models.md · index

Index of everything on this site: https://ai.hiina.space/index.md

Magic circle programming languages: 4. Five designs, five computational models

4. Five designs, five computational models

The design pass worked from five principles. Meaning goes in what classic geometry measures well (ring radii and concentricity, angles around a centre, containment, vertex counts) and stays out of arbitrary line topology and fine detail inside small glyphs. Identity and magnitude are separate channels: shape picks the operator, and quality, size or count sets how much, with precision graded and never a gate, except deliberately in Athanor. Evaluation is visible and errors are typed and theatrical, as in the Wand Simulator, HexDebug and Hex mishaps. Everything is bounded by a resource the player can see. And each language gets one central idea and its own model of computation. None of these designs has been built or tested; parameter values marked "(guess)" are ones the design pass itself flagged as guesses, and the foundational references it names (Joy, Lafont, Mazza, Lamping, Faust, Mackworth, Păun, Guo et al.) were cited from the design pass's own knowledge rather than fetched for this report.

Shared machinery: the quality score q

Three designs consume a per-element quality q in [0, 1], defined once. For a ring, the features are RMS radial deviation over R, closure gap over 2πR, out-of-plane RMS over R (VR only), and the high-band elliptic Fourier energy fraction (wobble). For a glyph, they are the $Q distance to the matched template, the Procrustes residual after similarity alignment, the high-band EFD fraction, and DTW cost per point where stroke order matters. For placement, they are angular-spacing error against the intended symmetry and radial deviation from the band centre.

Each residual r_j is divided by a baseline b_j = b_dev,j^(1−λ) · b_player,j^λ, where b_dev is the device noise floor (controller jitter at arm's length measured once per headset, or scan resolution for a photo) and b_player is the player's median residual on five calibration circles and five lines drawn at setup. At λ = 0 the score is absolute and rewards skill; at λ = 1 it is fully relative, so a player with a tremor and a calligrapher both land mid-scale on a typical effort. λ is a difficulty setting and the most important accessibility knob. Aggregate as s = Σ_j w_j log(1 + r_j / b_j) and q = σ(α − s). Fit w by Bradley–Terry logistic regression on pairwise neatness judgments, choose α so the median casual drawing scores 0.5, and validate with Spearman correlation on held-out pairs; a few hundred pairs per glyph family should suffice for a hobby game (guess).

Where semantics consumes q, use the floored q' = q_floor + (1 − q_floor) q so anything recognisable works. A "steady" assist drops the wobble terms (high-band EFD and out-of-plane residuals), which helps tremor without excusing wrong shapes. A "snap" assist beautifies with LADDER-style least-displacement constraint solving and fixes q at a set value. Do not ask a VLM for q.

The parsing toolkit has two branches. In VR, the existing prototype's stack applies: button-gated strokes, a PCA plane fit to the first ring stroke with later strokes projected onto it (their out-of-plane residual kept as a quality term), a circle fit (Kåsa or Taubin initialisation, then geometric refinement), PaleoSketch-style primitive classification, and $Q for glyphs. For images: rectify by fitting an ellipse to the outer ring and mapping it to a circle (fine for near-frontal photos; steep angles need four printed corner fiducials), adaptive threshold, skeletonise, RANSAC or Hough for circles, Douglas–Peucker for polygons, and a small CNN for glyph crops trained on jittered synthetic renders in the DECIMER manner. VLMs serve only as explainers or fallback glyph labellers.


Text licensed CC BY 4.0 (attribution: Hiina, ai.hiina.space). Source: https://github.com/hiinaspace/ai-hiina-space