Repository navigation
feat(obc-data): landmark and peak content read the wiki shards (P6-3b) - #2701
timohueser wants to merge 23 commits into
Conversation
- `device/landmark-content` and `device/peak-content` read `wiki` at the version that the target reads: `common.tar.zst` and the shards of the 2^20 µdeg cells that the region polygon touches, as its manifest lists them. Without a version, the content layers block with the prepare Fix, and the catalog and planner/search with them. - obc-pack unpacks the shards (tar under zstd) into the view. A fact that the version lacks is no content; the step metrics count it by kind (`absent`). - The content layers publish nothing: the `shared-content` bundles had no reader once the facts live on the target as `wiki`. - Deleted: the Wikimedia capture fetcher and its run-journal field, the regional capture selection, the legacy capture read, gc's resumable capture work, the HTTP counters and rate limit that only it used, and `tools/wikimedia_acquire.py` and `tools/wikimedia_adopt.py` with their tests. The wikidata, wikipedia and commons rows stay, without a fetcher, as the named inputs of `wiki`. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MdLzBWpdcQRZLATaT7poQZ
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MdLzBWpdcQRZLATaT7poQZ
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: true
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 |
- In the producer, a fact that the export lacks is a fault: the round-2 compile refuses it, so it gets the per-subject retry, the count and the majority stop. A castle without facts counts as a failed compile again. - The reader's content step names its absent facts in the run log. - A region whose `wiki` version lists no shard of it blocks: a snapshot input without files reads every file of the version. - `Client::sorted` is public, for the release that a test declares. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MdLzBWpdcQRZLATaT7poQZ
…mpile The summits take the link tags that `subjects` kept, so the export has a link fact of each. Round 2 no longer drops a summit without a linked identity: its compile counts the absent link and refuses it, so a regression of the peak links feeds the failure count and the majority stop. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MdLzBWpdcQRZLATaT7poQZ
…o or a fault A summit compiles in round 2 when it links an asked identity, or when it has a link tag and no identity, so that an absent link fact still fails its compile. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MdLzBWpdcQRZLATaT7poQZ
…mmits Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MdLzBWpdcQRZLATaT7poQZ
…wiki-readers The DACH bake reads the first wiki version, which #2703 prepared, with these readers. Conflicts: - fetch/http.rs: keep the bearer origin, `headers` and `post_json` of #2703; drop the rate limit, the counters and `limited` as #2701 does. The download loop counts `received` again: the size check and the progress line of #2703 read it. - device.rs: keep the `prepared` test helper of #2701, with the new `languages` field of the manifest. The test manifests of planner_build and cells_fixture get it too. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Merged Conflicts, in
Checks after the merge: 🤖 Generated with Claude Code |
…2-p6-wiki-readers
…2-p6-wiki-readers
… per item A round-2 compile reads the facts of the whole chunk, so one failing subject cost a compile of each of the 500 subjects alone: about 35 min a chunk in the DACH prepare. The chunk now compiles its halves, down to single subjects. One failing subject of 500 costs 19 compiles. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The rounds of a resume compiled no round again, also after an import read its input again. In the DACH prepare, round 1 ran without the 5,962 articles that the newer-Parsoid proof rejected. After the fix, round 2 wanted Commons metadata of their lead images, which round 1 had never asked for, and each such subject failed. `tools.wiki articles` now writes `work/imports.json`, the finished imports with their inputs and revisions. `rounds.json` keeps its digest: when it changes, the requests and failures of the rounds go and the rounds start again. Commons keeps its answers, so only new requests go out. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ki-readers # Conflicts: # host/obc-data/src/cli/update_cli.rs
… index `read_pinned` found each source by a scan of all of them. A view of a region listed about 2.2 million sources, and the compiler reads each of its classes, so the compile of DACH did not end in hours. `Sources` keeps the list with an index by path; the scans of a source by path in the asset and peak compilers use it too. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The landmark content step of DACH used about 22 GB of memory and swap and did not end: the view read the 1.28 million facts of the `wiki` shards into memory, found subjects and assets by scans of all facts, copied every fact into the view (each entity three times), and wrote and read back a 419 MB manifest. - `Facts` reads each fact file once to index it by kind and key, with the identity, URL and asset of each, and keeps no fact in memory: `get` reads one from its file. - The view holds only what its places reach: the facts that a place names, the P279 closure of the P31 types of the places as classes, and the P131 closure of their P131 and P17 places as locales. The compilers read no other fact, so the content is the same. - Fact files are hard links in the view, with a copy where the file system cannot link, and the manifest is written once, streamed. On the DACH export of `wiki@2026-10-13` (1,283,599 facts, 428,142 candidates): view and compile took 4 min 39 s and 10 s instead of 6 min 20 s and 6 min 14 s with the index alone, with a peak of 2.1 GB instead of 10.8 GB. The content of both is the same but for its `input_sha256`: 1,452 records and 430,244 omissions. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Part of #2648. Part of #2654.
Draft until the owner publishes the first
wikiversion to prod. Without a version ofwiki, the landmark and peak content blocks on every target, so this merges only after prod lists one. The branch is based on develop after #2699 (merged as 1d4b111), so the diff holds only P6-3b.Problem
The landmark and peak content of a region still asks Wikimedia itself: it captures facts by exact identity through
tools/wikimedia_acquire.pyand keeps them in the store. The prepared sourcewiki(#2695, #2699) now holds those facts for every OSM subject, in geographic shards on the target.Behavior
device/landmark-content[/<area>]anddevice/peak-content[/<area>]readwikiat the version that the target reads (prepared::resolve):common.tar.zstplus the shards of the 2^20 µdeg cells that the region polygon touches, kept only when the manifest lists them.Coverage::cells(20)already gives the cells that the.polytouches (boundary or centre inside), so this costs 3 lines..polyinputs stay. planner/search reads the content steps, as before.{landmark,peak}_contentunpack the shards (tar under zstd; addstar0.4.46, MIT OR Apache-2.0;zstdwas in the lockfile already) into the view, then run the views and the compile as before.shared::view,landmark_viewandpeak_viewtake a fact that the version lacks as no content and count it, instead of failing. The step writes{"absent": {"article": n, "category": n, "commons": n, "entity": n, "link": n}}to its metrics, so the receipt shows it, and prints one line with the counts to the run log. A fact with the statusmissingstays a confirmed outcome and is not counted. This also covers OSM identities newer than the version, and it never blocks the bake.photo_compile_failurescount and the majority stop. The summits take the link tags thatsubjectskept, so the export has a link fact of each;subjectskeeps only linked subjects, so round 2 compiles every summit, and one whose link fact is absent fails its compile instead of being dropped.wiki. Fix: Runobc data source prepare wiki." The device catalog (it needs every article layer) and planner/search block with them; the maps and the terrain still bake. A version whose manifest lists no shard of the area blocks them too: a snapshot input without files would read every file of the version.wiki 2026-10-01 (…) → 2026-11-01 (…); planner/search, device/catalog, planner/places and planner/index follow. No map, terrain or routing layer is stale.wikidata,wikipediaandcommonsstay indata/sources.tomlas the named inputs ofwiki, without a fetcher: a fetch of one fails with "sourcewikidatais read throughwiki". A target keeps no copy of them.Deleted
host/obc-data/src/fetch/wikimedia.rs(778 lines); the Wikimedia arm andlegacyinfetch/capture.rs; theAcquisitionplumbing and theacquisitionfield of the run journal; the Wikimedia special case incli/listing.rs.Http::fresh_download, the request and byte counters, and the rate limit: only the Wikimedia fetcher used them.partial/wikimedia-*work.host/obc-data-steps/src/device/shared_content.rs(253 lines) andcaptures_at.CAPTURES, the capture filter ofcontent_view,shared_files, andshared::bundleswith its test.tools/wikimedia_acquire.py(536),tools/wikimedia_adopt.py(195) and their tests (475).landmark_capture.pystays until P8 (obc-bake,peak_capture.py);discover::candidatesandpeaks::discoverstay for obc-bake.Decisions to check
shared-content/bundles so that another machine could restore the facts. Withwikion the target, the bundles had no reader, andbundles()would only write an empty folder. The content steps areClient::None; planner/search keeps its exemption in the "client files" rule, because a machine without the content compiles it again from thewikishards on the target.common.tar.zst. Every regional bake downloads all of it: the classes and every subject without a box or with a box over more than 16 cells. Its size is known only after the first version. If it is large, splitting it is a later change.publish_text = false, devices get no landmarks. Landmarks require article text, so such a version gives only peaks. That is the owner's Q2.Before merge
wikiversion, measure the memory, disk and time of one region content step. Each step unpacks all ofcommon.tar.zst, parses every fact, and copies every fact into the view (the entities three times: classes, locales, entities), twice per area. If that is large, makeviewcopy only the facts that the chosen subjects reach.Spec sections updated
specs/obc-data.md: the opening reference to the content source; theredistributerow; the capture table (the Wikimedia row and thecontentbullet removed; the three rows have no fetcher); thedevice/landmark-content/device/peak-contentrow (inputs, outputs, metrics, no client); the paragraph after the device table (shards, absent facts, no version, no shard of the area); the run journal schema (acquisitionremoved).specs/wikimedia-content.md: the introduction; the producer/reader seam in place of the Store seam; "Acquisition adapter bytes" becomes "Compact facts" without the adapter's request, input and output formats,--adoptand exit status; the rounds sentence; Store retention andshared-contentbundles replaced by one paragraph on versions on the target; the transfer metrics of the fetcher removed.Public docs
Changed, in its own
docs:commit:docs/content/software/data.md, "Shared landmark and peak content".host/obc-data/README.mdusesgeofabrik-extractsin the--refreshexample.Size
git diff --shortstat origin/develop...HEAD: 30 files changed, 575 insertions(+), 2,864 deletions(−). The review rounds add +67/−30 and +31/−23 (the last two rounds cancel out).Cargo.lock.wikiversion (device, planner, cells, planner_build).Checks
All obc-data and obc-data-steps builds and tests ran under
flock /home/user/cargo-target/obc-data.lockwith debug=0, at c843b9b; at the head,obc test -p obc-data-steps(33 passed), its clippy and fmt ran again.obc test -p obc-data: 181 passed, 1 skipped. The spec's run schema was regenerated withOBC_UPDATE_DATA_SPEC=1in the first round.obc test -p obc-data-steps: 33 passed.obc test fixtures -p obc-data-steps: passed (cells_fixture,terrain_fixture,planner_build).planner_buildneedsbuilder/web/node_modules; I linked one from another checkout for the run and removed it after. New and changed tests:content_reads_the_extract_the_poly_and_the_wiki_shards_of_its_cells: the region readscommon.tar.zstand its own cell, not the far cell of the manifest; no step readswikidata,wikipediaorcommons; without a version, and with a version that lists no shard of the region, the content layers block, and the catalog with them.a_new_wiki_version_stales_the_landmarks_and_the_search: device + planner steps; the stale layers are exactly device/landmarks (thewikicause), planner/search, device/catalog, planner/places and planner/index.planner_buildreads a real, empty common shard.a_leaf_plans_from_the_manifest_of_a_model…still checks that no step reads adtm-*source.obc test -p obc-pack: 95 passed;obc test fixtures -p obc-pack: passed (first round). New:a_fact_that_the_version_lacks_is_no_content_and_is_counted(landmark: entity, article, category, Commons; peak: link; the summit stays an OSM summit). The content step test unpacks a real shard and checks the metrics.tools.tests.test_wiki,tools.tests.test_data_registry: 18 OK.cargo clippy -p obc-data -p obc-data-steps -p obc-pack -p obc-bake --all-targets --features obc-data-steps/external-fixtures -- -D warnings: clean.cargo fmt --all -- --check,obc prose --check,obc suites check,tools/check_data_sources.py,tools/check_obc_data_licence.py,firmware/tools/check_dependencies.py,tools/licenses/gen-third-party.sh --check(THIRD-PARTY.md is current),python3 docs/build_docs.py --check-links: OK.Manifestis still built in three places (device.rsunit tests,cells_fixture.rs,planner_build.rs). The unit tests of the lib and the integration tests are separate crates, so one helper would need a new public function or a shared test module.cargo deny(not installed here) and the rest ofobc test affected.Cargo.lockchanged, so CI selects the whole workspace.obc req. This machine has no agent token.Requirements: none
🤖 Generated with Claude Code
https://claude.ai/code/session_01MdLzBWpdcQRZLATaT7poQZ
Generated by Claude Code
Generated by Claude Code