Repository navigation
perf(bake): one device/map step per leaf ingests the OSM once and cuts every band - #2744
Merged
Merged
Conversation
…s every band The step `device/map/<i>-<j>` replaces `device/coarse|mid|fine|network/<i>-<j>`. It decodes the OSM of the leaf once and calls `cut_ingested` three times: the network band, then coarse and mid with one semantic ladder, then fine. It drops the routable ways after the network band and adds land and contours once. `cut_ingested` is level-outer. It prepares one level set, cuts and encodes it for every cell of the band, keeps the encoded bytes and drops the set. A merged set stays in the memo until the last level that reads it. `serialize_lods_streaming` takes encoded levels. The step lists the empty cells of each band in `cells/<band>/empty.json`, as the spec states. The catalog reads `metadata/` only from terrain layers. The band steps of `obc-draw` and `obc-network` are deleted, with `Job` and `SourceFiles` of `obc-map-core`. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configuration
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
…ns every band The level-outer cutter appended each cell's encoded levels to memory until the band was written. The fine band of a leaf writes up to about 3 GB (726 MB for the 115 fine cells of 0037-0032 in the DACH run), so each cell now appends its level to a spill file below `.levels/` and reads it back when the cell is written. `cells_fixture` runs the real step for all four bands and asserts the SHA-256 of each cell as the band steps of d0c0650 wrote it. The malformed-network stand-in copies the built cells, so the leaf is cut once. A band with no cells is an error: the cutter reads an empty selection as every cell of the leaf. The spec names `metadata/` for the empty list and credits of terrain, as the code writes them, and the `network` list of `device/map` for the landmarks. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…er-d30971 # Conflicts: # host/obc-data-steps/src/device.rs # host/obc-data-steps/tests/cells_fixture.rs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
One step
device/map/<i>-<j>replaces the four band stepsdevice/coarse|mid|fine|network/<i>-<j>of a leaf. The step decodes the OSM of the leaf once and cuts every band withobc_bake::cut::cut_ingested, the cutter that is already the byte oracle of the cells. The function isobc-bake/mapinhost/obc-data-steps/src/functions.rs.cut_ingestedprepares one level set, cuts and encodes it for every cell of the band in parallel, and drops the set before the next level. A merged set stays in the memo until the last level that reads it. Each cell appends its encoded level to a spill file below<out>/.levels/. It reads the file back when the cell is written, and a successful cut removes the directory. Before, a band kept all its level sets until the last cell: that is the fine-band peak that killeddevice/fine/0037-0033.serialize_lods_streamingtakes encoded levels (obc_draw::serialize::Region). The monolithic pipeline encodes each tree in its closure, so it still holds one tree at a time.obc-draw/src/step.rsandobc-network/src/step.rs.JobandSourceFilesmoved fromobc-map-coreinto the newobc-bake/src/step.rs.obc-networkno longer depends onobc-data, andobc-data-stepsno longer depends onobc-draworobc-network.cells/<band>/empty.json, as the spec states, and nometadata/. The catalog rewritesmetadata/only for terrain layers. A band with no cells is an error, because the cutter reads an empty selection as every cell of the leaf.The options of the step are
leaf,cells(one list per band, in band-table order) andpartial_cells(one list for all bands: partial coverage depends on the square only).A stop needs no check in the step: since #2743, a stop sends SIGTERM to the process group of the step.
Evidence
Bytes
cells_fixtureruns the real step on all four bands of the fixture leaf (Grimsel, realcells.osm.pbf, land, GLO-30 terrain,builder/presets/schema.json). It asserts the SHA-256 of each cell as the four band steps ofd0c0650c2wrote it:0300/0264102e30645708264e…0600/0528eb0668a70925b83d…1201/1056eb62f326018cb804…1201/105633bc91069aac63b0…Fine and network are also compared with one
cutof the leaf. The cells of thecell_cutfixture (cut_ingested, three test bands) are identical before and after.Peak memory on the fixture leaf
Each step ran alone in a fresh test process (debug,
nice -n 19): the build recorded the request of each map step, and a replay ran it and readVmHWM. The process starts at 15 MB.d0c0650c2device/coarsed0c0650c2device/midd0c0650c2device/fined0c0650c2device/networkdevice/map(all four bands)On this leaf the semantic ladder sets the peak, in old mid and in the new step alike. The leaf has one small cell per band, so it does not show the fine-set peak, and the drawing features that the network phase now holds beside the ways are small here.
Size of the encoded bands in the DACH run
The receipts of run
2026-10-17-071235give the bytes that the spill now keeps on disk:device/fine/0037-0033has no receipt (it was killed). At the density of 0037-0032 its ~420 fine cells write about 3 GB. In memory, that would sit beside the features, land and contours, so the cutter spills it. With the spill, a worker holds one cell's levels while it writes the cell (the largest cell is 14 MB).Not measured: the peak of a real leaf. No real bake ran (shared PC).
Tests
cells_fixtureis the byte-equality test (the table above). It now cuts the leaf once: the malformed-network stand-in copies the built cells and truncates one. It takes about 5 min in debug, because coarse and mid build the whole-leaf semantic ladder.obc-bakestep::tests: a partial empty cell keeps its bytes, and a covered empty cell is only incells/<band>/empty.json.Checks run on the branch merged with develop (after #2743 and #2745), against this worktree's own target:
cargo nextest runfor obc-map-core, obc-draw, obc-network, obc-pack, obc-bake, obc-data and obc-data-steps withexternal-fixtures(717 of 718 pass), doctests of obc-bake and obc-data-steps,cargo clippy --all-targets -D warningson those seven crates,cargo fmt --all --check,obc suites check.Not passing locally:
planner_buildstops atCannot find module '@mapbox/vector-tile', because this worktree has nobuilder/webnode modules. This change does not touch the planner build.Public docs: unchanged. The contract
specs/obc-data.mdchanges with the code: thedevice/maprow and step list, where a map layer lists its empty cells, themetadata/files of the terrain row (as the code writes them), and thenetworklist that the landmarks read.Note for the first bake after merge: no
device/mapstep has a receipt of its own name yet. The admission rule of #2743 reads receipts of the same layer, and the old band receipts satisfy it.Requirements: none
🤖 Generated with Claude Code