gap: the level-crossing rail gate passes every tile, because rail is a Shortbread attribute key #236
Labels
No labels
agent
agent:ci
agent:done
agent:failed
agent:needs-input
agent:refined
agent:refining
agent:running
agent:shipped
agent:skip
autonomous
autopilot
driven
local
plan
proposal
qa
qa-gap
research
retro
ship
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
jeroen/cartopolis#236
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What I did
Measured the second of the layer's three fetch gates over real tiles, the way
docs/notes/prorail-level-crossings.md's own table samples cells: 64 z14 tiles coveringGroningen (
8486..8493×5316..5323) fromtiles.cartopolis.org, testing eachundecoded body with
body_mentions_rail's needles, against one bbox query of theoverwegregister bucketed back into cells.What happened
The gate passes every tile. Not most — all of them, including the note's own railless
control cell:
0x1ais field 3 of an MVTLayer— the key table. Shortbread'sstreetslayerdeclares an attribute called
rail, so the four bytesrailare in the key table ofevery
streetslayer ever emitted, whether or not a single feature in the tile is arailway.
body_mentions_railtherefore answerstruefor every populated tile on Earth.The layer's module note says the trade is "a street named 'Railroad Avenue', a POI
called 'Tramhalte' or an attribute key nobody here reads all match too … Each of those
costs one request that comes back with no crossings in it". The attribute key is not an
occasional false positive: it is all of them, always.
What a user would expect
Nothing visible — the layer draws correctly and the envelope still keeps the requests
inside the Netherlands. What a maintainer would expect is that the gate the module
opens with ("Three gates before a request is made … Most of the planet is neither Dutch
nor railed, and an empty answer still costs a round trip and ~0.8 KB") does some of that
work. It does none: the envelope and the Furniture toggle are the only two gates there
are, and every Dutch z14 cell the camera visits sends a PDOK request that comes back
empty roughly nine times in ten.
This is the same shape as #212, on a different gate in a different layer.
Why the test does not catch it
vector_tiles::tests::the_rail_probe_reads_a_kind_value_in_an_undecoded_bodybuilds itsnegative case with
synth::tagged_line_layer("streets", …, ("kind", "residential"), …),whose key table holds exactly one key:
kind. A real Shortbreadstreetslayer's keytable holds
bridge,tunnel,rail,link,oneway_reverse,bicycle,surfaceand the rest. The synthetic tile is not shaped like a real one on the one dimension the
probe reads, so the test asserts the opposite of what production sees.
Where the seam is
crates/geo/src/vector_tiles.rs::body_mentions_railandRAIL_HINTS. A byte searchcannot distinguish a key table from a value table, so either the probe has to move after
the parse (which
systems::crossings' module note explains it cannot — the fetch decisionis made before the decode, ADR-033) or the gate should be dropped and the note corrected
to say the envelope is what bounds this layer.
body_mentions_water, which reads a layername rather than an attribute key, is not affected by this and is worth keeping as the
counter-example.
Filed from the QA pass on #216 (#230).