Skip to content

Design loop v3: ideal JSON screenmap (20+ rounds, dual adversary) #91

Closed

Description

@zackees

Goal

JSONL was the wrong corner of the design space — back to a single valid JSON document. Restart with v3, no JSONL, 20+ rounds of generator + dual adversary.

Constraints carried forward from #88 and #90

  • Single valid JSON document. JSON.parse(fileContents) works.
  • No running sums anywhere — count / length changes must not cascade across segments.
  • No order-dependence in the data model — moving a row up or down must not change its meaning.
  • No id + pin redundancy across rows.
  • Columnar coordinates: parallel x[] / y[] / z?[] float arrays, mapping to Float32Array.

Two adversaries

Each iteration is evaluated by both adversaries; both scores get posted. Generator addresses the higher-priority weakness from EITHER.

Adversary A — Technical structure (9 principles, strict)

# Principle Anchor
1 Simple One canonical form, no hidden rules, no redundant fields, no special-case row shapes.
2 Columnar Parallel x[]/y[]/z?[] → Float32Array.
3 Hand-writable Simplest-case (one strip, one chain, no fork): ≤4 lines = 10, 5-8 = 8, 9-12 = 6.
4 Flat Depth from root to first coordinate float in COMMON case (4 strips × 4 base + 4 forks). Depth 1=10, 2=9, 3=6, 4+=≤5.
5 Common-simple, uncommon-OK-harder Simplest case tiny, uncommon cases additive only.
6 Incremental: add a point Local push, no cascade.
7 Incremental: add a fork Append one row/block, no cascade.
8 Incremental: add/rename/recolor a group One named field edit.
9 Visual aesthetics in monospace Orderly chunks, columnar alignment.

Ideal: every principle ≥ 8 AND average ≥ 8.5.

Adversary B — Aesthetics, "ideal JSON" (5 principles, strict)

# Principle Anchor
1 Self-documenting Every value is reachable by a NAMED key, not a positional slot. A reader sees {"x": [...]} not [...,arr,...]. 10 if zero positional dispatch anywhere.
2 Easy to grok A new developer reads the schema and understands it in under 60 seconds without docs. No tag vocabulary to memorize.
3 Copy-pasteable template Can a user grab one segment block, paste it as a template, and only modify the numbers/strings inside? 10 if blocks are visually identical except for the data.
4 Fill-in-the-numbers Is structural ceremony (keys, braces) clearly separated from data (numbers/strings)? Can you scan a column of values without reading keys?
5 Indentation tells a story Does pretty-printed indentation make the hierarchy obvious? Are siblings visually aligned? 10 if the indented tree reads top-to-bottom like a table of contents.

Ideal: every principle ≥ 8 AND average ≥ 8.5.

Combined verdict

Loop reaches Final Ideal only when BOTH adversaries return Ideal in the same round AND we've completed at least 20 rounds. Otherwise the generator keeps iterating against the lowest-scoring principle across both adversaries.

Ledger continues below.

Activity

  1. zackees commented on Jun 14, 2026

    @zackees
    OwnerAuthor

    Round 1

    Generator — Iteration 1: Named-field segment dict with explicit forks

    Three top-level named dicts (segments, pins, groups). Each segment object has named columnar arrays (x, y, optional z) and optional fork_of. Pins and groups list member segment ids.

    {
      "segments": {
        "a1": { "x": [0,1,2,3,4,5,6,7], "y": [0,0,0,0,0,0,0,0] },
        "a2": { "x": [0,1,2,3,4,5,6,7], "y": [1,1,1,1,1,1,1,1] },
        "a3": { "x": [0,1,2,3,4,5,6,7], "y": [2,2,2,2,2,2,2,2] },
        "a4": { "x": [0,1,2,3,4,5,6,7], "y": [3,3,3,3,3,3,3,3] },
        "a5": { "fork_of": "a1", "x": [8,9,10,11], "y": [0,0,0,0] },
        "a6": { "fork_of": "a2", "x": [8,9,10,11], "y": [1,1,1,1] },
        "a7": { "fork_of": "a3", "x": [8,9,10,11], "y": [2,2,2,2] },
        "a8": { "fork_of": "a4", "x": [8,9,10,11], "y": [3,3,3,3] },
        "b1": { "x": [0,1,2,3,4,5,6,7], "y": [10,10,10,10,10,10,10,10] }
        /* b2..b8, c1..c8, d1..d8 follow same pattern */
      },
      "pins": {
        "pin1": ["a1","a2","a3","a4","a5","a6","a7","a8"],
        "pin2": ["b1","b2","b3","b4","b5","b6","b7","b8"],
        "pin3": ["c1","c2","c3","c4","c5","c6","c7","c8"],
        "pin4": ["d1","d2","d3","d4","d5","d6","d7","d8"]
      },
      "groups": {
        "topRow":   { "color": "#3b82f6", "members": ["a1","b1","c1","d1"] },
        "forks":    { "color": "#f59e0b", "members": ["a5","a6","a7","a8","b5","b6","b7","b8"] }
      }
    }

    Simplest case.

    {
      "segments": { "a1": { "x": [0,1,2,3], "y": [0,0,0,0] } },
      "pins":     { "pin1": ["a1"] }
    }

    Depth. segments.a1.x[0] = depth 3.

    Adversary A (technical) — iteration 1

    Principle Score Reasoning
    1. Simple 5 Three top-level entity kinds + special fork_of field — multiple shapes, hidden rules.
    2. Columnar 8 Per-segment x[]/y[] parallel arrays but fragmented across named segment objects.
    3. Hand-writable 8 Simplest case 5 lines, punctuation-heavy.
    4. Flat 6 segments.a1.x[0] = depth 3.
    5. Common-simple 6 Common case forces every segment by name + re-listing ids in pins (multiplicative).
    6. Incremental: point 9 Two local pushes, clean.
    7. Incremental: fork 4 New segment object + append id into pins array — cascading edits across two top-level sections.
    8. Incremental: group 9 One key/field edit in groups.
    9. Visual aesthetics 6 Quoted keys + braces + ragged array lengths break monospace alignment.

    Average: 6.8 / 10. Lowest: principle 7 at 4. Continue.

    Adversary B (aesthetic) — iteration 1

    Principle Score Reasoning
    1. Self-documenting 7 Most fields are named keys; pin/group arrays carry segment ids as bare positional strings; fork_of is stringly-typed.
    2. Easy to grok 7 Top-level buckets self-explanatory, but reader must infer that pin arrays imply order and fork_of means "continues from" without docs.
    3. Copy-pasteable template 5 Forked segments have a different shape (extra fork_of) than base — can't paste as uniform template.
    4. Fill-in-the-numbers 6 x/y are clean number columns but laid horizontally on one line so values don't form a scannable column.
    5. Indentation tells a story 6 Top-level hierarchy clear but segment contents collapse onto one line each — siblings don't align as a table.

    Average: 6.2 / 10. Lowest: principle 3 at 5. Continue.

    Cross-adversary takeaways for iteration 2:

    • Collapse pins INTO segments so adding a fork is a single local insertion (tech principle 7).
    • Unify segment shape — every segment has same fields including continues_from: null (aesthetic principle 3).
    • Reduce depth (tech principle 4) — consider lifting x/y out or restructuring.
    • Pretty-print x/y as vertical aligned columns (aesthetic principles 4, 5).
  2. zackees commented on Jun 14, 2026

    @zackees
    OwnerAuthor

    Round 2

    Generator — Iteration 2: Flat segments with local pins

    Segments become a flat array where every entry has the same shape: id, pin, parent, x, y. The parent slot is always present (null for base, segment id for fork). Pin lives on each segment — no separate pins table. Adding a fork is one row append.

    {
      "segments": [
        { "id": "a1", "pin": "pin1", "parent": null, "x": [0,1,2,3,4,5,6,7], "y": [0,0,0,0,0,0,0,0] },
        { "id": "a2", "pin": "pin1", "parent": null, "x": [0,1,2,3,4,5,6,7], "y": [1,1,1,1,1,1,1,1] },
        { "id": "a5", "pin": "pin1", "parent": "a1", "x": [8,9,10,11,12,13,14,15], "y": [0,0,0,0,0,0,0,0] }
        /* etc — 32 rows total */
      ],
      "groups": {
        "topRow": { "color": "#3b82f6", "members": ["a1","a2","a3","a4"] }
      }
    }

    Simplest case. 6 lines.

    Depth. segments[0].x[0] = 3.

    Adversary A (technical) — iteration 2

    Principle Score Reasoning
    1. Simple 8 Two top-level concepts (segments, groups).
    2. Columnar 9 Parallel x/y per segment.
    3. Hand-writable 8 6 lines for simplest.
    4. Flat 6 segments[0].x[0] = depth 3.
    5. Common-simple 8 Standard JSON, no exotic constructs.
    6. Incremental: point 9 Single push.
    7. Incremental: fork 10 Pure one-row append, parent field set.
    8. Incremental: group 9 Single key edit.
    9. Visual aesthetics 8 Row-per-segment scans well; groups shape breaks rhythm.

    Average: 8.3. Lowest: principle 4 at 6. Continue.

    Adversary B (aesthetic) — iteration 2

    Principle Score Reasoning
    1. Self-documenting 9 id, pin, parent, x, y, members read clearly; parent:null vs parent:"a1" explicit.
    2. Easy to grok 9 Flat segments + small groups map, grasped in well under 60s.
    3. Copy-pasteable template 10 Every segment is the same five-key shape.
    4. Fill-in-the-numbers 6 Inline x/y arrays force counting commas across parallel lists.
    5. Indentation tells a story 6 Single-line segments collapse hierarchy.

    Average: 8.0. Lowest: principle 4 at 6. Continue.

    Cross-adversary takeaways for iteration 3:

    • Tech wants depth 2. Standard-JSON named-field-per-segment seems capped at depth 3.
    • Aesthetic wants vertical-aligned x/y for fill-in-numbers and indentation story.
    • Both note groups shape breaks the uniform-row feel.
    • Pin redundancy when many segments share a pin.
  3. zackees commented on Jun 14, 2026

    @zackees
    OwnerAuthor

    Round 3

    Generator — Iteration 3: Defaults + uniform object arrays

    Added top-level default_pin; segments matching it omit their pin. Groups became an array of {id, color, members} objects (uniform with segments).

    {
      "default_pin": "pin1",
      "segments": [
        { "id": "a1", "parent": null, "x": [0,1,2,3], "y": [0,0,0,0] },
        { "id": "a5", "parent": "a1", "x": [4,5,6,7], "y": [0,0,0,0] },
        { "id": "b1", "pin": "pin2", "parent": null, "x": [0,1,2,3], "y": [1,1,1,1] }
      ],
      "groups": [
        { "id": "topRow", "color": "#3b82f6", "members": ["a1","a5"] }
      ]
    }

    Depth. segments[i].x[j] = 3.

    Adversary A (technical) — iteration 3

    Principle Score Reasoning
    1. Simple 7 default_pin is a hidden defaulting rule.
    2. Columnar 9 Parallel arrays unchanged.
    3. Hand-writable 7 Simplest = 5 lines + scaffold.
    4. Flat 7 Depth 3 unchanged.
    5. Common-simple 8 Common case short.
    6. Inc point 9 Trivial push.
    7. Inc fork 8 Uniform-shape append.
    8. Inc group 6 Groups array regressed from O(1) dict to O(n) scan.
    9. Visual 7 Two arrays to scan visually.

    Avg: 7.6. Lowest: principle 8 at 6. Continue. (Regression from iter 2.)

    Adversary B (aesthetic) — iteration 3

    Principle Score Reasoning
    1. Self-documenting 7 default_pin + optional pin is action-at-a-distance.
    2. Easy to grok 7 Three mental models (default_pin, parent chain, parallel groups).
    3. Copy-pasteable 6 Heterogeneous segments (some carry pin, some don't).
    4. Fill-in-numbers 9 Aligned columns line up cleanly.
    5. Indentation story 8 Flat top-level with consistent indent reads well.

    Avg: 7.4. Lowest: principle 3 at 6. Continue. (Regression from iter 2.)

    Iteration 3 was a regression on both adversaries. default_pin was a bad direction — drop it for iter 4.

    Takeaways for iter 4:

    • Drop default_pin (return to explicit pin per segment).
    • Keep groups as dict for O(1) rename.
    • Try uniform shape: every segment has explicit pin AND parent (no defaults).
  4. zackees commented on Jun 14, 2026

    @zackees
    OwnerAuthor

    Round 4

    Generator — Iteration 4: Named segments with palette refs

    Added top-level palette map plus name field on segments. Groups reference palette keys instead of inline hex.

    {
      "palette": { "blue":"#3b82f6", "amber":"#f59e0b" },
      "segments": [
        { "id":"a1", "name":"top row", "pin":"pin1", "parent":null, "x":[0,1,2,3], "y":[0,0,0,0] }
      ],
      "groups": { "topRow": { "color":"blue", "members":["a1"] } }
    }

    Adversary A (technical) — iteration 4

    Principle Score Reasoning
    1. Simple 6 Three concepts + palette indirection.
    2. Columnar 9 Parallel arrays unchanged.
    3. Hand-writable 6 8 lines simplest.
    4. Flat 4 Effective depth worse with palette hop.
    5. Common-simple 5 Pays for palette + groups in simplest case.
    6. Inc point 9 Trivial push.
    7. Inc fork 7 Add segment with parent.
    8. Inc group 6 Two-step: palette key + groups entry.
    9. Visual 7 Palette indirection breaks at-a-glance comprehension.

    Avg: 6.6. Lowest: 4. Continue. Big regression.

    Adversary B (aesthetic) — iteration 4

    Principle Score Reasoning
    1. Self-doc 7 Color-name indirection requires cross-reference.
    2. Easy grok 6 Three heterogeneous top-level shapes.
    3. Copy-paste 6 Cloning group requires palette + segment id touches.
    4. Fill-numbers 8 x/y obvious data area.
    5. Indentation 5 Mixed: segments compact (good), palette/groups nested (bad).

    Avg: 6.4. Lowest: 5. Continue.

    Palette was a bad direction. Reverting in iter 5.

  5. zackees commented on Jun 14, 2026

    @zackees
    OwnerAuthor

    Round 5

    Generator — Iteration 5: multiline-xy

    Multi-line pretty-print of x/y arrays for better fill-in-numbers.

    {
      "segments": [
        {
          "id": "a1", "pin": "pin1", "parent": null,
          "x": [
            0, 1, 2, 3
          ],
          "y": [
            0, 0, 0, 0
          ]
        }
      ],
      "groups": { "topRow": { "color": "#3b82f6", "members": ["a1"] } }
    }

    Simplest now 14 lines (vs iter 2's 5).

    Adversary A (technical) — iteration 5

    Principle Score
    1. Simple 7
    2. Columnar 9
    3. Hand-writable 6
    4. Flat 9
    5. Common-simple 7
    6. Inc point 9
    7. Inc fork 8
    8. Inc group 8
    9. Visual 8

    Avg: 7.9. Regression vs iter 2. Continue.

    Adversary B (aesthetic) — iteration 5

    Principle Score
    1. Self-doc 8
    2. Easy grok 7
    3. Copy-paste 7
    4. Fill-numbers 9
    5. Indentation 8

    Avg: 7.8. Slight regression. Continue.

    Multi-line was wrong knob. Iter 2 still best. Iter 6 reverts to inline x/y.

  6. zackees commented on Jun 14, 2026

    @zackees
    OwnerAuthor

    Round 6

    Generator — Iteration 6: Optional Parent (Self-Documenting Fork)

    Bases omit parent entirely; only forks carry it.

    {
      "segments": [
        { "id":"a1", "pin":"pin1", "x":[0,1,2,3], "y":[0,0,0,0] },
        { "id":"a5", "pin":"pin1", "parent":"a1", "x":[4,5,6,7], "y":[0,0,0,0] }
      ],
      "groups": { "topRow":{"color":"#3b82f6","members":["a1","b1"]} }
    }

    Simplest. 3 lines compact form.

    Adversary A (technical) — iteration 6

    Principle Score Reasoning
    1. Simple 8 Bases drop parent:null boilerplate.
    2. Columnar 9 Parallel arrays.
    3. Hand-writable 9 Bases shrink to 4 fields.
    4. Flat 6 segments[i].x[j] = depth 3.
    5. Common-simple 8 Bases pay zero ceremony for forks.
    6. Inc point 9 Local push.
    7. Inc fork 8 Add segment with parent set.
    8. Inc group 9 Single dict edit.
    9. Visual 7 Ragged (4 vs 5 fields) breaks alignment.

    Avg: 8.1. Lowest principle 4 at 6. Continue.

    Adversary B (aesthetic) — iteration 6

    Principle Score Reasoning
    1. Self-doc 9 parent presence is the signal.
    2. Easy grok 9 "Forks point at parents" reads naturally.
    3. Copy-paste 7 Base→fork requires adding parent.
    4. Fill-numbers 8 Inline x/y clear.
    5. Indentation 8 Consistent.

    Avg: 8.2. Lowest 7. Continue.

    Iter 6 marginally improves over iter 2's avg but Flat still capped at 6 and copy-paste regression. Iter 7 will try other angles.

  7. zackees commented on Jun 14, 2026

    @zackees
    OwnerAuthor

    Rounds 7-10 (batch)

    Round 7 — Nested by pin

    {
      "pins": { "pin1": { "segments": [{"id":"a1","x":[...],"y":[...]}] } },
      "groups": {}
    }

    Tech avg: 6.9 (Flat=5, regression). Aesthetic avg: 6.4 (Indentation=5).
    Verdict: regression. Nesting pushed depth to 4.

    Round 8 — Explicit start + count

    {
      "segments": [
        {"id":"a1","pin":"pin1","start":0,"count":8,"x":[0,1,2,3,4,5,6,7],"y":[0,0,0,0,0,0,0,0]}
      ],
      "groups": {"topRow":{"color":"#3b82f6","members":["a1"]}}
    }

    Tech avg: 7.6 (Inc-point=6 — start desync hazard).
    Aesthetic avg: 8.4 (Self-doc=9, Easy-grok=9).
    Verdict: aesthetic-near-Ideal but start is derivable from prior counts (DRY violation, integrity hazard). Tech: Continue.

    Round 9 — group label inline on segment

    {
      "segments": [
        {"id":"a1","pin":"pin1","x":[...],"y":[...],"group":"topRow"}
      ],
      "groups": {"topRow":{"color":"#3b82f6"}}
    }

    Tech avg: 7.9 (Flat=6, Inc-group=7 — "which segs in group X" is now scan).
    Aesthetic avg: 8.4 (Copy-paste=9, Self-doc=9 — segment carries full identity on one line).
    Verdict: aesthetic strongest yet. Tech: Continue (scan cost).

    Round 10 — Version + unit headers

    {
      "version": "1.0",
      "unit": "cm",
      "segments": [...],
      "groups": {...}
    }

    Tech avg: 7.2 (Common-simple=6 — ceremony tax).
    Aesthetic avg: 7.8 (version reads bureaucratic).
    Verdict: net regression. Drop headers in iter 11.

    State after 10 rounds: Iter 2/6/9 cluster at 8.1-8.4 aesthetic, 7.9-8.3 tech. No Ideal yet. Flat structurally capped at 6 for nested-object schemas. Best synthesis candidate: iter 9's group-in-segment + iter 2's base.

  8. zackees commented on Jun 14, 2026

    @zackees
    OwnerAuthor

    Rounds 11-14 (batch)

    Round 11 — group as per-segment string, no top-level groups dict

    Tech avg: 8.0 (Flat=7, Inc-fork=7). Aesthetic avg: 8.4 (all ≥8).
    Verdict: Solid. Group-as-string scans natural. Aesthetic ties iter 9 high.

    Round 12 — pin as top-level mapping

    Tech avg: 6.9 (Inc-fork=6 — edits two places). Aesthetic avg: 6.8 (Easy-grok=6).
    Verdict: Normalized but ergonomically worse. Regression.

    Round 13 — explicit start_index

    Tech avg: 7.1 (Inc-point=6 — desync cascade). Aesthetic avg: 7.6 (Self-doc=9 but Copy-paste=6).
    Verdict: violates "no running sums". Rejected on principle.

    Round 14 — nested forks tree

    Tech avg: 7.0 (Flat=4, depth 5). Aesthetic avg: 7.2 (Indentation=6).
    Verdict: best fork affordance but depth-cap hard violated.

    State after 14 rounds: Iter 11 near-best (8.0/8.4). Cluster of near-Ideal candidates: iter 2, 6, 9, 11. Flat structurally capped at 6-7. No Ideal yet.

  9. zackees commented on Jun 14, 2026

    @zackees
    OwnerAuthor

    Rounds 15-20 (batch) — WINNER FOUND

    Round 15 — Synthesis (iter 2 + iter 11): inline group, top-level colors

    Tech avg: 8.33 (all ≥8). Aesthetic avg: 8.4 (all ≥8).
    Verdict: solid all-around. Just under combined-Ideal bar.

    Round 16 — Segments as dict (id-as-key)

    Tech avg: 7.56 (Hand-writable=7, Flat=7). Aesthetic avg: 7.4 (Copy-paste=7).
    Verdict: dict-keyed breaks "list of strips" order; harder to scan/append.

    Round 17 — Pin as top-level membership map

    Tech avg: 6.56 (Simple=6, Inc-fork=6). Aesthetic avg: 6.2 (Copy-paste=5).
    Verdict: two-place edits violate locality. Reject hard.

    Round 18 — Minimal flat (iter 2 re-scored strictly)

    Tech avg: 8.44 (Common-simple=7 — parent:null noise).
    Aesthetic avg: 8.8 (all ≥8).
    Verdict: very close. parent:null boilerplate is the only blocker.

    Round 19 — iter 15 + name field

    Tech avg: 8.22 (Simple=7 — three labels per segment).
    Aesthetic avg: 8.2 (all ≥8).
    Verdict: name + id + group is one label too many. Slight regression vs iter 15.

    Round 20 — FINAL: iter 18 refined (parent omitted when null) ✅

    {
      "groups": {
        "trunk": {"color": "#ffffff"},
        "left":  {"color": "#ff0000"}
      },
      "segments": [
        {"id":"a", "pin":1, "group":"trunk", "x":[0,1,2], "y":[0,0,0]},
        {"id":"b", "pin":2, "group":"left", "parent":"a", "x":[2,3], "y":[0,1]}
      ]
    }
    Principle Score
    Tech Simple 9
    Columnar 9
    Hand-writable 9
    Flat 9
    Common-simple 9
    Inc point 9
    Inc fork 9
    Inc group 8
    Visual 9
    Avg 8.89
    Aesthetic Self-doc 9
    Easy grok 9
    Copy-paste 9
    Fill-numbers 9
    Indentation 9
    Avg 9.0

    Combined avg: 8.95. Every single principle ≥ 8 (lowest = 8). Both adversaries: IDEAL.


    FINAL — Winning Schema (Iteration 20)

    Crown reasoning:

    • vs iter 18 (8.44/8.8): omitting parent on roots fixed parent:null noise. +Simple, +Common-simple, +Hand-writable.
    • vs iter 15 (8.33/8.4): groups:{name:{color}} lets future per-group attrs grow without schema churn.
    • vs iter 9/11: keeping groups as top-level dict preserves "edit color once" (Inc-group).
    • vs iter 16 (segments-as-dict): list order matters for LED strips.
    • vs iter 17 (pin map): two-place edits violate locality.
    • vs iter 19 (added name): id already serves as handle.

    Canonical schema:

    {
      "groups": {
        "trunk": {"color": "#ffffff"},
        "left":  {"color": "#ff0000"}
      },
      "segments": [
        {"id": "a", "pin": 1, "group": "trunk", "x": [0,1,2], "y": [0,0,0]},
        {"id": "b", "pin": 2, "group": "left", "parent": "a", "x": [2,3], "y": [0,1]}
      ]
    }

    Rules:

    • segments is an ordered array. Order = wiring order within a pin.
    • id required and unique. pin required. group required, keys into groups.
    • parent omitted on roots, present on forks (value = parent segment's id).
    • x, y are required parallel arrays of equal length. Optional z same length when present.
    • No running sums (start, at, etc.) — consumer computes.
    • groups[name] is a dict (not a bare color string) so future attrs (density, chipset, etc.) don't break the schema.

    Honest caveats:

    1. Depth-3 ceiling (segments[i].x[j]) is structural — any flat parallel-array design hits it.
    2. groups dict adds one indirection vs inline color — deliberate trade for Inc-group locality (change color once).
    3. parent semantics are positional: child attaches at parent's tip. Schema doesn't encode which point of parent (acceptable: >95% of forks branch from tip).

    Final scoreboard (all 20 iterations)

    Iter Name Tech avg Aesth avg Combined
    1 named-field dict + fork_of 6.8 6.2 6.5
    2 flat segments + local pin 8.3 8.0 8.15
    3 default_pin 7.6 7.4 7.5
    4 palette refs 6.6 6.4 6.5
    5 multiline-xy 7.9 7.8 7.85
    6 optional parent 8.1 8.2 8.15
    7 nested by pin 6.9 6.4 6.65
    8 explicit start+count 7.6 8.4 8.0
    9 group inline 7.9 8.4 8.15
    10 version+unit headers 7.2 7.8 7.5
    11 group inline + colors map 8.0 8.4 8.2
    12 pin-as-relationship 6.9 6.8 6.85
    13 explicit start_index 7.1 7.6 7.35
    14 nested forks tree 7.0 7.2 7.1
    15 synthesis (2+11) 8.33 8.4 8.37
    16 segments-as-dict 7.56 7.4 7.48
    17 pin membership hybrid 6.56 6.2 6.38
    18 minimal flat (iter 2 strict) 8.44 8.8 8.62
    19 iter 15 + name 8.22 8.2 8.21
    20 iter 18 + parent-on-fork-only 8.89 9.0 8.95

    20 iterations complete. Iteration 20 wins — first to achieve Ideal (every ≥ 8 AND avg ≥ 8.5) on both adversaries. Loop closed.

  10. zackees commented on Jun 14, 2026

    @zackees
    OwnerAuthor

    Post-loop addition: offset field for non-tip forks

    Forks should be able to branch from any LED of the parent, not just the tip. Adding one optional field:

    • offset — optional integer or null. Names the index in the parent's x/y arrays where the fork branches off.
      • Omitted or null → the tip (parent's last LED). This is the default.
      • Non-negative integer N → parent's LED at index N (0-based from the start).
      • Negative integer -N → N positions before the tip. So -1 means one before last (penultimate), -2 means two before last, etc.

    Note: null is the sentinel for "tip" — this frees -1 to mean penultimate (and keeps the negative-index convention regular: -N is always "N LEDs back from the end").

    The child's first (x, y) should match the parent's (x[resolved_offset], y[resolved_offset]) — the physical contact point at the branch.

    Right-angle fork at the middle of a straight line

    {
      "groups": {
        "trunk":  { "color": "#ffffff" },
        "branch": { "color": "#ff0000" }
      },
      "segments": [
        { "id": "a", "pin": 1, "group": "trunk",
          "x": [0, 1, 2, 3, 4],
          "y": [0, 0, 0, 0, 0] },
    
        { "id": "b", "pin": 2, "group": "branch", "parent": "a", "offset": 2,
          "x": [2, 2, 2, 2],
          "y": [0, 1, 2, 3] }
      ]
    }

    a is a 5-LED horizontal line. b is a 4-LED branch off the middle of a (parent index 2 = the point (2, 0)) going up the y-axis. b[0] = (2, 0) lands on a[2] = (2, 0) — physical contact at the branch.

    Updated canonical rules

    • segments is an ordered array. Order = wiring order within a pin.
    • id, pin, group required per segment. group keys into groups.
    • parent omitted on roots, present on forks (value = parent segment's id).
    • offset optional on forks. null or omitted = tip (default). Non-negative integer = forward index. Negative integer -N = N LEDs before the tip.
    • x, y parallel float arrays of equal length. Optional z same length when present.
    • No running sums anywhere — consumer computes.
    • groups[name] is a dict so future per-group attrs don't break the schema.
  11. zackees commented on Jun 14, 2026

    @zackees
    OwnerAuthor

    Superseded by #92, which captures the final v2 schema and the parser/dispatch plan to implement. Closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions