R30's shared-layer lists are hand-maintained and have drifted: airports/airport_points missing since #149 #201

Open
opened 2026-08-20 21:53:54 +00:00 by art-bot · 0 comments
Collaborator

R30's two acceptance tests in conf/shared/acceptance.yaml enumerate the shared
layers by hand, and the list has drifted out of date twice without anyone
noticing. airports and airport_points have been missing since #149 folded
them in.

What is missing

There are 18 shared contracts, 17 of them non-internal and therefore tile
layers. R30 has two halves, and neither covers all 17:

The floor half ("a request below a layer's floor returns an empty tile",
26 checks) is missing airports and airport_points entirely — neither
the z2 global-floor row nor the stop_z-1 row. Both have a deliberate stop_z
above the global min_zoom (airports 10, airport_points 8), so both belong in
the second group the test's own comment describes: "the layers whose floor is a
deliberate stop_z above the global one … the zoom just under that stop_z, so the
layer's OWN floor is exercised rather than only the global one".

The ceiling half ("a request above maxz serves the maxz table", 14 checks) is
missing airports, airport_points, contours and peaks.

Not hiding a bug

Measured against the current database, the four missing floor rows all return
0 bytes — they would pass as written:

check bytes
zxy_map_airports(2,0,0) 0
zxy_map_airports(9,0,0) 0
zxy_map_airport_points(2,0,0) 0
zxy_map_airport_points(7,0,0) 0

So this is missing coverage, not a live failure. The floor half is a four-line
fix. The ceiling half is more work per layer: each row needs a tile where that
layer provably draws at maxz, measured live (the existing rows are a Stockholm
z15, a Tornio–Haparanda border tile, the Dalälven rapids, and so on), so
airports/airport_points/contours/peaks each need a tile picked and measured.

The thing actually worth fixing

The list is hand-maintained in a project whose shared-layer design is otherwise
"the catalogue knows what exists". Every fact these rows encode — the function
name, the stop_z, the maxz — is already declared in
conf/shared/contracts/*.yaml, which is why R119/R120 could become catalogue
queries that cover whatever countries exist. R30 is the check that did not make
that move, and it drifts once per fold: #149 added airports and airport_points
and neither reached the list; #151/#152 added contours and peaks and only the
floor half was updated (in !199, and only because the same PR was already
editing the test to drop zxy_is).

Two options:

  1. Generate the floor half from the contracts. The importer knows every
    shared layer's stop_z and min_zoom; it could emit the z2 and stop_z-1
    rows rather than have them typed. A new contract then inherits the check the
    way it inherits R119.
  2. Keep it hand-written but make omission fail. A companion check that the
    set of zxy_map_* functions in pg_proc equals the set the R30 rows name —
    so a layer added without a row fails R30 instead of silently not being
    covered.

The ceiling half probably cannot be fully generated (picking a tile where a
layer draws is a judgement about the data), but it could at least be made to
fail loudly when a layer has no row.

Notes

  • Found in review of !199 (#152); the four floor rows for contours/peaks landed
    there, the airports pair did not, as it is outside that issue.
  • Related: #200, the R119 catalogue check that passes vacuously on a missing
    partition. Same shape of problem — a check that enumerates less than it claims.
R30's two acceptance tests in `conf/shared/acceptance.yaml` enumerate the shared layers by hand, and the list has drifted out of date twice without anyone noticing. `airports` and `airport_points` have been missing since #149 folded them in. ## What is missing There are 18 shared contracts, 17 of them non-`internal` and therefore tile layers. R30 has two halves, and neither covers all 17: **The floor half** ("a request below a layer's floor returns an empty tile", 26 checks) is missing **`airports`** and **`airport_points`** entirely — neither the z2 global-floor row nor the stop_z-1 row. Both have a deliberate `stop_z` above the global `min_zoom` (airports 10, airport_points 8), so both belong in the second group the test's own comment describes: "the layers whose floor is a deliberate stop_z above the global one … the zoom just under that stop_z, so the layer's OWN floor is exercised rather than only the global one". **The ceiling half** ("a request above maxz serves the maxz table", 14 checks) is missing **`airports`**, **`airport_points`**, **`contours`** and **`peaks`**. ## Not hiding a bug Measured against the current database, the four missing floor rows all return 0 bytes — they would pass as written: | check | bytes | |---|---| | `zxy_map_airports(2,0,0)` | 0 | | `zxy_map_airports(9,0,0)` | 0 | | `zxy_map_airport_points(2,0,0)` | 0 | | `zxy_map_airport_points(7,0,0)` | 0 | So this is missing coverage, not a live failure. The floor half is a four-line fix. The ceiling half is more work per layer: each row needs a tile where that layer provably draws at maxz, measured live (the existing rows are a Stockholm z15, a Tornio–Haparanda border tile, the Dalälven rapids, and so on), so airports/airport_points/contours/peaks each need a tile picked and measured. ## The thing actually worth fixing The list is hand-maintained in a project whose shared-layer design is otherwise "the catalogue knows what exists". Every fact these rows encode — the function name, the `stop_z`, the `maxz` — is already declared in `conf/shared/contracts/*.yaml`, which is why R119/R120 could become catalogue queries that cover whatever countries exist. R30 is the check that did not make that move, and it drifts once per fold: #149 added airports and airport_points and neither reached the list; #151/#152 added contours and peaks and only the floor half was updated (in !199, and only because the same PR was already editing the test to drop `zxy_is`). Two options: 1. **Generate the floor half from the contracts.** The importer knows every shared layer's `stop_z` and `min_zoom`; it could emit the z2 and stop_z-1 rows rather than have them typed. A new contract then inherits the check the way it inherits R119. 2. **Keep it hand-written but make omission fail.** A companion check that the set of `zxy_map_*` functions in `pg_proc` equals the set the R30 rows name — so a layer added without a row fails R30 instead of silently not being covered. The ceiling half probably cannot be fully generated (picking a tile where a layer draws is a judgement about the data), but it could at least be made to fail loudly when a layer has no row. ## Notes - Found in review of !199 (#152); the four floor rows for contours/peaks landed there, the airports pair did not, as it is outside that issue. - Related: #200, the R119 catalogue check that passes vacuously on a missing partition. Same shape of problem — a check that enumerates less than it claims.
art-bot self-assigned this 2026-08-20 21:53:54 +00:00
Sign in to join this conversation.
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#201
No description provided.