SPB Git

Repository Public BSD-3-Clause

ATLAS_ENGINE.md 53.2 KB 763 lines markdown

1# ORIX Atlas Engine — specification23Status: specification + prototype (phase 7 of ADR 0002). Date: 2026-11-25.45ORIX Atlas is the future proprietary Metal renderer of ORIX Maps. Today the application renders with MapLibre Native6behind `ORIXMapRenderer.MapBackend`; Atlas is developed in parallel and **is not a complete engine**. The prototype in7`Packages/ORIXAtlas` draws the fills and lines of real vector tiles offscreen. It has no text, no icons, no 3D, no8interaction, and does not implement `MapBackend`. It must not be announced as available until it renders the same style9documents as MapLibre (ADR 0002).1011Every section states what the prototype does: **implemented** (written, tested, measured where a number is given),12**partial** (some of it works, the limits are listed), **not started** (specified here only). Measurements are in13`Packages/ORIXAtlas/README.md`; all are Mac numbers (Apple M5 Max), none from an iPhone.1415## 1. Status at a glance1617| Subsystem | Prototype | Where |18|---|---|---|19| Camera: matrices, screen ↔ coordinate, pitch, bearing, world wrap | implemented | `AtlasCamera.swift` |20| Content insets, camera animation, fit-to-bounds | not started | §4.5 |21| Coordinate precision strategy (doubles on CPU, tile-relative floats on GPU) | implemented | §3 |22| Visible tile selection with pitch, centre-out, capped | implemented (single zoom level) | `TileCover.swift` |23| Level of detail under pitch (shallower tiles far away) | not started | §5.2 |24| Parent / child fallback | implemented as logic and for absent / corrupt tiles; never exercised by tiles still loading | `TileFallback` |25| Tile loading and decoding | implemented (through `ORIXTileStore`) | `AtlasRenderer.prepare` |26| Asynchronous loading while frames are drawn, cancellation, priorities | not started | §6 |27| CPU cache (decoded tiles), LRU | implemented by `TileStore`, budget estimated not measured | §7 |28| GPU mesh cache, byte budget, LRU | implemented | `AtlasRenderer` |29| Memory-pressure response, buffer pooling | not started | §7 |30| Polygon triangulation (ear clipping, holes) | implemented | `Triangulator.swift` |31| Line tessellation (miter + limit, bevel, round joins; butt, round, square caps) | implemented | `LineTessellator.swift` |32| Constant line width in points | implemented | shader, §9.3 |33| Dashed lines, line gradients, line offset | not started | §9.4 |34| Layer model from `ORIXMapStyle` | partial: 50 fill and line layers mirrored by hand from `StyleBuilder`; no style-document reader | `AtlasStyle.swift` |35| Draw ordering | implemented for the prototype's layers; no cross-tile `sort_rank` ordering | §10 |36| Zoom transitions (fades, cross-fade between tile levels) | not started (styles are evaluated at the fractional zoom; layers pop at their minimum zoom) | §11 |37| Metal pipeline, MSAA, per-tile clipping | implemented (one pipeline, 4× MSAA, `clip_distance`) | `AtlasRenderer.swift`, `Atlas.metal` |38| Offscreen rendering to `CGImage` | implemented | `AtlasRenderer.render` |39| On-screen view (`MTKView` / `CAMetalLayer`), gestures | not started | §16 |40| Text: glyph atlas, SDF, shaping, placement, collision | not started | §12 |41| Icons (POI symbols, shields, one-way arrows) | not started | §12.6 |42| Feature picking | not started | §13 |43| 3D buildings | not started (flat fill + 1-point outline only) | §14 |44| Terrain / hillshade hooks | not started | §15 |45| Overlays (route, position, pins, user GeoJSON) | not started | §17 |46| Multiple sources (world base map + regions) | not started (one archive per renderer) | §5.4 |47| Frame pacing 60 / 120 Hz, render-on-demand | not started | §16 |48| Energy | not started (nothing measured) | §18 |49| Threading under Swift 6 | implemented for the offscreen path (actor + task group); main-thread draw path specified only | §19 |50| Errors: missing and corrupt tiles | implemented (skipped, counted, replaced by an ancestor, not retried) | §20 |51| `MapBackend` conformance | not started | §21 |5253## 2. Architecture and data flow5455```56MapCamera ──► AtlasCamera ──► AtlasProjection (matrices, doubles)57                                   │58                                   ▼59                    TileCover.tiles(for:tileZoom:limit:)          which tiles, centre-out60                                   │61        ┌──────────────────────────┴───────────────────────────┐62        ▼ not cached                                           ▼ cached63 TileStore.tile(id)  (actor: read, inflate, decode, LRU)   GPU mesh cache (LRU, bytes)64        │  VectorTile (tile units, Int32)                       │65        ▼  background task                                      │66 TileMeshBuilder.build  (Triangulator, LineTessellator)         │67        │  TileMesh: [AtlasVertex], [UInt32], segments          │68        ▼  renderer actor                                       │69 MTLBuffer × 2 (shared storage) ──► insert, evict LRU ◄─────────┘70                                   │71                    TileFallback.resolve(cover, isReady)          what to draw for tiles not ready72                                   │  [TileDrawItem: source tile, world copy, clip rectangle]73                                   ▼74 AtlasStyle.table(theme, zoom) ──► frame uniforms (128 rows: colour, opacity, width)75                                   ▼76 one render pass: clear to water colour; per item: tile matrix + clip + units-per-point, ≤ 7 indexed draws77                                   ▼78 resolve MSAA ──► drawable (product) / shared texture ──► CGImage (prototype)79```8081Modules used: `ORIXGeoCore` (`Coordinate`, `TileID`, `WebMercator`), `ORIXTileStore` (`PMTilesArchive`, `VectorTile`,82`TileStore`, `LRUCache`), `ORIXMapStyle` (`MapTheme`, `ColorRole`, `BuiltInThemes`). The engine writes no tile reader of83its own.8485**Prototype: implemented** for the path above, synchronously per frame: `render` awaits every missing tile before86drawing. A product engine never waits; it draws what is ready (§6).8788### 2.1 Mesh independent of theme and zoom8990A vertex is 12 bytes: `Int16 x, y` (tile units of a 4096 tile), `Int16 ex, ey` (line extrusion × 4096, zero for91fills), `UInt16 style` (the layer), 2 reserved bytes. Colour, opacity, visibility and line width are **not** in the92mesh: the vertex shader looks the layer up in a table of 128 rows (64 layers × base pass and casing pass) rebuilt each93frame from the `MapTheme` and the fractional zoom. Consequences:9495- changing theme, or toggling `showBuildings` / `showLandUse` / `roadCasings`, rebuilds nothing;96- zoom-dependent widths and opacities are exact at every fractional zoom without touching buffers;97- a hidden layer still costs vertex work: its triangles are submitted and collapsed. Measured frames include them.98  A product engine should keep per-layer index ranges (the prototype records them in `TileMesh.layerRanges`) and skip99  hidden runs on the CPU.100101This is the "per-draw colour" option of the brief pushed one step further, and the reason `TileMeshBuilder.build`102takes no theme. The alternative (colour per vertex) costs 4 more bytes per vertex and a re-tessellation of every103cached tile on each theme change.104105## 3. Coordinate systems and precision106107| Space | Type | Origin, axes | Used for |108|---|---|---|---|109| Geographic | `Coordinate`, doubles, degrees | WGS 84 | API, camera centre |110| World (Mercator) | doubles, points at the camera zoom | north-west corner of the world; x east, y south; world width `512 · 2^zoom` | camera, tile cover, conversions |111| Centre-relative world | doubles | camera centre | input of the view-projection matrix |112| Tile units | `Int32` decoded, `Int16` on the GPU | tile's north-west corner; y south; extent 4096; the tile buffer goes slightly outside | geometry |113| Clip space | floats | Metal: x, y in −w…w, z in 0…w | GPU |114| Screen | `CGPoint`, points | top-left of the view, y down | touch, API |115116**Why doubles on the CPU.** At zoom 20 the world is 512 · 2²⁰ ≈ 5.4 · 10⁸ points wide. A 32-bit float has 24 bits of117mantissa: positions near Montréal would be quantized to about 32 points, visible as geometry that jitters and snaps118when the camera moves. Doubles keep 2⁻²² point there.119120**Why tile-relative floats on the GPU.** Metal vertex stages compute in 32-bit floats. The engine never sends a world121position: it sends tile units (integers up to a few thousand, exact in floats) and, per draw, one matrix122`viewProjection · translate(tileOrigin − cameraCentre) · scale(tilePoints / 4096)` whose product is formed **in123doubles** and only then rounded to floats (`AtlasProjection.tileMatrix`). The translation it contains is the distance124from the camera to the tile, at most a few thousand points for a visible tile, so the float result is accurate to a125small fraction of a pixel. Test `tileMatrixAgreesWithTheDoubleProjectionAtStreetZoom`: a zoom 15 tile at camera zoom12620, pitch 55°, bearing 33°, float matrix within 0.05 point of the double projection.127128Limits. (1) Tile units are integers: at the archive's deepest zoom (15) one unit is 512 / 4096 point at zoom 15 but1294 points at zoom 20; overzoomed geometry shows the tile's own quantization (this is a property of the data, common to130every renderer). (2) `Int16` positions clamp beyond ±32 767 units (8 tiles); the builder counts clamped vertices131(`TileMesh.Statistics.clampedVertices`), none occur in the Montréal set. (3) Heights (§14) will be in points relative132to the ground, which stay small.133134**Prototype: implemented.**135136## 4. Camera137138### 4.1 Model139140`AtlasCamera { center: Coordinate, zoom: Double, bearing: Double, pitch: Double }` with the semantics of141`ORIXMapRenderer.MapCamera`: zoom for 512-point tiles (zoom 0 = the world in one 512-point tile), bearing in degrees142clockwise from north of the direction at the top of the view, pitch in degrees from the vertical, ranges zoom 0…20 and143pitch 0…60, `normalized` with the same rules (latitude clamped to ±85.0511°, longitude wrapped, non-finite values144replaced). The eye looks at `center`, which is at the centre of the viewport; at the centre one world point is one145screen point whatever the pitch.146147### 4.2 Matrices148149Vertical field of view `fov = 2·atan(1/3) ≈ 36.87°` (MapLibre's value, so the same pitch gives the same framing).150Eye distance `d = (height / 2) / tan(fov / 2)` points. With `(x, y, h)` a centre-relative world position (h = height in151points, up), θ the bearing and φ the pitch:1521531. bearing: `x₁ = x·cosθ + y·sinθ`, `y₁ = −x·sinθ + y·cosθ` (the bearing direction now points up the screen);1542. flip y (eye space is y up): `y₂ = −y₁`;1553. pitch about the screen x axis: `y₃ = y₂·cosφ + h·sinφ`, `z₃ = −y₂·sinφ + h·cosφ` (the top of the view recedes);1564. move the eye back: `z₄ = z₃ − d`;1575. right-handed perspective with Metal depth (0 near, 1 far): `f = 1/tan(fov/2)`,158   `clip = (x₁·f·h/w, y₃·f, z₄·far/(near−far) + far·near/(near−far), −z₄)`.159160`far = 1.05 · (sinφ · t + d)` with `t = sin(fov/2) · d / sin(90° − φ − fov/2)`, the ground distance from the centre to161what the top edge of the view sees; `near = 0.05 · d`. The whole product is a `simd_double4x4`.162163### 4.3 Screen ↔ coordinate, including pitch164165- `point(for:)`: project to world points, take the world copy nearest to the centre, multiply, divide by w166  (nil when w ≤ 0: behind the eye), map NDC to points (y down).167- `coordinate(at:)`: un-project the screen point at depth 0 and depth 1 through the inverse matrix, intersect the ray168  with the ground plane h = 0 (nil if the ray does not descend), add the centre, un-project Mercator. Nil when the169  ground point is beyond a pole (outside the Mercator square). The longitude returned is always in [−180, 180).170171Round trip measured under 10⁻⁵ point for zoom 6.5–20, bearing 0–359°, pitch 0–60°.172173### 4.4 Limits of the projection, antimeridian, world copies174175- The construction requires `pitch + fov/2 < 90°`: beyond 71.57° the top ray is parallel to the ground or above it,176  `t` diverges and there is a horizon. The pitch limit of 60° (`MapCamera.pitchRange`) keeps 11.6° of margin; at 60°177  the farthest visible ground is 1.58 × the eye distance beyond the centre. Raising the limit needs a horizon: a far clip in the178  cover, fog or sky, and level of detail (§5.2).179- Web Mercator stops at ±85.0511°. When the world is smaller than the view (low zoom, tall phone), nothing is drawn180  beyond the poles: the clear colour (water) shows. A product engine constrains the camera instead (MapLibre does),181  so that the view never leaves the square; **not started**.182- The world repeats in x. Longitudes are wrapped at the API; internally x is unwrapped and a tile carries a `wrap`183  index (0 = primary copy, ±1 the neighbours). The cover yields `(tile, wrap)` pairs and the tile matrix adds184  `wrap · worldSize`, so the antimeridian needs no special case and zoom 0 in a wide view draws several worlds185  (tested: three copies, identical pixel columns 512 points apart).186187**Prototype: implemented** (matrices, conversions, wrap, `visibleBounds`).188189### 4.5 Not started190191Content insets (`MapInsets`: the visible centre is offset from the view centre; implemented as an off-axis shift of192the projection, exactly a translation in NDC), camera animation (`apply(camera:duration:)`: interpolate centre in193Mercator, zoom linearly, bearing along the shortest arc, or a "fly-to" curve for long moves), `fit(bounds:insets:194maxZoom:)`, gesture mathematics (zoom about the pinch point: keep `coordinate(at: focus)` fixed), camera constraints.195196## 5. Visible tile selection197198### 5.1 Single level (prototype)1992001. Tile zoom `z = clamp(floor(zoom), archive.minZoom, archive.maxZoom)`: 512-point tiles are drawn between 512 and201   1024 points wide. Above the archive's deepest zoom its tiles are overzoomed; below its shallowest they are shrunk.2022. Un-project the four corners of the viewport to the ground: a rectangle when flat, a trapezoid when pitched, rotated203   by the bearing. Convert to tile coordinates of zoom z (x unwrapped).2043. Scan the bounding box of that convex quadrilateral (rows clamped to 0…2ᶻ−1, which is the pole clamp) and keep the205   unit squares that intersect it (separating-axis test).2064. Split x into `(x mod 2ᶻ, wrap)`.2075. Sort by squared distance from the camera centre (ties broken deterministically) and keep the first `limit`208   (default 48 in the renderer). Centre-out order is the loading priority and decides what the cap drops.209210A window of ±128 tiles around the centre bounds the scan when an archive's shallowest zoom is far deeper than the211camera's. Tests: zoom 0, world copies, antimeridian from both sides, poles, every visible ground point covered for212flat, rotated and pitched cameras, order, cap.213214**Prototype: implemented.** Measured tile counts for a 393 × 852 point view: 2–6 flat, 9 at pitch 60°.215216### 5.2 Level of detail under pitch — not started217218At pitch 60° the far tiles are drawn at about 40 % of their nominal size, with the full detail of zoom z: wasted219triangles, and aliasing of thin lines. The product design is a quadtree descent from zoom 0: a tile is subdivided220while it intersects the frustum and its distance to the eye is below a threshold proportional to its size (the tile's221zoom is chosen so that its on-screen size stays between 256 and 1024 points). The result is a cover of mixed zooms222without overlap; the per-tile clip of §9.5 already supports it.223224### 5.3 Fallback while tiles load225226`TileFallback.resolve(cover:minZoom:maxZoom:isReady:)` turns each covered tile into draw items:227228- ready → itself, clip = whole tile;229- not ready, some children ready (zooming out) → each ready child drawn whole; each missing quadrant drawn from the230  nearest ready ancestor, clipped to that quadrant;231- not ready, no child ready (zooming in, or absent tile) → nearest ready ancestor, clipped to the sub-square the tile232  occupies in it;233- nothing ready → no item; the background shows.234235The draws of one covered tile never overlap, so translucent layers are not blended twice, and no stencil is needed:236the clip rectangle is applied in the vertex stage (§9.5). The product engine extends the child search to two levels237and keeps tiles of the previous zoom level *retained* in the cache until their replacements are drawn.238239**Prototype: implemented as logic** (unit-tested) and used by the renderer for tiles the archive cannot give (absent240→ overzoomed ancestor, tested with a camera over Toronto on the Montréal archive; corrupt → parent, tested). Because241the offscreen path waits for tiles, the "still loading" case never occurs in the prototype.242243### 5.4 Several sources — not started244245The application draws a world base map (zoom 0–6) under installed regions. The engine needs an ordered list of246sources per frame, a cover per source, and the rule of `StyleBuilder` (regions take over from `regionDetailMinZoom`;247the base map is overzoomed outside regions). The prototype takes one `TileStore`.248249## 6. Loading, decoding, geometry build, upload250251Product pipeline, per tile, in priority order (centre-out, current zoom first, then one ring of prefetch):2522531. `TileStore.tile(id)` (actor): directory lookup, range read from the memory-mapped archive, gzip inflate, MVT254   decode, cached by cost. Concurrent requests share one load.2552. `TileMeshBuilder.build` in a background task: pure function of the decoded tile.2563. Upload on the renderer's executor: two `MTLBuffer`s. Tiles are 0.5–1.9 MB; with shared storage on Apple GPUs this257   is a `memcpy`.2584. The tile becomes drawable at the next frame; a frame is requested.259260Requirements for the product: at most N builds in flight (N ≈ active performance cores − 1) on a dedicated serial or261bounded executor rather than the unbounded cooperative pool; cancellation of requests that left the cover and its262prefetch ring; no work on the main thread beyond issuing requests; back-pressure when the cache is full of tiles of263the current frame.264265**Prototype: partial.** Steps 1–3 exist and run concurrently in a `TaskGroup` (one child task per tile, unbounded),266but `render` awaits them: there is no frame while tiles load, no cancellation, no prefetch, no priority beyond the267cover order. Measured on the Mac: decode 0.51 ms p50 / 1.79 ms p95, mesh build 1.11 ms p50 / 2.74 ms p95 per tile;268cold first frame 13–27 ms including 4–12 ms of tile work for 2–9 tiles.269270## 7. Caches and budgets271272| Cache | Owner | Unit | Default | Eviction |273|---|---|---|---|---|274| Decoded tiles (CPU) | `TileStore` actor | 4 × encoded size (an estimate by that module) | 48 MB | LRU by cost |275| Meshes (GPU buffers) | `AtlasRenderer` actor | exact bytes of vertex + index buffers | 256 MB | LRU by cost |276| Unusable tiles (absent, corrupt) | `AtlasRenderer` | entries | 8 192, then cleared | wholesale |277| Glyph atlas, icon atlas | — | — | — | not started |278279Mesh cost measured: 0.78 MB per tile on average over 146 Montréal tiles (0.5 MB at zoom 15, ≈ 1 MB at zoom 12–14);280a phone frame holds 1.1–6.7 MB. The 256 MB default is a Mac development value. **An iPhone budget has not been281measured**; the working assumption to validate on devices is 48–96 MB of meshes depending on the device class, shrunk282on `didReceiveMemoryWarning` to the tiles of the current frame.283284Rules: tiles of the current frame are touched every frame and therefore are the last evicted; a frame holds strong285references to the meshes it draws, so an eviction never frees a buffer in use; the draw of a frame is synchronous286inside the actor, so nothing can be evicted between choosing draw items and encoding them. If the budget is smaller287than one frame, the tiles inserted first are evicted and drawn through the fallback (tested with a 2 MB budget).288289After upload the CPU copy of the mesh is dropped. The decoded tile stays in `TileStore`'s cache for picking (§13) and290is re-decoded on demand if evicted.291292Known costs to fix: `LRUCache.insert` scans every entry to find its victim (O(n) per eviction); meshes use 32-bit293indices everywhere and 12-byte vertices for fills that need 6; hidden layers stay in the buffers. Buffer pooling294(reusing `MTLBuffer`s of evicted tiles through a heap) is **not started**.295296**Prototype: implemented** for the mesh cache and the negative cache; memory-pressure handling **not started**.297298## 8. Polygon triangulation299300Ear clipping on a doubly linked list of vertices, with holes joined to the outer ring by bridges. Justification over301a constrained Delaunay or a monotone decomposition: map polygons are small (in the measured set the largest has 911302points) and already simplified by the tile builder; ear clipping is O(n) in practice on such input with a spatial303index, needs no extra vertices, and its failure modes on invalid input are easy to bound.304305- **Exact arithmetic.** Tile coordinates are integers; every orientation and containment predicate is a 64-bit306  integer cross product (coordinates clamped to ±2²⁴ so that no product overflows). There is no epsilon and no307  tolerance. Only the bridge search uses doubles, for the intersection of a ray with an edge.308- **Rings.** MVT gives exterior rings and holes in order, distinguished by the sign of their area; the mesh builder309  groups them, the triangulator re-orients them (outer positive, holes negative), accepts a closing point, ignores310  rings without area.311- **Holes.** Sorted by their leftmost vertex; each is connected to a visible vertex of the outer loop found by casting312  a ray towards −x, then choosing among the reflex vertices inside the triangle (hole vertex, hit point, edge end) the313  one under the smallest angle (Eberly). Only edges facing the hole are considered, which also selects the right copy314  among the two coincident edges of an earlier bridge.315- **Ears.** A convex vertex is an ear when no reflex vertex lies in its closed triangle. Candidates come from a316  uniform grid over the loop's vertices (√(n/2) cells per side, loops under 48 vertices are simply walked).317- **Recovery, in this order, when a full turn finds no ear:** remove repeated and collinear points; cut off local318  self-intersections; split the loop in two along a valid diagonal (needed even for valid polygons, because bridges319  make the loop only weakly simple and the emptiness test can then refuse every ear: one such polygon exists in the320  Montréal set); finally cut convex vertices without the emptiness test.321- **Bounds on hostile input.** The diagonal search has a work budget; the emptiness test has a budget of322  `2 000 000 + 2 000 · n` vertex looks, after which the remaining loop is cut without tests; once input is known to be323  invalid, each dead end removes a sixteenth of the loop. The function always terminates, never traps and never324  returns an index out of range; what it could not do properly is reported (`forcedEars`, `droppedHoles`,325  `abandonedVertices`).326327The structure of the hole bridging and of the recovery passes follows the well-known "earcut" formulation (Mapbox,328ISC licence) of the FIST and Eberly methods; the code is written for this project (integer predicates, grid index,329budgets). The lead should decide whether an acknowledgement line is wanted in the application's notices.330331Measured: on the buildings, landuse, water and earth polygons of 146 Montréal tiles, 128 170 polygons, **128 170 with332the sum of triangle areas exactly equal to the polygon area**, no diagnostic; 12.7 M triangles/s on building rings,33311.3 M triangles/s on land use rings (Mac, release, single thread). Not measured: rings of tens of thousands of334points (none in the data set); a 20 000-point random ring completes in 7.5 s in a debug build.335336Polygons are not clipped to the tile on the CPU; the GPU clip (§9.5) removes what lies in the buffer.337338**Prototype: implemented.**339340## 9. Lines341342### 9.1 Tessellation343344One quad per segment (two vertices on each side, extruded along the segment normal), plus:345346- **miter join**: the two segments share two vertices extruded along the bisector by `1 / cos(turn / 2)`; when that347  length exceeds the **miter limit** (2 by default) the join falls back to a bevel;348- **bevel join**: each segment keeps its own end vertices and one triangle (centre, outer end, outer start) fills the349  outer wedge; the inner sides overlap;350- **round join**: the same with a fan of triangles of at most 22.5° around the centre. A round join whose miter would351  be shorter than 1.05 half widths (turns under about 35°) is emitted as a miter: indistinguishable and two vertices352  instead of five or more;353- **caps**: butt (nothing), square (end vertices pushed out by one half width), round (a half disc of 8 triangles);354- closed lines (rings: building outlines) get a join instead of caps.355356Repeated and non-finite points are dropped; fewer than two distinct points produce nothing; an exact U-turn is a357bevel (no NaN).358359### 9.2 Which geometry for which layer360361Round geometry costs vertices and only shows on wide lines. `AtlasStyle.lineGeometry` chooses per layer from the362widest the layer can be while the tile is on screen (one zoom above the tile, zoom 20 for the archive's deepest363tiles): round joins when ≥ 3 points, round caps for surface roads only (the style document caps tunnels and bridges364butt), miter + butt for paths, railways and outlines.365366### 9.3 Constant width in points367368The mesh stores `position` and `extrusion`, not the width. The vertex shader computes369`position + extrusion · (widthPoints / 2) · unitsPerPoint`, with `unitsPerPoint = 4096 / (512 · 2^(zoom − tileZoom))`370a per-draw uniform and `widthPoints` the layer's row of the style table, evaluated at the fractional zoom with the371style specification's exponential interpolation (base 1.6). Hence the width is exact in points at the centre of the372view at any zoom, continuous when the tile zoom changes, and independent of the theme. Tested on a synthetic tile:373road and casing widths equal the style's to within MSAA sampling at zoom 12, 12.37, 12.99, 13, 14.5, 16 and 17.2,374flat and at pitch 50°.375376Under pitch the extrusion lies in the ground plane, so a line narrows with distance like the ground itself. This is377MapLibre's behaviour for lines and the intended one.378379A line thinner than one pixel is drawn one pixel wide with alpha scaled by its width: coverage is conserved (tested)380and the line does not break into dashes under multisampling.381382### 9.4 Not started383384Dashed lines (paths, tunnel casings, regional boundaries in `StyleBuilder`; needs the distance along the line per385vertex and a period in the fragment stage — the prototype draws them **solid**, which is its most visible386cartographic difference with MapLibre after the absence of text), line offset, gradients, patterns, one-way arrows.387Translucent lines blend twice where a join overlaps itself (tunnels, paths at 0.7 opacity).388389### 9.5 Clipping to the tile390391Tile geometry extends into a buffer around the tile. Each draw passes a rectangle in tile units and the vertex392shader outputs four `clip_distance` values; the rasterizer clips triangles to it. No stencil pass, no `discard`393(which defeats hidden-surface removal on Apple GPUs). The same mechanism clips an ancestor to the sub-square it394stands for. Tested: land in the buffer of a tile does not spill over its neighbour, at bearing 0 and 90°; no pixel395of a seam on uniform land across a tile border, flat, rotated and pitched.396397**Prototype: implemented** (§9.1–9.3, 9.5).398399## 10. Layer model and draw order400401`AtlasLayer` (50 cases) mirrors `StyleBuilder.geometryLayers`, in its order:402403`earth` → land cover (7 kinds, fading out between zoom 5 and 8) → land use (13 groups) → `water` polygons → waterways404→ pedestrian areas → **tunnels** (casing pass, then path, service, minor, link, major, highway, rail) → `building`,405`buildingOutline` → **surface roads** (same) → country and regional boundaries → **bridges** (same).406407The tile schema is Protomaps basemap v4; classification uses `kind`, `kind_detail`, `is_link`, `is_tunnel`,408`is_bridge` exactly as the style document's filters do. Colours come from `MapTheme[ColorRole]`; the theme switches409(`showLandUse`, `showBuildings`, `roadCasings`, `emphasizeTransit`, `emphasizeOutdoors`, `roadWidthScale`) are410honoured; road width ramps, opacity ramps and minimum zooms are those of `StyleBuilder`.411412A tile's index buffer is stored in that order, so order inside a tile is the order of the indices. Casings are a413second draw of the same index run with the other half of the style table, before the base run of the same structure:414all casings of a structure lie under all its roads, as in the style document. Because tiles are clipped to disjoint415squares, order between tiles does not matter.416417Differences with the style document, all **limits of the prototype**:418419- the table is a hand-made copy of `StyleBuilder`'s internals; there is **no reader of style documents**420  (`MapBackend.apply(styleJSON:)`), so nothing guarantees the two stay in step;421- features are not ordered by `sort_rank` inside a layer (overlapping land use, stacked bridges);422- buildings keep a flat fill (the style document fades it to 0.5 under extrusions); the outline is a 1-point line from423  zoom 15;424- `tunnelTint` mixing, tunnel and path opacities are applied; dashes are not;425- labels, POIs, overlays, extrusions, hillshade and contour layers are absent.426427**Prototype: partial.**428429Product direction: either a real interpreter of the subset of the style specification that `StyleBuilder` emits430(filters, `interpolate`, `match`, `coalesce`), compiled once per style into layer buckets and table-filling closures,431or — simpler and sufficient, since ORIX generates its own styles — a renderer-neutral layer description exported by432`ORIXMapStyle` from which both the MapLibre document and the Atlas table are derived.433434## 11. Zoom transitions435436- Styles are functions of the fractional zoom, evaluated every frame: widths and opacities change continuously.437  **Implemented.**438- A layer appears at its minimum zoom without a fade, as in MapLibre unless the style ramps its opacity.439- When `floor(zoom)` changes, the cover switches to the other tile level. With the fallback, children or the parent440  are drawn until the new tiles are ready; geometry of different generalization pops in. The product engine441  cross-fades: keep the previous level's tiles retained for about 300 ms and blend new tiles in with a per-tile442  opacity (a per-draw uniform; fills need an offscreen composite or dithering to cross-fade correctly, lines can443  simply fade). **Not started.**444- Labels have their own fade (§12.5).445446## 12. Text — not started (specified)447448Text is the largest missing subsystem. The MapLibre pipeline ships Noto Sans glyph ranges as signed-distance-field449PBFs (13 MB in the application today). Atlas should not reuse them: it can rasterize with CoreText and gain system450shaping for free.451452### 12.1 Glyph atlas453454- One `r8Unorm` texture per atlas page, 1024 × 1024 to start, growing to 2048 × 2048, pages added when full; shelf455  packing (glyphs sorted by height into rows) with a 1-texel gutter.456- Key: `(fontID, glyphID)` — glyph identifiers after shaping, not Unicode scalars, so ligatures and contextual forms457  cache correctly. Fonts: Noto Sans Regular / Medium / Italic from the bundle through `CTFont`, with CoreText's458  cascade list as fallback for scripts they lack.459- Glyphs are rasterized once at a base size of 24 points × screen scale and stored as SDF. Eviction: LRU by last460  frame used, only when a page is full; a full rebuild is acceptable on memory warning.461- Rasterization on a background task; a label waits (stays hidden) until all its glyphs are in the atlas, so text462  never appears half drawn.463464### 12.2 Signed distance fields465466- Generation: render the glyph outline with CoreGraphics into an 8-bit mask at 4× the cell resolution, compute the467  Euclidean distance transform (two-pass exact EDT, Felzenszwalb–Huttenlocher) inside and outside, downsample, encode468  distance to the edge in 0…255 with 0.75 as the edge value and a radius of 8 texels (MapLibre's convention, which469  leaves room for a halo of up to about 6 points at 24-point base size).470- Fragment shader: `alpha = smoothstep(edge − w, edge + w, sample)` with `w = fwidth(sample)`-based width so that the471  edge is one pixel soft at any scale and under pitch; halo = a second threshold further out, drawn first in the same472  fragment (mix of halo colour and fill colour), with `text-halo-width` and `text-halo-blur` from the style.473- Single-channel SDF rounds sharp corners above roughly 2× the base size. Map labels are 10–22 points, so this is474  acceptable; a multi-channel SDF is not justified at first.475- Not SDF: colour emoji. Rasterize as bitmaps into a separate BGRA atlas, or drop them from labels; to decide.476477### 12.3 Shaping scope478479First version: CoreText does the shaping (`CTLine` from an attributed string): kerning, ligatures, combining marks,480Latin with diacritics (French is the product's first language), Cyrillic, Greek, CJK, and right-to-left and complex481scripts (Arabic, Hebrew, Devanagari) as CoreText lays them out — including bidirectional reordering for482**point labels**. Line breaking for multi-line point labels: break at spaces and after hyphens to fit `text-max-width`483(8 em in the style), balance lines, centre them.484485Explicitly out of the first version: labels **along a curved line** for scripts that need joining across glyphs486(Arabic) — the glyphs of a curved label are placed individually, which breaks cursive joining unless clusters are487kept together; vertical CJK layout; `text-transform` beyond upper-case; rich text (`format` expressions). Curved road488names in Latin, Cyrillic, Greek and CJK are in scope.489490Localization: `name:<language>` with fallback to `name`, as `StyleBuilder.localizedName` does.491492### 12.4 Placement493494- **Point labels** (places, POIs, water names): anchor at the feature, text box from the shaped lines, optional icon;495  `text-variable-anchor` (try several positions around the icon) for POIs.496- **Line labels** (roads, waterways): choose anchors along the line at `symbol-spacing`, starting so that anchors of497  the same road in adjacent tiles line up; for each anchor walk the line by each glyph's advance and place each glyph498  tangent to it; reject an anchor where the line turns more than `text-max-angle` (45°) under the label or is shorter499  than the label; flip the label when it would read upside down for the current bearing.500- Labels are laid out in **tile space once**, by the background task that builds the tile, and **projected each501  frame**: point labels stay upright and screen-aligned (billboards), line labels lie in the map plane (or are502  re-projected glyph by glyph when pitched, which is what MapLibre does and what keeps them legible).503- Labels that continue across tile borders are deduplicated by a key (layer, text, quantized anchor).504505### 12.5 Collision506507- Per frame (throttled to changes of camera beyond a threshold, at most every 100 ms while moving): project each508  candidate's collision geometry — one box for a point label, a chain of circles for a line label — to screen space.509- Insert in priority order (layer order of the style, then `sort_rank` / `min_zoom` / population rank from the tile)510  into a uniform screen grid (cells of about 30 points). A candidate that intersects an already placed one is hidden.511  Padding from `text-padding` (the style derives it from `MapTheme.labelDensity`).512- Hysteresis: a placed label keeps its place while it still fits (cross-frame stability, no flicker when two labels513  are equally good); visibility changes fade over 300 ms through a per-label opacity that the vertex shader reads514  from a small dynamic buffer — the glyph quads themselves are not rebuilt.515- Collision is global across tiles and sources, so it runs on the frame's whole set of visible symbols, on a516  background task, and the result is applied at the next frame.517- Under pitch, boxes of distant labels shrink with perspective; MapLibre additionally thins labels far away. Same518  here.519520### 12.6 Icons521522POI symbols are SF Symbols rendered by the application into images today (`POIGroup.symbol`). Atlas needs an icon523atlas (BGRA, or SDF for single-colour symbols so they can be tinted per theme), icon + text placement as one unit,524and road shields (`shield_text`, `network` attributes exist in the tiles).525526## 13. Feature picking — not started (specified)527528`MapBackend` reports the topmost selectable feature under a tap (`MapEvent.tap(Coordinate, MapFeature?)`); selectable529layers are POIs, localities, neighbourhoods and transit stations (`OverlayID.selectableLayerSuffixes`), all symbols.530531Design, CPU-side, no GPU read-back:5325331. `coordinate(at:)` gives the ground position; the tap tolerance (22 points radius) becomes a small quadrilateral534   on the ground through `worldPoint(at:)` of four points.5352. **Symbols first**: the collision index of the last placement (§12.5) holds the screen boxes of every *visible*536   label and icon with a reference to its feature. Query it with the tap rectangle; take the highest-priority hit.537   This is exact with respect to what the user sees, including hidden-by-collision features being unselectable.5383. **Geometry** (for a later "what is here" feature): for each covering tile take the decoded tile from `TileStore`539   (re-decoded if evicted), convert the tap to tile units, and test layers top-down: point-in-polygon for fills,540   distance to polyline ≤ half width + tolerance for lines. A per-tile grid index (built lazily, cells of 256 units)541   bounds the work.5424. Return `MapFeature(layer:kind:name:coordinate:attributes:)` with attributes stringified.543544An ID-buffer pass (render feature identifiers offscreen and read one pixel) was considered and rejected for the first545version: it needs a second pass per tap, a mapping from identifiers to features across evictions, and gives nothing546for symbols that the collision index does not already give.547548## 14. 3D buildings — not started (specified)549550The tiles carry `height` and `min_height` (metres) on buildings and building parts. The style extrudes buildings551with a height from zoom 15, fading in to zoom 16 (`fill-extrusion`), when `MapTheme.extrudeBuildings` is set.552553- **Geometry**: roof = the triangulated footprint at `height`; walls = one quad per ring edge from `min_height` to554  `height`, with the edge's outward normal. Edges that lie on the tile's clip boundary are artefacts of tile cutting555  and get no wall. Vertex: position (x, y in tile units, z in metres as `Int16` or `Float16`), packed normal, style.556  Height converts to points with `1 / metersPerPoint(latitude of the tile, zoom)` in the per-draw uniform.557- **Depth**: a `depth32Float` attachment (memoryless on iOS), depth test and write enabled for extrusions only, drawn558  after all ground layers; ground layers keep the painter's order with depth test off. The projection of §4.2 already559  produces a valid depth and handles `h`.560- **Shading**: one directional light fixed to the viewport (the style document's `light`: anchor viewport, intensity561  0.35 by day and 0.25 at night), Lambert term on walls, a vertical gradient that darkens the base562  (`fill-extrusion-vertical-gradient`), flat roofs at full colour.563- **Translucency**: the style asks for 0.75–0.85 opacity. Drawing translucent extrusions straight to the frame shows564  inner walls. Render extrusions opaque into an offscreen colour + depth target and composite it at the layer565  opacity (MapLibre's approach), or ship opaque buildings first.566- **Cross-tile**: a building cut by a tile border is two prisms; with opaque rendering the cut is invisible provided567  no wall is generated on the cut.568- Labels over buildings: POI labels should be hidden behind tall extrusions or lifted; open question.569570## 15. Terrain and hillshade — hooks, not started571572`MapTheme.showTerrain` exists and `ORIXTerrain` has an elevation module; no region ships terrain tiles yet, and the573rule of the project is to draw nothing without data.574575Hooks the architecture reserves:576577- **Raster DEM source**: a second kind of tile (elevation as RGB-encoded or 16-bit rasters, 256 or 512 texels),578  loaded and cached like vector tiles but uploaded as textures.579- **Hillshade layer**: a per-tile pass that computes slope and aspect from the DEM texture in the fragment shader580  (Horn's method on a 3 × 3 neighbourhood, with a one-texel border taken from neighbours to avoid seams) and blends581  shadow and highlight colours over the land layers, under roads. This is 2D and needs nothing else.582- **Contours**: vector lines from the tile builder (preferred: no run-time marching squares), drawn as an ordinary583  line layer with index contours thicker.584- **3D terrain** (draping): ground layers rendered per tile into a texture, then drawn on a displaced grid mesh;585  camera altitude, `coordinate(at:)` by ray-marching the DEM, labels and extrusions lifted by sampled elevation. This586  changes §4.3, §5 and §12 and is the last item of the roadmap, not a hook to keep "free" today. What is kept: every587  place that assumes the ground plane h = 0 goes through `AtlasProjection`.588589## 16. Display, frame pacing — not started (specified)590591- **View**: `AtlasMapView`, a `UIView` (iOS) / `NSView` (macOS) backed by `CAMetalLayer`, driven by `CADisplayLink`592  (`CAMetalDisplayLink` where available) rather than a free-running `MTKView` loop. Drawable size = bounds × screen593  scale; MSAA and depth attachments memoryless on iOS.594- **Render on demand**: a frame is drawn only when something changed — camera, style, a tile became ready, a fade or595  an animation is running, an overlay changed. An idle map draws nothing. The display link is paused when no frame is596  pending.597- **Rates** (`MapController.FrameRate`): `.standard` → `preferredFrameRateRange(minimum: 30, maximum: 60, preferred:598  60)`; `.maximum` → up to 120 on ProMotion *while the map moves* (gesture or animation), falling back to 60 for599  fades; `.lowPower` → 30. Requires `CADisableMinimumFrameDurationOnPhone` in the application's Info.plist for 120 Hz600  on iPhone.601- **Budgets**: 16.6 ms at 60 Hz, 8.3 ms at 120 Hz, for CPU encode + GPU. Tile work never runs in the frame. Per602  frame the main thread does: camera update, cover, fallback resolve, uniform upload, encoding. On the Mac the603  prototype encodes a phone-sized frame of 14–59 draws in 0.02–0.07 ms and the GPU takes about 0.5 ms; **no iPhone604  number exists**, and the vertex load of §2.1 (hidden layers) and of pitch without LOD will matter more there.605- **Statistics**: CPU frame time reported through `MapController.engineDidRenderFrame(milliseconds:)`.606- **Gestures**: pan (with deceleration), pinch about its centroid, rotation, two-finger pitch, double-tap and607  two-finger-tap zoom, one-finger zoom (double-tap-drag); `CameraChangeReason.gesture`, `isUserInteracting` semantics608  of `MapController`.609- **Snapshots**: the offscreen path of the prototype, kept as the engine's snapshot and test facility.610611**Prototype**: offscreen only. `AtlasMapView` was optional in the brief and was not written.612613## 17. Overlays — not started614615The application draws routes, the travelled part, manoeuvre arrows, tracks, measurements, pins, selection, position616and accuracy disc as GeoJSON overlays (`OverlayID`, `MapBackend.apply(overlay:geoJSON:)`). Atlas needs: GeoJSON to617world-space meshes (lines through `LineTessellator`, polygons through `Triangulator`, in a local Mercator frame618around the overlay's first point to keep floats small), re-tessellated when the overlay changes, drawn between619geometry and labels in the order of `OverlayID.allSources`; symbols for pins through §12.6; the position puck with a620heading cone. Long routes need tiling or simplification per zoom.621622## 18. Energy — nothing measured623624Design rules, to be verified with Instruments (Energy Log, Metal System Trace) on devices:625626- render on demand (§16): an idle map costs zero frames; this is the largest single saving;627- 120 Hz only while moving; fades and tile arrivals at 60 Hz or less;628- collision at most every 100 ms while moving, not every frame;629- bound background concurrency so that tile work stays on efficiency cores when not urgent630  (`TaskPriority.utility` for prefetch, `.userInitiated` for the current cover);631- no `discard`, no stencil pass, memoryless MSAA and depth: tile-based deferred GPUs then resolve in tile memory;632- skip hidden layers on the CPU (§2.1) and add LOD under pitch (§5.2) to cut vertex work;633- `ProcessInfo.isLowPowerModeEnabled` and thermal state `.serious` → `.lowPower` frame rate, no prefetch, MSAA off634  on low-end devices (to evaluate: analytic line antialiasing would then be needed).635636## 19. Threading under Swift 6637638The package compiles in Swift 6 language mode with complete concurrency checking and no warning.639640| Component | Isolation | Notes |641|---|---|---|642| `AtlasCamera`, `AtlasProjection`, `TileCover`, `TileFallback`, `AtlasStyle`, `Triangulator`, `LineTessellator`, `TileMeshBuilder`, `TileMesh` | none: `Sendable` values and pure static functions | callable from any task |643| `TileStore` | its own actor (`ORIXTileStore`) | decoding in detached tasks |644| Mesh building | child tasks of a `TaskGroup` | results are `Sendable` `TileMesh` values |645| `AtlasRenderer` | actor | owns `MTLDevice`, queue, pipeline, textures, the mesh cache, the negative cache |646| `GPUTileMesh` | `final class`, `@unchecked Sendable` | immutable after `init`; required because `LRUCache` wants `Sendable` values; the only unchecked conformance |647| Frame encode + submit + read-back | one synchronous actor method | `waitUntilCompleted` is unavailable in async contexts; and no suspension point means no eviction mid-frame |648649No singleton, no global mutable state; the device is created by the renderer.650651**Product threading (not started).** The view is `@MainActor`; the `MapBackend` conformance lives there. The draw652callback of the display link must be synchronous and must not hop to an actor. So the renderer splits in two:653654- a `@MainActor` *frame* object owning the pipeline, the per-frame uniforms and an immutable **snapshot** of ready655  meshes (`[TileID: GPUTileMesh]`, a value swapped atomically), which encodes a frame without awaiting anything;656- a *tile manager* actor owning requests, caches and budgets, which publishes a new snapshot to the main actor when657  tiles arrive or are evicted and asks for a frame.658659Label layout and collision run in tasks and publish results the same way. Metal objects cross isolation only as660immutable resources inside snapshots.661662## 20. Errors: missing and corrupt tiles663664- **Absent tile** (`TileStore.tile` returns nil: outside the region, or beyond the archive's zooms): remembered as665  absent, not requested again; its nearest existing ancestor is loaded and drawn clipped (overzoom).666- **Corrupt tile** (inflate or decode throws: every parser in `ORIXTileStore` is bounds-checked): **skipped, counted**667  (`AtlasRenderer.corruptTileCount`), remembered so that it is not retried every frame, replaced by its nearest668  ancestor. `purge()` forgets the list. Tested with a hand-written garbage tile (counted exactly once, parent drawn,669  sibling unaffected) and with half of the data section of the real world archive overwritten.670- **Geometry that cannot be tessellated**: the triangulator and the tessellator never throw and never trap; degenerate671  rings and lines produce nothing and are counted (`TileMesh.Statistics.emptyGeometries`, `.triangulation`), unknown672  layers and kinds are ignored and counted, out-of-range coordinates are clamped and counted. 600 byte-flipped copies673  of a real tile and 1 500 random polygons were run through without a trap.674- **Buffer allocation failure**: counted (`uploadFailureCount`), the tile is treated as unusable.675- **Renderer errors** are typed (`AtlasError`): no Metal device, shader missing or not compiling, invalid frame size676  (zero, non-finite, above 16 384 pixels), allocation failure, command buffer error.677- Nothing is logged; no coordinate leaves the module (privacy rule of the conventions).678679The product engine additionally needs: a retry policy for transient read errors (a region file being replaced during680an update), a signal to the application when an installed region is damaged (many corrupt tiles in one archive), and681`MapEvent.styleFailed`.682683**Prototype: implemented.**684685## 21. What the prototype renders, honestly686687Verified by opening the PNG files written by the tests (list in the package README):688689- It looks like a map. Montréal at zoom 10–16 shows land, the St. Lawrence and its islands, parks, land use tints,690  the street grid with casings, motorways in the highway colour above other roads, railways, buildings from zoom 14691  with thin outlines from zoom 15; the eight themes are recognizable (Midnight dark, High Contrast with black692  casings); the world map shows continents, land cover and country boundaries; pitched and rotated views are693  geometrically right (pixels at `point(for:)` of known places have the expected colours).694- **No text and no icons at all.** Without labels the picture is a base map, not a usable map.695- Paths, tunnel casings and regional boundaries are **solid instead of dashed**. At street zooms the footways are696  thin solid brown lines, visually heavier than intended; a regional boundary appears as a faint solid line across697  the river.698- Indoor and underground paths of downtown are drawn over buildings where the data marks them as surface paths.699- Buildings are flat; overlapping `building` and `building_part` polygons blend twice below full opacity (zoom 13–16).700- Overzoomed (zoom 17.5 from zoom 15 tiles): correct widths, visibly polygonal curves from the tile's quantization,701  and round caps at the ends of every road piece.702- No seam was found between tiles on uniform land, and none was seen in the images; hairline seams on translucent703  layers were not specifically searched for.704- Line edges are antialiased by 4× MSAA only: five coverage levels, slightly stair-stepped at 1× scale; fine at 3×.705- Outside its region the Montréal archive has only bare world tiles: a camera over Toronto renders uniform land.706- Under pitch far tiles have the full detail of the centre: correct but wasteful, and thin far lines shimmer in707  principle (not observed in stills).708709## 22. Gap list against MapLibre710711What a product-ready engine still needs, by decreasing weight:7127131. **Text**: glyph atlas, SDF, shaping, point and line placement, collision, fades, localization (§12).7142. **Icons**: POI symbols, pins, shields, one-way arrows, collision with text (§12.6).7153. **On-screen view**: `CAMetalLayer`, display link, render on demand, 60 / 120 Hz, resize, backgrounding (§16).7164. **Gestures and camera animation**, insets, fit-to-bounds, camera constraints (§4.5, §16).7175. **Asynchronous tile pipeline**: frames while loading, priorities, cancellation, prefetch, retained tiles (§6).7186. **`MapBackend` conformance** and `MapController` events; **style input** (document reader or a neutral layer719   model from `ORIXMapStyle`) (§10).7207. **Overlays**: route, position, track, pins, user GeoJSON (§17).7218. **Several sources**: world base map + regions, with the take-over rule (§5.4).7229. **Dashed lines**, `sort_rank` ordering, line offset and patterns (§9.4, §10).72310. **Picking** (§13).72411. **3D buildings** with depth and lighting (§14).72512. **Level of detail under pitch**, pitch above 60° with a horizon (§5.2, §4.4).72613. **Zoom cross-fades** (§11).72714. **Memory**: device budgets, memory warnings, buffer pooling, 16-bit indices and a compact fill vertex, hidden728    layer skipping (§7, §2.1).72915. **Precompiled shaders** (`.metallib`), pipeline variants (depth, no MSAA).73016. **Hillshade, contours, terrain** (§15).73117. **Device validation**: every number here is from a Mac; frame time, memory, energy and thermal behaviour on732    iPhones are unknown.73318. Accessibility (VoiceOver elements for map features), right-to-left line labels, snapshots API, attribution.734735MapLibre has all of 1–16 today, maintained by others. Atlas's case rests on what it can do better for ORIX: system736text shaping without 13 MB of glyph files, a tile-relative precision model and a width model that are exact, a737renderer whose every stage is testable from the command line, and no dependency. None of that is demonstrated until738items 1–8 exist.739740## 23. Order of work741742Realistic sequence; each step ends with tests and device measurements. Durations are deliberately not given: nothing743here has been timed, and text alone is commonly the larger half of a map renderer.7447451. **On-screen and interactive**: `AtlasMapView`, display link, render on demand, gestures, frame statistics. First746   iPhone measurements; set memory budgets from them. (Unblocks every measurement that matters.)7472. **Asynchronous tiles**: tile manager actor, snapshots, priorities, cancellation, retained tiles, fallback under748   real loading; skip hidden layers; compact vertex formats.7493. **Style input** shared with `ORIXMapStyle`; multiple sources; dashes; `sort_rank`.7504. **Text, stage 1**: glyph atlas + SDF + point labels + collision + fades (places, POI names, water names).7515. **Icons** and POI symbols; picking through the collision index. → first build that can be compared side by side752   with MapLibre on the same style.7536. **Text, stage 2**: labels along lines (road names), shields, one-way arrows.7547. **Overlays** and **`MapBackend` conformance**; run the application's own UI tests against Atlas behind a755   development switch.7568. **3D buildings**; level of detail under pitch; zoom cross-fades.7579. **Energy and thermal** passes on devices; low-power behaviour; precompiled shaders.75810. **Hillshade and contours** when regions ship terrain; 3D terrain last, if ever.759760Atlas replaces MapLibre only after step 7 renders the same style documents with no visual regression on the761application's reference screenshots, and step 9 shows frame time, memory and energy at least equal on the oldest762supported iPhone.763
Files main
Menu

Theme