Repository navigation
Description
Status: done
Part of #3227.
Depends on: #3305
TL;DR
Goal: A phone installs the routing of an offline area as whole download cells with the installer of #3301, the areas of one routing package share one install, and the phone routes on it with the engine of #3303 and #3305.
Problem: Each offline map is its own routing package: the download service merges the format 9 selections of its zoom-9 tiles in Python into a new routing/blocks.json, and the phone downloads 1.03 to 3.3 times the bytes of its tiles in 11 to 25 packs (measured on Central Switzerland, 2.1 to 54 MB, 133 to 425 B for each road). The phone decodes the selected graph into its own memory at each open (37.5 + 14.5 B for each road and profile; about 25 to 30 million roads is the limit of a 4 GB iPhone [est]). Two areas are two routing packages: they share only the packs whose consumers they share, and the phone decodes each one into its own memory.
Decision:
- Area rule. The routing of an area is each download cell whose record
boxmeets the area grown by the half-sizes ofsnap::window(corner, REACH_M)at its corner nearest to a pole: the largest snap window of any point of the area. Route package format 10: the contract, the writer and the installer #3301 rule 2 makes a pointMissingRegionwhen a cell whose box meets its snap window is absent, so by construction no request point inside the area isMissingRegion. One Rust function,install::area_cells, applies the rule withDirectory::meetingof Route engine: the data layer on format 10 and the host interface #3302, which the snap of Route engine: the data layer on format 10 and the host interface #3302 calls too. - Source. The download service adds
routing/package.jsonandrouting/directory.binto each bundle and does nothing else for routing. The phone plans the cell objects itself with the directory and fetches each one fromobjects/SHA256of the bundle, which redirects to the object pool of the release, as today. - Sharing. One install for each routing package:
routing/<SHA-256 of directory.bin>/. Before each change ofmaps.json, the app calls the installer of Route package format 10: the contract, the writer and the installer #3301 with the union of the areas that the maps of that package will have; the last map takes the folder with it. No count is stored: the union comes from the map list. - Profile groups. The phone installs all groups, so every profile of the release works offline. A request for a profile whose group an install lacks answers
invalid_request("Profile NAME is not installed", Route package format 10: the contract, the writer and the installer #3301 rule 3 and Route engine: the data layer on format 10 and the host interface #3302), and the planner falls back online, as for each local error. - FFI.
planner_router_open(root, memory_budget_bytes, error)keeps its signature: it opens an install folder withplanner_router::openof Route engine: the road search on format 10, and the test of the old engine against the new one #3303, and the budget is the search limit of one search (Route engine: the road search on format 10, and the test of the old engine against the new one #3303 rule S9; 64 MiB from Route engine: the overlay search with the cost tables, and unpacking of the chosen legs only #3305); the app passes 0, the engine's default. Two new calls:planner_routing_planandplanner_routing_install, with JSON requests and a progress callback that can stop the install. - Updates. A new release has a new directory, so its install is a new folder. The old map and its folder stay usable until the user removes the old map.
- Maps. The map packs of an area come from the bounds of its tiles only; the "retained geometry bounds" of format 9 go. A route can leave the map of its area offline.
- Offline publication. The routing descriptor,
routing_packsandrouting_sourcego here, not in Format 10 becomes the only format: delete the old engine and format 9, merge routing-overlay into develop #3311 as Route package format 10: the contract, the writer and the installer #3301 says: Phone: an offline area of whole cells, installed with the same installer #3309 removes their only reader, the download service. The offline files change, so the layerplanner/indexgoes to format 5, withINDEX_FORMATandGRID, as its comment asks. - Long roads. A long road (Route package format 10: the contract, the writer and the installer #3301) of a download cell that the area does not install is no candidate on the phone, where the server can snap to it.
specs/planner-offline.mdstates this known difference.
Rejected: - The download service selects the cells: Python then reads the binary directory, a second reader of format 10. The app fetches from the pool URL directly: a second URL and download path; the bundle endpoint already redirects each hash.
- One install for each map: shared cells twice on disk. A stored count for each cell: a second state that can drift from
maps.json. - Only the groups of chosen activities: about a third of the routing bytes less [est], but a choice in the download screen, a group list for each map and a "profile not offline" state in the planner. The format and the installer allow it later.
- Map packs over the boxes of the download cells: 2 to 5 times the map bytes of a one-tile area.
- Drop the budget argument now: a change of a signature that the app links is a risk for no gain. The argument stays, with its new meaning; the engine of Route engine: the road search on format 10, and the test of the old engine against the new one #3303 decodes nothing into its own memory.
@_silgen_namedeclarations: Swift does not check them against Rust, so a wrong signature compiles, links and fails at run time. A header that cbindgen generates in CI: more machinery than the seven functions of the library need. One written C header, which a reviewer compares with the#[no_mangle]block ofnative.rs, lets the Swift compiler check each call.- The growth by
REACH_M/ 111,200 degrees:snap::cellsaddsceil(r / 0.110) + 2microdegrees, 100 more at 1 km, so a cell whose box starts in that strip of 11 m is missing at the edge. - The area without the growth (the words of Route package format 10: the contract, the writer and the installer #3301 rule 2): a point near the edge of the area is then
MissingRegion, and the planner goes online for a point that the map shows. - Link the parts of the old install whose hash did not change, at an update: a delta; out of scope.
Systems: routing, route-planning, planner-map-baking, companion-ios, obc-data
Contracts:specs/planner-offline.md
Size: L (5 systems, a contract change, the stored library of the phone, about 1,000 changed lines)
Branch:routing-overlay
Facts
- The download service merges the routing selection of each cell with
planner_grid.routing, writesrouting/blocks.json, addsrouting_packs, and names the selected release'srouting_packageby that file (planner_downloads.py#L89-L121). Only this service callsrouting,merge,tableandranges(planner_grid.py#L9-L70). GET /bundles/ID/objects/SHA256serves the file of the selection, else a 307 to the object pool, for any 64-hex name (planner_downloads.py#L198-L211). The follower always passes--objects-url(services.rs#L192-L198).- The map packs of a cell come from its bounds and the
geometry_boundsof its routing descriptor; the catalog hasrouting_source, each cellroutingandrouting_packs(planner_grid_offline.py#L27-L43).planner_grid_index.composeattaches the descriptors (planner_grid_index.py#L67-L73). - The app opens a router on
releases/ID/routingof each map with budget 0 (OfflinePlanner.swift#L50, RouteProvider.swift#L22, native.rs#L48-L68).LocalFirstPlanneruses the first map whose bounds hold all points and keeps one open source until its map goes (LocalFirstPlanner.swift#L17-L30, #L71-L81). - The store downloads 4 objects at once, keeps verified objects in
objects/SHA256, links them intoreleases/ID/, and deletes each object that no map and no pending download names (OfflineMapStore.swift#L104-L183). - A route answer must name the release's
routing_package(PlannerService.swift#L222, #L448).missing_regionis 422, andLocalFirstPlannerfalls back online on an error (lib.rs#L89-L91). - Route engine: the road search on format 10, and the test of the old engine against the new one #3303:
planner_router::openopens a folder withdirectory.binas format 10. Route engine: the data layer on format 10 and the host interface #3302: its hostMapsmaps a part at its first read and keeps the map when the installer removes the file; a first read of a removed file isMissingRegion, so a host opens a new reader after an install that removed cells (Route package format 10: the contract, the writer and the installer #3301 rule 4);snap::window(point, radius)is the window ofsnap::cellsbefore its rounding:ceil(r / 0.110) + 2microdegrees of latitude andceil(r / (0.110 cos lat)) + 2of longitude (snap.rs#L88-L89); a corridor probe whose snap givesMissingRegionis skipped. Route engine: the overlay search with the cost tables, and unpacking of the chosen legs only #3305 lowers the search limit to 64 MiB. Route package format 10: the contract, the writer and the installer #3301:plan(…).missing(target),installed_bytes,object_bytes, and aninstallthat takesinstall.lockand fails at once when another call holds it. - The layer
planner/indexhas format 4; its comment says that a change of the offline files changes it,INDEX_FORMATandGRID(planner.rs#L75-L80); the download service checks it (planner_downloads.py#L21, #L50), and the app checks/catalogformat == 1(OfflineMapStore.swift#L67). A build test assertsrouting/packs/in a bundle and readsrouting_packs(planner_build.rs#L362-L363). RouteProvider.swiftdeclares the C functions with@_silgen_name(RouteProvider.swift#L3-L7); the app has no bridging header.getreads at most 16 MiB (OfflineMapStore.swift#L231).- OBCKit does not link
planner-service; the app target does (project.yml#L171). The suiteswift.obckit-hostruns on macOS in CI (suites.toml#L445-L450).
The size of an area
An area of side t takes the download cells (side c) that meet it: about (1 + c / t)² times its own roads, plus the overlap of the cell boxes. So the download level decides the factor first, then that overlap; the ratio of installed to published bytes, about 1.8 (95 B published and 170 B installed for each road with the tables of 10 profiles, #3301 and #3304), does not change with it. #3301 gives download cells of 160,000 to 650,000 roads at its default level; with cells of 250,000 roads:
| Area | Own roads | c | Roads installed | Format 10: download / installed | Format 9 today |
|---|---|---|---|---|---|
| One zoom-9 tile in the Alps (70 roads/km², 2,800 km²) | 0.2 M | 60 km | 0.9 M (× 4.5) | 85 MB / 150 MB | 27 to 85 MB |
| One zoom-9 tile around a city (450 roads/km²) | 1.26 M | 24 km | 2.6 M (× 2.1) | 250 MB / 450 MB | 170 to 250 MB |
| 3 × 3 tiles in the Alps | 1.8 M | 60 km | 3.4 M (× 1.9) | 320 MB / 580 MB | 240 to 760 MB |
So a one-tile area downloads about 1 to 3 times the routing bytes of today and installs about 1.8 to 5.6 times, because the installed files are not compressed. A lower download level lowers the factor: cells of 80,000 roads give × 2.7 and × 1.5 for the two tiles. #3310 measures the factor on Germany for each level and chooses the level.
Plan
planner/router/src/install.rs(Route package format 10: the contract, the writer and the installer #3301):pub fn area_cells(directory: &Directory, areas: &[[f64; 4]]) -> Vec<u32>, the sorted download cell IDs of all areas, each once. An area[west, south, east, north]in degrees goes to microdegrees outward (floor for west and south, ceil for east and north). Then it grows on each side by the half-sizes ofsnap::window(corner, REACH_M)(Route engine: the data layer on format 10 and the host interface #3302), wherecorneris the corner of the area with the larger absolute latitude (clamped to ±85°): the largest window of any point inside. The cells are those ofDirectory::meeting(Route engine: the data layer on format 10 and the host interface #3302) on the grown box. Long roads do not count, as in Route package format 10: the contract, the writer and the installer #3301 rule 2.planner/service/src/native.rs:-
planner_router_open(root, memory_budget_bytes, error): the signature stays. It callsplanner_router::open; 0 givesdefault_budget(), the search limit of one search. A folder without a validinstall.bin(Route package format 10: the contract, the writer and the installer #3301 rule 4) gives the error of Route engine: the road search on format 10, and the test of the old engine against the new one #3303, as JSON inerror. The comment of the budget says that it is the search limit. Format 10 becomes the only format: delete the old engine and format 9, merge routing-overlay into develop #3311 does not change the signature. -
planner_routing_plan(request: *const c_char, error) -> *mut c_charandplanner_routing_install(request: *const c_char, progress: Option<extern "C" fn(*mut c_void, u64, u64) -> bool>, context: *mut c_void, error) -> bool. The request is UTF-8 JSON:Field Type Meaning package,directorystring The paths of package.jsonanddirectory.bintargetstring The install folder areasarray of [w, s, e, n]Degrees: the bounds of each map of the package objectsstring Only for install: the folder of the objects, each named by its SHA-256 -
The plan answers
{"objects": [{"sha256", "bytes", "part_bytes"}], "bytes"}: each object ofinstall::plan(directory, area_cells(areas), all groups).missing(target), with itsobject_bytesandbytes; the topbytesisinstalled_bytesof the whole plan pluspackage.jsonanddirectory.bin. -
The install calls
install::installwithINSTALL_THREADS = 2and afetchthat opensobjects/SHA256. Comment of the constant: each worker holds a zstd window of up to 8 MiB and its buffers; the install of an area takes seconds.fetchwraps the file in a reader that adds its bytes to a shared count and callsprogress(context, done, total)after each read, withtotaltheobject_bytesof the missing objects; whenprogressreturns false, the reader fails with "cancelled", the install stops and a later call goes on (Route package format 10: the contract, the writer and the installer #3301). With an emptyareas, the call takesinstall.lock, deletestargetand returns true. The store runs one call at a time, so the lock of Route package format 10: the contract, the writer and the installer #3301 only stops a second app process. -
An error writes
{"status", "body": {"code", "message"}}intoerror, asplanner_router_opendoes:invalid_requestfor a request that does not parse or a path that is not UTF-8,invalid_datafor an error of Route package format 10: the contract, the writer and the installer #3301 on an object or the directory,internalwith the path for an I/O error,cancelledfor a stop.
-
companion-ios/Packages/OBCKit/Sources/OBCPlanner/OfflineMap.swift:OfflineMap.routing(the hex SHA-256 ofdirectory.bin).protocol OfflineRouting: Sendablewithplan(package:directory:target:areas:) async throws -> OfflineRoutingPlanandinstall(package:directory:target:areas:objects:progress:) async throws;OfflineRoutingPlan { objects: [OfflineFile] (with part bytes), bytes: Int64 }.OfflineDownloadQuote.routing: [OfflineFile]. The selected release must haveoffline.format4 androuting/package.jsonandrouting/directory.binamong its files, androuting_packagemust be the SHA-256 ofrouting/directory.bin.OfflineMapStore.swift:inittakesrouting: any OfflineRouting.func routing(_ map: OfflineMap) -> URLisroot/routing/<map.routing>.prepare: after the bundle, it fetches the two routing files throughobjects/of the bundle withOfflineTransfer, the path for large files with resume and the check of each object, intoobjects/SHA256. A world directory has about 78 bytes for each file of the package: about 3 MB at 35,000 files, about 19.5 MB at the 250,000 files that Proof on Germany: the bake, the level sizes, the download level, the old engine against the new one #3310 allows, above the 16 MiB ofget. The quote shows a status while it loads. It plans the union of the areas of the maps of that package with the new bounds: the missing objects go totransferBytesandrouting. A second plan of the new bounds alone gives the routing part ofinstalledBytes.needed: also the allocated bytes of each missing routing object and of its part.install: it plans the union again, because the maps can change afterprepare, and writespending.jsonwith that list. The bundle objects and the routing objects download in the one task group of today, asidentityentries. Then the release folder is linked as today, thenrouting.installruns with the progress message "Installing routes…" (the callback reads the flag of step 6), thenmaps.jsongets the map,pending.jsongoes, andcollectObjectsruns. The order makes the map visible only after its routing is complete; until then the oldinstall.binof the folder holds.remove: firstrouting.installwith the areas of the other maps of its package (an empty list deletes the folder), thenmaps.jsonwithout the map, then its release folder goes, thencollectObjects. No routing object downloads for a removal. The install comes beforemaps.jsonalso here: the actor can run a route during theawait, and a reader that it opens then must not be cached under the new map list on the oldinstall.bin. A route during the install reads its mapped files, or getsmissing_regionfor a removed one and goes online once; the next route after the newmaps.jsonopens a new reader.collectObjectsalso keeps the objects ofpending.routing. Routing objects are in norelease.json, so they go after each install.installedBytesof a map is its bundle bytes plus the installed routing bytes of its own area alone. A cell that two maps share counts in each, so the list can show more than the storage that the app uses; the size in the download screen is the routing that this download adds (requiredBytes).coverage()takes/catalogformat == 2.
companion-ios/PlannerNative/PlannerNative.h(new): the C declarations of the five functions ofnative.rs(planner_router_open,planner_router_call,planner_router_cancel,planner_router_close,planner_response_free) and the two new ones, with an opaquePlannerHandle.companion-ios/PlannerNative/BridgingHeader.h(new) includes it;project.ymlsetsSWIFT_OBJC_BRIDGING_HEADERof the app target.RouteProvider.swiftloses its@_silgen_namelines and calls the functions of the header. The comment of the header: keep it equal to the#[no_mangle]block ofplanner/service/src/native.rs.companion-ios/PlannerNative/RoutingInstaller.swift(new;project.ymllists it besideRouteProvider.swift):OfflineRoutingover the two calls. Each call runs on one serialDispatchQueue(QoS utility) and returns through a checked continuation insidewithTaskCancellationHandler, so no blocking call runs on the cooperative pool. The progress context is anUnmanagedbox that holds an atomic flag and the Swift progress closure; the cancellation handler sets the flag. The callback runs on a Rust worker thread, which has no current task, so it never readsTask.isCancelled: it returns the inverse of the flag and passes the counts on.LocalFirstPlanner.swift:Openbecomes(OfflineMap, URL, URL): the release folder andstore.routing(map). The cached source goes when the set of map IDs changes, so a route after an install or a removal opens a new reader, as Route package format 10: the contract, the writer and the installer #3301 rule 4 asks; a route that runs during a removal keeps its mapped files (Route engine: the data layer on format 10 and the host interface #3302) or getsmissing_regionand goes online. The type comment: the maps of one routing package share one install; each route uses the install of the first map that holds its points.OBCCompanion/OfflinePlanner.swift:open(map:directory:routing:),RouteProvider(directory: routing),offline.format4, nosource_routing.OBCCompanionApp.swift: the store getsRoutingInstaller().tools/planner_grid_offline.py:sharedandassetsof the catalog also holdrouting/package.jsonandrouting/directory.binof the index of kindrouting-cells. The packs of a cell come from its bounds.routing_source,routingandrouting_packsgo.tools/planner_grid_index.py: the routing cell check and the descriptors incomposego (#L67-L73).tools/planner_grid.py:ranges,table,mergeandroutinggo.tools/planner_runtime.py:INDEX_FORMAT = 5;planner/search/installation.mjs:GRID = 5;host/obc-data-steps/src/planner.rs:PLANNER_INDEXformat 5.host/obc-data-steps/tests/planner_build.rs: the bundle assertsrouting/package.jsonandrouting/directory.binand norouting/packs/, and the loop over the cell entries readsfilesandpacksonly.tools/planner_downloads.py,quote: no routing selection. The selected release hasregionarea-plus the first 24 hex digits of the ID,routing_packagethe SHA-256 of therouting/directory.binentry, the TileJSON bounds of the requested cells,terrain_boundsof them, andofflinewithformat: 4,id,zoomandcells(nosource_routing). The selection format of the ID is 7.GET /cataloganswersformat: 2, so an app of today refuses before a download.specs/planner-offline.md:- Versions:
offline/catalog.jsonandoffline/cells/CELL.jsonformat: 5, service catalogformat: 2, selected releaseoffline.format: 4, selection format 7. - Grid publication: the routing of an area is the rule of step 1, with a link to the route package; the catalog
sharedholds the two routing files; the cell file losesroutingandrouting_packs, the catalogrouting_source; the packs of a cell come from its bounds. - Selected release:
routing_packageis the identity of the directory; norouting/blocks.json; the TileJSON and terrain bounds are those of the cells. - Download service:
objects/SHA256also gives each cell object of the release, by a 307 to the pool. - iOS library:
routing/<directory>/is an install of the route package with the union of the areas of the maps of that package; the store calls the installer after each change ofmaps.json; routing objects stay inobjects/only until their install; amaps.jsonentry hasrouting. "Routing graphs are not combined" goes. The known difference: a long road of a download cell that the area does not install is no candidate, where the server can snap to it (Route package format 10: the contract, the writer and the installer #3301 rule 2).
planner/service/README.md, phone library: the two calls, and the budget of the open as the search limit.companion-ios/PlannerNative/README.md: one sentence onRoutingInstaller.
- Versions:
Files
planner/router/src/install.rs: change:area_cells.planner/service/src/native.rs: change: the open on format 10, plan, install, the test.planner/router-build/tests/cells.rs: change: the area test.companion-ios/Packages/OBCKit/Sources/OBCPlanner/OfflineMap.swift,OfflineMapStore.swift,LocalFirstPlanner.swift: change.companion-ios/Packages/OBCKit/Tests/OBCPlannerTests/OfflineMapsTests.swift: change: the fake installer, the new test.companion-ios/PlannerNative/RoutingInstaller.swift,PlannerNative.h,BridgingHeader.h: create.RouteProvider.swift,README.md,companion-ios/project.yml,OBCCompanion/OfflinePlanner.swift,OBCCompanion/OBCCompanionApp.swift: change.tools/planner_downloads.py,planner_grid.py,planner_grid_offline.py,planner_grid_index.py,planner_runtime.py,tools/tests/test_planner_downloads.py,test_planner_grid_offline.py,test_planner_grid_index.py: change.planner/search/installation.mjs,host/obc-data-steps/src/planner.rs,host/obc-data-steps/tests/planner_build.rs: change: format 5; the bundle assertions.specs/planner-offline.md,planner/service/README.md: change.
Done when
- New tests:
planner/router-build/tests/cells.rs,an_area_holds_the_cells_of_each_snap_window_in_it: on Route package format 10: the contract, the writer and the installer #3301's test graph with three download cells, for a grid of points inside an area that touches two cells, among them points on its edges and corners, each download cell whose box meetssnap::window(point, REACH_M)is inarea_cells; a cell whose box starts 50 microdegrees beyond the grown edge is not.native.rs,areas_of_one_package_share_an_install_and_the_last_one_takes_it, through the C functions: plan and install area A, then A and B; a route in A answers 200 withpackagethe directory hash; with a callback that stops at once, the install returns false, and the next call completes; after an install of A alone, a route with a point only in B answers 422missing_region, and B's cell files are gone; an install with no area deletes the folder.OfflineMapsTests.swift,mapsOfOnePackageInstallTheirUnionAndTheLastRemovalDeletesIt: a fakeOfflineRoutingrecords the areas of each call; two maps of one package give the union, the removal of one gives the other area, the removal of the last gives an empty list;maps.jsonlists a map only after its install call; no routing object stays inobjects/after an install.- The Python tests change only where the routing selection is gone, and
test_a_selection_carries_the_routing_directory_and_no_routing_packchecks the two files,routing_packageand the absentrouting/blocks.json.
obc test -p obc-data-stepsin CI (it needs GEOS).obc test -p planner-router,-p planner-router-build,-p planner-service, andobc exec cargo clippy -p <crate> --all-targets -- -D warningsfor each, forplanner-servicealso with--no-default-features.cargo fmt --all.obc test affected --base origin/routing-overlay(it runspython.repository-tools).obc suites check,obc prose --check,python3 docs/build_docs.py --check-links.swift.obckit-hostand the Debug and Release simulator builds run only in CI, on macOS; the pull request says that the builder did not run them locally, and showsPlannerNative.hbeside the#[no_mangle]block ofnative.rs.- The pull request records, on the owner's PC under
nice, for the Central Switzerland target afterobc data update localon the branch: for each zoom-9 tile of the target and for the whole bounds, the own roads, the download cells and the download level, and the routing bytes downloaded and installed with format 9 (the bundle of the branch base) and with format 10 (a plan with an empty target, from a program that is not committed), beside the table above. When a one-tile area installs more than 3 times the bytes of today, the pull request says so to the owner; Proof on Germany: the bake, the level sizes, the download level, the old engine against the new one #3310 sets the download level. - Owner, on the iPhone 13 with a Debug build and
-OBCPlannerCatalogof a local follower on the branch:- Remove the offline maps of the earlier build first:
maps.jsonhas a new field. - Download two overlapping areas; the sizes match the pull request. In flight mode, route in each area, with alternatives near an edge; remove one area and route in the other again; the storage of the app in Settings shrinks.
- Stop the app during "Installing routes…" and start it again: the download goes on, and the other area still routes.
- Record the memory footprint (Xcode memory report) before and during the longest offline route of the larger area. The footprint grows by less than 100 MB (a design figure: the labels of a worker take less than 10 MB, the epic, and the search limit is 64 MiB, Route engine: the overlay search with the cost tables, and unpacking of the chosen legs only #3305).
- Remove the offline maps of the earlier build first:
- The pull request has
Requirements:(the offline-map and route requirements thatobc reqlists) and says that public docs changed, in adocs:commit.
Out of scope
- The bytes of format 10 and the installer: Route package format 10: the contract, the writer and the installer #3301. The host, the snap,
snap::window,Directory::meetingand the skip of a probe withMissingRegion: Route engine: the data layer on format 10 and the host interface #3302.openand the search: Route engine: the road search on format 10, and the test of the old engine against the new one #3303. The tables: Routing bake: the cost tables of each profile for each cell #3304. The overlay search: Route engine: the overlay search with the cost tables, and unpacking of the chosen legs only #3305. - The download level and the level sizes: Proof on Germany: the bake, the level sizes, the download level, the old engine against the new one #3310. The deletion of the format 9 writers: Format 10 becomes the only format: delete the old engine and format 9, merge routing-overlay into develop #3311.
- A route over two areas whose bounds do not hold all its points, an update button for an area, and deltas between releases.
Built differently
Pull request #3472 built this design, into routing-overlay, with these changes:
- The routing installs before the release folder is linked (Plan step 4 said after). The install reads the objects from
objects/. The link ofreleases/ID/and the write ofmaps.jsonthen follow with no suspension between them, so a stopped or killed install leaves no release folder. The map is still visible only after its routing is complete. - A discard of a pending download cleans the routing. It installs the areas of the listed maps of that package again, from the copies of
package.jsonanddirectory.binin the install folder. With no listed map of the package it deletes the folder. - The download of the routing objects is by SHA-256, each once. Two parts with equal bytes are one object. The space estimate counts each part, and for a new package the copies of
package.jsonanddirectory.bin. - A removal completes when the routing of the other maps of the package cannot be installed again because an object is missing (the app was killed in the middle of an earlier removal). The folder stays for those maps. The full repair needs a download in the removal; it is not built.
install::area_cellsreturns aResult. Thefetchof the installer returns a reader of the new traitinstall::Object, so the phone counts the progress;install::removedeletes a folder under its lock. An install that the lock of another process blocks answers503 busy. The plan has one entry for each missing part file. The stop flag of the Swift installer is anOSAllocatedUnfairLock<Bool>, because the app targets iOS 17.OfflineFileis public and has an optionalpart_bytes.- The preparation of a download fetches
package.jsonanddirectory.binon any network, before the user allows mobile data, as the Plan says. The contract states it. For a world package the directory has about 3 to 19.5 MB; the owner decides whether this fetch waits for the consent. - Measured on the Switzerland bake of
routing-overlayat67320e4(download level 4, 18 download cells of about 430,000 roads), a plan with an empty target, download and installed bytes: the Uri tile 166 and 276 MB, the Valais tile 151 and 248 MB, the Zurich tile 297 and 528 MB, a block of 3 × 3 tiles in the Alps 335 and 581 MB, the whole bounds 593 and 1,055 MB. A one-tile area installs more than 3 times the bytes of format 9 (27 to 85 MB in the Alps, 170 to 250 MB around a city, the figures of this issue). A tile takes 4 to 10 download cells at level 4, so the download level of Proof on Germany: the bake, the level sizes, the download level, the old engine against the new one #3310 decides this: on Switzerland, the table of Proof on Germany: the bake, the level sizes, the download level, the old engine against the new one #3310 gives a median overhead of 3.5 at level 3 against 12.8 at level 4. - Not run: the Swift suites and the simulator builds on a local machine (CI on macOS ran them). The comparison with format 9 on the Central Switzerland target and the four iPhone steps are with the owner; the commands are under "Owner steps" in the pull request.
Activity
Phone library: planner_routing_plan and planner_routing_install over …
Phone: the offline areas of one routing package share one install (#3309
Offline publication: the bundle carries the route package directory, …
Phone library: the README names the routing calls and the search limit (
docs: the offline area installs whole cells of the route package (#3309…
Phone store: the routing installs before the release folder links; a …
docs: the preparation fetches the route package directory on any netw…
Phone store: a removal goes on only for missing objects; a discard de…
docs: the contract keeps the rule of the preparation fetch without si…