Skip to main content

9  Recommendation

9.1 A composable pipeline, not one algorithm

Each family above is good at one thing. The recommendation is a pipeline of small stages that share one pattern type and one seeded RNG:

corpus ──► motif library ──► layout ──► structure ──► texture ──► colour ──► repair ──► export
           (cut, canonical-   (banner    (symmetry    (constrained (float/    (txt, png,
            ise, cluster)      sequence)  group fill)  WFC / MRF / colour     machine)
                                                       quilting)   checks)
  1. Motif library (offline, Python + R): curated motifs with symmetry group, fundamental region and descriptors (Chapter 7).
  2. Layout: place chosen motifs along the banner, choose border bands and frieze groups. Deterministic from config + seed.
  3. Structure: for any new motif or band, generate only the fundamental region and expand by the group (Chapter 4).
  4. Texture / blending: fill free cells with the overlapping WFC model with pinned cells as the first filler, because it is small, exact on binary data and naturally respects fixed motifs (Chapter 2). Keep image quilting as the second filler behind the same interface, to compare (Chapter 3).
  5. Colour: map the binary chart to up to four colours (by region, row band or motif), seeded like the other stages.
  6. Repair: enforce machine rules (width at most 179 needles, float length or backing choice, isolated stitches) with a local re-synthesis pass, as in Merrell’s modify-in-blocks (Merrell 2021).
  7. Export: the Sjonabok .txt format, PNG previews for the site, and the machine format.

Each banner slot holds either an original motif taken as it is from the library, or a derived motif generated from one or more originals (same symmetry group and local statistics, new arrangement). Helga (2026-11-23) allows both, so the mix is a configuration setting. Top and bottom border bands are part of the default layout.

Learned models (Chapter 5) are left out of version 1 and can be added later as an alternative filler or as a critic.

9.2 Reproducibility

  • One Rng object (e.g. std::mt19937_64 or PCG) seeded from the config, passed explicitly to every stage; each stage derives its own sub-seed from (seed, stage name) so stages can be changed independently.
  • Output metadata records corpus commit (submodule SHA), config hash, seed and program version.
  • No floating-point-order or hash-map-iteration dependence in the core (C++); Python and R only read the outputs.

9.3 Language split

C++ for the core stages (object-oriented: Pattern, MotifLibrary, Layout, Filler with WfcFiller / QuiltFiller, Repair, Exporter), Python for exploration and motif cutting, R/tidyverse for corpus statistics and evaluation, Make + shell to drive it, Quarto for the reports.