The Heading Fallback That Never Times Out
The most expensive bug in our pedestrian stack was one YAML key that every reviewer read as correct. The wearable profile still said heading_coast_ms after the loader had moved to heading_coast_s. The parser ignored the unknown key and applied a default of zero, and zero meant unlimited. From that release on, whenever the magnetometer was gated out near steel or a motor, heading coasted on the gyroscope indefinitely while still reporting full confidence to the micro-router.
The fallback is where the real system lives
Step-and-heading navigation is a chain of estimates, and it only works because each link can report doubt. The magnetometer gate rejects samples whose field norm or dip angle no longer matches the local Earth model. The gyro then carries heading alone, and the coast window limits how long that unaided integration may be trusted before the fusion layer lowers heading confidence and the map-matcher widens its candidate set. Remove that limit and nothing crashes. The step detector keeps counting, the barometer keeps resolving floors, and the router keeps snapping the user onto whichever corridor the drifting gyro points at, which is how you get the recurring ticket about the blue dot walking through a wall in the parking garage.
How it got past review
The diff was correct in every file the reviewer opened. The refactor renamed the key, converted the phone profile, and added a unit test asserting that heading_coast_s parses to 30 s, the value we ship. The wearable profile lived in another directory, matched no glob in the review tool, and still parsed cleanly because the loader had been written to tolerate unknown keys for forward compatibility. Replay tests passed as well, because the regression suite was built from clean walks through offices where the magnetometer gate rarely fires, so the coast path never ran long enough to matter. Test and evaluation standards for localization systems, such as ISO/IEC 18305, describe magnetically hostile scenarios, but a suite that cites them without running the disturbed cases only tests the happy path with more paperwork.
A check you can run on today's telemetry
Pull the per-epoch fusion log for last week's field sessions. For each session, compute the longest continuous interval in which the magnetometer gate state is rejected while published heading confidence stays at its nominal level. Any interval longer than the coast window your config claims proves that the effective configuration on the device differs from the one in the repository. This needs no new build, because it uses two fields most fusion layers already emit, and it catches the whole class of failure: a dead key, a unit slip, or a vendor sensor HAL that quietly changes batching behaviour. Group the results by device profile. Ours showed the phone profile clean and every wearable session recorded in a garage with unbounded intervals. Then fix it at the source: make the loader reject unknown keys, log each device's effective configuration once at session start, and enforce the rule that the coast window must be short enough for gyro drift over that window to stay under half the angle between adjacent edges at the tightest junction in the routing graph. For that rule we budget roughly one degree per minute of drift for a consumer MEMS gyro after online bias calibration, which is an estimate you should replace with your own measured figure.
What the shorter window costs
Tightening the window means more frequent degraded states and a router that hedges between corridors more often, a cost in visible jitter we accept because a hesitant blue dot produces fewer incidents than a confident wrong one.