Skip to content

web: follow the tile57 display_priority property rename#53

Merged
beetlebugorg merged 5 commits into
mainfrom
feat/display-priority-abi
Jul 22, 2026
Merged

web: follow the tile57 display_priority property rename#53
beetlebugorg merged 5 commits into
mainfrom
feat/display-priority-abi

Conversation

@beetlebugorg

Copy link
Copy Markdown
Owner

tile57 renamed the MVT paint-order properties: draw_prio -> display_priority,
cat -> display_category, and added display_plane (S-101 DisplayPlane, emitted
only when OverRadar). The client reads these keys directly, so it has to move
with them.

Three live reads plus one inspector label:

  • chart-style.mjs fill-sort-key on the areas layer
  • chartplotter.mjs pick-report comparator
  • s52-style.mjs display-category membership filter
  • dev-tools.mjs feature-inspector value formatting

The Go side needs no change: chartplotter uses the bake and metadata APIs, not
the draw-callback surface, and tile57.Feature (S-57 metadata) has none of the
renamed fields. go test ./... and make build are clean.

Re-vendored style-engine.wasm — it is built from tile57's style engine and had
the old key names compiled in, so a stale binary would emit draw_prio while the
JS read display_priority. Verified end-to-end by baking testdata through
chartplotter bake and decoding a z12 tile: display_priority and
display_category present, zero draw_prio or cat.

NOT included: the tile57 submodule pin. The engine commit carrying this rename
is not on main yet, so the pin stays where it is rather than recording a
reference nobody else can resolve.

Two things to know before this merges:

CI floats the submodule (git submodule update --remote tile57, ci.yml:32) and
ignores the pin, so it builds against tile57 main. Until the rename lands there,
CI on this branch is GREEN BUT WRONG — Go tests never touch the property keys,
and the style expressions coalesce a missing display_priority to 0, so the chart
renders at a single flat priority instead of failing.

Baked archives must be rebaked; old tiles carry the old keys and fail the same
silent way. make clear-cache then bake-ienc / bake-noaa — note both targets
skip when the output file already exists, so a stale archive persists unless
deleted.

display_plane is carried in the tiles but not yet honoured in layer ordering.
It outranks display_priority per S-52 §10.3.4.2, and chartplotter encodes paint
order as MapLibre layer sequence, so respecting it is a behaviour change rather
than part of this rename.

tile57 renamed the MVT paint-order properties: draw_prio -> display_priority,
cat -> display_category, and added display_plane (S-101 DisplayPlane, emitted
only when OverRadar). The client reads these keys directly, so it has to move
with them.

Three live reads plus one inspector label:
  - chart-style.mjs  fill-sort-key on the areas layer
  - chartplotter.mjs pick-report comparator
  - s52-style.mjs    display-category membership filter
  - dev-tools.mjs    feature-inspector value formatting

The Go side needs no change: chartplotter uses the bake and metadata APIs, not
the draw-callback surface, and tile57.Feature (S-57 metadata) has none of the
renamed fields. `go test ./...` and `make build` are clean.

Re-vendored style-engine.wasm — it is built from tile57's style engine and had
the old key names compiled in, so a stale binary would emit draw_prio while the
JS read display_priority. Verified end-to-end by baking testdata through
`chartplotter bake` and decoding a z12 tile: display_priority and
display_category present, zero draw_prio or cat.

NOT included: the tile57 submodule pin. The engine commit carrying this rename
is not on main yet, so the pin stays where it is rather than recording a
reference nobody else can resolve.

Two things to know before this merges:

CI floats the submodule (`git submodule update --remote tile57`, ci.yml:32) and
ignores the pin, so it builds against tile57 main. Until the rename lands there,
CI on this branch is GREEN BUT WRONG — Go tests never touch the property keys,
and the style expressions coalesce a missing display_priority to 0, so the chart
renders at a single flat priority instead of failing.

Baked archives must be rebaked; old tiles carry the old keys and fail the same
silent way. `make clear-cache` then bake-ienc / bake-noaa — note both targets
skip when the output file already exists, so a stale archive persists unless
deleted.

display_plane is carried in the tiles but not yet honoured in layer ordering.
It outranks display_priority per S-52 §10.3.4.2, and chartplotter encodes paint
order as MapLibre layer sequence, so respecting it is a behaviour change rather
than part of this rename.
tile57's compose ABI now finds/reuses/rebuilds the ownership partition
beside the archives itself (compose_open/compose_tree dropped partition_path;
compose_save_partition is gone). Drop all the host-side sidecar plumbing:
NewComposer no longer takes a partitionPath, Composer.SavePartition and
livePartitionPath are deleted, bake.go stops writing partition.tpart, and
openLiveComposer just opens — no load, no save. Fixes the StalePartition
dance that forced a blocking owned-face rebuild at boot on an engine bump.

Bumps the tile57 submodule to origin/main (2c36da6, PR #31 label-cache).
Bake pre-warm and the live provider opened a compositor over an explicit
slice of per-cell archives, round-tripping tile57_chart_open across cgo once
per archive (~35 ms each) — on a national library that turned boot
registration into a minute of chart_open churn.

Route both through NewComposerTree (tile57 OpenComposeTree): one engine call
walks, mmaps and composes the whole tree on the batch path. The ownership
partition is still the engine's — found beside the archives, reused when it
matches, rebuilt when not. Registration measured 60 s -> 7 s.

Share the Composer construction between the two openers via newComposerFrom.
The prior commit routes bake pre-warm and the live provider through
tile57.OpenComposeTree, but the pinned engine (2c36da6) predates it, so the
CI cross-build failed: undefined: tile57.OpenComposeTree. Float the submodule
to main (b0e1b30, PR #32 merged), where the batch compose-tree open lands.
…gine's

TestImportPacks stat'd <setDir>/partition.tpart, a host-written contract from
before the ownership partition moved into the engine (OpenComposeTree). The
engine now writes the sidecar only during a bake, beside the archives, and the
compose-open path merely refreshes an existing one; the host neither writes nor
reads it, so there is nothing at setDir to assert on.
@beetlebugorg
beetlebugorg merged commit 09c7d59 into main Jul 22, 2026
3 checks passed
@beetlebugorg
beetlebugorg deleted the feat/display-priority-abi branch July 22, 2026 02:17
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