# Filming our own product finds bugs our tests miss

Making the help videos meant driving MapMap on camera exactly as a new customer would, with nothing mocked and nothing pre-warmed. Across those sessions we logged 21 distinct product defects that every test suite we own had missed. All 21 now have a fix merged, across twelve pull requests. The ledger below still splits them into the eleven fixed first and the ten that took a second wave, because for a stretch of days half of this list was broken in production while we wrote about it, and blurring that would be the opposite of what filming is for.

## What does filming catch that a test suite does not?

A test asserts that a code path is correct. A recording asserts that the path a stranger takes exists at all: on a clean machine, in the order the documentation gives it, with the defaults the package ships, and with whatever a live dependency happens to be doing at the moment you point a camera at it.

Those are different claims, and only one of them can be made by code you wrote to reassure yourself. The web SDK had 351 passing tests when its blank-map fix landed, and not one of them called `createMap` with no `territoryTilesUrl` against the real CDN, because a unit test does not fetch a planet-scale tile archive. The self-host suite ran against a Compose file already primed with tiles from a previous run, so the cold-start branch, the only branch a new customer takes, was never the branch under test.

There is a second effect, and it changes behaviour rather than coverage. Because the camera is rolling, a defect cannot be quietly worked around. On a normal debugging afternoon you set `territoryTilesUrl` yourself, get a map and move on with the defect still in the box. On camera the workaround is the confession, so the fix goes in.

## Which defects were fixed first?

Eleven, across six merged pull requests.

| Defect | PR |
| --- | --- |
| The self-host stack crash-looped on a stock `docker compose up`. Four variables in our Compose file belonged to a scripted image archived in March 2026, so the binaries-only image we pin ignored all four, ran `bash` and exited | #220 |
| `@mapmap/maps` 0.5.0 shipped a default basemap URL with no file behind it, so `createMap` on its own defaults drew a blank map | #221 |
| A 404 on the basemap source produced no error and no warning, so the blank map came with no diagnostic at all | #221 |
| The bus archive script had no `curl -L`. The publisher moved the bulk endpoint behind a 302, so it wrote 0 bytes a minute for 7 h 19 m and exited 0 every time | #339 |
| Departure boards in the 3D scene clipped the destination at a fixed 15 characters, so "Waterloo Station" overprinted the time column | #339 |
| A zero frame delta became a 16 ms advance, so ambient traffic moved on a repeat render at an unchanged clock | #339 |
| Route chevrons ran on a 90 ms wall-clock interval rather than the scene clock, so a frame-stepped capture stuttered | #339 |
| The Map Health page promised answers "in minutes" directly above a 97.6 h median, because the median counted a report filed eight days before the triage agent existed | #342 |
| `verify_places` was documented on `/docs/api-reference` only, and absent from `/docs/mcp` and `/agents`, the two surfaces agent developers read | #342 |
| `GET /timezone` had answered `501 timezone-not-enabled` in production ever since it shipped. The data was on the box the whole time, unmounted and unenumerated | #343 |
| A published article's own worked example returned `414`. Its polyline was 7,543 characters against an 8,000-byte query-string cap | #344 |

## Which defects took a second wave?

Ten, across six further pull requests. When the first draft of this post was written, none of these had landed and every one was live in production; all six merged by 2 August 2026.

| Defect | PR |
| --- | --- |
| Every `#anchor` link into a docs or news body landed at the top of the page, because rendered headings carried no `id` | #345 |
| `/.well-known/agent-terms.json` and our outbound copy still declared 17 MCP tools, when a `tools/list` handshake against the hosted server was already returning more | #345 |
| The Map Health page told agents to file issues with the MCP `report_map_issue` tool. That tool appended to a local NDJSON queue and had never reached the board | #346 |
| `?style=` never restyled the 3D corridor's roads. The code wrote the derived colour to a layer id `road`, and none of the compiled style's 53 layers is called that | #349 |
| A theme published with no `palette` key threw inside `resolvePalette`, and the entire restyle vanished behind a catch, on a 200 | #349 |
| `POST /centroid` reported every leg duration at very nearly half its true value, and the final manoeuvre as a negative number | #350 |
| The MCP `geocode` tool put no `lang` on the wire, so 10 of 20 English exonyms resolved to the wrong country | #351 |
| A single accented word panicked the gateway before either geocoding backend was reached, surfacing as a bare, empty-bodied 502 | #351 |
| `/matrix` and `/route` disagree by up to 9.4% on long legs, and `/matrix` is always the longer of the two | #352 |
| `/matrix` did not apply the snap filter `/route` has always applied, so one coordinate could correlate onto a different edge depending on which endpoint you asked | #352 |

## Why is the matrix divergence the serious one?

Because it is the only defect on this list that quietly changes a number a customer is shown. On the production graph, in `auto` costing, the same coordinate pair came back 189,391 m from `POST /route` and 207,226 m from `POST /matrix`: a gap of 17,835 m, or 9.4%. Reverse the pair and the two agree to 6 m. In a 5 by 5 grid the same target measured 207,226 m from one source and 190,617 m from another, so the error is per-pair, not per-location.

The cause is upstream and structural. `/route` runs a bidirectional A-star that extends on a cost bound. `/matrix` runs `CostMatrix`, which freezes a pair's answer a bounded number of edge pops after its first connection, defaulting to 2,800. A 190 km journey needs far more than that before the meeting point is provably optimal, so the pair keeps an upper bound. That is why `/matrix` is never the shorter one.

It matters beyond the [matrix endpoint](/news/matrix-api) because `search_along_route` prices every detour from a matrix. On one London to Birmingham run, the same coffee stop came back at 6.8 minutes with 25 candidates costed and fell outside an 8 minute budget with 14, because interleaved expansion froze the pairs at different bounds. That result is also internally incoherent: 6.8 minutes beside 17.01 km, because distance and duration froze separately. An agent quoting a detour to a driver would have quoted whichever answer the batch size happened to produce.

The merged PR did not fix the engine. It applied the snap parity fix, named the divergence and shipped a regression gate, so it became a known property of the endpoint rather than a silent one. Every candidate engine-side fix changes the performance envelope of a live routing service, so each wants a benchmark first, and the engine-side divergence is still open upstream. Treat a matrix cell on a long leg as an upper bound, and ask `/route` for the one journey you are going to quote.

## Why did one accented word return an empty 502?

Because our own gateway panicked before either geocoding backend was reached. `is_code_query` decides whether a query is an exact postal code, and it ran its length checks and its outward and inward split on byte offsets. `Köln` is four characters in five bytes, so the split at byte 2 landed inside the `ö`, and `str::split_at` panics on a non-character boundary. The handler unwound, the connection was dropped with no response, and the edge turned that into a bare 502.

That accounts for every symptom that had looked arbitrary: empty body, no `x-request-id` because the gateway never got as far as writing one, and `limit`, `bbox`, `bias` and `lang` all ignored, because this runs before any of them are used. Running the old function verbatim over the 19 reported strings reproduces the split 19 times out of 19. `Köln`, `Genève`, `Rhône` and `Sète` panic; `München`, `Zürich`, `Malmö` and `Kölln` do not. It was never about diacritics. It was about whether `len() - 3` happened to land on a character boundary, which is why adding any character to the query made the problem disappear.

The same PR carries the second geocoding defect from that session: the MCP tool sent no `lang`, so an agent asking for Munich got Munich, North Dakota, and one asking for Geneva got Geneva, Alabama. Ten of 20 English exonyms landed in the wrong country. The [geocoding write-up](/news/geocoding) covers what the endpoint does when it is working.

## Why did /centroid report exactly half the truth?

Because upstream discounts the whole path when it means to discount one edge. `POST /centroid` finds the point where several journeys converge, and the convergence point sits at the mid point of the meeting edge, so each path should be charged half of that final edge. The engine subtracts half of `elapsed_cost` instead, and `elapsed_cost` is cumulative from the origin.

Measured on production, three locations converging on one point, the ratios were 1.9968, 1.9966 and 1.9975 against the same journeys asked of `/route`. Lengths matched to the metre, because only the duration is adjusted. The final manoeuvre came back at minus 645.893 s. Nobody had caught it because the wrong and the right expression coincide when a path has exactly one edge, and upstream's only centroid test uses one edge per participant.

There is no honest fix on our side of the wire: inverting the arithmetic needs the transition cost, and that is never serialised, so a multiplier in the gateway would have been a guess dressed as a correction. The fix is an engine patch, offered upstream, and it reached production when the engine image was rebuilt and the box cut over. Re-measured after the cutover, a convergence leg and the same journey asked of `/route` agree to a fraction of a second: the ratio that read 1.9968 now reads 1.0000.

## What did the same sessions find outside the 21?

Four more findings from the same sessions had no PR in this ledger. Listing them is the point of the exercise rather than an embarrassing footnote, and on 25 November 2026 we re-checked where each one stands.

- **Route optimisation was off on our own deployment for the whole filming period.** `optimise_routes`, `order_stops` and `plan_day` with optimisation enabled all answered 503, because `SN_VROOM_URL` was unset. That is documented behaviour without the solver sidecar, and it meant one planned help video could not be made at all. The sidecar has since been deployed, and `POST /optimise` answers 200.
- **`verify_places` free text can be confidently wrong.** That path attaches no locality and runs no feasibility pass, so a bare name is searched against the whole world: "Hop" with no locality still verifies against a neighbourhood near Bergen. Treat its verdicts as a prompt to re-check, not an answer, and pass structured claims with a `locality` when the answer matters.
- **MapMap Studio had four observational findings when this ledger closed**, none with a fix in flight at the time. Studio has been redesigned since, and we have not re-tested them against the current build, so we are not listing them as open defects.
- **`policy.country` on `POST /v1/cameras/along` reported `GB` for corridors nowhere near Great Britain**, with `mode: exact`, on an empty camera array. That has since been fixed: the field now falls back to the route's own country, and a Paris route answers `{"country": "FR", "mode": "omitted"}`.

We also retracted one finding on re-measurement. The Studio banner height slider looked like a no-op over most of its range; it is not, and the number it reports is correct given that the default is `auto` and the pill's natural height already exceeds the bottom of the range. A ledger that only ever grows is not a ledger.

## What this does not prove

- **Twenty-one defects is not a claim about quality.** It is a claim about a method. It tells you these 21 were wrong, and nothing about the rest of the defaults, the rest of the feeds or the rest of the engine.
- **Merging was never shipping, and the ledger proved it.** Two of the fixes were engine patches that did nothing until the engine image was rebuilt and the box cut over, which has since happened. And one entry is fixed in the honest rather than the flattering sense: the matrix divergence is documented and gated as an upper bound, not eliminated from the engine.
- **Fixing these broke the films.** Three finished videos stated their bug on camera as an honest limitation, so landing the fix made each of those films false the day it deployed. Honesty on camera has a maintenance cost: a film that names a defect has to be re-cut when the defect goes.
- **Filming does not scale as a test.** It is slow, manual and expensive, and it catches one class of fault: cold start, first run, the documented path, and whatever a live dependency is doing right now. It replaces nothing.
- **This post has been re-titled twice.** It began as two bugs, became three, and is now a ledger with no number in the headline, because the number kept moving faster than the copy.

## Try it

The path is the test. Run `docker compose up -d` from the distro directory with `VALHALLA_TILE_URLS` set to a Geofabrik extract, and time yourself to a first route: the [self-host guide](/docs/self-host) has the sizing table and the offline proof. For the map, install `@mapmap/maps` and call `createMap` with nothing but a container, which is the case that broke and is now the case we watch. The [quickstart](/docs/quickstart) covers it end to end, and the [web maps SDK write-up](/news/web-maps-sdk) explains what that package is.

If your own product has a documented first five minutes, record someone doing it on a clean machine. Not a screencast narrated from memory, a real run. It is the cheapest audit available, and it found us a defect in a [published article's own example](/news/static-map-images) that we had read a dozen times. If any part of what you show is live, film that part too. Monitoring asks whether a system is up. A camera asks whether it is showing you anything, and those turned out to be different questions.

Bus data: DfT Bus Open Data Service, Open Government Licence v3.0. Routing derives from OpenStreetMap. Credit "© OpenStreetMap contributors" when you render or republish it.
