glyphs: Greek-range invariant test keeps R7 green for onboarding Greece #175

Merged
art merged 1 commit from issue-173-greece-glyphs into main 2026-08-19 23:45:56 +00:00
Owner

Greece glyphs: keep R7 green with a Greek-range invariant test

Closes #173.


What and why

Greece is the first non-Latin country to onboard (issue #44/#172), so R7 — "verify glyph
coverage before onboarding" — becomes a real go/no-go rather than a formality. The embedded
Go font was already de-risked (the modern-Greek block U+0370-03FF is present, including the
tonos vowels modern place names use). This change turns that one-off inspection into the
test that keeps it green, so a future font replacement cannot silently drop Greek.

Changes

  • mapsrv/glyph_check_test.go — TestGreekGlyphInvariants, mirroring the existing
    ASCII TestSupersampledGlyphInvariants exactly: generate the range starting at 0x300
    (which carries U+0370-03FF) with the real NewGenerator(), and for each needed
    codepoint assert (a) a correctly-sized bitmap (the (w+6)(h+6) SDF-buffer invariant),
    (b) a full gradient (min ≤ 64, max ≥ 192 — deep inside to deep outside), and
    (c) a smooth field (maxAdjStep ≤ 64 — no hard edge, so the downsampling is working).
    The codepoints asserted are the modern-Greek set Greek names actually use: the seven
    tonos vowels U+03AC-03CE (ά έ ή ί ό ύ ώ) and the capitals Σ/Α/Ω/Π/Ρ.
  • docs/country-requirements.md — R7's example now names Greece as the first
    non-Latin case, cites the test, and adds a *Check:* line pointing at it.

Verification

Unit test — go test -run TestGreekGlyphInvariants ./mapsrv/ passes: all 12 codepoints
produce real glyphs with valid SDF gradients, e.g. U+03AC 13x21, min=0 max=224 maxAdjStep=34, U+03CE 17x21, min=0 max=231 maxAdjStep=34. make test (importer,
mapsrv, stylegen) is fully green.

Visual render over CDP (R127 — no --virtual-time-budget) — Greece data is not yet
imported, so I could not render Greek map features. Instead I drove the live font
stack
the map actually uses: a scratch MapLibre page served by mapsrv loads glyphs from
/fonts/Go Regular/768-1023.pbf (the Greek block, confirmed 200) and places the sample
names Αθήνα, Θεσσαλονίκη, Πειραιάς, Κρήτη, Αιγαίο Πέλαγος, Ολυμπία, Δελφοί, Σπάρτη. I drove
Chrome over CDP in real time (scripts/gr-glyph-cdp.mjs, the R127 pattern from
docs/performance.md): the map reported ready, all 8 labels rendered (queried via
queryRenderedFeatures), the Greek glyph range fetched 200, no glyph load failures, and
the only console error was a 404 for favicon.ico (not a glyph). The screenshot was
verified with the local vision model (Qwen2.5-VL-3B): it read the Greek labels correctly
and, on the negative control, reported no hollow/tofu missing-glyph boxes. Screenshot
at /tmp/gr-glyph.png (test run).

Remaining / uncertain:

  • The visual render was against a synthetic label page using the live font stack, not
    against Greek map features, because Greece is not imported yet. The on-map confirmation
    lands with the pilot (#172). The CDP driver (scripts/gr-glyph-cdp.mjs) and the test
    page (html/gr-glyph-test.html) are committed so the render is reproducible.
  • docs/country-gr.md does not exist on main (it lives on the unmerged issue-171
    branch). Per the issue's "once it exists", I recorded the verdict in R7 and will append
    the glyph note to docs/country-gr.md when that branch lands. R7 currently points to
    it.
  • Note: this checkout shares the working tree with a concurrent worker on the issue-172
    pilot branch. Its untracked conf/gr/ files are not part of this PR.
# Greece glyphs: keep R7 green with a Greek-range invariant test Closes #173. --- ## What and why Greece is the first non-Latin country to onboard (issue #44/#172), so R7 — "verify glyph coverage before onboarding" — becomes a real go/no-go rather than a formality. The embedded Go font was already de-risked (the modern-Greek block U+0370-03FF is present, including the tonos vowels modern place names use). This change turns that one-off inspection into the test that keeps it green, so a future font replacement cannot silently drop Greek. ## Changes - **`mapsrv/glyph_check_test.go`** — `TestGreekGlyphInvariants`, mirroring the existing ASCII `TestSupersampledGlyphInvariants` exactly: generate the range starting at 0x300 (which carries U+0370-03FF) with the real `NewGenerator()`, and for each needed codepoint assert (a) a correctly-sized bitmap (the `(w+6)(h+6)` SDF-buffer invariant), (b) a full gradient (`min ≤ 64`, `max ≥ 192` — deep inside to deep outside), and (c) a smooth field (`maxAdjStep ≤ 64` — no hard edge, so the downsampling is working). The codepoints asserted are the modern-Greek set Greek names actually use: the seven tonos vowels U+03AC-03CE (ά έ ή ί ό ύ ώ) and the capitals Σ/Α/Ω/Π/Ρ. - **`docs/country-requirements.md`** — R7's example now names Greece as the first non-Latin case, cites the test, and adds a `*Check:*` line pointing at it. ## Verification **Unit test** — `go test -run TestGreekGlyphInvariants ./mapsrv/` passes: all 12 codepoints produce real glyphs with valid SDF gradients, e.g. U+03AC `13x21, min=0 max=224 maxAdjStep=34`, U+03CE `17x21, min=0 max=231 maxAdjStep=34`. `make test` (importer, mapsrv, stylegen) is fully green. **Visual render over CDP (R127 — no `--virtual-time-budget`)** — Greece data is not yet imported, so I could not render Greek *map* features. Instead I drove the **live font stack** the map actually uses: a scratch MapLibre page served by mapsrv loads glyphs from `/fonts/Go Regular/768-1023.pbf` (the Greek block, confirmed `200`) and places the sample names Αθήνα, Θεσσαλονίκη, Πειραιάς, Κρήτη, Αιγαίο Πέλαγος, Ολυμπία, Δελφοί, Σπάρτη. I drove Chrome over CDP in real time (`scripts/gr-glyph-cdp.mjs`, the R127 pattern from `docs/performance.md`): the map reported ready, all 8 labels rendered (queried via `queryRenderedFeatures`), the Greek glyph range fetched `200`, no glyph load failures, and the only console error was a 404 for `favicon.ico` (not a glyph). The screenshot was verified with the local vision model (Qwen2.5-VL-3B): it read the Greek labels correctly and, on the negative control, reported **no hollow/tofu missing-glyph boxes**. Screenshot at `/tmp/gr-glyph.png` (test run). **Remaining / uncertain:** - The visual render was against a synthetic label page using the live font stack, not against Greek map features, because Greece is not imported yet. The on-map confirmation lands with the pilot (#172). The CDP driver (`scripts/gr-glyph-cdp.mjs`) and the test page (`html/gr-glyph-test.html`) are committed so the render is reproducible. - `docs/country-gr.md` does not exist on main (it lives on the unmerged `issue-171` branch). Per the issue's "once it exists", I recorded the verdict in R7 and will append the glyph note to `docs/country-gr.md` when that branch lands. R7 currently points to it. - Note: this checkout shares the working tree with a concurrent worker on the issue-172 pilot branch. Its untracked `conf/gr/` files are not part of this PR.
The embedded Go font already carries the modern-Greek block (U+0370-03FF,
including the tonos vowels), so R7 for Greece was a green light — but only as a
one-off inspection of the cmap. Turn it into the test that keeps it green.

TestGreekGlyphInvariants mirrors the existing ASCII invariant test exactly,
using the real NewGenerator(): for each codepoint the modern-Greek place, road
and water names actually use — the seven tonos vowels U+03AC-03CE and the
capitals Sigma/Alpha/Omega/Pi/Rho — it generates the range starting at 0x300
(which carries U+0370-03FF) and asserts a correctly-sized bitmap, a full SDF
gradient (deep inside to deep outside), and a smooth downsampled field with no
hard edge. A font replacement that drops the Greek block or breaks the SDF
pipeline now fails `make test`.

Verification: the new test passes for all 12 codepoints (e.g. U+03AC 13x21,
min=0 max=224 maxAdjStep=34; U+03CE 17x21, min=0 max=231). make test is fully
green across importer/mapsrv/stylegen. Visual render over CDP in real time
(R127, no --virtual-time-budget): Greece data is not imported yet, so a scratch
MapLibre page served by mapsrv pulls glyphs from the live /fonts/ stack (the
Greek block 768-1023.pbf returns 200) and places the sample names; driven over
CDP (scripts/gr-glyph-cdp.mjs) all 8 labels rendered, no glyph load failures,
and the local vision model reported the Greek labels legible with no
tofu/missing-glyph boxes (negative control). docs/country-requirements.md R7
names Greece as the first non-Latin case and cites the test; the note in
docs/country-gr.md lands with that file (issue #171).
art merged commit 323a575d9d into main 2026-08-19 23:45:56 +00:00
art deleted branch issue-173-greece-glyphs 2026-08-19 23:45:57 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
art/ismap!175
No description provided.