You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Goal: The road graph of the bake is a set of flat columns. A road then needs no heap objects of its own, and #3241 can move the roads into files. Problem:Graph.roads is a Vec<model::Road>: 64 B per road, plus one heap shape per road at 12 B per point, and freed import objects fragment the heap around these shapes. Decision:Graph.roads becomes Roads: one column per field of model::Road and one list of shape points per road. The cost code keeps taking &Road: Roads::get fills a reused Road. Rejected: one shape for both directions of a road. It needs more API, for little gain once the tables live on disk. Systems: routing Contracts: none Size: M (one system, about 500 changed lines)
Plan
lib.rs: Graph.roads becomes Roads, with a Column for each field of model::Road and Lists<Point> for the shapes. Roads::push(Road) appends a road. Roads::get(i, &mut Road) fills a reused road. Roads::len() counts them. Accessors (from, to, way) serve the loops that read one field.
The code that indexes graph.roads reads through Roads: lib.rs (prepare), base.rs (edges), cost.rs, landmarks.rs, connectivity.rs, layout.rs, terrain.rs, and osm.rs (emit_run, the turn restrictions).
prepare writes each geometry page from up to ROADS_PER_PAGE roads that it reads into one reused Vec<Road>. geometry::encode does not change.
layout::spatial_order sorts a permutation, then writes new columns in that order. It no longer swaps road structs.
terrain::apply writes the heights into the shape list and the climb into its columns.
The tests that build a Graph push their roads: tests/routing.rs, planner/service/tests/http.rs and the unit tests.
Done when
obc test -p planner-router-build, obc test -p planner-service and clippy on both crates pass.
A Switzerland bake gives the same manifest ID as before.
The pull request records the live memory after the Switzerland import, before and after.
Activity