Skip to content

Generator for grammar 002: grid compositions with exact multiply overprint#1

Merged
jamesdward merged 1 commit into
mainfrom
feat/generator-002
Jul 6, 2026
Merged

Generator for grammar 002: grid compositions with exact multiply overprint#1
jamesdward merged 1 commit into
mainfrom
feat/generator-002

Conversation

@jamesdward

Copy link
Copy Markdown
Owner

What

Milestone 2, Phase 5 — the 2D grid generator for the ISO family grammar (grammars/iso-002.yaml), consuming the sheet for grid, primitives, master inks and layering rule.

  • Five module-relative primitives (filled cell, inscribed circle Ø1M/Ø2M, stripe block at M/2 pitch-1M duty-0.5, staircase diagonal, stadium/quarter-round) placed by seeded free composition — audit 002 §3's dialect space: fixed alphabet, free picture.
  • Exact overprint arithmetic: flat ink layers composited by integer multiply (a·b+127)//255 with no anti-aliasing, so every pixel in the output is provably white, a lone ink, or a pairwise product. The audit verified this arithmetic to the integer on the real identity; the generator preserves it as a whole-image invariant that tests assert directly.
  • GroundTruth records primitives, cells, inks, overlap pairs and per-type counts (the future primitive_frequency_mix measurement, SI-008).
  • SPEC-ISSUES: SI-018 (composition/density model is dialect freedom), SI-019 (overprint depth capped at 2 to keep the colour invariant exact).

Tests

15 new measurement-based tests (grid autocorrelation at M, stripe run-lengths, exact multiply on every recorded overlap, whole-image colour invariant, determinism). Full suite: 88 passed.

Sample render (12×8 cells, module 72, seed 0): all five primitives, six-ink subset, 16 overlap pairs, multiply products visible where inks cross.

…ly overprint

- generator/grid.py: five sheet-driven primitives on the module grid, seeded
  free composition (audit 002 §3 dialect space), 4-6 ink subsets from the
  master set
- overprint composited by integer multiply (a*b+127)//255 in flat layers, no
  anti-aliasing, so every output colour is provably white, an ink, or a
  pairwise product — the audit's self-verifying arithmetic, byte-checkable
- overprint depth capped at 2 (SI-019); composition/density model recorded
  as dialect freedom (SI-018)
- GroundTruth records primitives, inks, overlaps and the primitive counts
  that will become the primitive_frequency_mix measurement
- 15 measurement-based tests; 88 total green
@jamesdward
jamesdward merged commit 841e14e into main Jul 6, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant